#!/bin/csh -f

set BASE = $cwd
set PROGNAME = ScaleWindow
set SCEN = 2017ff_17jp
set NEWSCEN = ${SCEN}_0NorsePeak

 setenv INDIR  /work/ROMO/lrt/cmaq/12US1/emis.2017/ptfire
 setenv OUTDIR /work/ROMO/lrt/cmaq/12US1/emis.2017/ptfire.alt
 mkdir -p $OUTDIR

#-----------------------------------------------------------------#

set start_date = 2017211   #first day for 36US1: 2013213
set end_date = 2017212      #                     2013273

set today = $start_date

while ($today <= $end_date )

#-----------------------------------------------------------------#

set STDATE = $today

set GDAY = (`/home/kpc/camx/dateconv/j2g $today`)

set YYYY = `echo $GDAY | cut -c1-4`
set YY = `echo $GDAY | cut -c3-4`
set MM = `echo $GDAY | cut -c5-6`
set DD = `echo $GDAY | cut -c7-8`

set G_DAY = $YYYY$MM$DD
set GS_DAY = $YY$MM$DD

@ YESTERDAY = $STDATE - 1
if ($YESTERDAY == 2005000) then
 set YESTERDAY = 2004366
endif

#-----------------------------------------------------------------#

 setenv STACK1 $INDIR/stack_groups_ptfire_${G_DAY}_12US1_${SCEN}.ncf
 setenv INFILE1 $INDIR/inln_mole_ptfire_${G_DAY}_12US1_cmaq_cb6_${SCEN}.ncf
 setenv INFILE2 $OUTDIR/inln_mole_ptfire_${G_DAY}_12US1_cmaq_cb6_${NEWSCEN}.ncf

/work/ROMO/users/kpc/firehia/ScaleWindow/diffinline


@ today = $today + 1


end
exit

