-
Notifications
You must be signed in to change notification settings - Fork 38
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
Bugfix/vertical regridding #235
Bugfix/vertical regridding #235
Conversation
Thanks @nicholasbalasus. Here are some thoughts on some of the points:
I think we could use something similar to how |
Thanks @jimmielin! I am thinking now that we shouldn't do any "magic" in HEMCO w.r.t. a different vertical regridding based on units (especially since HEMCO is "unitless" in many cases such as with restart files). I think the solution for the methane simulation is to start with OH fields that are in mol/mol instead of kg/m3 (but this is a methane simulation issue, not a HEMCO issue). Let me know if you agree. If so, the only remaining issue would be 47 -> 72. |
@nicholasbalasus @jimmielin I think there might be a bug in your proposed changes to the DO loop at line 1300 (936) of the old (new)
Please let me know if I am somehow misunderstanding how this code is supposed to work. |
Good catch, thanks @toddmooring! |
Thanks, @yantosca. Looks like a 36L file, so it probably called MESSy and MESSy didn't work. I'll take a look at this tomorrow. |
@nicholasbalasus: The lev dimension of the lev = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 ; From the technical note HEMCO/AEIC2019/v2022-03/2019_monmean/AEIC_2019_technical_note.pdf:
So this is an edge case, where the data doesn't extend up to level 37 (~170 hPa), which makes sense, as this is probably higher than cruise altitude for typical airplanes. I think it was decided to truncate the data to save space since the horizontal resolution is 0.5 x 0.625. |
Added a fix to handle these files. |
Thanks @nicholasbalasus. Testing again w/ the fix. |
@nicholasbalasus @jimmielin: Some good news and bad news. The good news is that the fix for AEIC now allows the 47L fullchem integration test to pass: gc_05x0625_NA_47L_merra2_fullchem...................Execute Simulation....PASS but the carbon simulation integration test now fails: gc_4x5_merra2_carbon................................Execute Simulation....FAIL The log file says: ********************************************
* B e g i n T i m e S t e p p i n g !! *
********************************************
---> DATE: 2019/01/01 UTC: 00:00
HEMCO already called for this timestep. Returning.
Carbon_Gases: Global OH is set to zero! I think the global OH file used in the GCClassic carbon simulation is a 47-L file. Will test further and suggest a fix. |
Thanks @yantosca. A 47L -> 72L should be handled by this (and is in this example). But that is with the CH4 simulation... I'm not sure if this is related, but I find for the CH4 simulation that when I save out |
^ But the behavior I suggested should not be relevant to this PR... |
Hi @nicholasbalasus. This might be an old-fashioned input error. IF ( Input_Opt%amIRoot ) THEN
IF ( useGlobOH ) THEN
IF ( useGlobOHv5 ) THEN
WRITE( 6, 100 ) 'GLOBAL_OH_GCv5'
ELSE
WRITE( 6, 100 ) 'GLOBAL_OH'
ENDIF
100 FORMAT( 'Carbon_Gases: Using global OH oxidant field option: ', a )
ELSE
WRITE( 6, 110 )
110 FORMAT( 'Carbon_Gases: Global OH is set to zero!' )
ENDIF
ENDIF I bundled this PR with some updates for the carbon simulation (see geoschem/geos-chem#1916). WIll dig further. |
When applying PR geoschem/geos-chem#1923, the carbon integration test now passes, but the Hg integration tests now fail. (The TOMAS failures are known issues that will be resolved in 14.3.0). ==============================================================================
GEOS-Chem Classic: Execution Test Results
GCClassic #47fe2b7 GEOS-Chem submodule update: Merge PR #1916 (Fixes for CH4 in carbon sim)
GEOS-Chem #e5d91c03f Merge PR #1923 (Update carbon_gases_mod for consistency w/ PR #1916)
HEMCO #daf54d0 Merge PR #235 (Bug fix for vertical regridding)
Using 24 OpenMP threads
Number of execution tests: 26
Submitted as SLURM job: 809695
==============================================================================
Execution tests:
------------------------------------------------------------------------------
gc_05x0625_NA_47L_merra2_CH4........................Execute Simulation....PASS
gc_05x0625_NA_47L_merra2_fullchem...................Execute Simulation....PASS
gc_4x5_47L_merra2_fullchem..........................Execute Simulation....PASS
gc_4x5_47L_merra2_fullchem_TOMAS15..................Execute Simulation....FAIL
gc_4x5_47L_merra2_fullchem_TOMAS40..................Execute Simulation....FAIL
gc_4x5_merra2_aerosol...............................Execute Simulation....PASS
gc_4x5_merra2_carbon................................Execute Simulation....PASS
gc_4x5_merra2_CH4...................................Execute Simulation....PASS
gc_4x5_merra2_CO2...................................Execute Simulation....PASS
gc_4x5_merra2_fullchem..............................Execute Simulation....PASS
gc_4x5_merra2_fullchem_aciduptake...................Execute Simulation....PASS
gc_4x5_merra2_fullchem_APM..........................Execute Simulation....PASS
gc_4x5_merra2_fullchem_benchmark....................Execute Simulation....PASS
gc_4x5_merra2_fullchem_complexSOA...................Execute Simulation....PASS
gc_4x5_merra2_fullchem_complexSOA_SVPOA.............Execute Simulation....PASS
gc_4x5_merra2_fullchem_LuoWd........................Execute Simulation....PASS
gc_4x5_merra2_fullchem_marinePOA....................Execute Simulation....PASS
gc_4x5_merra2_fullchem_RRTMG........................Execute Simulation....PASS
gc_4x5_merra2_Hg....................................Execute Simulation....FAIL
gc_4x5_merra2_metals................................Execute Simulation....PASS
gc_4x5_merra2_POPs_BaP..............................Execute Simulation....PASS
gc_4x5_merra2_tagCH4................................Execute Simulation....PASS
gc_4x5_merra2_tagCO.................................Execute Simulation....PASS
gc_4x5_merra2_tagO3.................................Execute Simulation....PASS
gc_4x5_merra2_TransportTracers......................Execute Simulation....PASS
gc_4x5_merra2_TransportTracers_LuoWd................Execute Simulation....PASS
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 23
Execution tests failed: 3
Execution tests not yet completed: 0 |
All GCHP integration tests pass. ==============================================================================
GCHP: Execution Test Results
GCClassic #a5676b8 GEOS-Chem submodule update: Merge PR #1916 (Fixes for CH4 in carbon sim)
GEOS-Chem #e5d91c03f Merge PR #1923 (Update carbon_gases_mod for consistency w/ PR #1916)
HEMCO #daf54d0 Merge PR #235 (Bug fix for vertical regridding)
Number of execution tests: 5
Submitted as SLURM job: 809728
==============================================================================
Execution tests:
------------------------------------------------------------------------------
gchp_merra2_fullchem................................Execute Simulation....PASS
gchp_merra2_fullchem_benchmark......................Execute Simulation....PASS
gchp_merra2_fullchem_RRTMG..........................Execute Simulation....PASS
gchp_merra2_tagO3...................................Execute Simulation....PASS
gchp_merra2_TransportTracers........................Execute Simulation....PASS
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 5
Execution tests failed: 0
Execution tests not yet completed: 0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% All execution tests passed! %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Furthermore all GCHP integration tests were identical to the previous integraton test for PR #1903 plus PR #234: Checking gchp_merra2_fullchem
-> No differences in OutputDir
-> No differences in Restarts
Checking gchp_merra2_fullchem_benchmark
-> No differences in OutputDir
-> No differences in Restarts
Checking gchp_merra2_fullchem_RRTMG
-> No differences in OutputDir
-> No differences in Restarts
Checking gchp_merra2_tagO3
-> No differences in OutputDir
-> No differences in Restarts
Checking gchp_merra2_TransportTracers
-> No differences in OutputDir
-> No differences in Restarts |
The error in the Hg simulation is: HEMCO: Opening /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/data/ExtData/HEMCO/MERCURY/v2018-04/ocean_fixed.nc
HEMCO ERROR: ModelLev_Interpolate was called but MESSy should have been used: GLOBAL_OCEAN
HEMCO ERROR: ERROR 0
--> LOCATION: ModelLev_Interpolate (hco_interp_mod.F90)
HEMCO ERROR: ERROR 16
--> LOCATION: HCOIO_READ (HCOIO_READ_STD_MOD.F90) Which is caused by the level index being = 1: data:
time = "2007-01-01", "2007-02-01", "2007-03-01", "2007-04-01", "2007-05-01",
"2007-06-01", "2007-07-01", "2007-08-01", "2007-09-01", "2007-10-01",
"2007-11-01", "2007-12-01" ;
lat = -89, -86, -82, -78, -74, -70, -66, -62, -58, -54, -50, -46, -42, -38,
-34, -30, -26, -22, -18, -14, -10, -6, -2, 2, 6, 10, 14, 18, 22, 26, 30,
34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 89 ;
lon = -180, -175, -170, -165, -160, -155, -150, -145, -140, -135, -130,
-125, -120, -115, -110, -105, -100, -95, -90, -85, -80, -75, -70, -65,
-60, -55, -50, -45, -40, -35, -30, -25, -20, -15, -10, -5, 0, 5, 10, 15,
20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105,
110, 115, 120, 125, 130, 135, 140, 145, 150, 155, 160, 165, 170, 175 ;
lev = 1 ;
} which should not be making it into the regridding code since there is only surface data. |
So is this the only |
Though I'm also not sure how this got a |
Looks like the change would need to be made here... If changing What do you think @yantosca ? |
Thanks @nicholasbalasus. I can make a separate PR to fix the Hg code and HEMCO config files in the geoschem/geos-chem repo. Will let you know. |
This merge brings PR #1925 (Update dimension to 2D from 3D for OCEAN_CONC for Hg simulations, by @nicholasbalasus) into the GEOS-Chem 14.2.1 development stream. This PR fixes a side-effect in the Hg simulation that was casued by PR geoschem/HEMCO#235. The OCEAN_CONC container data in the Hg simulations was being sent to vertical regridding even though the data is only 2D. This is now corrected. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
commit 718d342 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Tue Aug 29 07:50:26 2023 -0400 syntax fix commit 83a8f00 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Tue Aug 29 07:44:16 2023 -0400 handle AEIC files commit 3b99a63 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Mon Aug 28 13:24:31 2023 -0400 update CHANGELOG.md and address Bob's comments commit d1ddd10 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Fri Aug 25 09:15:42 2023 -0400 add some messages when HEMCO is verbose commit e320084 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 24 16:54:31 2023 -0400 further ENDIF fixes commit 2a58a42 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 24 16:40:09 2023 -0400 declare I commit 29e4efa Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 24 16:38:04 2023 -0400 another forgotten ENDIF commit 420cabc Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 24 16:33:44 2023 -0400 move ENDIF commit f1307ad Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 24 13:41:05 2023 -0400 add INFLATE behavior back in commit c9cce09 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 24 08:02:03 2023 -0400 bugfix in DO loop from Todd's comment commit a063876 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Sat Aug 12 07:32:48 2023 -0400 more RC fixes commit c0a771b Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Sat Aug 12 07:28:10 2023 -0400 error handling in hco_interp_mod.F90 commit 80c56ff Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Sat Aug 12 07:18:46 2023 -0400 fix for error writing commit bfbcd03 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Sat Aug 12 07:12:36 2023 -0400 update comments, only handle 22 and 5 met commit 786a952 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 19:59:41 2023 -0400 add nout back in commit fa8b181 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 17:25:49 2023 -0400 finally fixed out ALLOCATE error commit 86a3c4a Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 16:36:03 2023 -0400 another try at printing commit 1cf516c Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 16:26:40 2023 -0400 try to print again commit a63210f Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 16:23:20 2023 -0400 print to debuug commit af45fa5 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 15:58:16 2023 -0400 trying another fix for IsModelLevel commit c371cb3 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 15:19:28 2023 -0400 default False IsModelLevel commit 31cfa89 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 11:11:52 2023 -0400 another minor fix commit d1cf1a7 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 11:09:19 2023 -0400 syntax fix commit cf84735 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 11:05:00 2023 -0400 remove INFLATE commit 56b0a3f Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 10:59:07 2023 -0400 add ENDIF commit 29a2284 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 09:58:56 2023 -0400 add check that ModelLev_Interpolate should have been called commit 9832a3d Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 09:51:45 2023 -0400 remove NC calls commit 8b17007 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 09:50:59 2023 -0400 only us COLLAPSE if going from 72->47 or 102->74 commit 8415b03 Author: nicholasbalasus <nicholasbalasus@g.harvard.edu> Date: Thu Aug 10 09:40:36 2023 -0400 fix COLLAPSE, change ModelLev_Check, remove INFLATE and GEOS4 Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
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, as this was merged |
This merge brings PR 268 (Handle 3D NEI emissions, by @nicholasbalasus) into the HEMCO "no-diff-to-benchmark" development stream. This PR implements a workaround to an issue caused by the merge of HEMCO PR #235 (Bug fix for vertical regridding). This must be merged simultaneously with GEOS-Chem PR #2213. Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
Name and Institution (Required)
Name: Nick Balasus
Institution: Harvard University
Confirm you have reviewed the following documentation
Describe the update
So far, this PR fixes the COLLAPSE routine, removes INFLATE, and removes some old GEOS-4 code.
I've tried to make it so this is how the code works:
Expected changes
Previously, the COLLAPSE routine was not working as it should for model levels or edges. For example, for model levels, when it was trying to collapse two levels, it would actually just use the value of the first. When it would try to collapse four levels, it would average the bottom three. Now, it does pressure weighted averaging correctly when collapsing model levels and samples at model edges when collapsing model edges. This will impact all 47L simulations (meteorology, restart files, prescribed losses, etc.).
Related Github Issue(s)
So far, this will already solve #232. It's not there yet for geoschem/geos-chem#1904 though which is why I mark it as a draft. Here is what still needs to be done that I need some guidance on, maybe from @jimmielin.
PS
term thatNC_GET_SIGMA_LEVELS
needs. As is, MESSy is being called but is failing.The only limitation here is being able to do those unit conversions at non-regridded and regridded-resolution, which may be a big obstacle.