#!/bin/csh 

set OUTDIR = ./outputs 
set proj = 'ARDEQ_MPE'
echo $proj

set stday = (20160101)
set enday = (20161231)

set cases = ( 2016year )

setenv OUTFILE $OUTDIR/ARDEQ_MPE_combine_camxv7.10_cb6r5.cf2e.DMS.2016v2.$cases.grd01_O3_only.nc
rm -f $OUTFILE

foreach i ( 1 )

set EXEC = ./src/combine.exe 

setenv SPECIES_DEF ./spec_def/spec_def.camxv7.10_2016v2.elements

if ( ! -d $OUTDIR ) mkdir -p $OUTDIR

  set  gday  = $stday[$i]
  set  ENDAY = ($enday[$i])

  set case = $cases[$i]
  setenv PROMPTFLAG F

  while ($gday <= $ENDAY)
     set jday = `date -d $gday +%Y%j` # Converts to julian day
     echo $gday  $jday
  
   set indir = /root/RAID/2016v2_OUT  
     
     setenv INFILE1  $indir/ARDEQ_${gday}.12US2.35.2016fj_v7.10_CB6r5.cf2e.epa.camx.avrg.grd01.nc                                     

     ${EXEC}
     sleep 1
     echo 'finish ' $gday
     set gday = `date -d "$gday+ 1 day" +%Y%m%d`

  end  # end loop of date

end  # foreach i

