Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in calculation of PMF_OC #215

Merged
merged 1 commit into from
Apr 9, 2024
Merged

fix bug in calculation of PMF_OC #215

merged 1 commit into from
Apr 9, 2024

Conversation

cgnolte
Copy link
Collaborator

@cgnolte cgnolte commented Apr 4, 2024

Contact:
Chris Nolte, US EPA

Type of code change:
Bug fix

Description of changes:
This fixes a bug in the calculation of the ELMO parameter PMF_OC, which inadvertently subtracts off non-carbonaceous mass that should instead be skipped. Because PMF_NCOM is calculated using the value of PMF_OC, this bug affects PMF_NCOM as well.

Issue:
Resolves issue 213

Summary of Impact:
This change affects only PMF_OC and PMF_NCOM in the ELMO/AELMO outputs. There is no change in CONC/ACONC, CGRID, or deposition outputs. If using the default treatment of semivolatile organics, in which POC and PNCOM are mapped to VSVPO1, VSVPO2, VSVPO3, and VIVPO1 (see CMAQ_Control_DESID_<MECH>.nml), then the impact is minimal. However, if using the older method of treating POA as nonvolatile, with POC mapped to APOC and PNCOM mapped to APNCOM, then this bug has a significant impact on PMF_OC and PMF_NCOM.

Testing Performed:
This was tested against the research branch by running one day of the 2018_12NE3 benchmark case using the intel21.4 compiler. CGRID files were unchanged. On the research branch, PMF_OC did not equal the sum of PMF_POC and PMF_SOC, as it should. Instead, PMF_OC was less by the value of APNCOMI+APNCOMJ. Using the modified code in this PR resulted in the correct result, where PMF_OC = PMF_POC + PMF_SOC.

This code change was separately tested by running the bld_check script on both the 5.4+ branch (prior to this fix) and the modified code, executing the first day of the 2016_12SE1 benchmark case. The code compiled and ran in standard and debug modes using the intel21.4, gcc9.5, and pgi22.4 compilers. CGRID files were unchanged across each of the six pairs of runs. Additionally, I verified that PMF_OC = PMF_POC + PMF_SOC in each of the six runs using the modified code.

@cgnolte cgnolte assigned cgnolte and unassigned cgnolte Apr 4, 2024
@cgnolte cgnolte requested review from kmfoley and fisidi April 4, 2024 20:00
@kmfoley kmfoley merged commit dcd6d48 into USEPA:5.4+ Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants