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