#!/usr/bin/env bash ######################################## # CFS AWIPS PRODUCT GENERATION ######################################## set -xa # ################################### # SET SHELL PROCESSING VARIABLES # ################################### export PS4='$SECONDS + ' date export OMP_NUM_THREADS=${OMP_NUM_THREADS:-1} ########################################################## export DATA=${DATA:-${DATAROOT:?}/${jobid:?}} mkdir -p $DATA cd $DATA #################################### # Determine Job Output Name on System #################################### export pgmout="OUTPUT.$$" export cycle=t${cyc}z ################################# # Set up the NET and RUN ################################# export NET=cfs export RUN=cfs ################################### # Run setpdy and initialize PDY variables ################################### sh setpdy.sh . ./PDY # Input file size to check, usually file size with full records is around 38000KB to 49000KB export MINIMUM_SIZE=30000 cfs_day=$PDY # Check for the latest data to use #if [ $cyc -eq 00 -o $cyc -eq 12 ]; then # cfs_day=$PDY #else # cfs_day=$PDYm1 #fi ########################################################## # define cfs directories/scripts/executables ########################################################## export EXECcfs=$HOMEcfs/exec export PARMcfs=$HOMEcfs/parm export USHcfs=$HOMEcfs/ush export FIXcfs=$HOMEcfs/fix ######################################## # Set up the com directory ######################################## export COMROT=$(compath.py -o ${NET}/${cfs_ver}) export COMIN=$(compath.py -o ${NET}/${cfs_ver}/${RUN}.${cfs_day}) export COMOUT=$(compath.py -o ${NET}/${cfs_ver}/${RUN}.${cfs_day}) export COMINm1=$(compath.py -o ${NET}/${cfs_ver}/${RUN}.${PDYm1}) export COMOUTwmo=${COMOUTwmo:-$COMOUT/wmo} mkdir -m755 -p $COMOUT $COMOUTwmo env ######################################## # Run the script ######################################## $HOMEcfs/scripts/excfs_grib_awips.sh export err=$?;err_chk ######################################## # Remove the Temporary working directory ######################################## cd $DATAROOT if [ ${KEEPDATA:-NO} = NO ] ; then rm -rf $DATA ; fi date