Subversion Repositories lagranto.wrf

Rev

Rev 2 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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