Skip to content

Commit

Permalink
Add prefix to meteo nameformat
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaehn committed Oct 19, 2023
1 parent 6e9cd12 commit 06dc70b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions jobs/prepare_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ def main(starttime, hstart, hstop, cfg, model_cfg):
cfg.meteo['inc']):
meteo_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']))
cfg.meteo['prefix'] + time.strftime(cfg.meteo['nameformat']))
if cfg.model == 'icon-art' or cfg.model == 'icon-art-oem':
chem_file = os.path.join(
cfg.icon_input_icbc,
Expand Down Expand Up @@ -371,10 +371,10 @@ def main(starttime, hstart, hstop, cfg, model_cfg):
cfg.meteo['inc']):
src_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']) + '_lbc.nc')
time.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '_lbc.nc')
merged_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']) + '_merged.nc')
time.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '_merged.nc')
ds = xr.open_dataset(src_file)
# Load GEOSP-dataset as ds_geosp at time 00:
if (time.hour == 0):
Expand All @@ -397,10 +397,10 @@ def main(starttime, hstart, hstop, cfg, model_cfg):
if cfg.model.startswith('icon-art'):
meteo_file = os.path.join(
cfg.icon_input_icbc,
starttime.strftime(cfg.meteo['nameformat']) + '.nc')
starttime.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '.nc')
merged_file = os.path.join(
cfg.icon_input_icbc,
starttime.strftime(cfg.meteo['nameformat']) + '_merged.nc')
starttime.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '_merged.nc')
ds = xr.open_dataset(meteo_file)
merging = False
if 'PS' not in ds:
Expand Down Expand Up @@ -436,13 +436,13 @@ def main(starttime, hstart, hstop, cfg, model_cfg):
#------------
meteo_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']) + '.nc')
time.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '.nc')
chem_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.chem_nameformat) + '.nc')
merged_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']) +
time.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) +
'_merged.nc')
ds_meteo = xr.open_dataset(meteo_file)
ds_chem = xr.open_dataset(chem_file)
Expand All @@ -467,13 +467,13 @@ def main(starttime, hstart, hstop, cfg, model_cfg):
#------------
meteo_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']) + '_lbc.nc')
time.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '_lbc.nc')
chem_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.chem_nameformat) + '_lbc.nc')
merged_file = os.path.join(
cfg.icon_input_icbc,
time.strftime(cfg.meteo['nameformat']) + '_merged.nc')
time.strftime(cfg.meteo['prefix'] + cfg.meteo['nameformat']) + '_merged.nc')
ds_meteo = xr.open_dataset(meteo_file)
ds_chem = xr.open_dataset(chem_file)
# LNPS --> PS
Expand Down

0 comments on commit 06dc70b

Please sign in to comment.