#!/bin/csh -f

 setenv YEAR 2023

 setenv INDIR /work/MOD3EVAL/callen05/P301/smoke_out/P301_${YEAR}_rxequates/36US3/cmaq_cb6ae7/ptfire-rx/
 setenv OUTDIR /work/MOD3EVAL/kbaker/data/cmaq/36US3/emis.fire/$YEAR/
 mkdir -p $OUTDIR

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

set start_date = ${YEAR}001 
set end_date = ${YEAR}365

set today = $start_date

while ($today <= $end_date )

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

set STDATE = $today

set GDAY = (`/home/kbaker/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

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

foreach GROUP (1 2 3)
setenv IVAL $GROUP

 setenv STACKFILE $INDIR/stack_groups_out_ptfire-rx_${G_DAY}_36US3_P301_${YEAR}_rxequates.ncf
 setenv INFILE $INDIR/inln_mole_ptfire-rx_${G_DAY}_36US3_cmaq_cb6ae7_P301_${YEAR}_rxequates.ncf
 setenv OUTFILE $OUTDIR/inln_mole_ptfire-rx_${G_DAY}_36US3_cmaq_cb6ae7_P301_${YEAR}_rxequates_grp$GROUP.ncf
 cp $STACKFILE $OUTDIR

ls -l $INFILE
ls -l $STACKFILE
ls -l $OUTDIR


/work/MOD3EVAL/kbaker/projects/rxeq/ScaleWindow/ScaleWindow <<EOF
$GROUP
EOF


end

@ today = $today + 1

end

exit

