From a1a83f774c4d9dee26874dc15fe72782f020d959 Mon Sep 17 00:00:00 2001 From: Courtney Peverley Date: Fri, 31 Jan 2025 17:09:51 -0700 Subject: [PATCH 1/2] add "protected = true" to orbital data metadata (#354) Tag name (required for release branches): Originator(s): peverwhee Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number): Adds "protected = true" to orbital_data metadata so the generated code doesn't try to read it in from file. Describe any changes made to build system: n/a Describe any changes made to the namelist: n/a List any changes to the defaults for the input datasets (e.g. boundary datasets): n/a List all files eliminated and why: n/a List all files added and what they do: n/a List all existing files that have been modified, and describe the changes: (Helpful git command: `git diff --name-status development...`) M src/physics/utils/orbital_data.meta - add "protected = true" attribute If there are new failures (compared to the `test/existing-test-failures.txt` file), have them OK'd by the gatekeeper, note them here, and add them to the file. If there are baseline differences, include the test and the reason for the diff. What is the nature of the change? Roundoff? derecho/intel/aux_sima: all PASS derecho/gnu/aux_sima: all PASS If this changes climate describe any run(s) done to evaluate the new climate in enough detail that it(they) could be reproduced: CAM-SIMA date used for the baseline comparison tests if different than latest: --- src/physics/utils/orbital_data.meta | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/physics/utils/orbital_data.meta b/src/physics/utils/orbital_data.meta index 611f7535..bd134e5a 100644 --- a/src/physics/utils/orbital_data.meta +++ b/src/physics/utils/orbital_data.meta @@ -9,13 +9,16 @@ units = rad type = real | kind = kind_phys dimensions = () + protected = True [earth_sun_distance] standard_name = earth_sun_distance units = AU type = real | kind = kind_phys dimensions = () + protected = True [solar_zenith_angle] standard_name = solar_zenith_angle units = rad type = real | kind = kind_phys - dimensions = (horizontal_dimension) \ No newline at end of file + dimensions = (horizontal_dimension) + protected = True From 2b81de71de7240f55b41a647cd8030c2ef3c5ab2 Mon Sep 17 00:00:00 2001 From: Jesse Nusbaumer Date: Fri, 7 Feb 2025 10:10:20 -0700 Subject: [PATCH 2/2] Configure option syntax now only uses dashes (#358) Tag name (required for release branches): Originator(s): nusbaume Description (include the issue title, and the keyword ['closes', 'fixes', 'resolves'] followed by the issue number): Fixes #357 - Should convert CAM_CONFIG_OPTS argument syntax to use dashes instead of underscores Describe any changes made to build system: All arguments that can be used in the `CAM_CONFIG_OPTS` XML variable in a CAM-SIMA case's `env_build.xml` file now use dashes instead of underscores. Also all single-dash config options (e.g. `-dyn` versus `--dyn`) have been removed to avoid any confusion as users move from CAM to CAM-SIMA). Describe any changes made to the namelist: N/A List any changes to the defaults for the input datasets (e.g. boundary datasets): N/A List all files eliminated and why: N/A List all files added and what they do: N/A List all existing files that have been modified, and describe the changes: (Helpful git command: `git diff --name-status development...`) M cime_config/cam_config.py M cime_config/config_component.xml - Convert CAM_CONFIG_OPTS argument syntax to use dashes instead of underscores, and remove single-dash options. Also add an extra comment. M cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/shell_commands - Update syntax for regression test that used analytic ICs to now use dashes (`--analytic-ic`) M test/unit/test_cam_config.py - Fix unit test structure that was using a no-longer-supported single-dash config argument. If there are new failures (compared to the `test/existing-test-failures.txt` file), have them OK'd by the gatekeeper, note them here, and add them to the file. If there are baseline differences, include the test and the reason for the diff. What is the nature of the change? Roundoff? derecho/intel/aux_sima: ALL PASS derecho/gnu/aux_sima: ALL PASS If this changes climate describe any run(s) done to evaluate the new climate in enough detail that it(they) could be reproduced: CAM-SIMA date used for the baseline comparison tests if different than latest: --- cime_config/cam_config.py | 38 +++++++++++++------ cime_config/config_component.xml | 6 +-- .../outfrq_se_cslam_analy_ic/shell_commands | 2 +- test/unit/test_cam_config.py | 2 +- 4 files changed, 32 insertions(+), 16 deletions(-) diff --git a/cime_config/cam_config.py b/cime_config/cam_config.py index afb298a9..781cb148 100644 --- a/cime_config/cam_config.py +++ b/cime_config/cam_config.py @@ -503,6 +503,10 @@ def __init__(self, case, case_log): "To specify the Kessler and Held-Suarez suites as ", "run time options, use '--physics-suites kessler;held_suarez_1994'."] + #-------------------------- + # Set physics_suites string + #-------------------------- + self.create_config("physics_suites", phys_desc, user_config_opts.physics_suites) @@ -585,7 +589,7 @@ def parse_config_opts(cls, config_opts, test_mode=False): [('analytic_ic', False), ('dyn', 'se'), ('dyn_kind', 'REAL64'), ('phys_kind', 'REAL64'), ('physics_suites', 'kessler')] 5. Check that parse_config_opts works as expected when given both a string and logical argument: - >>> config_opts = ConfigCAM.parse_config_opts("--physics-suites kessler --dyn se --analytic_ic") + >>> config_opts = ConfigCAM.parse_config_opts("--physics-suites kessler --dyn se --analytic-ic") >>> vargs = vars(config_opts) >>> [(x, vargs[x]) for x in sorted(vargs)] [('analytic_ic', True), ('dyn', 'se'), ('dyn_kind', 'REAL64'), ('phys_kind', 'REAL64'), ('physics_suites', 'kessler')] @@ -609,26 +613,38 @@ def parse_config_opts(cls, config_opts, test_mode=False): epilog="Allowed values of "+cco_str) #Add argument options: - parser.add_argument("--physics-suites", "-physics-suites", type=str, - required=True, metavar='', + parser.add_argument("--physics-suites", + type=str, + required=True, + metavar='', help="""Semicolon-separated list of Physics Suite Definition Files (SDFs)""") - parser.add_argument("--dyn", "-dyn", metavar='', - type=str, required=False, default="", + parser.add_argument("--dyn", + type=str, + required=False, + metavar='', + default="", help="""Name of dycore""") - parser.add_argument("--analytic_ic", "-analytic_ic", - action='store_true', required=False, + parser.add_argument("--analytic-ic", + action='store_true', + required=False, help="""Flag to turn on Analytic Initial Conditions (ICs).""") - parser.add_argument("--dyn_kind", "-dyn_kind", - type=str, required=False, default="REAL64", + parser.add_argument("--dyn-kind", + type=str, + required=False, + metavar='', + default="REAL64", help="""Fortran kind used in dycore for type real.""") - parser.add_argument("--phys_kind", "-phys_kind", - type=str, required=False, default="REAL64", + parser.add_argument("--phys-kind", + type=str, + required=False, + metavar='', + default="REAL64", help="""Fortran kind used in physics for type real.""") popts = [opt for opt in config_opts.split(" ") if opt] diff --git a/cime_config/config_component.xml b/cime_config/config_component.xml index 030c5f87..5162cdbd 100644 --- a/cime_config/config_component.xml +++ b/cime_config/config_component.xml @@ -162,10 +162,10 @@ --physics-suites adiabatic - --physics-suites tj2016 --analytic_ic + --physics-suites tj2016 --analytic-ic - --physics-suites kessler --analytic_ic - --physics-suites held_suarez_1994 --analytic_ic + --physics-suites kessler --analytic-ic + --physics-suites held_suarez_1994 --analytic-ic --dyn none --physics-suites adiabatic diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/shell_commands b/cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/shell_commands index 97df00e3..17d353c9 100644 --- a/cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/shell_commands +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq_se_cslam_analy_ic/shell_commands @@ -1,2 +1,2 @@ ./xmlchange CAM_LINKED_LIBS=" " -./xmlchange --append CAM_CONFIG_OPTS="--analytic_ic" +./xmlchange --append CAM_CONFIG_OPTS="--analytic-ic" diff --git a/test/unit/test_cam_config.py b/test/unit/test_cam_config.py index bad32f5f..da994535 100644 --- a/test/unit/test_cam_config.py +++ b/test/unit/test_cam_config.py @@ -67,7 +67,7 @@ def __init__(self): "COMP_ATM" : "cam", "EXEROOT" : "/some/made-up/path", "CASEROOT" : "/another/made-up/path", - "CAM_CONFIG_OPTS" : "-dyn none --physics-suites mango;papaya", + "CAM_CONFIG_OPTS" : "--dyn none --physics-suites mango;papaya", "COMP_ROOT_DIR_ATM" : "/a/third/made-up/path", "CAM_CPPDEFS" : "UNSET", "NTHRDS_ATM" : 1,