Skip to content

Commit

Permalink
a few other fixes for having None option for either neon or plumber
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing committed Jul 24, 2024
1 parent 70726aa commit 3c308e7
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
2 changes: 0 additions & 2 deletions python/ctsm/site_and_regional/plumber_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ def build_base_case(
user_mods_dirs = [
os.path.join(self.cesmroot, "cime_config", "usermods_dirs", "PLUMBER2", self.name)
]
print("in plumbersite adding usermodsdirs")
print("usermodsdirs: {}".format(user_mods_dirs))
case_path = super().build_base_case(cesmroot, output_root, res, compset, user_mods_dirs)

return case_path
Expand Down
88 changes: 45 additions & 43 deletions python/ctsm/site_and_regional/run_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,53 +254,55 @@ def main(description):
compset = "I1PtClm60Bgc"

# -- Looping over neon sites
for neon_site in available_list:
if neon_site.name in neon_site_list:
if run_from_postad:
neon_site.finidat = None
if not base_case_root:
user_mods_dirs = None
base_case_root = neon_site.build_base_case(
cesmroot, output_root, res, compset, user_mods_dirs, overwrite, setup_only
if neon_site_list:
for neon_site in available_list:
if neon_site.name in neon_site_list:
if run_from_postad:
neon_site.finidat = None
if not base_case_root:
user_mods_dirs = None
base_case_root = neon_site.build_base_case(
cesmroot, output_root, res, compset, user_mods_dirs, overwrite, setup_only
)
logger.info("-----------------------------------")
logger.info("Running CTSM for neon site : %s", neon_site.name)

neon_site.run_case(
base_case_root,
run_type,
prism,
user_version,
overwrite=overwrite,
setup_only=setup_only,
no_batch=no_batch,
rerun=rerun,
experiment=experiment,
)
logger.info("-----------------------------------")
logger.info("Running CTSM for neon site : %s", neon_site.name)

neon_site.run_case(
base_case_root,
run_type,
prism,
user_version,
overwrite=overwrite,
setup_only=setup_only,
no_batch=no_batch,
rerun=rerun,
experiment=experiment,
)

# -- check for available plumber data:
available_plumber_list = check_plumber_data(valid_plumber_sites)

# -- Looping over plumber sites
for plumber_site in available_plumber_list:
if plumber_site.name in plumber_site_list:
if run_from_postad:
plumber_site.finidat = None
if not base_case_root:
user_mods_dirs = None
base_case_root = plumber_site.build_base_case(
cesmroot, output_root, res, compset, user_mods_dirs, overwrite, setup_only
if plumber_site_list:
for plumber_site in available_plumber_list:
if plumber_site.name in plumber_site_list:
if run_from_postad:
plumber_site.finidat = None
if not base_case_root:
user_mods_dirs = None
base_case_root = plumber_site.build_base_case(
cesmroot, output_root, res, compset, user_mods_dirs, overwrite, setup_only
)
logger.info("-----------------------------------")
logger.info("Running CTSM for plumber site : %s", plumber_site.name)
plumber_site.run_case(
base_case_root,
run_type,
prism,
user_version,
overwrite,
setup_only,
no_batch,
rerun,
experiment,
)
logger.info("-----------------------------------")
logger.info("Running CTSM for plumber site : %s", plumber_site.name)
plumber_site.run_case(
base_case_root,
run_type,
prism,
user_version,
overwrite,
setup_only,
no_batch,
rerun,
experiment,
)
6 changes: 3 additions & 3 deletions python/ctsm/site_and_regional/tower_arg_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_parser(args, description, valid_neon_sites, valid_plumber_sites):
required=False,
choices=valid_neon_sites + ["all"] + [None],
dest="neon_sites",
default=[None],
default=None,
nargs="+",
)

Expand Down Expand Up @@ -203,7 +203,7 @@ def get_parser(args, description, valid_neon_sites, valid_plumber_sites):
neon_sites = args.neon_sites
for site in neon_sites:
if site not in valid_neon_sites:
raise ValueError("Invalid site name {}".format(site))
raise ValueError("Invalid neon site name {}".format(site))
else:
neon_sites = None
if args.plumber_sites:
Expand All @@ -213,7 +213,7 @@ def get_parser(args, description, valid_neon_sites, valid_plumber_sites):
plumber_sites = args.plumber_sites
for site in plumber_sites:
if site not in valid_plumber_sites:
raise ValueError("Invalid site name {}".format(site))
raise ValueError("Invalid plumber site name {}".format(site))
else:
plumber_sites = None

Expand Down

0 comments on commit 3c308e7

Please sign in to comment.