Skip to content

Commit

Permalink
Fix IC linking in setup_expt.py (NOAA-EMC#1885)
Browse files Browse the repository at this point in the history
This fixes a bug in IC linking within setup_expt.py by correcting the date string
based on experiment start type -- warm starts should look at `rdate` (-6 hours)
and cold starts should look at `idate` (current cycle).

Fixes NOAA-EMC#1783
  • Loading branch information
DavidHuber-NOAA authored Sep 26, 2023
1 parent 527aa16 commit 3d2b72e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,15 @@ def fill_COMROT_cycled(host, inputs):
rdatestr = datetime_to_YMDH(inputs.idate - to_timedelta('T06H'))
idatestr = datetime_to_YMDH(inputs.idate)

if os.path.isdir(os.path.join(inputs.icsdir, f'{inputs.cdump}.{rdatestr[:8]}', rdatestr[8:], 'model_data', 'atmos')):
# Test if we are using the new COM structure or the old flat one for ICs
if inputs.start in ['warm']:
pathstr = os.path.join(inputs.icsdir, f'{inputs.cdump}.{rdatestr[:8]}',
rdatestr[8:], 'model_data', 'atmos')
else:
pathstr = os.path.join(inputs.icsdir, f'{inputs.cdump}.{idatestr[:8]}',
idatestr[8:], 'model_data', 'atmos')

if os.path.isdir(pathstr):
flat_structure = False
else:
flat_structure = True
Expand Down

0 comments on commit 3d2b72e

Please sign in to comment.