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

[PULL REQUEST] Bug fix in megan extension #140

Merged
merged 3 commits into from Apr 8, 2022
Merged

Conversation

lizziel
Copy link
Contributor

@lizziel lizziel commented Apr 7, 2022

This pull request fixes a bug in the HEMCO megan extension where the biogenic annual emissions factors (AEF) were not zeroed out between emission runs. The factors are computed by summing values in a loop over plant types. Unless the values are reset to zero before the loop there is cumulative summing across timesteps.

Also in this PR are a few minor changes to the megan extension:
(1) initialize arrays set from the restart file to single precision rather than double precision
(2) remove duplicate code to allocate module variable Array_16
(3) clean up a few comments

Testing the impact of these changes is in progress.

Previously the AEF arrays were not reset to zero before the computation
summing over plant types. Therefore the AEF values increased every
timestep, which was a bug.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
These arrays are defined as single precision but the initialization
value was previously hemco (flexible) precision.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
"Array_16" was previously allocated and initialized twice.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@lizziel lizziel added the category: Bug Something isn't working label Apr 7, 2022
@lizziel lizziel self-assigned this Apr 7, 2022
@lizziel lizziel changed the title Bugfix/megan extension Bug fix in megan extension Apr 7, 2022
@lizziel lizziel changed the title Bug fix in megan extension [PULL REQUEST] Bug fix in megan extension Apr 7, 2022
@lizziel lizziel requested a review from yantosca April 7, 2022 17:27
Copy link
Contributor

@yantosca yantosca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a straightforward PR that

  1. Updates old comments
  2. Initializes array fields of Inst% to zero
  3. Uses 0.0_sp instead of 0.0_hp for REAL*4 arrays in Inst%
    Good to merge!

@lizziel
Copy link
Contributor Author

lizziel commented May 10, 2022

This bug fix applies to GCHP and GEOS only since the computation of the annual scale factors occurs every timestep in those models. It is only called in the first timestep in GC-Classic.

@lizziel
Copy link
Contributor Author

lizziel commented May 10, 2022

This bug fix is included in GEOS-Chem 14.0.0.

@msulprizio msulprizio added this to the 3.5.0 milestone May 12, 2022
@yantosca yantosca added category: Bug Fix Fixes a bug that was previously reported and removed category: Bug Something isn't working labels Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Fix Fixes a bug that was previously reported topic: HEMCO Extensions Pertaining to HEMCO extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants