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

Move the variational scripts to this repository #2920

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion ci/cases/gfsv17/ocnanal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ base:
FHMAX_GFS: 240
ACCOUNT: {{ 'HPC_ACCOUNT' | getenv }}

ocnanal:
marineanl:
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
SOCA_INPUT_FIX_DIR: {{ HOMEgfs }}/fix/gdas/soca/1440x1080x75/soca
SOCA_OBS_LIST: {{ HOMEgfs }}/sorc/gdas.cd/parm/soca/obs/obs_list.yaml
SOCA_NINNER: 100
Expand Down
4 changes: 2 additions & 2 deletions env/CONTAINER.env
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ulimit -s unlimited
ulimit -a


if [ "${step}" = "ocnanalrun" ]; then
if [ "${step}" = "marineanlvar" ]; then
export NTHREADS_OCNANAL=1
export APRUN_OCNANAL="${launcher} -n 2"
export APRUN_MARINEANLVAR="${launcher} -n 2"
fi
10 changes: 4 additions & 6 deletions env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,15 @@ elif [[ "${step}" = "marinebmat" ]]; then
export APRUNCFP="${launcher} -n \$ncmd --multi-prog"
export APRUN_MARINEBMAT="${APRUN_default}"

elif [[ "${step}" = "ocnanalrun" ]]; then
elif [[ "${step}" = "marineanlvar" ]]; then

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"
export APRUN_MARINEANLVAR="${APRUN_default}"

export APRUN_OCNANAL="${APRUN_default}"

elif [[ "${step}" = "ocnanalchkpt" ]]; then
elif [[ "${step}" = "marineanlchkpt" ]]; then

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"

export APRUN_OCNANAL="${APRUN_default}"
export APRUN_MARINEANLCHKPT="${APRUN_default}"

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

Expand Down
8 changes: 4 additions & 4 deletions env/HERCULES.env
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ case ${step} in
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export APRUN_MARINEBMAT="${APRUN_default}"
;;
"ocnanalrun")
"marineanlvar")

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export APRUN_OCNANAL="${APRUN_default}"
export APRUN_MARINEANLVAR="${APRUN_default}"
;;
"ocnanalecen")

Expand All @@ -148,12 +148,12 @@ case ${step} in
[[ ${NTHREADS_OCNANALECEN} -gt ${max_threads_per_task} ]] && export NTHREADS_OCNANALECEN=${max_threads_per_task}
export APRUN_OCNANALECEN="${launcher} -n ${ntasks_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}"
;;
"ocnanalchkpt")
"marineanlchkpt")

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

export NTHREADS_OCNANAL=${NTHREADSmax}
export APRUN_OCNANAL="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANAL}"
export APRUN_MARINEANLCHKPT="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANAL}"
;;
"anal" | "analcalc")

Expand Down
6 changes: 3 additions & 3 deletions env/JET.env
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ elif [[ "${step}" = "atmensanlsol" ]]; then

export NTHREADS_ATMENSANLSOL=${NTHREADSmax}
export APRUN_ATMENSANLSOL="${APRUN_default}"

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

export NTHREADS_ATMENSANLLETKF=${NTHREADSmax}
Expand Down Expand Up @@ -121,10 +121,10 @@ elif [[ "${step}" = "marinebmat" ]]; then
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export APRUN_MARINEBMAT="${APRUN_default}"

elif [[ "${step}" = "ocnanalrun" ]]; then
elif [[ "${step}" = "marineanlvar" ]]; then

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export APRUN_OCNANAL="${APRUN_default}"
export APRUN_MARINEANLVAR="${APRUN_default}"

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

Expand Down
9 changes: 5 additions & 4 deletions env/ORION.env
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,19 @@ elif [[ "${step}" = "marinebmat" ]]; then
export NTHREADS_MARINEBMAT=${NTHREADSmax}
export APRUN_MARINEBMAT="${APRUN_default}"

elif [[ "${step}" = "ocnanalrun" ]]; then
elif [[ "${step}" = "marineanlvar" ]]; then

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

export APRUN_OCNANAL="${APRUN_default}"
export APRUN_MARINEANLVAR="${APRUN_default}"

elif [[ "${step}" = "ocnanalchkpt" ]]; then
elif [[ "${step}" = "marineanlchkpt" ]]; then

export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"

export NTHREADS_OCNANAL=${NTHREADSmax}
export APRUN_OCNANAL="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANAL}"

export APRUN_MARINEANLCHKPT="${APRUN} --cpus-per-task=${NTHREADS_OCNANAL}"

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

Expand Down
58 changes: 0 additions & 58 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_CHKPT

This file was deleted.

2 changes: 1 addition & 1 deletion jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_VRFY
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 "ocnanalprep" -c "base ocnanal ocnanalprep"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlinit" -c "base ocnanal marineanlinit"


##############################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
#!/bin/bash
source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalrun" -c "base ocnanal ocnanalrun"
export DATAjob="${DATAROOT}/${RUN}marineanalysis.${PDY:-}${cyc}"
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
export DATA="${DATAjob}/marinevariational"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlchkpt" -c "base marineanl marineanlchkpt"


##############################################
# Set variables used in the script
##############################################
# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
export GDUMP=${GDUMP:-"gdas"}

##############################################
# Begin JOB SPECIFIC work
##############################################


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

EXSCRIPT=${GDASOCNRUNSH:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_run.sh}
EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_checkpoint.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
Expand All @@ -33,9 +36,4 @@ if [[ -e "${pgmout}" ]] ; then
cat "${pgmout}"
fi

##########################################
# Do not remove the Temporary working directory (do this in POST)
##########################################
cd "${DATAROOT}" || exit 1

exit 0
Original file line number Diff line number Diff line change
@@ -1,41 +1,38 @@
#!/bin/bash
source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalpost" -c "base ocnanalpost"

export DATAjob="${DATAROOT}/${RUN}marineanalysis.${PDY:-}${cyc}"
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
export DATA="${DATAjob}/marinevariational"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlfinal" -c "base marineanl marineanlfinal"

##############################################
# Set variables used in the script
##############################################
# TODO remove this CDUMP declaration when the GDAS script
# exgdas_global_marine_analysis_post.py is updated to look for RUN instead
# of CDUMP.
export CDUMP=${CDUMP:-${RUN:-"gfs"}}
export CDATE=${CDATE:-${PDY}${cyc}}
# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
export GDUMP=${GDUMP:-"gdas"}
Copy link
Contributor

Choose a reason for hiding this comment

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

I doubt, GDUMP is used in a finalize step, but it might be needed in the __init__. Just check if that is the case.


# Generate COM variables from templates
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OCEAN_ANALYSIS COM_ICE_ANALYSIS COM_ICE_RESTART

mkdir -p "${COM_OCEAN_ANALYSIS}"
mkdir -p "${COM_ICE_ANALYSIS}"
mkdir -p "${COM_ICE_RESTART}"

##############################################
# Begin JOB SPECIFIC work
##############################################

# Add UFSDA to PYTHONPATH
ufsdaPATH="${HOMEgfs}/sorc/gdas.cd/ush/"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${ufsdaPATH}"
export PYTHONPATH
# Generate COM variables from templates
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COMIN_OBS:COM_OBS_TMPL

RUN=${GDUMP} YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
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 this GDUMP? This should be RUN.

Copy link
Contributor

Choose a reason for hiding this comment

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

GDUMP is associated with the guess; that is the previous cycle gPDY/gcyc -- just clarifying why the q.

COMOUT_OCEAN_ANALYSIS:COM_OCEAN_ANALYSIS_TMPL \
COMOUT_ICE_ANALYSIS:COM_ICE_ANALYSIS_TMPL \
COMOUT_ICE_RESTART:COM_ICE_RESTART_TMPL

if [[ -d "${COMOUT_OCEAN_ANALYSIS}" ]]; then mkdir -p "${COMOUT_OCEAN_ANALYSIS}"; fi
mkdir -p "${COMOUT_ICE_ANALYSIS}"
mkdir -p "${COMOUT_ICE_RESTART}"

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

EXSCRIPT=${GDASOCNPOSTPY:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_post.py}
EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_finalize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

source "${HOMEgfs}/ush/preamble.sh"
export DATA="${DATAROOT}/${RUN}ocnanal_${cyc}"
source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalprep" -c "base ocnanal ocnanalprep"
export DATAjob="${DATAROOT}/${RUN}marineanalysis.${PDY:-}${cyc}"
export DATA="${DATAjob}/marinevariational"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlinit" -c "base marineanl marineanlinit"


##############################################
Expand All @@ -10,42 +12,30 @@ source "${HOMEgfs}/ush/jjob_header.sh" -e "ocnanalprep" -c "base ocnanal ocnanal
# Ignore possible spelling error (nothing is misspelled)
# shellcheck disable=SC2153
GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
export GDATE
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
gPDY=${GDATE:0:8}
gcyc=${GDATE:8:2}
export GDUMP=${GDUMP:-"gdas"}

export OPREFIX="${RUN}.t${cyc}z."
export GPREFIX="${GDUMP}.t${gcyc}z."
export APREFIX="${RUN}.t${cyc}z."
##############################################
# Begin JOB SPECIFIC work
##############################################

# Generate COM variables from templates
YMD=${PDY} HH=${cyc} declare_from_tmpl -rx COM_OBS

RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
COM_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \
COM_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL \
COM_ICE_RESTART_PREV:COM_ICE_RESTART_TMPL
COMIN_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \
COMIN_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL \
COMIN_ICE_RESTART_PREV:COM_ICE_RESTART_TMPL

YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMIN_OCEAN_BMATRIX:COM_OCEAN_BMATRIX_TMPL \
COMIN_ICE_BMATRIX:COM_ICE_BMATRIX_TMPL

##############################################
# Begin JOB SPECIFIC work
##############################################

# Add UFSDA to PYTHONPATH
ufsdaPATH="${HOMEgfs}/sorc/gdas.cd/ush/"
# shellcheck disable=SC2311
pyiodaPATH="${HOMEgfs}/sorc/gdas.cd/build/lib/python$(detect_py_ver)/"
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${ufsdaPATH}:${pyiodaPATH}"
export PYTHONPATH

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

EXSCRIPT=${GDASOCNPREPPY:-${HOMEgfs}/sorc/gdas.cd/scripts/exgdas_global_marine_analysis_prep.py}
EXSCRIPT=${GDASMARINEANALYSIS:-${SCRgfs}/exglobal_marine_analysis_initialize.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"
Expand Down
38 changes: 38 additions & 0 deletions jobs/JGLOBAL_MARINE_ANALYSIS_VARIATIONAL
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#! /usr/bin/env bash

source "${HOMEgfs}/ush/preamble.sh"
export WIPE_DATA="NO"
export DATAjob="${DATAROOT}/${RUN}marineanalysis.${PDY:-}${cyc}"
export DATA="${DATAjob}/marinevariational"
source "${HOMEgfs}/ush/jjob_header.sh" -e "marineanlvar" -c "base marineanl marineanlvar"

##############################################
# Set variables used in the script
##############################################


##############################################
# Begin JOB SPECIFIC work
##############################################


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

EXSCRIPT=${GDASMARINERUNSH:-${SCRgfs}/exglobal_marine_analysis_variational.py}
${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

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

exit 0
Loading
Loading