Subversion Repositories lagranto.um

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

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