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

Refactoring of the marine B-matrix job #2749

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
17494de
3dfgat gdas.cd ctests work but needs tidy
guillaumevernieres Jul 1, 2024
58115a6
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 1, 2024
5438a47
pynorms
guillaumevernieres Jul 1, 2024
ee36b5e
point to different soca tools
guillaumevernieres Jul 2, 2024
8ae7f79
added perturbations for envar
guillaumevernieres Jul 3, 2024
ba665f4
working hybvar
guillaumevernieres Jul 5, 2024
6900fc4
addressed some of the review comments
guillaumevernieres Jul 9, 2024
2d21d3d
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 9, 2024
8e137d0
minor tidy
guillaumevernieres Jul 9, 2024
216df7f
fixed shell norms?
guillaumevernieres Jul 9, 2024
612b456
more shell norms
guillaumevernieres Jul 9, 2024
c034653
job deps and arch
guillaumevernieres Jul 10, 2024
2311b4f
removed dpdcy to soca calc_scales module
guillaumevernieres Jul 11, 2024
faa84bf
removed dpdcy to soca calc_scales module 2
guillaumevernieres Jul 11, 2024
4913ff9
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 11, 2024
c93a43b
multiple res
guillaumevernieres Jul 12, 2024
0e2e05e
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 12, 2024
6ab9a5d
revert account
guillaumevernieres Jul 12, 2024
96db47e
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 12, 2024
f6aaf60
host dpdt fix dir
guillaumevernieres Jul 12, 2024
8a7b148
Update jobs/JGLOBAL_MARINE_BMAT
guillaumevernieres Jul 18, 2024
7cf347d
Update jobs/JGLOBAL_ARCHIVE
guillaumevernieres Jul 18, 2024
c8cbba0
cycle on orion/hercules
guillaumevernieres Jul 18, 2024
75cfc93
Merge branch 'feature/marine-det_gv' of https://github.com/guillaumev…
guillaumevernieres Jul 18, 2024
112085f
Update ush/python/pygfs/utils/marine_da_utils.py
guillaumevernieres Jul 18, 2024
4e69124
renamed ex script
guillaumevernieres Jul 18, 2024
6e0e2dc
Merge branch 'feature/marine-det_gv' of https://github.com/guillaumev…
guillaumevernieres Jul 18, 2024
4da5791
Update ush/python/pygfs/utils/marine_da_utils.py
guillaumevernieres Jul 18, 2024
a0a34d9
...
guillaumevernieres Jul 18, 2024
ee30556
Merge branch 'feature/marine-det_gv' of https://github.com/guillaumev…
guillaumevernieres Jul 18, 2024
a209510
Merge branch 'NOAA-EMC:feature/marine-det_gv' into feature/marine-det_gv
guillaumevernieres Jul 19, 2024
65eb775
fixed missing import
guillaumevernieres Jul 19, 2024
c05582b
Merge branch 'feature/marine-det_gv' of https://github.com/guillaumev…
guillaumevernieres Jul 19, 2024
bbc1fa0
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 20, 2024
017d191
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 22, 2024
4ba7dee
new hash for gdas.cd
guillaumevernieres Jul 22, 2024
3e85a94
snow at 18z and fixed marine da arch j2
guillaumevernieres Jul 23, 2024
5a7dd31
Merge branch 'develop' into feature/marine-det_gv
guillaumevernieres Jul 23, 2024
6d3704c
Rename marinebmat log file in gdas.yaml.j2
DavidHuber-NOAA Jul 24, 2024
507b62d
Merge pull request #7 from DavidHuber-NOAA/fix_gdas_tmpl
guillaumevernieres Jul 24, 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
8 changes: 7 additions & 1 deletion env/HERA.env
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ elif [[ "${step}" = "atmensanlfv3inc" ]]; then

export NTHREADS_ATMENSANLFV3INC=${nth_atmensanlfv3inc:-${nth_max}}
[[ ${NTHREADS_ATMENSANLFV3INC} -gt ${nth_max} ]] && export NTHREADS_ATMENSANLFV3INC=${nth_max}
export APRUN_ATMENSANLFV3INC="${launcher} -n ${npe_atmensanlfv3inc} --cpus-per-task=${NTHREADS_ATMENSANLFV3INC}"
export APRUN_ATMENSANLFV3INC="${launcher} -n ${npe_atmensanlfv3inc} --cpus-per-task=${NTHREADS_ATMENSANLFV3INC}"

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

Expand Down Expand Up @@ -114,6 +114,12 @@ elif [[ "${step}" = "snowanl" ]]; then

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

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

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

export APRUN_MARINEBMAT="${launcher} -n ${npe_ocnanalbmat}"

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

export APRUNCFP="${launcher} -n \$ncmd --multi-prog"
Expand Down
4 changes: 4 additions & 0 deletions jobs/JGDAS_GLOBAL_OCEAN_ANALYSIS_PREP
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
COM_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL \
COM_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
##############################################
Expand Down
68 changes: 68 additions & 0 deletions jobs/JGLOBAL_MARINE_BMAT
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

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

export DATA="${DATAROOT}/${RUN}marinebmat_${cyc}"
export DATA=${DATA:-${DATAROOT}/${RUN}marinebmat_${cyc}}
CoryMartin-NOAA marked this conversation as resolved.
Show resolved Hide resolved
# source config.base, config.ocnanal and config.ocnanalbmat
# and pass marinebmat to ${machine}.env
source "${HOMEgfs}/ush/jjob_header.sh" -e "marinebmat" -c "base ocnanal marinebmat"

# If ensemble perturbations are used, save them in a DATAenspert directory that will
# exist throughout the DA cycle
if (( 10#${NMEM_ENS:-0} > 0 )); then
export DATAjob="${DATAROOT}/${RUN}marinebmat.${PDY:-}${cyc}"
export DATAenspert="${DATAjob}/enspert"
if [[ ! -d "${DATAenspert}" ]]; then mkdir -p "${DATAenspert}"; fi
fi

##############################################
# Set variables used in the script
##############################################
# shellcheck disable=SC2153
export GDATE=$(date --utc +%Y%m%d%H -d "${PDY} ${cyc} - ${assim_freq} hours")
Fixed Show fixed Hide fixed
export gPDY=${GDATE:0:8}
export gcyc=${GDATE:8:2}
export GDUMP="gdas"
export GDUMP_ENS="enkf${GDUMP}"
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved

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

# Generate COM variables from templates
RUN=${GDUMP} YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
COMIN_OCEAN_HISTORY_PREV:COM_OCEAN_HISTORY_TMPL \
COMIN_ICE_HISTORY_PREV:COM_ICE_HISTORY_TMPL

RUN="enkfgdas" YMD=${gPDY} HH=${gcyc} declare_from_tmpl -rx \
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
COMIN_OCEAN_HISTORY_ENS_PREV:COM_OCEAN_HISTORY_TMPL \
COMIN_ICE_HISTORY_ENS_PREV:COM_ICE_HISTORY_TMPL

YMD=${PDY} HH=${cyc} declare_from_tmpl -rx \
COMOUT_OCEAN_BMATRIX:COM_OCEAN_BMATRIX_TMPL \
COMOUT_ICE_BMATRIX:COM_ICE_BMATRIX_TMPL

mkdir -p "${COMOUT_OCEAN_BMATRIX}"
mkdir -p "${COMOUT_ICE_BMATRIX}"

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

EXSCRIPT=${GDASMARINEBMATRUNPY:-${SCRgfs}/exglobal_marine_bmat_run.py}
Copy link
Contributor

Choose a reason for hiding this comment

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

why _run?
EE2 will make us change this to match the j-job name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, will push the changes after I'm done testing

${EXSCRIPT}
status=$?
[[ ${status} -ne 0 ]] && exit "${status}"

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

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

exit 0
26 changes: 26 additions & 0 deletions jobs/rocoto/marinebmat.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#! /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="marinebmat"
export jobid="${job}.$$"

###############################################################
# setup python path for workflow utilities and tasks
wxflowPATH="${HOMEgfs}/ush/python:${HOMEgfs}/ush/python/wxflow/src"
socaToolsPATH="${HOMEgfs}/sorc/gdas.cd/ush/soca/tools"
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}:${socaToolsPATH}"
export PYTHONPATH

###############################################################
# Execute the JJOB
"${HOMEgfs}"/jobs/JGLOBAL_MARINE_BMAT
echo "BMAT gets run here"
status=$?
Fixed Show fixed Hide fixed
exit "${status}"
2 changes: 2 additions & 0 deletions parm/config/gfs/config.com
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,13 @@ declare -rx COM_OCEAN_HISTORY_TMPL=${COM_BASE}'/model_data/ocean/history'
declare -rx COM_OCEAN_RESTART_TMPL=${COM_BASE}'/model_data/ocean/restart'
declare -rx COM_OCEAN_INPUT_TMPL=${COM_BASE}'/model_data/ocean/input'
declare -rx COM_OCEAN_ANALYSIS_TMPL=${COM_BASE}'/analysis/ocean'
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_BMATRIX_TMPL=${COM_BASE}'/bmatrix/ice'
declare -rx COM_ICE_INPUT_TMPL=${COM_BASE}'/model_data/ice/input'
declare -rx COM_ICE_HISTORY_TMPL=${COM_BASE}'/model_data/ice/history'
declare -rx COM_ICE_RESTART_TMPL=${COM_BASE}'/model_data/ice/restart'
Expand Down
11 changes: 11 additions & 0 deletions parm/config/gfs/config.marinebmat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

########## config.marinebmat ##########
# configuration for the marine B-matrix

echo "BEGIN: config.marinebmat"

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

echo "END: config.marinebmat"
11 changes: 6 additions & 5 deletions parm/config/gfs/config.ocnanal
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@

echo "BEGIN: config.ocnanal"

export SOCA_FIX_YAML_TMPL="${PARMgfs}/gdas/soca/soca_fix_stage.yaml.j2"
export OBS_YAML_DIR="${HOMEgfs}/sorc/gdas.cd/parm/soca/obs/config"
export OBS_LIST=@SOCA_OBS_LIST@
export OBS_YAML="${OBS_LIST}"
export FV3JEDI_STAGE_YAML="${HOMEgfs}/sorc/gdas.cd/test/soca/testinput/dumy.yaml"
export SOCA_INPUT_FIX_DIR=@SOCA_INPUT_FIX_DIR@
Copy link
Contributor

Choose a reason for hiding this comment

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

This need not be this way.
See above comment.
If there is a dependence on the number of levels, we can make a case statement here and cover all cases.

export SOCA_VARS=tocn,socn,ssh
export SABER_BLOCKS_YAML=@SABER_BLOCKS_YAML@
#export SOCA_VARS=tocn,socn,ssh
#export SABER_BLOCKS_YAML=@SABER_BLOCKS_YAML@
export SOCA_NINNER=@SOCA_NINNER@
export CASE_ANL=@CASE_ANL@
#export CASE_ANL=@CASE_ANL@
export DOMAIN_STACK_SIZE=116640000 #TODO: Make the stack size resolution dependent
export JEDI_BIN=${HOMEgfs}/sorc/gdas.cd/build/bin

export COMIN_OBS=@COMIN_OBS@

# NICAS
export NICAS_RESOL=@NICAS_RESOL@
export NICAS_GRID_SIZE=@NICAS_GRID_SIZE@
#export NICAS_RESOL=@NICAS_RESOL@
#export NICAS_GRID_SIZE=@NICAS_GRID_SIZE@

echo "END: config.ocnanal"
2 changes: 1 addition & 1 deletion parm/config/gfs/config.resources
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ case ${step} in
export memory_prepoceanobs="48GB"
;;

"ocnanalbmat")
"ocnanalbmat" | "marinebmat")
npes=16
case ${OCNRES} in
"025") npes=480;;
Expand Down
24 changes: 24 additions & 0 deletions scripts/exglobal_marine_bmat_run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
# exglobal_marine_bmat_run.py
# This script creates an marineBmat object
# and runs the execute method
# which executes all the steps necessary to create the global marine B-matrix
import os

from wxflow import Logger, cast_strdict_as_dtypedict
from pygfs.task.marine_bmat import MarineBMat

# Initialize root logger
logger = Logger(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)

# Create an instance of the MarineBMat task
marineBMat = MarineBMat(config)
marineBMat.initialize()
marineBMat.execute()
marineBMat.finalize()
3 changes: 2 additions & 1 deletion sorc/link_workflow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ case "${machine}" in
"gaea") FIX_DIR="/gpfs/f5/epic/proj-shared/global/glopara/data/fix" ;;
*)
echo "FATAL: Unknown target machine ${machine}, couldn't set FIX_DIR"
exit 1
#exit 0
guillaumevernieres marked this conversation as resolved.
Show resolved Hide resolved
;;
esac

Expand Down Expand Up @@ -368,6 +368,7 @@ if [[ -d "${HOMEgfs}/sorc/gdas.cd/build" ]]; then
"gdas_soca_gridgen.x" \
"gdas_soca_error_covariance_toolbox.x" \
"gdas_soca_setcorscales.x" \
"gdas_soca_diagb.x" \
"fv3jedi_plot_field.x" \
"fv3jedi_fv3inc.x" \
"gdas_ens_handler.x" \
Expand Down
2 changes: 2 additions & 0 deletions ush/python/pygfs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
from .task.aero_analysis import AerosolAnalysis
from .task.atm_analysis import AtmAnalysis
from .task.atmens_analysis import AtmEnsAnalysis
from .task.marine_bmat import MarineBMat
from .task.snow_analysis import SnowAnalysis
from .task.upp import UPP
from .task.oceanice_products import OceanIceProducts
from .task.gfs_forecast import GFSForecast
from .utils import marine_da_utils

__docformat__ = "restructuredtext"
__version__ = "0.1.0"
Expand Down
Loading
Loading