Subversion Repositories lagranto.ecmwf

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

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