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
[Bug] COLLAPSE subroutine is not mass conserving #232
Comments
Tagging @yantosca @jimmielin. I am happy to write a fix for this but would like your thoughts on the last portion. |
Also thanks to @toddmooring for flagging this! |
Issue #208 deals with the same subroutine and may be related |
Hi @eastjames @toddmooring @nicholasbalasus @jimmielin. I think you are correct, this seems to have been a bug in translation. We used to have the code in |
Or it could have always been like that... |
Thank you, @yantosca. My changes does conserve mass now (but I've only checked this for one methane file). I'm going to go through the code a little more closely and do some more tests first and then will get back to you. |
This merge brings PR #235 (Bugfix/vertical regridding, by @nicholasbalasus into the HEMCO 3.7.1 development branch. This fixes the issue reported in #232, where @nicholasbalasus discovered that vertical regridding between 72 and 47 layers was not mass conserving. TL;DR: - If your input is 72/73 (native GEOS) and your output is 47/48 (reduced GEOS), use routine COLLAPSE. - If your input is 102/103 (native GISS) and your output is 74/75 (reduced GISS), use routine COLLAPSE. - Otherwise, use MESSy to do vertical regridding Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
Closing - addressed here daf54d0 |
Name and Institution (Required)
Name: Nick Balasus
Institution: Harvard University
Confirm you have reviewed the following documentation
Description of your issue or question
We are currently using a 72-layer restart file as initial conditions for a 47-layer GEOS-Chem CH4 run. Using the BoundaryCondition collection, I am able to output how this restart file has been regridded with HEMCO at t = 0. This reveals that the mass has not been conserved.
I run GEOS-Chem using this bash script:
Then, using Python, we can see that the mass is not conserved (6.25 Tg have been created):
I find this to be related to the COLLAPSE subroutine in HEMCO.
HEMCO/src/Core/hco_interp_mod.F90
Lines 1220 to 1311 in 477c7e8
I can make these simple changes that account for the fact that we are regridding layers, not levels. For example, if
InLev1
is equal to layer 37 (and should collapse 2 layers, 37 and 38), then theTOPLEV
should be the upper edge of grid box 38 (which is layer 39).Before this, when two layers were supposed to be being collapse, only the lower level was being taken into account (and the first three when four layers were collapse). The reason I create an issue for this instead of a PR is the fact that it seems like you would want a different subroutine depending on if you are regridding layers (n=72 or 47) or levels (n=73 or 48) which I get the impression that HEMCO is supposed to do based on the codes and comments.
The text was updated successfully, but these errors were encountered: