Subversion Repositories lagranto.um

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 michaesp 1
#!/bin/csh
2
 
15 michaesp 3
# Set Lagranto 
4
set LAGRANTO = ${LAGRANTOBASE}.${MODEL}/
3 michaesp 5
 
6
# Write usage information
7
if ( ${#argv} == 0) then
8
  echo 
9
  echo "--------------------------------------------------------------"
10
  echo "Usage: list2lsl.sh listinp traout [ -ref refdate ] [ -time value ]    "
11
  echo 
12
  echo "         listinp         : Input list file [lon,lat,p]"
13
  echo "         traout          : Output trajectory file"
14
  echo "         -ref refdate    : Reference date (yyyymmdd_hhmi)"
15
  echo "         -time value     : time value (in format HH.MM)"
16
  echo 
17
  echo "--------------------------------------------------------------"
18
  exit 1
19
endif
20
 
21
set inpfile=$1
22
set outfile=$2
23
 
24
set refdate   = `date +'%Y%m%d_%H%M'`
25
set timevalue = 0
26
 
27
while ( $#argv > 0 )
28
 
29
   switch ( $argv[1] )
30
 
31
   case -ref
32
     set refdate=$argv[2]
33
     shift;
34
   breaksw
35
 
36
   case -time
37
     set timevalue=$argv[2]
38
     shift;
39
   breaksw
40
 
41
  endsw
42
 
43
  shift;
44
 
45
end
46
 
47
set ntra=`wc -l ${inpfile} | awk '{print $1}'`
48
 
49
# Split the reference date
50
set yyyy=`echo ${refdate}   | cut -c 1-4`
51
set   mm=`echo ${refdate}   | cut -c 5-6`
52
set   dd=`echo ${refdate}   | cut -c 7-8`
53
set   hh=`echo ${refdate}   | cut -c 10-11`
54
set  min=`echo ${refdate}00 | cut -c 12-13`
55
 
56
\rm -f list2lsl.param
57
echo \"${inpfile}\"                      >! list2lsl.param
58
echo \"${outfile}\"                      >> list2lsl.param
59
echo ${ntra}                             >> list2lsl.param
60
echo ${yyyy} ${mm} ${dd} ${hh} ${min} 00 >> list2lsl.param 
61
echo ${timevalue}                        >> list2lsl.param 
62
 
63
${LAGRANTO}/goodies/list2lsl
64
 
65
\rm -f list2lsl.param
66
 
67
exit 0
68