#!/bin/csh

#SBATCH -J Makeplots 
#SBATCH -p compute 
#SBATCH -t 12:00:00
#SBATCH --mem=20g
#SBATCH --ntasks=4
#SBATCH -n 16

set echo

setenv project_dir /work/MOD3DEV/dkj/offline_ltng/analysis
setenv TMPDIR $project_dir/tmp
if(! -e $TMPDIR) mkdir -p $TMPDIR

set MonName = (Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec)
setenv YEAR "2011"
#setenv figIdentifier "New2way12US" 
setenv figIdentifier "Atcl" 
#setenv figIdentifier "NickWy" 
setenv MOD_CASES "Base,mNLDN,pNLDN,hNLDN"
#setenv MOD_CASES "Base,Nick,Wyat"
setenv dom 12km
#setenv locIdentifier "All,NC,CA"
setenv plot_fmt "pdf" 
setenv network  "AQS" #"IMPROVE" #"AQS"
cd $project_dir/jobs
setenv OBSin  "O3,NOX" #"IMPROVE" #"AQS"
set lunit = (ppb ppb) # 
setenv SDATE 2011-07-01
setenv EDATE 2011-07-31
setenv out_dm8hr TRUE
setenv out_dstat TRUE
setenv parallel TRUE
#foreach MON (09)
foreach MON (07 08)
  setenv MONTH $MON 
  setenv timeIdentifier "$MonName[$MONTH]_$YEAR" 
  ### specify the spatial bounds, if true, it will be automatically defined based on site lat-lon
  setenv user_bounds FALSE 
  foreach spec ("O3" "NOX")
    setenv species $spec 
    /usr/local/apps/R-3.4.0/intel-17.0/bin/R CMD BATCH --slave /work/MOD3DEV/dkj/offline_ltng/analysis/jobs/makePlots4Paper.R  makePlots4Paper_para.Rout
  end
end
cd $project_dir
  if($parallel == "TRUE") then
   rm -r tmp
  endif

exit
