#!/bin/sh


MOD=tak135sph.mod

#for DEPTH in 10 40 100 200 300 400 500  600 700
for DEPTH in  10 700
do
echo "GCARC  EVDP    P(taup)     P(CPS)                 S(taup)     S(CPS)"
#DDDDD DDDDD FFFFFFF.ff FFFFFFF.ff (FFFFFFF.ff) FFFFFFF.ff FFFFFFF.ff (FFFFFFF.ff)
echo "---------------------------------------------------------------------------------"
#for GCARC in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 
for GCARC in 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 30 40 50 60 70 80 90 100 110 120 130 140
do


export A=`time96 -GCARC $GCARC -EVDP $DEPTH -P -M $MOD`
export T0=`time96 -GCARC $GCARC -EVDP $DEPTH -SV -M $MOD`
export T1=`time96 -GCARC $GCARC -EVDP $DEPTH -SH -M $MOD`
DOTAUP $GCARC $DEPTH > taup.out
export TP=`grep ' = P' taup.out | head -1 | awk '{print $4}' `
if [ "${TP}" = "" ]
then
	TP=-1.0
fi
export Tp=`grep ' = p' taup.out | head -1 | awk '{print $4}' `
if [ "${Tp}" = "" ]
then
	Tp=-1.0
fi
if [ ${TP} = "-1.0" ]
then
	PT=${Tp}
else
	PT=${TP}
fi

export TS=`grep ' = S' taup.out | head -1 | awk '{print $4}' `
if [ "${TS}" = "" ]
then
	TS=-1.0
fi
export Ts=`grep ' = s' taup.out | head -1 | awk '{print $4}' `
if [ "${Ts}" = "" ]
then
	Ts=-1.0
fi
if [ ${TS} = "-1.0" ]
then
	ST=${Ts}
else
	ST=${TS}
fi

echo ${GCARC} ${DEPTH} ${PT} ${A} ${ST} ${T0}  | awk '{printf "%5d %5d %10.2f %10.2f (%10.2f) %10.2f %10.2f (%10.2f)\n", $1, $2, $3, $4 , $3 - $4, $5 ,$6, $5- $6}' 

done
echo "---------------------------------------------------------------------------------"
done
