#!/bin/sh # # exsample_script.sh.sms ############################################################################### # DOCBLOCK # # This script does ... # # After this, additional processing is performed by the following child # # scripts : # # # # myushscript1.sh : does ... # # myushscript2.sh : does ... # # # # Remarks : # # - anything appropriate # # # # History: # # # # - First implemented into production: 01-Mar-2012 # # # ############################################################################### # --------------------------------------------------------------------------- # # keep the following 7 lines set -x cd $DATA msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" msg="Starting my SCRIPT for ..." postmsg "$jlogfile" "$msg" # # example of copying input files to your temporary working directory ($DATA) cp $FIXyourmodel/file . cp $COMIN/inputfile . # example of calling your utility scripts if [ $cyc -eq 00 -o $cyc -eq 12 ] then $USHyourmodel/myushscript1.sh else $USHyourmodel/myushscript2.sh fi # Run an executable. Use of pgm, prep_step, startmsg, err_chk, postmsg # is required. export pgm=someprogram . prep_step export XLFUNIT_11="input1" export XLFUNIT_51="output1" startmsg $EXECyourmodel/execname >> $pgmout 2>errfile export err=$?;err_chk # Example on how to call a production utility export pgm=tocgrib2 . prep_step export XLFUNIT_11="anl.grib2" export XLFUNIT_31=" " export XLFUNIT_51="grib2.t${cyc}z.awprtmar2dvaranl.227" $utilexec/tocgrib2 < $utilparm/grib2_akrtma_2dvaranl.198 >> $pgmout 2>errfile export err=$?;err_chk # # Must use $SENDCOM to copy output files from $DATA (temp working directory) # to $COMOUT. Must use $SENDDBN to indicate if output is to be alerted. # Note that $DBNROOT is set by the production environment so you don't need # to worry about it. if [ $SENDCOM = YES ] then cp output1 $COMOUT/more_descriptive_filename cp grib2.t${cyc}z.awprtmar2dvaranl.227 $pcom/. if { $SENDDBN = YES ] then # dbnet alerts go here. NCO/PMB/Dataflow and SPAs will help w/ setting this up $DBNROOT/bin/dbn_alert MODEL ALERT_TYPE $job $COMOUT/filename fi fi msg="$job completed normally" postmsg "$jlogfile" "$msg" # End of script ------------------------------------------- #