#!/bin/csh -f
#
# This script sets up monthly environment variables for running 
# emissions in SMOKE for a year-long project; this
# is a helper script that is called by the run scripts 
#
# Script created by : Z. Adelman, EMC MCNC
# Edited : December 2001 by ZEA for WRAPJS processing
# Edited : August 2003 by ZEA for SMOKEv1.5
# Edited : December 2003 by APH for WRAP2003 processing
# Edited : October 2013 by Tejas for EPRI-PHEV 2030 processing
# Edited : February 2014 by Allison for CARMMS 2021 processing
# Edited : 10sep2015 mjimenez Denver 2011 SIP (only April spinup!!)
# Edited : 8oct2015 tshah BOEM GOMR PGM modeling
# Edited : 10nov2015 lhuang correct for leap year

#*********************************************************************
# Keys
# EPI_STDATE
# EPI_STTIME
# EPI_RUNLEN
# EPI_NDAY

setenv  BASE_YEAR 2016     # required for smoke v4.5

############################## January #####################################

if ( $month == jan ) then
   setenv MSDATE    20160101   # Start date of met  time-based files
   setenv SEASON    win          # win, spr, sum, aut: SEASONons
   setenv WINSUM    WIN          # Mobile processing, WIN or SUM
   setenv winsum    win          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016001  # Julian start date
       setenv ESDATE    20160101

   setenv EPI_STDATE 2016001     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7440000     # run length (HHHMMSS)
   setenv EPI_NDAY   31          # number of full run days

endif

############################## February #####################################
if ( $month == feb ) then
   setenv MSDATE    20160201     # Start date of met  time-based files
   setenv SEASON    win          # win, spr, sum, aut: SEASONons
   setenv WINSUM    WIN          # Mobile processing, WIN or SUM
   setenv winsum    win          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016032      # Julian start date
       setenv ESDATE    20160201

   setenv EPI_STDATE 2016032     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 6960000     # run length (HHHMMSS)
   setenv EPI_NDAY   29          # number of full run days

endif

############################## March #####################################
if ( $month == mar ) then
   setenv MSDATE    20160301     # Start date of met  time-based files
   setenv SEASON    spr          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016061      # Julian start date
       setenv ESDATE    20160301

   setenv EPI_STDATE 2016061     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7440000     # run length (HHHMMSS)
   setenv EPI_NDAY   31          # number of full run days

endif

############################## April #####################################
if ( $month == apr ) then
   setenv MSDATE    20160401     # Start date of met  time-based files
   setenv SEASON    spr          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016092      # Julian start date
       setenv ESDATE    20160401

   setenv EPI_STDATE 2016092     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7200000     # run length (HHHMMSS)
   setenv EPI_NDAY   30          # number of full run days

endif

############################## May #####################################
if ( $month == may ) then
   setenv MSDATE    20160515     # Start date of met  time-based files
   setenv SEASON    spr          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016136      # Julian start date
       setenv ESDATE    20160515

   setenv EPI_STDATE 20160515     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 4080000     # run length (HHHMMSS)
   setenv EPI_NDAY   17          # number of full run days

endif

############################## June #####################################
if ( $month == jun ) then
   setenv MSDATE    20160601     # Start date of met  time-based files
   setenv SEASON    sum          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016153      # Julian start date
       setenv ESDATE    20160601

   setenv EPI_STDATE 2016153     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7200000     # run length (HHHMMSS)
   setenv EPI_NDAY   30          # number of full run days

endif

############################## July #####################################
if ( $month == jul ) then
   setenv MSDATE    20160701     # Start date of met  time-based files
   setenv SEASON    sum          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016183      # Julian start date
       setenv ESDATE    20160701

   setenv EPI_STDATE 2016183     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7440000     # run length (HHHMMSS)
   setenv EPI_NDAY   31          # number of full run days

endif

############################## August #####################################
if ( $month == aug ) then
   setenv MSDATE    20160801     # Start date of met  time-based files
   setenv SEASON    sum          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016214     # Julian start date
       setenv ESDATE    20160801

   setenv EPI_STDATE 2016214     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7440000     # run length (HHHMMSS)
   setenv EPI_NDAY   31          # number of full run days

endif

############################## September #####################################
if ( $month == sep ) then
   setenv MSDATE    20160901     # Start date of met  time-based files
   setenv SEASON    aut          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016245      # Julian start date
       setenv ESDATE    20160901

   setenv EPI_STDATE 2016245     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7200000     # run length (HHHMMSS)
   setenv EPI_NDAY   30          # number of full run days

endif

############################## October #####################################
if ( $month == oct ) then
   setenv MSDATE    20161001     # Start date of met  time-based files
   setenv SEASON    aut          # win, spr, sum, aut: SEASONons
   setenv WINSUM    SUM          # Mobile processing, WIN or SUM
   setenv winsum    sum          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016275      # Julian start date
       setenv ESDATE    20161001

   setenv EPI_STDATE 2016275     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7440000     # run length (HHHMMSS)
   setenv EPI_NDAY   31          # number of full run days

endif

############################## November #####################################
if ( $month == nov ) then
   setenv MSDATE    20161101     # Start date of met  time-based files
   setenv SEASON    aut          # win, spr, sum, aut: SEASONons
   setenv WINSUM    WIN          # Mobile processing, WIN or SUM
   setenv winsum    win          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016306      # Julian start date
       setenv ESDATE    20161101

   setenv EPI_STDATE 2016306     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7200000     # run length (HHHMMSS)
   setenv EPI_NDAY   30          # number of full run days

endif

############################## December #####################################
# Not running for the last three days of December
if ( $month == dec ) then
   setenv MSDATE    20161201     # Start date of met  time-based files
   setenv SEASON    win          # win, spr, sum, aut: SEASONons
   setenv WINSUM    WIN          # Mobile processing, WIN or SUM
   setenv winsum    win          # Mobile processing, WIN or SUM
   
       setenv G_STDATE  2016336      # Julian start date
       setenv ESDATE    20161201

   setenv EPI_STDATE 2016336     # Julian start date
   setenv EPI_STTIME  000000     # start time (HHMMSS)
   setenv EPI_RUNLEN 7440000     # run length (HHHMMSS)
   setenv EPI_NDAY   31          # number of full run days

endif
