Subversion Repositories lagranto.icon

Rev

Details | Last modification | View Log | RSS feed

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