Subversion Repositories lagranto.ecmwf

Rev

Rev 15 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 15 Rev 19
Line 62... Line 62...
62
set flag_o     = "nil"
62
set flag_o     = "nil"
63
set flag_p     = "nil"
63
set flag_p     = "nil"
64
set changet    = 'false'
64
set changet    = 'false'
65
set noclean    = 'false'
65
set noclean    = 'false'
66
set timecheck  = 'no' 
66
set timecheck  = 'no' 
67
 
-
 
-
 
67
set isen       = 'no'
-
 
68
set modlev     = 'no'
68
 
69
 
69
while ( $#argv > 0 )
70
while ( $#argv > 0 )
70
 
71
 
71
  switch ( $argv[1] )
72
  switch ( $argv[1] )
72
 
73
 
Line 111... Line 112...
111
   case -timecheck
112
   case -timecheck
112
     set timecheck = 'yes'
113
     set timecheck = 'yes'
113
     echo "timecheck               -> yes (user defined)"
114
     echo "timecheck               -> yes (user defined)"
114
   breaksw
115
   breaksw
115
 
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
116
 
126
  
117
  endsw
127
  endsw
118
 
128
 
119
  shift;
129
  shift;
120
 
130
 
Line 347... Line 357...
347
    set datfiles=`echo $datfiles $date`
357
    set datfiles=`echo $datfiles $date`
348
  endif
358
  endif
349
  @ num --
359
  @ num --
350
end
360
end
351
 
361
 
-
 
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
   
352
# Write some status information
390
# Write some status information
353
echo "Primary file prefix            : ${charp}"
391
echo "Primary file prefix            : ${charp}"
354
echo "Secondary file prefix          : ${chars}"
392
echo "Secondary file prefix          : ${chars}"
355
echo "Time increment for input files : ${timeinc}"
393
echo "Time increment for input files : ${timeinc}"
356
echo "# input files                  : ${numfiles}"
394
echo "# input files                  : ${numfiles}"
357
echo "${charp} files availability           : 1"  
395
echo "${charp} files availability           : 1"  
358
echo "${chars} files availability           : ${sfiles}"     
396
echo "${chars} files availability           : ${sfiles}"     
359
echo "First input file               : $datfiles[1] " 
397
echo "First input file               : $datfiles[1] " 
360
echo "Last input file                : $datfiles[$numfiles] " 
398
echo "Last input file                : $datfiles[$numfiles] " 
-
 
399
if ( "${isen}" == "yes" ) then
-
 
400
    echo "TH available on S              : ${thonS} "
-
 
401
endif 
361
 
402
 
362
# ---------------------------------------------------------------------
403
# ---------------------------------------------------------------------
363
# Handle vertical wind - scaling factor
404
# Handle vertical wind - scaling factor
364
# ---------------------------------------------------------------------
405
# ---------------------------------------------------------------------
365
 
406
 
-
 
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
 
366
echo
412
echo
367
echo '---- VERTICAL WIND SCALING ------------------------------'
413
echo '---- VERTICAL WIND SCALING ------------------------------'
368
echo
414
echo
369
 
415
 
370
# Check whether OMEGA is avialbale on first file
416
# Check whether OMEGA is avialbale on first file
Line 390... Line 436...
390
endif
436
endif
391
 
437
 
392
# Write status information
438
# Write status information
393
echo "Vertical scaling factor (wfactor)  : ${wfactor}"
439
echo "Vertical scaling factor (wfactor)  : ${wfactor}"
394
 
440
 
-
 
441
next1:
-
 
442
 
395
# ---------------------------------------------------------------------
443
# ---------------------------------------------------------------------
396
# Time step and output interval
444
# Time step and output interval
397
# ---------------------------------------------------------------------
445
# ---------------------------------------------------------------------
398
 
446
 
399
echo
447
echo
Line 586... Line 634...
586
echo $dd                      >> $parfile
634
echo $dd                      >> $parfile
587
echo $hh                      >> $parfile
635
echo $hh                      >> $parfile
588
echo $min                     >> $parfile
636
echo $min                     >> $parfile
589
echo $timerange               >> $parfile
637
echo $timerange               >> $parfile
590
echo \"${timecheck}\"         >> $parfile
638
echo \"${timecheck}\"         >> $parfile
-
 
639
echo \"${isen}\" ${thonS}     >> $parfile
-
 
640
echo \"${modlev}\"            >> $parfile
591
 
641
 
592
# Finish the preprocessor
642
# Finish the preprocessor
593
echo 
643
echo 
594
echo '       *** END OF PREPROCESSOR CALTRA ***              '
644
echo '       *** END OF PREPROCESSOR CALTRA ***              '
595
echo '========================================================='
645
echo '========================================================='