-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3dfgat gdas.cd ctests work but needs tidy
- Loading branch information
1 parent
9476c12
commit 17494de
Showing
11 changed files
with
546 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/bin/bash | ||
source "${HOMEgfs}/ush/preamble.sh" | ||
export DATA="${DATAROOT}/${RUN}marinebmat_${cyc}" | ||
export DATA=${DATA:-${DATAROOT}/${RUN}marinebmat_${cyc}} | ||
# 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" | ||
|
||
############################################## | ||
# Set variables used in the script | ||
############################################## | ||
# 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="gdas" | ||
|
||
|
||
############################################## | ||
# Begin JOB SPECIFIC work | ||
############################################## | ||
|
||
# Generate COM variables from templates | ||
# TODO: This is temporary, the plan is to prepare the bmatrix at the end of the | ||
# cycle, so the backgrounds should be from the current cycle, not the previous | ||
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 | ||
|
||
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} | ||
${EXSCRIPT} | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit "${status}" | ||
|
||
############################################## | ||
# End JOB SPECIFIC work | ||
############################################## | ||
|
||
############################################## | ||
# Final processing | ||
############################################## | ||
if [[ -e "${pgmout}" ]] ; then | ||
cat "${pgmout}" | ||
fi | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/sorc/soca/tools" | ||
PYTHONPATH="${PYTHONPATH:+${PYTHONPATH}:}${wxflowPATH}" | ||
export PYTHONPATH | ||
|
||
############################################################### | ||
# Execute the JJOB | ||
"${HOMEgfs}"/jobs/JGLOBAL_MARINE_BMAT | ||
echo "BMAT gets run here" | ||
status=$? | ||
exit "${status}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.execute() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.