geoschem / HEMCO

The Harmonized Emissions Component (HEMCO), developed by the GEOS-Chem Support Team.
https://hemco.readthedocs.io
Other
15 stars 31 forks source link

Update IsModelLevel check for CESM and WRF-GC #244

Closed jimmielin closed 6 months ago

jimmielin commented 8 months ago

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 https://github.com/geoschem/HEMCO/pull/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.

lizziel commented 8 months ago

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

jimmielin commented 8 months ago

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 commented 8 months ago

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

stale[bot] commented 6 months ago

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.

msulprizio commented 6 months ago

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

jimmielin commented 6 months ago

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