Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 19 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ done
case ${BUILD_TARGET} in
ursa | hera | orion | hercules | wcoss2 | noaacloud | gaeac5 | gaeac6 )
echo "Building obsForge on $BUILD_TARGET"
[[ -f $dir_root/versions/build.${BUILD_TARGET}.ver ]] && source $dir_root/versions/build.${BUILD_TARGET}.ver
source $dir_root/ush/module-setup.sh
module use $dir_root/modulefiles
module load obsforge/$BUILD_TARGET.$COMPILER
Expand All @@ -81,11 +82,27 @@ esac

CMAKE_OPTS+=" -DMACHINE=$BUILD_TARGET"

# Default to skipping test-data downloads unless explicitly overridden.
if [[ " ${CMAKE_OPTS} " != *" -DSKIP_DOWNLOAD_TEST_DATA="* ]]; then
CMAKE_OPTS+=" -DSKIP_DOWNLOAD_TEST_DATA=ON"
fi

# Default to disabling tests (including ioda tests) on wcoss2 unless explicitly overridden.
if [[ $BUILD_TARGET == 'wcoss2' ]] && [[ " ${CMAKE_OPTS} " != *" -DBUILD_TESTING="* ]]; then
CMAKE_OPTS+=" -DBUILD_TESTING=OFF"
fi

# Default to C++17 (required by ioda code using std::exclusive_scan) unless overridden.
if [[ " ${CMAKE_OPTS} " != *" -DCMAKE_CXX_STANDARD="* ]]; then
CMAKE_OPTS+=" -DCMAKE_CXX_STANDARD=17"
fi

# TODO: Remove LD_LIBRARY_PATH line as soon as permanent solution is available
if [[ $BUILD_TARGET == 'wcoss2' ]]; then
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/cray/pe/mpich/8.1.29/ofi/intel/2022.1/lib"
mpich_ver_for_env="${cray_mpich_ver:-8.1.19}"
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/cray/pe/mpich/${mpich_ver_for_env}/ofi/intel/2022.1/lib"
export LMOD_MPI_NAME=cray-mpich
export LMOD_MPI_VERSION=8.1.29-xhbciau
export LMOD_MPI_VERSION="${mpich_ver_for_env}"
fi

BUILD_DIR=${BUILD_DIR:-$dir_root/build}
Expand Down
2 changes: 2 additions & 0 deletions dev/jobs/JOBSFORGE_GLOBAL_MARINE_DUMP
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ source "${HOMEobsforge}/ush/jjob_header.sh"
##############################################
# Set variables used in the script
##############################################
PYTHONPATH="${HOMEobsforge}/ush/python${PYTHONPATH:+:${PYTHONPATH}}"
export PYTHONPATH


##############################################
Expand Down
124 changes: 124 additions & 0 deletions ecf/defs/obsforge_v1.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
suite obsforge_v1
family primary
edit PACKAGEHOME '/lfs/h2/emc/da/noscrub/cory.r.martin/obsforge/git/release/obsforge.v1.0.0'
edit OUTPUTDIR '/lfs/h2/emc/ptmp/cory.r.martin/obsforge/output'
edit obsforge_ver 'v1.0.0'
edit QUEUE 'dev'
edit QUEUE_ARCH 'dev_transfer'
edit PROJENVIR 'DEV'
edit MACHINE_SITE 'development'
edit ENVIR 'para'
edit EXPDIR '%PACKAGEHOME%/parm/config/obsforge'
edit DATAROOT '/lfs/h2/emc/ptmp/cory.r.martin/obsforge/dataroot'
edit DBNLOGDIR '/lfs/h2/emc/ptmp/cory.r.martin/obsforge/com/dbnlog'
edit ECF_INCLUDE '/lfs/h2/emc/da/noscrub/cory.r.martin/obsforge/git/release/obsforge.v1.0.0/ecf/include'
family 00
edit CYC '00'
family obsforge
family gfs
edit ECF_FILES '%PACKAGEHOME%/ecf/gfs'
edit JTYP 'gfs'
family marine
task jobsforge_gfs_marine_dump
trigger :TIME >= 0237 and :TIME <= 0837
task jobsforge_gfs_marine_bufr_dump
trigger :TIME >= 0256 and :TIME <= 0837
# trigger: /prod/primary/00/obsproc/v1.2/gfs/atmos/prep/jobsproc_gfs_atmos_dump == complete
endfamily # marine
endfamily # gfs
family gdas
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gdas'
edit JTYP 'gdas'
family marine
task jobsforge_gdas_marine_dump
trigger :TIME >= 0540 and :TIME <= 1140
task jobsforge_gdas_marine_bufr_dump
trigger :TIME >= 0559 and :TIME <= 1140
# trigger: /prod/primary/00/obsproc/v1.2/gdas/atmos/prep/jobsproc_gdas_atmos_dump == complete
endfamily # marine
endfamily # gdas
endfamily # obsforge
endfamily # 00
family 06
edit CYC '06'
family obsforge
family gfs
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gfs'
edit JTYP 'gfs'
family marine
task jobsforge_gfs_marine_dump
trigger :TIME >= 0837 and :TIME <= 1437
task jobsforge_gfs_marine_bufr_dump
trigger :TIME >= 0856 and :TIME <= 1437
# trigger: /prod/primary/06/obsproc/v1.2/gfs/atmos/prep/jobsproc_gfs_atmos_dump == complete
endfamily # marine
endfamily # gfs
family gdas
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gdas'
edit JTYP 'gdas'
family marine
task jobsforge_gdas_marine_dump
trigger :TIME >= 1140 and :TIME <= 1740
task jobsforge_gdas_marine_bufr_dump
trigger :TIME >= 1159 and :TIME <= 1740
# trigger: /prod/primary/06/obsproc/v1.2/gdas/atmos/prep/jobsproc_gdas_atmos_dump == complete
endfamily # marine
endfamily # gdas
endfamily # obsforge
endfamily # 06
family 12
edit CYC '12'
family obsforge
family gfs
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gfs'
edit JTYP 'gfs'
family marine
task jobsforge_gfs_marine_dump
trigger :TIME >= 1437 and :TIME <= 2037
task jobsforge_gfs_marine_bufr_dump
trigger :TIME >= 1456 and :TIME <= 2037
# trigger: /prod/primary/12/obsproc/v1.2/gfs/atmos/prep/jobsproc_gfs_atmos_dump == complete
endfamily # marine
endfamily # gfs
family gdas
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gdas'
edit JTYP 'gdas'
family marine
task jobsforge_gdas_marine_dump
trigger :TIME >= 1740 and :TIME <= 2340
task jobsforge_gdas_marine_bufr_dump
trigger :TIME >= 1759 and :TIME <= 2340
# trigger: /prod/primary/12/obsproc/v1.2/gdas/atmos/prep/jobsproc_gdas_atmos_dump == complete
endfamily # marine
endfamily # gdas
endfamily # obsforge
endfamily # 12
family 18
edit CYC '18'
family obsforge
family gfs
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gfs'
edit JTYP 'gfs'
family marine
task jobsforge_gfs_marine_dump
trigger :TIME >= 2037 and :TIME <= 0237
task jobsforge_gfs_marine_bufr_dump
trigger :TIME >= 2056 and :TIME <= 0237
# trigger: /prod/primary/18/obsproc/v1.2/gfs/atmos/prep/jobsproc_gfs_atmos_dump == complete
endfamily # marine
endfamily # gfs
family gdas
edit ECF_FILES '%PACKAGEHOME%/ecf/scripts/gdas'
edit JTYP 'gdas'
family marine
task jobsforge_gdas_marine_dump
trigger :TIME >= 2340 and :TIME <= 0540
task jobsforge_gdas_marine_bufr_dump
trigger :TIME >= 2359 and :TIME <= 0540
# trigger: /prod/primary/18/obsproc/v1.2/gdas/atmos/prep/jobsproc_gdas_atmos_dump == complete
endfamily # marine
endfamily # gdas
endfamily # obsforge
endfamily # 18
endfamily # primary
endsuite
17 changes: 17 additions & 0 deletions ecf/include/envir-p1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# envir-p1.h
export job=${job:-$PBS_JOBNAME}
export jobid=${jobid:-$job.$PBS_JOBID}

if [[ "$envir" == prod && "$SENDDBN" == YES ]]; then
export eval=%EVAL:NO%
if [ $eval == YES ]; then export SIPHONROOT=${UTILROOT}/para_dbn
else export SIPHONROOT=/lfs/h1/ops/prod/dbnet_siphon
fi
if [ "$PARATEST" == YES ]; then export SIPHONROOT=${UTILROOT}/fakedbn; export NODBNFCHK=YES; fi
else
export SIPHONROOT=${UTILROOT}/fakedbn
fi

export DBNROOT=$SIPHONROOT

if [[ ! " prod para test " =~ " ${envir} " && " ops.prod ops.para " =~ " $(whoami) " ]]; then err_exit "ENVIR must be prod, para, or test [envir-p1.h]"; fi
99 changes: 99 additions & 0 deletions ecf/include/head.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
date
hostname
set -xe # print commands as they are executed and enable signal trapping

export PS4='+ $SECONDS + '

# Variables needed for communication with ecFlow
export ECF_NAME=%ECF_NAME%
export ECF_HOST=%ECF_LOGHOST%
export ECF_PORT=%ECF_PORT%
export ECF_PASS=%ECF_PASS%
export ECF_TRYNO=%ECF_TRYNO%
export ECF_RID=${ECF_RID:-${PBS_JOBID:-$(hostname -s).$$}}
export ECF_JOB=%ECF_JOB%
export ECF_JOBOUT=%ECF_JOBOUT%
export ecflow_ver=%ecflow_ver%

if [ -d /apps/ops/prod ]; then # On WCOSS2
set +x
echo "Running 'module reset'"
module reset
set -x
fi

modelhome=%PACKAGEHOME:%
eval "export HOME${model:?'model undefined'}=$modelhome"
eval "versionfile=\$HOME${model}/versions/run.ver"
if [ -f "$versionfile" ]; then . $versionfile ; fi
modelver=$(echo ${modelhome} | perl -pe "s:.*?/${model}\.(v[\d\.a-z]+).*:\1:")
eval "export ${model}_ver=$modelver"

export envir=%ENVIR%
export MACHINE_SITE=%MACHINE_SITE%
export RUN_ENVIR=${RUN_ENVIR:-nco}
export SENDECF=${SENDECF:-YES}
export SENDCOM=${SENDCOM:-YES}
if [ -n "%PDY:%" ]; then export PDY=${PDY:-%PDY:%}; fi
if [ -n "%PARATEST:%" ]; then export PARATEST=${PARATEST:-%PARATEST:%}; fi
if [ -n "%COMPATH:%" ]; then export COMPATH=${COMPATH:-%COMPATH:%}; fi
if [ -n "%MAILTO:%" ]; then export MAILTO=${MAILTO:-%MAILTO:%}; fi
if [ -n "%DBNLOGDIR:%" ]; then export DBNLOG=YES; fi
export KEEPDATA=${KEEPDATA:-%KEEPDATA:NO%}
export SENDDBN=${SENDDBN:-%SENDDBN:YES%}
export SENDDBN_NTC=${SENDDBN_NTC:-%SENDDBN_NTC:YES%}

if [ -d /apps/ops/prod ]; then # On WCOSS2
set +x
if [ $(whoami) == ops.para ]; then
module use -a /apps/ops/para/nco/modulefiles/core
fi
echo "Running module load ecflow/$ecflow_ver"
module load ecflow/$ecflow_ver
echo "ecflow module location: $(module display ecflow |& head -2 | tail -1 | sed 's/:$//')"
set -x
. ${ECF_ROOT}/versions/run.ver
set +x
module load prod_util/${prod_util_ver}
module load prod_envir/${prod_envir_ver}
echo "Listing modules from head.h:"
module list
set -x
if [[ ! " ops.prod ops.para " =~ " $(whoami) " ]]; then
echo "Allow over-riding defaults for developers"
if [ -n "%COMROOT:%" ]; then export COMROOT="%COMROOT:%"; fi
if [ -n "%DATAROOT:%" ]; then export DATAROOT="%DATAROOT:%"; fi
if [ -n "%DCOMROOT:%" ]; then export DCOMROOT="%DCOMROOT:%"; fi
fi
fi

timeout 300 ecflow_client --init=${ECF_RID}

if [[ " ops.prod ops.para " =~ " $(whoami) " ]]; then
POST_OUT=${POST_OUT:-/lfs/h1/ops/%ENVIR%/tmp/posts/ecflow_post_in.${ECF_RID}}
echo 'export ECF_NAME=${ECF_NAME}' > $POST_OUT
echo 'export ECF_HOST=${ECF_HOST}' >> $POST_OUT
echo 'export ECF_PORT=${ECF_PORT}' >> $POST_OUT
echo 'export ECF_PASS=${ECF_PASS}' >> $POST_OUT
echo 'export ECF_TRYNO=${ECF_TRYNO}' >> $POST_OUT
echo 'export ECF_RID=${ECF_RID}' >> $POST_OUT
fi

# Define error handler
ERROR() {
set +ex
if [ "$1" -eq 0 ]; then
msg="Killed by signal (likely via qdel)"
else
msg="Killed by signal $1"
fi
ecflow_client --abort="$msg"
echo $msg
if [[ " ops.prod ops.para " =~ " $(whoami) " ]]; then
echo "# Trap Caught" >>$POST_OUT
fi
trap $1; exit $1
}
# Trap all error and exit signals
trap 'ERROR $?' ERR EXIT

3 changes: 3 additions & 0 deletions ecf/include/tail.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
timeout 300 ecflow_client --complete # Notify ecFlow of a normal end
trap 0 # Remove all traps
exit 0 # End the shell
61 changes: 61 additions & 0 deletions ecf/scripts/gdas/jobsforge_gdas_marine_bufr_dump.ecf
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#PBS -S /bin/bash
#PBS -N jobsforge_gfs_marine_bufr_dump_%CYC%
#PBS -j oe
#PBS -q %QUEUE%
#PBS -A GFS-DEV
#PBS -l walltime=00:10:00
#PBS -l select=1:mpiprocs=1:ompthreads=1:ncpus=1
#PBS -l place=vscatter:exclhost
#PBS -l debug=true

model=obsforge
%include <head.h>
%include <envir-p1.h>

set -x

export RUN=%JTYP%

############################################################
# Load modules
############################################################
module load prod_util/${prod_util_ver}
module load intel/${intel_ver}
module load craype/${craype_ver}
module load cray-mpich/${cray_mpich_ver}
module load cray-pals/${cray_pals_ver}

module load hdf5-D/${hdf5D_ver}
module load pnetcdf/${pnetcdfD_ver}
module load netcdf-D/${netcdfD_ver}
module load boost/${boost_ver}
module load eigen/${eigen_ver}
module load eckit/${eckit_ver}
module load fckit/${fckit_ver}
module load udunits/${udunits_ver}
module load python/${python_ver}
module load ve/gcafs/${ve_obsforge_ver} # TODO: change later

module list

#############################################################
# environment settings
#############################################################
export cyc=%CYC%
export cycle=t%CYC%z

############################################################
# CALL executable job script here
############################################################
${HOMEobsforge}/jobs/JOBSFORGE_GDAS_MARINE_BUFR_DUMP
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current obsForge implementation does not distinguish between GDAS and GFS jobs and scripts. Both use the same job/scripts because their processing logic is identical. Do we still need to make them separately?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Short answer, yes. Just documenting it here that we will want separate jobs for production but can have one job for development mode/in the GitHub main branch.


if [ $? -ne 0 ]; then
ecflow_client --msg="***JOB ${ECF_NAME} ERROR RUNNING J-SCRIPT ***"
ecflow_client --abort
exit
fi

%include <tail.h>
%manual

%end
Loading