Skip to content

Commit

Permalink
Fix warm-start IC staging (#1529)
Browse files Browse the repository at this point in the history
The incorrect path was used for staging coupled components during the COM refactor update (#1421). These are now corrected.

Fixes #1528
  • Loading branch information
guillaumevernieres authored Apr 26, 2023
1 parent 7421d80 commit 1e4a24c
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions workflow/setup_expt.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ 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, 'model_data', 'atmos')):
if os.path.isdir(os.path.join(inputs.icsdir, f'{inputs.cdump}.{rdatestr[:8]}', rdatestr[8:], 'model_data', 'atmos')):
flat_structure = False
else:
flat_structure = True
Expand All @@ -94,7 +94,7 @@ def fill_COMROT_cycled(host, inputs):

if flat_structure:
# ICs are in the old flat COM structure
if inputs.start in ['warm']: # This is warm start experiment (only meaningful for atmos)
if inputs.start in ['warm']: # This is warm start experiment
src_atm_dir = os.path.join('atmos', 'RESTART')
src_med_dir = os.path.join('med', 'RESTART')
elif inputs.start in ['cold']: # This is a cold start experiment
Expand Down Expand Up @@ -154,7 +154,7 @@ def link_files_from_src_to_dst(src_dir, dst_dir):
if do_ocean:
detdir = f'{inputs.cdump}.{rdatestr[:8]}/{rdatestr[8:]}'
dst_dir = os.path.join(comrot, detdir, dst_ocn_rst_dir)
src_dir = os.path.join(inputs.icsdir, detdir, 'ocean', src_ocn_rst_dir)
src_dir = os.path.join(inputs.icsdir, detdir, src_ocn_rst_dir)
makedirs_if_missing(dst_dir)
link_files_from_src_to_dst(src_dir, dst_dir)

Expand All @@ -169,16 +169,16 @@ def link_files_from_src_to_dst(src_dir, dst_dir):
# Link ice files
if do_ice:
detdir = f'{inputs.cdump}.{rdatestr[:8]}/{rdatestr[8:]}'
dst_dir = os.path.join(comrot, detdir, 'ice', dst_ice_dir)
src_dir = os.path.join(inputs.icsdir, detdir, 'ice', src_ice_dir)
dst_dir = os.path.join(comrot, detdir, dst_ice_dir)
src_dir = os.path.join(inputs.icsdir, detdir, src_ice_dir)
makedirs_if_missing(dst_dir)
link_files_from_src_to_dst(src_dir, dst_dir)

# Link mediator files
if do_med:
detdir = f'{inputs.cdump}.{rdatestr[:8]}/{rdatestr[8:]}'
dst_dir = os.path.join(comrot, detdir, 'med', dst_med_dir)
src_dir = os.path.join(inputs.icsdir, detdir, 'med', src_med_dir)
dst_dir = os.path.join(comrot, detdir, dst_med_dir)
src_dir = os.path.join(inputs.icsdir, detdir, src_med_dir)
makedirs_if_missing(dst_dir)
link_files_from_src_to_dst(src_dir, dst_dir)

Expand All @@ -188,8 +188,8 @@ def link_files_from_src_to_dst(src_dir, dst_dir):
detdir = f'{inputs.cdump}.{rdatestr[:8]}/{rdatestr[8:]}'
elif inputs.start in ['cold']:
detdir = f'{inputs.cdump}.{idatestr[:8]}/{idatestr[8:]}'
dst_dir = os.path.join(comrot, detdir, 'chem', chem_dir)
src_dir = os.path.join(inputs.icsdir, detdir, 'chem', chem_dir)
dst_dir = os.path.join(comrot, detdir, chem_dir)
src_dir = os.path.join(inputs.icsdir, detdir, chem_dir)
makedirs_if_missing(dst_dir)
link_files_from_src_to_dst(src_dir, dst_dir)

Expand Down

0 comments on commit 1e4a24c

Please sign in to comment.