Skip to content

Commit

Permalink
Development of a unified cumulus convection scheme (#638)
Browse files Browse the repository at this point in the history
* unified convection

* Update some logic for progsigma
  • Loading branch information
lisa-bengtsson authored Apr 17, 2023
1 parent f071fc6 commit c463125
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 26 deletions.
3 changes: 3 additions & 0 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@
'physics/physics/cu_gf_driver_pre.F90',
'physics/physics/cu_gf_driver.F90',
'physics/physics/cu_gf_driver_post.F90',
'physics/physics/cu_unified_driver_pre.F90',
'physics/physics/cu_unified_driver.F90',
'physics/physics/cu_unified_driver_post.F90',
'physics/physics/hedmf.f',
'physics/physics/moninshoc.f',
'physics/physics/satmedmfvdif.F',
Expand Down
35 changes: 21 additions & 14 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,7 @@ module GFS_typedefs
integer :: imfshalcnv_samf = 2 !< flag for SAMF scale- & aerosol-aware mass-flux shallow convection scheme
integer :: imfshalcnv_gf = 3 !< flag for scale- & aerosol-aware Grell-Freitas scheme (GSD)
integer :: imfshalcnv_ntiedtke = 4 !< flag for new Tiedtke scheme (CAPS)
integer :: imfshalcnv_unified = 5 !< flag for the unified convection scheme
logical :: hwrf_samfdeep !< flag for HWRF SAMF deepcnv scheme (HWRF)
logical :: progsigma !< flag for prognostic area fraction in samf ddepcnv scheme (GFS)
integer :: imfdeepcnv !< flag for mass-flux deep convection scheme
Expand All @@ -1094,6 +1095,7 @@ module GFS_typedefs
integer :: imfdeepcnv_samf = 2 !< flag for SAMF scale- & aerosol-aware mass-flux deep convection scheme
integer :: imfdeepcnv_gf = 3 !< flag for scale- & aerosol-aware Grell-Freitas scheme (GSD)
integer :: imfdeepcnv_ntiedtke = 4 !< flag for new Tiedtke scheme (CAPS)
integer :: imfdeepcnv_unified = 5 !< flag for the unified convection scheme
logical :: hwrf_samfshal !< flag for HWRF SAMF shalcnv scheme (HWRF)
integer :: isatmedmf !< flag for scale-aware TKE-based moist edmf scheme
!< 0: initial version of satmedmf (Nov. 2018)
Expand Down Expand Up @@ -2577,7 +2579,7 @@ subroutine sfcprop_create (Sfcprop, IM, Model)
Sfcprop%cqs2 = clear_val
Sfcprop%lh = clear_val
end if
if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) then
allocate (Sfcprop%conv_act(IM))
allocate (Sfcprop%conv_act_m(IM))
Sfcprop%conv_act = zero
Expand Down Expand Up @@ -2960,7 +2962,7 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%rrfs_hwp = clear_val
endif

if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) then
allocate (Coupling%qci_conv (IM,Model%levs))
Coupling%qci_conv = clear_val
endif
Expand Down Expand Up @@ -3395,7 +3397,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &

logical :: hwrf_samfdeep = .false. !< flag for HWRF SAMF deepcnv scheme
logical :: hwrf_samfshal = .false. !< flag for HWRF SAMF shalcnv scheme
logical :: progsigma = .false. !< flag for prognostic updraft area fraction closure in saSAS
logical :: progsigma = .false. !< flag for prognostic updraft area fraction closure in saSAS or Unified conv.
logical :: do_mynnedmf = .false. !< flag for MYNN-EDMF
logical :: do_mynnsfclay = .false. !< flag for MYNN Surface Layer Scheme
! DH* TODO - move to MYNN namelist section
Expand Down Expand Up @@ -3893,17 +3895,17 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
write(*,*) 'NO FLAG: pbl is generic'
endif

if(imfshalcnv == Model%imfshalcnv_gf) then
if(imfshalcnv == Model%imfshalcnv_gf .or. imfshalcnv == Model%imfshalcnv_unified) then
if(me==master) &
write(*,*) 'FLAG: imfshalcnv_gf so scnv not generic'
write(*,*) 'FLAG: imfshalcnv_gf or imfshalcnv_unified so scnv not generic'
Model%flag_for_scnv_generic_tend=.false.
elseif(me==master) then
write(*,*) 'NO FLAG: scnv is generic'
endif

if(imfdeepcnv == Model%imfdeepcnv_gf) then
if(imfdeepcnv == Model%imfdeepcnv_gf .or. imfdeepcnv == Model%imfdeepcnv_unified) then
if(me==master) &
write(*,*) 'FLAG: imfdeepcnv_gf so dcnv not generic'
write(*,*) 'FLAG: imfdeepcnv_gf or imfdeepcnv_unified so dcnv not generic'
Model%flag_for_dcnv_generic_tend=.false.
elseif(me==master) then
write(*,*) 'NO FLAG: dcnv is generic'
Expand Down Expand Up @@ -4471,8 +4473,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%hwrf_samfdeep = hwrf_samfdeep
Model%hwrf_samfshal = hwrf_samfshal

if (progsigma .and. imfdeepcnv/=2) then
write(*,*) 'Logic error: progsigma requires imfdeepcnv=2'
if ((progsigma .and. imfdeepcnv/=2) .and. (progsigma .and. imfdeepcnv/=5)) then
write(*,*) 'Logic error: progsigma requires imfdeepcnv=2 or 5'
stop
end if
Model%progsigma = progsigma
Expand Down Expand Up @@ -5416,6 +5418,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
print *,' Grell-Freitas scale & aerosol-aware mass-flux deep conv scheme'
elseif(Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke) then
print *,' New Tiedtke cumulus scheme'
elseif(Model%imfdeepcnv == Model%imfdeepcnv_unified) then
print *,' New unified cumulus convection scheme'
endif
endif
else
Expand Down Expand Up @@ -5459,6 +5463,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
print *,' Grell-Freitas scale- & aerosol-aware mass-flux shallow conv scheme (2013)'
elseif (Model%imfshalcnv == Model%imfshalcnv_ntiedtke) then
print *,' New Tiedtke cumulus scheme'
elseif (Model%imfshalcnv == Model%imfshalcnv_unified) then
print *,' New unified cumulus scheme'
else
print *,' unknown mass-flux scheme in use - defaulting to no shallow convection'
Model%imfshalcnv = -1
Expand Down Expand Up @@ -5705,7 +5711,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
endif

if(Model%ras .or. Model%cscnv) Model%cnvcld = .false.
if(Model%do_shoc .or. Model%pdfcld .or. Model%do_mynnedmf .or. Model%imfdeepcnv == Model%imfdeepcnv_gf) Model%cnvcld = .false.
if(Model%do_shoc .or. Model%pdfcld .or. Model%do_mynnedmf .or. Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) Model%cnvcld = .false.
if(Model%cnvcld) Model%ncnvcld3d = 1

!--- get cnvwind index in phy_f2d; last entry in phy_f2d array
Expand Down Expand Up @@ -5770,7 +5776,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%lmfshal = (Model%shal_cnv .and. Model%imfshalcnv > 0)
Model%lmfdeep2 = (Model%imfdeepcnv == Model%imfdeepcnv_samf &
.or. Model%imfdeepcnv == Model%imfdeepcnv_gf &
.or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke)
.or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke &
.or. Model%imfdeepcnv == Model%imfdeepcnv_unified)
!--- END CODE FROM GLOOPR

!--- BEGIN CODE FROM GLOOPB
Expand Down Expand Up @@ -6709,7 +6716,7 @@ subroutine tbd_create (Tbd, IM, Model)
allocate (Tbd%hpbl (IM))
Tbd%hpbl = clear_val

if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke .or. Model%imfdeepcnv == Model%imfdeepcnv_samf .or. Model%imfshalcnv == Model%imfshalcnv_samf) then
if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke .or. Model%imfdeepcnv == Model%imfdeepcnv_samf .or. Model%imfshalcnv == Model%imfshalcnv_samf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified .or. Model%imfshalcnv == Model%imfshalcnv_unified) then
allocate(Tbd%prevsq(IM, Model%levs))
Tbd%prevsq = clear_val
endif
Expand All @@ -6719,7 +6726,7 @@ subroutine tbd_create (Tbd, IM, Model)
Tbd%ud_mf = zero
endif

if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke) then
if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_ntiedtke .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) then
allocate(Tbd%forcet(IM, Model%levs))
allocate(Tbd%forceq(IM, Model%levs))
allocate(Tbd%forcet(IM, Model%levs))
Expand All @@ -6729,7 +6736,7 @@ subroutine tbd_create (Tbd, IM, Model)
Tbd%prevst = clear_val
end if

if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) then
allocate(Tbd%cactiv(IM))
allocate(Tbd%cactiv_m(IM))
allocate(Tbd%aod_gf(IM))
Expand Down
32 changes: 22 additions & 10 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -979,15 +979,15 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection)
[conv_act_m]
standard_name = consecutive_calls_for_grell_freitas_mid_level_convection
long_name = Memory counter for GF midlevel
units = none
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection)
[hice]
standard_name = sea_ice_thickness
long_name = sea ice thickness
Expand Down Expand Up @@ -2699,7 +2699,7 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection)
[pfi_lsan]
standard_name = ice_flux_due_to_large_scale_precipitation
long_name = instantaneous 3D flux of ice from nonconvective precipitation
Expand Down Expand Up @@ -4788,6 +4788,12 @@
units = flag
dimensions = ()
type = integer
[imfshalcnv_unified]
standard_name = identifier_for_unified_shallow_convection
long_name = flag for Unified shallow convection scheme
units = flag
dimensions = ()
type = integer
[imfshalcnv_ntiedtke]
standard_name = identifier_for_new_tiedtke_shallow_convection
long_name = flag for new Tiedtke shallow convection scheme
Expand Down Expand Up @@ -4818,6 +4824,12 @@
units = flag
dimensions = ()
type = integer
[imfdeepcnv_unified]
standard_name = identifier_for_unified_deep_convection
long_name = flag for Unified deep convection scheme
units = flag
dimensions = ()
type = integer
[imfdeepcnv_ntiedtke]
standard_name = identifier_for_new_tiedtke_deep_convection
long_name = flag for new Tiedtke deep convection scheme
Expand Down Expand Up @@ -7000,7 +7012,7 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection)
[imap]
standard_name = map_of_block_column_number_to_global_i_index
long_name = map of local index ix to global index i for this block
Expand Down Expand Up @@ -7224,45 +7236,45 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection)
[forceq]
standard_name = tendendy_of_specific_humidity_due_to_nonphysics
long_name = moisture tendency due to dynamics only
units = kg kg-1 s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection)
[prevst]
standard_name = air_temperature_on_previous_timestep
long_name = temperature from previous time step
units = K
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection)
[prevsq]
standard_name = specific_humidity_on_previous_timestep
long_name = moisture from previous time step
units = kg kg-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection .or. control_for_deep_convection_scheme == identifer_for_scale_aware_mass_flux_deep_convection .or. control_for_shallow_convection_scheme == identifier_for_scale_aware_mass_flux_shallow_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection .or. control_for_deep_convection_scheme == identifier_for_new_tiedtke_deep_convection .or. control_for_deep_convection_scheme == identifer_for_scale_aware_mass_flux_deep_convection .or. control_for_shallow_convection_scheme == identifier_for_scale_aware_mass_flux_shallow_convection)
[cactiv]
standard_name = counter_for_grell_freitas_convection
long_name = convective activity memory
units = none
dimensions = (horizontal_loop_extent)
type = integer
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection)
[cactiv_m]
standard_name = counter_for_grell_freitas_mid_level_convection
long_name = mid-level convective activity memory
units = none
dimensions = (horizontal_loop_extent)
type = integer
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection)
active = (control_for_deep_convection_scheme == identifier_for_grell_freitas_deep_convection .or. control_for_deep_convection_scheme == identifier_for_unified_deep_convection)
[CLDFRA_BL]
standard_name = subgrid_scale_cloud_area_fraction_in_atmosphere_layer
long_name = subgrid cloud fraction from PBL scheme
Expand Down
47 changes: 46 additions & 1 deletion ccpp/driver/GFS_restart.F90
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, &
if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
Restart%num2d = Restart%num2d + 3
endif
! Unified convection
if (Model%imfdeepcnv == Model%imfdeepcnv_unified) then
Restart%num2d = Restart%num2d + 3
endif
! CA
if (Model%imfdeepcnv == 2 .and. Model%do_ca) then
Restart%num2d = Restart%num2d + 1
Expand Down Expand Up @@ -152,6 +156,10 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, &
if (Model%imfdeepcnv == 3) then
Restart%num3d = Restart%num3d + 3
endif
! Unified convection
if (Model%imfdeepcnv == 5) then
Restart%num3d = Restart%num3d + 4
endif
! MYNN PBL
if (Model%do_mynnedmf) then
Restart%num3d = Restart%num3d + 9
Expand Down Expand Up @@ -235,6 +243,24 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, &
Restart%data(nb,num)%var2p => Coupling(nb)%condition(:)
enddo
endif
! Unified convection
if (Model%imfdeepcnv == Model%imfdeepcnv_unified) then
num = num + 1
Restart%name2d(num) = 'gf_2d_conv_act'
do nb = 1,nblks
Restart%data(nb,num)%var2p => Sfcprop(nb)%conv_act(:)
enddo
num = num + 1
Restart%name2d(num) = 'gf_2d_conv_act_m'
do nb = 1,nblks
Restart%data(nb,num)%var2p => Sfcprop(nb)%conv_act_m(:)
enddo
num = num + 1
Restart%name2d(num) = 'aod_gf'
do nb = 1,nblks
Restart%data(nb,num)%var2p => Tbd(nb)%aod_gf(:)
enddo
endif
!--- RAP/HRRR-specific variables, 2D
! GF
if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
Expand Down Expand Up @@ -501,14 +527,33 @@ subroutine GFS_restart_populate (Restart, Model, Statein, Stateout, Sfcprop, &

!--Convection variable used in CB cloud fraction. Presently this
!--is only needed in sgscloud_radpre for imfdeepcnv == imfdeepcnv_gf.
if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
if (Model%imfdeepcnv == Model%imfdeepcnv_gf .or. Model%imfdeepcnv == Model%imfdeepcnv_unified) then
num = num + 1
Restart%name3d(num) = 'cnv_3d_ud_mf'
do nb = 1,nblks
Restart%data(nb,num)%var3p => Tbd(nb)%ud_mf(:,:)
enddo
endif

!Unified convection scheme
if (Model%imfdeepcnv == Model%imfdeepcnv_unified) then
num = num + 1
Restart%name3d(num) = 'gf_3d_prevst'
do nb = 1,nblks
Restart%data(nb,num)%var3p => Tbd(nb)%prevst(:,:)
enddo
num = num + 1
Restart%name3d(num) = 'gf_3d_prevsq'
do nb = 1,nblks
Restart%data(nb,num)%var3p => Tbd(nb)%prevsq(:,:)
enddo
num = num + 1
Restart%name3d(num) = 'gf_3d_qci_conv'
do nb = 1,nblks
Restart%data(nb,num)%var3p => Coupling(nb)%qci_conv(:,:)
enddo
endif

!--- RAP/HRRR-specific variables, 3D
! GF
if (Model%imfdeepcnv == Model%imfdeepcnv_gf) then
Expand Down
Loading

0 comments on commit c463125

Please sign in to comment.