Having been asked to add some RASP sounding plots in Northern Ireland, it became apparent that a script to just test just the ones added would make life easier (than replotting sounding by hour from the command line).Then it became an idea to just have this to replot all soundings (as potentially to do them later on a differnet host).
The script below is the result, fixed for one model with fixed start end points. These can of course be extended/changed as approriate.
# Script expects a model as the first parameter,
# e.g. "sound_plot.sh EI12"
# Also expects "replot" to be available in $HOMEDIR/GM and it works
# Set where the RASP setup lives
# Set where are commands are ... useful to put full path if run
# from a cron job. Ensure they exist, or add a check for it.
# Check we got a model and date to plot
if [ $# -eq 2 ]
echo "Using input as '$1'"
echo "Using '$REPLOT_CMD' to replot"
echo "Using date as '$2'"
echo "Provide a model to try. E.g. UK12 2015-04-03"
case $1 in
EI12) # We'll do just the one here
# Set the start and end sounding number (as in soundingXX)
SEQ1=$(SEQ_CMD -s " " $val1 $val2)
# Set the start end of hours to use
SEQ2=$(SEQ_CMD -f "%02g" -s " " $val3 $val4)
# Set the model to use and clear out the temp folder where
# we will put the results
echo "Don't know this model to work out start and finish: $1"
# Now sort out the results folder ...
# Clear it out
rm -rf $TMP_FOLDER
# Output what we set
START_SND=$(printf '%d' "$val3")
END_SND=$(printf '%d' "$val4")
START_HR=$(printf '%02d' "$val1")
END_HR=$(printf '%02d' "$val2")
echo "Sounding sequence: sounding$SEQ1"
echo "Hour sequence: $SEQ2"
echo "Sending results to: $TMP_FOLDER"
echo "Using date of: $2"
#Now do plots, assuming no gaps though
for SND_NAME in $SEQ1
for PROC_HR in $SEQ2
echo "$REPLOT_CMD -r $MODEL -d $TMP_FOLDER -p $SOUNDING_NAME -l $TMP_FOLDER -w $MODEL_FOLDER/wrfout_d02_$2_$PROC_HR\:00\:00"
$HOMEDIR/GM/replot -r $MODEL -d $TMP_FOLDER -p $SOUNDING_NAME -l $TMP_FOLDER -w $MODEL_FOLDER/wrfout_d02_$2_$PROC_HR\:00\:00