Skip to content

Commit

Permalink
Combination for CCPP-physics #213 and #218 (H2O scheme refactor and C…
Browse files Browse the repository at this point in the history
…3/SAS/MYNN fix) (#865)

* Host side changes for h2o photochemistry scheme

* A fix for the issue to run C3 or SAS convection with the prognostic area fraction closure, and MYNN PBL: tendency_of_vertically_diffused_tracer_concentration from MYNN PBL

---------

Co-authored-by: Dustin Swales <[email protected]>
Co-authored-by: Lisa Bengtsson <[email protected]>
  • Loading branch information
3 people authored Aug 29, 2024
1 parent 70b3065 commit 40e014f
Show file tree
Hide file tree
Showing 46 changed files with 98 additions and 61 deletions.
9 changes: 7 additions & 2 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
'physics/physics/hooks/machine.F',
'physics/physics/Radiation/RRTMG/radsw_param.f',
'physics/physics/Radiation/RRTMG/radlw_param.f',
'physics/physics/photochem/h2o_def.f',
'physics/physics/photochem/module_ozphys.F90',
'physics/physics/photochem/module_h2ophys.F90',
'data/CCPP_typedefs.F90',
'data/GFS_typedefs.F90',
'data/CCPP_data.F90',
Expand All @@ -45,6 +45,10 @@
'module_ozphys' : '',
'ty_ozphys' : '',
},
'module_h2ophys' : {
'module_h2ophys' : '',
'ty_h2ophys' : '',
},
'CCPP_typedefs' : {
'GFS_interstitial_type' : 'GFS_Interstitial(cdata%thrd_no)',
'GFDL_interstitial_type' : 'GFDL_interstitial',
Expand Down Expand Up @@ -85,6 +89,7 @@
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_photochemistry.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90',
'physics/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90',
Expand Down Expand Up @@ -150,7 +155,7 @@
'physics/physics/GWD/gwdc_post.f',
'physics/physics/GWD/gwdps.f',
'physics/physics/GWD/rayleigh_damp.f',
'physics/physics/photochem/h2ophys.f',
'physics/physics/photochem/module_h2ophys.F90',
'physics/physics/photochem/module_ozphys.F90',
'physics/physics/MP/Ferrier_Aligo/mp_fer_hires.F90',
'physics/physics/MP/GFDL/gfdl_cloud_microphys.F90',
Expand Down
38 changes: 23 additions & 15 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ module GFS_typedefs

use module_radsw_parameters, only: topfsw_type, sfcfsw_type
use module_radlw_parameters, only: topflw_type, sfcflw_type
use h2o_def, only: levh2o, h2o_coeff
use module_ozphys, only: ty_ozphys
use module_h2ophys, only: ty_h2ophys

implicit none

Expand Down Expand Up @@ -1018,6 +1018,7 @@ module GFS_typedefs
real(kind=kind_phys) :: dt_inner !< time step for the inner loop in s
logical :: sedi_semi !< flag for semi Lagrangian sedi of rain
integer :: decfl !< deformed CFL factor
logical :: thpsnmp_is_init !< Local scheme initialization flag

!--- GFDL microphysical paramters
logical :: lgfdlmprad !< flag for GFDL mp scheme and radiation consistency
Expand Down Expand Up @@ -1632,7 +1633,11 @@ module GFS_typedefs
type(ty_ozphys) :: ozphys !< DDT with data needed by ozone physics
integer :: levozp !< Number of vertical layers in ozone forcing data
integer :: oz_coeff !< Number of coefficients in ozone forcing data

!--- NRL h2o photchemistry physics
type(ty_h2ophys) :: h2ophys !< DDT with data needed by h2o photchemistry physics.
integer :: levh2o !< Number of vertical layers in stratospheric h2o data.
integer :: h2o_coeff !< Number of coefficients in stratospheric h2o data.

contains
procedure :: init => control_initialize
procedure :: init_chemistry => control_chemistry_initialize
Expand Down Expand Up @@ -3549,6 +3554,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
real(kind=kind_phys) :: dt_inner = -999.0 !< time step for the inner loop
logical :: sedi_semi = .false. !< flag for semi Lagrangian sedi of rain
integer :: decfl = 8 !< deformed CFL factor
logical :: thpsnmp_is_init = .false. !< Local scheme initialization flag

!--- GFDL microphysical parameters
logical :: lgfdlmprad = .false. !< flag for GFDLMP radiation interaction
Expand Down Expand Up @@ -3980,6 +3986,9 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
integer :: kozpl = 28 !< File identifier for ozone forcing data
integer :: kozc = 48 !< File identifier for ozone climotology data

!--- NRL h2o photochemistry physics
integer :: kh2oc = 29 !< File identifier for h2o photochemistry data.

!--- aerosol scavenging factors
integer, parameter :: max_scav_factors = 183
character(len=40) :: fscav_aero(max_scav_factors) = ''
Expand Down Expand Up @@ -4901,18 +4910,6 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%oz_phys_2015 = oz_phys_2015
Model%h2o_phys = h2o_phys

! To ensure that these values match what's in the physics,
! array sizes are compared during model init in GFS_phys_time_vary_init()
!
! from module h2ointerp
if (h2o_phys) then
levh2o = 72
h2o_coeff = 3
else
levh2o = 1
h2o_coeff = 1
end if

Model%pdfcld = pdfcld
Model%shcnvcw = shcnvcw
Model%redrag = redrag
Expand Down Expand Up @@ -5626,6 +5623,17 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
err_message = Model%ozphys%load_o3clim('global_o3prdlos.f77',kozc)
end if

!--- NRL h2o photochemistry physics.
if (Model%h2o_phys) then
! Load data for h2o photochemistry physics.
err_message = Model%h2ophys%load('global_h2oprdlos.f77',kh2oc)
Model%levh2o = Model%h2ophys%nlev
Model%h2o_coeff = Model%h2ophys%ncf
else
Model%levh2o = 1
Model%h2o_coeff = 1
end if

!--- quantities to be used to derive phy_f*d totals
Model%nshoc_2d = nshoc_2d
Model%nshoc_3d = nshoc_3d
Expand Down Expand Up @@ -7167,7 +7175,7 @@ subroutine tbd_create (Tbd, Model)

!--- ozone and stratosphere h2o needs
allocate (Tbd%ozpl (IM,Model%levozp,Model%oz_coeff))
allocate (Tbd%h2opl (IM,levh2o,h2o_coeff))
allocate (Tbd%h2opl (IM,Model%levh2o,Model%h2o_coeff))
Tbd%h2opl = clear_val
Tbd%ozpl = clear_val

Expand Down
26 changes: 25 additions & 1 deletion ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -4852,6 +4852,12 @@
units = count
dimensions = ()
type = integer
[thpsnmp_is_init]
standard_name = flag_for_thompson_mp_scheme_initialization
long_name = flag carrying scheme initialization status
units = flag
dimensions = ()
type = logical
[lgfdlmprad]
standard_name = flag_for_GFDL_microphysics_radiation_interaction
long_name = flag for GFDL microphysics-radiation interaction
Expand Down Expand Up @@ -5365,6 +5371,12 @@
units = mixed
dimensions = ()
type = ty_ozphys
[h2ophys]
standard_name = dataset_for_h2o_photochemistry_physics
long_name = dataset for NRL h2o photochemistry physics
units = mixed
dimensions = ()
type = ty_h2ophys
[h2o_phys]
standard_name = flag_for_stratospheric_water_vapor_physics
long_name = flag for stratospheric water vapor physics
Expand Down Expand Up @@ -7049,6 +7061,18 @@
units = count
dimensions = ()
type = integer
[levh2o]
standard_name = vertical_dimension_of_h2o_forcing_data
long_name = number of vertical layers in h2o forcing data
units = count
dimensions = ()
type = integer
[h2o_coeff]
standard_name = number_of_coefficients_in_h2o_forcing_data
long_name = number of coefficients in h2o forcing data
units = index
dimensions = ()
type = integer
[ipt]
standard_name = index_of_horizontal_gridpoint_for_debug_output
long_name = horizontal index for point used for diagnostic printout
Expand Down Expand Up @@ -10012,7 +10036,7 @@
relative_path = ../physics/physics/
dependencies = hooks/machine.F,hooks/physcons.F90
dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f
dependencies = photochem/h2o_def.f,photochem/module_ozphys.F90
dependencies = photochem/module_ozphys.F90,photochem/module_h2ophys.F90
dependencies = MP/GFDL/GFDL_parse_tracers.F90

[ccpp-arg-table]
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_lam3km.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v15p2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v16.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v16_csawmg.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v16_flake.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v16_fv3wam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v16_ras.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_coupled_p8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_coupled_p8_c3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_coupled_p8_sfcocn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_coupled_p8_ugwpv1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<scheme>ugwpv1_gsldrag_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_p8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_p8_c3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_p8_mynn.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_p8_rrtmgp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_GFS_v17_p8_ugwpv1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<scheme>ugwpv1_gsldrag_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HAFS_v1_gfdlmp_tedmf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HAFS_v1_gfdlmp_tedmf_nonsst.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HAFS_v1_thompson.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HAFS_v1_thompson_nonsst.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HAFS_v1_thompson_tedmf_gfdlsf.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<scheme>unified_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HRRR.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<scheme>drag_suite</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
Expand Down
2 changes: 1 addition & 1 deletion ccpp/suites/suite_FV3_HRRR_c3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<scheme>drag_suite</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>h2ophys</scheme>
<scheme>GFS_photochemistry</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
Expand Down
Loading

0 comments on commit 40e014f

Please sign in to comment.