-
Notifications
You must be signed in to change notification settings - Fork 166
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
Fixes towards achieving bit-for-bit reproducibility in GC-Classic upon restart #2521
base: main
Are you sure you want to change the base?
Conversation
- use AerMass in OCPISOA to avoid unnecessary recalculation - removed unnecessary OCPI reference when SVPOA is activated
- replace verbose representation of SOA and OCPI with OCPISOA
…nSVPOA - also includes some rewrites for better readability
R4N2 was a common product of alkane, isoprene, and monoterpene oxidation and produced organonitrate SOA but we don’t want ALK4 to produce organonitrate SOA as discusses in #1625. A fix from Jared Brewer is included here. NOTE: The KPP fullchem mechanism has not been rebuilt with these fixes to facilitate merging these updates up to the latest GEOS-Chem release. These updates will also need to be added to the custom.eqn file. Signed-off-by: Melissa Sulprizio <[email protected]>
run/shared/species_database.yml run/shared/species_database_hg.yml - Allow for KPP_AbsTol and KPP_RelTol tags. - Set KPP_AbsTol to 1.0e25 for all dummy species, in order to prevent these from being considered when computing the error norm. Headers/species_mod.F90 - Add KPP_AbsTol and KPP_RelTol to the Species derived type Headers/species_database_mod.F90 - Add "KPP_AbsTol" and "KPP_RelTol" to the tags array - Add code to parse KPP_AbsTol and KPP_RelTol tags - Remove the "places" keyword and just pass the number of decimal places, for a consistent appearance - Trimmed trailing whitespace - Updated comments Headers/state_chem_mod.F90 - Add KPP_AbsTol and KPP_RelTol 1-D arrays. These are initialized at the same time as the Map_KppVar mapping array. This will allow us to replace missing values at initialization, and just copy the values to ATOL and RTOL each timestep. This is more efficient. GeosCore/fullchem_mod.F90 GeosCore/mercury_mod.F90 - Replace missing values in State_Chm%KPP_AbsTol and State_Chm%KPP_RelTol with default values. This preserves the absolute and relative tolerances for species that were specified in species_database.yml. - Copy State_Chm%KPP_AbsTol to the KPP ATOL array - Copy State_Chm%KPP_RelTol to the KPP RTOL array Signed-off-by: Bob Yantosca <[email protected]>
CHANGELOG.md - Added notes describing how we can now define KPP absolute and relative tolerances for species in species_database.yml Signed-off-by: Bob Yantosca <[email protected]>
Headers/roundoff_mod.F90 - Bug fix: First cast to dble or flex. Then round off if the places argument is > 0. This allows us to just cast w/o rounding off if needed. run/shared/species_database_mod.F90 - Changed 1.0e+25_8 to 1.0e+25 in for KPP_AbsTol (LBRO2H) CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca <[email protected]>
GeosCore/fullchem_mod.F90 - Removed extraneous "<" character Signed-off-by: Bob Yantosca <[email protected]>
This merge brings PR #2359 (Allow per-species definition of KPP absolute and relative solver tolerances; Set absolute tolerances of dummy species to large value, by @yantosca) into the GEOS-Chem 14.5.0 development stream. This PR adds structural updates to allow per-species setting of the KPP absolute & relative tolerances. This now allows us to assign a large absolute tolerance (1e25) to KPP dummy species, which excludes them from the error norm computations. This results in a faster simulation at the cost of numerical noise. Signed-off-by: Bob Yantosca <[email protected]>
This merge brings the hotfix from PR #2363 (Update setCommonRunSettings.template) on top of PR #2359. This will allow GCHP benchmarks on the cloud to proceed. Signed-off-by: Bob Yantosca <[email protected]
run/shared/species_database.yml run/shared/species_database_hg.yml - Allow for KPP_AbsTol and KPP_RelTol tags. - Set KPP_AbsTol to 1.0e25 for all dummy species, in order to prevent these from being considered when computing the error norm. Headers/species_mod.F90 - Add KPP_AbsTol and KPP_RelTol to the Species derived type Headers/species_database_mod.F90 - Add "KPP_AbsTol" and "KPP_RelTol" to the tags array - Add code to parse KPP_AbsTol and KPP_RelTol tags - Remove the "places" keyword and just pass the number of decimal places, for a consistent appearance - Trimmed trailing whitespace - Updated comments Headers/state_chem_mod.F90 - Add KPP_AbsTol and KPP_RelTol 1-D arrays. These are initialized at the same time as the Map_KppVar mapping array. This will allow us to replace missing values at initialization, and just copy the values to ATOL and RTOL each timestep. This is more efficient. GeosCore/fullchem_mod.F90 GeosCore/mercury_mod.F90 - Replace missing values in State_Chm%KPP_AbsTol and State_Chm%KPP_RelTol with default values. This preserves the absolute and relative tolerances for species that were specified in species_database.yml. - Copy State_Chm%KPP_AbsTol to the KPP ATOL array - Copy State_Chm%KPP_RelTol to the KPP RTOL array Signed-off-by: Bob Yantosca <[email protected]>
CHANGELOG.md - Added notes describing how we can now define KPP absolute and relative tolerances for species in species_database.yml Signed-off-by: Bob Yantosca <[email protected]>
Headers/roundoff_mod.F90 - Bug fix: First cast to dble or flex. Then round off if the places argument is > 0. This allows us to just cast w/o rounding off if needed. run/shared/species_database_mod.F90 - Changed 1.0e+25_8 to 1.0e+25 in for KPP_AbsTol (LBRO2H) CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca <[email protected]>
GeosCore/fullchem_mod.F90 - Removed extraneous "<" character Signed-off-by: Bob Yantosca <[email protected]>
Fix typo for MassFlux_Entry
This merge brings PR #2315 (ix bugs in PDER, OCPISOA and TotalOC in complexSOA, by @yuanjianz) into the GEOS-Chem 14.5.0 development stream. This PR fixes several minor bugs in the complex SOA scheme as described in issues #2314 and #2321. Signed-off-by: Bob Yantosca <[email protected]>
Previously these values were zero due to an issue in ISORROPIA. With the update to HETP we can now enable these cations. Signed-off-by: Lizzie Lundgren <[email protected]>
This merge brings the GEOS-Chem 14.4.2 release into the GEOS-Chem 14.5.0 development stream. 14.4.2 is a zero-diff update. The CHANGELOG.md has been updated accordingly. Signed-off-by: Bob Yantosca <[email protected]>
This merge brings PR #2398 (Pass non-zero Ca2, Mg, and K cations to HETP, by @lizziel) into the GEOS-Chem 14.5.0 development stream. This PR uncomments setting Ca2+, K+, and Mg+ cation values passed to HETP. Previously these values were zero due to an issue in ISORROPIA. With the update to HETP we can enable these cations. Signed-off-by: Bob Yantosca <[email protected]>
Resolved conflicts in: CHANGELOG.md KPP/fullchem/fullchem.eqn KPP/fullchem/fullchem.kpp run/shared/species_database.yml Signed-off-by: Melissa Sulprizio <[email protected]>
This merge brings PR #2352 (Add fixes for ALK4 and R4N2 chemistry from Brewer et al. (2023, JGR), by @msulprizio) into the GEOS-Chem 14.5.0 development stream. R4N2 was a common product of alkane, isoprene, and monoterpene oxidation and produced organonitrate SOA but we don’t want ALK4 to produce organonitrate SOA as discusses in #1625. A fix from Jared Brewer is included here. Signed-off-by: Bob Yantosca <[email protected]>
Due to an oversight, we had forgotten to rebuild the KPP solver files for PR #2352. This has now been done. We will re-tag this PR with 14.5.0-alpha.4 to re-trigger 1-month benchmarks. Signed-off-by: Bob Yantosca <[email protected]>
run/GCClassic/HISTORY.rc.templates/HISTORY.rc.fullchem - Change ##'DryDep' -> #'DryDep', which will activate this collection in benchmark simulations. run/GCHP/HISTORY.rc.templates/HISTORY.rc.fullchem - Change @#'DryDep' -> #'DryDep', which will activate this collection in benchmark simulations. - Also reduce the DryDep collection species to only those species we need for benchmark plots/tables CHANGELOG.md - Updated accordingly Signed-off-by: Bob Yantosca <[email protected]>
CHANGELOG.md - Restored missing line that was inadvertenly deleted - Place `` around "State_Chm%CH4_EMIS" run/GCHP/HISTORY.rc.templates/HISTORY.rc.fullchem - Removed extra slash in comments Signed-off-by: Bob Yantosca <[email protected]>
This merge brings all of the updates from the GEOS-Chem 14.4.3 "no-diff-to-benchmark" release back into the dev/14.5.0 branch. We will test this merge with its own alpha benchmark. Signed-off-by: Bob Yantosca <[email protected]>
…l NOx extension Yi Wang updated the soil NOx algorithm in HEMCO to utilize soil temperature as described in Yi Wang et al. (ERL, 2021). Those updates require the addition of a new meteorology field, TSOIL1, for the soil temperature in layer 1. This field has been added to State_Met. Signed-off-by: Melissa Sulprizio <[email protected]>
CHANGELOG.md - The entry for "Tropopause pressure field..." for 14.4.3 was located much further down than it should have been. We have moved it back to to the 14.4.3 section at the top of the file. Signed-off-by: Bob Yantosca <[email protected]>
This merge brings PR # ( , by @) into Signed-off-by: Bob Yantosca <[email protected]>
Signed-off-by: Melissa Sulprizio <[email protected]>
Fix the bug of using SALA mass to compute coarse-mode TK, TMg, and TCa. Add AlkR factor to the formulas.
The entries for 14.5.0 (unreleased) have been updated to: - remove duplicate entries - consistently start lines with past-tense verbs - remove items listing fixes on updates added in this version Signed-off-by: Melissa Sulprizio <[email protected]>
Update the description for recent changes related to Ca, K, Mg, and Na in aerosol_thermodynamics_mod.F90
Signed-off-by: Melissa Sulprizio <[email protected]>
Signed-off-by: Lizzie Lundgren <[email protected]>
For consistency with the literature (e.g. Travis et al, EGUsphere, 2024) we rename ALK7 to ALK6. See further discussion in Github issue #2459. Signed-off-by: Melissa Sulprizio <[email protected]>
Signed-off-by: Melissa Sulprizio <[email protected]>
…nfig Signed-off-by: Lizzie Lundgren <[email protected]>
For most cases this is double precision. Previously State_Met arrays were always saved out as single. Signed-off-by: Lizzie Lundgren <[email protected]>
Signed-off-by: Lizzie Lundgren <[email protected]>
This is FP for all cases except STATE_PSC which is real4 and DryDepVel which is always real8. Signed-off-by: Lizzie Lundgren <[email protected]>
Previously these were written as REAL4 despite being stored in the model as REAL8. Signed-off-by: Lizzie Lundgren <[email protected]>
Signed-off-by: Lizzie Lundgren <[email protected]>
This is a no diff update but now allows print of min, max, sum of restart variable Met_DELPDRY to be included with all of the other restart variables retrieved from HEMCO into GEOS-Chem. Signed-off-by: Lizzie Lundgren <[email protected]>
This module currently has one subroutine only, to print min, max, and mean of species concentrations to log. It currently only prints if root thread and does not convert units. Optional arguments allow printing one species or a consecutive sequence of species indexes. Signed-off-by: Lizzie Lundgren <[email protected]>
This update ensures error is not introduced due to unit conversions used for saving species to the restart file in mol/mol. Conversion to mol/mol must occur every timestep as part of updating diagnostics used for restart variables so that GEOS-Chem Classic can achieve bit-for-bit reproducibility upon breaking up runs. We still use kg/kg dry air throughout main.F90. Conversion from mol/mol to kg/kg occurs at the start of every timestep. This also means that mol/mol is not converted to kg/kg in the subroutine that retrieves restart variables from HEMCO during initialization since it will occur later. Signed-off-by: Lizzie Lundgren <[email protected]>
It is necessary to move where prescribed CH4 is set because it is dependent on PBL height and previously PBL height was not updated until after Set_CH4 was called. This introduces small differences in GC-Classic when breaking up runs. CH4 is now set using updated PBL height and is grouped with emissions where other prescribed surface VMRs are applied. It is still applied outside of emissions. Signed-off-by: Lizzie Lundgren <[email protected]>
@lizziel, I think I know what this may be. The N deposition code (I think You could get around that by declaring the variable to hold the level sum with |
Signed-off-by: Lizzie Lundgren <[email protected]>
Signed-off-by: Lizzie Lundgren <[email protected]>
This commit removes the level argument since it is not actually used in the subroutines. This update also uncomments a Soil NOx extension logical bracketed around a call to SOIL_WETDEP. The subroutine only changes arrays used in Soil NOx extension so calling it when the extension is off is not necessary. Signed-off-by: Lizzie Lundgren <[email protected]>
Name and Institution (Required)
Name: Lizzie Lundgren
Institution: Harvard University
Describe the update
This PR applies changes in GC-Classic needed to achieve bit-for-bit reproducibility when breaking up a run in time. Please note that with these updates out-of-the-box GC-Classic will still not have reproducibility upon restart due to a limitation of HEMCO. HEMCO reads inputs, including GEOS-Chem restart file variables, as single precision when most of these fields in GEOS-Chem are double precision.
Separately I implemented an update that reads the GEOS-Chem restart file locally, preserving native precision found in the file. With this PR and that update on top of it I am able to achieve bit-for-bit reproducibility in GC-Classic full chemistry benchmark simulation when breaking up the run in time. We are not going to bring in the update to read the restart file locally because we need to use HEMCO for its flexgrid capability. However, I will make that update available as a dev branch should anyone want to use it (see here). An update to HEMCO to read native precision will come later.
Updates within GEOS-Chem that change benchmark output:
State_Chm%DryDepNitrogen
used in the HEMCO soil NOx extension and saved out to the GEOS-Chem restart file. I believe this was previously undetected because the differences are at the level of double precision numerical noise and thus were previously obscured by outputting to file as single precision. This update includes writing to the restart and diagnostic files using native precision which exposed the issue.Chem_ORVCsesq
restart file entry in GC-Classic fullchemHEMCO_Config.rc
.State_Met
andState_Chm
arrays in GC-Classic History using the native precision used in the model. Previously the precision was unspecified and outputs thus used the default of single precision.State_Diag%SpeciesRst
which is the species concentration array written to the restart file GC-Classic. Previously it was set to REAL4.This PR also contains several no-diff updates:
State_Chm
array allocationucx_mod
DELPDRY
to subroutineGC_Get_Restart
. This is a no diff update but now allows print of min, max, sum of restart variableMet_DELPDRY
to be included with all of the other restart variables retrieved from HEMCO into GEOS-Chem for use upon startup.GeosUtil/print_mod.F90
for specialized model print options. This module currently has one subroutine only, to print min, max, and mean of species concentrations to log. It currently only prints if root thread and does not convert units. Optional arguments allow printing one species or a consecutive sequence of species indexes. The current units are printed to the log.Get_GC_Restart
subroutine so that all species initial concentrations are printed to log, including if background values are used (with note about that), as well as initial concentrations of other arrays in the restart file that are read into the model.SOIL_WETDEP
andSOIL_DRYDEP
subroutines used to updateState_Chm%WetDepNitrogen
andState_Chm%DryDepNitrogen
used in the Soil NOx extension in HEMCO. Changes include removing the unused level argument and uncommenting a commented out Soil NOx extension logical used to determine whether to callSOIL_WETDEP
inDo_Washout_as_Sfc
.Expected changes
This update will cause small differences in all GEOS-Chem Classic simulations.
Reference(s)
None
Related Github Issue
geoschem/HEMCO#18
#111
#2014