forked from NOAA-EMC/obs-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NOAA-EMC:develop' into develop
- Loading branch information
Showing
18 changed files
with
1,407 additions
and
292 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#!/bin/bash | ||
|
||
# ----------------------------------------------------- | ||
# runObsMon.sh | ||
# | ||
# This is a driver script to run the plotObsMon job. | ||
# ----------------------------------------------------- | ||
|
||
#-------------------------------------------------------------------- | ||
# usage | ||
#-------------------------------------------------------------------- | ||
function usage { | ||
echo "Usage: runObsMon.sh -p|--pdate pdate -m|--model, [-r|--run]" | ||
echo " -p | --pdate cycle time to be processed, format yyyymmddhh" | ||
echo " if unspecified the last available date will be processed" | ||
echo " -m | --model model or experiment name (i.e. gfs, nam)" | ||
echo " -r | --run optional, name of run (i.e. gfs, gdas)" | ||
echo " " | ||
} | ||
|
||
|
||
echo begin runObsMon.sh | ||
|
||
nargs=$# | ||
echo nargs: $nargs | ||
if [[ ${nargs} -lt 4 || ${nargs} -gt 6 ]]; then | ||
usage | ||
exit 1 | ||
fi | ||
|
||
|
||
#----------------------------------------------- | ||
# Process command line arguments | ||
# | ||
|
||
pdate="" | ||
model="" | ||
run="" | ||
|
||
while [[ $# -ge 1 ]] | ||
do | ||
key="$1" | ||
echo ${key} | ||
|
||
case ${key} in | ||
-p|--pdate) | ||
pdate="$2" | ||
shift # past argument | ||
;; | ||
-m|--model) | ||
model="$2" | ||
shift # past argument | ||
;; | ||
-r|--run) | ||
run="$2" | ||
shift # past argument | ||
;; | ||
esac | ||
|
||
shift | ||
done | ||
|
||
echo pdate: $pdate | ||
echo model: $model | ||
echo run: $run | ||
|
||
export PDY=`echo ${pdate}|cut -c1-8` | ||
export cyc=`echo ${pdate}|cut -c9-10` | ||
export NET=obsmon | ||
export MODEL=${model} | ||
export RUN=${run} | ||
export KEEPDATA="YES" | ||
|
||
#-------------------------------- | ||
# locate and source config file | ||
# | ||
readonly dir_root=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) | ||
om_config=${dir_root}/parm/OM_config | ||
source ${om_config} | ||
|
||
#----------------------------- | ||
# define plot output location | ||
# | ||
export COMOUT=${COMOUT}/${NET} | ||
|
||
#------------------------- | ||
# Set up & submit j-job | ||
# | ||
jobname="PlotObsMon" | ||
jobfile="${JOBSobsmon}/JMON_PLOT_OBS" | ||
|
||
logdir="${OM_LOGS}/${MODEL}" | ||
if [[ ! -d ${logdir} ]]; then mkdir -p ${logdir}; fi | ||
|
||
logfile="${OM_LOGS}/${MODEL}/OM_log" | ||
if [[ -e ${logfile} ]]; then rm ${logfile}; fi | ||
|
||
case ${MACHINE_ID} in | ||
hera) | ||
echo "submitting job on hera" | ||
${SUB} --account ${ACCOUNT} --ntasks=1 --mem=500M --time=45:00 \ | ||
-J ${jobname} --partition service -o ${logfile} ${jobfile} | ||
;; | ||
|
||
wcoss2) # NOTE: this has not been tested; eva doesn't yet run on wcoss2 | ||
echo "submitting job on wcoss2" | ||
$SUB -q $JOB_QUEUE -A $ACCOUNT -o ${logfile} -e ${logfile} \ | ||
-V -l select=1:mem=500M -l walltime=20:00 -N ${jobname} ${jobfile} | ||
;; | ||
esac | ||
|
||
echo end runObsMon.sh |
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,54 @@ | ||
#!/bin/bash | ||
|
||
########################### | ||
# J-job for Mon Plot Obs | ||
########################### | ||
|
||
export NET="obsmon" | ||
export PDATE="${PDY}${cyc}" | ||
|
||
############################ | ||
# Define package locations | ||
############################ | ||
export HOMEobsmon=${HOMEobsmon:-${PACKAGEROOT}/${NET}.${obsmon_ver}} | ||
export SCRIPTSobsmon=${SCRIPTSobsmon:-$HOMEobsmon/scripts} | ||
export PARMobsmon=${PARMobsmon:-$HOMEobsmon/parm} | ||
export USHobsmon=${USHobsmon:-$HOMEobsmon/ush} | ||
|
||
################################ | ||
# Define plot output location | ||
################################ | ||
export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${obsmon_ver})} | ||
export COMOUTplots=${COMOUTplots:-${COMOUT}/${MODEL}/${PDATE}} | ||
mkdir -m 775 -p $COMOUTplots | ||
|
||
################################### | ||
# Create $DATA for temp workspace | ||
################################### | ||
export DATA=${DATA:-${DATAROOT}/${NET}/${MODEL}/Plot} | ||
if [[ -d ${DATA} ]]; then rm -rf ${DATA}; fi | ||
|
||
mkdir -p ${DATA} | ||
cd ${DATA} | ||
|
||
################ | ||
# Run exscript | ||
################ | ||
${OBSMON_PLOT:-${SCRIPTSobsmon}/exobsmon_plot.sh} | ||
status=$? | ||
[[ ${status} -ne 0 ]] && exit ${status} | ||
|
||
#################### | ||
# Final processing | ||
#################### | ||
if [[ -e "${pgmout}" ]] ; then | ||
cat "${pgmout}" | ||
fi | ||
|
||
#################### | ||
# Remove workspace | ||
#################### | ||
KEEPDATA=${KEEPDATA:-"NO"} | ||
cd ${DATAROOT} | ||
[[ ${KEEPDATA} = "NO" ]] && rm -rf ${DATA} | ||
|
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,45 @@ | ||
|
||
readonly om_dir_root=$(cd "$(dirname "$(readlink -f -n "${BASH_SOURCE[0]}" )" )/.." && pwd -P) | ||
export HOMEobsmon=${om_dir_root} | ||
export JOBSobsmon=${om_dir_root}/jobs | ||
|
||
#-------------------------------------------- | ||
# Export job submission vars per MACHINE_ID | ||
# | ||
source ${om_dir_root}/ush/detect_machine.sh | ||
MACHINE_ID=`echo "${MACHINE_ID%%.*}"` | ||
|
||
case ${MACHINE_ID} in | ||
|
||
hera) | ||
export SUB=/apps/slurm/default/bin/sbatch | ||
export SERVICE_PARTITION="service" | ||
|
||
ptmp="/scratch2/NCEPDEV/stmp3/$USER" | ||
stmp="/scratch2/NCEPDEV/stmp1/$USER" | ||
queue="" | ||
project="" | ||
account="da-cpu" | ||
aprun_py="python" | ||
;; | ||
|
||
wcoss2) | ||
export SUB="qsub" | ||
|
||
ptmp="/lfs/h2/emc/ptmp/$USER" | ||
stmp="/lfs/h2/emc/stmp/$USER" | ||
queue="dev" | ||
project="GDAS-DEV" | ||
account="GFS-DEV" | ||
aprun_py="python" | ||
;; | ||
esac | ||
|
||
export ACCOUNT=${ACCOUNT:-$account} | ||
export PROJECT=${PROJECT:-$project} | ||
export JOB_QUEUE=${JOB_QUEUE:-$queue} | ||
|
||
export OM_LOGS="${ptmp}/logs/OM_logs" | ||
export DATAROOT=${DATAROOT:-${stmp}} | ||
export COMOUT=${COMOUT:-${ptmp}} | ||
export APRUN_PY=${APRUN_PY:-${aprun_py}} |
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
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
Oops, something went wrong.