Subversion Repositories lagranto.20cr

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 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 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 that 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
if ( "${mode}" == "-leaving"  )  goto next
40
if ( "${mode}" == "-staying"  )  goto next
41
 
42
echo " Invalid mode ${mode}..."
43
exit 1
44
 
45
next:
46
 
47
# Set program names
48
set prog1=${LAGRANTO}/goodies/extract
49
set prog2=${LAGRANTO}/goodies/trainfo.sh
50
 
51
# Get trajectory dimensions
52
set dim=`${prog2} ${inpfile} dim` 
53
 
54
# Run program
55
\rm -f extract.param
56
echo \"${inpfile}\"  >! extract.param
57
echo \"${outfile}\"  >> extract.param
58
echo \"${mode}\"     >> extract.param
59
echo ${dim}          >> extract.param
60
echo \"${str}\"      >> extract.param
61
 
62
${prog1}
63
 
64
#\rm -f extract.param
65
 
66
exit 0
67