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

Setup the snow DA analysis to update to the enkf ensemble members #2033

Closed
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
027916a
Initialize the configs and setups for ensemble land DA.
jiaruidong2017 Nov 4, 2023
229d6cc
Add DO_JEDILANDENS to the config.base
jiaruidong2017 Nov 4, 2023
fb9629f
Add the task landensanl for land DA updates to the ensemble members
jiaruidong2017 Nov 5, 2023
057814b
Reverted a change.
jiaruidong2017 Nov 5, 2023
73d748b
Remove the predefined COM variables.
jiaruidong2017 Nov 6, 2023
2c90836
Add jobs/JGLOBAL_LANDENS_ANALYSIS to update ensembles with snow DA.
jiaruidong2017 Nov 19, 2023
27660fe
Revert the change to the land_analysis.py
jiaruidong2017 Nov 19, 2023
dbe75a7
Remove DO_JEDILANDENS
jiaruidong2017 Nov 19, 2023
6e65049
Reuse the config.landanl for config.landensanl
jiaruidong2017 Nov 19, 2023
85311c6
Modify the config.landensanl
jiaruidong2017 Nov 20, 2023
ffd6c59
Reverted changes.
jiaruidong2017 Nov 20, 2023
67313b7
Merge branch 'develop' into feature/ens_landda
jiaruidong2017 Nov 20, 2023
9dc7d53
Address the shell check warning.
jiaruidong2017 Nov 20, 2023
ea58de5
Move the IMS data processing from preplandobs task to landanl task.
jiaruidong2017 Dec 2, 2023
8a20d1a
Remove the comments
jiaruidong2017 Dec 2, 2023
b82dfd7
Create a new get_obs_dict for skipping the IMS data copies.
jiaruidong2017 Dec 11, 2023
d808429
Merge branch 'develop' into feature/ens_landda
jiaruidong2017 Dec 13, 2023
089f3bf
Merge branch 'NOAA-EMC:develop' into feature/ens_landda
jiaruidong2017 Dec 16, 2023
ede3f9f
Add the archive to save the snow analysis to hpss.
jiaruidong2017 Dec 29, 2023
b9b2922
Fix the shell check warning.
jiaruidong2017 Dec 29, 2023
d30517d
Merge branch 'develop' into feature/ens_landda
jiaruidong2017 Dec 29, 2023
5cc3d1b
Remove gdasland list and delete vrfy and comment lines.
jiaruidong2017 Jan 3, 2024
9886210
Merge branch 'develop' into feature/ens_landda
jiaruidong2017 Jan 17, 2024
ed5963b
Merge branch 'develop' into feature/ens_landda
jiaruidong2017 Jan 28, 2024
6394992
Merge to develop to remove the deterministic changes.
jiaruidong2017 Jan 28, 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
12 changes: 11 additions & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if [[ $# -ne 1 ]]; then

echo "Must specify an input argument to set runtime environment variables!"
echo "argument can be any one of the following:"
echo "atmanlrun atmensanlrun aeroanlrun landanl"
echo "atmanlrun atmensanlrun aeroanlrun landanl landensanl"
echo "anal sfcanl fcst post vrfy metp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is vrfy being added back in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed vrfy.

echo "eobs eupd ecen efcs epos"
echo "postsnd awips gempak"
Expand Down Expand Up @@ -88,6 +88,16 @@ elif [[ "${step}" = "landanl" ]]; then

export APRUN_APPLY_INCR="${launcher} -n 6"

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

nth_max=$((npe_node_max / npe_node_landensanl))

export NTHREADS_LANDANL=${nth_landensanl:-${nth_max}}
[[ ${NTHREADS_LANDANL} -gt ${nth_max} ]] && export NTHREADS_LANDANL=${nth_max}
export APRUN_LANDANL="${launcher} -n ${npe_landensanl}"

export APRUN_APPLY_INCR="${launcher} -n 6"

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

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"
Expand Down
48 changes: 48 additions & 0 deletions jobs/JGLOBAL_LANDENS_ANALYSIS
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA=${DATA:-${DATAROOT}/${RUN}landensanl_${cyc}}
Copy link
Contributor

Choose a reason for hiding this comment

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

These are only needed if the job is using the working directory of a previous job. It appears this job is doing initialize/run/finalize all in one job.

Suggested change
export WIPE_DATA="NO"
export DATA=${DATA:-${DATAROOT}/${RUN}landensanl_${cyc}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed as you suggested. Thanks.

source "${HOMEgfs}/ush/jjob_header.sh" -e "landensanl" -c "base landensanl"

##############################################
# Set variables used in the script
##############################################
# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
gPDY=${GDATE:0:8}
gcyc=${GDATE:8:2}
GDUMP="enkfgdas"

##############################################
# Begin JOB SPECIFIC work
##############################################
# Generate COM variables from templates
YMD=${PDY} HH=${cyc} generate_com -rx COM_LANDENS_ANALYSIS
Copy link
Contributor

Choose a reason for hiding this comment

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

COM_LANDENS_ANALYSIS_TMPL is not defined anywhere in order to build this variable. Should this be

Suggested change
YMD=${PDY} HH=${cyc} generate_com -rx COM_LANDENS_ANALYSIS
YMD=${PDY} HH=${cyc} generate_com -rx COM_LAND_ANALYSIS

(COM_LAND_ANALYSIS is already defined in config.com)

I also don't see a MEMDIR definition, which this will need if it is part of RUN=enkf. What RUN(s) is this part of, and if it is part of enkf, is it trying to write stuff for a bunch of different members (either as a metatask or looping over members within a single job)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @WalterKolczynski-NOAA I removed the whole sections because the COM directories for the ensemble members will be defined at the runtime and the MEMDIR is part of RUN=enkf.


RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} generate_com -rx \
COM_ATMOS_RESTART_PREV:COM_ATMOS_RESTART_TMPL

mkdir -m 775 -p "${COM_LANDENS_ANALYSIS}"

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

EXSCRIPT=${LANDENSANLPY:-${HOMEgfs}/scripts/exglobal_landens_analysis.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

##############################################
# End JOB SPECIFIC work
##############################################

##############################################
# Final processing
##############################################
if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

exit 0
24 changes: 24 additions & 0 deletions jobs/rocoto/landensanl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#! /usr/bin/env bash

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

###############################################################
# Source UFSDA workflow modules
. "${HOMEgfs}/ush/load_ufsda_modules.sh"
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

export job="landensanl"
export jobid="${job}.$$"

###############################################################
# setup python path for workflow utilities and tasks
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}"
export PYTHONPATH

###############################################################
# Execute the JJOB
"${HOMEgfs}/jobs/JGLOBAL_LANDENS_ANALYSIS"
status=$?
exit "${status}"
1 change: 1 addition & 0 deletions parm/config/gfs/config.base.emc.dyn
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export DO_JEDIATMVAR="@DO_JEDIATMVAR@"
export DO_JEDIATMENS="@DO_JEDIATMENS@"
export DO_JEDIOCNVAR="@DO_JEDIOCNVAR@"
export DO_JEDILANDDA="@DO_JEDILANDDA@"
export DO_JEDILANDENS="@DO_JEDILANDENS@"
export DO_MERGENSST="@DO_MERGENSST@"

# Hybrid related
Expand Down
34 changes: 34 additions & 0 deletions parm/config/gfs/config.landensanl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /usr/bin/env bash
WalterKolczynski-NOAA marked this conversation as resolved.
Show resolved Hide resolved

########## config.landensanl ##########
# Land Ens Analysis specific

echo "BEGIN: config.landensanl"

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

obs_list_name=gdas_land_gts_only.yaml
if [[ "${cyc}" = "18" ]]; then
obs_list_name=gdas_land_prototype.yaml
fi

export OBS_YAML_DIR=${HOMEgfs}/sorc/gdas.cd/parm/land/obs/config/
export OBS_LIST=${HOMEgfs}/sorc/gdas.cd/parm/land/obs/lists/${obs_list_name}

# Name of the JEDI executable and its yaml template
export JEDIEXE="${HOMEgfs}/exec/fv3jedi_letkf.x"
export JEDIYAML="${HOMEgfs}/sorc/gdas.cd/parm/land/letkfoi/letkfoi.yaml"

# Ensemble member properties
export SNOWDEPTHVAR="snodl"
export BESTDDEV="30." # Background Error Std. Dev. for LETKFOI

# Name of the executable that applies increment to bkg and its namelist template
export APPLY_INCR_EXE="${HOMEgfs}/exec/apply_incr.exe"
export APPLY_INCR_NML_TMPL="${HOMEgfs}/sorc/gdas.cd/parm/land/letkfoi/apply_incr_nml.j2"

export io_layout_x=@IO_LAYOUT_X@
export io_layout_y=@IO_LAYOUT_Y@

echo "END: config.landensanl"
18 changes: 17 additions & 1 deletion parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ $# -ne 1 ]]; then
echo "prep preplandobs prepatmiodaobs"
echo "atmanlinit atmanlrun atmanlfinal"
echo "atmensanlinit atmensanlrun atmensanlfinal"
echo "landanl"
echo "landanl landensanl"
echo "aeroanlinit aeroanlrun aeroanlfinal"
echo "anal sfcanl analcalc analdiag fcst post echgres"
echo "verfozn verfrad vminmon vrfy fit2obs metp arch cleanup"
Expand Down Expand Up @@ -874,6 +874,22 @@ elif [[ "${step}" = "atmensanlfinal" ]]; then
export npe_node_atmensanlfinal
export is_exclusive=True

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

export layout_x=1
export layout_y=1

export wtime_landensanl="00:15:00"
npe_landensanl=$(echo "${layout_x} * ${layout_y} * 6" | bc)
export npe_landensanl
npe_landensanl_gfs=$(echo "${layout_x} * ${layout_y} * 6" | bc)
export npe_landensanl_gfs
export nth_landensanl=1
export nth_landensanl_gfs=${nth_landensanl}
npe_node_landensanl=$(echo "${npe_node_max} / ${nth_landensanl}" | bc)
export npe_node_landensanl
export is_exclusive=True

elif [[ ${step} = "eobs" || ${step} = "eomg" ]]; then

export wtime_eobs="00:15:00"
Expand Down
1 change: 1 addition & 0 deletions parm/config/gfs/yaml/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ base:
DO_JEDIATMENS: "NO"
DO_JEDIOCNVAR: "NO"
DO_JEDILANDDA: "NO"
DO_JEDILANDENS: "NO"
DO_MERGENSST: "NO"

atmanl:
Expand Down
12 changes: 10 additions & 2 deletions scripts/exgdas_enkf_sfc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,18 @@ if [ $DOSFCANL_ENKF = "YES" ]; then
RUN="${GDUMP_ENS}" MEMDIR=${memchar} YMD=${gPDY} HH=${gcyc} generate_com \
COM_ATMOS_RESTART_MEM_PREV:COM_ATMOS_RESTART_TMPL

RUN="${GDUMP_ENS}" MEMDIR=${memchar} YMD=${PDY} HH=${cyc} generate_com \
COM_LAND_MEM_ANALYSIS:COM_LAND_ANALYSIS_TMPL

[[ ${TILE_NUM} -eq 1 ]] && mkdir -p "${COM_ATMOS_RESTART_MEM}"

${NCP} "${COM_ATMOS_RESTART_MEM_PREV}/${PDY}.${cyc}0000.sfc_data.tile${n}.nc" \
"${COM_ATMOS_RESTART_MEM}/${PDY}.${cyc}0000.sfcanl_data.tile${n}.nc"
if [[ ${DO_JEDILANDENS:-"NO"} = "YES" ]]; then
${NCP} "${COM_LAND_MEM_ANALYSIS}/${PDY}.${cyc}0000.sfc_data.tile${n}.nc" \
"${COM_ATMOS_RESTART_MEM}/${PDY}.${cyc}0000.sfcanl_data.tile${n}.nc"
else
${NCP} "${COM_ATMOS_RESTART_MEM_PREV}/${PDY}.${cyc}0000.sfc_data.tile${n}.nc" \
"${COM_ATMOS_RESTART_MEM}/${PDY}.${cyc}0000.sfcanl_data.tile${n}.nc"
fi
${NLN} "${COM_ATMOS_RESTART_MEM_PREV}/${PDY}.${cyc}0000.sfc_data.tile${n}.nc" \
"${DATA}/fnbgsi.${cmem}"
${NLN} "${COM_ATMOS_RESTART_MEM}/${PDY}.${cyc}0000.sfcanl_data.tile${n}.nc" \
Expand Down
24 changes: 24 additions & 0 deletions scripts/exglobal_landens_analysis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# exglobal_landens_analysis.py
# This script creates an LandEnsAnalysis object
# and runs the initialize, execute and finalize methods
# which executes the global land enkf ensemble analysis
import os

from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs.task.landens_analysis import LandEnsAnalysis

# Initialize root logger
logger = Logger(level=os.environ.get("LOGGING_LEVEL", "DEBUG"), colored_log=True)


if __name__ == '__main__':

# Take configuration from environment and cast it as python dictionary
config = cast_strdict_as_dtypedict(os.environ)

# Instantiate the landens analysis task
LandEnsAnl = LandEnsAnalysis(config)
LandEnsAnl.initialize()
LandEnsAnl.execute()
LandEnsAnl.finalize()
7 changes: 6 additions & 1 deletion workflow/applications/gfs_cycled.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(self, conf: Configuration):
self.do_jediatmens = self._base.get('DO_JEDIATMENS', False)
self.do_jediocnvar = self._base.get('DO_JEDIOCNVAR', False)
self.do_jedilandda = self._base.get('DO_JEDILANDDA', False)
self.do_jedilandens = self._base.get('DO_JEDILANDENS', False)
self.do_mergensst = self._base.get('DO_MERGENSST', False)

self.lobsdiag_forenkf = False
Expand Down Expand Up @@ -54,6 +55,8 @@ def _get_app_configs(self):
configs += ['atmensanlinit', 'atmensanlrun', 'atmensanlfinal']
else:
configs += ['eobs', 'eomg', 'ediag', 'eupd']
if self.do_jedilandens:
configs += ['landensanl']
configs += ['ecen', 'esfc', 'efcs', 'echgres', 'epos', 'earc']

if self.do_verfozn:
Expand Down Expand Up @@ -93,7 +96,7 @@ def _get_app_configs(self):
configs += ['aeroanlinit', 'aeroanlrun', 'aeroanlfinal']

if self.do_jedilandda:
configs += ['preplandobs', 'landanl']
configs += ['preplandobs', 'landanl', 'landensanl']

return configs

Expand Down Expand Up @@ -146,6 +149,8 @@ def get_task_names(self):
else:
hybrid_tasks += ['eobs', 'eupd', 'echgres']
hybrid_tasks += ['ediag'] if self.lobsdiag_forenkf else ['eomg']
if self.do_jedilandens:
hybrid_tasks += ['landensanl']
hybrid_after_eupd_tasks += ['ecen', 'esfc', 'efcs', 'epos', 'earc', 'cleanup']

# Collect all "gdas" cycle tasks
Expand Down
24 changes: 23 additions & 1 deletion workflow/rocoto/gfs_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,23 @@ def atmensanlfinal(self):

return task

def landensanl(self):

deps = []
dep_dict = {'type': 'task', 'name': f'{self.cdump.replace("enkf","")}preplandobs'}
deps.append(rocoto.add_dependency(dep_dict))
dep_dict = {'type': 'task', 'name': f'{self.cdump}echgres'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)

cycledef = 'gdas_half,gdas' if self.cdump in ['enkfgdas'] else self.cdump

resources = self.get_resource('landensanl')
task = create_wf_task('landensanl', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies,
cycledef=cycledef)

return task

def ecen(self):

def _get_ecengroups():
Expand Down Expand Up @@ -1182,7 +1199,12 @@ def esfc(self):
else:
dep_dict = {'type': 'task', 'name': f'{self.cdump}eupd'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)
if self.app_config.do_jedilandens:
dep_dict = {'type': 'task', 'name': f'{self.cdump}landensanl'}
deps.append(rocoto.add_dependency(dep_dict))
dependencies = rocoto.create_dependency(dep_condition='and', dep=deps)
else:
dependencies = rocoto.create_dependency(dep=deps)

resources = self.get_resource('esfc')
task = create_wf_task('esfc', resources, cdump=self.cdump, envar=self.envars, dependency=dependencies)
Expand Down
2 changes: 1 addition & 1 deletion workflow/rocoto/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Tasks:
'eobs', 'eomg', 'epos', 'esfc', 'eupd',
'atmensanlinit', 'atmensanlrun', 'atmensanlfinal',
'aeroanlinit', 'aeroanlrun', 'aeroanlfinal',
'preplandobs', 'landanl',
'preplandobs', 'landanl', 'landensanl',
'fcst', 'post', 'ocnpost',
'verfozn', 'verfrad', 'vminmon', 'vrfy', 'metp',
'postsnd', 'awips', 'gempak',
Expand Down