#!/bin/csh -f

set EXEC = m3tshift

#> Year to be entirely encompassed by the time stamps in the time-shifted output file
set TARGET_YEAR = 2014

#> Path to the seasonal average H-CMAQ file downloaded from the CMAS data warehouse
#> This path will also be used to store the time-shifted output file
set DATADIR = /proj/ie/proj/staff/lizadams/timeshift/download_data

#> Name of the seasonal average H-CMAQ file downloaded from the CMAS data warehouse
set AV_CONC_INFILE = CCTM_CONC_v53beta2_intel17.0_HEMIS_cb6r3m_ae7_kmtbr_m3dry_2016_quarterly_av.nc

#> Name of the time-shifted seasonal average H-CMAQ file 
set AV_CONC_OUTFILE = CCTM_CONC_v53beta2_intel17.0_HEMIS_cb6r3m_ae7_kmtbr_m3dry_${TARGET_YEAR}_quarterly_av.nc

setenv INFILE ${DATADIR}/${AV_CONC_INFILE}
setenv OUTFILE ${DATADIR}/${AV_CONC_OUTFILE}

#> Invoke m3shift to shift the time stamps to the target year
#> Note that the first time stamp represents the fall of the previous year

@ TARGET_YEAR = ${TARGET_YEAR} - 1

${EXEC} << EOF
INFILE
2015289
120000
${TARGET_YEAR}289
120000
21960000
109800000
OUTFILE
EOF

