CEMPD / SMOKE

Create emissions inputs for multiple air quality modeling systems with unmatched speed and flexibility
https://www.cmascenter.org/smoke/
45 stars 21 forks source link

Implementing optional SI units in SMOKE emission inputs #107

Open hnqtran opened 1 month ago

hnqtran commented 1 month ago

Potential implementation of metric tons as optional unit in SMOKE emission inputs to accommodate SMOKE applications outside U.S.

hnqtran commented 1 month ago

Found wrong unit conversion issue in src/lib/unitfac.f (lines 158 - 168)

            CASE( 'kg' )

                SELECT CASE( BUF2 )
                    CASE( 'g' )
                        UNITFAC = 1000.
                    CASE( 'tons' )
                        UNITFAC = GM2TON / 1000.
                     CASE( 'kg' )
                     CASE DEFAULT
                        CALL CASE_NOT_FOUND( UNITFAC )
                END SELECT

Conversion of 'kg' to 'tons' (US short tons) should be UNITFAC = GM2TON * 1000.

Reason: As defined in src/inc/IOCNST3.EXT: TON2GM = 907184.74 ! Short tons to grams GM2TON = 1. / TON2GM ! Grams to short tons (= 1.1023E-6) Thus, 'kg' to 'tons' = GM2TON * 1000.

hnqtran commented 4 weeks ago

The overall approach is to create a gate keeper so that when a new env variable SI_UNITS_YN = "Y" specifying SI units in the inputs, the gate keeper will convert emission data from SI back to U.S. unit (or skipping converting stack parameters from U.S. to SI units for point sources) before going through subsequent subroutines as normal.

QA check is implemented to check for indicator of SI units in the header lines of emission input files (e.g., #UNIT_SYS=SI) to make sure that the user is providing data in SI units together with SI_UNITS_YN = "Y" setting in the run script.

Using SI unit in the smoke reporting files are already implemented in SMOKE through UNITS instruction in REPCONFIG files

hnqtran commented 4 weeks ago

Ongoing list of SMOKE subroutines required update: