Skip to content

Commit

Permalink
Merge branch 'development' into develop/optional-mpas-features
Browse files Browse the repository at this point in the history
  • Loading branch information
kuanchihwang committed Feb 7, 2025
2 parents e97fd3c + 2b81de7 commit e39892e
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 17 deletions.
38 changes: 27 additions & 11 deletions cime_config/cam_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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')]
Expand All @@ -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='<CCPP_SDFs>',
parser.add_argument("--physics-suites",
type=str,
required=True,
metavar='<CCPP_SDFs>',
help="""Semicolon-separated list of Physics Suite
Definition Files (SDFs)""")

parser.add_argument("--dyn", "-dyn", metavar='<dycore>',
type=str, required=False, default="",
parser.add_argument("--dyn",
type=str,
required=False,
metavar='<dycore>',
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='<kind string>',
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='<kind string>',
default="REAL64",
help="""Fortran kind used in physics for type real.""")

popts = [opt for opt in config_opts.split(" ") if opt]
Expand Down
6 changes: 3 additions & 3 deletions cime_config/config_component.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@

<!-- Simple models -->
<value compset="_CAM%ADIAB">--physics-suites adiabatic</value>
<value compset="_CAM%TJ16">--physics-suites tj2016 --analytic_ic</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%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>

<!-- Aquaplanet -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
./xmlchange CAM_LINKED_LIBS=" "
./xmlchange --append CAM_CONFIG_OPTS="--analytic_ic"
./xmlchange --append CAM_CONFIG_OPTS="--analytic-ic"
5 changes: 4 additions & 1 deletion src/physics/utils/orbital_data.meta
Original file line number Diff line number Diff line change
Expand Up @@ -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)
dimensions = (horizontal_dimension)
protected = True
2 changes: 1 addition & 1 deletion test/unit/test_cam_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e39892e

Please sign in to comment.