Skip to content

Commit

Permalink
Add option to download ICs from HPSS for GEFS
Browse files Browse the repository at this point in the history
  • Loading branch information
EricSinsky-NOAA committed Oct 25, 2024
1 parent 142c253 commit 4f13fca
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
5 changes: 5 additions & 0 deletions jobs/JGLOBAL_STAGE_IC
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "stage_ic" -c "base stage_ic"

# Since ICs will download to DATA if DO_DOWNLOAD_ICS is YES, set ICSDIR to DATA
if [[ "${DO_DOWNLOAD_ICS}" == "YES" ]]; then
export ICSDIR=${DATA}
fi

# Execute staging
"${SCRgfs}/exglobal_stage_ic.py"
err=$?
Expand Down
3 changes: 3 additions & 0 deletions parm/config/gefs/config.base
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,9 @@ export ARCH_CYC=00 # Archive data at this cycle for warm_start capabil
export ARCH_WARMICFREQ=4 # Archive frequency in days for warm_start capability
export ARCH_FCSTICFREQ=1 # Archive frequency in days for gdas and gfs forecast-only capability

export DO_DOWNLOAD_ICS="YES" # Set to YES to download ICs from HPSS, set to NO to copy ICs locally
export HPSSICARCH="/NCEPDEV/emc-marine/2year/Neil.Barton/ICS/HR4/C384mx025" # ICs directory on HPSS

export DELETE_COM_IN_ARCHIVE_JOB="YES" # NO=retain ROTDIR. YES default in arch.sh and earc.sh.

# Number of regional collectives to create soundings for
Expand Down
4 changes: 2 additions & 2 deletions parm/config/gefs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ export max_tasks_per_node
case ${step} in

"stage_ic")
export walltime="00:15:00"
export walltime="06:00:00"
export ntasks=1
export tasks_per_node=1
export threads_per_task=1
export is_exclusive=True
export memory="4096M"
;;

"waveinit")
Expand Down
3 changes: 2 additions & 1 deletion scripts/exglobal_stage_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def main():
'assim_freq', 'current_cycle', 'previous_cycle',
'ROTDIR', 'ICSDIR', 'STAGE_IC_YAML_TMPL', 'DO_JEDIATMVAR',
'OCNRES', 'waveGRD', 'ntiles', 'DOIAU', 'DO_JEDIOCNVAR',
'REPLAY_ICS', 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST']
'REPLAY_ICS', 'DO_WAVE', 'DO_OCN', 'DO_ICE', 'DO_NEST',
'HPSSICARCH', 'DO_DOWNLOAD_ICS']

stage_dict = AttrDict()
for key in keys:
Expand Down
13 changes: 11 additions & 2 deletions ush/python/pygfs/task/stage_ic.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
from typing import Any, Dict, List

from wxflow import (AttrDict, FileHandler, Task, cast_strdict_as_dtypedict,
logit, parse_j2yaml, strftime, to_YMD,
add_to_datetime, to_timedelta, Template, TemplateConstants)
logit, parse_j2yaml, strftime, to_YMD, to_YMDH,
add_to_datetime, to_timedelta, Template, TemplateConstants,
Hsi, Htar)

logger = getLogger(__name__.split('.')[-1])

Expand Down Expand Up @@ -47,6 +48,14 @@ def execute_stage(self, stage_dict: Dict[str, Any]) -> None:
None
"""

if stage_dict.DO_DOWNLOAD_ICS == True:
# Download ICs from HPSS to ICSDIR
self.tar_cmd = "htar"
self.hsi = Hsi()
self.htar = Htar()
self.xvf = self.htar.xvf
self.xvf(stage_dict.HPSSICARCH+"/"+to_YMDH(stage_dict.current_cycle)+".tar")

if not os.path.isdir(stage_dict.ROTDIR):
raise FileNotFoundError(f"FATAL ERROR: The ROTDIR ({stage_dict.ROTDIR}) does not exist!")

Expand Down
4 changes: 2 additions & 2 deletions workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@


class Tasks:
SERVICE_TASKS = ['arch', 'earc']
VALID_TASKS = ['aerosol_init', 'stage_ic',
SERVICE_TASKS = ['stage_ic', 'arch', 'earc']
VALID_TASKS = ['aerosol_init',
'prep', 'anal', 'sfcanl', 'analcalc', 'analdiag', 'arch', "cleanup",
'prepatmiodaobs', 'atmanlinit', 'atmanlvar', 'atmanlfv3inc', 'atmanlfinal',
'prepoceanobs',
Expand Down

0 comments on commit 4f13fca

Please sign in to comment.