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

Update IsModelLevel check for CESM and WRF-GC #244

Merged

Conversation

jimmielin
Copy link
Collaborator

@jimmielin jimmielin commented Oct 24, 2023

Name and Institution (Required)

Name: Haipeng Lin
Institution: Harvard U.

Confirm you have reviewed the following documentation

Describe the update

In HEMCO 3.7.x (via PR #235), @nicholasbalasus and I introduced changes to the vertical regridding handling in HEMCO for accuracy and for removing legacy code.

However, this causes a regression in functionality for GEOS-Chem within CESM and WRF-GC as they can no longer vertically regrid emissions to their (dynamically set) model levels.

In MODEL_CESM and MODEL_WRF, IsModelLevel can never be .true. because models are dynamically set and thus no fixed input file is on "CESM/WRF model levels" at runtime. Thus the IsModelLevel variable in these models is interpreted to be "GEOS-Chem model levels" and a fixed set of GEOS-Chem level parameters is included in the file to regrid these to the CESM/WRF model grids.

Changes to the Is_ModelLevel subroutine has made it return .false. under CESM/WRF which causes HEMCO to attempt to read sigma levels from files which do not have these levels, e.g., AEIC19 inventory.

This update returns HEMCO in CESM/WRF to its original functionality with a more robust check of units (level or GEOS-Chem level will mean data is on GEOS-Chem levels). Sigma coordinates explicitly specified will still be handled correctly.

Expected changes

No changes to GEOS-Chem full-chemistry benchmark.

Returns HEMCO vertical regridding behavior in CESM/WRF to pre-3.7.x behavior.

Reference(s)

N/A

Related Github Issue(s)

Steps to reproduce in CESM: clone CESM latest, manually checkout [HEMCO] external under src/hemco/HEMCO to versions 3.7.1. Run will fail due to AEIC19 inventory not containing proper sigma levels.

…MCO 3.7.x in vertical regridding updates.

Signed-off-by: Haipeng Lin <[email protected]>
@jimmielin jimmielin added topic: Regridding or Interpolation Related to issues with time interpolation or horiziontal/vertical regridding category: Interface to External Model Related to HEMCO updates needed to interface with other models (GEOS, WRF, CESM, etc) category: Bug Fix Fixes a bug that was previously reported labels Oct 24, 2023
@lizziel
Copy link
Contributor

lizziel commented Oct 25, 2023

Thanks @jimmielin. Is this PR ready to merge or are you still working on it?

@lizziel lizziel self-requested a review October 25, 2023 15:13
@jimmielin
Copy link
Collaborator Author

Hi @lizziel I think it is ready but I'm waiting for Derecho to come back up so I can run final checks on this to make sure it works with both CAM-chem & GEOS-Chem.

We're in no rush in bringing in HEMCO 3.7.x to CESM, but please let me know if there is a point release of 3.7.x in the works and this PR could go in there. If not then I can wait for whatever the next release is and update CESM to that.

@lizziel
Copy link
Contributor

lizziel commented Oct 27, 2023

There is now a HEMCO branch dev/no-diff-to-benchmark that we can merge this into as soon as it is ready.

Copy link
Contributor

@lizziel lizziel left a comment

Choose a reason for hiding this comment

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

The code looks good. Please consolidate all of the comments into one block within the CESM/WRF ifdef. Put all before the the IF LevUnit check so that the executed code isn't broken up by comments. That will make it easier to read. Thanks!

@lizziel lizziel self-assigned this Oct 27, 2023
Copy link

stale bot commented Dec 15, 2023

This issue has been automatically marked as stale because it has not had recent activity. If there are no updates within 7 days it will be closed. You can add the "never stale" tag to prevent the Stale bot from closing this issue.

@stale stale bot added the stale No recent activity on this issue label Dec 15, 2023
@msulprizio msulprizio added never stale Never label this issue as stale and removed stale No recent activity on this issue labels Dec 18, 2023
@msulprizio
Copy link
Contributor

@jimmielin Is this PR still a WIP or is it ready to merge?

@jimmielin
Copy link
Collaborator Author

Thanks @msulprizio this should be ready for merge. I'll remove the WIP flag.

@jimmielin jimmielin changed the title [WIP] Update IsModelLevel check for CESM and WRF-GC Update IsModelLevel check for CESM and WRF-GC Dec 18, 2023
@msulprizio msulprizio added this to the 3.8.0 milestone Dec 18, 2023
@msulprizio msulprizio merged commit f0dc3db into geoschem:dev/3.8.0 Dec 18, 2023
1 check passed
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 category: Interface to External Model Related to HEMCO updates needed to interface with other models (GEOS, WRF, CESM, etc) never stale Never label this issue as stale topic: Regridding or Interpolation Related to issues with time interpolation or horiziontal/vertical regridding
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants