#!/bin/bash # ----------------------------------------------------------- # UNIX Shell Script File # Tested Operating System(s): RHEL 5,6 # Tested Run Level(s): 3, 5 # Shell Used: BASH shell # Original Author(s): Roberto Padilla-Hernandez # File Creation Date: 02/01/2015 # Date Last Modified: # # Version control: 1.14 # # Support Team: # # Contributors: Floyd fayton # # ----------------------------------------------------------- # ------------- Program Description and Details ------------- # ----------------------------------------------------------- # # Job Card to set the resources required for a NWPS run # # ----------------------------------------------------------- #PBS -N %WFO%_fc_c1r #PBS -j oe #PBS -S /bin/bash #PBS -q dev #PBS -A NWPS-DEV #PBS -l walltime=04:15:00 #PBS -l place=vscatter,select=2:ncpus=72:mpiprocs=72:ompthreads=1:mem=230GB #PBS -l debug=true #PBS -V #PBS -o /lfs/h2/emc/ptmp/ali.salimi/com/retro/nwps/v1.4.9/NWPS_%WFO%_forecast_cg1.o #PBS -e /lfs/h2/emc/ptmp/ali.salimi/com/retro/nwps/v1.4.9/NWPS_%WFO%_forecast_cg1.o cd $PBS_O_WORKDIR # Setup and load modules export HOMEnwps=${NWPSdir} VERSION_FILE=${HOMEnwps}/versions/run.ver if [ -f $VERSION_FILE ]; then . $VERSION_FILE else ECFNAME="jnwps_prep.ecf" echo "***JOB ${ECFNAME} ERROR: Version File $VERSION_FILE does not exist ***" exit fi module purge module load envvar/${envvar_ver} module load prod_envir/${prod_envir_ver} module load prod_util/${prod_util_ver} module load PrgEnv-intel/${PrgEnv_intel_ver} module load craype/${craype_ver} module load intel/${inter_ver} module load cray-pals/${cray_pals_ver} module load cray-mpich/${cray_mpich_ver} module load wgrib2/${wgrib2_ver} #module load hdf5/${hdf5_ver} #module load netcdf/${netcdf_ver} module load python/${python_ver} module load jasper/${jasper_ver} module load libpng/${libpng_ver} module load zlib/${zlib_ver} module load w3nco/${w3nco_ver} module load cfp/${cfp_ver} module load iobuf/${iobuf_ver} module list PATH=${NWPSdir}/lib/netcdf/${netcdf_ver}/bin:$PATH PATH=${NWPSdir}/lib/hdf5/${hdf5_ver}/bin:$PATH LD_LIBRARY_PATH=${NWPSdir}/lib/netcdf/${netcdf_ver}/lib:$LD_LIBRARY_PATH LD_LIBRARY_PATH=${NWPSdir}/lib/hdf5/${hdf5_ver}/lib:$LD_LIBRARY_PATH NETCDF_VERSION=${netcdf_ver} NetCDF=${NWPSdir}/lib/netcdf/${netcdf_ver} NETCDF_ROOT=${NWPSdir}/lib/netcdf/${netcdf_ver} HDF5_ROOT=${NWPSdir}/lib/hdf5/${hdf5_ver} NETCDF_LIBRARIES=${NWPSdir}/lib/netcdf/${netcdf_ver}/lib HDF5_LIBRARIES=${NWPSdir}/lib/hdf5/${hdf5_ver}/lib NETCDF_INCLUDES=${NWPSdir}/lib/netcdf/${netcdf_ver}/include HDF5_INCLUDES=${NWPSdir}/lib/hdf5/${hdf5_ver}/include export IOBUF_PARAMS="*:count=4:size=32M:prefetch=1:preflush=1" export FORT_BUFFERED=true export NWPSplatform="DEVWCOSS" export MP_PGMMODEL=mpmd export MP_CSS_INTERRUPT=yes export WFO="%WFO%" export siteid=${WFO} export SITEID=${WFO^^} export N="1" export KEEPDATA="YES" export model="nwps" export MODEL=${model^^} export envir="para" export DEVWCOSS_USER=$(whoami) export COMROOT=/lfs/h2/emc/ptmp/${DEVWCOSS_USER}/com/retro #Dev environment value for $job export job=pnwps_${WFO}_fc_cg1_ret export jobid=pnwps_${WFO}_fc_cg1_ret.$$ #Dev environment jlogfile export ver=${nwps_ver} mkdir -p /lfs/h2/emc/ptmp/${DEVWCOSS_USER}/$NET/$ver/retro/logs/jlogfiles export jlogfile=/lfs/h2/emc/ptmp/${DEVWCOSS_USER}/$NET/$ver/retro/logs/jlogfiles/jlogfile.${job} #Set platform export WCOSS_SYSTEM=$( echo $COMROOTp1 | cut -c7 )d1 export WCOSS_SYSTEM_COM=$( echo $COMROOTp1 | cut -c7-9 ) # Wait for upstream component job to finish while [ -z $(grep 'COMPLETED NORMALLY' /lfs/h2/emc/ptmp/${DEVWCOSS_USER}/$NET/$ver/retro/logs/jlogfiles/jlogfile.pnwps_%WFO%_prep_ret | awk '{print $1}') ] do if [ ! -z $(grep 'FAILED' /lfs/h2/emc/ptmp/${DEVWCOSS_USER}/$NET/$ver/retro/logs/jlogfiles/jlogfile.pnwps_%WFO%_prep_ret | awk '{print $1}') ] then msg="FATAL ERROR: Upstream job pnwps_%WFO%_prep_ret failed" postmsg "$jlogfile" "$msg" export err=1; err_chk fi echo 'Waiting for pnwps_%WFO%_prep_ret to complete, at date' date sleep 60 done ${NWROOT}/dev/jobs/J${MODEL}_FORECAST_RET #%include #%manual ################################################################################ #TASKSCRIPT DOCUMENTATION BLOCK #TASKSCRIPT: jnwps_%FAMILY1%_forecast_cg%N% #LAST MODIFIER: Floyd Fayton #ORGANIZATION: NP11 #DATE: SEP 2014 #FULL NAME: /nwps_para/nwps/SR/j%WFO% #PURPOSE: To execute the job that creates NWPS %WFO% GRIB output files #JOB SCRIPT CALLED: /nwprod/nwps.${nwps_ver}/jobs/JNWPS ==> # /nwprod/nwps.${nwps_ver}/scripts/exnwps_forecast_cg%N%.sh.ecf ################################################################################# ###################################################################### # Job specific troubleshooting instructions: # see generic troubleshoot manual page # ###################################################################### #%end