#!/bin/sh #set -x USAGE="usage: osoafos pil infile mach dir test" #VERS="version: ${USHutil}/osoafos 2000-03-21 06:35L " #in production $USHutil}=/nwprod/util/ush/ # #___________________________________________________________________________ # NAME : osoafos # Author : Peter Henrichsen # Purpose : The osoafos is the parent script for contoawp.sh . # : osoafos sets up and exports the files, scripts and # : directories needed by contoawp.sh. Then it llsubmit's a job # : to run the contoawp.sh script which converts the two AFOS # : graphics, 90s & 90r, radar summary charts from utf format # : into AWIPS redbook format. # # History : 1999-07-12 Peter Henrichsen convert to run on IMB SP. # : 1999-12-02 Peter Henrichsen modified to use USHutil. # : 2000-03-21 Peter Henrichsen modified so that # dbnet can run the script. # # # Location : This script is found on hp36 as: # : /tmp_mnt/export/sgi73/peterhen/util/scripts/ibm/osoafos # : & on ncosp as # : /nwprod/util/ush/osoafos or # : /nfsuser/g02/wx12ph/util/ush/osoafos # # # Argumemts: 'pil' this is the AFOS pil number to convert. # : 'infile' is the input AFOS utf file (fullpath). # : The 3rd arg is optional, if missing the default is oso. # : 'mach' is the name of the machine where the AFOS utf # : file was created. # : The 4th & 5th args are optional "dir" & "test" are used in # : testing. # : Arg 4 is the test base dir for the fix, ush, sorc & exec. # ie /nfsuser/g02/wx12ph or /nwtest. # : Arg5 is used to send in test mode if it is "send". # # #___________________________________________________________________________ # integer istat set -x export PATH=${PATH}:. # export child script name. export MEMBER=contoawp.sh #___________________________________________________________________________ # get varables to exportation to child scripts $MEMBER . #___________________________________________________________________________ export NAME="$1" export INFILE="$2" export MACH="$3" export USR="$3" export whatdir=fnafos if test $# -ge 4 then envir=test export homedir="$4" export HOMEutil=$homedir comout=$HOMEutil/com/foreign/$envir export HOMEout=/tmpuser/$LOGNAME pcom=$HOMEutil/pcom/foreign if test $# -eq 5 then what="$5" if test "$what" = 'send' then envir=prod SENDCOM=YES SENDDBN=YES else envir=test SENDCOM=NO SENDDBN=NO fi fi else envir=prod SENDCOM=YES SENDDBN=YES who=$LOGNAME if test "$who" = 'dbnprd' then export HOMEout=/tmpnwprd/dbnprd else export HOMEout=/tmpuser/dbnprd fi export HOMEutil=/nwprod comout=/com/foreign/$envir pcom=/pcom/foreign fi # # ######################################## # Set up this job's temporary directory to # store processing files. # ######################################## export DATA=$HOMEout/$whatdir.$$ mkdir -m 775 -p $DATA >/dev/null 2>&1 export FIXutil=$HOMEutil/util/fix export EXECutil=$HOMEutil/util/exec export USHutil=$HOMEutil/util/ush export utilities=$HOMEutil/util/ush export envir SENDCOM SENDDBN mkdir -m 775 -p $pcom >/dev/null 2>&1 mkdir -m 775 -p $comout >/dev/null 2>&1 cd $DATA echo " set the CYCLE" CYCLE=t00z cycle=$CYCLE export CYCLE cycle # run setup to initialize working directory and utility scripts export utilexec=/nwprod/util/exec export utilscript=/nwprod/util/ush # Run setup to initialize working directory and utility scripts sh $utilscript/setup.sh # Run setpdy and initialize PDY variables sh $utilscript/setpdy.sh . ./PDY job=FN$MACH jlogfile=/com/logs/snd2forgn_log export pid=$$ export reqid=${$} export pgmout=$job.$NAME.$pid jobid="${job}.o${reqid}" model=man export output=output.$job.$NAME.$pid export comout envir jlogfile jobid model pcom job # _______________________________________________________________________ # start the $MEMBER # _______________________________________________________________________ $USHutil/$MEMBER>>$DATA/$pgmout 1>>$DATA/$pgmout 2>>$DATA/$pgmout cd rm -rf $DATA exit