#!/bin/sh set -xa export PS4='$SECONDS + ' date ############################################ # GFS GEMPAK PRODUCT GENERATION ############################################ ########################################################## # obtain unique process id (pid) and make temp directory ########################################################## export DATA=${DATA:-${DATAROOT}/${jobid:?}} mkdir -p $DATA cd $DATA ###################################### # Set up the cycle variable ###################################### export cycle=${cycle:-t${cyc}z} ########################################### # Run setpdy and initialize PDY variables ########################################### setpdy.sh . PDY ################################ # Set up the HOME directory ################################ export HOMEgfs=${HOMEgfs:-${NWROOT}/gfs.${gfs_ver}} export EXECgfs=${EXECgfs:-$HOMEgfs/exec} export PARMgfs=${PARMgfs:-$HOMEgfs/parm} export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} export FIXgfs=${FIXgfs:-$HOMEgfs/gempak/fix} export USHgfs=${USHgfs:-$HOMEgfs/gempak/ush} export SRCgfs=${SRCgfs:-$HOMEgfs/scripts} ###################################### # Set up the GEMPAK directory ####################################### export HOMEgempak=${HOMEgempak:-${NWROOTp1}/gempak} export FIXgempak=${FIXgempak:-$HOMEgempak/fix} export USHgempak=${USHgempak:-$HOMEgempak/ush} # For half-degree P Grib files export DO_HD_PGRB=${DO_HD_PGRB:-YES} ############################################ # Set up model and cycle specific variables ############################################ export finc=${finc:-3} export fstart=${fstart:-0} export model=${model:-gfs} export GRIB=${GRIB:-pgrb2f} export EXT="" export DBN_ALERT_TYPE=${DBN_ALERT_TYPE:-GFS_GEMPAK} ################################### # Specify NET and RUN Name and model #################################### export NET=${NET:-gfs} export RUN=${RUN:-gfs} export model=${model:-gfs} ############################################## # Define COM directories ############################################## export COMIN=${COMIN:-$(compath.py ${NET}/${envir}/${RUN}.${PDY})/${cyc}} export COMOUT=${COMOUT:-${COMROOT}/${NET}/${envir}/${RUN}.${PDY}/${cyc}/gempak} if [ $SENDCOM = YES ] ; then mkdir -m 775 -p $COMOUT fi export pgmout=OUTPUT.$$ env rm -f poescript ################################################################# # Execute the script for the 384 hour 1 degree grib ################################################################## echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.1 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.2 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.3 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.4 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.5 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.6 " >>poescript ################################################################# # Execute the script for the half-degree grib ################################################################## echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.1 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.2 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.3 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.4 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.5 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.6 " >>poescript ################################################################# # Execute the script for the quater-degree grib #################################################################### echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.1 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.2 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.3 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.4 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.5 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.6 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.7 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.8 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.9 " >> poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.10 " >> poescript #################################################################### # Execute the script to create the 35km Pacific grids for OPC ##################################################################### echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs35_pac 180 GFS_GEMPAK_WWB &> $DATA/gfs35_pac.$$.1 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs35_pac 180 GFS_GEMPAK_WWB &> $DATA/gfs35_pac.$$.2 " >>poescript #################################################################### # Execute the script to create the 35km Atlantic grids for OPC ##################################################################### echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs35_atl 180 GFS_GEMPAK_WWB &> $DATA/gfs35_atl.$$.1 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs35_atl 180 GFS_GEMPAK_WWB &> $DATA/gfs35_atl.$$.2 " >>poescript ##################################################################### # Execute the script to create the 40km grids for HPC ###################################################################### echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs40 180 GFS_GEMPAK_WWB &> $DATA/gfs40.$$.1 " >>poescript echo "time $SRCgfs/exgfs_nawips.sh.ecf gfs40 180 GFS_GEMPAK_WWB &> $DATA/gfs40.$$.2 " >>poescript cat poescript chmod 775 $DATA/poescript export MP_PGMMODEL=mpmd export MP_CMDFILE=$DATA/poescript ntasks=${NTASKS_GEMPAK:-$(cat $DATA/poescript | wc -l)} ptile=${PTILE_GEMPAK:-4} threads=${NTHREADS_GEMPAK:-1} export OMP_NUM_THREADS=$threads APRUN="mpirun -n $ntasks cfp " APRUN_GEMPAKCFP=${APRUN_GEMPAKCFP:-$APRUN} APRUNCFP=$(eval echo $APRUN_GEMPAKCFP) $APRUNCFP $DATA/poescript export err=$?; err_chk cat $DATA/gfs*.$$.? msg="JOB $job HAS COMPLETED NORMALLY!" postmsg $jlogfile "$msg" ############################################ # print exec I/O output ############################################ if [ -e "$pgmout" ] ; then cat $pgmout fi ################################### # Remove temp directories ################################### if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi date