Subversion Repositories lagranto.ecmwf

Rev

Rev 3 | Go to most recent revision | Details | Compare with Previous | 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
  ${LAGRANTO}/bin/lagrantohelp timeres short
8
  echo  
9
  exit 0
10
endif
11
 
12
# Get input and output trajectory file
13
set inpfile = $1
14
set outfile = $2
15
 
16
# Handle optional arguments
17
 
18
set mode = "cubic"
15 michaesp 19
set shift = 0
20
set value = 0
21
set unit  = "min"
3 michaesp 22
 
23
while ( $#argv > 0 )
24
 
25
  switch ( $argv[1] )
26
 
27
   case -h
28
     set unit  = "h"
29
     set value = $argv[2]
30
     shift;
31
   breaksw
32
 
33
   case -min
34
     set unit  = "min"
35
     set value = $argv[2]
36
     shift;
37
   breaksw
38
 
39
   case -linear
40
     set mode  = "linear"
41
   breaksw
42
 
43
   case -cubic
44
     set mode  = "cubic"
45
   breaksw
15 michaesp 46
 
47
   case -shifth
48
     set shift = $argv[2]
49
     shift;
50
   breaksw
3 michaesp 51
 
52
  endsw
53
 
54
  shift;
55
 
56
end
57
 
58
# Get the dimensions of the trajectory file
59
set dim=`${LAGRANTO}/goodies/trainfo.sh ${inpfile} dim` 
60
 
61
# Prepare parameter file and run program
62
\rm -f timeres.param
63
echo \"${inpfile}\"  >! timeres.param
64
echo \"${outfile}\"  >> timeres.param
65
echo ${dim}          >> timeres.param
66
echo ${value}        >> timeres.param
67
echo \"${unit}\"     >> timeres.param
68
echo \"${mode}\"     >> timeres.param
15 michaesp 69
echo ${shift}        >> timeres.param
3 michaesp 70
 
71
${LAGRANTO}/goodies/timeres
72
 
73
# Make clean
74
#\rm -f timeres.param
75
 
76
exit 0
77