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

Implement re-organized CCPP physics external #306

Merged
merged 7 commits into from
Oct 15, 2024
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
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[submodule "ncar-physics"]
path = src/physics/ncar_ccpp
url = https://github.com/ESCOMP/atmospheric_physics
fxtag = atmos_phys0_05_000
fxtag = atmos_phys0_05_001
fxrequired = AlwaysRequired
fxDONOTUSEurl = https://github.com/ESCOMP/atmospheric_physics
[submodule "ccs_config"]
Expand Down
21 changes: 15 additions & 6 deletions cime_config/cam_autogen.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,22 +435,31 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
if not os.path.exists(physics_blddir):
os.makedirs(physics_blddir)
# End if
# Collect all source directories
atm_phys_src_dir = os.path.join(atm_root, "src", "physics", "ncar_ccpp")
source_search = [source_mods_dir, atm_phys_src_dir]
# Find all metadata files, organize by scheme name
# Set top-level CCPP physics directory
atm_phys_top_dir = os.path.join(atm_root, "src", "physics", "ncar_ccpp")
# Collect all possible Suite Definition File (SDF) locations
atm_suites_path = os.path.join(atm_phys_top_dir, "suites")
atm_test_suites_path = os.path.join(atm_phys_top_dir, "test", "test_suites")
jimmielin marked this conversation as resolved.
Show resolved Hide resolved
suite_search = [source_mods_dir, atm_suites_path, atm_test_suites_path]
# Find all scheme metadata files, organized by scheme name
atm_schemes_path = os.path.join(atm_phys_top_dir, "schemes")
source_search = [source_mods_dir, atm_schemes_path]
peverwhee marked this conversation as resolved.
Show resolved Hide resolved
all_scheme_files = _find_metadata_files(source_search, find_scheme_names)

# Find the SDFs specified for this model build
sdfs = []
scheme_files = []
xml_files = {} # key is scheme, value is xml file path
for sdf in phys_suites_str.split(';'):
sdf_path = _find_file(f"suite_{sdf}.xml", source_search)
sdf_path = _find_file(f"suite_{sdf}.xml", suite_search)
if not sdf_path:
emsg = f"ERROR: Unable to find SDF for suite '{sdf}'"
raise CamAutoGenError(emsg)
# End if
if os.path.dirname(os.path.abspath(sdf_path)) == atm_test_suites_path:
#Notify user that a test suite is being used
_LOGGER.info("Using non-standard test suite: %s", sdf)
# End if
sdfs.append(sdf_path)
# Given an SDF, find all the schemes it calls
_, suite = read_xml_file(sdf_path)
Expand Down Expand Up @@ -587,7 +596,7 @@ def generate_physics_suites(build_cache, preproc_defs, host_name,
# there to the bld directory:
if do_gen_ccpp:
# Set CCPP physics "utilities" path
atm_phys_util_dir = os.path.join(atm_phys_src_dir, "utilities")
atm_phys_util_dir = os.path.join(atm_schemes_path, "utilities")

# Check that directory exists
if not os.path.isdir(atm_phys_util_dir):
Expand Down
10 changes: 4 additions & 6 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,10 @@
<value compset="_CAM\d0%WX.*%SDYN">-nlev 145</value> -->

<!-- Simple models -->
<!-- <value compset="_CAM%HS94" grid="(%ne[0-9])|(%[0-9.]+x)">-analytic_ic</value>
<value compset="_CAM%ADIAB">-phys adiabatic</value>
<value compset="_CAM%DABIP04">-phys adiabatic</value>
<value compset="_CAM%TJ16">-phys tj2016 -analytic_ic</value>
<value compset="_CAM%HS94">-phys held_suarez</value>
<value compset="_CAM%KESSLER">-phys kessler -chem terminator -analytic_ic</value> -->
<!-- <value compset="_CAM%ADIAB">-phys adiabatic</value>
<value compset="_CAM%DABIP04">-phys adiabatic</value> -->
<value compset="_CAM%TJ16">--physics-suites tj2016 --analytic_ic</value>
<!-- <value compset="_CAM%KESSLER">-phys kessler -chem terminator -analytic_ic</value> -->
<value compset="_CAM%KESSLER">--physics-suites kessler --analytic_ic</value>
<value compset="_CAM%HS94">--physics-suites held_suarez_1994 --analytic_ic</value>
<value compset="_CAM%PHYSTEST">--dyn none --physics-suites adiabatic</value>
Expand Down
2 changes: 1 addition & 1 deletion src/physics/ncar_ccpp
Submodule ncar_ccpp updated 59 files
+88 −1 doc/ChangeLog
+0 −0 schemes/cam_diagnostics/tropopause_diagnostics.F90
+0 −0 schemes/cam_diagnostics/tropopause_diagnostics.meta
+0 −0 schemes/dry_adiabatic_adjust/dadadj.F90
+0 −0 schemes/dry_adiabatic_adjust/dadadj.meta
+0 −0 schemes/dry_adiabatic_adjust/dadadj_apply_qv_tendency.F90
+0 −0 schemes/dry_adiabatic_adjust/dadadj_apply_qv_tendency.meta
+0 −0 schemes/dry_adiabatic_adjust/dadadj_namelist.xml
+0 −0 schemes/held_suarez/held_suarez_1994.F90
+0 −0 schemes/held_suarez/held_suarez_1994.meta
+0 −0 schemes/kessler/kessler.F90
+0 −0 schemes/kessler/kessler.meta
+0 −0 schemes/kessler/kessler_update.F90
+0 −0 schemes/kessler/kessler_update.meta
+0 −0 schemes/musica/micm/micm_util.F90
+0 −0 schemes/musica/micm/musica_ccpp_micm.F90
+0 −0 schemes/musica/musica_ccpp.F90
+0 −0 schemes/musica/musica_ccpp.meta
+0 −0 schemes/musica/musica_ccpp_namelist.xml
+0 −0 schemes/musica/musica_ccpp_util.F90
+0 −0 schemes/musica/tuvx/musica_ccpp_tuvx.F90
+0 −0 schemes/tj2016/tj2016_precip.F90
+0 −0 schemes/tj2016/tj2016_precip.meta
+0 −0 schemes/tj2016/tj2016_sfc_pbl_hs.F90
+0 −0 schemes/tj2016/tj2016_sfc_pbl_hs.meta
+0 −0 schemes/tropopause_find/tropopause_find.F90
+0 −0 schemes/tropopause_find/tropopause_find.meta
+0 −0 schemes/utilities/geopotential_temp.F90
+0 −0 schemes/utilities/geopotential_temp.meta
+0 −0 schemes/utilities/physics_tendency_updaters.F90
+0 −0 schemes/utilities/physics_tendency_updaters.meta
+0 −0 schemes/utilities/qneg.F90
+0 −0 schemes/utilities/qneg.meta
+0 −0 schemes/utilities/qneg_namelist.xml
+0 −0 schemes/utilities/state_converters.F90
+0 −0 schemes/utilities/state_converters.meta
+0 −0 schemes/utilities/static_energy.F90
+0 −0 schemes/utilities/static_energy.meta
+0 −0 schemes/zhang_mcfarlane/zm_conv_convtran.F90
+0 −0 schemes/zhang_mcfarlane/zm_conv_convtran.meta
+0 −0 schemes/zhang_mcfarlane/zm_conv_evap.F90
+0 −0 schemes/zhang_mcfarlane/zm_conv_evap.meta
+0 −0 schemes/zhang_mcfarlane/zm_conv_momtran.F90
+0 −0 schemes/zhang_mcfarlane/zm_conv_momtran.meta
+0 −0 schemes/zhang_mcfarlane/zm_convr.F90
+0 −0 schemes/zhang_mcfarlane/zm_convr.meta
+0 −0 suites/suite_cam4.xml
+0 −0 suites/suite_cam6.xml
+0 −0 suites/suite_cam6_silhs.xml
+0 −0 suites/suite_cam7.xml
+0 −0 suites/suite_held_suarez_1994.xml
+0 −0 suites/suite_kessler.xml
+0 −0 suites/suite_musica.xml
+0 −0 suites/suite_tj2016.xml
+2 −2 test/CMakeLists.txt
+0 −0 test/test_suites/suite_dry_adiabatic_adjust.xml
+0 −0 test/test_suites/suite_tj2016_precip.xml
+0 −0 test/test_suites/suite_tj2016_sfc_pbl_hs.xml
+0 −0 test/test_suites/suite_tropopause_find.xml
14 changes: 0 additions & 14 deletions test/include/Makefile

This file was deleted.

17 changes: 0 additions & 17 deletions test/include/cam_abortutils.F90

This file was deleted.

96 changes: 0 additions & 96 deletions test/include/cam_logfile.F90

This file was deleted.

10 changes: 0 additions & 10 deletions test/include/ccpp_kinds.F90

This file was deleted.

Loading
Loading