Skip to content
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

Fix inconsistencies between CO2 simulation and carbon simulation with CO2 only #2510

Merged
merged 9 commits into from
Oct 24, 2024

Conversation

msulprizio
Copy link
Contributor

Name and Institution (Required)

Name: Melissa Sulprizio
Institution: Harvard

Describe the update

This pull request will address differences that still remain in CO2 between the traditional CO2 simulation and the carbon simulation with CO2 only. Fixes so far include:

  1. Add missing ship logical to HEMCO_Config.rc.carbon, otherwise ship emissions for CO2 are not included
  2. Update HEMCO_Config.rc.CO2 to:
    a. Include DiagnFile to properly save out emissions diagnostics
    b. Use same Aviation_SurfCorr_SclFac.1x1.nc file as carbon simulation

Expected changes

This is a zero difference update with respect to the full chemistry benchmark. It will impact CO2 in the carbon simulations.

Reference(s)

If this is a science update, please provide a literature citation.

Related Github Issue

See also:

… CO2

- Add missing ship logical to HEMCO_Config.rc.carbon, otherwise ship
  emissions for CO2 are not included
- Update HEMCO_Config.rc.CO2 to:
  1. Include DiagnFile to properly save out emissions diagnostics
  2. Use same Aviation_SurfCorr_SclFac.1x1.nc file as carbon simulation

Signed-off-by: Melissa Sulprizio <[email protected]>
@msulprizio msulprizio added this to the 14.5.1 milestone Oct 10, 2024
@msulprizio msulprizio added category: Bug Fix Fixes a previously-reported bug topic: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO) labels Oct 10, 2024
@msulprizio msulprizio self-assigned this Oct 10, 2024
…sed on species defined

In carbon_gases_mod.F90 all chemistry input fields needed for CO2, CH4, and CO
chemistry were obtained regardless of the species included in the carbon simulation.
Therefore when running the carbon simulation with only one species (e.g. CO2)
fields were being obtained that weren't necessary. These fields have been
blocked by logical statements checking if the species that needs those fields is
advected.

Also in this module, the chemistry routine has been updated to only call
KPP when CH4 and/or CO are defined as advected species. KPP is not needed
for CO2-only simulations. Instead CO2-only simulations utilize the CO2_COPROD
field obtained from HEMCO. This field was originally obtained and applied
to the species concentration array in subroutine Emiss_Carbon_Gases. The
routine name was misleading and has been renamed to CO2_Production. The call
to this routine has also been moved from emissions_mod.F90 to Chem_Carbon_Gases
in carbon_gases_mod.F90.

Notes: When we retire the CO2 simulation, we should be able to also remove
the CO2 menu from geoschem_config.yml since it is not needed when using
CO2 in the carbon simulation.

Signed-off-by: Melissa Sulprizio <[email protected]>
The call to routine CO2_Production (formerly Emiss_Carbon_Gases) has been
moved back to emissions_mod.F90 to reproduce the CO2 simulation.

We may want to consider moving the call to this routine back to chemistry
(i.e. in Chem_Carbon_Gases) since the routine applies the production of
CO2 from CO and therefore represents a chemical source, not emissions.
I will follow up with the Carbon Gases Working Group for guidance.

Signed-off-by: Melissa Sulprizio <[email protected]>
…ased on species defines

Logical switches have been added to HEMCO_Config.rc.carbon to only read
the data necessary based on the carbon species used. For example, GLOBAL_OH
is not needed for CO2-only simulations and will therefore not be read anymore.
This should speed up single-species carbon simulations.

Signed-off-by: Melissa Sulprizio <[email protected]>
@msulprizio msulprizio marked this pull request as ready for review October 16, 2024 20:55
@msulprizio
Copy link
Contributor Author

Additional updates and fixes now include:

  • shunting the call to KPP in carbon_gases_mod.F90 for CO2-only carbon simulations
  • renaming subroutine Emiss_Carbon_Gases to CO2_Production to reflect that only CO2 production from CO are read and applied in that routine
  • adding logical switches to HEMCO_Confic.rc.carbon to avoid reading data that is not needed in single-species carbon simulations

We are now able to reproduce CO2 concentrations between the CO2 simulation and CO2-only carbon simulations. See plots in #2463.

@yantosca yantosca self-requested a review October 16, 2024 21:04
@yantosca yantosca added the topic: Configuration Files Related to GEOS-Chem configuration files label Oct 16, 2024
Copy link
Contributor

@yantosca yantosca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @msulprizio. I had a couple of minor comments but will defer to @lizziel.

GeosCore/carbon_gases_mod.F90 Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
GeosCore/carbon_gases_mod.F90 Outdated Show resolved Hide resolved
…U and on first timestep

Also fixed a typo in CHANGELOG.md to use past tense.

Signed-off-by: Melissa Sulprizio <[email protected]>
@msulprizio
Copy link
Contributor Author

All GCClassic and GCHP integrations pass

@Aosrain
Copy link

Aosrain commented Oct 17, 2024

@msulprizio When I try to recompile GCClassic with the updated codes, it shows the following error information.

=================================
make -j
[ 1%] Built target KPP_FirstPass
[ 1%] Built target HETP_core
[ 4%] Built target HeadersHco
[ 6%] Built target CloudJ_Core
[ 6%] Built target JulDayHco
[ 16%] Built target Headers
[ 21%] Built target NcdfUtilHco
[ 23%] Built target JulDay
[ 24%] Built target GeosUtilHco
[ 29%] Built target NcdfUtil
[ 44%] Built target HCO
[ 47%] Built target GeosUtil
[ 49%] Built target ObsPack
[ 52%] Built target History
[ 67%] Built target HCOX
[ 69%] Built target KPP
[ 70%] Built target HCOI_Shared
[ 72%] Building Fortran object src/GEOS-Chem/GeosCore/CMakeFiles/GeosCore.dir/carbon_gases_mod.F90.o
[ 72%] Building Fortran object src/GEOS-Chem/GeosCore/CMakeFiles/GeosCore.dir/input_mod.F90.o
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(1601): error #6460: This is not a field name that is defined in the encompassing structure. [AER_OPTICS_DIR]
Input_Opt%AER_OPTICS_DIR = TRIM( v_str )
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(1601): error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [TRIM]
Input_Opt%AER_OPTICS_DIR = TRIM( v_str )
-------------------------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2837): error #6460: This is not a field name that is defined in the encompassing structure. [CLOUD_FLAG]
Input_Opt%Cloud_Flag = v_int
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2851): error #6460: This is not a field name that is defined in the encompassing structure. [OD_INCREASE_FACTOR]
Input_Opt%OD_Increase_Factor = Cast_and_RoundOff( v_str, places=4 )
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2865): error #6460: This is not a field name that is defined in the encompassing structure. [MIN_CLOUD_OD]
Input_Opt%Min_Cloud_OD = Cast_and_RoundOff( v_str, places=4 )
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2881): error #6460: This is not a field name that is defined in the encompassing structure. [CLOUD_CORR]
Input_Opt%Cloud_Corr = Cast_and_RoundOff( v_str, places=3 )
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2896): error #6460: This is not a field name that is defined in the encompassing structure. [NUM_MAX_OVERLAP]
Input_Opt%Num_Max_Overlap = v_int
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2913): error #6460: This is not a field name that is defined in the encompassing structure. [SPHERE_CORRECTION]
Input_Opt%Sphere_Correction = v_int
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2930): error #6460: This is not a field name that is defined in the encompassing structure. [NUM_WV_BINS]
Input_Opt%Num_WV_Bins = v_int
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2943): error #6460: This is not a field name that is defined in the encompassing structure. [USE_H2O_UV_ABS]
Input_Opt%USE_H2O_UV_Abs = v_bool
--------------^
/nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90(2943): error #6303: The assignment operation or the binary expression operation is invalid for the data types of the two operands. [V_BOOL]
Input_Opt%USE_H2O_UV_Abs = v_bool
-------------------------------^
compilation aborted for /nobackup/lwu5/GCClassic/GC_run/gc_4x5_merra2_carbon/CodeDir/src/GEOS-Chem/GeosCore/input_mod.F90 (code 1)
make[2]: *** [src/GEOS-Chem/GeosCore/CMakeFiles/GeosCore.dir/build.make:452: src/GEOS-Chem/GeosCore/CMakeFiles/GeosCore.dir/input_mod.F90.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:1392: src/GEOS-Chem/GeosCore/CMakeFiles/GeosCore.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

@msulprizio
Copy link
Contributor Author

All GCClassic and GCHP integrations pass

Correction to my previous statement: All GCClassic integration tests are passing. The GCHP carbon CO2 simulation failed, even though the integration test reported it as passing (separate issue reported in #2527). I am investigating the failure (in ExtData) and will push a fix to this PR before requesting reviews again.

…2-only simulations

The carbon simulation with CO2 only was failing integration tests due to a
failed ExtData import for CEDS_CO2_SHIP. The sed statements in singleCarbonSpecies.sh
removed any entries with "CEDS_CO" if the CO species was not included in
the simulation, also inadvertently removing the CEDS_CO2_SHIP entry. This
has now been fixed by adding an underscore after CEDS_CO2. Other lines in
that sed statement have also been updated to include an underscore or trailing
white space to avoid this issue in the future.

Signed-off-by: Melissa Sulprizio <[email protected]>
Several entries for CO2 emissions and chemistry data were incorrect in
ExtData.rc.carbon. Primarily the climatology option and refresh string
were inconsistent with the entries in HEMCO_Config.rc.

Signed-off-by: Melissa Sulprizio <[email protected]>

# Conflicts:
#	CHANGELOG.md
@msulprizio
Copy link
Contributor Author

GCClassic and GCHP integration tests are now indeed passing. I pushed additional fixes for CO2 to ExtData.rc to get the GCHP carbon_CO2 simulation to complete.

GCClassic differences for CO2 now look reasonable:

GCHP differences in CO2 or the carbon (all species) simulation vs carbon with CO2 only looks reasonable as well:

There are still large differences between CO2 in GCClassic and GCHP carbon simulations (all species vs CO2-only):

Tagging @lizziel for any insight on the GCClassic vs GCHP differences.

@lizziel
Copy link
Contributor

lizziel commented Oct 23, 2024

It looks like there are hot spots of CO2 at high elevations in GCHP. I am not sure what would cause this but can look into it.

@Aosrain
Copy link

Aosrain commented Oct 23, 2024

I turned off all the settings in HEMCO_Config.rc and geoschem_config.yml. It still shows some hot spots, especially at 500 hPa.

Also set CO2 value in restart file to 400 ppmv.

CO2_compare.pdf

…ons for consistency with carbon simulations

The CO2 and tagCO run directories were created using old restart files whose origin
is not clear. To simplify validating the carbon simulation, these simulations
now use the carbon simulation restart file which has been spun up for 5 years
with a recent model version (14.1.0). The default start date for these simulations
has changed to 20190101 as well.

Signed-off-by: Melissa Sulprizio <[email protected]>
@msulprizio msulprizio removed the request for review from yantosca October 24, 2024 17:53
@msulprizio
Copy link
Contributor Author

Thanks @lizziel @Aosrain. I will merge in these fixes for now and we can add additional fixes for CO2 in GCHP separately.

@msulprizio msulprizio merged commit c18954c into dev/no-diff-to-benchmark Oct 24, 2024
@msulprizio msulprizio deleted the bugfix/carbon_co2 branch October 24, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Bug Fix Fixes a previously-reported bug topic: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO) topic: Configuration Files Related to GEOS-Chem configuration files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants