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

Winterwx #30

Merged
merged 14 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
85 changes: 79 additions & 6 deletions physics/GFS_MP_generic_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ module GFS_MP_generic_post
!> @{
subroutine GFS_MP_generic_post_run( &
im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rainmin, dtf, frain, rainc, &
rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, rain0, ice0, snow0,&
graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp, totprcp, totice, &
totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, pwat, &
imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rhowater, rainmin, dtf, &
frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, &
rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,&
totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, &
pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, &
drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, &
graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, &
dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, &
Expand All @@ -37,7 +38,7 @@ subroutine GFS_MP_generic_post_run(
integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
integer, intent(in) :: imp_physics_nssl
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma
logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden
integer, intent(in) :: index_of_temperature,index_of_process_mp

integer :: dfi_radar_max_intervals
Expand All @@ -46,7 +47,7 @@ subroutine GFS_MP_generic_post_run(
integer :: ix_dfi_radar(:)
real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0

real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin
real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater
real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc
real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc
real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0
Expand Down Expand Up @@ -81,6 +82,13 @@ subroutine GFS_MP_generic_post_run(
real(kind=kind_phys), dimension(:), intent(inout) :: diceprv
real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv
real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv
real(kind=kind_phys), dimension(:), intent(inout) :: frzr
real(kind=kind_phys), dimension(:), intent(inout) :: frzrb
real(kind=kind_phys), dimension(:), intent(inout) :: frozr
real(kind=kind_phys), dimension(:), intent(inout) :: frozrb
real(kind=kind_phys), dimension(:), intent(inout) :: tsnowp
real(kind=kind_phys), dimension(:), intent(inout) :: tsnowpb
real(kind=kind_phys), dimension(:), intent(inout) :: rhonewsn1
real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdt_qmicro
real(kind=kind_phys), dimension(:,:), intent(inout) :: prevsq
real(kind=kind_phys), intent(in) :: dtp
Expand All @@ -101,6 +109,9 @@ subroutine GFS_MP_generic_post_run(
real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2, ttend
real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1

real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr
real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
Expand All @@ -111,6 +122,68 @@ subroutine GFS_MP_generic_post_run(
rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit
enddo

! compute surface snowfall, graupel/sleet, freezing rain and precip ice density
if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then
do i = 1, im
if (gt0(i,1) .le. 273) then
frzr(i) = frzr(i) + rain0(i)
frzrb(i) = frzrb(i) + rain0(i)
endif
tsnowp(i) = tsnowp(i) + snow0(i)
tsnowpb(i) = tsnowpb(i) + snow0(i)
frozr(i) = frozr(i) + graupel0(i)
frozrb(i) = frozrb(i) + graupel0(i)
enddo
!Compute the variable precip ice density for specific LSM schemes and options
if (exticeden) then
snowrat = 0.
grauprat = 0.
icerat = 0.
prcpncfr = 0.
prcpcufr = 0.
curat = 0.
prcpncfr = 0.
prcpcufr = 0.
rhonewsnow = 0.
rhonewgr = 0.
rhonewice = 0.
rhoprcpice = 0.
do i = 1, im
rhonewsn1(i)= 200.
prcpncfr = rain1(i)*sr(i)
if(sr(i) > 0..and. gt0(i,1) < 273.) then
prcpcufr = max(0.,rainc(i)*sr(i))
else
if(gt0(i,1) < 273.) then
prcpcufr = max(0.,rainc(i))
else
prcpcufr = 0.
endif ! gt0(i,1) < 273.
endif ! frzfrac > 0.
!
if((prcpncfr + prcpcufr) > 0.) then
! -- calculate snow, graupel and ice fractions in falling frozen precip
snowrat=min(1.,max(0.,snow0(i)/(prcpncfr + prcpcufr)))
grauprat=min(1.,max(0.,graupel0(i)/(prcpncfr + prcpcufr)))
icerat=min(1.,max(0.,(prcpncfr-snow0(i)-graupel0(i)) &
/(prcpncfr + prcpcufr)))
curat=min(1.,max(0.,(prcpcufr/(prcpncfr + prcpcufr))))

rhonewsnow=min(125.,1000.0/max(8.,(17.*tanh((276.65-gt0(i,1))*0.15))))
rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-gt0(i,1))*0.3333))))
rhonewice=rhonewsnow
!--- compute density of "precip ice" from weighted contribution
! of snow, graupel and ice fractions

ChunxiZhang-NOAA marked this conversation as resolved.
Show resolved Hide resolved
rhoprcpice = min(500.,max(58.8,(rhonewsnow*snowrat + &
rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat)))
! from now on rhonewsn1 is the density of falling frozen precipitation
rhonewsn1(i)=rhoprcpice
endif
enddo
endif
endif

!> - If requested (e.g. Zhao-Carr MP scheme), call calpreciptype() to calculate dominant
!! precipitation type.
! DH* TODO - Fix wrong code in non-CCPP build (GFS_physics_driver)
Expand Down
71 changes: 71 additions & 0 deletions physics/GFS_MP_generic_post.meta
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,14 @@
type = real
kind = kind_phys
intent = in
[rhowater]
standard_name = fresh_liquid_water_density_at_0c
long_name = density of liquid water
units = kg m-3
dimensions = ()
type = real
kind = kind_phys
intent = in
[dtf]
standard_name = timestep_for_dynamics
long_name = dynamics timestep
Expand Down Expand Up @@ -278,6 +286,69 @@
type = real
kind = kind_phys
intent = inout
[frzr]
standard_name = cumulative_lwe_thickness_of_surface_freezing_rain_amount
long_name = accumulated surface freezing rain
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[frzrb]
standard_name = cumulative_lwe_thickness_of_surface_freezing_rain_amount_in_bucket
long_name = accumulated surface freezing rain in bucket
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[frozr]
standard_name = cumulative_lwe_thickness_of_surface_graupel_amount
long_name = accumulated surface graupel
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[frozrb]
standard_name = cumulative_lwe_thickness_of_surface_graupel_amount_in_bucket
long_name = accumulated surface graupel in bucket
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[tsnowp]
standard_name = cumulative_lwe_thickness_of_surface_snow_amount
long_name = accumulated surface snow
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[tsnowpb]
standard_name = cumulative_lwe_thickness_of_surface_snow_amount_in_bucket
long_name = accumulated surface snow in bucket
units = m
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[rhonewsn1]
standard_name = surface_frozen_precipitation_density
long_name = density of precipitation ice
units = kg m-3
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = inout
[exticeden]
standard_name = do_external_surface_frozen_precipitation_density
long_name = flag for calculating frozen precip ice density outside of the LSM
units = flag
dimensions = ()
type = logical
intent = in
[save_t]
standard_name = air_temperature_save
long_name = air temperature before entering a physics scheme
Expand Down
2 changes: 1 addition & 1 deletion physics/GFS_debug.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1285,7 +1285,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_ice ', Interstitial%qss_ice )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_land ', Interstitial%qss_land )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%qss_water ', Interstitial%qss_water )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%radar_reset ', Interstitial%radar_reset )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%fullradar_diag ', Interstitial%fullradar_diag )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raddt ', Interstitial%raddt )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raincd ', Interstitial%raincd )
call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Interstitial%raincs ', Interstitial%raincs )
Expand Down
23 changes: 11 additions & 12 deletions physics/lsm_noah.f
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ subroutine lsm_noah_run &
& lheatstrg, isot, ivegsrc, &
& bexppert, xlaipert, vegfpert,pertvegf, & ! sfc perts, mgehne
& albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, &
& adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, &
& adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, rhonewsn1, &
& exticeden, &
! --- in/outs:
& weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, &
& canopy, trans, tsurf, zorl, &
Expand Down Expand Up @@ -252,7 +253,7 @@ subroutine lsm_noah_run &
& -1.0_kind_phys, -2.0_kind_phys /

! --- input:
integer, intent(in) :: im, km, isot, ivegsrc
integer, intent(in) :: im, km, isot, ivegsrc
real (kind=kind_phys), intent(in) :: grav, cp, hvap, rd, eps, &
& epsm1, rvrdm1
real (kind=kind_phys), intent(in) :: pertvegf
Expand All @@ -265,13 +266,13 @@ subroutine lsm_noah_run &
& snoalb, sfalb, zf, &
& bexppert, xlaipert, vegfpert, &
& albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, &
& adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd
& adjvisbmd, adjnirbmd, adjvisdfd, adjnirdfd, rhonewsn1

real (kind=kind_phys), intent(in) :: delt

logical, dimension(:), intent(in) :: flag_iter, flag_guess, land

logical, intent(in) :: lheatstrg
logical, intent(in) :: lheatstrg, exticeden

! --- in/out:
real (kind=kind_phys), dimension(:), intent(inout) :: weasd, &
Expand All @@ -292,7 +293,7 @@ subroutine lsm_noah_run &
! --- locals:
real (kind=kind_phys), dimension(im) :: rch, rho, &
& q0, qs1, theta1, weasd_old, snwdph_old, &
& tprcp_old, srflag_old, tskin_old, canopy_old
& tprcp_old, srflag_old, tskin_old, canopy_old

real (kind=kind_phys), dimension(km) :: et, sldpth, stsoil, &
& smsoil, slsoil
Expand All @@ -309,8 +310,8 @@ subroutine lsm_noah_run &
& smcdry, smcref, smcmax, sneqv, snoalb1d, snowh, &
& snomlt, sncovr, soilw, soilm, ssoil, tsea, th2, tbot, &
& xlai, zlvl, swdn, tem, z0, bexpp, xlaip, vegfp, &
& mv, sv, alphav, betav, vegftmp, cpinv, hvapi, elocp

& mv, sv, alphav, betav, vegftmp, cpinv, hvapi, elocp, &
& rhonewsn
integer :: couple, ice, nsoil, nroot, slope, stype, vtype
integer :: i, k, iflag
!
Expand All @@ -326,7 +327,6 @@ subroutine lsm_noah_run &
errflg = 0

!> - Save land-related prognostic fields for guess run.

do i = 1, im
if (land(i) .and. flag_guess(i)) then
weasd_old(i) = weasd(i)
Expand All @@ -335,7 +335,6 @@ subroutine lsm_noah_run &
canopy_old(i) = canopy(i)
tprcp_old(i) = tprcp(i)
srflag_old(i) = srflag(i)

do k = 1, km
smc_old(i,k) = smc(i,k)
stc_old(i,k) = stc(i,k)
Expand All @@ -361,7 +360,6 @@ subroutine lsm_noah_run &
sbsno(i) = zero
snowc(i) = zero
snohf(i) = zero

!> - Initialize variables wind, q, and rh at level 1.

q0(i) = max(q1(i), qmin) !* q1=specific humidity at level 1 (kg/kg)
Expand All @@ -371,7 +369,6 @@ subroutine lsm_noah_run &
qs1(i) = fpvs( t1(i) ) !* qs1=sat. humidity at level 1 (kg/kg)
qs1(i) = max(eps*qs1(i) / (prsl1(i)+epsm1*qs1(i)), qmin)
q0 (i) = min(qs1(i), q0(i))

do k = 1, km
zsoil(i,k) = zsoil_noah(k)
enddo
Expand Down Expand Up @@ -524,7 +521,8 @@ subroutine lsm_noah_run &
!> - Apply perturbation of soil type b parameter and leave area index.
bexpp = bexppert(i) ! sfc perts, mgehne
xlaip = xlaipert(i) ! sfc perts, mgehne

!> - New snow depth variables
rhonewsn = rhonewsn1(i)
!> - Call Noah LSM gfssflx().

call gfssflx & ! ccppdox: these is sflx in mpbl
Expand All @@ -533,6 +531,7 @@ subroutine lsm_noah_run &
& swdn, solnet, lwdn, sfcems, sfcprs, sfctmp, &
& sfcspd, prcp, q2, q2sat, dqsdt2, th2, ivegsrc, &
& vtype, stype, slope, shdmin1d, alb, snoalb1d, &
& rhonewsn, exticeden, &
& bexpp, xlaip, & ! sfc-perts, mgehne
& lheatstrg, &
! --- input/outputs:
Expand Down
15 changes: 15 additions & 0 deletions physics/lsm_noah.meta
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,21 @@
type = real
kind = kind_phys
intent = in
[rhonewsn1]
standard_name = surface_frozen_precipitation_density
long_name = density of precipitation ice
units = kg m-3
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = in
[exticeden]
standard_name = do_external_surface_frozen_precipitation_density
long_name = flag for calculating frozen precip ice density outside of the LSM
units = flag
dimensions = ()
type = logical
intent = in
[weasd]
standard_name = water_equivalent_accumulated_snow_depth_over_land
long_name = water equiv of acc snow depth over land
Expand Down
Loading