Subversion Repositories lagranto.um

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 michaesp 1
#!/bin/csh
2
 
3
 
4
# Write usage information
5
if ( ${#argv} == 0) then
6
  echo 
7
  echo "--------------------------------------------------------------"
8
  echo "Usage: timeres.sh trainp traout -[h|min] val -[cubic|linear]        "
9
  echo 
10
  echo "         trainp          : Input trajectory file"
11
  echo "         traout          : Output trajectory file"
12
  echo
13
  echo "     -[h|min] value  : new time resolution in h or min"
14
  echo "     -[cubic|spline] : interpolation method"
15
  echo "--------------------------------------------------------------"
16
  exit 0
17
endif
18
 
19
# Get input and output trajectory file
20
set inpfile = $1
21
set outfile = $2
22
 
23
# Handle optional arguments
24
 
25
set mode = "cubic"
26
 
27
while ( $#argv > 0 )
28
 
29
  switch ( $argv[1] )
30
 
31
   case -h
32
     set unit  = "h"
33
     set value = $argv[2]
34
     shift;
35
   breaksw
36
 
37
   case -min
38
     set unit  = "min"
39
     set value = $argv[2]
40
     shift;
41
   breaksw
42
 
43
   case -linear
44
     set mode  = "linear"
45
   breaksw
46
 
47
   case -cubic
48
     set mode  = "cubic"
49
   breaksw
50
 
51
  endsw
52
 
53
  shift;
54
 
55
end
56
 
57
# Get the dimensions of the trajectory file
58
set dim=`${LAGRANTO}/goodies/trainfo.sh ${inpfile} dim` 
59
 
60
# Prepare parameter file and run program
61
\rm -f timeres.param
62
echo \"${inpfile}\"  >! timeres.param
63
echo \"${outfile}\"  >> timeres.param
64
echo ${dim}          >> timeres.param
65
echo ${value}        >> timeres.param
66
echo \"${unit}\"     >> timeres.param
67
echo \"${mode}\"     >> timeres.param
68
 
69
${LAGRANTO}/goodies/timeres
70
 
71
# Make clean
72
#\rm -f timeres.param
73
 
74
exit 0
75