@echo off
setLocal EnableDelayedExpansion

cd ..
set WRK=%CD%

set DIR=c:
set PGM=%DIR%\hysplit4
cd %PGM%\working
SET INP=hysplit2.bin

IF NOT EXIST %INP% (
   echo Missing input file %INP%
   echo Re-run conc_cexp to create output file!
   pause
)

REM --------------------------------------------------------------

echo %INP%   >input.txt
echo 0      >>input.txt
echo /n     >>input.txt
EOD         >>input.txt
%PGM%\exec\conread <input.txt
DEL input.txt
PAUSE

REM ----------------------------------------------------------

%PGM%\exec\con2asc -i%INP% -s -u1.0E+12
TYPE hysplit2.bin.txt
PAUSE

REM ----------------------------------------------------------

echo C510 42.25 -78.80 >samplers.txt
%PGM%\exec\con2stn -i%INP% -ocon2stn.txt -r1 -c1.0E+12 -ssamplers.txt 
type con2stn.txt
PAUSE

REM ----------------------------------------------------------

ECHO 'TITLE^&','### %0 ### ^&' >LABELS.CFG
%PGM%\exec\timeplot -icon2stn.txt
timeplot.ps
PAUSE

%PGM%\exec\timeplot -icon2stn.txt -s%WRK%\captex\captex2_m510.txt
timeplot.ps
