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

Complete CCPPIzation of Hack shallow convection; dycore tests change to ne3pg3; FCAM4 test #362

Merged
merged 25 commits into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
00e4376
Initial commit for hk_conv
jimmielin Dec 9, 2024
0a8d922
Fixes to build Hack with ZM
jimmielin Jan 8, 2025
5eb4275
Add dlfzm
jimmielin Jan 22, 2025
8cc5d48
Update to atmos_phys rebased
jimmielin Jan 27, 2025
22dd39d
Remove zm_jt/maxg due to incorrect pbuf writing; update ref_pres from…
jimmielin Feb 3, 2025
339443e
Add use_shfrc and shfrc registry (stateful) fields
jimmielin Feb 6, 2025
dd09b41
Update submodules to pre-finalized state
jimmielin Feb 13, 2025
f73b41d
Merge branch 'development' into hplin/hk_conv_rebase
jimmielin Feb 14, 2025
236a21e
Update trop_cloud_top_lev standard name
jimmielin Feb 14, 2025
e28e1d4
Update to address review comments
jimmielin Feb 18, 2025
92c05d6
Add initializations for snapshot fields for running CAM4 suite (need …
jimmielin Feb 20, 2025
c25cc60
Add Hack shallow convection test.
jimmielin Feb 21, 2025
ee30f0a
Fix test definition res; initialize tpert to zero; initialize landfra…
jimmielin Feb 21, 2025
a8cadbe
Update ncar-physics external to latest in hk_conv
jimmielin Feb 21, 2025
8284094
Merge branch 'development' into hplin/hk_conv_rebase
jimmielin Feb 24, 2025
67f88c3
Add cam_in inputs in registry for reading from snapshot.
jimmielin Feb 27, 2025
cba3f39
Update atmos_phys tag to pre-merge for regression testing
jimmielin Feb 27, 2025
5aff5d1
More reasonable SST initialization
jimmielin Feb 27, 2025
0defe92
Update to atmos_phys0_10_001
jimmielin Mar 7, 2025
092b294
Merge branch 'development' into hplin/hk_conv_rebase
jimmielin Mar 7, 2025
ae2604a
Change all dycore tests to ne3pg3_ne3pg3_mg37
jimmielin Mar 10, 2025
b50c289
Merge branch 'development' into hplin/hk_conv_rebase
jimmielin Mar 10, 2025
30764b1
Remove delt from registry.xml
jimmielin Mar 10, 2025
c43d0a8
Fix standard name for vertical_layer_index_of_troposphere_cloud_physi…
jimmielin Mar 10, 2025
b76c105
Update comments in registry.xml
jimmielin Mar 10, 2025
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 .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[submodule "ncar-physics"]
path = src/physics/ncar_ccpp
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = 252b500a93c89f36ece7d8ba08fd8eb025279eaa
fxtag = atmos_phys0_10_001
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics
[submodule "ccs_config"]
Expand Down
4 changes: 2 additions & 2 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@
<default_value></default_value>
<values match="last" modifier='additive'>
<value compset="_CAM70">--physics-suites cam7</value>
<!-- <value compset="_CAM40">-phys cam4</value>
<value compset="_CAM50">-phys cam5</value>
<value compset="_CAM40">--physics-suites cam4</value>
<!-- <value compset="_CAM50">-phys cam5</value>
<value compset="_CAM60">-phys cam6</value> -->

<!-- Modifiers for CAM runs -->
Expand Down
5 changes: 5 additions & 0 deletions cime_config/config_compsets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@
<lname>2000_CAM70_SLND_SICE_SOCN_SROF_SGLC_SWAV</lname>
</compset>

<compset>
<alias>FCAM4</alias>
<lname>2000_CAM40_SLND_SICE_SOCN_SROF_SGLC_SWAV</lname>
</compset>

<compset>
<alias>F2010climo</alias>
<lname>2010_CAM60_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_CISM2%NOEVOLVE_SWAV</lname>
Expand Down
21 changes: 21 additions & 0 deletions cime_config/testdefs/testlist_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@
<option name="comment">Test for Zhang McFarlane physics</option>
</options>
</test>
<test compset="FPHYStest" grid="ne5_ne5_mg37" name="SMS_Ln2" testmods="cam/outfrq_hack_shallow_derecho">
<machines>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment">Test for Hack shallow convection scheme</option>
</options>
</test>

<!-- Derecho dycore tests -->
<test compset="FKESSLER" grid="mpasa480_mpasa480" name="SMS_Ln9" testmods="cam/outfrq_kessler_mpas_derecho">
Expand Down Expand Up @@ -106,4 +115,16 @@
<option name="comment">CAM7 test with SE-CSLAM dycore</option>
</options>
</test>

<!-- CAM4 physics tests -->
<test compset="FCAM4" grid="ne5pg3_ne5pg3_mg37" name="SMS_Ln9" testmods="cam/outfrq_se_cslam_analy_ic">
<machines>
<machine name="derecho" compiler="intel" category="aux_sima"/>
<machine name="derecho" compiler="gnu" category="aux_sima"/>
</machines>
<options>
<option name="wallclock">00:10:00</option>
<option name="comment">CAM4 test with SE-CSLAM dycore</option>
</options>
</test>
</testlist>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./xmlchange CAM_CONFIG_OPTS="--dyn none --physics-suites convect_shallow_hack"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
! these are QPC4 snapshots and require custom physical constant definitions.
ncdata = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne5np4_hack_convect_shallow_snapshot_derecho_gnu_before_c20250220.nc'
ncdata_check = '/glade/campaign/cesm/community/amwg/sima_baselines/cam_sima_test_snapshots/cam_ne5np4_hack_convect_shallow_snapshot_derecho_gnu_after_c20250220.nc'

pver = 26
user_defined_cpwv = 1.846e3
user_defined_gravit = 9.79764
user_defined_mwdry = 28.96623324623746
user_defined_mwh2o = 18.01618112892741
user_defined_rearth = 6.37100e6
user_defined_sday = 86164.10063718943

zmconv_c0_lnd = 0.0035D0
zmconv_c0_ocn = 0.0035D0
zmconv_capelmt = 70.0
zmconv_dmpdz = -1.0E-3
zmconv_ke = 5.0E-6
zmconv_ke_lnd = 3.0E-6
zmconv_momcd = 0.4000D0
zmconv_momcu = 0.4000D0
zmconv_num_cin = 5
zmconv_parcel_pbl = .false.
zmconv_tau = 3600.0
zmconv_tiedke_add = 0.5

! snapshot is sourced from SE dycore
hkconv_c0 = 1.0e-4

! history fields for CAM4 Hack shallow convection
hist_output_frequency;h1: 1*nsteps
hist_max_frames;h1: 1
hist_add_inst_fields;h1: CMFDT,CMFDQ,CMFDLIQ,CMFDICE,CMFDQR,DQP,ICWMRSH,CMFSL,CMFLQ,FREQSH,EVAPTCM,FZSNTCM,EVSNTCM,HKNTPRPD,HKNTSNPD,HKFLXPRC,HKFLXSNW,HKEIHEAT,EVAPQCM,PRECSH,CMFMCSH,CMFMC,CLDTOP,CLDBOT,PCLDTOP,PCLDBOT,ZMDLF,SHDLF
hist_precision;h1: REAL64
2 changes: 1 addition & 1 deletion src/data/ref_pres.meta
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
dimensions = ()
protected = True
[ trop_cloud_top_lev ]
standard_name = vertical_layer_index_of_troposphere_cloud_top
standard_name = vertical_layer_index_of_troposphere_cloud_physics_top
units = index
type = integer
dimensions = ()
Expand Down
148 changes: 147 additions & 1 deletion src/data/registry.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,89 @@
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<ic_file_input_names>frontga pbuf_frontga</ic_file_input_names>
</variable>
<!-- State quantities for shallow/deep convection -->
<variable local_name="qpert"
standard_name="convective_water_vapor_wrt_moist_air_and_condensed_water_perturbation_due_to_pbl_eddies"
units="kg kg-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>qpert pbuf_qpert</ic_file_input_names>
</variable>
<variable local_name="cmfmc"
standard_name="atmosphere_convective_mass_flux_due_to_all_convection"
units="kg m-2 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_interface_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>cmfmc tphysbc_cmfmc</ic_file_input_names>
</variable>
<variable local_name="cmfmc_dp"
standard_name="atmosphere_convective_mass_flux_due_to_deep_convection"
units="kg m-2 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_interface_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>cmfmc_dp pbuf_CMFMC_DP</ic_file_input_names>
</variable>
<variable local_name="cmfmc_sh"
standard_name="atmosphere_convective_mass_flux_due_to_shallow_convection"
units="kg m-2 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_interface_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>cmfmc_sh pbuf_CMFMC_SH</ic_file_input_names>
</variable>
<variable local_name="dlfzm"
standard_name="detrainment_of_cloud_liquid_water_wrt_moist_air_and_condensed_water_due_to_deep_convection"
units="kg kg-1 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>dlfzm pbuf_DLFZM</ic_file_input_names>
</variable>
<variable local_name="dlf"
standard_name="detrainment_of_cloud_liquid_water_wrt_moist_air_and_condensed_water_due_to_all_convection"
units="kg kg-1 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>dlf tphysbc_dlf</ic_file_input_names>
</variable>
<variable local_name="dlf2"
standard_name="detrainment_of_cloud_liquid_water_wrt_moist_air_and_condensed_water_due_to_shallow_convection"
units="kg kg-1 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>dlf2 tphysbc_dlf2</ic_file_input_names>
</variable>
<variable local_name="rprddp"
standard_name="tendency_of_precipitation_wrt_moist_air_and_condensed_water_due_to_deep_convection_excluding_subcloud_evaporation"
units="kg kg-1 s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>pbuf_RPRDDP</ic_file_input_names>
</variable>
<!-- note: rliq and rliq2 from CAM snapshot appear to be in m s-1 (precip) units.
the CCPP standard names table claim that it should be in kg m-2 s-1 units. -->
<variable local_name="rliq"
standard_name="vertically_integrated_cloud_liquid_water_tendency_due_to_all_convection_to_be_applied_later_in_time_loop"
units="m s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>rliq tphysbc_rliq</ic_file_input_names>
</variable>
<variable local_name="rliq2"
standard_name="vertically_integrated_cloud_liquid_water_tendency_due_to_shallow_convection_to_be_applied_later_in_time_loop"
units="m s-1" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>rliq2 tphysbc_rliq2</ic_file_input_names>
</variable>
<!-- State helper values -->
<variable local_name="lnpmid" standard_name="ln_air_pressure"
units="1" type="real" kind="kind_phys"
Expand Down Expand Up @@ -498,24 +581,87 @@
units="fraction" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>landfrac cam_in_landfrac</ic_file_input_names>
</variable>
<variable local_name="icefrac"
standard_name="sea_ice_area_fraction"
units="fraction" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>icefrac cam_in_icefrac</ic_file_input_names>
</variable>
<variable local_name="snowhland"
standard_name="lwe_surface_snow_depth_over_land"
units="m" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>snowhland cam_in_snowhland</ic_file_input_names>
</variable>
<variable local_name="sst"
standard_name="sea_surface_temperature"
units="K" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<!-- FIXME: this is a temporary initialization to allow CAM4/CAM7 suites to run standalone,
while SSTs are not being provided from another Earth system component. -->
<initial_value>273.15_kind_phys</initial_value>
<ic_file_input_names>sst cam_in_sst</ic_file_input_names>
</variable>

<!-- Zhang McFarlane (ZM) Variables -->
<!-- Temporary initializations from snapshot -->
<!-- Note that no_deep_pbl defaults to false, but needs to be set to true for diag_TKE or UW schemes -->
<variable local_name="pblh"
standard_name="atmosphere_boundary_layer_thickness"
units="m" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<!-- FIXME: this is a temporary initialization to allow CAM4/CAM7 suites to run standalone,
while a PBL scheme is unavailable. -->
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>pblh pbuf_pblh</ic_file_input_names>
</variable>
<variable local_name="tpert"
standard_name="convective_temperature_perturbation_due_to_pbl_eddies"
units="K" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension</dimensions>
<initial_value>0.0_kind_phys</initial_value>
<ic_file_input_names>tpert pbuf_tpert</ic_file_input_names>
</variable>

<!-- Cloud fraction variables - need to be kept in physics state -->
<variable local_name="top_lev_cloudphys"
standard_name="vertical_layer_index_of_cloud_fraction_top"
units="index" type="integer">
<long_name>vertical layer index for top of cloud area fraction schemes</long_name>
<initial_value>1</initial_value>
</variable>

<!-- Shallow convection variables - need to be kept in physics state -->
<variable local_name="convect_shallow_use_shfrc"
standard_name="flag_for_cloud_area_fraction_to_use_shallow_convection_calculated_cloud_area_fraction"
units="flag" type="logical">
<long_name>should cloud fraction use shallow convection calculated convective cloud area fraction</long_name>
<!-- only true for UW and UNICON shallow schemes. set by scheme init. -->
<initial_value>.false.</initial_value>
</variable>
<variable local_name="shfrc"
standard_name="shallow_convective_cloud_area_fraction"
units="fraction" type="real" kind="kind_phys"
allocatable="allocatable">
<dimensions>horizontal_dimension vertical_layer_dimension</dimensions>
<!-- only used if use_shfrc is .true. -->
<initial_value>0.0_kind_phys</initial_value>
</variable>

<!-- Zhang McFarlane (ZM) Variables -->
<variable local_name="delt"
standard_name="half_timestep_for_physics"
units="s" type="real" kind="kind_phys">
</variable>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed? I don't think ZM actually uses a half-physics timestep.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, removed!

<variable local_name="ql"
standard_name="in_cloud_water_vapor_mixing_ratio_wrt_moist_air_and_condensed_water_due_to_deep_convection"
units="kg kg-1" type="real" kind="kind_phys"
Expand Down
2 changes: 1 addition & 1 deletion src/physics/ncar_ccpp
Submodule ncar_ccpp updated 47 files
+18 −0 .github/PULL_REQUEST_TEMPLATE/develop-template.md
+6 −0 .github/PULL_REQUEST_TEMPLATE/main-template.md
+4 −0 .github/pull_request_template.md
+1 −1 .github/workflows/unit-tests.yaml
+0 −56 doc/ChangeLog
+216 −0 phys_utils/atmos_phys_pbl_utils.F90
+14 −8 schemes/cloud_fraction/cloud_fraction_fice.F90
+13 −1 schemes/cloud_fraction/cloud_fraction_fice.meta
+31 −0 schemes/cloud_fraction/set_cloud_fraction_top.F90
+31 −0 schemes/cloud_fraction/set_cloud_fraction_top.meta
+134 −0 schemes/hack_shallow/convect_shallow_sum_to_deep.F90
+157 −0 schemes/hack_shallow/convect_shallow_sum_to_deep.meta
+1,020 −0 schemes/hack_shallow/hack_convect_shallow.F90
+312 −0 schemes/hack_shallow/hack_convect_shallow.meta
+33 −0 schemes/hack_shallow/hack_convect_shallow_namelist.xml
+50 −0 schemes/hack_shallow/set_general_conv_fluxes_to_shallow.F90
+109 −0 schemes/hack_shallow/set_general_conv_fluxes_to_shallow.meta
+25 −0 schemes/hack_shallow/set_shallow_conv_fluxes_to_general.F90
+31 −0 schemes/hack_shallow/set_shallow_conv_fluxes_to_general.meta
+3 −3 schemes/musica/tuvx/musica_ccpp_tuvx.F90
+291 −0 schemes/sima_diagnostics/convect_shallow_diagnostics.F90
+277 −0 schemes/sima_diagnostics/convect_shallow_diagnostics.meta
+2 −2 schemes/sima_diagnostics/sima_state_diagnostics.meta
+2 −5 schemes/sima_diagnostics/zm_diagnostics.F90
+3 −3 schemes/sima_diagnostics/zm_diagnostics.meta
+1 −1 schemes/utilities/geopotential_temp.meta
+2 −2 schemes/utilities/qneg.meta
+2 −2 schemes/zhang_mcfarlane/zm_conv_convtran.meta
+52 −0 schemes/zhang_mcfarlane/zm_conv_options.F90
+103 −0 schemes/zhang_mcfarlane/zm_conv_options.meta
+17 −1 schemes/zhang_mcfarlane/zm_conv_options_namelist.xml
+26 −43 schemes/zhang_mcfarlane/zm_convr.F90
+12 −6 schemes/zhang_mcfarlane/zm_convr.meta
+169 −0 suites/suite_cam4.xml
+7 −3 suites/suite_cam7.xml
+4 −1 test/CMakeLists.txt
+19 −9 test/docker/Dockerfile.musica
+6 −4 test/docker/Dockerfile.musica.no_install
+58 −64 test/musica/CMakeLists.txt
+1 −6 test/musica/micm/CMakeLists.txt
+9 −54 test/musica/tuvx/CMakeLists.txt
+57 −0 test/test_suites/suite_convect_shallow_hack.xml
+2 −1 test/test_suites/suite_zhang_mcfarlane.xml
+9 −0 test/unit-test/CMakeLists.txt
+1 −1 test/unit-test/tests/CMakeLists.txt
+4 −0 test/unit-test/tests/phys_utils/CMakeLists.txt
+25 −0 test/unit-test/tests/phys_utils/test_atmos_pbl_utils.pf