diff --git a/python/ctsm/site_and_regional/neon_arg_parse.py b/python/ctsm/site_and_regional/neon_arg_parse.py index 3aa619aad3..7317c947fb 100644 --- a/python/ctsm/site_and_regional/neon_arg_parse.py +++ b/python/ctsm/site_and_regional/neon_arg_parse.py @@ -195,6 +195,17 @@ def get_parser(args, description, valid_neon_sites): choices=["v1", "v2", "v3"], ) + parser.add_argument( + "--xmlchange", + help=""" + Any xmlchanges (e.g., CLM_CO2_TYPE=constant,CCSM_CO2_PPMV=500) + [default: %(default)s] + """, + required=False, + type=str, + default=None, + ) + args = parse_args_and_handle_standard_logging_options(args, parser) if "all" in args.neon_sites: @@ -254,4 +265,5 @@ def get_parser(args, description, valid_neon_sites): args.rerun, args.no_input_data_check, args.user_version, + args.xmlchange, ) diff --git a/python/ctsm/site_and_regional/neon_site.py b/python/ctsm/site_and_regional/neon_site.py index 7978eac2ed..82ef7adf05 100755 --- a/python/ctsm/site_and_regional/neon_site.py +++ b/python/ctsm/site_and_regional/neon_site.py @@ -68,6 +68,7 @@ def run_case( rerun=False, experiment=False, no_input_data_check=False, + xmlchange=None, ): """ Run case. @@ -116,6 +117,7 @@ def run_case( rerun, experiment, no_input_data_check, + xmlchange, ) def modify_user_nl(self, case_root, run_type, rundir, site_lines=None): diff --git a/python/ctsm/site_and_regional/run_neon.py b/python/ctsm/site_and_regional/run_neon.py index d4ded645b7..2d9346d49e 100755 --- a/python/ctsm/site_and_regional/run_neon.py +++ b/python/ctsm/site_and_regional/run_neon.py @@ -196,6 +196,7 @@ def main(description): rerun, no_input_data_check, user_version, + xmlchange, ) = get_parser(sys.argv, description, valid_neon_sites) if output_root: @@ -242,4 +243,5 @@ def main(description): rerun=rerun, experiment=experiment, no_input_data_check=no_input_data_check, + xmlchange=xmlchange, ) diff --git a/python/ctsm/site_and_regional/tower_site.py b/python/ctsm/site_and_regional/tower_site.py index 7f83b29663..33b36b7613 100644 --- a/python/ctsm/site_and_regional/tower_site.py +++ b/python/ctsm/site_and_regional/tower_site.py @@ -264,6 +264,7 @@ def run_case( rerun, experiment, no_input_data_check, + xmlchange, ): """ Run case. @@ -411,6 +412,12 @@ def run_case( if not rundir: rundir = case.get_value("RUNDIR") + if xmlchange: + xmlchange_list = xmlchange.split(",") + for setting in xmlchange_list: + setting_split = setting.split("=") + case.set_value(*setting_split) + self.modify_user_nl(case_root, run_type, rundir) case.create_namelists()