Subversion Repositories lagranto.ecmwf

Rev

Rev 15 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 michaesp 1
#!/bin/csh
2
 
3
# ---------------------------------------------------------------------
4
# Usage, parameter settings
5
# ---------------------------------------------------------------------
6
 
7
# Write usage information
8
if ( (${#argv} == 0) | (${#argv} < 4) ) then
9
  echo 
10
  ${LAGRANTO}/bin/lagrantohelp caltra short 
11
  echo  
12
  exit 0
13
endif
14
 
15
# Write title
16
echo 
17
echo '========================================================='
18
echo '       *** START OF PREPROCESSOR CALTRA ***              '
19
echo
20
 
21
# Get the arguments
22
set startdate = $1
23
set enddate   = $2
24
set startf    = $3
25
set outfile   = $4
26
if ( ${#argv} > 4 ) then
27
   set flags = $5
28
else
29
   set flags=
30
endif 
31
 
32
# Set base directories (run+prog)
33
set cdfdir=${PWD}
34
set tradir=${PWD}
35
 
36
# Set program paths and filenames 
37
set parfile = ${tradir}/caltra.param 
38
 
39
# Set the prefix of the primary and secondary data files
40
set charp = 'P'
41
set chars = 'S'
42
 
43
echo '---- DIRECTORIES AND PROGRAMS ---------------------------'
44
echo    
45
echo "CDF directory         : ${cdfdir}"
46
echo "TRA directory         : ${tradir}"
47
echo "PROGRAM CALTRA        : ${LAGRANTO}/caltra/caltra"
48
echo "PARAMETER file        : ${parfile}"
49
echo
50
 
51
# ---------------------------------------------------------------------
52
# Set optional flags
53
# ---------------------------------------------------------------------
54
 
55
echo '---- OPTIONAL FLAGS -------------------------------------'
56
echo
57
 
58
# Set some default values ("nil" must be set according to input files)
59
set flag_j     = "nil"
60
set flag_i     = "nil"
61
set flag_t     = "nil"
62
set flag_o     = "nil"
63
set flag_p     = "nil"
64
set changet    = 'false'
65
set noclean    = 'false'
66
set timecheck  = 'no' 
19 michaesp 67
set isen       = 'no'
68
set modlev     = 'no'
3 michaesp 69
 
70
while ( $#argv > 0 )
71
 
72
  switch ( $argv[1] )
73
 
74
   case -j
75
     set flag_j=1
76
     echo "Flag '-j'     -> ${flag_j} (user defined)"
77
   breaksw
78
 
79
   case -i
80
     set flag_i=$argv[2]
81
     echo "Flag '-i'     -> ${flag_i} (user defined)"
82
     shift;
83
   breaksw
84
 
85
   case -t
86
     set flag_t=$argv[2]
87
     echo "Flag '-t'     -> ${flag_t} (user defined)"
88
     shift;
89
   breaksw
90
 
91
   case -o
92
     set flag_o=$argv[2]
93
     echo "Flag '-o'     -> ${flag_o} (user defined)"
94
     shift;
95
   breaksw
96
 
97
   case -p
98
     set flag_p=1
99
     echo "Flag '-p'     -> ${flag_p} (user defined)"
100
   breaksw
101
 
102
   case -changet
103
     set changet = 'true'
104
     echo "changet       -> true (user defined)"
105
   breaksw
106
 
107
   case -noclean
108
     set noclean = 'true'
109
     echo "noclean       -> true (user defined)"
110
   breaksw
111
 
112
   case -timecheck
113
     set timecheck = 'yes'
114
     echo "timecheck               -> yes (user defined)"
115
   breaksw
19 michaesp 116
 
117
   case -isen
118
     set isen = 'yes'
119
     echo "isen                    -> yes (user defined)"
120
   breaksw
121
 
122
   case -2d
123
     set modlev = 'yes'
124
     echo "2d (model level)        -> yes (user defined)"
125
   breaksw
126
 
3 michaesp 127
  endsw
128
 
129
  shift;
130
 
131
end
132
 
133
# No change of times necessary if no check requested
134
if ( "${timecheck}" == "no" ) then
135
   set  changet = 'false'
136
endif
137
 
138
# Set some defaults
139
if ( "${flag_j}"     == "nil" ) then
140
    set flag_j     = 0
141
    echo "Flag '-j'     -> 0 (default)"
142
endif
143
if ( "${flag_p}"     == "nil" ) then
144
    set flag_p     = 0
145
    echo "Flag '-p'     -> 0 (default)"
146
endif
147
 
148
# ---------------------------------------------------------------------
149
# Handle the time specifier - startdate, enddate
150
# ---------------------------------------------------------------------
151
 
152
echo
153
echo '---- TIME RANGE -----------------------------------------'
154
echo
155
 
156
# Check format of start and end date - must be the same
157
set ns=`echo $startdate | sed -e 's/_[0-9]*//' | wc -c`
158
set ne=`echo $enddate   | sed -e 's/_[0-9]*//' | wc -c`
159
if ( $ns != $ne ) then
160
  echo " ERROR: start and end date must be in the same format ***"
161
  exit 1
162
endif
163
if ( $ns != 9 ) then
164
  echo " ERROR: Date format must be yyyymmdd ***"
165
  exit 1
166
endif
167
set ns=`echo $startdate | sed -e 's/[0-9]*_//' | wc -c`
168
set ne=`echo $enddate   | sed -e 's/[0-9]*_//' | wc -c`
169
if ( $ns != $ne ) then
170
  echo " ERROR: start and end date must be in the same format ***"
171
  exit 1
172
endif
173
if ( ( $ns != 5 ) & ( $ns != 3 ) ) then
174
  echo " ERROR: Time format must be hh(mm) ***"
175
  exit 1
176
endif
177
 
178
# Split the start and end date into <yymmdd_hh and mm>
179
set startdate_ymdh = `echo $startdate | cut -c 1-11`
180
set startdate_min  = `echo $startdate | cut -c 12-13`
181
if ( $startdate_min == "" ) set startdate_min = 00
182
 
183
set enddate_ymdh = `echo $enddate | cut -c 1-11`
184
set enddate_min  = `echo $enddate | cut -c 12-13`
185
if ( $enddate_min == "" ) set enddate_min = 00
186
 
187
# Get the time difference between <start_ymdh> and <end_ymdh> date
188
# Decide whether trajectoriesare forward or backward
189
set timediff_hh = `${LAGRANTO}/goodies/gettidiff ${enddate_ymdh} ${startdate_ymdh}`
190
 
191
if ( $timediff_hh == 0 ) then
192
  if ( $enddate_min > $startdate_min ) then
193
    set direction = f
194
    set idir      = 1
195
  else
196
    set direction = b
197
    set idir      = -1
198
  endif
199
else if ( $timediff_hh > 0 ) then
200
  set direction = f
201
  set idir      = 1
202
else
203
  set direction = b
204
  set idir      = -1
205
  @ timediff_hh = $idir * $timediff_hh
206
endif
207
 
208
# Get also minutes for time difference, if <start_min> or <end_min> != 0
209
set timediff_mm=
210
 
211
if ( $startdate_min != 00 || $enddate_min != 00 ) then
212
  @ min = ( $enddate_min - $startdate_min )
213
  if ( $min == 0 ) then
214
    set timediff_mm=
215
  else if ( $min > 0 ) then
216
    if ( $idir == 1 ) then
217
      set timediff_mm=$min
218
    else
219
      @ timediff_hh --
220
      @ timediff_mm = 60 - $min
221
    endif
222
  else
223
    if ( $idir == 1 ) then
224
      @ timediff_hh --
225
      @ timediff_mm = 60 + $min
226
    else
227
      @ timediff_mm = 0 - $min
228
    endif
229
  endif
230
endif
231
 
232
# Set the reference date equal to the satrtdate
233
set refdate=${startdate}
234
 
235
# Write status information
236
echo "Time range      : ${startdate} -> ${enddate}"
237
if ( ${timediff_mm} !=  "" ) then
238
   echo "Time difference : ${timediff_hh} h ${timediff_mm} min"
239
else
240
   echo "Time difference : ${timediff_hh} h"
241
endif
242
echo "Direction       : ${direction} (${idir})"
243
echo "Reference date  : ${refdate}"
244
 
245
# ---------------------------------------------------------------------
246
# Check availability of input data 
247
# ---------------------------------------------------------------------
248
 
249
echo
250
echo '---- INPUT FILES ----------------------------------------'
251
echo
252
 
253
# Take the time increment from flag list ('nil', if not defined)
254
set timeinc = ${flag_i}
255
 
256
# Find a first data file (if possible corresponding to start/end date
257
# If starttime is not a data time, take the first file in the direectory
258
if ( $direction == "f" ) then
259
  set file=${charp}${startdate_ymdh}
260
else
261
  set file=${charp}${enddate_ymdh}
262
endif
263
if ( ! -f $file ) then
264
  set file=`ls ${charp}[0-9_]*[0-9] | head -1 | sed -e 's/@//'`
265
endif
266
 
267
# Determine timeinc (the time difference in hours between two data file)
268
# if not already defined with option -i
269
if ( ${timeinc} == "nil" ) then
270
  set date1=`echo $file | cut -c 2-12`
271
  set n=`ls ${charp}[0-9_]*[0-9] | grep -n $date1 | awk -F: '{print $1}'`
272
  @ n ++
273
  set date2=`ls ${charp}[0-9_]*[0-9] | head -$n | tail -1 | cut -c 2-12`
274
  set timeinc=`${LAGRANTO}/goodies/gettidiff $date2 $date1`
275
endif
276
if ( $timeinc == 0 ) then
277
    echo " ERROR: cannot set the time increment between input files ***"
278
    exit 1
279
endif
280
 
281
# Search the first file to use: We step through all P files and see whether they are
282
# good P files. Let's first do the test for the first data file found. If it's ok, we 
283
# take it; if not, we step through all P files and find the good one  
284
set flag=0
285
set td=
286
 
287
set date = `echo $file | cut -c 2-12`
288
set td1  = `${LAGRANTO}/goodies/gettidiff ${startdate_ymdh} ${date}`
289
set td2  = `${LAGRANTO}/goodies/gettidiff ${enddate_ymdh}   ${date}`
290
 
291
if (( $td1 < $timeinc || $td2 < $timeinc ) && ( $td1 >= 0 || $td2 >= 0 )) then
292
   set datfiles=$date
293
   if ( $td1 < $timeinc    ) set td=$td1
294
   if ( $td2 < $timeinc    ) set td=$td2
295
   if ( ( $startdate_min > 0 ) || ( $enddate_min > 0 ) ) @ td ++
296
   goto label2      
297
endif
298
 
299
foreach i ( ${charp}????????_?? )
300
 
301
  set date = `echo $i | cut -c 2-12`
302
  set td1  = `${LAGRANTO}/goodies/gettidiff ${startdate_ymdh} ${date}`
303
  set td2  = `${LAGRANTO}/goodies/gettidiff ${enddate_ymdh}   ${date}`
304
  if (( $td1 < $timeinc || $td2 < $timeinc ) && ( $td1 >= 0 || $td2 >= 0 )) then
305
     set datfiles=$date
306
     if ( $td1 < $timeinc    ) set td=$td1
307
     if ( $td2 < $timeinc    ) set td=$td2
308
     if ( ( $startdate_min > 0 ) || ( $enddate_min > 0 ) ) @ td ++
309
     goto label2      
310
  endif
311
 
312
end
313
 
314
# if no P/T-files are available for the specified time period, then $td is
315
# still undefined
316
if ( $td == "" ) then
317
  echo " ERROR: no data files available for the specified time period"
318
  exit 1
319
endif
320
 
321
# Everything is fine so far: proceed
322
label2:
323
 
324
# Check whether first date is ok - before or at needed dates
325
if ( $direction == "f" ) then
326
  set tdiff0 = `${LAGRANTO}/goodies/gettidiff ${startdate_ymdh} ${date}`
327
else
328
  set tdiff0 = `${LAGRANTO}/goodies/gettidiff ${enddate_ymdh} ${date}`
329
endif
330
  if ( $tdiff0 < 0 ) then
331
  echo " ERROR: data files missing for the specified time period"
332
  exit 1
333
endif
334
 
335
# Calculate the number of further files
336
@ num = ( $timediff_hh + $td ) / $timeinc + 1
337
@ dum1 = ( $num - 1 ) * $timeinc
338
@ dum2 = $timediff_hh + $td
339
if ( $dum1 != $dum2 ) @ num ++
340
 
341
# Get a list of all needed files
342
set numfiles=$num
343
set sfiles=1
344
echo $datfiles
345
while ( $num > 1 )
346
  set date=`${LAGRANTO}/goodies/newtime $date $timeinc`
347
 
348
  echo $date
349
 
350
  if ( ! -f ${charp}${date} ) then
351
    echo " ERROR: file with primary data is missing for $date"
352
    exit 1
353
  else if ( ! -f ${chars}${date} ) then
354
    set sfiles=0
355
    set datfiles=`echo $datfiles $date`
356
  else
357
    set datfiles=`echo $datfiles $date`
358
  endif
359
  @ num --
360
end
361
 
19 michaesp 362
# Special handling for isentropic trajectories - check whether TH can be read from S files
363
set thonS = 1
364
if ( "${isen}" == "yes" ) then  
365
   foreach date ( ${datfiles} )
366
      if ( -f ${chars}${date} ) then
367
         set ok = `${LAGRANTO}/goodies/getvars ${chars}${date} | grep TH` 
368
         if ( "${ok}" == "" ) set thonS = 0
369
      else
370
         set thonS = 0
371
      endif
372
   end
373
endif
374
 
375
# Special handling for 2d trajectories - check whether P,PS are available
376
if ( "${modlev}" == "yes" ) then  
377
   set flonp = 1
378
   foreach date ( ${datfiles} )
379
       set ok = `${LAGRANTO}/goodies/getvars ${charp}${date} | grep P` 
380
       if ( "${ok}" == "" ) set flonp = 0
381
       set ok = `${LAGRANTO}/goodies/getvars ${charp}${date} | grep PS` 
382
       if ( "${ok}" == "" ) set flonp = 0
383
   end
384
   if ( ${flonp} == 0 ) then
385
      echo ' ERROR: P and PS must be available on P files for 2D mode'
386
      exit 1
387
   endif
388
endif
389
 
3 michaesp 390
# Write some status information
391
echo "Primary file prefix            : ${charp}"
392
echo "Secondary file prefix          : ${chars}"
393
echo "Time increment for input files : ${timeinc}"
394
echo "# input files                  : ${numfiles}"
395
echo "${charp} files availability           : 1"  
396
echo "${chars} files availability           : ${sfiles}"     
397
echo "First input file               : $datfiles[1] " 
398
echo "Last input file                : $datfiles[$numfiles] " 
19 michaesp 399
if ( "${isen}" == "yes" ) then
400
    echo "TH available on S              : ${thonS} "
401
endif 
3 michaesp 402
 
403
# ---------------------------------------------------------------------
404
# Handle vertical wind - scaling factor
405
# ---------------------------------------------------------------------
406
 
19 michaesp 407
# No vertical wind scaling is needed for isentropic and 2d trajectories
408
set wfactor = 1
409
if ( "${isen}"   == "yes" ) goto next1
410
if ( "${modlev}" == "yes" ) goto next1
411
 
3 michaesp 412
echo
413
echo '---- VERTICAL WIND SCALING ------------------------------'
414
echo
415
 
416
# Check whether OMEGA is avialbale on first file
417
set first=$datfiles[1]
418
set file="${charp}${first}"
419
set omflag=`${LAGRANTO}/goodies/getvars $file | grep " OMEGA " | wc -l`
420
if ( $omflag != 1 ) then
421
   echo " ERROR: variable OMEGA is not on file $file"
422
   exit 1
423
endif
424
 
425
# Get the maximum and minimum wind on 850 hPa and decide the <wfactor>
426
set wmin  = `${LAGRANTO}/goodies/getmima $file OMEGA P850 | awk '{print $1}'`
427
set wmax  = `${LAGRANTO}/goodies/getmima $file OMEGA P850 | awk '{print $2}'`
428
set wmin  = `echo $wmin | sed -e 's/\.//'`
429
set wmax  = `echo $wmax | sed -e 's/\.//'`
430
set wdiff = `echo $wmax - $wmin | bc`
431
 
432
if ( $wdiff > 400 ) then
433
    set wfactor=1.
434
else
435
    set wfactor=100.
436
endif
437
 
438
# Write status information
439
echo "Vertical scaling factor (wfactor)  : ${wfactor}"
440
 
19 michaesp 441
next1:
442
 
3 michaesp 443
# ---------------------------------------------------------------------
444
# Time step and output interval
445
# ---------------------------------------------------------------------
446
 
447
echo
448
echo '---- TIME STEPS -----------------------------------------'
449
echo
450
 
451
# Take the time step and output step from flag list ('nil', if not defined)
452
set timestep = ${flag_t}
453
set deltout  = ${flag_o}
454
 
455
# Calculate the time step
456
if ( $timestep == "nil" ) @ timestep = ( 60 * $timeinc ) / 12
457
 
458
# Take the output interval from time increment
459
if ( $deltout == "nil" ) @ deltout = 60 * ${timeinc}
460
 
461
# Check whether the timestep is an integer ratio of deltout
462
@ flag = $deltout / $timestep
463
@ flag = $deltout - ( $flag * $timestep )
464
if ( $flag != 0 ) then
465
  echo " ERROR: output time interval should be multiple of timestep"
466
  echo 
467
  echo "           $deltout min  : output time interval"
468
  echo "           $timestep min  : time step"
469
  exit 1
470
endif
471
 
472
# Calculate the start and the end time relative to the first datfile
473
if ( $direction == f ) then
474
  set tstart = `${LAGRANTO}/goodies/gettidiff $startdate $datfiles[1]`
475
  set tend   = `${LAGRANTO}/goodies/gettidiff $datfiles[$numfiles] $enddate`
476
else
477
  set tstart = `${LAGRANTO}/goodies/gettidiff $datfiles[$numfiles] $startdate`
478
  set tend   = `${LAGRANTO}/goodies/gettidiff $enddate $datfiles[1]`
479
endif
480
 
481
# Check whether tstart and tend are a multiple of the output time interval
482
if ( $tstart != 0 ) then
483
  if ( `echo $tstart | grep "\."` != "" ) then
484
    set dum=`echo $tstart | sed -e 's/[-0-9]*\.//'`
485
    @ flag = $dum / $deltout
486
    @ flag = $dum - ( $flag * $deltout )
487
    if ( $flag != 0 ) then
488
      echo " ERROR : the start time should be shifted relative to the first"
489
      echo "         datafile by a multiple of the output time interval"
490
      echo "         hint:  set the latter with the option -o"
491
      exit 1
492
    endif
493
  endif
494
endif
495
if ( `echo $tend | grep "\."` != "" ) then
496
  set dum=`echo $tend | sed -e 's/[-0-9]*\.//'`
497
  @ flag = $dum / $deltout
498
  @ flag = $dum - ( $flag * $deltout )
499
  if ( $flag != 0 ) then
500
    echo " ERROR : the end time should be shifted relative to the first"
501
    echo "         datafile by a multiple of the output time interval"
502
    echo "         hint:  set the latter with the option -o"
503
    exit 1
504
  endif
505
endif
506
 
507
# Write status information
508
echo "Trajectory calculation time step [min] : ${timestep}"
509
echo "Output time step [min]                 : ${deltout}"
510
if ( $direction == f ) then
511
  echo "Start time relative to first file      : $datfiles[1] + ${tstart} "
512
  echo "End time relative to first file        : $datfiles[$numfiles] - ${tend} "  
513
else
514
  echo "Start time relative to first file      : $datfiles[$numfiles] - ${tstart} "
515
  echo "End time relative to last file         : $datfiles[1] + ${tend} "
516
endif
517
 
518
# ---------------------------------------------------------------------
519
# Start file
520
# ---------------------------------------------------------------------
521
 
522
echo
523
echo '---- START FILE -----------------------------------------'
524
echo
525
 
526
# Check if start file is available
527
if ( ! -f ${startf} ) then
528
   echo " ERROR : start file ${startf} is missing"
529
   exit 1
530
endif
531
 
532
# Decide whether startfile has an explicit format specifier
533
set format = "0"
534
foreach app ( 1 2 3 4 5 6 7 8 9 )
5 michaesp 535
  set flag = `echo ${startf} | grep "\.${app}"`
3 michaesp 536
  if ( "${flag}" != "" ) set format = "${app}"
537
end
538
 
539
# If format is 0, it might nevertheless be a hidden format 1
540
if ( "${format}" == "0" ) then
541
    set ncol = `awk "{print NF}" ${startf} | tail -1` 
542
    if ( "${ncol}" != "3" ) then
543
        set format = "1"
544
        echo " WARNING: ${startf} is a hidden trajectory file of format 1"
545
        echo "          it will be renamed: ${startf} -> ${startf}.1"
546
        echo
547
        ln -sf ${startf} ${startf}.1
548
        set startf = "${startf}.1"
549
    endif
550
endif
551
 
552
# Get the number of trajectories
553
if ( "${format}" == "0" ) then
554
   set ntra = `wc -l ${startf} | awk '{print $1}' `
555
   set ncol = 3
556
else
557
   set ntra = `${LAGRANTO}/goodies/trainfo.sh ${startf} ntra`
558
   set ncol = `${LAGRANTO}/goodies/trainfo.sh ${startf} ncol`
559
   set ntim = `${LAGRANTO}/goodies/trainfo.sh ${startf} ntim`
560
 
561
   if ( "${ntim}" != "1" ) then
15 michaesp 562
      echo " ERROR: starting trajectory file must only have one time... Stop (${ntim})"
3 michaesp 563
      exit 1
564
   endif
565
 
566
endif
567
 
568
# Write status information
569
echo "Start file                  : ${startf} "
570
if ( "${format}" == "0" ) then 
571
   echo "Format                      : (lon,lat,p) list"
572
else
573
   echo "Format                      : trajectory file (${format})"
574
endif
575
echo "# coordinates (lon,lat,lev) : ${ntra} "  
576
echo "# columns                   : ${ncol} "  
577
 
578
# ---------------------------------------------------------------------
579
# Prepare input file for caltra and run it
580
# ---------------------------------------------------------------------
581
 
582
# Set times relative to the reference date
583
if ( "${changet}" == "true" ) then
584
 echo
585
 echo '---- CHANGE TIMES ON DATA FILES  ------------------------'
586
 echo   
587
 foreach i ( $datfiles )
588
   ${LAGRANTO}/goodies/changet.sh ${refdate} ${charp}${i}
589
 end
590
 if ( ${sfiles} == 1 ) then
591
   foreach i ( $datfiles )
592
     ${LAGRANTO}/goodies/changet.sh ${refdate} ${chars}${i}
593
   end
594
 endif
595
endif
596
 
597
# Split the reference date
598
set yyyy=`echo ${refdate}   | cut -c 1-4` 
599
set   mm=`echo ${refdate}   | cut -c 5-6` 
600
set   dd=`echo ${refdate}   | cut -c 7-8` 
601
set   hh=`echo ${refdate}   | cut -c 10-11` 
602
set  min=`echo ${refdate}00 | cut -c 12-13` 
603
 
604
# Get the total tiem range
605
if ( ${timediff_mm} != '' ) then
606
   @ timerange = 60 * ${timediff_hh} + ${timediff_mm}
607
else
608
   @ timerange = 60 * ${timediff_hh}
609
endif
610
 
611
# Write parameter file
612
\rm -f ${parfile}
613
touch ${parfile}
614
 
615
\echo $idir                   >> $parfile
616
echo $numfiles                >> $parfile
617
foreach i ( $datfiles )
618
  echo $i                     >> $parfile
619
end
620
echo $timeinc                 >> $parfile
621
echo $flag_p                  >> $parfile
622
echo \"${startf}\"            >> $parfile
623
echo ${ntra}                  >> $parfile
624
echo ${ncol}                  >> $parfile
625
echo \"${outfile}\"           >> $parfile
626
echo $timestep                >> $parfile
627
echo $tstart                  >> $parfile
628
echo $tend                    >> $parfile
629
echo $deltout                 >> $parfile
630
echo $flag_j                  >> $parfile
631
echo $wfactor                 >> $parfile
632
echo $yyyy                    >> $parfile
633
echo $mm                      >> $parfile
634
echo $dd                      >> $parfile
635
echo $hh                      >> $parfile
636
echo $min                     >> $parfile
637
echo $timerange               >> $parfile
638
echo \"${timecheck}\"         >> $parfile
19 michaesp 639
echo \"${isen}\" ${thonS}     >> $parfile
640
echo \"${modlev}\"            >> $parfile
3 michaesp 641
 
642
# Finish the preprocessor
643
echo 
644
echo '       *** END OF PREPROCESSOR CALTRA ***              '
645
echo '========================================================='
646
echo
647
 
648
# Run caltra
649
${LAGRANTO}/caltra/caltra
650
 
651
if ( "${status}" != "0" ) then
652
  echo "ERROR:  Program <caltra> failed"
653
  exit 1
654
endif
655
 
656
# ----------------------------------------------------------
657
# Final tasks (make clean)
658
# ----------------------------------------------------------
659
 
660
finish:
661
 
662
if ( "${noclean}" == "false" ) then
663
  \rm -f ${parfile}
664
 endif
665
 
666
exit 0 
667