Subversion Repositories lagranto.ecmwf

Rev

Rev 3 | Rev 39 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3 Rev 5
Line 57... Line 57...
57
set changet    = 'false'
57
set changet    = 'false'
58
set noclean    = 'false'
58
set noclean    = 'false'
59
set timecheck  = 'no' 
59
set timecheck  = 'no' 
60
set intmode    = 'normal'
60
set intmode    = 'normal'
61
set radius     = '0'        
61
set radius     = '0'        
-
 
62
set tropo_pv   = '2' 
-
 
63
set tropo_th   = '380'
62
 
64
 
63
# Set flag for consistency
65
# Set flag for consistency
64
set isok = 1
66
set isok = 1
65
 
67
 
66
while ( $#argv > 0 )
68
while ( $#argv > 0 )
Line 115... Line 117...
115
   breaksw
117
   breaksw
116
 
118
 
117
   case -clustering
119
   case -clustering
118
     set intmode = 'clustering'
120
     set intmode = 'clustering'
119
     echo "intmode                 -> clustering (user defined)"
121
     echo "intmode                 -> clustering (user defined)"
-
 
122
     shift;
-
 
123
     if ( "$1" == "" ) then
-
 
124
        echo "ERROR (clustering): specify tropopause PV [pvu] and TH [K]! Example: -clustering 2 380"
-
 
125
        exit
-
 
126
     else
-
 
127
        set tropo_pv = $1
-
 
128
     endif
-
 
129
     shift;
-
 
130
     if ( "$1" == "" ) then
-
 
131
        echo "ERROR (clustering): specify tropopause PV [pvu] and TH [K]! Example: -clustering 2 380"
-
 
132
        exit
-
 
133
     else
-
 
134
        set tropo_th = $1
-
 
135
        echo 'intmode                 -> clustering tropo_pv = ' ${tropo_pv} 'pvu and tropo_th = ' ${tropo_th} 'K'
-
 
136
     endif
120
   breaksw
137
   breaksw
121
 
138
 
122
   case -circle_avg
139
   case -circle_avg
123
     set intmode = 'circle_avg'
140
     set intmode = 'circle_avg'
124
     echo "intmode                 -> circle_avg (user defined)"
141
     echo "intmode                 -> circle_avg (user defined)"
Line 193... Line 210...
193
 
210
 
194
# Get the start, end and reference date for the tracing
211
# Get the start, end and reference date for the tracing
195
set startdate = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} startdate` 
212
set startdate = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} startdate` 
196
set enddate   = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} enddate` 
213
set enddate   = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} enddate` 
197
set refdate   = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} refdate` 
214
set refdate   = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} refdate` 
198
set ntra      =  `${LAGRANTO}/goodies/trainfo.sh ${inpfile} ntra`
215
set ntra      = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} ntra`
199
set ntim      =  `${LAGRANTO}/goodies/trainfo.sh ${inpfile} ntim`
216
set ntim      = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} ntim`
200
set ncol      =  `${LAGRANTO}/goodies/trainfo.sh ${inpfile} ncol`
217
set ncol      = `${LAGRANTO}/goodies/trainfo.sh ${inpfile} ncol`
201
 
218
 
202
# Check format of start and end date - must be the same
219
# Check format of start and end date - must be the same
203
set ns=`echo $startdate | sed -e 's/_[0-9]*//' | wc -c`
220
set ns=`echo $startdate | sed -e 's/_[0-9]*//' | wc -c`
204
set ne=`echo $enddate   | sed -e 's/_[0-9]*//' | wc -c`
221
set ne=`echo $enddate   | sed -e 's/_[0-9]*//' | wc -c`
205
if ( $ns != $ne ) then
222
if ( $ns != $ne ) then
Line 483... Line 500...
483
  echo " ERROR: tracevars-files must not contain empty lines ***"
500
  echo " ERROR: tracevars-files must not contain empty lines ***"
484
  exit 1
501
  exit 1
485
endif
502
endif
486
set calf=`cat $tvfile | awk '{print $3}'`
503
set calf=`cat $tvfile | awk '{print $3}'`
487
set tfil=`cat $tvfile | awk '{print $4}'`
504
set tfil=`cat $tvfile | awk '{print $4}'`
-
 
505
 
-
 
506
# Write some status information
-
 
507
cat ${tvfile}
-
 
508
echo
-
 
509
echo "# Number of tracing variables        : ${nlines}"
-
 
510
echo "Fields are read from following files : ${tfil}"
-
 
511
 
-
 
512
# Loop over all variables - check availability
488
foreach v ( $vars )
513
foreach v ( $vars )
489
  if ( $calf[1] == 0 ) then
514
  if ( $calf[1] == 0 ) then
490
    set v0 = `echo $v | awk 'BEGIN {FS = ":"}; {print $1}'`
515
    set v0 = `echo $v | awk 'BEGIN {FS = ":"}; {print $1}'`
491
    set flag=`${LAGRANTO}goodies/getvars $tfil[1]$datfiles[1] | grep " $v0 " | wc -l`
516
    set flag=`${LAGRANTO}/goodies/getvars $tfil[1]$datfiles[1] | grep " $v0 " | wc -l`
492
    set iscomment=`echo $v0 | cut -c 1` 
517
    set iscomment=`echo $v0 | cut -c 1` 
493
    if ( "${iscomment}" != "#" ) then 
518
    if ( "${iscomment}" != "#" ) then 
494
	 if ( $flag == 0 ) then
519
	 if ( $flag == 0 ) then
495
           echo " ERROR: variable $v listed in $tvfile is not on the $tfil[1]-files ***"
520
           echo " ERROR: variable $v listed in $tvfile is not on the $tfil[1]-files ***"
496
           exit 1
521
           exit 1
Line 500... Line 525...
500
  shift calf
525
  shift calf
501
  shift tfil
526
  shift tfil
502
end
527
end
503
set ntrace=${nlines} 
528
set ntrace=${nlines} 
504
 
529
 
505
# Write some status information
-
 
506
cat ${tvfile}
-
 
507
echo
-
 
508
echo "# Number of tracing variables : ${ntrace}"
-
 
509
 
-
 
510
# ---------------------------------------------------------------------
530
# ---------------------------------------------------------------------
511
# Prepare input file for trace and run it
531
# Prepare input file for trace and run it
512
# ---------------------------------------------------------------------
532
# ---------------------------------------------------------------------
513
 
533
 
514
# Set times relative to the reference date
534
# Set times relative to the reference date
Line 560... Line 580...
560
  echo 0                                                   >> $parfile
580
  echo 0                                                   >> $parfile
561
endif
581
endif
562
echo \"${timecheck}\"                                      >> $parfile
582
echo \"${timecheck}\"                                      >> $parfile
563
echo \"${intmode}\"                                        >> $parfile
583
echo \"${intmode}\"                                        >> $parfile
564
echo ${radius}                                             >> $parfile # Bojan circle mode
584
echo ${radius}                                             >> $parfile # Bojan circle mode
-
 
585
echo ${tropo_pv}                                           >> $parfile # Bojan clustering mode
-
 
586
echo ${tropo_th}                                           >> $parfile # Bojan clustering mode
565
 
587
 
566
# Finish the preprocessor
588
# Finish the preprocessor
567
echo 
589
echo 
568
echo '       *** END OF PREPROCESSOR TRACE ***              '
590
echo '       *** END OF PREPROCESSOR TRACE ***              '
569
echo '========================================================='
591
echo '========================================================='