From e8569c9475919a6b25b349839a352179dbb0bbf6 Mon Sep 17 00:00:00 2001 From: Guillaume Vernieres Date: Wed, 24 Apr 2024 14:59:30 -0400 Subject: [PATCH] added switch for cycling type --- scripts/exgdas_global_marine_analysis_prep.py | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/scripts/exgdas_global_marine_analysis_prep.py b/scripts/exgdas_global_marine_analysis_prep.py index d80bfc834..686b4c8e8 100755 --- a/scripts/exgdas_global_marine_analysis_prep.py +++ b/scripts/exgdas_global_marine_analysis_prep.py @@ -70,10 +70,6 @@ def find_clim_ens(input_date): staticsoca_dir = os.getenv('SOCA_INPUT_FIX_DIR') nmem_ens = 0 nmem_ens = int(os.getenv('NMEM_ENS')) -if os.getenv('DOHYBVAR') == "YES": - dohybvar = True -else: - dohybvar = False # create analysis directories diags = os.path.join(anl_dir, 'diags') # output dir for soca DA obs space @@ -89,12 +85,25 @@ def find_clim_ens(input_date): window_begin = datetime.strptime(os.getenv('PDY')+os.getenv('cyc'), '%Y%m%d%H') - half_assim_freq window_begin_iso = window_begin.strftime('%Y-%m-%dT%H:%M:%SZ') window_middle_iso = window_middle.strftime('%Y-%m-%dT%H:%M:%SZ') -fcst_begin = datetime.strptime(os.getenv('PDY')+os.getenv('cyc'), '%Y%m%d%H') RUN = os.getenv('RUN') cyc = os.getenv('cyc') gcyc = os.getenv('gcyc') PDY = os.getenv('PDY') +# hybrid-envar switch +if os.getenv('DOHYBVAR') == "YES": + dohybvar = True +else: + dohybvar = False + +# switch for the cycling type +if os.getenv('DOIAU') == "YES": + # forecast initialized at the begining of the DA window + fcst_begin = window_begin +else: + # forecast initialized at the middle of the DA window + fcst_begin = datetime.strptime(os.getenv('PDY')+os.getenv('cyc'), '%Y%m%d%H') + ################################################################################ # fetch observations