Rev 3 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
#!/bin/csh
# Write usage information
if ( ${#argv} == 0) then
echo
echo "--------------------------------------------------------------"
echo "Usage: timeres.sh trainp traout -[h|min] val -[cubic|linear] "
echo
echo " trainp : Input trajectory file"
echo " traout : Output trajectory file"
echo
echo " -[h|min] value : new time resolution in h or min"
echo " -[cubic|spline] : interpolation method"
echo "--------------------------------------------------------------"
exit 0
endif
# Get input and output trajectory file
set inpfile = $1
set outfile = $2
# Handle optional arguments
set mode = "cubic"
while ( $#argv > 0 )
switch ( $argv[1] )
case -h
set unit = "h"
set value = $argv[2]
shift;
breaksw
case -min
set unit = "min"
set value = $argv[2]
shift;
breaksw
case -linear
set mode = "linear"
breaksw
case -cubic
set mode = "cubic"
breaksw
endsw
shift;
end
# Get the dimensions of the trajectory file
set dim=`${LAGRANTO}/goodies/trainfo.sh ${inpfile} dim`
# Prepare parameter file and run program
\rm -f timeres.param
echo \"${inpfile}\" >! timeres.param
echo \"${outfile}\" >> timeres.param
echo ${dim} >> timeres.param
echo ${value} >> timeres.param
echo \"${unit}\" >> timeres.param
echo \"${mode}\" >> timeres.param
${LAGRANTO}/goodies/timeres
# Make clean
#\rm -f timeres.param
exit 0