Skip to content

Commit

Permalink
ilamb config updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TeaganKing committed Feb 18, 2025
1 parent 7e932fb commit 62372f9
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions helper_scripts/generate_ilamb_config_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def generate_ilamb_model_setup(cesm_root, cupid_config_loc, run_type):
sys.path.append(os.path.join(cesm_root, "cime"))

cupid_root = os.path.join(cesm_root, "tools", "CUPiD")
ilamb_config_loc = os.path.join(cesm_root, "tools", "CUPiD", "ilamb_aux")
# Is cupid_config_loc a valid value?
if cupid_config_loc is None:
cupid_config_loc = os.path.join(
Expand Down Expand Up @@ -141,19 +140,14 @@ def generate_ilamb_model_setup(cesm_root, cupid_config_loc, run_type):
)
print("---------")
print("conda activate cupid-analysis")
print(f"export ILAMB_ROOT={os.getcwd()}")
print(f"export ILAMB_ROOT={os.path.join(cupid_config_loc, 'ilamb_aux')}")
if os.path.exists(os.path.join(cupid_config_loc, "ILAMB_output/")):
print(
"WARNING: directory {os.path.join(cupid_config_loc, 'ILAMB_output/'} exists; this may cause issues with runnign ILAMB. It is recommended to remove this directory prior to running the following command.", # noqa: E501
)
if run_type == "SP":
print(
f"ilamb-run --config {os.path.join(cupid_config_loc, 'ilamb_nohoff_final_CLM_SP.cfg')} --build_dir {os.path.join(cupid_config_loc, 'ILAMB_output/')} --df_errs {os.path.join(ilamb_config_loc, 'quantiles_Whittaker_cmip5v6.parquet')} --define_regions {os.path.join(ilamb_config_loc, 'DATA/regions/LandRegions.nc')} {os.path.join(ilamb_config_loc, 'DATA/regions/Whittaker.nc')} --regions global --model_setup {os.path.join(cupid_config_loc, 'model_setup.txt')} --filter .clm2.h0.", # noqa: E501
)
elif run_type == "BGC":
print(
f"ilamb-run --config {os.path.join(cupid_config_loc, 'ilamb_nohoff_final_CLM_BGC.cfg')} --build_dir {os.path.join(cupid_config_loc, 'ILAMB_output/')} --df_errs {os.path.join(ilamb_config_loc, 'quantiles_Whittaker_cmip5v6.parquet')} --define_regions {os.path.join(ilamb_config_loc, 'DATA/regions/LandRegions.nc')} {os.path.join(ilamb_config_loc, 'DATA/regions/Whittaker.nc')} --regions global --model_setup {os.path.join(cupid_config_loc, 'model_setup.txt')} --filter .clm2.h0.", # noqa: E501
f"WARNING: directory {os.path.join(cupid_config_loc, 'ILAMB_output/')} exists; this may cause issues with runnign ILAMB. It is recommended to remove this directory prior to running the following command.", # noqa: E501
)
print(
f"ilamb-run --config {os.path.join(cupid_config_loc, f'ilamb_nohoff_final_CLM_{run_type}.cfg')} --build_dir {os.path.join(cupid_config_loc, 'ILAMB_output/')} --df_errs {os.path.join(cupid_config_loc, 'ilamb_aux', 'quantiles_Whittaker_cmip5v6.parquet')} --define_regions {os.path.join(cupid_config_loc, 'ilamb_aux', 'DATA/regions/LandRegions.nc')} {os.path.join(cupid_config_loc, 'ilamb_aux', 'DATA/regions/Whittaker.nc')} --regions global --model_setup {os.path.join(cupid_config_loc, 'model_setup.txt')} --filter .clm2.h0.", # noqa: E501
)
print("---------")


Expand Down

0 comments on commit 62372f9

Please sign in to comment.