Subversion Repositories lagranto.um

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