#!/bin/sh

#-------------------------------------------------------------

  MDL="${HOME}/hysplit4"
  MET="${HOME}/Tutorial/captex"
  MAP="${MDL}/graphics/arlmap"
  INP="hysplit2.bin"
  OUT="${MDL}/working"

  cd $OUT

  if [ ! -f $INP ];then
     echo "Missing input file: $INP"
     echo "Run model to generate output file!"
     exit
  fi
  echo "###$0 ###"

#--------------------------------------------------------------

  echo "'TITLE&','### $0 ###&'"  >LABELS.CFG

  ${MDL}/exec/concplot -i$INP -j${MDL}/graphics/arlmap -z80 -x1.0E+12 -upg
  gs concplot.ps
  echo "Create animation: concplot.gif"
  convert -trim +repage -density 140 -loop 100 -delay 50 -dispose Background concplot.ps concplot.gif
  echo "Enter to continue ..."; read x

  echo "Creating particle plot ..."
  ${MDL}/exec/parxplot -iPARDUMP -j$MAP -k1 -z80 -n10
  echo "Create animation: parxplot.gif"
  convert -trim +repage -density 140 -loop 100 -delay 50 -dispose Background parxplot.ps parxplot.gif
  gs parxplot.ps
  echo "Enter to continue ..."; read x

  ${MDL}/exec/isochron -i$INP -j$MAP -d6 -n10 -t0.0
  gs toa.ps
  echo "Enter to continue ..."; read x

  ${MDL}/exec/gridplot -i$INP -ogridplot -j$MAP -c1.0E+12 -d2.0 -a1 -upg -l-1.0
  echo "Create animation: gridplot.gif"
  convert -trim +repage -density 140 -loop 100 -delay 50 -dispose Background gridplot.ps gridplot.gif
  gs gridplot.ps
