### TECHNICAL MEMORANDUM

DATE : August 2013

TO: Docket EPA

- HQ

- OAR

- 2010

- 0929

FROM: Jennifer Bohman, Climate Change Division, US EPA

SUBJECT: Technical Approach and Design of the Inputs Verification Tool

1. Introduction and Purpose

The purpose of this memorandum is to provide a detailed description of EPA ’ s technical

approach and design for the inputs v erification t ool

. Section 2 describes how users would

interact with the inputs verification tool using the electronic Greenhouse Gas Reporting Tool’s

( e

- GGRT ) two reporting options as well as the basic function s of the tool. S ection 3 describes

the database design for the e

- GGRT application and data structure for the inputs verifi cation tool.

S ection 4 describes how the inputs verifi cation t ool would manage data for the two reporting

options.

2. Description

The inputs verifi cation tool would accommodate the two reporting options currently available in

e

- GGRT : entry of data on web forms and the upload of data in XML files

. This section

describes how users would interact with the inp uts verifi cation tool for both of these reporting

options as well as the basic function s of the tool

.

For the web form reporting option , u sers would enter their annual GHG report information in the

e

- GGRT application and their inputs to emission equations in the inputs verification tool. The

inputs verification tool would calculate emission results, conduct verification checks on the

inputs to emission equations, and generate a verification summary listing the re sults of the

verification check. The inputs to equations would not be saved and would be immediately

deleted when the user logs out of e

- GGRT , closes the browser , or if the user’s s ession times out

due to an extended period (e.g., 25 minutes) of inactivity

. Only the verification summary as well

as the data reporting elements required in the annual GHG report would be saved to the e

- GGRT

database and accessible during subsequent user sessions

.

The inputs verification tool would be built into the e

- GGRT application. To access the inputs

verification tool, users would log in to e

- GGRT with their username and password, select their

facility, and navigate to the “Data Reporting” section of e

- GGRT. Within this section of the

application, users w ould be clearly directed to open the inputs verifi cation t ool when requi red to

enter inputs . The inputs verification tool would then present web forms where users would enter

their inputs to equa tions. The inputs verification tool screens would differ in appearance from the

### regular e

- GGRT screens, as a visual cue to users that they are entering data in the inputs

verification tool and that the data is handled differently. The inputs verification tool would

perform checks to verify that the inputs to equations data is complete, that data elements are

within the expected ranges, and whether expected relationships exist between inputs to equat ions

data and other data entered for the facility that is part of the annual GHG report. The inputs

verification tool would also calculate emissions values, which would automatically be included

into the annual GHG report unless the facility elects to ente r an alternate result. Attachment 1

includes several screen captures of the inputs verification tool screens within e

- GGRT.

For the XML upload reporting option , users would upload an XML file containing their entire

annual report data submission that con forms to the published e

- GGRT XML Repor ting Schema.

Additionally, user s would upload a separate XML file containing a complet e set of inputs to

eq uations data that conforms to the inputs verifi cation tool XML schema (see S ection 3 of this

memorandum for a dditional information on the inputs verification tool schema). Similar to the

web form reporting option , the inputs verification tool would calculate emission results based on

the inputs file uploaded, conduct verification checks on the inputs to emission equations,

compare calculated results to those included in the annual report XML file, and generate a

verification summary listing the results of the verification check. The inputs to equations XML

file would not be saved and would be immediately deleted when the user logs out, closes the

browser, or if the user’s session times out due to an extended period (e.g., 25 minutes ) of

inactivity

. Only the verification summary as well as annual GHG report XML file would be

saved to the e

- GGRT database and acces sible during subsequent user sessions.

For the XML upload option, there would be no inputs verifi cation t ool screens. Instead, user s

would be prompted to upload their annual report XML file and to upload their inputs to

equations XML file . The inputs verifi cation t ool would then process the files in the background.

When completed, users would be taken to a summary screen th at presents a comprehensive

verification s ummary for review.

3. Design

This section describes the database design for the e

- GGRT application and the inputs verifi cation

tool. This design ensures that data entered into or used by the inputs verifi cation tool would not

be saved to the e

- GGRT database. This section also describes how this design would be used

for the two repo rting options

.

T he e

- GGRT application and the inputs verification tool would have separate data structures.

The data structure for the e

- GGRT application defines how data in the annual report is organized

and stored. Therefore, the e

- GGRT data structure would only provide for storage of annual

report data elements and associated metadata elements (e.g., date/timestamps, status values, etc.).

The data structure for the inputs verification tool would define how the inputs to equations are

organized and wo uld only provide for in

- memory handling of inputs to equations and associated

metadata elements. The segregation of the two data structures would ensure that annual report

data is not comingled with inputs to equations

.

### For the web forms reporting option , users would enter annual report data into e

- GGRT web

forms

. These annual report data are persisted to an Oracle relational database maintained by

EPA as the user navigates through the e

- GGRT web application and takes certain actions (e.g.,

clicking a “SAVE” or “NEXT” button). Users would e n ter i nputs into the inputs verifi cation

tool

, but the data would not be saved to the Oracle rela tional datab ase (see S ection 4 of this

memorandum for additional details). Upon generating an annual report, annual report data

stored in the relational database is retrieved and formatted in accordance with the published e

GGRT XML Reporting Schema. The reporting s chema does NOT contain any data element

definitions for inputs to emission equations

, ensuring that annual GHG reports would exclude

these inputs.

For the XML reporting option, users w ould upload two XML files, one file with the annual GHG

report data ( comporting with the e

- GGRT data structure) and one file with inputs to equations

(comporting with the inputs verification tool data structure). Data from each file w ould be

loaded into their corresponding and separate data structures. If a user attempte d to upload an

XML annual report file containing extraneous/additional data elements

, it would be rejected as

invalid. EPA w ould conduct verification checks on the inputs to equations stored temporarily in

session memory and generate a verification summar y. EPA w ould not save the inputs to

equation s file. EPA w ould only save the file with the annual GHG report data and the resulting

verification summary.

Attachment 2 shows the e

- GGRT data structure and demonstrates that no table or column exists

to stor e the inputs to equations data elements. It also contains the data structure for the inputs

verification tool prototype developed for subpart X , mass balance methodology

.

4. Data Management

This section describes how the inputs verifi cation t oo l would manage data for the two reporting

options.

For the web form reporting option, users w ould enter data into the inputs verifi cation tool web

forms. As the user enters this data

, it would be temporarily stored to an area of the applicat ion

server called th e s ession. Th e session is a temporary, in

- memory structure of the server hosting

the e

- GGRT application. A separate, unique session is launched with each login. The session is

terminated when the user logs out , closes the browser, or when the inactive pe riod is reached

. It

is not possible for another, unauthorized user to share the same session, even by logging in with

the same username and password of a user who is currently logged in. By design, Java Web

application servers such as those that would be used by the inputs verifi cation tool prohibit users

from viewing another user’s session

.

Each session would only be visible to the user connected to the inputs verification tool and the e

GGRT application. E

- GGRT uses two load

- balanced application server s and a separate database

server. Session data is not persisted (saved) to disk memory on the application or database server

and is not replicated in any way. When a session ends, session data is immediately and

permanently deleted. It does not persist in any form. For example, session data is not sent to a

recycle bin or deleted items folder. Because the inputs to equations data would not be saved to

### the database or disk, the data would not be overwritten, copied, replicated, or backed up. No

permanent c ookies would be used by the inputs verifi cation tool.

EPA anticipates that some users w ould not be able to enter all their inputs to equations into the

inputs v erification tool web forms during one sitting . Alternately, some users may want to

update or correct inputs that were entered during a prior session without having to re

- enter all

their inputs to equations

. Because the inputs verifi cation tool would not save data, users w ould

be responsible for saving an d uploading their inputs data if they do n ot plan to enter all inputs to

equations as well as submit their annual report in the one e

- GGRT session

. T he inputs

verifi cation tool w ould assist users in this process. D uring each session, users w ould have the

option to export their inputs data that is currently in session or to import a previously exported

inputs dat a file . If a user chooses the export option, the inputs verifi cation tool would create a zip

file containing an XML file and a human

- readable HTML file of th eir data that the user c ould

save to their computer or network file system

.

For the XML reporting option, users w ould upload the inputs verifi cation tool file as described in

Sections 2 and 3 of this memorandum. As with the web forms reporting option, t he inputs

verifi cation tool would temporarily store the data to the session. The inputs verification tool

would then manage the data in the same way as described for the web form reporting option.

A ttachment 3 shows the code struc ture for the inputs verifi cation tool load ing the inputs XML

(for those using the XML reporting method ) and the code that uses the data without persist ing

the data at any point.

## Attachment 1

- Screen Captures of Inputs Verifi cation Tool

### Page 1 Purpose: This attachment provides a brief overview of how the i nputs v erifi cation t ool functions from the user’s

perspective (for the web forms reporting option).

To access the inputs verification tool, users would log in to e

- GGRT with their username and password, select

their facility, and navigate to the “Data Reporting” section of e

- GGRT. In the screenshot below, the user has

selected the “Data Reporting” tab a nd also entered the Subpart X reporting module . They have added a

petrochemical processing unit that has been named “ Methanol Unit 101 ” and they have added one carbon

containing feedstock and one carbon

- containing product for the process unit.

Figure 1. e

- GGRT Data Reporting Screen

From this screen , t he u ser would use the button labeled “ U se Inputs Verifier to calculate | GO ” to access the

inputs verification module and enter equation inputs for the feedstock(s) and product(s) they have added.

### Page 2 The screens in the inputs verification tool module are different in appearance and are indicated by a label in the

title bar.

Figure 2. I nputs V erifier Tool Screen

The u ser will enter data in the inputs fields

. Please n ote that e very field for inputs to equations states that the

data “ will not be stored by EPA”

.

### Page 3 The user will continue entering inputs to equations.

Figure 3. Enter Inputs and Calculate

After entering inputs to equations

, the user would click the “ SAVE ” button

, shown in Fig ure 3

.

The inputs verification tool will calculate the result of the e quation for which the user is entering inputs.

### Page 4 Figure 4. Before Exporting An Inputs Data File

In the FACILITY’S INPUTS VERIFIER FILE section of the screen , the m essage states “Inputs Data Not

Saved” (indicated in Figure 4).

The u ser would click “Save Inputs Data Locally” (indicated in Figure 4 ) to export the inputs data and save t he

inputs data file to their computer.

### Page 5 Figure 5. After Exporting An Inputs Data File

The message will change to “Inputs Data Loaded” and the information in the “ Exported By (Date) ” field will be

updated (indicated in Figure 5)

.

The user can log out of e

- GGRT (shown in the red outline) and then log in again later to continue entering data

by loading the inputs data file that they saved to their computer

.

### Page 6 Figure 6. e

- GGRT Log i n Screen

The user can log in again with their e

- GGRT username and password to resume entering inputs data.

### Page 7 After logging in again, t he user would navigate to the Data Reporting section of e

- GRRT

. As described

previously

, the user would click the “Use Inputs Verifier to calculate | GO” button to open the inputs

verification tool module

.

Figure 8 shows the inputs verification tool screen before the user has l oad ed an i nputs d ata f ile

.

Figure 7

. Inputs Verifier Screen Before Loading An Inputs Data File

As shown in Figure 7 , t he i nputs fields are blank . This is because the system did not store inputs data from the

user’s previous session.

In the FACILITY’S INPUTS VERIFIER FILE section of the screen, the message states “Inputs Data Not

Loaded”. To load an inputs data file, t he user would click the link labeled “ Temporarily Load Inputs Data

.

### Page 8 The user would browse to and select the inputs data file saved to their local computer. The user would then

click the “ Import ” button to load the file to the inputs verification tool

.

Figure 8

. L oading A Saved Inputs Data File

### Page 9 Figure 9

. After L oading An Inputs Data File

After importing the inputs file, t he message will change to “Inputs Data Loaded” and the i nputs fields will be

populated with information from the inputs data file that the user imported

.

## Attachment 2 . Data Structure

### Database Structure

Figure 1 contains a sample annual GHG report (in XML) for Subpart X that is properly formatted . This file

would be submitted to EPA and saved in the e

- GGRT database

. Note that there are no equation inputs contain ed

in the annual report file structure. Figure 2 contains a sample Inputs Verification Tool file (in XML) for Subpart

X that is properly formatted . This file would be generated and used by the Inputs Verification Tool. This file

wo uld not be saved to the eGGRT database. This file would be saved and maintained by reporters on their local

machines. Figure 1 and Figure 2 demonstrate that inputs data would not be intermixed with annual report data,

but kept in separate data structures . Only the annual report data (as seen in Figure 1 ) would be saved by EPA.

Figure 1 : XML Structure for Subpart X Annual GHG Report

- < GHG xmlns =" http://www.ccdsupport.com/schema/ghg ">

- < FacilitySiteInformation >

< CertificationStatement > The designated representative or alternate designated representative must

sign (i.e., ag ree to) this certification statement. If you are an agent and you click on "SUBMIT",

you are not agreeing to the certification statement, but are submitting the certification

statement on behalf of the designated representative or alternate designated repr esentative

who is agreeing to the certification statement. An agent is only authorized to make the

electronic submission on behalf of the designated representative, not to sign (i.e., agree to) the

certification statement. </ CertificationStatement >

< Repo rtingYear > 2012 </ ReportingYear >

- < FacilitySiteDetails >

- < FacilitySite >

< FacilitySiteIdentifier > 509238 < / FacilitySiteIdentifier >

< FacilitySiteName > Peregrinus Industries </ FacilitySiteName >

</ FacilitySite >

- < LocationAddress >

< LocationAddressText > 100 Oak </ LocationAddressText >

< LocalityName > McLean </ LocalityName >

- < StateIdentity >

< StateCode > VA </ StateCode >

</ StateIdentity >

< AddressPostalCode > 22124 </ AddressPostalCode >

</ LocationAddress >

< CogenerationUnitEmissionsIndicator > N </ CogenerationUnitEmissionsIndicator >

< PrimaryNAICSCode > 112111 </ PrimaryNAICSCode >

- < ParentCompanyDetails >

- < ParentCompany >

< ParentCompanyLegalName > US GOVERNMENT </ ParentCompanyLegalName >

</ ParentCompany >

</ ParentCompanyDetails >

< TotalNonBiogenicCO2eFacilitySubpartsCtoJJ massUOM =" Metric

Tons "> 306892.8 </ TotalNonBiogenicCO2eFacilitySubpartsCtoJJ >

< TotalBiogenicCO2FacilitySubpartsCtoJJ massUOM =" Metric

Tons "> 0 </ TotalBiogenicCO2FacilitySubpartsCtoJJ >

< TotalCO2eSupplierSubpartsKKtoPP massUOM =" Metric Tons "> 0 </ TotalCO2eSupplierSubpartsKKtoPP >

- < SubPartInformation >

- < SubPartX >

- < GHGasInfoDetails >

< GHGasName > Biogenic Carbon dioxide </ GHGasName >

- < GHGasQuantity massUOM =" Metric Tons ">

< CalculatedValue > 0 </ CalculatedValue ></ GHGasQuantity >

</ GHGasInfoDetails >

- < GHGasInfoDetails >

< GHGasName > Methane </ GHGasName >

- < GHGasQuantity massUOM =" Metric Tons ">

< CalculatedValue > 0 </ CalculatedValue >

</ GHGasQuantity >

</ GHGasInfoDetails >

- < GHGasInfoDetails >

< GHGasName > Nitrous Oxide </ GHGasName >

- < GHGasQuantity massUOM =" Metric Tons ">

< CalculatedValue > 0 </ CalculatedValue >

</ GHGasQuantity >

</ GHGasInfoDetails >

- < GHGasInfoDetails >

< GHGasName > Carbon Dioxide </ GHGasName >

- < GHGasQuantity massUOM =" Metric Tons ">

< Cal culatedValue > 3849.1 </ CalculatedValue >

</ GHGasQuantity >

</ GHGasInfoDetails >

- < CEMSDetails >

- < CEMSUnitDetails >

- < UnitIdentification >

< UnitName > xCEMS </ UnitName >

< UnitType > Petrochemical process unit </ UnitType >

</ UnitIdentification >

- < XProductDetails >

< PetroChemicalProductType > Methanol </ PetroChemicalProductType >

- < ProductQuantity massUOM =" Metric Tons ">

< MeasureValue > 11111 </ MeasureValue >

</ ProductQuantity >

</ XProductDetails >

</ CEMSUnitDetails >

</ CEMSDetails >

- < MassBalanceDetails >

- < UnitIdentification >

< UnitName > Methanol Unit 101 </ UnitName >

< UnitDescription > methanol production unit </ UnitDescription >

< UnitType > Petrochemical process unit </ UnitType >

</ UnitIdentification >

- < AnnualCO2Emissions massUOM =" Metric Tons ">

< CalculatedValue > 33101.1 </ CalculatedValue >

</ AnnualCO2Emissions >

< CombustionUnitIdentifiers > None </ CombustionUnitIdentifiers >

- < ProductFeedStockDetails >

< ProductOrFeedstockIndicator > Feedstock </ ProductOrFeedstockIndicator >

< Type > Natural gas </ Type >

< PhysicalState > Gaseous < / PhysicalState >

- < FlowMeterDetails >

< ManufacturersRecommendedMethod > Twice weekly

measurements </ ManufacturersRecommendedMethod >

< CalibrationMethod > Twice weekly calibrations </ C alibrationMethod >

</ FlowMeterDetails >

- < AnnualQuantity massUOM =" Metric Tons ">

< MeasureValue > 500250 </ MeasureValue ></ AnnualQuantity >

- < MonthlyDetails >

< MonthName > January </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > February </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calc ulated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > March </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ MolecularWeightMethod >< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > April </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calc ulated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > May </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > June </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >< MolecularWeightMethod > Calc ulated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > July </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ Molecu larWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > August </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubst itutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > September </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ Molecu larWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > October </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubs titutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > November </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ Molecu larWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > December </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSub stitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

< / CarbonContent >< CarbonContentMethod > ASTM D5373

- 08 </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

< MolecularWeightMethod > Calculated based on chemical formula and atomic

weights </ MolecularWeightMethod >

< VolumeTemperatureBasis > 60 degrees Fahrenheit </ VolumeTemperatureBasis >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

</ ProductFeedStockDetails >

- < ProductFeedStockDetails >

< ProductOrFeedstockIndicator > Product </ ProductOrFeedstockIndicator >

< Type > Methanol </ Type >

< PhysicalState > Liquid </ PhysicalState >

- < FlowMeterDetails >

< ManufacturersRecommendedMethod > twice monthly

measurements </ ManufacturersRecommendedMethod >

< CalibrationMethod > twice monthly calibrations </ CalibrationMethod >

</ FlowMeterDetails >

- < AnnualQuantity massUOM =" Metric Tons ">

< MeasureValue > 678260 </ MeasureValue >

</ AnnualQuantity >

- < MonthlyDetails >

< MonthName > January </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > February </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >< MonthName > March </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > April </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > May </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > June </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > July </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > August </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > September </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails ></ MonthlyDetails >

- < MonthlyDetails >

< MonthName > October </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > November </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

- < MonthlyDetails >

< MonthName > December </ MonthName >

- < OtherProductFeedStockDetails >

- < VolumeorMass >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ VolumeorMass >

< VolumeorMassMethod > Tank level measurements </ VolumeorMassMethod >

- < CarbonContent >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ CarbonContent >

< CarbonContentMethod > SW

- 846 Method 9060A </ CarbonContentMethod >

- < MolecularWeight >

< IsSubstitutedIndicator > N </ IsSubstitutedIndicator >

</ MolecularWeight >

</ OtherProductFeedStockDetails >

</ MonthlyDetails >

</ ProductFeedStockDetails >

- < XProductDetails >

< PetroChemicalProductType > Methanol </ PetroChemicalProductType >

</ XProductDetails >

- < OffSpecProductMassorVolume volUOM =" Gallons ">

< MeasureValue > 56880 </ MeasureValue ></ OffSpecProductMassorVolume >

< NumberofDaysOffSpecProductProduced > 2 </ NumberofDaysOffSpecProductProduced >

- < AdditionalDetails >

- < CarbonContentofWasteWater fractionUOM =" decimal fraction ">

< MeasureValue > 0.05 </ MeasureValue >

</ CarbonContentofWasteWater >

- < AnnualAverageWasteWaterFlow UnitsofMeasure =" gal ">

< MeasureValue > 56548800 </ MeasureValue >

</ AnnualAverageWasteWaterFlow >

</ AdditionalDetails >

</ MassBalanceDetails >

</ SubPartX >

</ SubPartInformation >

</ FacilitySiteDetails >

< StartDate > 2012

- 01

- 01 </ StartDate >

< EndDate > 2012

- 12

- 31 </ EndDate >

< DateTimeReportGenerated > 2013

- 08

- 02T10:34:59 </ DateTimeReportGenerated >

- < SubpartBAMMDetails >

< SubpartName > C </ SubpartName >

< WasBAMMUsed > Y </ WasBAMMUsed >

< BAMMUsedDescription > test </ BAMMUsedDescription >

< BAMMUseStartDate > 2012

- 12

- 01 </ BAMMUseStartD ate >

< BAMMUseEndDate > 2012

- 12

- 31 </ BAMMUseEndDate >

</ SubpartBAMMDetails >

- < SubpartBAMMDetails >

< SubpartName > X </ SubpartName >

</ SubpartBAMMDetails >

</ FacilitySiteInformation >

</ GHG >

### Figure 2 : XML Structure for Subpart X Equation Inputs File

< Facility name=" 

### Peregrinus Industries " reportingYear=" 

### 201 4 " lastUpdateDate="2013

- 08

-

02T09:18:23.907

- 04:00">

<Subparts>

<Subpart name="X">

< Units>

< Unit name=" 

### Methanol Unit 101 " id="0">

<Inputs>

<InputX4 name="Methanol Unit 101">

<CO2Val>33101.07282811380</CO2Val>

<InputX1>

<Feedstocks>

< Feedsto ck name=" 

### Natural gas " id="0" MVC="836.6">

<Months>

<Month>

<key>January</key>

<value>

<index>0</index>

<Vo lume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>February</key>

<value>

<index>1</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>March</key>

<value>

<index>2</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>April</key>

<value>

<index>3</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

< Month>

<key>May</key>

<value>

<index>4</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW> 45.6</MW>

</value>

</Month>

<Month><key>June</key>

<value>

<index>5</index>

< Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>July</key>

<value>

<index>6</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>August</key>

<value>

<index>7</index>

<Volume>21890000</Volume>

<CC >0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>September</key>

<value>

<index>8</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>October</key>

<value>

<index>9</index>

<Volume>21890000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

<key>November</key>

<value>

<index>10</index>

<Volume>21979000</Volume>

<CC>0.70</CC>

<MW>45.6</MW>

</value>

</Month>

<Month>

< key>December</key>

<value>

<index>11</index>

<Volume>30689000</Volume>

<CC>0.71</CC>

<MW>45.6</MW>

</value>

</Month>

</Months></Feedstock>

</Feedstocks>

</InputX1>

<InputX2>

<Products>

< 

### Product name="Me thanol" id="0">

<Months>

<Month>

<key>January</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>February</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>March</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>April</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value >

</Month>

<Month>

<key>May</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>June</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>July</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month><Month>

<key>August</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>September</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</ CC>

</value>

</Month>

<Month>

<key>October</key>

<value>

<index>0</index>

< Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>November</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

<Month>

<key>Decemb er</key>

<value>

<index>0</index>

<Volume>50000</Volume>

<CC>2.45</CC>

</value>

</Month>

</Months>

</Product>

</Products>

</InputX2>

<InputX3/>

</InputX4>

</Inputs>

</Unit>

</Units>

</Subpart>

</Subparts>

</Facility>

## Attachment 3 . Code Structure

### Page 1

Purpose : This attachment describes the code that exports and loads the inputs data file when users enter

inputs to equations data via Inputs Verifier web forms. T he code that processes the inputs XML file

employs logic similar to the Inputs Verifier web form code. This attachment illustrates that during the

e xport and load process es , the code does not write data to a server file system o r database ; that is, the

inputs data is not saved on an EPA server when an inputs file is exported or loaded

. In all cases, the code

processes the files without saving the inputs data remotely

.

I. Export

When exporting inputs data stored in session to a file that can be saved to a user’s local machine (by

selecting the “ Save Inputs Data Locally ” link) the code employs the following steps:

1. The system creates an in

- memory representation of the HTML and XML inputs files

(“htmlBytes”, “xmlBytes”).

2. An MD5 hash value is calculated from the XML data and the hash value is stored in the database.

This hash value is used to verify the integrity of an inputs file loaded during a subsequent session.

3. The system creates an in

- memory representation of the zip file ( “zipBytes”) that contains HTML

and XML versions of the inputs data.

4. The system prepares the header

, sets the file name

, and sets the type of the file that will be

available to be downloaded (zip).

5. Finally, the system adds the in

- memory zip file to the HTTP response.

This section of code contain s no commands to save the data in the server file system or the database . In

addition, at the end of the process the code ensures that the object (“zipBytes”) is out of scope and cannot

be accessed after that, theref ore subsequent processes are not able to access and/or save the data.

II. Load (Import)

When importing an inputs data file stored locally, (by selecting the “Temporarily Load Inputs Data” link)

the code employs the following steps:

1. The system reads the contents of the uploaded file from a MultipartFile object named “file”.

Note that a related configuration parameter named “maxInMemorySize” is set to an appropriate

value to ensure that any uploaded inputs file is not stored on the server file system temp orarily.

a. If the uploaded file is in zip format, the XML file is first extracted from the zip file

and an InputStream object named “fileContent” is created using the extracted XML

file. Otherwise, the InputStream object is created using the uploaded XML f ile.

b. Next, a StringBuffer object named “xmlBuffer” is created by reading the data from

fileContent.

2. The system verifies the integrity of the file by performing an MD5 hash check to ensure the data

being imported is the same as the data that was last exp orted. If it passes, the process continues

. (No MD5 check is performed during the bulk upload process because there is no previous inputs

data to use for comparison.)

3. At this point, the system code is finished with the loaded zip/XML file, and subsequent l ines of

code deal with XML data. The zip/XML file is not stored, either temporarily or more

permanently, on the server file system or database.

4. The system reads the inputs data file and converts the XML data into a Java

FacilityInputGraphDTO object. The s ystem then loads the inputs data from this object into one

or more EquationInputDTO objects, which are stored in a concurrent hash map in session. The

inputs data is not stored on the server file system or in the database.

### Page 2

5. After the system puts the input s data in the session, the user can view and update the data via the

user interface.

This section of code contains no commands to save the data in the server file system or the database

.

The code shown in Figure 1 is the code described in Step #1, above

.



### Figure 1

. Load ( Import ) an Inputs Data File