From 4098f108a6e48df1822b1da42e9ad307845e5ef5 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Mon, 9 Sep 2024 10:58:38 -0400 Subject: [PATCH 01/17] Remove the GTS BUFR2IODA part of the snow obs prep job and Replace it with a direct read from BUFR at runtime. --- parm/config/gfs/config.prepsnowobs | 3 - parm/config/gfs/config.snowanl | 1 + scripts/exglobal_prep_snow_obs.py | 1 - ush/python/pygfs/task/snow_analysis.py | 92 ++++---------------------- 4 files changed, 15 insertions(+), 82 deletions(-) diff --git a/parm/config/gfs/config.prepsnowobs b/parm/config/gfs/config.prepsnowobs index 60ca16ce9e..20bdd89ddf 100644 --- a/parm/config/gfs/config.prepsnowobs +++ b/parm/config/gfs/config.prepsnowobs @@ -8,11 +8,8 @@ echo "BEGIN: config.prepsnowobs" # Get task specific resources . "${EXPDIR}/config.resources" prepsnowobs -export GTS_OBS_LIST="${PARMgfs}/gdas/snow/prep/prep_gts.yaml.j2" export IMS_OBS_LIST="${PARMgfs}/gdas/snow/prep/prep_ims.yaml.j2" -export BUFR2IODAX="${EXECgfs}/bufr2ioda.x" - export CALCFIMSEXE="${EXECgfs}/calcfIMS.exe" export FIMS_NML_TMPL="${PARMgfs}/gdas/snow/prep/fims.nml.j2" diff --git a/parm/config/gfs/config.snowanl b/parm/config/gfs/config.snowanl index a2984f190b..c1a99f99ea 100644 --- a/parm/config/gfs/config.snowanl +++ b/parm/config/gfs/config.snowanl @@ -9,6 +9,7 @@ echo "BEGIN: config.snowanl" source "${EXPDIR}/config.resources" snowanl export OBS_LIST="${PARMgfs}/gdas/snow/obs/lists/gdas_snow.yaml.j2" +export GTS_LIST="${PARMgfs}/gdas/snow/obs/config/bufr2ioda_mapping.yaml.j2" # Name of the JEDI executable and its yaml template export JEDIEXE="${EXECgfs}/gdas.x" diff --git a/scripts/exglobal_prep_snow_obs.py b/scripts/exglobal_prep_snow_obs.py index a6a9070151..aa1eb1bb7d 100755 --- a/scripts/exglobal_prep_snow_obs.py +++ b/scripts/exglobal_prep_snow_obs.py @@ -20,6 +20,5 @@ # Instantiate the snow prepare task SnowAnl = SnowAnalysis(config) - SnowAnl.prepare_GTS() if SnowAnl.task_config.cyc == 0: SnowAnl.prepare_IMS() diff --git a/ush/python/pygfs/task/snow_analysis.py b/ush/python/pygfs/task/snow_analysis.py index 9656b00a8e..ca2d4fd49b 100644 --- a/ush/python/pygfs/task/snow_analysis.py +++ b/ush/python/pygfs/task/snow_analysis.py @@ -54,83 +54,6 @@ def __init__(self, config): # Extend task_config with local_dict self.task_config = AttrDict(**self.task_config, **local_dict) - @logit(logger) - def prepare_GTS(self) -> None: - """Prepare the GTS data for a global snow analysis - - This method will prepare GTS data for a global snow analysis using JEDI. - This includes: - - processing GTS bufr snow depth observation data to IODA format - - Parameters - ---------- - Analysis: parent class for GDAS task - - Returns - ---------- - None - """ - - # create a temporary dict of all keys needed in this method - localconf = AttrDict() - keys = ['HOMEgfs', 'DATA', 'current_cycle', 'COM_OBS', 'COM_ATMOS_RESTART_PREV', - 'OPREFIX', 'CASE', 'OCNRES', 'ntiles'] - for key in keys: - localconf[key] = self.task_config[key] - - # Read and render the GTS_OBS_LIST yaml - logger.info(f"Reading {self.task_config.GTS_OBS_LIST}") - prep_gts_config = parse_j2yaml(self.task_config.GTS_OBS_LIST, localconf) - logger.debug(f"{self.task_config.GTS_OBS_LIST}:\n{pformat(prep_gts_config)}") - - # copy the GTS obs files from COM_OBS to DATA/obs - logger.info("Copying GTS obs for bufr2ioda.x") - FileHandler(prep_gts_config.gtsbufr).sync() - - logger.info("Link BUFR2IODAX into DATA/") - exe_src = self.task_config.BUFR2IODAX - exe_dest = os.path.join(localconf.DATA, os.path.basename(exe_src)) - if os.path.exists(exe_dest): - rm_p(exe_dest) - os.symlink(exe_src, exe_dest) - - # Create executable instance - exe = Executable(self.task_config.BUFR2IODAX) - - def _gtsbufr2iodax(exe, yaml_file): - if not os.path.isfile(yaml_file): - logger.exception(f"FATAL ERROR: {yaml_file} not found") - raise FileNotFoundError(yaml_file) - - logger.info(f"Executing {exe}") - try: - exe(yaml_file) - except OSError: - raise OSError(f"Failed to execute {exe} {yaml_file}") - except Exception: - raise WorkflowException(f"An error occured during execution of {exe} {yaml_file}") - - # Loop over entries in prep_gts_config.bufr2ioda keys - # 1. generate bufr2ioda YAML files - # 2. execute bufr2ioda.x - for name in prep_gts_config.bufr2ioda.keys(): - gts_yaml = os.path.join(self.task_config.DATA, f"bufr_{name}_snow.yaml") - logger.info(f"Generate BUFR2IODA YAML file: {gts_yaml}") - temp_yaml = parse_j2yaml(prep_gts_config.bufr2ioda[name], localconf) - save_as_yaml(temp_yaml, gts_yaml) - logger.info(f"Wrote bufr2ioda YAML to: {gts_yaml}") - - # execute BUFR2IODAX to convert {name} bufr data into IODA format - _gtsbufr2iodax(exe, gts_yaml) - - # Ensure the IODA snow depth GTS file is produced by the IODA converter - # If so, copy to COM_OBS/ - try: - FileHandler(prep_gts_config.gtsioda).sync() - except OSError as err: - logger.exception(f"{self.task_config.BUFR2IODAX} failed to produce GTS ioda files") - raise OSError(err) - @logit(logger) def prepare_IMS(self) -> None: """Prepare the IMS data for a global snow analysis @@ -248,7 +171,7 @@ def initialize(self) -> None: # create a temporary dict of all keys needed in this method localconf = AttrDict() - keys = ['DATA', 'current_cycle', 'COM_OBS', 'COM_ATMOS_RESTART_PREV', + keys = ['HOMEgfs', 'DATA', 'current_cycle', 'COM_OBS', 'COM_ATMOS_RESTART_PREV', 'OPREFIX', 'CASE', 'OCNRES', 'ntiles'] for key in keys: localconf[key] = self.task_config[key] @@ -272,6 +195,19 @@ def initialize(self) -> None: save_as_yaml(self.task_config.jedi_config, self.task_config.jedi_yaml) logger.info(f"Wrote letkfoi YAML to: {self.task_config.jedi_yaml}") + # Read and render the GTS_LIST yaml + logger.info(f"Reading {self.task_config.GTS_LIST}") + gts_config = parse_j2yaml(self.task_config.GTS_LIST, localconf) + logger.debug(f"{self.task_config.GTS_LIST}:\n{pformat(gts_config)}") + + # Generate bufr2ioda mapping YAML files + for name in gts_config.bufr2ioda.keys(): + mapping_yaml = os.path.join(self.task_config.DATA, "obs", f"bufr_{name}_mapping.yaml") + logger.info(f"Generate BUFR2IODA YAML file: {mapping_yaml}") + temp_yaml = parse_j2yaml(gts_config.bufr2ioda[name], localconf) + save_as_yaml(temp_yaml, mapping_yaml) + logger.info(f"Wrote bufr2ioda YAML to: {mapping_yaml}") + # need output dir for diags and anl logger.info("Create empty output [anl, diags] directories to receive output from executable") newdirs = [ From 8d1bc8743c30b8db006d7e0731c7bd94eb1baf73 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Mon, 9 Sep 2024 20:38:56 -0400 Subject: [PATCH 02/17] Change HOMEgfs to PARMgfs. --- ush/python/pygfs/task/snow_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ush/python/pygfs/task/snow_analysis.py b/ush/python/pygfs/task/snow_analysis.py index ca2d4fd49b..aa51a65bf6 100644 --- a/ush/python/pygfs/task/snow_analysis.py +++ b/ush/python/pygfs/task/snow_analysis.py @@ -171,7 +171,7 @@ def initialize(self) -> None: # create a temporary dict of all keys needed in this method localconf = AttrDict() - keys = ['HOMEgfs', 'DATA', 'current_cycle', 'COM_OBS', 'COM_ATMOS_RESTART_PREV', + keys = ['PARMgfs', 'DATA', 'current_cycle', 'COM_OBS', 'COM_ATMOS_RESTART_PREV', 'OPREFIX', 'CASE', 'OCNRES', 'ntiles'] for key in keys: localconf[key] = self.task_config[key] From 5074d11abf0fce18b4fca2b4c31623cb0582516a Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Thu, 12 Sep 2024 07:13:51 -0400 Subject: [PATCH 03/17] Made changes to stage the static GTS mapping files. --- ush/python/pygfs/task/snow_analysis.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/ush/python/pygfs/task/snow_analysis.py b/ush/python/pygfs/task/snow_analysis.py index aa51a65bf6..4a6c6efd8a 100644 --- a/ush/python/pygfs/task/snow_analysis.py +++ b/ush/python/pygfs/task/snow_analysis.py @@ -191,23 +191,15 @@ def initialize(self) -> None: logger.info("Staging ensemble backgrounds") FileHandler(self.get_ens_bkg_dict(localconf)).sync() + # stage GTS bufr2ioda mapping YAML files + logger.info(f"Staging GTS bufr2ioda mapping YAML files from {self.task_config.GTS_LIST}") + gts_mapping_list = parse_j2yaml(self.task_config.GTS_LIST, localconf) + FileHandler(gts_mapping_list).sync() + # Write out letkfoi YAML file save_as_yaml(self.task_config.jedi_config, self.task_config.jedi_yaml) logger.info(f"Wrote letkfoi YAML to: {self.task_config.jedi_yaml}") - # Read and render the GTS_LIST yaml - logger.info(f"Reading {self.task_config.GTS_LIST}") - gts_config = parse_j2yaml(self.task_config.GTS_LIST, localconf) - logger.debug(f"{self.task_config.GTS_LIST}:\n{pformat(gts_config)}") - - # Generate bufr2ioda mapping YAML files - for name in gts_config.bufr2ioda.keys(): - mapping_yaml = os.path.join(self.task_config.DATA, "obs", f"bufr_{name}_mapping.yaml") - logger.info(f"Generate BUFR2IODA YAML file: {mapping_yaml}") - temp_yaml = parse_j2yaml(gts_config.bufr2ioda[name], localconf) - save_as_yaml(temp_yaml, mapping_yaml) - logger.info(f"Wrote bufr2ioda YAML to: {mapping_yaml}") - # need output dir for diags and anl logger.info("Create empty output [anl, diags] directories to receive output from executable") newdirs = [ From f122edf47da50c78a0dee9e5dd2f00514456eebd Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Thu, 12 Sep 2024 09:35:22 -0400 Subject: [PATCH 04/17] Change the name to be more descriptive. --- parm/config/gfs/config.snowanl | 2 +- ush/python/pygfs/task/snow_analysis.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parm/config/gfs/config.snowanl b/parm/config/gfs/config.snowanl index c1a99f99ea..b1460dfa67 100644 --- a/parm/config/gfs/config.snowanl +++ b/parm/config/gfs/config.snowanl @@ -9,7 +9,7 @@ echo "BEGIN: config.snowanl" source "${EXPDIR}/config.resources" snowanl export OBS_LIST="${PARMgfs}/gdas/snow/obs/lists/gdas_snow.yaml.j2" -export GTS_LIST="${PARMgfs}/gdas/snow/obs/config/bufr2ioda_mapping.yaml.j2" +export GTS_SNOW_STAGE_YAML="${PARMgfs}/gdas/snow/obs/config/bufr2ioda_mapping.yaml.j2" # Name of the JEDI executable and its yaml template export JEDIEXE="${EXECgfs}/gdas.x" diff --git a/ush/python/pygfs/task/snow_analysis.py b/ush/python/pygfs/task/snow_analysis.py index 4a6c6efd8a..4b991d2b34 100644 --- a/ush/python/pygfs/task/snow_analysis.py +++ b/ush/python/pygfs/task/snow_analysis.py @@ -192,8 +192,8 @@ def initialize(self) -> None: FileHandler(self.get_ens_bkg_dict(localconf)).sync() # stage GTS bufr2ioda mapping YAML files - logger.info(f"Staging GTS bufr2ioda mapping YAML files from {self.task_config.GTS_LIST}") - gts_mapping_list = parse_j2yaml(self.task_config.GTS_LIST, localconf) + logger.info(f"Staging GTS bufr2ioda mapping YAML files from {self.task_config.GTS_SNOW_STAGE_YAML}") + gts_mapping_list = parse_j2yaml(self.task_config.GTS_SNOW_STAGE_YAML, localconf) FileHandler(gts_mapping_list).sync() # Write out letkfoi YAML file From 086158dba05b6f152a1e54f838865817fd3ba1fd Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Sun, 15 Sep 2024 12:43:11 -0400 Subject: [PATCH 05/17] Update IMS preprocessing job. --- scripts/exglobal_prep_snow_obs.py | 3 +-- workflow/rocoto/gfs_cycled_xml.py | 11 +++++++++++ workflow/rocoto/gfs_tasks.py | 8 ++++++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/scripts/exglobal_prep_snow_obs.py b/scripts/exglobal_prep_snow_obs.py index aa1eb1bb7d..b544d6327c 100755 --- a/scripts/exglobal_prep_snow_obs.py +++ b/scripts/exglobal_prep_snow_obs.py @@ -20,5 +20,4 @@ # Instantiate the snow prepare task SnowAnl = SnowAnalysis(config) - if SnowAnl.task_config.cyc == 0: - SnowAnl.prepare_IMS() + SnowAnl.prepare_IMS() diff --git a/workflow/rocoto/gfs_cycled_xml.py b/workflow/rocoto/gfs_cycled_xml.py index afd663c337..fda1385798 100644 --- a/workflow/rocoto/gfs_cycled_xml.py +++ b/workflow/rocoto/gfs_cycled_xml.py @@ -24,6 +24,17 @@ def get_cycledefs(self): sdate_str = sdate.strftime("%Y%m%d%H%M") strings.append(f'\t{sdate_str} {edate_str} {interval_str}') + if self._app_config.do_jedisnowda: + sdate_snocvr = self._base['SDATE'] + edate_snocvr = self._base['EDATE'] + interval_snocvr = to_timedelta(f"24:00:00H") + sdate_snocvr = sdate_snocvr + interval_snocvr + sdate_snocvr_str = sdate_snocvr.replace(hour=0, minute=0, second=0).strftime("%Y%m%d%H%M") + edate_snocvr_str = edate_snocvr.strftime("%Y%m%d%H%M") + interval_str = timedelta_to_HMS(interval_snocvr) + if sdate_snocvr <= edate_snocvr: + strings.append(f'\t{sdate_snocvr_str} {edate_snocvr_str} {interval_str}') + if self._app_config.gfs_cyc != 0: sdate_gfs = self._base['SDATE_GFS'] edate_gfs = self._base['EDATE_GFS'] diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 89da933d00..4b0c98e9a2 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -571,13 +571,14 @@ def prepsnowobs(self): deps.append(rocoto.add_dependency(dep_dict)) dependencies = rocoto.create_dependency(dep=deps) + cycledef = 'gdas_prep_snocvr' resources = self.get_resource('prepsnowobs') task_name = f'{self.run}prepsnowobs' task_dict = {'task_name': task_name, 'resources': resources, 'dependency': dependencies, 'envars': self.envars, - 'cycledef': self.run.replace('enkf', ''), + 'cycledef': cycledef, 'command': f'{self.HOMEgfs}/jobs/rocoto/prepsnowobs.sh', 'job_name': f'{self.pslot}_{task_name}_@H', 'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log', @@ -591,7 +592,10 @@ def prepsnowobs(self): def snowanl(self): deps = [] - dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowobs'} + if f'@H' == '00': + dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowobs'} + else: + dep_dict = {'type': 'task', 'name': f'{self.run}prep'} deps.append(rocoto.add_dependency(dep_dict)) dependencies = rocoto.create_dependency(dep=deps) From 2df23be2d536e9f4bf457d700065742c3b8869ca Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Mon, 16 Sep 2024 08:05:06 -0400 Subject: [PATCH 06/17] Rename IMS snow preprocessing jobs/names to be snowcover --- env/HERA.env | 2 +- env/HERCULES.env | 2 +- env/JET.env | 2 +- env/ORION.env | 2 +- env/S4.env | 2 +- env/WCOSS2.env | 2 +- ...{JGLOBAL_PREP_SNOW_OBS => JGLOBAL_PREP_SNOWCOVER} | 4 ++-- jobs/rocoto/{prepsnowobs.sh => prepsnowcover.sh} | 4 ++-- .../gfs/{config.prepsnowobs => config.prepsnowcover} | 8 ++++---- parm/config/gfs/config.resources | 4 ++-- ...l_prep_snow_obs.py => exglobal_prep_snowcover.py} | 6 +++--- workflow/applications/gfs_cycled.py | 4 ++-- workflow/rocoto/gfs_tasks.py | 12 ++++++------ workflow/rocoto/tasks.py | 2 +- 14 files changed, 28 insertions(+), 28 deletions(-) rename jobs/{JGLOBAL_PREP_SNOW_OBS => JGLOBAL_PREP_SNOWCOVER} (90%) rename jobs/rocoto/{prepsnowobs.sh => prepsnowcover.sh} (91%) rename parm/config/gfs/{config.prepsnowobs => config.prepsnowcover} (66%) rename scripts/{exglobal_prep_snow_obs.py => exglobal_prep_snowcover.py} (80%) diff --git a/env/HERA.env b/env/HERA.env index 0d77547b5b..c602490d60 100755 --- a/env/HERA.env +++ b/env/HERA.env @@ -52,7 +52,7 @@ if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then export sys_tp="HERA" export launcher_PREP="srun" -elif [[ "${step}" = "prepsnowobs" ]]; then +elif [[ "${step}" = "prepsnowcover" ]]; then export APRUN_CALCFIMS="${APRUN_default}" diff --git a/env/HERCULES.env b/env/HERCULES.env index 0138e33645..2df873648a 100755 --- a/env/HERCULES.env +++ b/env/HERCULES.env @@ -50,7 +50,7 @@ case ${step} in export sys_tp="HERCULES" export launcher_PREP="srun" ;; - "prepsnowobs") + "prepsnowcover") export APRUN_CALCFIMS="${APRUN_default}" ;; diff --git a/env/JET.env b/env/JET.env index f2b018d2d7..930ff3ff37 100755 --- a/env/JET.env +++ b/env/JET.env @@ -40,7 +40,7 @@ if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then export sys_tp="JET" export launcher_PREP="srun" -elif [[ "${step}" = "prepsnowobs" ]]; then +elif [[ "${step}" = "prepsnowcover" ]]; then export APRUN_CALCFIMS="${launcher} -n 1" diff --git a/env/ORION.env b/env/ORION.env index e8c1bcbf58..b81e08cad8 100755 --- a/env/ORION.env +++ b/env/ORION.env @@ -47,7 +47,7 @@ if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then export sys_tp="ORION" export launcher_PREP="srun" -elif [[ "${step}" = "prepsnowobs" ]]; then +elif [[ "${step}" = "prepsnowcover" ]]; then export APRUN_CALCFIMS="${launcher} -n 1" diff --git a/env/S4.env b/env/S4.env index 5d5ffd23b1..d17e3bf452 100755 --- a/env/S4.env +++ b/env/S4.env @@ -40,7 +40,7 @@ if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then export sys_tp="S4" export launcher_PREP="srun" -elif [[ "${step}" = "prepsnowobs" ]]; then +elif [[ "${step}" = "prepsnowcover" ]]; then export APRUN_CALCFIMS="${APRUN_default}" diff --git a/env/WCOSS2.env b/env/WCOSS2.env index d2dae3ba93..385a3787f1 100755 --- a/env/WCOSS2.env +++ b/env/WCOSS2.env @@ -34,7 +34,7 @@ if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then export sys_tp="wcoss2" export launcher_PREP="mpiexec" -elif [[ "${step}" = "prepsnowobs" ]]; then +elif [[ "${step}" = "prepsnowcover" ]]; then export APRUN_CALCFIMS="${APRUN_default}" diff --git a/jobs/JGLOBAL_PREP_SNOW_OBS b/jobs/JGLOBAL_PREP_SNOWCOVER similarity index 90% rename from jobs/JGLOBAL_PREP_SNOW_OBS rename to jobs/JGLOBAL_PREP_SNOWCOVER index 0e3557697d..e208cd0362 100755 --- a/jobs/JGLOBAL_PREP_SNOW_OBS +++ b/jobs/JGLOBAL_PREP_SNOWCOVER @@ -2,7 +2,7 @@ source "${HOMEgfs}/ush/preamble.sh" export DATA=${DATA:-${DATAROOT}/${RUN}snowanl_${cyc}} -source "${HOMEgfs}/ush/jjob_header.sh" -e "prepsnowobs" -c "base prepsnowobs" +source "${HOMEgfs}/ush/jjob_header.sh" -e "prepsnowcover" -c "base prepsnowcover" ############################################## # Set variables used in the script @@ -25,7 +25,7 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \ ############################################################### # Run relevant script -EXSCRIPT=${GDASSNOWPREPPY:-${SCRgfs}/exglobal_prep_snow_obs.py} +EXSCRIPT=${GDASSNOWPREPPY:-${SCRgfs}/exglobal_prep_snowcover.py} ${EXSCRIPT} status=$? [[ ${status} -ne 0 ]] && (echo "FATAL ERROR: Error executing ${EXSCRIPT}, ABORT!"; exit "${status}") diff --git a/jobs/rocoto/prepsnowobs.sh b/jobs/rocoto/prepsnowcover.sh similarity index 91% rename from jobs/rocoto/prepsnowobs.sh rename to jobs/rocoto/prepsnowcover.sh index 3f23bc16a5..6f4bf51a5f 100755 --- a/jobs/rocoto/prepsnowobs.sh +++ b/jobs/rocoto/prepsnowcover.sh @@ -8,7 +8,7 @@ source "${HOMEgfs}/ush/preamble.sh" status=$? [[ ${status} -ne 0 ]] && exit "${status}" -export job="prepsnowobs" +export job="prepsnowcover" export jobid="${job}.$$" ############################################################### @@ -21,6 +21,6 @@ export PYTHONPATH ############################################################### # Execute the JJOB -"${HOMEgfs}/jobs/JGLOBAL_PREP_SNOW_OBS" +"${HOMEgfs}/jobs/JGLOBAL_PREP_SNOWCOVER" status=$? exit "${status}" diff --git a/parm/config/gfs/config.prepsnowobs b/parm/config/gfs/config.prepsnowcover similarity index 66% rename from parm/config/gfs/config.prepsnowobs rename to parm/config/gfs/config.prepsnowcover index 20bdd89ddf..12b97ca470 100644 --- a/parm/config/gfs/config.prepsnowobs +++ b/parm/config/gfs/config.prepsnowcover @@ -1,12 +1,12 @@ #! /usr/bin/env bash -########## config.prepsnowobs ########## +########## config.prepsnowcover ########## # Snow Obs Prep specific -echo "BEGIN: config.prepsnowobs" +echo "BEGIN: config.prepsnowcover" # Get task specific resources -. "${EXPDIR}/config.resources" prepsnowobs +. "${EXPDIR}/config.resources" prepsnowcover export IMS_OBS_LIST="${PARMgfs}/gdas/snow/prep/prep_ims.yaml.j2" @@ -15,4 +15,4 @@ export FIMS_NML_TMPL="${PARMgfs}/gdas/snow/prep/fims.nml.j2" export IMS2IODACONV="${USHgfs}/imsfv3_scf2ioda.py" -echo "END: config.prepsnowobs" +echo "END: config.prepsnowcover" diff --git a/parm/config/gfs/config.resources b/parm/config/gfs/config.resources index a89c72e951..39f9919441 100644 --- a/parm/config/gfs/config.resources +++ b/parm/config/gfs/config.resources @@ -12,7 +12,7 @@ if (( $# != 1 )); then echo "Must specify an input task argument to set resource variables!" echo "argument can be any one of the following:" echo "stage_ic aerosol_init" - echo "prep prepsnowobs prepatmiodaobs" + echo "prep prepsnowcover prepatmiodaobs" echo "atmanlinit atmanlvar atmanlfv3inc atmanlfinal" echo "atmensanlinit atmensanlobs atmensanlsol atmensanlletkf atmensanlfv3inc atmensanlfinal" echo "snowanl esnowrecen" @@ -151,7 +151,7 @@ case ${step} in memory="40GB" ;; - "prepsnowobs") + "prepsnowcover") walltime="00:05:00" ntasks=1 threads_per_task=1 diff --git a/scripts/exglobal_prep_snow_obs.py b/scripts/exglobal_prep_snowcover.py similarity index 80% rename from scripts/exglobal_prep_snow_obs.py rename to scripts/exglobal_prep_snowcover.py index b544d6327c..c7be33a2cf 100755 --- a/scripts/exglobal_prep_snow_obs.py +++ b/scripts/exglobal_prep_snowcover.py @@ -1,8 +1,8 @@ #!/usr/bin/env python3 -# exglobal_prep_snow_obs.py +# exglobal_prep_snowcover.py # This script creates a SnowAnalysis object -# and runs the prepare_GTS and prepare_IMS method -# which perform the pre-processing for GTS and IMS data +# and runs the prepare_IMS method which perform +# the pre-processing for IMS data import os from wxflow import Logger, cast_strdict_as_dtypedict diff --git a/workflow/applications/gfs_cycled.py b/workflow/applications/gfs_cycled.py index 4bb473f454..dab222ed26 100644 --- a/workflow/applications/gfs_cycled.py +++ b/workflow/applications/gfs_cycled.py @@ -113,7 +113,7 @@ def _get_app_configs(self): configs += ['prepobsaero'] if self.do_jedisnowda: - configs += ['prepsnowobs', 'snowanl'] + configs += ['prepsnowcover', 'snowanl'] if self.do_hybvar: configs += ['esnowrecen'] @@ -156,7 +156,7 @@ def get_task_names(self): gdas_gfs_common_tasks_before_fcst += ['sfcanl', 'analcalc'] if self.do_jedisnowda: - gdas_gfs_common_tasks_before_fcst += ['prepsnowobs', 'snowanl'] + gdas_gfs_common_tasks_before_fcst += ['prepsnowcover', 'snowanl'] wave_prep_tasks = ['waveinit', 'waveprep'] wave_bndpnt_tasks = ['wavepostbndpnt', 'wavepostbndpntbll'] diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 4b0c98e9a2..d539c8e8f9 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -564,7 +564,7 @@ def aeroanlfinal(self): return task - def prepsnowobs(self): + def prepsnowcover(self): deps = [] dep_dict = {'type': 'task', 'name': f'{self.run}prep'} @@ -572,14 +572,14 @@ def prepsnowobs(self): dependencies = rocoto.create_dependency(dep=deps) cycledef = 'gdas_prep_snocvr' - resources = self.get_resource('prepsnowobs') - task_name = f'{self.run}prepsnowobs' + resources = self.get_resource('prepsnowcover') + task_name = f'{self.run}prepsnowcover' task_dict = {'task_name': task_name, 'resources': resources, 'dependency': dependencies, 'envars': self.envars, 'cycledef': cycledef, - 'command': f'{self.HOMEgfs}/jobs/rocoto/prepsnowobs.sh', + 'command': f'{self.HOMEgfs}/jobs/rocoto/prepsnowcover.sh', 'job_name': f'{self.pslot}_{task_name}_@H', 'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log', 'maxtries': '&MAXTRIES;' @@ -593,7 +593,7 @@ def snowanl(self): deps = [] if f'@H' == '00': - dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowobs'} + dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowcover'} else: dep_dict = {'type': 'task', 'name': f'{self.run}prep'} deps.append(rocoto.add_dependency(dep_dict)) @@ -618,7 +618,7 @@ def snowanl(self): def esnowrecen(self): deps = [] - dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}prepsnowobs'} + dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}prepsnowcover'} deps.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}snowanl'} deps.append(rocoto.add_dependency(dep_dict)) diff --git a/workflow/rocoto/tasks.py b/workflow/rocoto/tasks.py index df2b0467db..5ac321817b 100644 --- a/workflow/rocoto/tasks.py +++ b/workflow/rocoto/tasks.py @@ -20,7 +20,7 @@ class Tasks: 'eobs', 'eomg', 'epos', 'esfc', 'eupd', 'atmensanlinit', 'atmensanlobs', 'atmensanlsol', 'atmensanlletkf', 'atmensanlfv3inc', 'atmensanlfinal', 'aeroanlinit', 'aeroanlvar', 'aeroanlfinal', 'aeroanlgenb', - 'prepsnowobs', 'snowanl', 'esnowrecen', + 'prepsnowcover', 'snowanl', 'esnowrecen', 'fcst', 'atmanlupp', 'atmanlprod', 'atmupp', 'goesupp', 'atmos_prod', 'ocean_prod', 'ice_prod', From 3c08705845c1d36399520d89226370e350c67ff3 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Fri, 27 Sep 2024 19:22:26 -0400 Subject: [PATCH 07/17] Address reviewer's comments. --- workflow/rocoto/gfs_cycled_xml.py | 2 +- workflow/rocoto/gfs_tasks.py | 12 +++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/workflow/rocoto/gfs_cycled_xml.py b/workflow/rocoto/gfs_cycled_xml.py index fda1385798..c5411c108a 100644 --- a/workflow/rocoto/gfs_cycled_xml.py +++ b/workflow/rocoto/gfs_cycled_xml.py @@ -27,7 +27,7 @@ def get_cycledefs(self): if self._app_config.do_jedisnowda: sdate_snocvr = self._base['SDATE'] edate_snocvr = self._base['EDATE'] - interval_snocvr = to_timedelta(f"24:00:00H") + interval_snocvr = to_timedelta('24H') sdate_snocvr = sdate_snocvr + interval_snocvr sdate_snocvr_str = sdate_snocvr.replace(hour=0, minute=0, second=0).strftime("%Y%m%d%H%M") edate_snocvr_str = edate_snocvr.strftime("%Y%m%d%H%M") diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index d539c8e8f9..35a348f2aa 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -571,14 +571,13 @@ def prepsnowcover(self): deps.append(rocoto.add_dependency(dep_dict)) dependencies = rocoto.create_dependency(dep=deps) - cycledef = 'gdas_prep_snocvr' resources = self.get_resource('prepsnowcover') task_name = f'{self.run}prepsnowcover' task_dict = {'task_name': task_name, 'resources': resources, 'dependency': dependencies, 'envars': self.envars, - 'cycledef': cycledef, + 'cycledef': 'gdas_prep_snocvr', 'command': f'{self.HOMEgfs}/jobs/rocoto/prepsnowcover.sh', 'job_name': f'{self.pslot}_{task_name}_@H', 'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log', @@ -592,12 +591,11 @@ def prepsnowcover(self): def snowanl(self): deps = [] - if f'@H' == '00': - dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowcover'} - else: - dep_dict = {'type': 'task', 'name': f'{self.run}prep'} + dep_dict = {'type': 'task', 'name': f'{self.run}prep'} deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep=deps) + dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowcover'} + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) resources = self.get_resource('snowanl') task_name = f'{self.run}snowanl' From b12a375fb1f94e1c530145718be353c7c99d5cb7 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Tue, 22 Oct 2024 20:48:26 -0400 Subject: [PATCH 08/17] Update to use for managing the rocoto dependency. --- workflow/rocoto/gfs_tasks.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index f2892816a8..90389a979b 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -590,12 +590,19 @@ def prepsnowcover(self): def snowanl(self): deps = [] - dep_dict = {'type': 'task', 'name': f'{self.run}prep'} - deps.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowcover'} deps.append(rocoto.add_dependency(dep_dict)) + + deps2 = [] + dep_dict = {'type': 'taskvalid', 'name': f'{self.run}prepsnowcover', 'condition': 'not'} + deps2.append(rocoto.add_dependency(dep_dict)) + dep_dict = {'type': 'task', 'name': f'{self.run}prep'} + deps2.append(rocoto.add_dependency(dep_dict)) + deps.append(rocoto.create_dependency(dep_condition='and', dep=deps2)) + dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) + resources = self.get_resource('snowanl') task_name = f'{self.run}_snowanl' task_dict = {'task_name': task_name, From 679e57edd42fd26f1f4b96c2e3b657eeecc7a4ae Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Tue, 22 Oct 2024 20:53:55 -0400 Subject: [PATCH 09/17] Fix the pynorms error. --- workflow/rocoto/gfs_tasks.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 90389a979b..148fd9f14c 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -592,17 +592,14 @@ def snowanl(self): deps = [] dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowcover'} deps.append(rocoto.add_dependency(dep_dict)) - deps2 = [] dep_dict = {'type': 'taskvalid', 'name': f'{self.run}prepsnowcover', 'condition': 'not'} deps2.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'task', 'name': f'{self.run}prep'} deps2.append(rocoto.add_dependency(dep_dict)) deps.append(rocoto.create_dependency(dep_condition='and', dep=deps2)) - dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) - resources = self.get_resource('snowanl') task_name = f'{self.run}_snowanl' task_dict = {'task_name': task_name, From d97480a7c90395b71db193a3bdd1f059c98b90b7 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Wed, 23 Oct 2024 07:15:00 -0400 Subject: [PATCH 10/17] Fix an error. --- workflow/rocoto/gfs_tasks.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 148fd9f14c..12cdd24a6f 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -571,7 +571,7 @@ def prepsnowcover(self): dependencies = rocoto.create_dependency(dep=deps) resources = self.get_resource('prepsnowcover') - task_name = f'{self.run}prepsnowcover' + task_name = f'{self.run}_prepsnowcover' task_dict = {'task_name': task_name, 'resources': resources, 'dependency': dependencies, @@ -590,14 +590,16 @@ def prepsnowcover(self): def snowanl(self): deps = [] - dep_dict = {'type': 'task', 'name': f'{self.run}prepsnowcover'} + dep_dict = {'type': 'task', 'name': f'{self.run}_prepsnowcover'} deps.append(rocoto.add_dependency(dep_dict)) + deps2 = [] - dep_dict = {'type': 'taskvalid', 'name': f'{self.run}prepsnowcover', 'condition': 'not'} + dep_dict = {'type': 'taskvalid', 'name': f'{self.run}_prepsnowcover', 'condition': 'not'} deps2.append(rocoto.add_dependency(dep_dict)) - dep_dict = {'type': 'task', 'name': f'{self.run}prep'} + dep_dict = {'type': 'task', 'name': f'{self.run}_prep'} deps2.append(rocoto.add_dependency(dep_dict)) deps.append(rocoto.create_dependency(dep_condition='and', dep=deps2)) + dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) resources = self.get_resource('snowanl') From ed78b8c4601a50472e62ddd45821a60821a02378 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Wed, 23 Oct 2024 14:50:07 -0400 Subject: [PATCH 11/17] Update the name of dependency from prepsnowcover for ens recentering. --- workflow/rocoto/gfs_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 12cdd24a6f..fda625a907 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -621,7 +621,7 @@ def snowanl(self): def esnowrecen(self): deps = [] - dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}prepsnowcover'} + dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}_prepsnowcover'} deps.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}_snowanl'} deps.append(rocoto.add_dependency(dep_dict)) From eac7e1fe64829ba8536444280114f9e1009b6f5e Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Fri, 25 Oct 2024 13:14:56 -0400 Subject: [PATCH 12/17] Update to run gdas_prepsnowcover job on every 00Z cycle. --- workflow/rocoto/gfs_cycled_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/rocoto/gfs_cycled_xml.py b/workflow/rocoto/gfs_cycled_xml.py index a73ff17d40..ddee248e61 100644 --- a/workflow/rocoto/gfs_cycled_xml.py +++ b/workflow/rocoto/gfs_cycled_xml.py @@ -32,7 +32,7 @@ def get_cycledefs(self): sdate_snocvr_str = sdate_snocvr.replace(hour=0, minute=0, second=0).strftime("%Y%m%d%H%M") edate_snocvr_str = edate_snocvr.strftime("%Y%m%d%H%M") interval_str = timedelta_to_HMS(interval_snocvr) - if sdate_snocvr <= edate_snocvr: + if sdate_snocvr.date() <= edate_snocvr.date(): strings.append(f'\t{sdate_snocvr_str} {edate_snocvr_str} {interval_str}') interval_gfs = self._app_config.interval_gfs From 96254c46b87a1023efe40a898e03b28014e2ced7 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Fri, 25 Oct 2024 14:33:12 -0400 Subject: [PATCH 13/17] Made changes as reviewer suggested. --- workflow/rocoto/gfs_cycled_xml.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/workflow/rocoto/gfs_cycled_xml.py b/workflow/rocoto/gfs_cycled_xml.py index ddee248e61..65119df5ba 100644 --- a/workflow/rocoto/gfs_cycled_xml.py +++ b/workflow/rocoto/gfs_cycled_xml.py @@ -25,14 +25,21 @@ def get_cycledefs(self): strings.append(f'\t{sdate_str} {edate_str} {interval_str}') if self._app_config.do_jedisnowda: - sdate_snocvr = self._base['SDATE'] - edate_snocvr = self._base['EDATE'] + sdate = self._base['SDATE'] + edate_snocvr = self._base['EDATE'].replace(hour=0, minute=0, second=0) interval_snocvr = to_timedelta('24H') - sdate_snocvr = sdate_snocvr + interval_snocvr - sdate_snocvr_str = sdate_snocvr.replace(hour=0, minute=0, second=0).strftime("%Y%m%d%H%M") + assim_freq = to_timedelta("{self._base['assim_freq']}H") + + is_warm_start = self._base.get('EXP_WARM_START', False) + first_full_cycle = sdate if is_warm_start else sdate + assim_freq + sdate_snocvr = (first_full_cycle if first_full_cycle.hour == 0 else + (first_full_cycle + interval_snocvr).replace(hour=0, minute=0, second=0)) + + sdate_snocvr_str = sdate_snocvr.strftime("%Y%m%d%H%M") edate_snocvr_str = edate_snocvr.strftime("%Y%m%d%H%M") interval_str = timedelta_to_HMS(interval_snocvr) - if sdate_snocvr.date() <= edate_snocvr.date(): + + if sdate_snocvr <= edate_snocvr: strings.append(f'\t{sdate_snocvr_str} {edate_snocvr_str} {interval_str}') interval_gfs = self._app_config.interval_gfs From a00f9e8a5f0441de028ee13bdff9b99af8039536 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Fri, 25 Oct 2024 14:43:04 -0400 Subject: [PATCH 14/17] Fix pynorm error. --- workflow/rocoto/gfs_cycled_xml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/rocoto/gfs_cycled_xml.py b/workflow/rocoto/gfs_cycled_xml.py index 65119df5ba..1fb59c81e5 100644 --- a/workflow/rocoto/gfs_cycled_xml.py +++ b/workflow/rocoto/gfs_cycled_xml.py @@ -33,7 +33,7 @@ def get_cycledefs(self): is_warm_start = self._base.get('EXP_WARM_START', False) first_full_cycle = sdate if is_warm_start else sdate + assim_freq sdate_snocvr = (first_full_cycle if first_full_cycle.hour == 0 else - (first_full_cycle + interval_snocvr).replace(hour=0, minute=0, second=0)) + (first_full_cycle + interval_snocvr).replace(hour=0, minute=0, second=0)) sdate_snocvr_str = sdate_snocvr.strftime("%Y%m%d%H%M") edate_snocvr_str = edate_snocvr.strftime("%Y%m%d%H%M") From db3a91237ddea5e907fb9acc9cd7818c0a900039 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Mon, 28 Oct 2024 13:58:19 -0400 Subject: [PATCH 15/17] Update the dependency for the enkfgdas_esnowrecen job. --- workflow/rocoto/gfs_tasks.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index fda625a907..1847c1632c 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -623,11 +623,15 @@ def esnowrecen(self): deps = [] dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}_prepsnowcover'} deps.append(rocoto.add_dependency(dep_dict)) - dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}_snowanl'} - deps.append(rocoto.add_dependency(dep_dict)) + + deps2 = [] + dep_dict = {'type': 'taskvalid', 'name': f'{self.run.replace("enkf","")}_prepsnowcover', 'condition': 'not'} + deps2.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'metatask', 'name': f'{self.run}_epmn', 'offset': f"-{timedelta_to_HMS(self._base['interval_gdas'])}"} - deps.append(rocoto.add_dependency(dep_dict)) - dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) + deps2.append(rocoto.add_dependency(dep_dict)) + deps.append(rocoto.create_dependency(dep_condition='and', dep=deps2)) + + dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) resources = self.get_resource('esnowrecen') task_name = f'{self.run}_esnowrecen' From 3d8c9d33c2e89b6d2f80b2b0002e7e700f81b5c7 Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Mon, 28 Oct 2024 14:33:26 -0400 Subject: [PATCH 16/17] Update the esnowrecen job dependency. --- workflow/rocoto/gfs_tasks.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 1847c1632c..442a7f2624 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -621,17 +621,11 @@ def snowanl(self): def esnowrecen(self): deps = [] - dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}_prepsnowcover'} + dep_dict = {'type': 'task', 'name': f'{self.run.replace("enkf","")}_snowanl'} deps.append(rocoto.add_dependency(dep_dict)) - - deps2 = [] - dep_dict = {'type': 'taskvalid', 'name': f'{self.run.replace("enkf","")}_prepsnowcover', 'condition': 'not'} - deps2.append(rocoto.add_dependency(dep_dict)) dep_dict = {'type': 'metatask', 'name': f'{self.run}_epmn', 'offset': f"-{timedelta_to_HMS(self._base['interval_gdas'])}"} - deps2.append(rocoto.add_dependency(dep_dict)) - deps.append(rocoto.create_dependency(dep_condition='and', dep=deps2)) - - dependencies = rocoto.create_dependency(dep_condition='or', dep=deps) + deps.append(rocoto.add_dependency(dep_dict)) + dependencies = rocoto.create_dependency(dep_condition='and', dep=deps) resources = self.get_resource('esnowrecen') task_name = f'{self.run}_esnowrecen' From 7148c4e2aac9ec7a24d1889b5df1f8308d08a43b Mon Sep 17 00:00:00 2001 From: Jiarui Dong Date: Wed, 30 Oct 2024 07:35:50 -0400 Subject: [PATCH 17/17] Update the gfs workflow for prepsnowcover job. --- scripts/exglobal_prep_snowcover.py | 3 ++- workflow/rocoto/gfs_tasks.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/exglobal_prep_snowcover.py b/scripts/exglobal_prep_snowcover.py index c7be33a2cf..2637546e7c 100755 --- a/scripts/exglobal_prep_snowcover.py +++ b/scripts/exglobal_prep_snowcover.py @@ -20,4 +20,5 @@ # Instantiate the snow prepare task SnowAnl = SnowAnalysis(config) - SnowAnl.prepare_IMS() + if SnowAnl.task_config.cyc == 0: + SnowAnl.prepare_IMS() diff --git a/workflow/rocoto/gfs_tasks.py b/workflow/rocoto/gfs_tasks.py index 442a7f2624..78582dc324 100644 --- a/workflow/rocoto/gfs_tasks.py +++ b/workflow/rocoto/gfs_tasks.py @@ -570,13 +570,17 @@ def prepsnowcover(self): deps.append(rocoto.add_dependency(dep_dict)) dependencies = rocoto.create_dependency(dep=deps) + cycledef = 'gdas_prep_snocvr' + if self.run in ['gfs']: + cycledef = self.run + resources = self.get_resource('prepsnowcover') task_name = f'{self.run}_prepsnowcover' task_dict = {'task_name': task_name, 'resources': resources, 'dependency': dependencies, 'envars': self.envars, - 'cycledef': 'gdas_prep_snocvr', + 'cycledef': cycledef, 'command': f'{self.HOMEgfs}/jobs/rocoto/prepsnowcover.sh', 'job_name': f'{self.pslot}_{task_name}_@H', 'log': f'{self.rotdir}/logs/@Y@m@d@H/{task_name}.log',