-
Notifications
You must be signed in to change notification settings - Fork 31
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/ISSUE] xyL inconsistent diagnostic #47
Comments
UpdateI added a bunch of print statements and I find that the There is also an option "Vertical weights" on line 409 of hco_state_mod.F90, which can be set to disable "accurate weights." RecommendationsI recommend two simple updates.
Remaining QuestionThat leaves me with a question. Could I have added met fields to get more representative results? [1] https://github.com/geoschem/HEMCO/blob/master/src/Core/hco_calc_mod.F90#L935 |
@barronh, thanks for looking more into this. If I am understanding correctly there is a separate issue that setting DilFact to 1.0 (and issuing a warning message) should occur only if box height is available. If box height is zero in standalone mode then box height should be deemed unavailable, and the correct code in the ELSE should be executed:
.... more code ....
Is this your understanding too? |
To clarify further, by "should" I mean HEMCO would need to be changed to do this. This looks like a bug. |
I think I follow your point. Ideally, the code should have noted the unavailability and used a uniform distribution. In addition, is there a case where h2 is not greater than h1 and the routine should return 1? |
That's a good question. I'll think more about the potential cases, although it probably safest to add that even if it should never happen. |
I looked more into a fix for this bug. The problem is The dilution factor then ends up being wrong because logic in
I added an update to nullify For the case where box height is available, I removed the automatic setting of dilution factor to 1.0 if h2 not greater than h1. If this occurs the model now exits with an error. I do not think there is a valid reason for h2 to be <= h1 when box height is available and criteria are met to call Thank you @barronh for reporting this and providing a test run directory and data. The provided materials were very helpful for reproducing the issue and honing in on a fix quickly. This update will go into HEMCO 3.0.0 and I will post a commit hash when it is available. |
I am so grateful that you tracked this down and fixed it! Thank you! |
No problem! The fix is in commit a8f775f. You may notice the incorrect module name is used in the error handling message. That is fixed in a subsequent commit. |
Describe the bug
There is an inconsistency between the diagnostic interpretation of xyL mass that changes by time step. The diagnostic is initialized with the xy mass split evenly over assigned layers, but subsequent time steps have the mass duplicated. I'm somewhat confused about which is right.
Background
I'm trying to use the xyL=1:N option described in the users guide.
I was expecting the sum of xy emissions to be conserved, but what I get is duplication of the 2D mass in each layer for all timesteps except for the first. If duplication is intended, perhaps, the wiki could be updated to say "(duplicating the original total emissions in each layer)." Which ever way is intended, the diagnostic should be consistent.
When checking my implementation (xyL=1:3), daily diagnostics showed 291.7% of input emissions. When I output hourly, the first has 100% of input emission and all subsequent hours have 300%.
To Reproduce
I ran with a real emission file and found the issue, but have boiled it down to something small and repeatable.
I'm using v2.2 that comes with GCv12.8.0, but in the offline mode. I am running with a single input file for a single variable NO2. To make sure the test case is easy, I've disabled all scaling factors and I am just using an output grid of equal resolution but larger in scope to not lose mass on the edges (0.1 degree x 0.1 degree). My config file has xy and xyL derived from a 2D NO2 variable. The xyz uses a 3D NO23D variable that duplicates mass in each layer. My diagnostics include NO2_XY_TOTAL, NO2_XYZ_TOTAL, and NO2_XYL_TOTAL.
The XY and XYZ diagnostics are consistently 100% and 100% of their input variables. On the first time step, the XYL diagnostic is 100% original mass. On all subsequent time steps, the XYL is 300% of the xy input mass.
Attached is a tar.gz with my setup and instructions (REAMDE) to reproduce.
xyLtest.tar.gz
Versions Etc.
HEMCO: v2.2.0 compiled stand alone from GEOS-Chem v12.8.0 distribution
Compiler: intel 19.0.1
Libraries: netcdf-4.7.3, hdf5-1.10.5
Cluster environment (uname -a): Linux atmos1 3.10.0-1062.12.1.el7.x86_64 #1 SMP Thu Dec 12 06:44:49 EST 2019 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: