Skip to content

Commit

Permalink
Add module load cdo to regrid_ggcmi_shdates.py for sys test to pass
Browse files Browse the repository at this point in the history
  • Loading branch information
slevis-lmwg committed Dec 8, 2023
1 parent b45d142 commit ff02bad
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/ctsm/crop_calendars/regrid_ggcmi_shdates.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def main(

# Ensure we can call necessary shell script(s)
for cmd in ["cdo"]:
run_and_check(f"{cmd} --help")
run_and_check(f"module load {cmd}; {cmd} --help")

os.chdir(regrid_input_directory)
if not os.path.exists(regrid_output_directory):
Expand Down Expand Up @@ -137,15 +137,15 @@ def main(

# Sometimes cdo fails for no apparent reason. In testing this never happened more than 3x in a row.
try:
run_and_check(f"cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
run_and_check(f"module load cdo; cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
except:
try:
run_and_check(f"cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
run_and_check(f"module load cdo; cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
except:
try:
run_and_check(f"cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
run_and_check(f"module load cdo; cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
except:
run_and_check(f"cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")
run_and_check(f"module load cdo; cdo -L -remapnn,'{templatefile}' -setmisstonn '{f}' '{f3}'")

# Delete template file, which is no longer needed
os.remove(templatefile)
Expand Down

0 comments on commit ff02bad

Please sign in to comment.