#!/bin/sh set -xa export PS4='$SECONDS + ' date ############################################ # GFS GEMPAK PRODUCT GENERATION ############################################ echo echo "=============== BEGIN GEMPAK ===============" echo echo "=============== BEGIN TO SOURCE RELEVANT CONFIGS ===============" configs="base gempak" export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} for config in $configs; do . $EXPDIR/config.${config} status=$? [[ $status -ne 0 ]] && exit $status done ############################################################### echo echo "=============== BEGIN TO SOURCE MACHINE RUNTIME ENVIRONMENT ===============" . $BASE_ENV/${machine}.env gempak status=$? [[ $status -ne 0 ]] && exit $status ########################################################## # obtain unique process id (pid) and make temp directory ########################################################## export DATA=${DATA:-${DATAROOT}/${PBS_JOBNAME}.${PBS_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:-${PACKAGEROOT}/gfs.${gfs_ver}} export EXECgfs=${EXECgfs:-$HOMEgfs/exec} export PARMgfs=${PARMgfs:-$HOMEgfs/parm} export EXPDIR=${EXPDIR:-$HOMEgfs/parm/config} export FIXgempak=${FIXgempak:-$HOMEgfs/gempak/fix} export USHgempak=${USHgempak:-$HOMEgfs/gempak/ush} export SRCgfs=${SRCgfs:-$HOMEgfs/scripts} # 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} export COMPONENT=${COMPONENT:-atmos} ############################################## # Define COM directories ############################################## export COMIN=${COMIN:-$(compath.py ${envir}/${NET}/${gfs_ver})/${RUN}.${PDY}/${cyc}/$COMPONENT} export COMOUT=${COMOUT:-$(compath.py -o ${NET}/${gfs_ver}/${RUN}.${PDY})/${cyc}/$COMPONENT/gempak} export SENDCOM=${SENDCOM:-NO} export SENDDBN=${SENDDBN:-NO} export DBNROOT=${DBNROOT:-${UTILROOT}/fakedbn} if [ $SENDCOM = YES ] ; then mkdir -m 775 -p $COMOUT fi export pgmout=OUTPUT.$$ env if [ -f poescript ]; then rm -f poescript fi ################################################################# # Execute the script for the 384 hour 1 degree grib ################################################################## echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.1 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.2 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.3 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.4 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.5 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs 384 GFS_GEMPAK &> $DATA/gfs_1p0.$$.6 " >>poescript ################################################################# # Execute the script for the half-degree grib ################################################################## echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.1 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.2 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.3 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.4 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.5 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p50 384 GFS_GEMPAK &> $DATA/gfs_0p5.$$.6 " >>poescript ################################################################# # Execute the script for the quater-degree grib #################################################################### echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.1 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.2 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.3 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.4 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.5 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.6 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.7 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.8 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh gfs_0p25 384 GFS_GEMPAK &> $DATA/gfs_0p25.$$.9 " >> poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh 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_atmos_nawips.sh gfs35_pac 180 GFS_GEMPAK_WWB &> $DATA/gfs35_pac.$$.1 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh 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_atmos_nawips.sh gfs35_atl 180 GFS_GEMPAK_WWB &> $DATA/gfs35_atl.$$.1 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh 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_atmos_nawips.sh gfs40 180 GFS_GEMPAK_WWB &> $DATA/gfs40.$$.1 " >>poescript echo "time $SRCgfs/exgfs_atmos_nawips.sh 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="mpiexec -l -np $ntasks --cpu-bind verbose,core cfp" APRUN_GEMPAKCFP=${APRUN_GEMPAKCFP:-$APRUN} APRUNCFP=$(eval echo $APRUN_GEMPAKCFP) $APRUNCFP $DATA/poescript export err=$?; err_chk cat $DATA/gfs*.$$.? echo "JOB $job HAS COMPLETED NORMALLY!" ############################################ # print exec I/O output ############################################ if [ -e "$pgmout" ] ; then cat $pgmout fi ################################### # Remove temp directories ################################### if [ "$KEEPDATA" != "YES" ] ; then rm -rf $DATA fi date