Subversion Repositories lagranto.wrf

Rev

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

Rev Author Line No. Line
2 michaesp 1
#!/bin/csh
2
 
11 michaesp 3
# Set Lagranto 
4
set LAGRANTO = ${LAGRANTOBASE}.${MODEL}/
5
 
2 michaesp 6
# Write usage information
7
if ( ${#argv} == 0) then
8
  echo 
9
  ${LAGRANTO}/bin/lagrantohelp extract short
10
  echo  
11
  exit 0
12
endif
13
 
14
# Set the input and output filenames
15
set inpfile = $1
16
set outfile = $2
17
shift; shift;
18
 
19
# Handle optional arguments (get a list, remove , and / separators)
20
set mode=$1
21
shift;
22
set str=
23
while ( $#argv > 0 )
24
   set str = "${str} $1"
25
   shift
26
end
27
 
28
set str=`echo $str | sed -e "s/,//g"`  
29
set str=`echo $str | sed -e "s/\///g"`  
30
 
31
# Check the mode is valid
32
if ( "${mode}" == "-var"      )  goto next
33
if ( "${mode}" == "-time"     )  goto next
34
if ( "${mode}" == "-tra"      )  goto next
35
if ( "${mode}" == "-startf"   )  goto next
36
if ( "${mode}" == "-index"    )  goto next
37
if ( "${mode}" == "-boolean"  )  goto next
38
if ( "${mode}" == "-pattern"  )  goto next
39
 
40
echo " Invalid mode ${mode}..."
41
exit 1
42
 
43
next:
44
 
45
# Set program names
46
set prog1=${LAGRANTO}/goodies/extract
47
set prog2=${LAGRANTO}/goodies/trainfo.sh
48
 
49
# Get trajectory dimensions
50
set dim=`${prog2} ${inpfile} dim` 
51
 
52
# Run program
53
\rm -f extract.param
54
echo \"${inpfile}\"  >! extract.param
55
echo \"${outfile}\"  >> extract.param
56
echo \"${mode}\"     >> extract.param
57
echo ${dim}          >> extract.param
58
echo \"${str}\"      >> extract.param
59
 
60
${prog1}
61
 
62
#\rm -f extract.param
63
 
64
exit 0
65