Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add run and finalize methods to marine LETKF task #2944

Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
20e48a1
debugging for ocean ensemble run
AndrewEichmann-NOAA Aug 21, 2024
16d805f
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Aug 21, 2024
f749b3f
fix ci stager for ensemble + DO_IAU
AndrewEichmann-NOAA Aug 29, 2024
9501e74
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Aug 29, 2024
6b1832a
removing ice var changer
AndrewEichmann-NOAA Sep 5, 2024
7f30c33
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Sep 5, 2024
581f1c3
the latests
AndrewEichmann-NOAA Sep 13, 2024
0dcf183
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Sep 17, 2024
6a2cd3d
removal of cruft
AndrewEichmann-NOAA Sep 19, 2024
fb55a4e
undo odd thing
AndrewEichmann-NOAA Sep 19, 2024
398ec22
style
AndrewEichmann-NOAA Sep 19, 2024
f314c2a
style
AndrewEichmann-NOAA Sep 19, 2024
c7cb09e
style
AndrewEichmann-NOAA Sep 19, 2024
1e53cb5
removed personal bits
AndrewEichmann-NOAA Sep 19, 2024
36fa89c
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Sep 20, 2024
c66994e
the great deawkwarding
AndrewEichmann-NOAA Sep 20, 2024
1069b58
using communal ICs
AndrewEichmann-NOAA Sep 24, 2024
e77db56
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Sep 24, 2024
5c21402
renaming
AndrewEichmann-NOAA Sep 24, 2024
e6bc17b
rearrange task deps
AndrewEichmann-NOAA Sep 26, 2024
4472499
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Sep 26, 2024
b19d000
merge cleanup
AndrewEichmann-NOAA Sep 30, 2024
926bbc3
debugging after merge
AndrewEichmann-NOAA Oct 3, 2024
4bc1886
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 3, 2024
b4bafa3
fixing halo size key
AndrewEichmann-NOAA Oct 9, 2024
0b8a255
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 9, 2024
40fea74
thou shall not pass
AndrewEichmann-NOAA Oct 9, 2024
938fa53
fix workflow generator
AndrewEichmann-NOAA Oct 9, 2024
77f44e1
ocn inc corrected for gefs
AndrewEichmann-NOAA Oct 10, 2024
1574996
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 10, 2024
dcd4322
using GDUMP_ENS
AndrewEichmann-NOAA Oct 11, 2024
ddc5445
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 16, 2024
8024e5f
add underscore in task names
AndrewEichmann-NOAA Oct 16, 2024
c4f289b
comment pruning
AndrewEichmann-NOAA Oct 16, 2024
afc8257
Update workflow/rocoto/gfs_tasks.py
AndrewEichmann-NOAA Oct 16, 2024
7716bdd
review stuff
AndrewEichmann-NOAA Oct 17, 2024
01de9c9
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 17, 2024
ee50ae6
style points
AndrewEichmann-NOAA Oct 17, 2024
826e8d0
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 18, 2024
f200ec0
Update jobs/JGLOBAL_MARINE_ANALYSIS_LETKF
AndrewEichmann-NOAA Oct 18, 2024
0dbd5e1
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 22, 2024
d48236f
review changes
AndrewEichmann-NOAA Oct 28, 2024
84b125c
Merge branch 'feature/ens-WCDA-ctest' of github.com:AndrewEichmann-NO…
AndrewEichmann-NOAA Oct 28, 2024
1bb7007
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 28, 2024
28eb915
Merge branch 'feature/ens-WCDA-ctest' of github.com:AndrewEichmann-NO…
AndrewEichmann-NOAA Oct 28, 2024
522d3c5
merged and tested
AndrewEichmann-NOAA Oct 28, 2024
3da66c3
orion env fix
AndrewEichmann-NOAA Oct 28, 2024
eee78a1
review and merge tweaks
AndrewEichmann-NOAA Oct 29, 2024
bb9d014
Merge branch 'develop' into feature/ens-WCDA-ctest
AndrewEichmann-NOAA Oct 29, 2024
02388e6
review tweak
AndrewEichmann-NOAA Oct 29, 2024
9fa7813
Update ush/python/pygfs/task/marine_letkf.py
AndrewEichmann-NOAA Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions ci/cases/pr/C48mx500_hybAOWCDA.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
experiment:
system: gfs
mode: cycled

arguments:
pslot: {{ 'pslot' | getenv }}
app: S2S
resdetatmos: 48
resdetocean: 5.0
resensatmos: 48
comroot: {{ 'RUNTESTS' | getenv }}/COMROOT
expdir: {{ 'RUNTESTS' | getenv }}/EXPDIR
icsdir: {{ 'ICSDIR_ROOT' | getenv }}/C48mx500/20240610
idate: 2021032412
edate: 2021032418
nens: 3
gfs_cyc: 0
start: warm
yaml: {{ HOMEgfs }}/ci/cases/yamls/soca_gfs_defaults_ci.yaml

skip_ci_on_hosts:
- wcoss2
- orion
- hercules
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 3 additions & 3 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ elif [[ "${step}" = "ocnanalecen" ]]; then
export NTHREADS_OCNANALECEN=${NTHREADSmax}
export APRUN_OCNANALECEN="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "marineanalletkf" ]]; then
elif [[ "${step}" = "marineanlletkf" ]]; then

export NTHREADS_MARINEANALLETKF=${NTHREADSmax}
export APRUN_MARINEANALLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_MARINEANALLETKF}"
export NTHREADS_MARINEANLLETKF=${NTHREADSmax}
export APRUN_MARINEANLLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_MARINEANLLETKF}"

AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then

Expand Down
6 changes: 3 additions & 3 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ elif [[ "${step}" = "ocnanalecen" ]]; then
export NTHREADS_OCNANALECEN=${NTHREADSmax}
export APRUN_OCNANALECEN="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "marineanalletkf" ]]; then
elif [[ "${step}" = "marineanlletkf" ]]; then

export NTHREADS_MARINEANALLETKF=${NTHREADSmax}
export APRUN_MARINEANALLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_MARINEANALLETKF}"
export NTHREADS_MARINEANLLETKF=${NTHREADSmax}
export APRUN_MARINEANLLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_MARINEANLLETKF}"

elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then

Expand Down
6 changes: 3 additions & 3 deletions env/WCOSS2.env
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ elif [[ "${step}" = "ocnanalecen" ]]; then
export NTHREADS_OCNANALECEN=${NTHREADSmax}
export APRUN_OCNANALECEN="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANALECEN}"

elif [[ "${step}" = "marineanalletkf" ]]; then
elif [[ "${step}" = "marineanlletkf" ]]; then

export NTHREADS_MARINEANALLETKF=${NTHREADSmax}
export APRUN_MARINEANALLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_MARINEANALLETKF}"
export NTHREADS_MARINEANLLETKF=${NTHREADSmax}
export APRUN_MARINEANLLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_MARINEANLLETKF}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect specification for WCOSS2.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aerorahul Is there an example you could suggest to work off of? There seem to be a number of choices.

Copy link
Contributor

@aerorahul aerorahul Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since JEDI does not yet employ threads, this could simply be:

export APRUN_MARINEANLLETKF="${APRUN_default}"

When threading do come into play,

export APRUN_MARINEANLLETKF="${APRUN_default} --ppn ${tasks_per_node}--cpu-bind depth --depth=${NTHREADS_MARINEANLLETKF}"

You could see the JEDI atm sections of this code for reference.


elif [[ "${step}" = "atmanlfv3inc" ]]; then

Expand Down
13 changes: 8 additions & 5 deletions jobs/JGLOBAL_MARINE_ANALYSIS_LETKF
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
source "${HOMEgfs}/ush/preamble.sh"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanalletkf" -c "base ocnanal marineanalletkf"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlletkf" -c "base ocnanal marineanlletkf"

##############################################
# Set variables used in the script
Expand All @@ -13,10 +13,13 @@ gPDY=${GDATE:0:8}
gcyc=${GDATE:8:2}

YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
COMIN_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \
COMIN_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL
COMIN_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \
COMIN_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL

YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_OBS:COM_OBS_TMPL
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMIN_OBS:COM_OBS_TMPL \
COMOUT_OCEAN_LETKF:COM_OCEAN_LETKF_TMPL \
COMOUT_ICE_LETKF:COM_ICE_LETKF_TMPL

##############################################
# Begin JOB SPECIFIC work
Expand All @@ -25,7 +28,7 @@ YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_OBS:COM_OBS_TMPL
###############################################################
# Run relevant script

EXSCRIPT=${GDASOCNLETKFPY:-${HOMEgfs}/scripts/exgdas_global_marine_analysis_letkf.py}
EXSCRIPT=${GDASOCNLETKFPY:-${HOMEgfs}/scripts/exglobal_marine_analysis_letkf.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
Expand Down
12 changes: 7 additions & 5 deletions jobs/JGLOBAL_MARINE_BMAT
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@

source "${HOMEgfs}/ush/preamble.sh"

if (( 10#${ENSMEM:-0} > 0 )); then
# source config.base, config.ocnanal and config.marinebmat
# and pass marinebmat to ${machine}.env
source "${HOMEgfs}/ush/jjob_header.sh" -e "marinebmat" -c "base ocnanal marinebmat"


if (( 10#${NMEM_ENS:-0} > 0 )); then
export DATAjob="${DATAROOT}/${RUN}marinebmat.${PDY:-}${cyc}"
export DATA="${DATAjob}/${jobid}"
export DATA=${DATA:-${DATAROOT}/${jobid:?}}
# Create the directory to hold ensemble perturbations
export DATAenspert="${DATAjob}/enspert"
if [[ ! -d "${DATAenspert}" ]]; then mkdir -p "${DATAenspert}"; fi
fi
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved

# source config.base, config.ocnanal and config.marinebmat
# and pass marinebmat to ${machine}.env
source "${HOMEgfs}/ush/jjob_header.sh" -e "marinebmat" -c "base ocnanal marinebmat"

##############################################
# Set variables used in the script
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source "${HOMEgfs}/ush/preamble.sh"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

export job="marineanalletkf"
export job="marineanlletkf"
export jobid="${job}.$$"

###############################################################
Expand Down
2 changes: 2 additions & 0 deletions parm/config/gfs/config.com
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ declare -rx COM_OCEAN_HISTORY_TMPL=${COM_BASE}'/model/ocean/history'
declare -rx COM_OCEAN_RESTART_TMPL=${COM_BASE}'/model/ocean/restart'
declare -rx COM_OCEAN_INPUT_TMPL=${COM_BASE}'/model/ocean/input'
declare -rx COM_OCEAN_ANALYSIS_TMPL=${COM_BASE}'/analysis/ocean'
declare -rx COM_OCEAN_LETKF_TMPL=${COM_BASE}'/analysis/ocean/letkf'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What files get written to the letkf directories vs the regular component analysis directories?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the analysis files from the LETKF, which are separate from the variational analysis files

declare -rx COM_OCEAN_BMATRIX_TMPL=${COM_BASE}'/bmatrix/ocean'
declare -rx COM_OCEAN_NETCDF_TMPL=${COM_BASE}'/products/ocean/netcdf'
declare -rx COM_OCEAN_GRIB_TMPL=${COM_BASE}'/products/ocean/grib2'
declare -rx COM_OCEAN_GRIB_GRID_TMPL=${COM_OCEAN_GRIB_TMPL}'/${GRID}'

declare -rx COM_ICE_ANALYSIS_TMPL=${COM_BASE}'/analysis/ice'
declare -rx COM_ICE_LETKF_TMPL=${COM_BASE}'/analysis/ice/letkf'
declare -rx COM_ICE_BMATRIX_TMPL=${COM_BASE}'/bmatrix/ice'
declare -rx COM_ICE_INPUT_TMPL=${COM_BASE}'/model/ice/input'
declare -rx COM_ICE_HISTORY_TMPL=${COM_BASE}'/model/ice/history'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
#!/bin/bash

########## config.marineanalletkf ##########
########## config.marineanlletkf ##########
# Ocn Analysis specific

echo "BEGIN: config.marineanalletkf"
echo "BEGIN: config.marineanlletkf"

# Get task specific resources
. "${EXPDIR}/config.resources" marineanalletkf
. "${EXPDIR}/config.resources" marineanlletkf

export MARINE_LETKF_EXEC="${JEDI_BIN}/gdas.x"
export MARINE_LETKF_YAML_TMPL="${PARMgfs}/gdas/soca/letkf/letkf.yaml.j2"
export MARINE_LETKF_STAGE_YAML_TMPL="${PARMgfs}/gdas/soca/letkf/letkf_stage.yaml.j2"
export MARINE_LETKF_SAVE_YAML_TMPL="${PARMgfs}/gdas/soca/letkf/letkf_save.yaml.j2"

export GRIDGEN_EXEC="${JEDI_BIN}/gdas_soca_gridgen.x"
export GRIDGEN_YAML="${PARMgfs}/gdas/soca/gridgen/gridgen.yaml"

echo "END: config.marineanalletkf"
echo "END: config.marineanlletkf"
4 changes: 2 additions & 2 deletions parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ if (( $# != 1 )); then
echo "waveinit waveprep wavepostsbs wavepostbndpnt wavepostbndpntbll wavepostpnt"
echo "wavegempak waveawipsbulls waveawipsgridded"
echo "postsnd awips gempak npoess"
echo "ocnanalprep prepoceanobs marinebmat ocnanalrun ocnanalecen marineanalletkf ocnanalchkpt ocnanalpost ocnanalvrfy"
echo "ocnanalprep prepoceanobs marinebmat ocnanalrun ocnanalecen marineanlletkf ocnanalchkpt ocnanalpost ocnanalvrfy"
exit 1

fi
Expand Down Expand Up @@ -600,7 +600,7 @@ case ${step} in
tasks_per_node=$(( max_tasks_per_node / threads_per_task ))
;;

"marineanalletkf")
"marineanlletkf")
ntasks=16
case ${OCNRES} in
"025")
Expand Down
11 changes: 6 additions & 5 deletions ush/forecast_postdet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -460,12 +460,13 @@ MOM6_postdet() {
fi

# GEFS perturbations
# TODO if [[ $RUN} == "gefs" ]] block maybe be needed
if [[ "${RUN}" == "gefs" ]]; then
# to ensure it does not interfere with the GFS when ensemble is updated in the GFS
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
if (( MEMBER > 0 )) && [[ "${ODA_INCUPD:-False}" == "True" ]]; then
${NCP} "${COMIN_OCEAN_ANALYSIS}/mom6_increment.nc" "${DATA}/INPUT/mom6_increment.nc" \
|| ( echo "FATAL ERROR: Unable to copy ensemble MOM6 increment, ABORT!"; exit 1 )
fi
if (( MEMBER > 0 )) && [[ "${ODA_INCUPD:-False}" == "True" ]]; then
${NCP} "${COMIN_OCEAN_ANALYSIS}/mom6_increment.nc" "${DATA}/INPUT/mom6_increment.nc" \
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
|| ( echo "FATAL ERROR: Unable to copy ensemble MOM6 increment, ABORT!"; exit 1 )
fi
fi # if [[ "${RUN}" == "gefs" ]]; then
fi # if [[ "${RERUN}" == "NO" ]]; then

# Link output files
Expand Down
2 changes: 1 addition & 1 deletion ush/python/pygfs/task/marine_bmat.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def finalize(self: Task) -> None:
FileHandler({'copy': diagb_list}).sync()

# Copy the ensemble perturbation diagnostics to the ROTDIR
if self.task_config.DOHYBVAR == "YES" or self.task_config.NMEM_ENS > 3:
if self.task_config.DOHYBVAR == "YES" or self.task_config.NMEM_ENS > 2:
window_middle_iso = self.task_config.MARINE_WINDOW_MIDDLE.strftime('%Y-%m-%dT%H:%M:%SZ')
weight_list = []
src = os.path.join(self.task_config.DATA, f"ocn.ens_weights.incr.{window_middle_iso}.nc")
Expand Down
84 changes: 67 additions & 17 deletions ush/python/pygfs/task/marine_letkf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
from pygfs.task.analysis import Analysis
from typing import Dict
from wxflow import (AttrDict,
Executable,
FileHandler,
logit,
parse_j2yaml,
to_timedelta,
to_YMDH)
to_YMDH,
WorkflowException)
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved

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

Expand Down Expand Up @@ -64,17 +66,35 @@ def initialize(self):
logger.info("initialize")

# make directories and stage ensemble background files
ensbkgconf = AttrDict()
keys = ['previous_cycle', 'current_cycle', 'DATA', 'NMEM_ENS',
'PARMgfs', 'ROTDIR', 'COM_OCEAN_HISTORY_TMPL', 'COM_ICE_HISTORY_TMPL']
for key in keys:
ensbkgconf[key] = self.task_config[key]
ensbkgconf.RUN = 'enkfgdas'
soca_ens_bkg_stage_list = parse_j2yaml(self.task_config.SOCA_ENS_BKG_STAGE_YAML_TMPL, ensbkgconf)
FileHandler(soca_ens_bkg_stage_list).sync()
soca_fix_stage_list = parse_j2yaml(self.task_config.SOCA_FIX_YAML_TMPL, self.task_config)
FileHandler(soca_fix_stage_list).sync()
letkf_stage_list = parse_j2yaml(self.task_config.MARINE_LETKF_STAGE_YAML_TMPL, self.task_config)
stageconf = AttrDict()
keys = ['current_cycle',
'previous_cycle',
'COM_ICE_LETKF_TMPL',
'COM_OCEAN_LETKF_TMPL',
'COM_ICE_HISTORY_TMPL',
'COM_OCEAN_HISTORY_TMPL',
'COMIN_OCEAN_HISTORY_PREV',
'COMIN_ICE_HISTORY_PREV',
'COMOUT_ICE_LETKF',
'COMOUT_OCEAN_LETKF',
'DATA',
'NMEM_ENS',
'PARMgfs',
'ROTDIR',
'WINDOW_BEGIN',
'WINDOW_MIDDLE']
for key in keys:
stageconf[key] = self.task_config[key]
stageconf.RUN = 'enkfgdas'
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved

# stage ensemble background files
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
soca_ens_bkg_stage_list = parse_j2yaml(self.task_config.SOCA_ENS_BKG_STAGE_YAML_TMPL, stageconf)
FileHandler(soca_ens_bkg_stage_list).sync()

# stage letkf-specific files
letkf_stage_list = parse_j2yaml(self.task_config.MARINE_LETKF_STAGE_YAML_TMPL, stageconf)
FileHandler(letkf_stage_list).sync()

obs_list = parse_j2yaml(self.task_config.OBS_YAML, self.task_config)
Expand All @@ -83,7 +103,7 @@ def initialize(self):
obs_files = []
for ob in obs_list['observers']:
obs_name = ob['obs space']['name'].lower()
obs_filename = f"{self.task_config.RUN}.t{self.task_config.cyc}z.{obs_name}.{to_YMDH(self.task_config.current_cycle)}.nc"
obs_filename = f"{self.task_config.RUN}.t{self.task_config.cyc}z.{obs_name}.{to_YMDH(self.task_config.current_cycle)}.nc4"
obs_files.append((obs_filename, ob))

obs_files_to_copy = []
Expand All @@ -102,12 +122,7 @@ def initialize(self):
FileHandler({'copy': obs_files_to_copy}).sync()

# make the letkf.yaml
letkfconf = AttrDict()
keys = ['WINDOW_BEGIN', 'WINDOW_MIDDLE', 'RUN', 'gcyc', 'NMEM_ENS']
for key in keys:
letkfconf[key] = self.task_config[key]
letkfconf.RUN = 'enkfgdas'
letkf_yaml = parse_j2yaml(self.task_config.MARINE_LETKF_YAML_TMPL, letkfconf)
letkf_yaml = parse_j2yaml(self.task_config.MARINE_LETKF_YAML_TMPL, stageconf)
letkf_yaml.observations.observers = obs_to_use
letkf_yaml.save(self.task_config.letkf_yaml_file)

Expand All @@ -133,6 +148,32 @@ def run(self):

logger.info("run")

exec_cmd_gridgen = Executable(self.task_config.APRUN_MARINEANLLETKF)
exec_cmd_gridgen.add_default_arg(self.task_config.GRIDGEN_EXEC)
exec_cmd_gridgen.add_default_arg(self.task_config.GRIDGEN_YAML)

try:
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
logger.debug(f"Executing {exec_cmd_gridgen}")
exec_cmd_gridgen()
except OSError:
raise OSError(f"Failed to execute {exec_cmd_gridgen}")
except Exception:
raise WorkflowException(f"An error occured during execution of {exec_cmd_gridgen}")
pass
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved

exec_cmd_letkf = Executable(self.task_config.APRUN_MARINEANLLETKF)
for letkf_exec_arg in self.task_config.letkf_exec_args:
exec_cmd_letkf.add_default_arg(letkf_exec_arg)

try:
logger.debug(f"Executing {exec_cmd_letkf}")
exec_cmd_letkf()
except OSError:
raise OSError(f"Failed to execute {exec_cmd_letkf}")
except Exception:
raise WorkflowException(f"An error occured during execution of {exec_cmd_letkf}")
pass

@logit(logger)
def finalize(self):
"""Method finalize for ocean and sea ice LETKF task
Expand All @@ -145,3 +186,12 @@ def finalize(self):
"""

logger.info("finalize")

letkfsaveconf = AttrDict()
keys = ['current_cycle', 'DATA', 'NMEM_ENS', 'WINDOW_BEGIN',
'PARMgfs', 'ROTDIR', 'COM_OCEAN_LETKF_TMPL', 'COM_ICE_LETKF_TMPL']
for key in keys:
letkfsaveconf[key] = self.task_config[key]
letkfsaveconf.RUN = 'enkfgdas'
AndrewEichmann-NOAA marked this conversation as resolved.
Show resolved Hide resolved
letkf_save_list = parse_j2yaml(self.task_config.MARINE_LETKF_SAVE_YAML_TMPL, letkfsaveconf)
FileHandler(letkf_save_list).sync()
3 changes: 2 additions & 1 deletion ush/python/pygfs/utils/marine_da_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import f90nml
import os
from logging import getLogger
import os
import re
import xarray as xr

from wxflow import (FileHandler,
Expand Down
4 changes: 2 additions & 2 deletions workflow/applications/gfs_cycled.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _get_app_configs(self):
if self.do_jediocnvar:
configs += ['prepoceanobs', 'ocnanalprep', 'marinebmat', 'ocnanalrun']
if self.do_hybvar:
configs += ['ocnanalecen']
configs += ['marineanlletkf', 'ocnanalecen']
configs += ['ocnanalchkpt', 'ocnanalpost']
if self.do_vrfy_oceanda:
configs += ['ocnanalvrfy']
Expand Down Expand Up @@ -148,7 +148,7 @@ def get_task_names(self):
if self.do_jediocnvar:
gdas_gfs_common_tasks_before_fcst += ['prepoceanobs', 'ocnanalprep', 'marinebmat', 'ocnanalrun']
if self.do_hybvar:
gdas_gfs_common_tasks_before_fcst += ['ocnanalecen']
gdas_gfs_common_tasks_before_fcst += ['marineanlletkf', 'ocnanalecen']
gdas_gfs_common_tasks_before_fcst += ['ocnanalchkpt', 'ocnanalpost']
if self.do_vrfy_oceanda:
gdas_gfs_common_tasks_before_fcst += ['ocnanalvrfy']
Expand Down
Loading
Loading