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