diff --git a/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh b/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh index 5573d32c..7b1377d5 100755 --- a/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh +++ b/src/Conventional_Monitor/image_gen/ush/ConMon_IG.sh @@ -15,7 +15,7 @@ function usage { echo " " echo " " - echo "Usage: ConMon_IG.sh suffix [-p|--pdate pdate -r|--run gdas|gfs]" + echo "Usage: ConMon_IG.sh suffix [-p|--pdate pdate -r|--run gdas|gfs -n|--ncyc]" echo " Suffix is the indentifier for this data source." echo " " echo " -p | --pdate yyyymmddcc to specify the cycle to be plotted." @@ -27,6 +27,8 @@ function usage { echo " Use only if data in TANKdir stores both runs, gdas" echo " gdas is the default value." echo " " + echo " -n | --ncyc is the number of cycles to be used in time series plots. If" + echo " not specified the default value in parm/RadMon_user_settins will be used" } @@ -38,17 +40,16 @@ echo "Begin ConMon_IG.sh" nargs=$# -if [[ $nargs -lt 1 || $nargs -gt 5 ]]; then +if [[ $nargs -lt 1 || $nargs -gt 7 ]]; then usage exit 1 fi -set -ax - #----------------------------------------------- # Process command line arguments # export RUN=gdas +num_cycles="" while [[ $# -ge 1 ]] do @@ -64,6 +65,10 @@ do export RUN="$2" shift # past argument ;; + -n|--ncyc) + export num_cycles="$2" + shift # past argument + ;; *) #any unspecified key is CONMON_SUFFIX export CONMON_SUFFIX=$key @@ -80,7 +85,11 @@ echo "CONMON_SUFFIX = $CONMON_SUFFIX" echo "PDATE = $PDATE" echo "RUN = $RUN" -export NUM_CYCLES=${NUM_CYCLES:-121} # number of cycles in plot +if [[ ${#num_cycles} -gt 0 ]]; then + export NUM_CYCLES=${num_cycles} +fi + + export JOBNAME=${JOBNAME:-ConMon_plt_${CONMON_SUFFIX}} export grib2=${grib2:-1} # 1 = grib2 (true), 0 = grib # should this move to config? diff --git a/src/Conventional_Monitor/parm/ConMon_config b/src/Conventional_Monitor/parm/ConMon_config index 120d0a26..629dcc7e 100644 --- a/src/Conventional_Monitor/parm/ConMon_config +++ b/src/Conventional_Monitor/parm/ConMon_config @@ -177,6 +177,11 @@ if [[ $CONMON_CONFIG -ne 1 ]]; then export C_LOGDIR=${C_PTMP_USER}/logs/${CONMON_SUFFIX}/${RUN}/conmon export WORK_conmon=${WORK_conmon:-${C_STMP_USER}/${CONMON_SUFFIX}/${RUN}/ConMon} + # + # NUM_CYCLES is the number of cycles to be used time series plots. + # + export NUM_CYCLES=${NUM_CYCLES:-121} + # # Automatically remove old, extracted data files # diff --git a/src/Ozone_Monitor/image_gen/ush/OznMon_Plt.sh b/src/Ozone_Monitor/image_gen/ush/OznMon_Plt.sh index 84348adb..795ab095 100755 --- a/src/Ozone_Monitor/image_gen/ush/OznMon_Plt.sh +++ b/src/Ozone_Monitor/image_gen/ush/OznMon_Plt.sh @@ -5,44 +5,18 @@ # # Main plot script for OznMon. # -# Usage: -# -# OznMon_Plt.sh OZNMON_SUFFIX [-p|pdate yyyymmddcc] [-r|run gdas|gfs] -# -# OZNMON_SUFFIX = data source identifier which matches data -# in the OZN_TANKDIR directory. -# -p|--pdate = specified cycle to plot. If not specified the -# last available date will be plotted. -# -r|--run = $RUN value, gdas|gfs, default is gdas. -# -# -t|--tank = parent directory to the oznmon data file location. This will be extended by -# $OZNMON_SUFFIX, $RUN, and $PDATE to locate the extracted oznmon data. -# Three data directory formats will be tried: -# ops = ${tankdir}/${net}/${version}/${run}.${pdy}/${hh}/atmos/${monitor} -# dev = ${tankdir}/${monitor}/stats/${net}/${run}.${pdy}/${hh} -# mon = ${tankdir}/stats/${net}/${run}.${pdy}/${hh}/${monitor} -# -# If --tank is not specified then it defaults to OZN_TANKDIR (defined in -# parm/OznMon_config). -# -# -c1|--comp1 = define first instrument/sat source to plot as comparison -# (applies to time series plots only) -# -c2|--comp2 = define second instrument/sat source to plot as comparison -# (applies to time series plots only) -# -# NOTE: Both COMP1 and COMP2 have to be defined to -# generate comparison plots as part of the COMP1 -# source's time plots. #----------------------------------------------------------------------- function usage { echo " " - echo "Usage: OznMon_Plt.sh OZNMON_SUFFIX " + echo "Usage: OznMon_Plt.sh OZNMON_SUFFIX [-p|--pdate -r|--run -n|--ncyc -c1|--comp1 -c2|--comp2] " echo " OZNMON_SUFFIX is data source identifier which matches data in " echo " the $OZN_TANKDIR directory." echo " -p | --pdate yyyymmddcc to specify the cycle to be plotted." echo " If unspecified the last available date will be plotted." echo " -r | --run the gdas|gfs run to be plotted, gdas is default" + echo " -n | --ncyc is the number of cycles to be used in time series plots. If" + echo " not specified the default value in parm/RadMon_user_settins will be used" echo " -t | --tank parent directory to the oznmon data file location. This" echo " will be extended by $OZNMON_SUFFIX, $RUN, and $PDATE to locate the" echo " extracted oznmon data." @@ -53,11 +27,12 @@ function usage { echo start OznMon_Plt.sh - nargs=$# echo nargs = $nargs +num_cycles="" tank="" +pdate="" while [[ $# -ge 1 ]] do @@ -72,6 +47,10 @@ do export RUN="$2" shift # past argument ;; + -n|--ncyc) + num_cycles="$2" + shift # past argument + ;; -t|--tank) tank="$2" shift # past argument @@ -93,7 +72,7 @@ do shift done -if [[ $nargs -lt 0 || $nargs -gt 9 ]]; then +if [[ $nargs -lt 0 || $nargs -gt 13 ]]; then usage exit 1 fi @@ -112,6 +91,10 @@ if [[ ${#RUN} -le 0 ]]; then export RUN=gdas fi +if [[ ${#num_cycles} -gt 0 ]]; then + export NUM_CYCLES=${num_cycles} +fi + echo "OZNMON_SUFFIX = $OZNMON_SUFFIX" echo "pdate = $pdate" echo "RUN = $RUN" @@ -172,7 +155,6 @@ else fi fi export OZN_TANKDIR=${ozn_tankdir} -echo "OZN_TANKDIR = $OZN_TANKDIR" #-------------------------------------------------------------------- # Set up OZN_TANKDIR_IMGS @@ -218,7 +200,6 @@ if [[ ${#pdate} -le 0 ]]; then fi fi - #------------------------------------ # Confirm there is data for $pdate # diff --git a/src/Ozone_Monitor/image_gen/ush/plot_summary.sh b/src/Ozone_Monitor/image_gen/ush/plot_summary.sh index 143302f2..879265ee 100755 --- a/src/Ozone_Monitor/image_gen/ush/plot_summary.sh +++ b/src/Ozone_Monitor/image_gen/ush/plot_summary.sh @@ -60,8 +60,9 @@ $UNCOMPRESS *.gz # cycle will be the cycle specified by $PDATE. # if [[ -e ${SATYPE}.${ptype}.ctl ]]; then - bdate=`$NDATE -720 $PDATE` - ${OZN_IG_SCRIPTS}/update_ctl_tdef.sh ${SATYPE}.${ptype}.ctl ${bdate} 121 + ((cyc=${NUM_CYCLES}-1, hrs=cyc*${CYCLE_INTERVAL})) + bdate=`${NDATE} -${hrs} ${PDATE}` + ${OZN_IG_SCRIPTS}/update_ctl_tdef.sh ${SATYPE}.${ptype}.ctl ${bdate} ${NUM_CYCLES} cat << EOF > ${SATYPE}.gs 'open ${SATYPE}.${ptype}.ctl' diff --git a/src/Ozone_Monitor/image_gen/ush/plot_time.sh b/src/Ozone_Monitor/image_gen/ush/plot_time.sh index 42d02fdf..1a8ba8cd 100755 --- a/src/Ozone_Monitor/image_gen/ush/plot_time.sh +++ b/src/Ozone_Monitor/image_gen/ush/plot_time.sh @@ -84,11 +84,12 @@ done # Modify tdef line in .ctl file to start at bdate. # if [[ -e ${SATYPE}.${dsrc}.ctl ]]; then - edate=`$NDATE -720 $PDATE` - ${OZN_IG_SCRIPTS}/update_ctl_tdef.sh ${SATYPE}.${dsrc}.ctl ${edate} 121 + ((cyc=${NUM_CYCLES}-1, hrs=cyc*${CYCLE_INTERVAL})) + edate=`${NDATE} -${hrs} ${PDATE}` + ${OZN_IG_SCRIPTS}/update_ctl_tdef.sh ${SATYPE}.${dsrc}.ctl ${edate} ${NUM_CYCLES} if [[ $ADD_COMP -eq 1 ]]; then - ${OZN_IG_SCRIPTS}/update_ctl_tdef.sh ${COMP2}.${dsrc}.ctl ${edate} 121 + ${OZN_IG_SCRIPTS}/update_ctl_tdef.sh ${COMP2}.${dsrc}.ctl ${edate} ${NUM_CYCLES} fi diff --git a/src/Ozone_Monitor/parm/OznMon_user_settings b/src/Ozone_Monitor/parm/OznMon_user_settings index 22f2de96..6ad8ff22 100644 --- a/src/Ozone_Monitor/parm/OznMon_user_settings +++ b/src/Ozone_Monitor/parm/OznMon_user_settings @@ -72,6 +72,10 @@ export REGIONAL_RR=${REGIONAL_RR:-0} # export CYCLE_INTERVAL=${CYCLE_INTERVAL:-6} +# +# NUM_CYCLES is the number of cycles to be used time series plots. +# +export NUM_CYCLES=${NUM_CYCLES:-121} # # CLEAN_TANKDIR controls automatic removal of old data files in diff --git a/src/Radiance_Monitor/image_gen/ush/RadMon_IG_glb.sh b/src/Radiance_Monitor/image_gen/ush/RadMon_IG_glb.sh index fe9b1331..bf53ac97 100755 --- a/src/Radiance_Monitor/image_gen/ush/RadMon_IG_glb.sh +++ b/src/Radiance_Monitor/image_gen/ush/RadMon_IG_glb.sh @@ -13,7 +13,7 @@ # usage #-------------------------------------------------------------------- function usage { - echo "Usage: RadMon_IG_glb.sh suffix [-p|--pdate -r|--run ]" + echo "Usage: RadMon_IG_glb.sh suffix [-p|--pdate -r|--run -n|--ncyc]" echo "" echo " suffix is the indentifier for this data source." echo " This is usually the same as the NET value." @@ -23,6 +23,9 @@ function usage { echo "" echo " -r|--run is gdas|gfs. gdas is the default if not specified." echo "" + echo " -n|--ncyc is the number of cycles to be used in time series plots. If" + echo " not specified the default value in parm/RadMon_user_settins will be used" + echo "" } echo start RadMon_IG_glb.sh @@ -34,7 +37,7 @@ echo exit_value=0 nargs=$# -if [[ $nargs -lt 1 || $nargs -gt 5 ]]; then +if [[ $nargs -lt 1 || $nargs -gt 7 ]]; then usage exit 1 fi @@ -44,6 +47,7 @@ fi # run=gdas pdate="" +num_cycles="" while [[ $# -ge 1 ]] do @@ -58,6 +62,10 @@ do run="$2" shift # past argument ;; + -n|--ncyc) + num_cycles="$2" + shift # past argument + ;; *) #any unspecified key is RADMON_SUFFIX export RADMON_SUFFIX=$key @@ -72,7 +80,11 @@ export RUN=${run} echo "RADMON_SUFFIX = ${RADMON_SUFFIX}" echo "RUN = ${RUN}" echo "pdate = ${pdate}" +echo "num_cycles = ${num_cycles}" +if [[ ${#num_cycles} -gt 0 ]]; then + export NUM_CYCLES=${num_cycles} +fi #-------------------------------------------------------------------- # Run config files to load environment variables, diff --git a/src/Radiance_Monitor/image_gen/ush/RadMon_IG_rgn.sh b/src/Radiance_Monitor/image_gen/ush/RadMon_IG_rgn.sh index 1fa3e272..b85baf2d 100755 --- a/src/Radiance_Monitor/image_gen/ush/RadMon_IG_rgn.sh +++ b/src/Radiance_Monitor/image_gen/ush/RadMon_IG_rgn.sh @@ -11,7 +11,7 @@ # usage #-------------------------------------------------------------------- function usage { - echo "Usage: RadMon_IG_rgn.sh suffix [-p|--pdate -r|--run ]" + echo "Usage: RadMon_IG_rgn.sh suffix [-p|--pdate -r|--run -n|--ncyc]" echo "" echo " suffix is the indentifier for this data source." echo " This is usually the same as the NET value." @@ -21,6 +21,9 @@ function usage { echo "" echo " -r|--run nam is the default if not specified." echo "" + echo " -n|--ncyc is the number of cycles to be used in time series plots. If" + echo " not specified the default value in parm/RadMon_user_settins will be used" + echo "" } @@ -28,7 +31,7 @@ echo start RadMon_IG_rgn.sh nargs=$# -if [[ $nargs -lt 1 || $nargs -gt 5 ]]; then +if [[ $nargs -lt 1 || $nargs -gt 7 ]]; then usage exit 1 fi @@ -37,6 +40,8 @@ fi # Process command line arguments. # run=nam +pdate="" +num_cycles="" while [[ $# -ge 1 ]] do @@ -51,6 +56,10 @@ do run="$2" shift # past argument ;; + -n|--ncyc) + num_cycles="$2" + shift # past argument + ;; *) #any unspecified key is RADMON_SUFFIX export RADMON_SUFFIX=$key @@ -65,9 +74,11 @@ export RUN=${run} echo "RADMON_SUFFIX = ${RADMON_SUFFIX}" echo "RUN = ${RUN}" echo "pdate = ${pdate}" +echo "num_cycles = ${num_cycles}" - -set -ax +if [[ ${#num_cycles} -gt 0 ]]; then + export NUM_CYCLES=${num_cycles} +fi #-------------------------------------------------------------------- # Set environment variables