Subversion Repositories lagranto.wrf

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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