Skip to content

Commit

Permalink
Merge branch 'NOAA-EMC:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardSafford-NOAA authored Mar 12, 2024
2 parents 4946e89 + dbb83c9 commit 2f1c44c
Show file tree
Hide file tree
Showing 18 changed files with 1,407 additions and 292 deletions.
112 changes: 112 additions & 0 deletions driver/runObsMon.sh
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
54 changes: 54 additions & 0 deletions jobs/JMON_PLOT_OBS
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}

45 changes: 45 additions & 0 deletions parm/OM_config
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}}
34 changes: 26 additions & 8 deletions parm/gfs/gfs_plots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

cycle_interval: 6
data: '/scratch1/NCEPDEV/da/Edward.Safford/noscrub/git/eva/src/eva/tests/data'
net: gfs
model: gfs

satellites:
- name: npp
Expand All @@ -12,17 +12,34 @@ satellites:
- plot: ozn horiz
times: 4
levels: '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
run: ges
component: ges

- plot: ozn time
times: 121
levels: '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
run: ges
component: ges

- plot: ozn summary
times: 121
levels: '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22'
run: ges
component: ges

- name: metop-b
instruments:
- name: mhs
plot_list:
- plot: rad time
times: 121
channels: '1,2,3,4,5'
component: ges
- plot: rad angle
times: 121
channels: '1,2,3,4,5'
component: ges
- plot: rad bcoef
times: 121
channels: '1,2,3,4,5'
component: ges

- name: g16
instruments:
Expand All @@ -31,7 +48,7 @@ satellites:
- plot: rad time
times: 121
channels: '7,8,9,10,11,12,13,14,15,16'
run: ges
component: ges

- name: j1
instruments:
Expand All @@ -40,18 +57,19 @@ satellites:
- plot: rad angle
times: 121
channels: '12,13,14,15,16'
run: ges
component: ges

- plot: rad bcoef
times: 121
channels: '12,13,14,15,16'
run: ges
component: ges

minimization:
- net: gfs
- model: gfs
plot_list:
- plot: min summary
run: gdas
times: 28

- plot: min gnorm four cycle
run: gdas
Expand Down
2 changes: 1 addition & 1 deletion parm/gfs/minGnormFourCycle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ graphics:
figure size: [20,18]
tight layout:
title: "Valid: {{ PDATE | to_YMDH }}"
output name: line_plots/minimization/{{NET}}_{{RUN}}.4cycle.gnorms.png
output name: line_plots/minimization/{{MODEL}}_{{RUN}}.4cycle.gnorms.png
plot logo:
which: 'noaa/nws'
loc: 'upper center'
Expand Down
4 changes: 2 additions & 2 deletions parm/gfs/minGnormOneCycle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ graphics:
figure size: [20,18]
tight layout:
title: "Valid: {{ PDATE | to_YMDH }}"
output name: line_plots/minimization/{{NET}}_{{RUN}}.{{ PDATE | to_YMDH }}.gnorms.png
output name: line_plots/minimization/{{MODEL}}_{{RUN}}.{{ PDATE | to_YMDH }}.gnorms.png
plot logo:
which: 'noaa/nws'
loc: 'upper right'
Expand Down Expand Up @@ -108,7 +108,7 @@ graphics:
figure size: [20,18]
tight layout:
title: "Valid: {{ PDATE | to_YMDH }}"
output name: line_plots/minimization/{{NET}}_{{RUN}}.{{ PDATE | to_YMDH }}.reduction.png
output name: line_plots/minimization/{{MODEL}}_{{RUN}}.{{ PDATE | to_YMDH }}.reduction.png
plot logo:
which: 'noaa/nws'
loc: 'upper right'
Expand Down
2 changes: 1 addition & 1 deletion parm/gfs/minSummary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ graphics:
figure size: [20,18]
tight layout:
title: "Valid: {{ PDATE | to_YMDH }}"
output name: line_plots/minimization/{{NET}}_{{RUN}}.summary.gnorms.png
output name: line_plots/minimization/{{MODEL}}_{{RUN}}.summary.gnorms.png
plot logo:
which: 'noaa/nws'
loc: 'upper left'
Expand Down
12 changes: 6 additions & 6 deletions parm/gfs/oznHoriz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ datasets:
type: MonDataSpace
satellite: {{SAT}}
sensor: {{SENSOR}}
run: {{RUN}}
run: {{COMPONENT}}

type: MonDataSpace
control_file:
- {{DATA}}/ozn_data/horiz/ompsnp_npp.ges.ctl
- {{DATA}}/ozn_data/horiz/ompsnp_npp.{{COMPONENT}}.ctl
filenames:
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{RUN}}.{{ PDATE | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{RUN}}.{{ PDATEm6 | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{RUN}}.{{ PDATEm12 | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{RUN}}.{{ PDATEm18 | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{COMPONENT}}.{{ PDATE | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{COMPONENT}}.{{ PDATEm6 | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{COMPONENT}}.{{ PDATEm12 | to_YMDH }}.ieee_d
- {{DATA}}/ozn_data/horiz/{{SENSOR}}_{{SAT}}.{{COMPONENT}}.{{ PDATEm18 | to_YMDH }}.ieee_d
levels: {{LEVELS}}
groups:
- name: GsiIeee
Expand Down
Loading

0 comments on commit 2f1c44c

Please sign in to comment.