Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/exgdas_global_marine_analysis_prep.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ def find_clim_ens(input_date):
################################################################################
# Copy initial condition

bkg_utils.stage_ic(bkg_dir, anl_dir, RUN, gcyc)
bkg_utils.stage_ic(bkg_dir, anl_dir, gcyc)

################################################################################
# prepare input.nml
Expand Down
9 changes: 4 additions & 5 deletions ush/soca/bkg_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@ def gen_bkg_list(bkg_path, out_path, window_begin=' ', yaml_name='bkg.yaml', ice
bkg_date = window_begin

# Construct list of background file names
RUN = os.getenv('RUN')
cyc = str(os.getenv('cyc')).zfill(2)
gcyc = str((int(cyc) - 6) % 24).zfill(2) # previous cycle
fcst_hrs = list(range(3, 10, dt_pseudo))
files = []
for fcst_hr in fcst_hrs:
files.append(os.path.join(bkg_path, f'{RUN}.ocean.t'+gcyc+'z.inst.f'+str(fcst_hr).zfill(3)+'.nc'))
files.append(os.path.join(bkg_path, f'gdas.ocean.t'+gcyc+'z.inst.f'+str(fcst_hr).zfill(3)+'.nc'))

# Identify the ocean background that will be used for the vertical coordinate remapping
ocn_filename_ic = os.path.splitext(os.path.basename(files[0]))[0]+'.nc'
Expand Down Expand Up @@ -159,17 +158,17 @@ def gen_bkg_list(bkg_path, out_path, window_begin=' ', yaml_name='bkg.yaml', ice
FileHandler({'copy': bkg_list_src_dst}).sync()


def stage_ic(bkg_dir, anl_dir, RUN, gcyc):
def stage_ic(bkg_dir, anl_dir, gcyc):

# Copy and rename initial condition
ics_list = []
# ocean IC's
mom_ic_src = os.path.join(bkg_dir, f'{RUN}.ocean.t{gcyc}z.inst.f003.nc')
mom_ic_src = os.path.join(bkg_dir, f'gdas.ocean.t{gcyc}z.inst.f003.nc')
mom_ic_dst = os.path.join(anl_dir, 'INPUT', 'MOM.res.nc')
ics_list.append([mom_ic_src, mom_ic_dst])

# seaice IC's
cice_ic_src = os.path.join(bkg_dir, f'{RUN}.agg_ice.t{gcyc}z.inst.f003.nc')
cice_ic_src = os.path.join(bkg_dir, f'gdas.agg_ice.t{gcyc}z.inst.f003.nc')
cice_ic_dst = os.path.join(anl_dir, 'INPUT', 'cice.res.nc')
ics_list.append([cice_ic_src, cice_ic_dst])
FileHandler({'copy': ics_list}).sync()