Skip to content

Commit

Permalink
fix template issue + updates for g-w develop merge
Browse files Browse the repository at this point in the history
  • Loading branch information
CoryMartin-NOAA committed Jul 1, 2024
1 parent 57f0af1 commit a207fe5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions jobs/JGLOBAL_SNOW_ENSEMBLE_ANALYSIS
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ export GDUMP
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMIN_OBS:COM_OBS_TMPL \
COMOUT_ATMOS_ANALYSIS:COM_ATMOS_ANALYSIS_TMPL \
COMOUT_CONF:COM_CONF_TMPL
MEMDIR="ensstat" YMD=${PDY} HH=${cyc} declare_from_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}")"
MEMDIR=${memchar} RUN=${GDUMP_ENS} YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_SNOW_ANALYSIS
MEMDIR=${memchar} RUN=${GDUMP_ENS} YMD=${PDY} HH=${cyc} declare_from_tmpl COMOUT_SNOW_ANALYSIS:COM_SNOW_ANALYSIS_TMPL
mkdir -p "${COMOUT_SNOW_ANALYSIS}"
done

Expand Down
24 changes: 12 additions & 12 deletions ush/python/pygfs/task/snowens_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,32 +30,32 @@ class SnowEnsAnalysis(Analysis):
def __init__(self, config):
super().__init__(config)

_res_det = int(self.config['CASE'][1:])
_res_ens = int(self.config['CASE_ENS'][1:])
_window_begin = add_to_datetime(self.runtime_config.current_cycle, -to_timedelta(f"{self.config['assim_freq']}H") / 2)
_recenter_yaml = os.path.join(self.runtime_config.DATA, f"{self.runtime_config.RUN}.t{self.runtime_config['cyc']:02d}z.land_recenter.yaml")
_res_det = int(self.task_config['CASE'][1:])
_res_ens = int(self.task_config['CASE_ENS'][1:])
_window_begin = add_to_datetime(self.task_config.current_cycle, -to_timedelta(f"{self.task_config['assim_freq']}H") / 2)
_recenter_yaml = os.path.join(self.task_config.DATA, f"{self.task_config.RUN}.t{self.task_config['cyc']:02d}z.land_recenter.yaml")

# Create a local dictionary that is repeatedly used across this class
local_dict = AttrDict(
{
'npx_ges': _res_ens + 1,
'npy_ges': _res_ens + 1,
'npz_ges': self.config.LEVS - 1,
'npz': self.config.LEVS - 1,
'npz_ges': self.task_config.LEVS - 1,
'npz': self.task_config.LEVS - 1,
'SNOW_WINDOW_BEGIN': _window_begin,
'SNOW_WINDOW_LENGTH': f"PT{self.config['assim_freq']}H",
'SNOW_WINDOW_LENGTH': f"PT{self.task_config['assim_freq']}H",
'ATM_WINDOW_BEGIN': _window_begin,
'ATM_WINDOW_LENGTH': f"PT{self.config['assim_freq']}H",
'OPREFIX': f"{self.runtime_config.RUN}.t{self.runtime_config.cyc:02d}z.",
'APREFIX': f"{self.runtime_config.RUN}.t{self.runtime_config.cyc:02d}z.",
'ATM_WINDOW_LENGTH': f"PT{self.task_config['assim_freq']}H",
'OPREFIX': f"{self.task_config.RUN}.t{self.task_config.cyc:02d}z.",
'APREFIX': f"{self.task_config.RUN}.t{self.task_config.cyc:02d}z.",
'jedi_yaml': _recenter_yaml,
}
)
bkg_time = _window_begin if self.config.DOIAU else self.runtime_config.current_cycle
bkg_time = _window_begin if self.task_config.DOIAU else self.task_config.current_cycle
local_dict['bkg_time'] = bkg_time

# task_config is everything that this task should need
self.task_config = AttrDict(**self.config, **self.runtime_config, **local_dict)
self.task_config = AttrDict(**self.task_config, **local_dict)

@logit(logger)
def initialize(self) -> None:
Expand Down

0 comments on commit a207fe5

Please sign in to comment.