Control Scripts Notes(From: Jim Wilkinson)


1. This description is incomplete in that not all arguments/functions are described.
2. This description can be used as follows:
> CLA = command line argument to bin/concept shell script
> CALLS = either bin/concept makes a call to this shell-sql-perl script or the shell-sql-perl script makes a call to an additional script
> LOADS = a stored procedure is loaded into the data base
3. Examples:
% bin/concept init_project –n beta

creates a project named ‘beta’ in the CONCEPT ‘projects’ directory

% bin/concept run_area_model –n beta –s scenario1

runs the CONCEPT Area Source Model for project ‘beta’ scenario ‘scenario1.’ The CLA ‘run_area_model’ subsequently calls the shell script ‘../bin/run_area_model.sh’ which in turn calls the SQL script ‘../src/set_area_defaults.sql,’ the SQL script ‘../src/area_model.sql,’ the shell script ‘../bin/camx_area.sh,’ and the shell script ‘../bin/area_reports.sh.’ The shell script ‘../bin/camx_area.sh’ calls the perl script ‘../src/area/output/camx_area.pl,’ and the shell script ‘../bin/area_reports.sh’ calls the following perl scripts: ../src/area/output/temporal_by_day.pl; ../src/area/output/temporal_by_hour.pl; ../src/area/output/temporal_by_poll.pl; ./src/area/output/speciation_by_day.pl; ../src/area/output/speciation_by_poll.pl; ../src/area/output/spatial_by_day.pl; and ../src/area/output/spatial_by_poll.pl.

bin/concept -- CONCEPT control shell script

¦ (CLA) create_project -- defines new PROJECT
-- creates empty PROJECT-specific GLOBALS and XREF schema
¦ (CLA) init_project -- creates empty PROJECT-specific GLOBALS and CREF tables
> (CALLS) ../db/globals.sql -- creates empty PROJECT-specific GLOBALS tables
* fips * tribal_codes * time_zones * sic_codes
* naics_codes * mact_codes * scc * pollutant_codes
* emission)units_codes * maerial_codes * control_device_codes * conversion_factors
> (CALLS) ../db/rpo_xrefs.sql -- creates empty PROJECT-specific XREF tables
* rpo_ts * rpo_tm * rpo_tw * rpo_td
* rpo_cr * rpo_cp * rpo_lp * rpo_ss
* rpo_sr * point_grid_xref
> (CALLS) ../bin/import_sp.sh - loads stored procedures SQL code into data base
? (LOADS) ../src/area/sp/area_temporal.sql -- AreaTemporalAllocation () stored procedure
* creates and calls stored function AreaTemporal_CreateTempTables ()
* creates and calls stored function AreaTemporal_Prep_NEITables ()
* creates and calls stored function GetTemporalShift ( date, integer, integer, integer, varchar(2) )
* creates and calls stored function elapsed_time ( stepStart )
? (LOADS) ../src/area/sp/area_speciation.sql -- AreaSpeciation () stored procedure
* creates and calls stored function AreaSpeciation_CreateTempTables ()
* calls stored function elapsed_time ( stepStart )
? (LOADS) ../src/area/sp/area_spatial.sql -- AreaSpatialAllocation () stored procedure
* creates and calls stored function AreaSpatial_CreateTempTables ()
* calls stored function elapsed_time ( stepStart )
? (LOADS) ../src/point/sp/point_elev.sql -- PointElevatedSources () stored procedure
* creates and calls stored function AreaSpeciation_CreateTempTables ()
? (LOADS) ../src/point/sp/point_temporal.sql -- PointTemporalAllocation () stored procedure
* creates and calls stored function PointTemporal_CreateTempTables ()
* creates and calls stored function PointTemporal_Prep_NEITables ()
* calls stored function elapsed_time ( stepStart )
? (LOADS) ../src/point/sp/point_speciation.sql -- PointSpeciation () stored procedure
* creates and calls stored function PointSpeciation_CreateTempTables ()
* calls stored function elapsed_time ( stepStart )
? (LOADS) ../src/point/sp/point_spatial.sql -- PointSpatialAllocation () stored procedure
* creates and calls stored function PointSpatial_CreateTempTables ()
* calls stored function elapsed_time ( stepStart )
? (LOADS) ../src/point/sp/point_elev_camx.sql -- PointElevatedCAMx () stored procedure
* calls stored function elapsed_time ( stepStart )
¦ (CLA) add_scenario -- creates SCENARIO and SCENARIO-specific schema
> (CALLS) ../db/run_control.sql -- creates empty SCENARIO-specific tables
* run_contorl * run_pollutants
> (CALLS) ../db/nei_area.sql -- creates SCENARIO-specific tables
* nei_area_tr * nei_area_ep * nei_area_pe * nei_area_ce
* nei_area_em
> (CALLS) ../db/nei_point.sql -- creates_empty SCENARIO-specific tables
* nei_point_tr * nei_point_si * nei_point_eu * nei_point_er
* nei_point_ep * nei_point_pe * nei_point_ce * nei_point_em
¦ (CLA) init_scenario -- reinitializes (i.e., empties) SCENARIO-specific schema
> (CALLS) ../db/run_control.sql -- creates empty SCENARIO-specific tables
* run_contorl * run_pollutants
> (CALLS) ../db/nei_area.sql -- creates SCENARIO-specific tables
* nei_area_tr * nei_area_ep * nei_area_pe * nei_area_ce
* nei_area_em
> (CALLS) ../db/nei_point.sql -- creates_empty SCENARIO-specific tables
* nei_point_tr nei_point_si * nei_point_eu * nei_point_er
* nei_point_ep nei_point_pe * nei_point_ce * nei_point_em

¦ (CLA) import_globals -- loads data into PROJECT-specific GLOBALS schema
> (CALLS) ../bin/import_globals.sh -- loads data into PROJECT-specific GLOBALS tables
* fips * time_zones * sic_codes * naics_codes
* mact_codes * scc * pollutant_codes * emission_units_codes
* material_codes * conversion_factors
¦ (CLA) import_rpo -- loads data into PROJECT-specific XREF schema
> (CALLS) ../bin/import_rpo.sql -- loads data into PROJECT-specific XREF tables
* rpo_ts * rpo_tm * rpo_tw * rpo_td
* rpo_cr * rpo_cp * rpo_lp * rpo_ss
* rpo_sr * point_grid_xref
¦ (CLA) import_nei -- loads data into PROJECT- and SCENARIO-specific schema
> (CALLS) ../bin/import_nei.sh -- loads data into PROJECT- and SCENARIO-specific tables
* nei_point_tr * nei_point_si * nei_point_eu * nei_point_er
* nei_point_ep * nei_point_pe * nei_point_ce * nei_point_em
* nei_area_ep * nei_area_pe * nei_area_em
¦ (CLA) import_control -- loads data into PROJECT- and SCENARIO-specific run control schema
> (CALLS) ../bin/import_control.pl -- loads data into PROJECT- and SCENARIO-specific run control table
* run_control
¦ (CLA) run_area_model -- run the CONCEPT Area Source Model
> (CALLS) ../bin/run_area_model.sh -- control shell script for the CONCEPT Area Source Model
? (CALLS) ../src/set_area_defaults.sql -- changes certain NULL values in NEI data to default values
? (CALLS) ../src/area_model.sql -- calls stored procedure AreaTemporalAllocation ()
-- calls stored procedure AreaSpeciation ()
-- calls stored procedure AreaSpatialAllocation ()
? (CALLS) ../bin/camx_area.sh -- creates CAMx-ready area source emissions estimates file
? (CALLS) ../src/area/output/camx_area.pl -- perl script to create CAMx-ready area source emissions estimates file
? (CALLS) ../bin/area_reports.sh -- CONCEPT Area Source Model reports
? (CALLS) ../src/area/output/temporal_by_day.pl
? (CALLS) ../src/area/output/temporal_by_hour.pl
? (CALLS) ../src/area/output/temporal_by_poll.pl
? (CALLS) ../src/area/output/speciation_by_day.pl
? (CALLS) ../src/area/output/speciation_by_poll.pl
? (CALLS) ../src/area/output/spatial_by_day.pl
? (CALLS) ../src/area/output/spatial_by_poll.pl
¦ (CLA) run_point_model -- run the CONCEPT Point Source Model
> (CALLS) ../bin/run_point_model.sh -- control shell script for the CONCEPT Point Source Model
? (CALLS) ../src/set_point_defaults.sql -- changes certain NULL values in NEI data to default values
? (CALLS) ../src/point_model.sql -- calls stored procedure PointElevatedSources ()
-- calls stored procedure PointTemporalAllocation ()
-- calls stored procedure PointSpeciation ()
-- calls stored procedure PointSpatialAllocation ()
-- calls stored procedure PointElevatedCAMx ()
? (CALLS) ../bin/camx_point.sh -- creates CAMx-ready low-level point source emissions estimates file
? (CALLS) ../src/point/output/camx_point.pl -- perl script to create CAMx-ready low-level point source emissions estimates file
? (CALLS) ../bin/camx_point_elev.sh -- creates CAMx-ready elevate point source emissions estimates file
? (CALLS) ../src/point/output/camx_point_elev.pl -- perl script to create CAMx-ready elevated point source emissions estimates file
? (CALLS) ../bin/point_reports.sh -- CONCEPT Point Source Model reports
? (CALLS) ../src/point/output/temporal_by_day.pl
? (CALLS) ../src/point/output/temporal_by_hour.pl
? (CALLS) ../src/point/output/temporal_by_poll.pl
? (CALLS) ../src/point/output/speciation_by_day.pl
? (CALLS) ../src/point/output/speciation_by_poll.pl
? (CALLS) ../src/point/output/spatial_by_day.pl
? (CALLS) ../src/point/output/spatial_by_poll.pl