Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add prefix to split yaml files, clean up J-job setup.
  • Loading branch information
EdwardSafford-NOAA committed Jun 26, 2024
1 parent 4e8351d commit d18e15b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion jobs/JMON_PLOT_OBS
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ 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
if [[ -d ${DATAROOT}/${NET} ]]; then rm -rf ${DATAROOT}/${NET}; fi

mkdir -p ${DATA}
cd ${DATA}
Expand Down
10 changes: 5 additions & 5 deletions scripts/exobsmon_plot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,24 @@ ${APRUN_PY} ${USHobsmon}/splitPlotYaml.py -i ${plot_yaml} -c ${chan_yaml}
#--------------------------------------------------------------
# Submit OM_plots job if split yields any *.yaml files
#
if compgen -G "${DATA}/*.yaml" > /dev/null; then
if compgen -G "${DATA}/OM_PLOT*.yaml" > /dev/null; then

jobname="OM_plots"
export logfile="${OM_LOGS}/${MODEL}/OM_plot.log"
if [[ -e ${logfile} ]]; then rm ${logfile}; fi

cmdfile="OM_jobscript"
>$cmdfile
>${cmdfile}

ctr=0
for yaml in ${DATA}/*.yaml; do
for yaml in ${DATA}/OM_PLOT*.yaml; do
echo "processing yaml: $ctr $yaml"
case ${MACHINE_ID} in
hera)
echo "${ctr} ${APRUN_PY} ${USHobsmon}/plotObsMon.py -i ${yaml} -p ${PDATE}" >> $cmdfile
echo "${ctr} ${APRUN_PY} ${USHobsmon}/plotObsMon.py -i ${yaml} -p ${PDATE}" >> ${cmdfile}
;;
wcoss2)
echo "${APRUN_PY} ${USHobsmon}/plotObsMon.py -i ${yaml} -p ${PDATE}" >> $cmdfile
echo "${APRUN_PY} ${USHobsmon}/plotObsMon.py -i ${yaml} -p ${PDATE}" >> ${cmdfile}
;;
esac
((ctr+=1))
Expand Down
6 changes: 3 additions & 3 deletions ush/splitPlotYaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,21 +106,21 @@ def removeKey(d, keys):
pd['satellites'] = [{'name': satname,
'instruments': [{'name': iname,
'plot_list': plist}]}]
fname = f'sat_{satname}_{iname}.yaml'
fname = f'OM_PLOT_sat_{satname}_{iname}.yaml'
file = open(fname, "w")
yaml.dump(pd, file)
file.close()

if 'minimization' in mon_dict.keys():
md = removeKey(mon_dict, ['satellites', 'observations'])
fname = f'minimization.yaml'
fname = f'OM_PLOT_minimization.yaml'
file = open(fname, "w")
yaml.dump(md, file)
file.close()

if 'observations' in mon_dict.keys():
od = removeKey(mon_dict, ['satellites', 'minimization'])
fname = f'observations.yaml'
fname = f'OM_PLOT_observations.yaml'
file = open(fname, "w")
yaml.dump(od, file)
file.close()

0 comments on commit d18e15b

Please sign in to comment.