#!/bin/csh -f # Version @(#)$Id$ # Path $Source$ # Date $Date$ # This script sets up needed environment variables for running SMOKE point # sources using daily and/or hourly emissions for 1 or more months. The # "onetime" steps are intended to be run in another script. This script runs # only Smkinven (for daily/hourly), Temporal, Laypoint, Smkmerge, optionally # Smk2emis, and Smkreport for date-specific reports. # Optionally, if LAYER_FRACTION is defined, Layalloc is run instead of Laypoint # to layer the emissions. # # This script is intended to be used with the EMF # source emissions in SMOKE for the EPA 2002 modeling platform, and # calls the scripts that runs the SMOKE programs. # # Script created by : M. Houyoux, Environmental Protection Agency # October, 2007 # #********************************************************************* ## log w/ EMF server that script is running $EMF_CLIENT -k $EMF_JOBKEY -s "Running" # set source category setenv SMK_SOURCE P # source category to process setenv MRG_SOURCE $SMK_SOURCE # source category to merge ## day-dependent programs set run_smkinven = Y # run inventory import program set run_temporal = Y # run temporal allocation program set run_laypoint = Y # run layer fractions program set run_smkmerge = Y # run merge program set run_elevpoint = N # run elevated source selection program (once per day; default is N unless ELEVPOINT_DAILY = Y) set run_smk2emis = N # run conversion of 2-d to UAM binary set run_layalloc = N # Layer allocation program, set to N unless LAYER_FRACTION is defined if ( $?ELEVPOINT_DAILY ) then if ( $ELEVPOINT_DAILY == Y ) then set run_elevpoint = Y endif endif ## quality assurance set run_smkreport = Y # Y runs reporting for state reports set run_m3stat = Y if ($?GCNTL) then # if GCNTL exists, use Cntlmat output from onetime setenv MRG_CTLMAT_MULT $MRG_SOURCE # 'A' merges with area projection matrix produced from CNTLMAT setenv MRG_REPCTL_YN Y # Y Report control totals setenv CUSTOM_GCNTL Y endif # allow the user to turn these things off in his/her case if (! $?REGISTER_REPOUT) then setenv REGISTER_REPOUT Y # Imports Smkreport and Smkmerge reports into EMF endif if (! $?REGISTER_AQMOUT) then setenv REGISTER_AQMOUT Y # Imports Smkmerge I/O API outputs in EMF endif setenv PROMPTFLAG N # Y (never set to Y for batch processing) setenv AUTO_DELETE Y # Y deletes SMOKE I/O API output files (recommended) setenv AUTO_DELETE_LOG Y # Y automatically deletes logs without asking if ( ! $?DEBUGMODE ) then setenv DEBUGMODE N # Y changes script to use debugger endif #setenv DEBUG_EXE totalview # Sets the debugger to use when DEBUGMODE = Y setenv DEBUG_EXE idb # Sets the debugger to use when DEBUGMODE = Y ## If LAYER_FRACTION is set, run Layalloc instead of Laypoint if ( $?LAYER_FRACTION ) then setenv MRG_LAYERS_YN N set run_layalloc = Y endif ## If MRG_LAYERS_YN is not set by EMF, default to Y if (! $?MRG_LAYERS_YN ) then setenv MRG_LAYERS_YN Y endif ## If MRG_LAYERS_YN is N, don't run Laypoint if ( $MRG_LAYERS_YN == N ) then set run_laypoint = N endif ############################################################################## switch ( $#argv ) case 0: case 1: case 2: case 3: echo "SCRIPT ERROR: Script requires arguments for a grid name" echo " and the -m or -q option with 3 settings." echo " " echo " This script expects to be called using one of the following argument lists:" echo " -m