Home

Speciation Tool User`s Guide

image

Contents

1. 0 cccccccescssssessensecaececeeececeecesessessseesesseuaaaseeseseeeeeeees B 3 Table B T1 thl rename 2S Peles 2212 0 wes eae iaiia let KEE AEN A E a B 4 Eio e D A n o E 0116 EE SAAE A E E EE EAT B 4 Table B13 tbl StatiC orie r a a al a ea aS B 4 Table C1 tbl gas Process s viscssessieisdeasacedhshsves sdnsestudeed sadusde E A E A aa C 1 PablesG 2 CM WOCUMALY enn a evens a a a idee Aa ea ENE Ea E C 1 Table G 3 tbl_ run COntrol svat tvee eects el adieu suse eseb eee A es ATTAT C 1 ARENS m Glee T E o WR O d cic tegen ciate rr rg epee oer C 1 Table G 5 tbl user sprotile twits risinn e A eeieabencesaiweioeue ss C 1 Table C 6 Table names in the run schema created by the Speciation Tool for internal calculations noeng a na a e aa tenet wonaeandentunncadeadley seed wacaxetuaddeen ayes a C 2 Table D 1 Chemical Mechanisms AE5 and AE6 as input to the Speciation Tool 00 D 1 Table D 2 Chemical Mechanisms AE5 and AE6 as defined by EPA ccccseseessesseeeeeeeeeeeees D 2 EXHIBITS Exhibit 2 1 Speciation tool initialization and run SCHEMAS sssssesssessseeseersrssesssssssseesreereeee 2 2 Exhibit 3 1 Speciation Tool directory and file NAMES sssssnesnssssssssesseesereererrrrssrssssssssesrrrereeee 3 2 Exhibit 4 1 Example of run time Me SSABES ccceccesseessnssaaeeaececceeeeceeessesceesseesaeaaecseseeeeeeees 4 8 UNC EMAQ 1 05 010 v1 ii ENVIRON Speciation Tool User s Guide V
2. x PL pgSQL Refer to the Speciation Tool User Guide Appendix A for installation procedures of the required software 3 4 Initialize the Speciation Tool Database Prior to making any Speciation Tool runs the tool must be initialized using the steps described below 3 4 1 Update and source the Assigns sptool file The Assigns sptool file provided in the top level Speciation Tool home directory sets environment variables that are required for initialization These include the Speciation Tool home directory database name and input file names of the default speciation data The only environment variable that must be updated is SPTOOL_HOME This is installation dependent and must be set based on your system Change the path name to correspond to the directory where the Speciation Tool top directory resides on your system For example if you install the Speciation Tool under the directory disk4 models emis you would set the SPTOOL_HOME environment variable like this setenv SPTOOL HOME disk4 models emis sptool Speciation Tool top level directory UNC EMAQ 1 05 010 v1 3 3 ENVIRON Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE The other environment variable that you might want to change is the Speciation Tool database name The file provided in the distribution package has this variable set to sptoolv3_1 setenv SPTOOL DB sptoolv3 1 Speciation Tool Database name You may change s
3. OXYL 0 16 Y XYLS PXYL Oe 1 6 Y The overwrite flag in the last column determines whether a toxics species is added to N or replaced in Y the GSPRO file In the input toxics table XYLS species ID 507 has been assigned to DONT_USE a placeholder With the overwrite flag turned on the Speciation Tool will remove the XYLS DONT_USE entry and add the three XYLS entries shown above For the FORM_PRIMARY and ALD2_PRIMARY lumped species on the other hand the tool will add these species to GSPRO without removing any entries PROC_FILE Example PROC_FILE process_mode dat The PROC_FILE keyword specifies an optional input file that provides mobile source emission modes for profiles that represent mobile source processing This feature is provided to support SMOKE requirements regarding mobile source emission modes An example record in this file is 4674 EXH where profile code 4674 applies to exhaust emissions When the process file is provided additional records are generated in the GSCNV output file For example profile 4674 would include a VOC to TOG record as well as an EXH_VOC to EXH_TOG record with the same conversion factors 4 3 3 Output files Keyword options SPLITS_OUT Example SPLITS_OUT outputs gspro_O2coalstudy dat The SPLITS_OUT optional keyword is used to specify a path and file name for the model splits results written in SMOKE GSPRO format Paths can be relative paths from the Speciation Too
4. Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE Messages are displayed during the initialization process to indicate progress while importing the shared data Below is a partial sample of a successful load The time it takes to import the data will vary depending on your system a few minutes is typical Importing mechanisms disk4 models emis sptool src import_data mechanism_mar2013_forimport txt Using transactions import of data will abort on any error Reading data from disk4 models emis sptool src import_data mechanism_mar2013_forimport txt 1000 lines processed 2000 lines processed 18000 lines processed finished imported 18981 lines Importing species properties disk4 models emis sptool src import_data export_species_properties_2013_0311 csv Using transactions import of data will abort on any error Reading data from disk43 sptool wa1_05 2012 src import_data export_species_properties_2013_0311 csv 1000 lines processed 2000 lines processed finished imported 2274 lines Speciation Tool shared data successfully imported Completed Wed Mar 20 11 50 30 PDT 2013 The Speciation Tool uses the shared schema functions and tables in every run Appendix B provides the table definitions that are stored in the shared schema If an error occurs while importing the data the program will terminate with a message indicating which file and record caused the error A data
5. only one option can be specified per run MECH_BASIS Example MECH_BASIS CBO5 This keyword indicates the chemical mechanism to use for mapping inventory species to the AQM lumped species The specified mechanism must match a mechanism name in one of the mechanism tables in the shared schema these names are imported when the Speciation Tool is initialized The data provided with the Speciation Tool include VOC mechanism definitions for CBIV CBO5 CB6 SAPRCO7 SAPRCO7T SAPRC99 SAPRC99B SOA_CAMX45 and SOA_CAMX45_SP99 and PM25 mechanism definitions for AES and AE6 OUTPUT Example OUTPUT VOC The OUTPUT keyword indicates which output profiles will be generated The output options are VOC gas species PM particulates and STATIC STATIC represents the list of splits that do not change with profile weight definitions such as the pollutants CO and NH3 It simply formats the imported static profiles to correspond to the output GSPRO file format The OUTPUT keyword is optional If it is omitted from the control file the default is to generate VOC factors RUN_TYPE Example RUN_TYPE CRITERIA The RUN_TYPE options are CRITERIA INTEGRATE NOINTEGRATE and HAPLIST The different run types support different simulation options in SMOKE For VOCs output All four of these options can be used For emissions processing of only total VOCs the CRITERIA option is used The INTEGRATE or NOINTEGRATE options are used if a se
6. Keyword Example SPTOOL_AQM CMAQ SPTOOL_CARBONS carbons_cb6_cb05_cbiv_saprc99 csv SPTOOL GAS PROFILES Qry_gas_specie_export txt SPTOOL_INVTABLE invtable_caphap_27jun2007_v 7 txt SPTOOL_ MECH CB05 SPTOOL_PM_PROFILES Not Applicable SPTOOL_ PROCESS process_poll csv SPTOOL_ STATIC Not Applicable SPTOOL _VOC_TYPE INTEGRATE If the keyword is not applicable for a particular run the corresponding value is set to Not Applicable For example if the output type is specified as PM the metadata record SPTOOL_GAS_ PROFILES is set to Not Applicable These headers can be used as a guide for merging different GSPRO tables Before combining outputs for toxics TOG profiles with NONHAPTOG profiles be sure to confirm that the same chemical mechanism was specified for each run and that the same input files for the VOC calculations were used for each run 4 4 Run the Speciation Tool To run the Speciation Tool enter the following command perl SPTOOL SRC_HOME run_sptool pl SPTOOL DB lt run_name gt lt run_control file gt where SSPTOOL_DB is the Speciation Tool database name lt run_name gt is the user assigned run name lt run_control_file gt is the name and location of the control file that defines the run parameters and input and output file names UNC EMAQ 1 05 010 v1 4 7 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL 4 4 1 Run time messages The Speciation Tool writes a
7. already existing instance of the Speciation Tool database simply make a copy of the Assigns sptoo file and change the database name variable SPTOOL_DB Source the new assigns file and run the initialization program A new database is created and the data files imported This is the approach to take if you want to modify any of the shared data In particular you may have different versions of the INVTABLE that you want to support Each version can be represented in a different database 6 3 How do I define a new chemical mechanism To introduce a new chemical mechanism to the Speciation Tool e Define the assignments to the mechanism table with a unique mechanism name different from those of existing mechanisms and import the data to the shared schema mechanism table tbl_mechanism for VOC processing tbl_pm_mechanism for PM25 processing e f needed update the shared schema carbon table tbl_carbons to include any new model species names e Update the mechanism description table tbl _mechanism_description in the shared schema For examples of the tables used to define new chemical mechanisms look under the import_data directory in the Speciation Tool distribution package for the following files tbl_mechanism mechanism_14may2013_forimport txt tbl_carbons carbons_14may2013 csv tbl_mechanism_description mechanism_description 14may2013 txt Refer to Appendix B for the file formats The new mechanism data can be imported
8. and communicate with the database installation instructions are given in Section A 4 First however PostgreSQL must be installed as described in Section A 3 You can use the YUM software package manager to install PostgreSQL and the Perl modules YUM is an easy to use utility that installs updates and removes software packages on RPM based systems This utility is found on RedHat CentOS Fedora and other RPM based Linux distributions Note For systems with different installation procedures requirements PostgreSQL precompiled binaries can be found at http www postgresql org Click on the Downloads tab to review the available products From http www postgresql org download choose the binary package corresponding to your operating system As of August 2013 binary packages are available for the following operating systems e BSD FreeBSD OpenBSD e Linux RedHat CentOS Fedora Scientific families Linux Debian GNU Linux Ubuntu Linux SuSE and OpenSuSE Other Linux e MacOSX Solaris e Windows A 3 PostgreSQL Installation To install PostgreSQL using YUM you will probably need to be logged in as root To download and install PostgreSQL execute the following command yum install postgresql If prompted enter y to confirm the installation The package will download and install additional packages may be automatically selected for install in order to resolve dependencies A 4 Instal
9. percent sum is outside the specified tolerance The dropped profiles are reported to standard output Below is a small example of these warnings NOTICE establishing profile weights NOTICE WARNING review VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV NOTICE WARNING The following profiles were dropped NOTICE WARNING Total weight percent is outside the tolerance of 5 percent NOTICE WARNING PROFILE ID 4742 82 87586700 percent Diesel Exhaust Bus at 10 oC 2 stroke NOTICE WARNING PROFILE ID 4743 83 00138200 percent Diesel Exhaust Bus at 20 oC 2 stroke NOTICE WARNING PROFILE ID 4744 84 50961700 percent Diesel Exhaust Bus at 10 oC 2 stroke oxidatio Note that many of these listed profiles actually have a profile definition with a percent sum of 100 The problem is not with the profile definition but the incomplete species data Any species with an undefined missing molecular weight is dropped from the profile since the molecular weight is required to compute the splits factors This dropped percent sometimes takes the total profile percent sum outside the selected tolerance This type of problem can be resolved by updating the species molecular weights 4 4 2 What happens when the script is running The run_sptool pl program creates the run schema reads and imports the run control file imports the run specific data files executes the PostgreSQL functions that compute split factors and con
10. relevance old_profile Integer Profiles taken from previous version sibling Character 20 Profile_ID of PM profile from same study voc_to_tog Numeric 12 7 VOC to TOG conversion factor data_origin Character 50 Originating organization primary_prof Boolean description Character Profile description documentation Character Documentation of profile origin UNC EMAQ 1 05 010 v1 ENVIRON B 1 B 2 Speciation Tool User s Guide Version 3 1 APPENDIX B Table B 4 tbl_invtable Field Name Field Type Description eminv_poll Character 12 Emission inventory pollutant name mode Character 3 Process mode poll_code Character 16 Pollutant code specie_id Character 20 Species identifier reactivity Character 20 Reactivity group keep Character 20 Keep flag Y or N factor Character 20 Adjustment factor voc Character 20 VOC or TOG component flag model Character 20 Model species flag explicit Character 20 Explicit in mechanism flag activity Character 20 Data type flag Y indicates activity not emissions nti Character 20 Identifies HAPs on the Clean Air List unit Character 20 Units description Character 50 Inventory data description cas_description Character 50 CAS pollutant description Table B 5 tbl_mechanism Field Name Field Type Description mechanism Character 20 Mechanism name specie_id Char
11. weight percent NOTICE calculating average molecular weight by specie NOTICE calculating average molecular weight by AQM Completed splits calculations Completed output preparations Completed writing the output files for run cb05_integrate Exhibit 4 1 Example of run time messages There are a number of different warning messages that are displayed during processing The most frequent message occurs when a species exists in the shared schema species table that has not been defined in the specified chemical mechanism Below is a small example of these messages which provide the species ID number and name There are many species that are currently undefined in the chemical mechanisms this is a concern only if a profile references one of them UNC EMAQ 1 05 010 v1 4 8 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL NOTICE WARNING review VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV NOTICE WARNING CB0O5 mechanism undefined for the following species NOTICE The following will be set to UNK NOTICE WARNING SPECIES ID 2673 2 6 dimethylheptane propylcyclopentane NOTICE WARNING SPECIES ID 2674 Trans 3 hexene 3 methylcyclopentene NOTICE WARNING SPECIES ID 2675 2 methyl 2 hexene cis 3 heptene NOTICE WARNING SPECIES ID 2676 3 methyl trans 3 hexene Trans 2 heptene As indicated in Section 4 3 1 profiles are dropped during processing when the weight
12. 715 329 525 526 UNC EMAQ 1 05 010 v1 ENVIRON D 2
13. BD PgPP A 5 Start the PostgreSQL Service and Prepare It for the Speciation Tool To start the PostgreSQL database service execute the following command etc init d postgresql start Change to the user who will be running the Speciation Tool su lt user name here gt Start the terminal based front end to PostgreSQL psql with the default postgres user gt psql U postgres Create PostgreSQL user s with the database create option for each of the users who will be running the Speciation Tool Each user name should correspond to the Linux user account name The command is CREATE USER lt user name here gt WITH CREATEDB UNC EMAQ 1 05 010 v1 ENVIRON A 3 Speciation Tool User s Guide Version 3 1 APPENDIX A Then exit psql g Finally run the script sptool_reqd_checks sh again as in Section A 1 to verify that all of the packages are available to the Speciation Tool If they are you are now ready to follow the Speciation Tool setup procedures in Chapter 3 UNC EMAQ 1 05 010 v1 ENVIRON A 4 Speciation Tool User s Guide Version 3 1 APPENDIX B APPENDIX B Shared Schema File Formats Speciation Tool User s Guide Version 3 1 Table B 1 tbl_carbons APPENDIX B Field Name Field Type Description mechanism Character 20 Mechanism name aqm_poll Character 20 Air quality model lumped species identifier name num_carbons Numeric 5 2 Number of car
14. E 3 Each profile is defined as the sum of its components and is quantified as the percent contribution of each component to total organic gases Ideally the sum of the percent components for each profile should equal 100 which means that all mass is accounted for UNC EMAQ 1 05 010 v1 4 4 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL and assigned to individual species However due to round off or inaccurate profile definitions the profile components do not always add to 100 The optional TOLERANCE keyword defines an acceptable deviation from 100 with the default level in the Speciation Tool set at 5 Any profile definition where the sum of the percentages is outside the acceptable tolerance will not be output in the run For example for the 5 default tolerance level all profiles that sum to less than 95 or greater than 105 would be excluded from the output If the sum of the weight percentages for a particular profile is not 100 and nothing is done to correct the profile definition the resulting speciation profile will drop or add mass if used in emissions modeling The Speciation Tool therefore renormalizes all gas profiles whose sum is within the tolerance thereby preserving VOC mass Profiles outside of the tolerance are dropped at run time although they do continue to reside in the shared schema tables 4 3 2 Input files File formats for all of the run specific input files are p
15. EMA Shared schema created GRANT Create permissions granted on sptoolv3_1 GRANT All permissions granted on shared schema Defining custom functions and initializing tables working Speciation Tool functions and tables successfully defined in sptoolv3_1 UNC EMAQ 1 05 010 v1 3 4 ENVIRON Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE If you forget to set the environment variables you will get error messages like those displayed below If this occurs review the previous section on the Assigns sptool file source the assigns file and then rerun the initialization script SCRIPT ERROR Required environment variable SPTOOL_SRC_HOME not set in script init_sptooldb_v3 1 csh SCRIPT ERROR Required environment variable SPTOOL_DB not set in script init_sptooldb_v3 1 csh ABORT init_sptooldb_v3 1 csh script aborted with errors If you attempt to initialize the Speciation Tool with a database name that already exists you will get the following message createdb database creation failed ERROR database sptoolv3_1 already exists ERROR failed to create a new database sptoolv3_1 This usually means the database already exists To replace the existing database type dropdb sptoolv3_1 from the command line Delete the existing database if you want it replaced Otherwise change the SPTOOL_DB name in the Assigns sptool file to a different database name The command to delete the exis
16. G Refer to the SMOKE user s manual http www smoke model org for more detailed information on how SMOKE handles integrating criteria VOC and toxics inventories Note The Speciation Tool shared tables includes a default INVTABLE file These data should be reviewed and potentially replaced with the INVTABLE that you are using for SMOKE modeling AQM Example AQM CAMX The AQM keyword is used to indicate the air quality model to be used so that the output files will contain appropriate model lumped species names The Speciation Tool initialization data files support the AQM options CMAQ and CAMX CMAQ is the Community Multiscale Air Quality Model and CAMX is the Comprehensive Air Quality Model with extensions Different models sometimes use different names for the same species For example other PM2 5 emissions are mapped to the model species name PMFINE in CMAQ but FPRM in CAMX The tables tbl_ static and tbl_rename_species in the shared schema include fields that indicate model specific lumped species names If another model uses different names those need to be included in these tables The shared schema table tbl_rename_species allows you to export model specific species names different from the ones specified in the mechanism table For example ethene in the SAPRC99 mechanism is stored as ETHE in the mechanism table and is mapped to the model species name ETHENE for CMAQ TOLERANCE Example TOLERANC
17. NONHAPTOG EVP__ BENZENE UNC EMAQ 1 05 010 v1 5 1 ENVIRON Speciation Tool User s Guide Version 3 1 5 0 APPLICATIONS AND METHODOLOGY SMOKE compares the INVTABLE settings to the header records in the GSPRO file ensuring that the lists are consistent NOINTEGRATE In the NOINTEGRATE case both the criteria VOC inventory and the separate toxics inventory are included in emissions processing However due to an inability to map one inventory to the other toxics are included from both sources The criteria VOC includes the HAP VOC mass In generating the speciation profiles the specified active HAPs are removed from the VOC profiles but the profiles are not renormalized mass is preserved and profiles are generated as TOG HAPLIST This option generates records for the HAPs that define the NONHAPTOG for both the INTEGRATE and NOINTEGRATE cases All HAPS are written to profile number 0000 which is often used as the default profile ID in SMOKE processing 5 1 2 Chemical mechanisms During initialization the Speciation Tool imports default data profiles species list chemical mechanism etc into the shared schema However the Speciation Tool is not tailored to a specific chemical mechanism such as CBO5 If the chemical mechanism you require is not available in the Speciation Tool database you can import a new mechanism definition assuming you can supply the new chemical mechanism assignments Refer to Section 6 3 in the Chap
18. Speciation Tool User s Guide Speciation Tool User s Guide Version 3 1 Prepared for U S EPA Prepared by Michele Jimenez Uarporn Nopmongcol Greg Yarwood ENVIRON International Corporation 773 San Marin Drive Suite 2115 Novato California 94945 www environcorp com P 415 899 0700 F 415 899 0707 July 2013 lt ENVIRON Speciation Tool User s Guide Version 3 1 ACKNOWLEDGMENTS ACKNOWLEDGMENTS The authors gratefully acknowledge Marc Houyoux of the U S Environmental Protection Agency s Office of Air Quality Planning and Standards for his contributions to this report UNC EMAQ 1 05 010 v1 ENVIRON Speciation Tool User s Guide Version 3 1 CONTENTS CONTENTS ACKNOWLEDGMENTS ss cose a aee Enor EEE case ein EAEE r Et aden l 1 0 BACKGROUND wa isea a E E R 1 1 2 0 INTRODUCTION a a a a a E A A A E a iaia S 2 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE cccssesssssececccssssscecccccesssccececcceessescesees 3 1 3 1 Quick Start iie a a ee Ea aA aO Aaa ea a aat a iaa a a Aaa 3 1 3 2 Install Spe iation To hirornnsieraen nene R E N E AER 3 2 3 3 Check for Required Software ccccceesessssssececeeeeeceeceeescesseeseeeseeaaecaeeeeeeeeseseeeseeseeeees 3 3 3 4 Initialize the Speciation Tool Database 00 0 cccccccccccccecescescsesseessnseaaeeaeeeeeeeeeeesessesseeeees 3 3 4 0 RUNNING THE SPECIATION TOOL ccccccsssssssscccccnsssssccccssccsssssscescccccssscecceensnssssessssssess 4 1 AT T
19. acter 20 Unique species identifier aqm_poll Character 20 Air Quality Modeling lumped species identifier moles_per_mole Numeric 20 12 The moles per mole Table B 6 tbl_mechanism_description Field Name Field Type Description mechanism Character 20 Mechanism name description Character 256 Description ionsoailag Character 1 Flag N SOA mechanism Y nonSOA mechanism origin Character 300 Originating organization reference Character 100 References comment Character 500 Comment Table B 7 tbl_metadata Field Name Field Type Description keyword Character 20 Metadata keyword datival Character 256 Corresponding value file version Character 20 Data version UNC EMAQ 1 05 010 v1 ENVIRON Speciation Tool User s Guide Version 3 1 Table B 8 tbl_pm_mechanism APPENDIX B Field Name Field Type Description mechanism Character 20 Mechanism name specie_id Character 20 Unique species identifier aqm_poll Character 20 Air Quality Modeling lumped species identifier qualify Boolean Indicates which species determines if a profile qualifies for the specified mechanism compute Boolean If true compute aqm_poll usually PMFINE or PMOTHR Table B 9 tbl_pm_profiles Field Name Field Type Description profile_id Character 20 Unique profile identifier profile_name Character 255 Profile name quality Character 10 Overall Quali
20. ate the PM 5 split factors Executes PostgreSQL commands in prep_out sql e Creates tables in the run_id schema e Generates the output splits and conversion factors data Perl Extracts from the run_id schema the split factors and conversion factors data and writes the output GSPRO and GSCNV files UNC EMAQ 1 05 010 v1 4 10 ENVIRON Speciation Tool User s Guide Version 3 1 5 0 APPLICATIONS AND METHODOLOGY 5 0 APPLICATIONS AND METHODOLOGY 5 1 Gas Profile Processing The Speciation Tool is designed to support the availability of both CAPS and HAPS to either integrate the HAPs in the chemical mechanism or not and to include both active and tracer species in modeling It generates GSPRO and GSCNV speciation input files for the SMOKE model Refer to the SMOKE user s manual for detailed information of how SMOKE handles integrating the criteria VOC and toxics inventories The Speciation Tool shared schema includes the table tb _invtable which carries the imported default INVTABLE data These data should be reviewed to verify that they correspond to the SMOKE INVTABLE that will be used in your SMOKE modeling 5 1 1 Run type options As discussed in Section 4 3 1 the various Speciation Tool run options are CRITERIA INTEGRATE NOINTEGRATE and HAPLIST CRITERIA is specified if no additional HAPS inventory is included in the modeling The INTEGRATE and NOINTEGRATE options indicate how a separate HAPS inventory will be hand
21. base rollback will be initiated and none of the data for the file with the error will be imported The import stops at the first error Use the printed message to diagnose the cause of the error After correcting the error rerun the load script 3 4 4 The import program The initialization script executes the Perl program import_rawdata p for each file imported to the shared schema Each database table in the shared schema is associated with a keyword listed in Table 1 that identifies the table to populate To import additional data to the shared schema tables you can execute the Perl program from the command line This will essentially append data to an existing table gt perl SSPTOOL SRC_HOME import rawdata pl S SPTOOL DB table _ type input file The parameters include the database name a keyword from Table 3 1 and the path file name of the records to use as input The input data must conform to the table definitions in Appendix B Any error will abort the import with a database rollback no records will be UNC EMAQ 1 05 010 v1 3 6 ENVIRON Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE appended to the table Use the printed message to diagnose the cause of the error After correcting the error rerun the import script Table 3 1 Keyword list showing Speciation Tool shared data types Keyword Description mechanism mechanism definition mechanismPM PM 5 mechan
22. bon bonds for lumped AQM species active Character 1 Options A active T tracer Not a user input assigned by the system Table C 5 tbl_user_profile_wts Field Name Field Type Description profile_id Character 20 Profile identifier specie_id Character 20 Unique species identifier percent Numeric 10 6 Percentage of pollutant in profile UNC EMAQ 1 05 010 v1 ENVIRON C 1 Speciation Tool User s Guide Version 3 1 APPENDIX C Table C 6 Table names in the run schema created by the Speciation Tool for internal calculations Table Name Description tmp_actox Checks for profiles with 100 active toxics tmp_aqm_carbons Initialized with shared tbl_carbons Records are added for user specified toxics species tmp_calcs_byaqm Store intermediate calculations by mechanism profileld and AQM pollutant Includes moles per gram moles model species per mole emissions and average molecular weight tmp_calcs_byspc Stores intermediate calculations by mechanism profileld specield and AQM pollutant Includes moles per gram moles model species per mole emissions mole weight percent of model species grams per mole and average molecular weight tmp_calcs_haps Store intermediate calculations by mechanism profileld specield emission inventory pollutant and AQM pollutant for the user specified HAPs species Includes moles per mole moles per gram and average molecular weight tm
23. bon bonds for lumped species Table B 2 tbl_gas_profile_weights Field Name Field Type Description profile_id Character 20 Profile identifier specie_id Character 20 Unique species identifier percent Numeric 10 6 Percentage of pollutant in profile uncertainty Numeric 10 6 Uncertainty percent of pollutant unc_method Character 100 Description of method used to determine uncertainty analytic_method Character 500 Description of analytical method Table B 3 tbl_gas_profiles Field Name Field Type Description profile_id Character 20 Unique profile identifier profile_name Character 200 Profile name quality Character 10 Overall Quality Rating controls Character 100 Emission controls date_added Date Date profile added notes Character Notes total Numeric 10 5 Sum of profile percentages master_poll Character 20 Basis of profile test_method Character Test method description norm_basis Character 100 Normalization description composite Character 1 Indicates if profile is original or composite O or C standard Boolean Standard or user added profile test_year Character 50 Year testing was completed j_rating Numeric 10 2 Judgment rating based on general merit v_rating Numeric 10 2 Vintage Rating d_rating Numeric 10 2 Data quality rating based on number of observations region Character 100 Geographic region of
24. ced by the new run The run name must meet the following conditions e Begin with an alphabetic character e Must not include spaces in the name e Must not be the shared schema e Should be different from all existing run names in the Speciation Tool unless you mean to replace an existing run UNC EMAQ 1 05 010 v1 4 1 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL e Must not be public or begin with pg_ these are reserved for system schemas e Must be less than 64 characters long To examine the list of existing schemas runs in the database use this command psql lt database name gt G select from pg_namespace where lt database_name gt is the Speciation Tool database name The first column of the resulting list labeled nspname will include run names as well as system schema names The last column labeled nspacl lists the owner of each schema 4 3 Run Control File The run control file indicates the run parameters and the run specific data files required for a Speciation Tool run The format of the run control file is lt keyword gt lt option gt Only lines that begin with a keyword are recognized by the database All other lines are skipped allowing embedded comments to be used within the control file Table 4 1 summarizes the control file keywords and their options Details on each keyword are provided in Sections 4 3 1 through 4 3 3 Table 4 1 Spe
25. ciation Tool Control File Keywords Keyword Description Run Parameters MECH_BASIS Mechanism identifier name Matches identifier in the shared schema mechanism table Options provided with Speciation Tool include e CBIV e CBO5 e CB6 e SAPRC99 e SAPRC99B e SAPRCO7 e SAPRCO7T e SOA_CAMX45 e SOA_CAMX45_SP99 AE5 e AE6 OUTPUT Output options default is VOC e VOC e PM e STATIC RUN_TYPE Specifies how TOG split factors are developed Options include e CRITERIA e INTEGRATE e NOINTEGRATE e HAPLIST UNC EMAQ 1 05 010 v1 4 2 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL AQM Air quality model Determines some of the lumped species names for the output files Options e CAMX e CMAQ TOLERANCE The sum of weight percentages for a profile definition should equal 100 but sometimes it does not TOLERANCE specifies the acceptable deviation from 100 The default is5 Applies only to gas profiles Optional Input Files PRO_FILE User defined input profiles path file name TOX_FILE Toxics species path file name PRIMARY_FILE Additional toxics entries path file name PROC _FILE Mobile source process modes path file name Output Files SPLITS_OUT Output speciation profiles GSPRO path file name CNV_OUT Output conversion factors GSCNV path file name 4 3 1 Run parameters For all of the keywords below
26. e To add a single record from the command line use an INSERT statement The shared schema tbl_species carries almost 20 fields exported from the SPECIATE database The Speciation Tool references only a few of these fields The required fields are specie_id specie_name volatile_mw and non_voctog Here is an example of adding a single record to the table with only the required fields psql c INSERT INTO shared tbl_ species specie id specie name volatile mw non_voctog VALUES EG1 Example Name 70 273 FALSE The specie_id must be unique in the table you will get an error message if you attempt to add an already existing specie_id The non_voctog field is type Boolean and should be set to true if the species is not regarded as a VOC UNC EMAQ 1 05 010 v1 6 3 ENVIRON Speciation Tool User s Guide Version 3 1 APPENDIX A APPENDIX A PostgreSQL and Perl Installation Procedures UNC EMAQ 1 05 010 v1 ENVIRON Speciation Tool User s Guide Version 3 1 APPENDIX A This section provides details on installing PostgreSQL and the required Perl modules DBI DBD Pg and Text CVS on a Linux system via the Linux command line Before continuing it is recommended that you discuss these software requirements with your system administrator as you may need to be logged in as root A 1 Status of Requirements Begin by determining what is and is not installed on your system Execute the scri
27. e organic carbon lpoc explicit measured P P Pso4 O PNO3 0 E SS eS 7 PNCOM POC OM OC Ratio 1 where OM OC ratio is 1 25 for motor vehicle exhaust 1 7 for non carbon organic wood combustion 1 4 for 2669 matter PNCOM explicit in 911XX profiles other sources explicit in 911XX profiles explicit in 911XX profiles elemental carbon unspeciated PM3 5 PMFINE 1 sum of 4 species 626 797 613 626 797 613 84 Iron aluminum P P P P P 696 sodium fpna explicitingaixx profiles measured 0 24 PNH4 PSO4 for non combustion sources O for combustion sources or use measured value of hydrated 2668 water PH20 explicit in 911XX profiles water if available f unspeciated PM 5 PMOTHR 1 sum of 17 species A note on chloride from M Strum EPA OAQPS only species 795 chlorine atom is used to populate PCL rather than using species 337 chloride ion or using both 795 and 337 because in the current PM 5 profiles in SPECIATE 4 3 when chloride species 337 is present species 795 chlorine atom is also present Including both of these would be double counting In addition per communication with Adam Reff email from Adam Reff to Madeleine Strum 3 24 2011 Reff indicates that chlorine atom via XRF is a more complete representation of all forms of Cl that might be present silica Psi explicit in 911xx profiles A S T C C EC C EC FE L l l A MG K MN 488 292 694
28. ed file 3 Verify required software packages are available See Appendix A for a discussion of the software packages needed a Run sptool_reqd_checks sh 4 Set environment variables a Edit Assigns sptool set SPTOOL_HOME b Source Assigns sptool 5 Initialize the Speciation Tool database a Execute init_sptooldb_v3 1 csh 6 Execute the provided test case a Change to the run directory cd run b Run cb05_notoxics job 7 Review and compare results a Change to output directory cd output b Compare results to provided test case files UNC EMAQ 1 05 010 v1 3 1 ENVIRON Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE 3 2 Install Speciation Tool To install the Speciation Tool create a Speciation Tool home directory from which to work In the example below it is sptool but you can specify any valid directory name Copy the installation package file sptoo v3_1_June2013 tar gz to the directory and extract the Speciation Tool files gt tar xvzf sptoolv3 1 June2013 tar gz After the extraction you should see the files and directories listed in Exhibit 3 1 aqm_poll_rename csv carbons_14may2013 csv export_gas_profiles_2013_0311 csv export_gas_species_2011_0524 txt export_pm_profiles_2011_0524 txt export_pm_species_2011_0524 txt export_species_properties_2013_0311 csv invtable_hapcap_cb05soa_25may2011_v13 txt invtable_hapcapintegate_cb05soa_nomp_nohg _02aug2012_
29. ema File Formats Appendix D PM 2 5 Chemical Mechanism Definitions UNC EMAQ 1 05 010 v1 i ENVIRON Speciation Tool User s Guide Version 3 1 CONTENTS TABLES Table 3 1 Keyword list showing Speciation Tool shared data types ccccsessessesseceeeeeeeeees 3 7 Table 4 1 Speciation Tool Control File KeyWords cccccccccccceccecceeescescsessssesaeeaeceeceeeeeseeeeeess 4 2 Table 4 2 Metadata keywords and example ccccesssesssssscsececeecceceeeeeessessseeseseaaeaaesaeeseeeeeees 4 7 Table 4 3 Program and module calls from the Speciation Tool program run_sptool pl 4 9 Table B 1y CBI carDOns iiicecsisscseseeseeaeeiel oil astisaty n a ows a Wie ee est ee B 1 Table B 2 tbl_gas profile Weights ccccccccccsecsessessensesaeeeeceeeeeeeeeeessesseeesesseasaaaesseeeeeeeeees B 1 Table B 3 tbli gas profiles nenna vies levered oe en ieee ties See B 1 Table B 42 tbh invita lO ss seccc2 Sos cvs cen A E E sgssgseadevegen snegseae eed obese sagean Vands cst E B 2 Table Be5 2 tbl mechani S e a a a aa a a tes ab seusoesiens a aT B 2 Table B 6 tbl_mechanism_description cccccceccescsssssssncncaeeaeeeceeeeeceeescessseeseaaaaaeeseeseeeeeees B 2 Table BA tbl M etad A d a es Re B 2 Table B 8 tbl_pm_mechaniSm sssssssessessesesseesrrssrssssssssesreorreereresessssssssesseesererrrereeseesssssssseno B 3 Table B 9 tbl pm _profiles sernir ea A a a a a eaaa B 3 Table B 10 tbl_pm_profile_weights
30. ersion 3 1 1 0 BACKGROUND 1 0 BACKGROUND Air quality models AQMs contain a set of equations that use representative lumped modeling compounds to simulate complex atmospheric chemistry The emission inventory an important input to the AQM consists of components such as CO NO total volatile organic compounds VOCs and particulate matter PM The emission inventory components also known as pollutants or species must be converted to the lumped modeling compounds for air quality modeling The Speciation Tool is a stand alone tool that was developed to generate the factors needed to convert the emission inventory species to the AQM lumped species The conversion process is referred to as speciation The factors are referred to as split factors i e we split total VOCs into olefins aldehydes etc The chemical mechanism is the mapping of the emission inventory pollutants to the AQM compounds In the past most air quality modeling was performed based solely on criteria air pollutants CAPS However more recently the trend is to develop inventories that include both criteria and toxic air pollutants Toxic air pollutants also known as hazardous air pollutants HAPS are known to cause or are suspected of causing serious health effects The Speciation Tool supports the availability of both CAPS and HAPS It was designed to integrate the HAPS into the chemical mechanism when that is desired It is also designed to i
31. he RUM O el CP een Oo ne 4 1 A2 RUN NIME aenea at tev Fide aaa Pea ade desing in daicaa E E nellduava Get Legandeculicested Seeds 4 1 4 3 RUN G Ntrol PUG veseitenec rata eaen uaratia a anan e eaaa A a e Eaa aE RTENE 4 2 AA RUN the SPECIATION Tool apersona ni n a aa i a Aa ia aeaa 4 7 5 0 APPLICATIONS AND METHODOLOGY ssssssssssssossssescecsssssessssssessssoossssssocossssssecesssssseeeee 5 1 5 1 Gas Profile Processing ccccccccccssssssessssscssanceecseceeceseeessessnussnsnnsaesaeeeceeceueeenseasessesees 5 1 5 2 PMz2s Profile ProCeSSING ccccccccccccescesceessensenaecaeeeeceeceeeeessessenseeeseesaeaaeeeeeeeeeeeeesseeseeeees 5 2 6 0 FREQUENTLY ASKED QUESTIONS sssiscivecwus sts ccccesessccuccssnucnuanseredeuscebosetecsinaiuseaventtanenseveeasens 6 1 6 1 How dol add a single speciation profile cccssssscecceccssnseeceecsscssneeecesseseeeeeeeeeseeaaes 6 1 6 2 Can I have more than one copy of the Speciation Tool database cceeeeseeeeeeeees 6 1 6 3 How do I define a new chemical mechanism ccscccceesssnsteeeecesesneeeecceeeseeeeeeeeseeaaes 6 1 6 4 What if have a different INVTABLE ccssccccsssssscecceecssneaeceecesensaeeecesssseeeeecesessnaes 6 2 6 5 How dol add a new species to the database cceeccceesesssessensecaeeaeeeeeeeeeeesesseeeseeeees 6 3 APPENDICES Appendix A PostgreSQL and Perl Installation Procedures Appendix B Shared Schema File Formats Appendix C Run Sch
32. ism definition mechanism_description description and data source for each chemical mechanism invtable SMOKE Inventory Table gas_profiles gas profile description and historical information gas_profile_weights gas weight profiles pm_profiles PM profile description and historical information pm_profile_weights PM weight profiles rename_species rename mechanism AQM lumped species names species species data IDs names molecular weights etc carbons number of carbons for AQM lumped species name static static profiles profile weights do not change After a successful Speciation Tool initialization the PostgreSQL sptoo lv3_1 database will be created with the shared schema that holds the tool functions and default data UNC EMAQ 1 05 010 v1 3 7 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL 4 0 RUNNING THE SPECIATION TOOL A Speciation Tool run will generate the speciation factors required to convert emission inventory species e g VOC or PM2 s to lumped species e g OLE or ALD2 for air quality modeling This chapter discusses the mechanics of running the Speciation Tool which include how to run the tool and the parameters and options available The command to run the Speciation Tool is perl SPTOOL _SRC_HOME run_sptool pl lt database gt lt run_name gt lt run_control file gt The command line parameters inc
33. l main directory as shown or absolute paths If this keyword is omitted the output file name is derived from the run control parameter specifications and the run date and is written to the relative path outputs An example of a default output file name is outputs gspro_CB05_NOINTEGRATE_CAMX_26Jun2011 UNC EMAQ 1 05 010 v1 4 6 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL CNV _OUT Example CNV_OUT outputs gscnv_O2coalstudy dat The CNV_OUT optional keyword is used to specify a path and file name for the model TOG VOC conversion factors written in SMOKE GSCNV format Paths can be relative paths from the Speciation Tool main directory as shown or absolute paths If this keyword is omitted the output file name is derived from the run control parameter specifications and the run date and is written to the relative path outputs An example of a default output file name is outputs gscnv_CB05_NOINTEGRATE_CAMX_26Jun2011 Header Records Metadata The Speciation Tool output files GSPRO and GSCNV contain header records that are referred to as metadata Each of the output files has the same common metadata keywords The purpose of the metadata records is to provide a summary of the data and parameters that were used to generate the outputs Table 4 2 provides the list of metadata keywords for an example run Table 4 2 Metadata keywords and example Metadata
34. l Perl Database Interface Modules Three Perl modules are required to read in text files and communicate with the database used by the Speciation Tool UNC EMAQ 1 05 010 v1 ENVIRON A 2 Speciation Tool User s Guide Version 3 1 APPENDIX A Perl DBI The Perl Database Interface allows communication between the perl DBI Speciation Tool scripts and PostgreSQL database Perl DBD Pg This is a PostgreSQL specific database driver for the DBI module to allow per1l DBD Pg Perl to communicate with the PostgreSQL database using the DBI or Perl DBD PgPP Note that for this release of the Speciation Tool the DBD PgPP driver instead of DBD Pg was used for the installation and testing Perl Text CSV This module allows Perl scripts to parse and create CSV comma perl Text CSV separated values files Use YUM to download and install if needed all three modules Enter the following command note that the package names are case sensitive yum install perl DBI perl DBD Pg perl Text CSV Enter y when prompted to confirm the installation of these packages Note If the system displays errors indicating that the packages are not found check the spelling and case of the package names in your command As an alternative to YUM you can use the CPAN installation approach with Perl Enter the following commands perl MCPAN e shell cpan gt insta DBI cpan gt insta Text CSV cpan gt install D
35. led in the SMOKE model by either subtracting the HAPS portion from the criteria VOC or not The HAPLIST option generates the HAPS records used in SMOKE for computing NONHAPVOC CRITERIA Arun type of CRITERIA means that all VOC model species including toxics VOC species are computed from criteria VOC emissions This option is specified when there is no separate toxics emission inventory included in the modeling INTEGRATE Arun type of INTEGRATE means that the specified HAPs species are integrated from a separate emission inventory Part of the criteria VOC mass will be replaced with the HAP VOC mass from the HAP emission inventory SMOKE computes the NONHAPVOC mass from the criteria VOC mass by subtracting the HAP VOC mass The Speciation Tool creates the HAPs list using the Inventory Table data that are imported during initialization The HAPs list is composed of species compounds in the Inventory Table where the field Keep Y AND the field VOCTOG V ORT The HAPs are removed from the VOC profiles and the profiles are renormalized and generated as NONHAPVOC profiles The GSCNV output file will contain NONHAPVOC to NONHAPTOG factors The GSPRO header records list all of the toxics species that are subtracted from TOG to estimate NONHAPTOG If the Inventory Table includes process mode information for on road mobile source modeling some pollutant names will also be appended to the process mode For example NHAP NONHAPTOG BENZENE NHAP
36. lude the database name user specified run name and control file name The run_sptool p program creates the run schema reads and imports the specified run control file imports run specific data files executes the PostgreSQL functions to compute the split factors and conversion factors and writes the output files Prior to running the Speciation Tool discussed in Section 4 4 you will need to e Source the assigns file Section 4 1 e Create a run name Section 4 2 e Create a run control file Section 4 3 e Develop the input files that are required for the run Section 4 3 4 1 The Run Script The Perl program run_sptool pl creates the output speciation profile files GSPRO and GSCNV The program requires the source code directory and database name Source the Assigns sptool file to set the required environment variables SPTOOL_HOME and SPTOOL_DB This file was discussed in Section 3 4 1 If you receive an error file not found when running the script it is probably because you have not set the Speciation Tool home directory or because the path is set to an invalid path name 4 2 Run Name The run name is an identifier to uniquely label the Speciation Tool run It is used to create a schema of that name in the Speciation Tool database To create a new schema without replacing an existing one specify a run name that has not previously been used If you specify an existing run name the existing schema will be dropped and repla
37. m_poll Character 20 AQM species code split_factor Numeric 20 10 Mole based split factor numerator divisor Numeric 20 10 Denominator of the mole based factor mass_fraction Numeric 20 10 Mass fraction aq_model Character 10 Air Quality Model UNC EMAQ 1 05 010 v1 ENVIRON Speciation Tool User s Guide Version 3 1 APPENDIX C APPENDIX C Run Schema File Formats Speciation Tool User s Guide Version 3 1 APPENDIX C Table C 1 tbl_gas_process Field Name Field Type Description profile_id Character 20 Profile identifier process Character 20 Process mode Table C 2 tbl_primary Field Name Field Type Description aqminv_poll Character 20 Inventory pollutant name aqm_add Character 20 Compound name to add split_factor Numeric 12 8 Split factor for added compound writeflag Character 1 Flag N compound should be added Y compound should be replaced Table C 3 tbl_run_control Field Name Field Type Description keyword Character 20 Key word identifying function or file name datival Character Corresponding value for the key word Table C 4 tbl_toxics Field Name Field Type Description aqm_model Character 20 AQM name specie_id Character 20 Unique species identifier aqm_poll Character20 Air quality model lumped species identifier name num_carbons Numeric 6 3 Number of car
38. nclude both active species and tracer species in modeling active species are included in the chemical mechanism with chemical feedback while tracer species are included with no chemical feedback The Speciation Tool supports chemical mechanisms for both VOCs and PM UNC EMAQ 1 05 010 v1 1 1 ENVIRON Speciation Tool User s Guide Version 3 1 2 0 INTRODUCTION 2 0 INTRODUCTION This user s guide provides instructions for running the Speciation Tool version 3 1 The purpose of the Speciation Tool is to generate the chemical speciation profiles required by emissions processors for converting emission inventory compounds to air quality modeling compounds The Speciation Tool supports speciation profile entries for VOC compounds and for particulate matter less than 2 5 microns PM2 5 in diameter based on EPA s SPECIATE 4 3 profile assignments e The VOC chemical mechanisms included in the Speciation Tool are Carbon Bond Mechanism versions 4 5 and 6 CBIV CBO5 CB6 and the 1999 and 2007 Statewide Air Pollution Research Center mechanism SAPRC99 and SAPRC2007 e The PM25 mechanisms included are the CMAQ version 5 AES and version 6 AE6 aerosol mechanisms The Speciation Tool also produces the factors needed to convert VOC mass to total organic gases TOG mass this is the VOC to TOG conversion factor These factors are needed when an emission inventory is reported as VOC which is often the case Because the gas profiles are c
39. nf_v9 txt mech_pm_ae5_ae6 txt mechanism_description 14may2013 txt mechanism_14may2013_forimport txt sptool outputs Assigns sptool gscnv_CBO5_CRITERIA_CAMX_13Mar2013 init_sptooldb_v3 1 csh gspro_CBO5_CRITERIA_CAMX_13Mar2013 cb05_notoxics job process_poll csv runctl_cb05_notoxics_camx txt sptool_reqd_checks sh runctl_cb05_notoxics_cmaq txt drop_table sql import_control pl make_pm_splits sql make_splits sql mk_process_pol pl prep_out sql run_sptool pl table_defs sql table_inps sql write outputs ol Exhibit 3 1 Speciation Tool directory and file names UNC EMAQ 1 05 010 v1 3 2 ENVIRON Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE 3 3 Check for Required Software Before you begin the initialization first verify that PostgreSQL and Perl are installed and accessible Whoever is installing the Speciation Tool must have PostgreSQL permission to create a database Execute the script sptool _reqd_checks sh to make sure that the required software can be found and to verify user PostgreSQL authorizations gt sptool_reqd_checks sh Following is an example of a successful check for the required software Checking the status of software requirements Status of required software x Installed Not installed Unable to determine see notes x Perl x DBI x DBD Pg x Text CSV POSTGRESQL x PostgreSQL
40. number of messages to standard output that indicate the program s progress The messages indicate key steps as they are completed either from the Perl scripts or the PostgreSQL functions The difference between the message types is easily detected as all of the PostgreSQL messages begin with the word NOTICE Exhibit 4 1 provides an example of a typical list of run time messages for a run identified as cb05_integrate If the run name specified was used for a case run previously additional messages are written at the start of the program that indicate existing tables are being dropped e g NOTICE drop cascades to table cb05_integrate tmp_metadataset Created cb05_integrate schema Granted permissions on cb05_integrate schema Set path successfully to cb05_integrate schema Input tables created in cb05_integrate schema Completed importing User Profile Weights file user_prof_wts_2540 txt Imported run control file run_ctl_cb05_integrate txt in cbO5_integrate schema NOTICE Type of Output is VOC NOTICE AQM is CAMX NOTICE Type of runis INTEGRATE NOTICE Mechanism basis is CBO5 NOTICE Profile Tolerance is 5 NOTICE establishing profile weights NOTICE renormalizing profile weights NOTICE establishing mechanism NOTICE calculating moles per gram emissions NOTICE calculating mole percent NOTICE calculating moles per mole emissions NOTICE summing on AQM pollutant NOTICE calculating mole
41. ofile definitions and species properties It also retains the functions that compute the speciation split factors Before running the Speciation Tool PostgreSQL Perl and Perl libraries must be installed Speciation Tool scripts must be run to confirm the correct installation of these ancillary tools and to initialize the database A successful initialization will create the database load the tool functions create the shared schema with defined tables and import default data files to the shared schema The instructions for these tasks are provided in Chapter 3 UNC EMAQ 1 05 010 v1 2 1 ENVIRON Speciation Tool User s Guide Version 3 1 2 0 INTRODUCTION Chapter 4 Running the Speciation Tool provides the details for running the model run parameters and options are described A Speciation Tool run creates a named schema in the Speciation Tool database As illustrated in Exhibit 2 1 initialization creates the sptoolv3_1 PostgreSQL database with schema shared and each run will create an additional named schema based on the user s specifications In this example two runs have been made cb0O5_criteria and saprc_toxics PostgreSQL Databases sptoolv3_1 cb05_criteria run saprc toxics run Initialize and Load Data Run Parameters Optional input files Profile definitions HAPS Active tracer list Exhibit 2 1 Speciation tool initialization and run schemas Chapter 5 Application
42. omputed based on TOG while the inventory is reported as VOC the VOC to TOG conversion factor is applied to the inventory VOC to estimate TOG The speciation profiles are then applied to the TOG value with no loss of mass The output files of the Speciation Tool are intended to be used in the Sparse Matrix Operator Kernel Emissions SMOKE modeling system These are the SMOKE speciation profile file GSPRO and pollutant to pollutant conversion file GSCNV The GSCNV file generated by the Speciation Tool is formatted for SMOKE version 2 3 and higher it will not work for earlier versions of the model The Speciation Tool does not create the SMOKE speciation cross reference file GSREF you must ensure that the speciation profile codes output by this tool correspond to the codes assigned to emissions sources by the SMOKE GSREF file The Speciation Tool is a PostgreSQL database application with a Perl script interface It is designed for concurrent multiple user access where each run has a unique user specified name The Speciation Tool assigns the run name to a database schema for storing temporary tables and results As a database convention a schema is essentially a container that stores tables and functions in a selected database Think of a schema as a folder in the Speciation Tool database The shared schema in the Speciation Tool database created during initialization holds the imported data of the mechanism definitions profile descriptions pr
43. p_calcs_haps_null Stores the calculated average molecular weights for those records in tmp_calcs_haps with undefined average molecular weights tmp_error Stores run error messages tmp_gscnv Stores the output conversion factor data tmp_gspro Stores the output splits factor data tmp_haps Stores the list of HAPs extracted from the INVTABLE tmp_header Stores the NONHAPTOG header entries tmp_invtable Used for checking output pollutant name widths specified in INVTABLE tmp_mechanism Initialized with the user selected mechanism from shared tbl_mechanism or tbl_pm_mechanism Records are removed or inserted depending on run parameters tmp_metadataset Stores the metadata written to the header of the output files tmp_prfwts Stores the tmp_pm_mechanism Mechanism definition for user specified PM mechanism run tmp_pm_splits PM gt 5 split factors tmp_prfwts Initialized with tmp_raw_profiles Data records are removed and renormalized depending upon run parameters tmp_profile_list Stores the unique list of PM profiles tmp_qa_carbons Stores AQM compounds where no carbon data has been specified tmp_qa_mechanism Stores species with no corresponding mechanism definition tmp_raw_profiles Initialized with either shared tbl_gas_profile_weights tb _pm_profile_weights or tbl_user_profile_wts if user provided tmp_species_carbons Stores the calcula
44. parate toxics HAP inventory is included in addition to a total VOC inventory in the SMOKE modeling HAPLIST supports the SMOKE calculation of NONHAPTOG For PM2 5 output The only run type currently supported is CRITERIA UNC EMAQ 1 05 010 v1 4 3 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL e CRITERIA All model species including toxics species are computed from criteria emissions There is no separate toxics emission inventory included in the modeling e INTEGRATE The HAPs species from a separate emission inventory are to be integrated Part of the criteria VOC mass is replaced with the HAP VOC mass This involves subtracting toxics VOC emissions from the criteria VOC emissions to avoid double counting of VOCs Profiles are generated as NONHAPTOG e NOINTEGRATE The HAPs species from a separate emission inventory are not to be integrated i e toxics are included from both sources This case assumes that the criteria VOC mass includes HAP VOC mass The NOINTEGRATE approach is selected when sources in the criteria inventory and the toxics inventory do not have the necessary details to be definitively matched The active HAPs specified as explicit in the inventory table INVTABLE are removed from the VOC profiles but the profiles are not renormalized mass is preserved and profiles are generated as TOG e HAPLIST Generates records for the HAPs that define the SMOKE calculation of NONHAPTO
45. pt sptool_reqd_checks sh which is provided in the Speciation Tool package The script checks for the required software and user PostgreSQL authorizations gt sptool_reqd_checks sh Following is an example of a successful check for the required software Checking the status of software requirements Status of required software x Installed Not installed Unable to determine see notes x Perl x DBI x DBD Pg x Text CSV POSTGRESQL x PostgreSQL x PL pgSQL Refer to the Speciation Tool User Guide Appendix A for installation procedures of the required software Missing software modules are indicated bya whereas software modules that are installed and ready to be used are marked with x Note that if PostgreSQL is erroneously shown as not installed restarting the postgresql service can fix many of the reasons that might have caused this to occur A 2 Perl For the purposes of this guide it is assumed that Perl has already been installed on your system almost every modern Linux distribution includes Perl To verify that Perl is installed enter the following at the Linux command line perl v UNC EMAQ 1 05 010 v1 ENVIRON A 1 Speciation Tool User s Guide Version 3 1 APPENDIX A If Perl is present information about the version will be displayed Additional interfaces and modules for Perl need to be installed that will allow the Speciation Tool to read text files
46. ptoolv3_1 to any valid PostgreSQL database name as long as the one you choose does not already exist The command line psql l hyphen lowercase L will display a list of existing PostgreSQL databases Restrict the database name s characters to a z 0 9 and the underscore _ and use no embedded blank characters After the Assigns sptoo file has been updated source the file to set the required environment variables gt source Assigns sptool 3 4 2 Create the Speciation Tool database The initialization script init_sptooldb_v3 1 csh is a C shell script that checks for required environment variables executes a set of PostgreSQL commands to create the Speciation Tool database sets database permissions creates the shared schema and table definitions for the tool data and imports Speciation Tool SQL functions and data to the shared schema The functions imported by the script perform the computations needed for generating the speciation profiles and pollutant to pollutant factors that are output by the program gt init_sptooldb v3 1 csh Messages are printed to the screen to reflect installation progress The first part of a successful initialization will look similar to this gt init_sptooldb_v3 1 csh SPTOOL_SRC_HOME disk4 models emis sptool src New database SPTOOL_DB sptoolv3_1 SPTOOL_USER yourusername POSTGRES BIN usr local pgsql bin CREATE DATABASE Database sptoolv3_1 created CREATE SCH
47. rovided in Appendix C PRO_FILE Example PRO_FILE ctl prfwts_O2coalstudy dat The PRO_FILE keyword is used to specify a file of gas profiles Specifying this option will override using the gas profiles defined in the shared schema The profiles provided in this input file are those for which the model will generate the splits and conversion factors PRO_FILE is an optional keyword in the control file The default is to use the profile definitions in the shared schema At this time only one set of profiles is used per run either the shared data or the data provided using the PRO_FILE keyword If speciation profiles are required from both sources separate runs are required TOX_FILE Example TOX_FILE ctl toxics_coalstudy dat The toxics file is applicable only to VOC output This file is required for run types INTEGRATE NOINTEGRATE and HAPLIST The file lists the toxics compounds that are explicit in the chemical mechanism The Speciation Tool uses the information in the Inventory Table imported to the shared schema during initialization to determine whether each HAP is to be treated as an active or a tracer compound an active compound is indicated with a Y in the INVTABLE explicit field Active species are included in the chemical mechanism with chemical feedback while tracer species are included with no chemical feedback Tracer toxics species mass is double counted For the INTEGRATE case i e RUN_TYPE INTEGRATE the acti
48. s and Methodology provides additional details on the Speciation Tool calculations Chapter 6 Frequently Asked Questions addresses both basic and advanced questions on using the Speciation Tool UNC EMAQ 1 05 010 v1 2 2 ENVIRON Speciation Tool User s Guide Version 3 1 3 0 INITIALIZE THE SPECIATION TOOL DATABASE 3 0 INITIALIZE THE SPECIATION TOOL DATABASE The Speciation Tool is written in PostgreSQL using the Perl Database Interface DBI and CSV parser Text CSV These software products are open source and available on the internet You must install PostgreSQL and Perl prior to running the Speciation Tool Appendix A has instructions on installing these packages and on options required The Speciation Tool must be initialized prior to making any runs Initialization steps include e Get the Speciation Tool package e Extract files e Set the home directory e Run the initialization script Section 3 1 provides a concise step by step approach designed for those already familiar with software setup and database applications Those with less experience can use Section 3 1 as an outline of the steps needed and then move on to the detailed information given in Sections 3 2 through 3 4 3 1 Quick Start 1 Create a Speciation Tool directory 2 Extract the Speciation Tool installation files a Change to the Speciation Tool directory b Copy the Speciation Tool package to this directory c Extract and uncompress the zipp
49. st of species that define the mechanism a flag qualify to define the species that determine the profiles to process and the AQM pollutant name to be assigned to any unspecified PM mass e g PMFINE A profile is processed if it contains one or more species that are flagged qualify For each profile that matches the selection criteria only the species that are specifically defined in the chemical mechanism definition will be included in the outputs Each PM2 gt 5 chemical mechanism definition must have a single record specifying the AQM pollutant to compute it does not matter whether the specified computed pollutant is a component of the profile definition The unspecified mass component is defined as 1 0 minus the sum of the mass fractions of the mechanism compounds In the AE5 chemical mechanism the unspecified mass is assigned to PMFINE and in AE6 it is assigned to the output species PMOTHR UNC EMAQ 1 05 010 v1 5 3 ENVIRON Speciation Tool User s Guide Version 3 1 6 FAQ 6 0 FREQUENTLY ASKED QUESTIONS 6 1 How dol add a single speciation profile The easiest method of processing one or more new profiles is to use the run control keyword PRO_FILE The profile definition is imported to a run schema table If this table is populated only profiles in the run schema are processed 6 2 Can I have more than one copy of the Speciation Tool database Yes If you want to rerun the Speciation Tool initialization and keep an
50. te a file with the record SAPRC99_BENZ BENZ 6 Import the file to the shared carbon table perl import _rawdata pl database name carbons lt new_carbon_ file txt gt 4 Update the mechanism description table Create a file with the record SAPRC99_BENZ SAPRC99 with explicit benzene Y lt description gt Import the file to the shared mechanism description table perl import _rawdata pl database name mechanism description lt new file txt gt The mechanism description table carries the field NONSOA Flag which defines whether the mechanism treats SOA explicitly The CBIV CB05 and SAPRC99 mechanisms all have the NONSOA flag set to Y Only the SOA_CAMX45 mechanism has the flag set to N 6 4 What if have a different INVTABLE The SMOKE INVTABLE data is imported as part of the Speciation Tool initialization Currently the tool does not allow an optional input of inventory data for a single run If you need to use only your version of the INVTABLE replace the INVTABLE file name that is referenced in the Assigns sptoo before you initialize the database UNC EMAQ 1 05 010 v1 6 2 ENVIRON Speciation Tool User s Guide Version 3 1 6 FAQ If you need to use multiple versions for your processing applications you will need multiple versions of the Speciation Tool database each importing a different INVTABLE during initialization refer to question 6 2 above 6 5 How do I add a new species to the databas
51. ted number of carbons for each species tmp_spcinp Stores user specified species that have invalid molecular weights tmp_sums Stores the profile weights percent sums during renormalization UNC EMAQ 1 05 010 v1 ENVIRON C 2 Speciation Tool User s Guide Version 3 1 APPENDIX D APPENDIX D PM Chemical Mechanism Definitions Speciation Tool User s Guide Version 3 1 APPENDIX D Table D 1 represents the AE5 and AE6 chemical mechanism definitions Table D2 prepared by EPA provided the information used to fill in Table D1 Table D 1 Chemical Mechanisms AE5 and AE6 as input to the Speciation Tool Chemical Mechanism SpecielD AQM Pollutant Qualify Compute AES AES 626 POC T F AE5 797 PEC T F AE5 699 PSO4 T F AE5 613 PNO3 T F AE5 PMFINE F T AE6 AE6 626 POC F F AE6 797 PEC F F AE6 699 PSO4 F F AE6 613 PNO3 F F AE6 784 PNH4 F F AE6 2669 PNCOM T F AE6 488 PFE F F AE6 292 PAL F F AE6 694 PSI F F AE6 715 PTI F F AE6 329 PCA F F AE6 525 PMG F F AE6 669 PK F F AE6 526 PMN F F AE6 696 PNA F F AE6 795 PCL F F AE6 2668 PH20 T F AE6 PMOTHR F T UNC EMAQ 1 05 010 v1 D 1 ENVIRON Speciation Tool User s Guide Version 3 1 APPENDIX D Table D 2 Chemical Mechanisms AE5 and AE6 as defined by EPA SPECIATE Species speciesID Species Description Name Calculation CMAQ AES ee Ye e
52. ter 6 FAQ list for these details The Speciation Tool also has the capability to generate speciation profiles for secondary organic aerosols SOA to support air quality models such as CAMx that have an explicit SOA scheme This is accomplished through the use of the chemical mechanism SOA_CAMX45 which is included in the initialization data When using the SAPRC99 mechanism keep in mind that the carbon content of VOC or TOG emissions is not conserved through the SAPRC99 speciation step that the output mass fractions in the GSPRO file are sensitive to the number of carbons assumed for each species and that carbon numbers are not well defined for SAPRC99 lumped species This uncertainty does not influence the output modeling emissions in molar units Output emissions reported in mass units such as speciated SMOKE reports however do inherit this uncertainty and therefore should be considered as qualitative rather than quantitative information 5 2 PM Profile Processing The Speciation Tool also supports speciation profile entries for PM2 5 At this time only the CRITERIA run option is supported for PM processing The chemical mechanism definitions imported during initialization include the CMAQ aerosol mechanisms AE5 and AE6 Appendix D provides these mechanism definitions UNC EMAQ 1 05 010 v1 5 2 ENVIRON Speciation Tool User s Guide Version 3 1 5 0 APPLICATIONS AND METHODOLOGY The PM2 5 chemical mechanism definitions include a li
53. tical method UNC EMAQ 1 05 010 v1 ENVIRON B 3 Speciation Tool User s Guide Version 3 1 APPENDIX B Table B 11 tbl_rename_species Field Name Field Type Description aq_model Character 10 AQM Model mechanism Character 20 Mechanism name eminv_poll Character 20 Compound name aqm_poll Character 20 Replacement AQM compound name Table B 12 tbl_species Field Name Field Type Description specie_id Character 20 Unique species identifier specie_name Character 100 Species name CAS Character 50 CAS identifier epaid Character 50 EPA identifier saroad Character 10 Old SAROAD code pams Boolean Yes or No to PAMS haps Boolean Yes or No to HAPs symbol Character 10 Symbolic name molecular_weight Numeric 20 12 Molecular weight of specie non_voctog Boolean Yes or No to non volatile organic gas non_vol_wt Character 20 Non volatile weight unknown_wt Character 20 Unknown weight unassign_wt Character 20 Unassigned weight exempt_wt Character 20 Exempt weight volatile_mw Numeric 20 12 Volatile molecular weight num_carbons Numeric 20 12 Number of carbon bonds epa_itn Character 20 EPA internal tracking number comment Character 50 Comments Table B 13 tbl_static Field Name Field Type Description profile_id Character 20 Profile identifier eminv_poll Character 20 Emission inventory pollutant code aq
54. ting PostgreSQL database is gt dropdb SPTOOL_DB Once you either drop the existing database or change the assigned name you can perform the initialization again 3 4 3 Load the Speciation Tool shared schema data The final step in initializing the Speciation Tool is to load the data that are provided in the distribution package This information includes species properties chemical mechanism definitions speciation profile definitions from SPECIATE 4 3 and some additional general information that is shared by all Speciation Tool runs The data are imported into the Speciation Tool database during initialization and stored in tables in the Speciation Tool PostgreSQL database shared schema A database contains one or more named schemas which in turn contain tables and other objects The same table name can be used in different schemas without conflict for example in Exhibit 2 1 the cb05_criteria and saprc_toxics schemas can both contain the same table names Unlike PostgreSQL databases schemas are not rigidly separated so users can access tables in any of the schemas within the same database The Speciation Tool shared schema is accessed by all Speciation Tool runs the tables are shared The input data files reside in the import_data subdirectory of the Speciation Tool home directory The file names are assigned to environment variables in the Assigns sptool file and do not need to be changed UNC EMAQ 1 05 010 v1 3 5 ENVIRON
55. ty Rating controls Character 150 Emission controls date_added Date Date profile added notes Character Notes total Numeric 10 5 Sum of profile percentages master_poll Character 20 Basis of profile test_method Character Test method description norm_basis Character 100 Normalization description composite Character 1 Indicates if profile is original or composite O or C standard Boolean Standard or user added profile incl_gas Boolean test_year Character 50 Year testing was completed j_rating Numeric 10 2 Judgment rating based on general merit v_rating Numeric 10 2 Vintage Rating d_rating Numeric 10 2 Data quality rating based on number of observations region Character 100 Geographic region of relevance lower_size Numeric 10 4 upper_size Numeric 10 4 sibling Character 20 Profile_ID of PM profile from same study data_origin Character 50 Originating organization primary_prof Boolean description Character Profile description documentation Character Documentation of profile origin Table B 10 tbl_pm_profile_weights Field Name Field Type Description profile_id Character 20 Profile identifier specie_id Character 20 Unique species identifier percent Numeric 12 6 Percentage of pollutant in profile uncertainty Numeric 12 6 Uncertainty percent of pollutant unc_method Character 100 Description of method used to determine uncertainty analytic_method Character 500 Description of analy
56. ve and tracer toxics species are removed from the VOC profiles whereas for the NOINTEGRATE case only active toxics species are removed from the VOC profiles For the case where HAPLIST is the specified RUN_TYPE the active HAPs produce a single one to one mapping from HAPs inventory pollutant to model compound The tracer HAPs generate the same mapping as the active HAPS but in addition the tracer HAPs inventory pollutants are mapped to the original VOC profile compounds to support the INTEGRATE case The HAPLIST UNC EMAQ 1 05 010 v1 4 5 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL case also generates nointegrate HAPs by appending the suffix _ NOI to the model compound name for example BENZENE_NOI PRIMARY_FILE Example PRIMARY_FILE ctl primary_toxics_coalstudy dat You can add or override toxics entries by providing a primary toxics list This file is used only when the run type is HAPLIST if a primary toxics list is specified for any other run type the data are ignored The file determines whether toxics species are added to or replaced in the GSPRO file This capability allows the Speciation Tool to support one to many toxics species mapping and primary toxics profiles The file format and example are as follows lt Inv poll gt lt AQM name gt lt splitfac gt lt overwrite flag gt FORMALD FORM PRIMARY 15 0 N ACETALD ALD2 PRIMARY 1 0 N XYLS MXYL 0 52 Y XYLS
57. version factors and writes the output files After the script has been run the run specific schema retains the run parameters input data intermediate calculations and final results Appendix C includes the run based schema table formats for the input data and a list of the database tables created during a run The Speciation Tool is driven by the Perl program run_sptool p Table 4 3 summarizes the program steps In addition to the commands below numerous data and processing checks are performed in the run script Table 4 3 Program and module calls from the Speciation Tool program run_sptool pl Command line Language Description SELECT inputs_createtables Executes PostgreSQL commands in table_inps sql e Creates tables in the run id schema import_control pl Perl Imports the run control data and optional user specified input data UNC EMAQ 1 05 010 v1 4 9 ENVIRON Speciation Tool User s Guide Version 3 1 4 0 RUNNING THE SPECIATION TOOL SELECT MakeSplits SELECT MakePMSplits SELECT PrepOut write_outputs pl SQL If VOC processing Executes PostgreSQL commands in make_splits sql e Creates tables in the run_id schema e Performs data validity checks e Performs numerous calculations to generate the gas split factors If PM25 processing Executes PostgreSQL commands in make_pm_splits sql e Creates tables in the run_id schema e Performs data validity checks e Performs calculations to gener
58. with the import_rawdata p Perl program perl SPTOOL SRC_HOME import_rawdata pl SPTOOL DB table type input file UNC EMAQ 1 05 010 v1 6 1 ENVIRON Speciation Tool User s Guide Version 3 1 6 FAQ where table_type is the keyword from Table 1 in this example it would be either mechanism carbons or mechanism_description input_file contains the specified new records Alternatively rather than appending records to three separate shared schema tables tbl_ mechanism tbl_carbons tbl_mechanism_description a new version of the Speciation Tool could be generated refer to question 6 2 above The new mechanism definition data could be imported as part of the initialization process These data could be appended to existing files or not depending on your processing preferences The example below illustrates how to introduce a new mechanism SAPRC99 with explicit benzene 1 Update the mechanism table Extract the SAPRC99 entries from the import file grep SAPRC99 mechanism mar2013_forimport txt gt mechanism saprc99 wexpl_benz txt Edit the new file Change SAPRC99 to SAPRC99_ BENZ on all records Delete existing benzene specie_id 302 assignments of ARO1 and NROG Add explicit benzene entry SAPRC99_ BENZ 302 BENZ 1 2 Import the new mechanism file to the shared mechanism table perl import _rawdata pl database name mechanism mechanism_saprc99 wexpl benz txt 3 Update the carbon table Crea

Download Pdf Manuals

image

Related Search

Related Contents

ダウンロード(日本語)  dragon-age-inquisition  Kombi Feedback Switch bearbeitet.pages  AJ210/12 Philips Radio-réveil station météo  Système 1 - système avancé de perfusion - Terumo    取扱説明書 - 株式会社グリーンウッド  InviMag Universal Kit/ KFDuo User manual  Online Invoice User Manual - Agency    

Copyright © All rights reserved.
Failed to retrieve file