#!/usr/bin/env bash
#BSUB -J nwm_forcing_medium_range_%CYC%
#BSUB -o /gpfs/hps3/ptmp/Cham.Pham/com/logs/jnwm_forcing_medium_range_%CYC%.o%J
#BSUB -cwd /gpfs/hps3/ptmp/Cham.Pham/tmpnwprd
#BSUB -q dev
#BSUB -W 3:30
#BSUB -A "NWM-DEV"
#BSUB -U NWM
#BSUB -n 160
#BSUB -R span[ptile=10]
#BSUB -R affinity[cpu(2):distribute=balance]
#BSUB -a poe

. /usrx/local/Modules/3.2.9/init/ksh


%include "/ecf/ecfnets/include/ecf/ecfnets/include/head.h"
%include "/ecf/ecfnets/include/envir-xc40.h"

source /gpfs/hps3/nwc/noscrub/Cham.Pham/nwtest/nwm.v2.1/ecf/model_envir.h
export model=nwm
#source /ecf/ecfnets/include/model_ver.h

#Unlimit the stack size
ulimit -c 0
ulimit -s unlimited

module load ibmpe #cfp/2.0.0
module load ncarg
module load NetCDF
module load python
module load ics/16.0.3

# add NCL to PATH
export PATH=/gpfs/tp1/u/James.R.Taft/CFP.2.0.0.new/bin:$NCARG_ROOT:$NCARG_BIN:$NCARG_LIB:$NCARG_INC:$PATH:

# EXPORT list here
export cyc=%CYC%

#-----set up CFP2 environment
export OMP_NUM_THREADS=2

export CFP_PTILE=10
export CFP_NPROCS=160
export CFP_VERBOSE=1

#export CFPCOMMAND="mpirun.lsf cfp"
#export CFPCOMMAND="mpirun.lsf /gpfs/tp1/u/James.R.Taft/CFP.2.0.0.new/cfp"

export HOMEnwm=/gpfs/hps3/nwc/noscrub/Zhengtao.Cui/trunk_v1.1/nwm.v2.1.0

# CALL executable job script here
${HOMEnwm}/jobs/JNWM_FORCING_MEDIUM_RANGE


%include "/ecf/ecfnets/include/tail.h"
%manual
######################################################################
#
#  PURPOSE:
#
######################################################################

######################################################################
# Job specific troubleshooting instructions:
#  see generic troubleshoot manual page
#
######################################################################

# include manual page below
%end