Skip to content

Commit

Permalink
enssnowanl looks like it is working, need to do a fresh test
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMartin-NOAA committed Nov 14, 2024
1 parent 479d23b commit 5ddce36
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
9 changes: 5 additions & 4 deletions jobs/JGLOBAL_SNOWENS_ANALYSIS
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ RUN=${CDUMP} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMOUT_ATMOS_ANALYSIS:COM_ATMOS_ANALYSIS_TMPL \
COMOUT_CONF:COM_CONF_TMPL
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl \
COMOUT_SNOW_ANALYSIS:COM_SNOW_ANALYSIS_TMPL

mkdir -p "${COMOUT_SNOW_ANALYSIS}" "${COMOUT_CONF}"

for imem in $(seq 1 "${NMEM_ENS}"); do
memchar="mem$(printf %03i "${imem}")"
Expand All @@ -33,6 +29,11 @@ for imem in $(seq 1 "${NMEM_ENS}"); do
mkdir -p "${COMOUT_SNOW_ANALYSIS}"
done

MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_tmpl -x\
COMOUT_SNOW_ANALYSIS:COM_SNOW_ANALYSIS_TMPL

mkdir -p "${COMOUT_SNOW_ANALYSIS}" "${COMOUT_CONF}"

###############################################################
# Run relevant script

Expand Down
2 changes: 1 addition & 1 deletion sorc/gdas.cd
Submodule gdas.cd updated 1 files
+1 −1 parm/jcb-algorithms
24 changes: 13 additions & 11 deletions ush/python/pygfs/task/snowens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ def finalize(self) -> None:

# ---- tar up diags
# path of output tar statfile
snowstat = os.path.join(self.task_config.COM_SNOW_ANALYSIS, f"{self.task_config.APREFIX}snowstat")
snowstat = os.path.join(self.task_config.COMOUT_SNOW_ANALYSIS, f"{self.task_config.APREFIX}snowstat")

# get list of diag files to put in tarball
diags = glob.glob(os.path.join(self.task_config.DATA, 'diags', 'diag*nc'))
Expand All @@ -325,7 +325,7 @@ def finalize(self) -> None:
for src in yamls:
yaml_base = os.path.splitext(os.path.basename(src))[0]
dest_yaml_name = f"{self.task_config.RUN}.t{self.task_config.cyc:02d}z.{yaml_base}.yaml"
dest = os.path.join(self.task_config.COM_SNOW_ANALYSIS, dest_yaml_name)
dest = os.path.join(self.task_config.COMOUT_SNOW_ANALYSIS, dest_yaml_name)
logger.debug(f"Copying {src} to {dest}")
yaml_copy = {
'copy': [[src, dest]]
Expand All @@ -339,13 +339,15 @@ def finalize(self) -> None:
bkgtimes.append(self.task_config.SNOW_WINDOW_BEGIN)
bkgtimes.append(self.task_config.current_cycle)
anllist = []
for bkgtime in bkgtimes:
template = f'{to_fv3time(bkgtime)}.sfc_data.tile{{tilenum}}.nc'
for itile in range(1, self.task_config.ntiles + 1):
filename = template.format(tilenum=itile)
src = os.path.join(self.task_config.DATA, 'anl', filename)
dest = os.path.join(self.task_config.COM_SNOW_ANALYSIS, filename)
anllist.append([src, dest])
for mem in range(1, self.task_config.NMEM_ENS + 1):
for bkgtime in bkgtimes:
template = f'{to_fv3time(bkgtime)}.sfc_data.tile{{tilenum}}.nc'
for itile in range(1, self.task_config.ntiles + 1):
filename = template.format(tilenum=itile)
src = os.path.join(self.task_config.DATA, 'anl', f"mem{mem:03d}", filename)
COMOUT_SNOW_ANALYSIS = self.task_config.COMOUT_SNOW_ANALYSIS.replace('ensstat', f"mem{mem:03d}")
dest = os.path.join(COMOUT_SNOW_ANALYSIS, filename)
anllist.append([src, dest])
FileHandler({'copy': anllist}).sync()

logger.info('Copy increments to COM')
Expand All @@ -354,7 +356,7 @@ def finalize(self) -> None:
for itile in range(1, self.task_config.ntiles + 1):
filename = template.format(tilenum=itile)
src = os.path.join(self.task_config.DATA, 'anl', filename)
dest = os.path.join(self.task_config.COM_SNOW_ANALYSIS, filename)
dest = os.path.join(self.task_config.COMOUT_SNOW_ANALYSIS, filename)
inclist.append([src, dest])
FileHandler({'copy': inclist}).sync()

Expand Down Expand Up @@ -393,7 +395,7 @@ def add_increments(self) -> None:
logger.info(f"Processing member mem{mem:03d}")
# loop over times to apply increments
for bkgtime in bkgtimes:
logger.info("Processing analysis valid: {bkgtime}")
logger.info(f"Processing analysis valid: {bkgtime}")
logger.info("Create namelist for APPLY_INCR_EXE")
nml_template = self.task_config.ENS_APPLY_INCR_NML_TMPL
nml_config = {
Expand Down

0 comments on commit 5ddce36

Please sign in to comment.