#!/bin/sh # XLFRTEOPTS="namelist=old" export XLFRTEOPTS # R_EXTVARS=no # # This pscript template requires following edit variables to be defined # /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/R25C2/2001 2001 01 01 00 72 96 # 2000 11 2880 3 1416 # ln # yes yes yes no # yes no no # r_sigit r_sigitdt r_sfc r_flx r_pgb rfcstout r_extvars r_dia r_sigit r_sigitdt r_sfc # yes no # # which should be defined in r_post.in # set -x cd /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/R25C2/2001 if [ $? -ne 0 ] ; then echo "`date` $0: cd to /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/R25C2/2001 failed" >>ERROR.out fi # list_of_files='r_sigit r_sigitdt r_sfc r_flx r_pgb rfcstout r_extvars r_dia' files_to_be_kept='r_sigit r_sigitdt r_sfc' files_to_be_averaged='' # ftp_r_sigit=yes ftp_r_sigitdt=yes ftp_r_sfc=yes ftp_r_flx=no ftp_r_pgb=yes ftp_r_fcstout=no ftp_r_extvars=no ftp_r_dia=no # variance=no variance=no # HXX=`expr 72 + 3` # # r_pgb # fh=`expr $HXX + 0` if [ $fh -lt 10 ] ; then fhc=0$fh else fhc=$fh fi while [ -s r_pgb.ft$fhc -a $fh -le 96 ] ; do fh=`expr $fh + 3` fhc=$fh done fhstart=$fh if [ $fhstart -le 96 ] ; then if [ = yes ] ; then /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/runscr/r_pgb $fhstart 96 3 || exit 8 elif [ = yes ] ; then /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/libs/etc/catpgb fi fi # # Delete used r_flx files # rc=0 for filex in $files_to_be_kept do if [ $filex = r_flx ] ; then rc=1 fi done if [ $rc -eq 0 ] ; then /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/runscr/delfile r_flx $HXX 96 3 || exit 8 fi # # r_extvars # if [ $R_EXTVARS = yes ] ; then fh=`expr $HXX + 0` if [ $fh -lt 10 ] ; then fhc=0$fh else fhc=$fh fi while [ -s r_extvars.ft$fhc -a $fh -le 96 ] ; do fh=`expr $fh + 3` fhc=$fh done fhstart=$fh if [ $fhstart -le 96 ] ; then /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/runscr/r_extvars $fhstart 96 3 || exit 8 fi fi # # Daily file archive # for file in $list_of_files do FILE=`echo $file | tr '[A-Z]' '[a-z]'` ftp=\$ftp_$FILE ftp=`eval echo $ftp` if [ $ftp = yes ] ; then if [ 72 -ne 0 ] ; then hp=`expr 72 + 3` else hp=0 fi if [ -n "" ] ; then /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/runscr/ftparch $file $hp 96 3 ln || exit 8 # # Delete ftp'ed files # rc=0 for filex in $files_to_be_averaged do if [ $filex = $file ] ; then rc=1 fi done rd=0 for filex in $files_to_be_kept do if [ $filex = $file ] ; then rd=1 fi done if [ $rc -eq 0 -a $rd -eq 0 ] ; then /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/rsm_runs/runscr/delfile \ $file \ $hp 96 3 || exit 8 fi fi fi done # # averaging # # find when to compute averages # /gpfs/research/eoas/scratch/abhardwaj/RSM25CLD2/libs/etc/incdte 2001 01 01 00 96 >incdte.out$$ || exit 8 read yyyyp mmp ddp hhp incdte.out$$ || exit 8 read yyyy mm dd hh