#!/bin/csh
# First Line must be the Shell used.
# Modify: qsub fpgm1.job; execute in batch on TCS; generic F90 source: fpgm.f
# Job script fpgm1.job must be executable: use chmod 755 fpgm1.job
# also needs fdata input and send output to fpgm1.output using 1 processor
#
# These first few lines setPortable Batch System (PBS) scheduler directives.
# set h:mm:ss
#PBS -l walltime=1:00 
# set number nodes:procs: 1:1,1:4,2:16,...,nodes:procs
#PBS -l rmsnodes=1:1 
# set project-name for MCS572S03
#PBS -l rmsproject=sc70jjp 
# set file names for standard error and output
#PBS -e fpgm1.error
#PBS -o fpgm1.output
#
# turn on echo
set echo           
#
# This job requires the program source fpgm.f and fdata file fdata in $LOCAL
# copy source to $LOCAL
cp ${SCRATCH}/fpgm.f  .    
# copy fdata to $LOCAL
cp ${SCRATCH}/fdata   .    
#
# Compile the program:  compiles and links  fpgm
f90 -lmpi -lelan -arch ev67 -o fpgm fpgm.f  
#
# runs executable called fpgm 
prun -N ${RMS_NODES} -n ${RMS_PROCS} ./fpgm < fdata
# within mpprun environmenti, but the "./" is needed and is not redundant. 
# output using nprocs=1 should be in ${SCRATCH}/fpgm1.output where qsub is run.
#
