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

sync with emc develop #59

Merged
merged 23 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8f7f329
New winter wx diags, variable precip ice density computed in MP_gener…
ericaligo-NOAA Dec 8, 2022
33f4922
Fix typo
ericaligo-NOAA Dec 9, 2022
f72f38b
Rename winter wx diags
ericaligo-NOAA Dec 12, 2022
6825a3e
Merge remote-tracking branch 'upstream/ufs/dev' into winterwx
ericaligo-NOAA Dec 27, 2022
560f998
minor touchups
ericaligo-NOAA Jan 5, 2023
2f3d69a
removed commented out lines related to old computation of precip ice …
ericaligo-NOAA Jan 5, 2023
db11313
Merge remote-tracking branch 'upstream/ufs/dev' into winterwx
ericaligo-NOAA Jan 6, 2023
5eaa95f
remove unused frozen precip density in RUC; update many CCPP standard…
Jan 11, 2023
8abbcba
address standard name clash for lwe of surface snow
grantfirl Jan 12, 2023
e259523
add back RUC LSM internal surface frozen precip density and option to…
grantfirl Jan 18, 2023
c96fee6
update initialization of rhosnfr in lsm_ruc.F90
grantfirl Jan 19, 2023
cb0afb8
use updated exticeden flag
grantfirl Jan 20, 2023
9691f35
Merge pull request #1 from grantfirl/winterwx_gjf
ericaligo-NOAA Jan 20, 2023
f3499e3
Merge pull request #956 from dustinswales/accumulated_cleanup
Feb 8, 2023
944aae4
Cleanup from previous merge.
Feb 8, 2023
bc083e7
Changed UGWP diagnostic variable declaration intents from 'out' to 'i…
mdtoyNOAA Feb 13, 2023
3a38637
Updated UGWP diagnostic variable declaration intents in drag_suite.meta
mdtoyNOAA Feb 14, 2023
48d9d23
Merge remote-tracking branch 'upstream/ufs/dev' into winterwx
ericaligo-NOAA Feb 15, 2023
3362852
Merge pull request #30 from ericaligo-NOAA/winterwx
ChunxiZhang-NOAA Feb 17, 2023
2241837
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
mdtoyNOAA Feb 17, 2023
235ef96
Merge pull request #40 from mdtoyNOAA/ufs/dev_drag_suite_intent_mods
grantfirl Feb 22, 2023
52754f7
Merge branch 'ufs/dev' of https://github.com/ufs-community/ccpp-physi…
Feb 27, 2023
4a75606
Merge pull request #38 from dustinswales/ncar-main-PR956
grantfirl Mar 2, 2023
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
301 changes: 186 additions & 115 deletions CODEOWNERS

Large diffs are not rendered by default.

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

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
80 changes: 39 additions & 41 deletions physics/GFS_cloud_diagnostics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

module GFS_cloud_diagnostics
use machine, only: kind_phys
use physparam, only: icldflg
use module_radiation_clouds, only: gethml

! Module parameters (imported directly from radiation_cloud.f)
Expand All @@ -19,10 +18,6 @@ module GFS_cloud_diagnostics

! Version tag and last revision date
character(40), parameter :: VTAGCLD='UFS-cloud-diagnostics vX.x May 2020 '

! Module variables
integer :: &
llyr = 2 ! Upper limit of boundary layer clouds

public GFS_cloud_diagnostics_run

Expand All @@ -36,51 +31,54 @@ module GFS_cloud_diagnostics
!> \section arg_table_GFS_cloud_diagnostics_run
!! \htmlinclude GFS_cloud_diagnostics_run.html
!!
subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr_rand, iovr_maxrand, iovr_max, &
iovr_dcorr, iovr_exp, iovr_exprand, lsswr, lslwr, lat, de_lgth, p_lay, &
subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr, iovr_rand, iovr_maxrand, &
iovr_max, iovr_dcorr, iovr_exp, iovr_exprand, lsswr, lslwr, lat, de_lgth, p_lay, &
cld_frac, p_lev, deltaZ, cloud_overlap_param, precip_overlap_param, con_pi, &
mtopa, mbota, cldsa, errmsg, errflg)
top_at_1, si, mtopa, mbota, cldsa, errmsg, errflg)
implicit none

! Inputs
integer, intent(in) :: &
nCol, & ! Number of horizontal grid-points
nLev ! Number of vertical-layers
integer, intent(in) :: &
iovr_rand, & ! Flag for random cloud overlap method
iovr_maxrand, & ! Flag for maximum-random cloud overlap method
iovr_max, & ! Flag for maximum cloud overlap method
iovr_dcorr, & ! Flag for decorrelation-length cloud overlap method
iovr_exp, & ! Flag for exponential cloud overlap method
iovr_exprand ! Flag for exponential-random cloud overlap method
logical, intent(in) :: &
lsswr, & ! Call SW radiation?
lslwr ! Call LW radiation
real(kind_phys), intent(in) :: &
con_pi ! Physical constant: pi
integer, intent(in) :: &
nCol, & ! Number of horizontal grid-points
nLev ! Number of vertical-layers
integer, intent(in) :: &
iovr, & ! Choice of cloud-overlap method
iovr_rand, & ! Flag for random cloud overlap method
iovr_maxrand, & ! Flag for maximum-random cloud overlap method
iovr_max, & ! Flag for maximum cloud overlap method
iovr_dcorr, & ! Flag for decorrelation-length cloud overlap method
iovr_exp, & ! Flag for exponential cloud overlap method
iovr_exprand ! Flag for exponential-random cloud overlap method
logical, intent(in) :: &
lsswr, & ! Call SW radiation?
lslwr, & ! Call LW radiation?
top_at_1 ! Vertical ordering flag
real(kind_phys), intent(in) :: &
con_pi ! Physical constant: pi
real(kind_phys), dimension(:), intent(in) :: &
lat, & ! Latitude
de_lgth ! Decorrelation length
lat, & ! Latitude
de_lgth, & ! Decorrelation length
si ! Vertical sigma coordinate
real(kind_phys), dimension(:,:), intent(in) :: &
p_lay, & ! Pressure at model-layer
cld_frac ! Total cloud fraction
p_lay, & ! Pressure at model-layer
cld_frac ! Total cloud fraction
real(kind_phys), dimension(:,:), intent(in) :: &
p_lev ! Pressure at model interfaces
p_lev ! Pressure at model interfaces
real(kind_phys), dimension(:,:), intent(in) :: &
deltaZ, & ! Layer thickness (m)
cloud_overlap_param, & ! Cloud-overlap parameter
precip_overlap_param ! Precipitation overlap parameter
deltaZ, & ! Layer thickness (m)
cloud_overlap_param, & ! Cloud-overlap parameter
precip_overlap_param ! Precipitation overlap parameter

! Outputs
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag
integer,dimension(:,:),intent(out) :: &
mbota, & ! Vertical indices for cloud tops
mtopa ! Vertical indices for cloud bases
character(len=*), intent(out) :: &
errmsg ! Error message
integer, intent(out) :: &
errflg ! Error flag
integer,dimension(:,:),intent(out) :: &
mbota, & ! Vertical indices for cloud tops
mtopa ! Vertical indices for cloud bases
real(kind_phys),dimension(:,:), intent(out) :: &
cldsa ! Fraction of clouds for low, middle, high, total and BL
cldsa ! Fraction of clouds for low, middle, high, total and BL

! Local variables
integer i,id,iCol,iLay,icld
Expand Down Expand Up @@ -111,8 +109,8 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr_rand, iovr_maxrand, iovr_m
! defined by ptopc. The cloud overlapping method is defined by control flag 'iovr', which may
! be different for lw and sw radiation programs.
call gethml(p_lay*0.01, ptop1, cld_frac, cldcnv, deltaZ, de_lgth, cloud_overlap_param,&
nCol, nLev, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, &
iovr_exprand, cldsa, mtopa, mbota)
nCol, nLev, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, &
iovr_exprand, top_at_1, si, cldsa, mtopa, mbota)

end subroutine GFS_cloud_diagnostics_run
!> @}
Expand Down
23 changes: 23 additions & 0 deletions physics/GFS_cloud_diagnostics.meta
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[ccpp-table-properties]
name = GFS_cloud_diagnostics
type = scheme
dependencies = machine.F,radiation_clouds.f

########################################################################
[ccpp-arg-table]
Expand All @@ -20,6 +21,13 @@
dimensions = ()
type = integer
intent = in
[iovr]
standard_name = flag_for_cloud_overlap_method_for_radiation
long_name = max-random overlap clouds
units = flag
dimensions = ()
type = integer
intent = in
[iovr_rand]
standard_name = flag_for_random_cloud_overlap_method
long_name = choice of random cloud overlap method
Expand Down Expand Up @@ -148,6 +156,21 @@
type = real
kind = kind_phys
intent = in
[top_at_1]
standard_name = flag_for_vertical_ordering_in_radiation
long_name = flag for vertical ordering in radiation
units = flag
dimensions = ()
type = logical
intent = in
[si]
standard_name = sigma_pressure_hybrid_vertical_coordinate
long_name = vertical sigma coordinate for radiation initialization
units = none
dimensions = (vertical_interface_dimension)
type = real
kind = kind_phys
intent = in
[mtopa]
standard_name = model_layer_number_at_cloud_top
long_name = vertical indices for low, middle and high cloud tops
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
Loading