#!/bin/ksh set -ax #------------------------------------------------------------------------------ # # NAME: tclip_run.ksh # # LANGUAGE: K-shell # # PURPOSE: End to end processing of the TCLIPER model # # DESCRIPTION: Primary script used to drive the TCLIP Intensity model # processing. # # INFORMATION: # National Hurricane Center / Tropical Prediction Center # Department of Commerce - NOAA / NWS # # CATEGORY: Statistical Model # # CALLING SEQUENCE: tclip_run.ksh CCYYYY.com # # INPUTS: # CCYYYY.com <-- computes CARQs # # OUTPUTS: tcliper.dat - TCLIPER forecast in A-deck format # tcliper.log - TCLIPER log file # # EXTERNAL: # # SIDE EFFECTS: Unknown # # RESTRICTIONS: # # EXAMPLE or USAGE: tclip_run.ksh al152013.com # # OTHER NOTES: None # # MODIFICATION HISTORY: # Written by: M. DeMaria 05-DEC-2016 (NOAA-NHC) # #----------------------------------------------------------------------------- #... DEFINE PATHS ... #-------------------- # note - user should define these paths # # common path #commonp="/nhc/save/guidance/prgms" ### need to move to j-job script ? commonp="${HOMEnhcg}" # # Specify name of directory containing executables xdir=${commonp}"/exec/" # Specify name of directory containing static data files #ydir=${commonp}"/coefs/" ydir=${commonp}"/parm/" # # Log directory #ldir="/nhc/save/guidance/storm-data/log/" ldir="${WORK_DIR}/storm-data/log/${stormid}/" #ldir="/nhc/save/guidance/prgms/test/ocd5/" mkdir -p -m 775 $ldir #--------------------------------------- #... EXPORT ENV for COEFS/DATA files ... #--------------------------------------- # # Coefs and Data files ... #export SHIPS_COEF="/nhc/save/guidance/prgms/coefs/" export SHIPS_COEF="${HOMEnhcg}/parm/" #------------ #... LOGS ... #------------ # # Set LOG equal to the storm ID LOG="TCLIPER-"`echo ${1##/*/} | sed -e 's/\.com//'` LOG=${ldir}${LOG}.`date +"%Y%m%d.%H%M"`".log" # ----------------------------------------------------------- # BEGIN SHIPS PREP : Track, Grib and Input Deck Creation # ----------------------------------------------------------- echo "-------------------------------------------------------" > $LOG echo " ***** TCLIPER RUN STARTED ***** " >> $LOG echo "-------------------------------------------------------">> $LOG echo "start time: "`date +"%Y/%m/%d %T %Z doy=(%y%j)"` >> $LOG echo "" >> $LOG # # Create the ocd5.com input file for the model run rm -f tcliper.com sleep 1 cabname=${1} # diagnostic info echo "[${cabname}] [${1}]" >> $LOG hostname >> $LOG cp -f $cabname tcliper.com >> $LOG 2>&1 echo "" >> $LOG echo "***** COM FILE *****" >> $LOG echo "-------------------------------------------------------" >> $LOG echo " [${cabname}] " >> $LOG cat tcliper.com >> $LOG echo "-------------------------------------------------------" >> $LOG echo "" >> $LOG # # Check to make sure tcliper.com file is not empty if [ ! -s tcliper.com ]; then echo "*** ERROR: tcliper.com file is empty, halt tcliper processing." \ >> $LOG exit 1 fi echo " " >> $LOG echo "---- Running the TCLIPER fortran code ----" >> $LOG rm -f tcliper.dat rm -f tcliper.log export pgm=tcliper.x prep_step startmsg ${xdir}"tcliper.x" >> $LOG export err=$?; err_chk; # echo "" >> $LOG echo "---- tcliper.x log file ----" >> $LOG cat tcliper.log >> $LOG # echo "" >> $LOG echo "---- tcliper.x output file for ATCF----" >> $LOG cat tcliper.dat >> $LOG # --- Perform Cleanup --- # Clean up after ships model run rm -f tcliper.inp rm -f tcliper.com rm -f tcliper.log echo "" >> $LOG echo "-------------------------------------------------------" >> $LOG echo " ***** TCLIPER RUN COMPLETED *****" >> $LOG echo "-------------------------------------------------------" >> $LOG echo "end time: "`date +"%Y/%m/%d %T %Z doy=(%y%j)"` >> $LOG echo "" >> $LOG # compress $LOG #gzip $LOG # --- End of Model Run --- # # exit with success stat exit 0 #