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