Subversion Repositories lagranto.wrf

Rev

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

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