Subversion Repositories lagranto.icon

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
# 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
set str=`echo $str | sed -e "s/,//g"`  
28
set str=`echo $str | sed -e "s/\///g"`  
29
 
30
# Check the mode is valid
31
if ( "${mode}" == "-var"      )  goto next
32
if ( "${mode}" == "-time"     )  goto next
33
if ( "${mode}" == "-tra"      )  goto next
34
if ( "${mode}" == "-startf"   )  goto next
35
if ( "${mode}" == "-index"    )  goto next
36
if ( "${mode}" == "-boolean"  )  goto next
37
if ( "${mode}" == "-pattern"  )  goto next
38
if ( "${mode}" == "-leaving"  )  goto next
39
if ( "${mode}" == "-staying"  )  goto next
40
 
41
echo " Invalid mode ${mode}..."
42
exit 1
43
 
44
next:
45
 
46
# Set program names
47
set prog1=${LAGRANTO}/goodies/extract
48
set prog2=${LAGRANTO}/goodies/trainfo.sh
49
 
50
# Get trajectory dimensions
51
set dim=`${prog2} ${inpfile} dim` 
52
 
53
# Run program
54
\rm -f extract.param
55
echo \"${inpfile}\"  >! extract.param
56
echo \"${outfile}\"  >> extract.param
57
echo \"${mode}\"     >> extract.param
58
echo ${dim}          >> extract.param
59
echo \"${str}\"      >> extract.param
60
 
61
${prog1}
62
 
63
#\rm -f extract.param
64
 
65
exit 0
66