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

Comment out manual InvMEGAN diagnostic creation code #281

Closed
eamarais opened this issue Jul 8, 2024 · 13 comments · Fixed by #282
Closed

Comment out manual InvMEGAN diagnostic creation code #281

eamarais opened this issue Jul 8, 2024 · 13 comments · Fixed by #282
Assignees
Labels
category: Bug Something isn't working topic: Diagnostics Pertaining to HEMCO diagnostic outputs
Milestone

Comments

@eamarais
Copy link

eamarais commented Jul 8, 2024

Your name

Eloise Marais

Your affiliation

UCL, UK

What happened? What did you expect to happen?

This is only sort of a bug. It's a request to comment out unnecessary code that outputs lots of emissions estimates by default when these aren't wanted. Specifically, to comment out calls to Diagn_Create code for all "InvMEGAN_*" variables in the subroutine HCOX_Megan_Init in ./HEMCO/src/Extensions/hcox_megan_mod.F90. These aren't needed, as the user can request these be output from the HEMCO diagnostics file HEMCO_Diagn.rc.
I tested and confirmed that commenting out all these lines, recompiling and rerunning GCClassic with the diagnostics requested via HEMCO_Diagn.rc works.

What are the steps to reproduce the bug?

Intentionally left blank, as this is just a quick fix detailed above.

Please attach any relevant configuration and log files.

Attached a screenshot to show 1 of the 16 diagnostics currently set manually in the code.
Screenshot 2024-07-08 at 12 48 53

What HEMCO version were you using?

3.0.0 and 3.6.0 (issue is in both)

What environment were you running HEMCO on?

Local cluster

What compiler and version were you using?

gcc 9.2.0

Will you be addressing this bug yourself?

Yes

In what configuration were you running HEMCO?

GCClassic

As what resolution were you running HEMCO?

multiple (4x5, 0.25x0.3125)

What meterology fields did you use?

GEOS-FP

Additional information

No response

@eamarais eamarais added the category: Bug Something isn't working label Jul 8, 2024
@yantosca yantosca added the topic: Diagnostics Pertaining to HEMCO diagnostic outputs label Jul 8, 2024
@msulprizio
Copy link
Contributor

Thanks for reporting this @eamarais. I've added it to our to-do list for an upcoming release (GEOS-Chem 14.4.x or 14.5.0).

@yantosca
Copy link
Contributor

yantosca commented Jul 12, 2024

Hi @msulprizio and @eamarais, thanks for bringing this up. I wonder if we could figure out a way to leave the InvMEGAN diagnostics on for the fullchem_benchmark simulations (since we use them to generate inventory tables) but disable them otherwise. I can look into this.

Also note, in PR #2372 we are implementing a fix to turn off the MEGAN extension for all fullchem simulations except fullchem_benchmark. This has the added benefit of disabling the InvMEGAN diagnostic output. See this comment.

@eamarais
Copy link
Author

Hi @yantosca, these should be output as long as these are specified in the HEMCO_Diagn.rc file.

@yantosca
Copy link
Contributor

yantosca commented Jul 12, 2024

@eamarais: Maybe an easy fix is to delete those lines from the HEMCO_Diagn.rc at rundir creation for all fullchem simulations except benchmark. I can look into this.

@eamarais
Copy link
Author

@yantosca, I don't quite follow your suggestion, as my recommendation is that it makes sense to no longer have these Diagn_Create lines in the code. These are no longer needed, as the request to output the InvMEGAN* variables can be specified by users in HEMCO_Diagn.rc and users can output these when they want, rather than having these output by default.

Copy link
Contributor

@eamarais: Oh yes, now I see. Brain freeze.

@yantosca yantosca modified the milestones: 3.10.0, 3.9.2 Jul 12, 2024
yantosca added a commit that referenced this issue Jul 12, 2024
This commit addresses the issue in geoschem/HEMCO #281.

src/Extensions/hcox_megan_mod.F90
- Removed the calls to Diagn_Create for InvMEGAN diagnostics.
  These can be activated by adding the proper entries to the
  HEMCO_Diagn.rc file.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca
Copy link
Contributor

Thanks @eamarais. We can now close this issue out as PR #282 has been merged into the HEMCO "no-diff-to-benchmark" development stream. This will ship with GEOS-Chem 14.4.2 / HEMCO 3.9.2.

@zmoon
Copy link

zmoon commented Feb 6, 2025

output the InvMEGAN* variables can be specified by users in HEMCO_Diagn.rc and users can output these when they want

can be activated by adding the proper entries to the HEMCO_Diagn.rc file.

Hi there. We're having difficulty doing this in practice. I tried, for example,

InvMEGAN_AAXX    AAXX         108    -1  -1   2   kg/m2/s

but we don't get the diagnostics out.

I noticed that the block that sends data back to HcoState doesn't include these species. Could that be related? Or is my HEMCO_Diagn.rc line incorrect? Or do other HEMCO config parts need to be modified too?

@zmoon
Copy link

zmoon commented Feb 6, 2025

I tested and confirmed that commenting out all these lines, recompiling and rerunning GCClassic with the diagnostics requested via HEMCO_Diagn.rc works.

@eamarais would you be able to share what your HEMCO_Diagn.rc looked like for this?

@eamarais
Copy link
Author

eamarais commented Feb 6, 2025

@zmoon, I don't recall changing the format of the lines in HEMCO_Diagn.rc, so it should just be the following for isoprene, for example:

InvMEGAN_ISOP ISOP 108 -1 -1 2 kg/m2/s ISOP_biogenic_emission_flux_from_MEGAN_extension

These lines are located below the commented text "MEGAN Extension" and require that extension 108 be turned on in HEMCO_Config.rc.

Hope this helps!

@zmoon

This comment has been minimized.

@drnimbusrain
Copy link

@yantosca @eamarais Following up on this discussion, can you please help clarify how to get these InvMEGAN* variable diagnostics out from latest standalone HEMCO v3.10+, e.g., AAXX, FAXX, APIN, BPIN, etc.

For example, we have some of these turned on in the HEMCO_sa_Diag.rc file as the following:

InvMEGAN_AAXX    AAXX         108    -1  -1   2   kg/m2/s
InvMEGAN_FAXX    FAXX         108    -1  -1   2   kg/m2/s
InvMEGAN_APIN    APIN         108    -1  -1   2   kg/m2/s

While we get all other diagnostics from MEGAN extension (e.g., ISOP), we do not get the AAXX, FAXX, and APIN in the output.

Thank you.

@eamarais
Copy link
Author

eamarais commented Feb 6, 2025

@zmoon and @drnimbusrain, I feel sheepish as I realise now that my suggested modification is not suitable and that my check that it "worked" was superficial, as I output only the emissions associated with GEOS-Chem species.

@msulprizio and @yantosca, please could you revert my suggested changes to the code? Sorry about that! It does mean then that these emissions are output with every simulation. Is there a way around this, like a conditional statement in the hcox_megan_mod.F90 code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Something isn't working topic: Diagnostics Pertaining to HEMCO diagnostic outputs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants