Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GF radar reflectivity update for RRFS realtime runs #103

Merged
merged 4 commits into from
Oct 3, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,&
& imp_physics_mg, iovr, iovr_rand, iovr_maxrand, iovr_max, &
& iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, &
& idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, &
& imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_gf, do_mynnedmf, &
& imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, &
& lgfdlmprad, &
& uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, &
& effrl, effri, effrr, effrs, effr_in, &
Expand Down
16 changes: 10 additions & 6 deletions physics/cu_c3_deep.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2078,9 +2078,9 @@ subroutine cu_c3_deep_run( &

!> - Call rain_evap_below_cloudbase() to calculate evaporation below cloud base

call rain_evap_below_cloudbase(itf,ktf,its,ite, &
kts,kte,ierr,kbcon,xmb,psur,xland,qo_cup, &
po_cup,qes_cup,pwavo,edto,pwevo,pre,outt,outq) !,outbuoy)
! call rain_evap_below_cloudbase(itf,ktf,its,ite, &
! kts,kte,ierr,kbcon,xmb,psur,xland,qo_cup, &
! po_cup,qes_cup,pwavo,edto,pwevo,pre,outt,outq) !,outbuoy)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to just remove these lines.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest we keep this just in case we need to tune with subcloud evaporation in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've been recommending that folks remove code rather than comment it out because folks often forget why they left commented code in and it makes the code harder to read in the long run. Git saves the history, so one can always go back to a commit before this PR and put these lines back in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will remove these commented lines.

k=1
!$acc kernels
Expand Down Expand Up @@ -2137,7 +2137,7 @@ subroutine cu_c3_deep_run( &
do k = ktop(i), 1, -1
rain = pwo(i,k) + edto(i) * pwdo(i,k)
rn(i) = rn(i) + rain * xmb(i) * .001 * dtime
!if(po(i,k).gt.400.)then
if(k.gt.jmin(i))then
if(flg(i))then
q1=qo(i,k)+(outq(i,k))*dtime
t1=tn(i,k)+(outt(i,k))*dtime
Expand All @@ -2162,7 +2162,7 @@ subroutine cu_c3_deep_run( &
pre(i)=max(pre(i),0.)
delqev(i) = delqev(i) + .001*dp*qevap(i)/g
endif
!endif ! 400mb
endif
endif
enddo
! pre(i)=1000.*rn(i)/dtime
Expand Down Expand Up @@ -4429,7 +4429,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, &
!
!now do the rest
!
kklev(i)=maxloc(zu(i,:),1)
kklev(i)=maxloc(zu(i,2:ktop(i)),1)
!$acc loop seq
do k=kbcon(i)+1,ktop(i)
if(t(i,k) > 273.16) then
Expand Down Expand Up @@ -4489,6 +4489,10 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, &
endif
if(k.gt.kbcon(i)+1)c1d(i,k)=clwdet*up_massdetr(i,k-1)
if(k.gt.kbcon(i)+1)c1d_b(i,k)=clwdet*up_massdetr(i,k-1)
!if(is_deep.and.k.gt.kklev(i))then
c1d(i,k)=0.005
c1d_b(i,k)=0.005
!endif

grantfirl marked this conversation as resolved.
Show resolved Hide resolved
if(autoconv.eq.2) then
!
Expand Down
4 changes: 2 additions & 2 deletions physics/cu_c3_driver.F90
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,&
!
!> - Set tuning constants for radiation coupling
!
tun_rad_shall(:)=.01
tun_rad_mid(:)=.3 !.02
tun_rad_shall(:)=.012
tun_rad_mid(:)=.15 !.02
tun_rad_deep(:)=.3 !.065
edt(:)=0.
edtm(:)=0.
Expand Down
10 changes: 6 additions & 4 deletions physics/cu_c3_sh.F90
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module cu_c3_sh
use progsigma, only : progsigma_calc

!real(kind=kind_phys), parameter:: c1_shal=0.0015! .0005
real(kind=kind_phys), parameter:: c1_shal=0. !0.005! .0005
real(kind=kind_phys), parameter:: g =9.81
real(kind=kind_phys), parameter:: cp =1004.
real(kind=kind_phys), parameter:: xlv=2.5e6
real(kind=kind_phys), parameter:: r_v=461.
real(kind=kind_phys), parameter:: c0_shal=.001
real(kind=kind_phys) :: c0_shal=.004
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
real(kind=kind_phys) :: c1_shal=0. !0.005! .0005
real(kind=kind_phys), parameter:: fluxtune=1.5

contains
Expand Down Expand Up @@ -274,6 +274,8 @@ subroutine cu_c3_sh_run ( &
ktopx(i)=0
if(xland(i).gt.1.5 .or. xland(i).lt.0.5)then
xland1(i)=0
c0_shal=.001
c1_shal=.001
! ierr(i)=100
endif
pre(i)=0.
Expand Down Expand Up @@ -669,11 +671,11 @@ subroutine cu_c3_sh_run ( &
if(qco(i,k)>=trash ) then
dz=z_cup(i,k)-z_cup(i,k-1)
! cloud liquid water
c1d(i,k)=.02*up_massdetr(i,k-1)
c1d(i,k)=c1_shal! 0. !.02*up_massdetr(i,k-1)
qrco(i,k)= (qco(i,k)-trash)/(1.+(c0_shal+c1d(i,k))*dz)
if(qrco(i,k).lt.0.)then ! hli new test 02/12/19
qrco(i,k)=0.
c1d(i,k)=0.
!c1d(i,k)=0.
endif
pwo(i,k)=c0_shal*dz*qrco(i,k)*zuo(i,k)
clw_all(i,k)=qco(i,k)-trash !LB total cloud before rain and detrain
Expand Down
11 changes: 6 additions & 5 deletions physics/cu_gf_driver_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,21 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m
conv_act_m(i)=0.0
endif
! reflectivity parameterization for parameterized convection (reference:Unipost MDLFLD.f)
if(sqrt(garea(i)).lt.6500.)then
!if(sqrt(garea(i)).lt.6500.)then
ze = 0.0
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
ze_conv = 0.0
dbz_sum = 0.0
cuprate = raincv(i) * 3600.0 / dt ! cu precip rate (mm/h)
ze_conv = 300.0 * cuprate**1.4
if (maxupmf(i).gt.0.05) then
cuprate = max(0.1,1.e3*raincv(i) * 3600.0 / dt) ! cu precip rate (mm/h)
if(cuprate .lt. 0.05) cuprate=0.
ze_conv = 300.0 * cuprate**1.5
if (maxupmf(i).gt.0.1 .and. cuprate.gt.0.) then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not cuprate always >0 after adjustment? Any reason to change cuprate and add the condition of cuprate>0?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is not cuprate always >0 after adjustment? Any reason to change cuprate and add the condition of cuprate>0?

In line 73, If the convective precipitation rate is very weak (<0.05 mm/h), the cuprate is reset to 0. Thus in the if condition of line 75, we exclude the case with weak convective updraft and weak convective precipitation.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is in line 72, cuprate will be always >0.1 mm/h.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching that. Yes, we have duplicated safeguards. I will update line 72 just as "cuprate = 1.e3*raincv(i) * 3600.0 / dt" in this PR soon.

do k = 1, km
ze = 10._kind_phys ** (0.1 * refl_10cm(i,k))
dbz_sum = max(dbzmin, 10.0 * log10(ze + ze_conv))
refl_10cm(i,k) = dbz_sum
enddo
endif
endif
!endif
enddo
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
!$acc end kernels

Expand Down
32 changes: 11 additions & 21 deletions physics/smoke_dust/dust_data_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,10 @@ module dust_data_mod
! Never used:
! real(kind_phys), parameter :: fengsha_alpha = 0.3
! real(kind_phys), parameter :: fengsha_gamma = 1.3

! -- FENGSHA threshold velocities based on Dale A. Gillette's data
integer, parameter :: fengsha_maxstypes = 13
! real(kind_phys), dimension(fengsha_maxstypes) :: dust_uthres = &
! (/ 0.065, & ! Sand - 1
! 0.20, & ! Loamy Sand - 2
! 0.52, & ! Sandy Loam - 3
! 0.50, & ! Silt Loam - 4
! 0.50, & ! Silt - 5
! 0.60, & ! Loam - 6
! 0.73, & ! Sandy Clay Loam - 7
! 0.73, & ! Silty Clay Loam - 8
! 0.80, & ! Clay Loam - 9
! 0.95, & ! Sandy Clay - 10
! 0.95, & ! Silty Clay - 11
! 1.00, & ! Clay - 12
! 9.999 /) ! Other - 13
! dust_uthres = 0.065, 0.18, 0.27, 0.30, 0.35, 0.38, 0.35, 0.41, 0.41,
! 0.45,0.50,0.45,9999.0

real(kind_phys), dimension(fengsha_maxstypes), parameter :: dust_uthres = &
(/ 0.065, & ! Sand - 1
0.18, & ! Loamy Sand - 2
Expand All @@ -76,12 +62,16 @@ module dust_data_mod
0.50, & ! Silty Clay - 11
0.45, & ! Clay - 12
9999.0 /) ! Other - 13
! -- FENGSHA uses precalculated drag partition from ASCAT. See: Prigent et al. (2012,2015)
integer, parameter :: dust_calcdrag = 1

real(kind_phys) :: dust_alpha = 2.2
! -- FENGSHA uses precalculated drag partition
integer, parameter :: dust_calcdrag = 1
! -- FENGSHA dust moisture parameterization 1:fecan - 2:shao
integer :: dust_moist_opt = 1

real(kind_phys) :: dust_alpha = 1.0
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
real(kind_phys) :: dust_gamma = 1.0

real(kind_phys) :: dust_moist_correction = 1.0
real(kind_phys) :: dust_drylimit_factor = 1.0

! -- sea salt parameters
integer, dimension(nsalt), parameter :: spoint = (/ 1, 2, 2, 2, 2, 2, 3, 3, 3 /) ! 1 Clay, 2 Silt, 3 Sand
Expand All @@ -93,7 +83,7 @@ module dust_data_mod
(/ 1., 0.2, 0.2, 0.2, 0.2, 0.2, 0.333, 0.333, 0.333 /)


! -- soil vagatation parameters
! -- soil vegatation parameters
integer, parameter :: max_soiltyp = 30
real(kind_phys), dimension(max_soiltyp), parameter :: &
maxsmc = (/ 0.421, 0.464, 0.468, 0.434, 0.406, 0.465, &
Expand Down
70 changes: 56 additions & 14 deletions physics/smoke_dust/dust_fengsha_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ subroutine gocart_dust_fengsha_driver(dt, &
REAL(kind_phys), INTENT(IN) :: dt ! time step
REAL(kind_phys), INTENT(IN) :: g ! gravity (m/s**2)



! Local variables
integer :: nmx,i,j,k,imx,jmx,lmx
integer :: ilwi
Expand All @@ -75,6 +77,7 @@ subroutine gocart_dust_fengsha_driver(dt, &
real(kind_phys), DIMENSION (num_emis_dust) :: distribution
real(kind_phys), dimension (3) :: massfrac
real(kind_phys) :: erodtot
real(kind_phys) :: moist_volumetric

! conversion values
conver=1.e-9
Expand Down Expand Up @@ -174,10 +177,13 @@ subroutine gocart_dust_fengsha_driver(dt, &
endif
endif

! soil moisture correction factor
moist_volumetric = dust_moist_correction * smois(i,2,j)

! Call dust emission routine.

call source_dust(imx,jmx, lmx, nmx, dt, tc, ustar, massfrac, &
erodtot, dxy, smois(i,1,j), airden, airmas, bems, g, dust_alpha, dust_gamma, &
erodtot, dxy, moist_volumetric, airden, airmas, bems, g, dust_alpha, dust_gamma, &
R, uthr(i,j))

! convert back to concentration
Expand Down Expand Up @@ -457,10 +463,16 @@ subroutine DustEmissionFENGSHA(slc, clay, sand, silt, &

! Now compute size-dependent total emission flux
! ----------------------------------------------
! Fecan moisture correction
! -------------------------
h = moistureCorrectionFecan(slc, sand, clay, rhop)


if (dust_moist_opt .eq. 1) then

! Fecan moisture correction
! -------------------------
h = moistureCorrectionFecan(slc, sand, clay)
else
! shao soil moisture correction
h = moistureCorrectionShao(slc)
end if
! Adjust threshold
! ----------------
u_thresh = uthrs * h
Expand All @@ -478,15 +490,14 @@ subroutine DustEmissionFENGSHA(slc, clay, sand, silt, &

end subroutine DustEmissionFENGSHA
!-----------------------------------------------------------------
real function soilMoistureConvertVol2Grav(vsoil, sandfrac, rhop)
real function soilMoistureConvertVol2Grav(vsoil, sandfrac)

! !USES:
implicit NONE

! !INPUT PARAMETERS:
REAL(kind_phys), intent(in) :: vsoil ! volumetric soil moisture fraction [1]
REAL(kind_phys), intent(in) :: sandfrac ! fractional sand content [1]
REAL(kind_phys), intent(in) :: rhop ! dry dust density [kg m-3]

! !DESCRIPTION: Convert soil moisture fraction from volumetric to gravimetric.
!
Expand All @@ -500,20 +511,21 @@ real function soilMoistureConvertVol2Grav(vsoil, sandfrac, rhop)

! !CONSTANTS:
REAL(kind_phys), parameter :: rhow = 1000. ! density of water [kg m-3]

REAL(kind_phys), parameter :: rhop = 1700. ! density of dry soil
!EOP
!-------------------------------------------------------------------------
! Begin...

! Saturated volumetric water content (sand-dependent) ! [m3 m-3]
vsat = 0.489 - 0.00126 * ( 100. * sandfrac )
vsat = 0.489 - 0.126 * sandfrac


! Gravimetric soil content
soilMoistureConvertVol2Grav = vsoil * rhow / (rhop * (1. - vsat))
soilMoistureConvertVol2Grav = 100.0 * (vsoil * rhow / rhop / ( 1. - vsat))

end function soilMoistureConvertVol2Grav
!----------------------------------------------------------------
real function moistureCorrectionFecan(slc, sand, clay, rhop)
real function moistureCorrectionFecan(slc, sand, clay)

! !USES:
implicit NONE
Expand All @@ -522,7 +534,6 @@ real function moistureCorrectionFecan(slc, sand, clay, rhop)
REAL(kind_phys), intent(in) :: slc ! liquid water content of top soil layer, volumetric fraction [1]
REAL(kind_phys), intent(in) :: sand ! fractional sand content [1]
REAL(kind_phys), intent(in) :: clay ! fractional clay content [1]
REAL(kind_phys), intent(in) :: rhop ! dry dust density [kg m-3]

! !DESCRIPTION: Compute correction factor to account for Fecal soil moisture
!
Expand All @@ -540,15 +551,46 @@ real function moistureCorrectionFecan(slc, sand, clay, rhop)
! Begin...

! Convert soil moisture from volumetric to gravimetric
grvsoilm = soilMoistureConvertVol2Grav(slc, sand, 2650.)
grvsoilm = soilMoistureConvertVol2Grav(slc, sand)

! Compute fecan dry limit
drylimit = clay * (14.0 * clay + 17.0)
drylimit = dust_drylimit_factor * clay * (14.0 * clay + 17.0)

! Compute soil moisture correction
moistureCorrectionFecan = sqrt(1.0 + 1.21 * max(0., grvsoilm - drylimit)**0.68)

end function moistureCorrectionFecan
!----------------------------------------------------------------
real function moistureCorrectionShao(slc)

! !USES:
implicit NONE

! !INPUT PARAMETERS:
REAL(kind_phys), intent(in) :: slc ! liquid water content of top soil layer, volumetric fraction [1]

! !DESCRIPTION: Compute correction factor to account for Fecal soil moisture
!
! !REVISION HISTORY:
!
! 02Apr2020, B.Baker/NOAA - Original implementation
! 01Apr2020, R.Montuoro/NOAA - Adapted for GOCART process library

! !Local Variables
real :: grvsoilm
real :: drylimit

!EOP
!---------------------------------------------------------------
! Begin...

if (slc < 0.03) then
moistureCorrectionShao = exp(22.7 * slc)
else
moistureCorrectionShao = exp(95.3 * slc - 2.029)
end if

end function moistureCorrectionShao
!---------------------------------------------------------------
real function DustFluxV2HRatioMB95(clay, kvhmax)

Expand Down
22 changes: 15 additions & 7 deletions physics/smoke_dust/rrfs_smoke_wrapper.F90
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ module rrfs_smoke_wrapper
num_moist, num_chem, num_emis_seas, num_emis_dust, &
DUST_OPT_FENGSHA, p_qv, p_atm_shum, p_atm_cldq, &
p_smoke, p_dust_1, p_coarse_pm, epsilc
use dust_data_mod, only : dust_alpha, dust_gamma
use dust_data_mod, only : dust_alpha, dust_gamma, dust_moist_opt, &
dust_moist_correction, dust_drylimit_factor
use plume_data_mod, only : p_frp_std, p_frp_hr, num_frp_plume
use seas_mod, only : gocart_seasalt_driver
use dust_fengsha_mod, only : gocart_dust_fengsha_driver
Expand Down Expand Up @@ -49,6 +50,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
ebb_smoke_hr, frp_hr, frp_std_hr, &
coef_bb, ebu_smoke,fhist, min_fplume, max_fplume, hwp, wetness, &
smoke_ext, dust_ext, ndvel, ddvel_inout,rrfs_sd, &
dust_moist_opt_in, dust_moist_correction_in, dust_drylimit_factor_in, &
dust_alpha_in, dust_gamma_in, fire_in, &
seas_opt_in, dust_opt_in, drydep_opt_in, coarsepm_settling_in, &
do_plumerise_in, plumerisefire_frq_in, addsmoke_flag_in, &
Expand Down Expand Up @@ -91,12 +93,15 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
real(kind_phys), dimension(:,:), intent(out) :: smoke_ext, dust_ext
real(kind_phys), dimension(:,:), intent(inout) :: nwfa, nifa
real(kind_phys), dimension(:,:), intent(inout) :: ddvel_inout
real (kind=kind_phys), dimension(:), intent(in) :: wetness
integer, intent(in ) :: imp_physics, imp_physics_thompson
real (kind=kind_phys), intent(in) :: dust_alpha_in, dust_gamma_in, wetdep_ls_alpha_in
integer, intent(in) :: seas_opt_in, dust_opt_in, drydep_opt_in, &
coarsepm_settling_in, plumerisefire_frq_in, &
addsmoke_flag_in, wetdep_ls_opt_in
real(kind_phys), dimension(:), intent(in) :: wetness
real(kind_phys), intent(in) :: dust_alpha_in, dust_gamma_in, wetdep_ls_alpha_in
real(kind_phys), intent(in) :: dust_moist_correction_in
real(kind_phys), intent(in) :: dust_drylimit_factor_in
integer, intent(in) :: dust_moist_opt_in
integer, intent(in) :: imp_physics, imp_physics_thompson
integer, intent(in) :: seas_opt_in, dust_opt_in, drydep_opt_in, &
coarsepm_settling_in, plumerisefire_frq_in, &
addsmoke_flag_in, wetdep_ls_opt_in
logical, intent(in ) :: do_plumerise_in, rrfs_sd
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
Expand Down Expand Up @@ -314,6 +319,9 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate,
! Set at compile time in dust_data_mod:
dust_alpha = dust_alpha_in
dust_gamma = dust_gamma_in
dust_moist_opt = dust_moist_opt_in
dust_moist_correction = dust_moist_correction_in
dust_drylimit_factor = dust_drylimit_factor_in
call gocart_dust_fengsha_driver(dt,chem,rho_phy,smois,p8w,ssm, &
isltyp,vegfrac,snowh,xland,dxy,g,emis_dust,ust,znt, &
clayf,sandf,rdrag,uthr, &
Expand Down
Loading
Loading