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

Add fixes to allow carbon simulations to run with a single advected species #1963

Merged
merged 14 commits into from
Sep 20, 2023

Conversation

yantosca
Copy link
Contributor

@yantosca yantosca commented Sep 15, 2023

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Confirm you have reviewed the following documentation

Describe the update

This PR adds several updates & fixes to allow the carbon simulations to use only a single advected species. A new script run/shared/singleCarbonSpecies is called to edit the "out-of-the-box" run directory configuration files (which by default advect CH4, CO, CO2, and OCS) so that only the species of interest is advected (and that emissions/diagnostics for the other species are disabled).

The singleCarbonSpecies.sh script is called from the createRunDir.sh script for both GCClassic and GCHP, which now asks if you wish to use all species or a single species:

===========================================================
GEOS-CHEM RUN DIRECTORY CREATION
===========================================================

-----------------------------------------------------------
Choose simulation type:
-----------------------------------------------------------
   1. Full chemistry
   2. Aerosols only
   3. CH4
   4. CO2
   5. Hg
   6. POPs
   7. Tagged CH4
   8. Tagged CO
   9. Tagged O3
  10. TransportTracers
  11. Trace metals
  12. Carbon
>>> 12

-----------------------------------------------------------
Do you wish to use a single advected species?
-----------------------------------------------------------
  1. Use all species
  2. Use CH4 only
  3. Use CO2 only
  4. Use CO only
  5. Use OCS only
>>> 

Also, an integration test has been added (for GEOS-Chem Classic only at this time, GCHP to follow) for the carbon simulation with CH4 as the only advected species.

Expected changes

This is a zero-diff update w/r/t the fullchem benchmark simulations. It will only affect the carbon simulation by giving the user the option to advect a single species.

Reference(s)

N/A

Related Github Issue(s)

N/A

run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon
run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon
- Now read all CHEMISTRY_INPUT data regardless of the settings of
  USE_CH4_DATA, USE_CO_DATA, USE_CO2_DATA.
- The only exception is that if USE_CO_DATA is false, we have to read
  alternate entries of GMI_PROD_CO and GMI_LOSS_CO with "*" as the
  species name instead of CO.  Otherwise, this will cause a HEMCO error,
  as HEMCO will try to place these data into the nonexistent CO species.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
In this commit, we have merged GEOS-Chem 14.1.1 into the the development
branch "bugfix/carbon-single-tracer", which contains updates that allow
the carbon simulation to be run with a single species.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
GeosCore/chemistry_mod.F
- Wrap the call to "Chem_Carbon_Gases with the FlexChem timer

GeosCore/carbon_gases_mod.F(09
- Add KPP and RCONST timers

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This merge brings the bugfix/carbon-single-tracer branch up-to-date
with the GEOS-Chem 14.2.0-alpha tag.  The 14.2.0-alpha.2 tag was
shown to have zero differences w/r/t GEOS-Chem 14.1.1 so this is
a good place to update to.  This will also allow further updates to
the carbon simulation to take advantage of the updated HEMCO
3.7.0 in development.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This merge brings the "bugfix/carbon-single-tracer" up to 14.2.0-rc.1.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon
run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon
- Change "Verbose: 0" to "Verbose: false" for HEMCO 3.7.0
- Remove "Warnings: 1" for HEMCO 3.7.0
- Move "2009 CHINA_MASK" out of the USE_CO_DATA.or.USE_CO2_DATA block,
  this was causing HEMCO to crash with a I/O read error.

run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon
run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon
- Removed Tagged CO entries
- Fixed comment headers

run/shared/single_carbon_species.sh
- Script that updates carbon-simulation configuration files so that
  it is possible to run with a single species.  More testing and
  development is needed.  This will eventually be called from the
  run/GCClassic/createRunDir.sh and run/GCHP/createRunDir.sh.
- Currently seems to work for GCClassic; Needs more modifications
  to edit the ExtData.rc file properly.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
This merge brings the updates for the GEOS-Chem carbon simulation
(with single tracer rundirectory option) up to date with the latest
state of the 14.2.1 development stream.  This also brings updates
from 14.2.0-alpha.19 into the bugfix/carbon-single-tracer branch.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
run/shared/singleCarbonSpecies.sh
- Renamed from run/single_carbon_species.sh

run/shared/single_carbon_species.sh
- Moved to singleCarbonSpecies.sh

run/GCClassic/createRunDir.sh
run/GCHP/createRunDir.sh
- Use functions from run/shared/singleCarbonSpecies.sh to edit
  rundir configuration files for a single species simulation

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
run/shared/singleCarbonSpecies.sh
- Add function updateExtData, which removes entries in ExtData.rc
  for species that are not being retained in a single-species
  carbon simulation.
- Updated comments
- Trimmed trailing whitespace
- Replaced tabs with spaces

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
run/GCClassic/createRunDir.sh
run/GCHP/createRunDir.sh
- Set sim_extra_option to "none" if option 1 is selected
- Only call singleCarbonSpecies.sh for the carbon simulation
  if sim_extra_option is not none

These fixes prevented an infinite loop because the sim_extra_option
variable was not being set to the default value of "none" if the user
selected to "use all species".

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
test/integration/GCClassic
- Add integration test for carbon simulation with CH4 as the only
  advected species (gc_4x5_merra2_carbon_CH4only)
- Update run directory creation commands in integrationTestCreate.sh
  for GEOS-Chem Classic

NOTE: We will add this functionality to GCHP integration tests soon.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca added topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates) no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations specialty simulations category: Bug Fix Fixes a previously-reported bug labels Sep 15, 2023
@yantosca yantosca added this to the 14.2.1 milestone Sep 15, 2023
@yantosca yantosca self-assigned this Sep 15, 2023
@yantosca
Copy link
Contributor Author

GEOS-Chem Classic integration tests on the bugfix/single-carbon-tracer branch all passed, except for TOMAS, which is a known issue that will be fixed in 14.3.0.

==============================================================================
GEOS-Chem Classic: Execution Test Results

GCClassic #f73eb7e GEOS-Chem submod update: Merge PR #1957 and PR #1958
GEOS-Chem #24a6b77ef Update int test scripts for single-species carbon simulation
HEMCO     #daf54d0 Merge PR #235 (Bug fix for vertical regridding)

Using 24 OpenMP threads
Number of execution tests: 27

Submitted as SLURM job: 2217582
==============================================================================
 
Execution tests:
------------------------------------------------------------------------------
...
gc_4x5_47L_merra2_fullchem_TOMAS15..................Execute Simulation....FAIL
gc_4x5_47L_merra2_fullchem_TOMAS40..................Execute Simulation....FAIL
...
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 25
Execution tests failed: 2
Execution tests not yet completed: 0

All GCHP integration tests also passed:

==============================================================================
GCHP: Execution Test Results

GCClassic #d5180cc GEOS-Chem submod update: Merge PR #1957 and PR #1958
GEOS-Chem #24a6b77ef Update int test scripts for single-species carbon simulation
HEMCO     #daf54d0 Merge PR #235 (Bug fix for vertical regridding)

Number of execution tests: 5

Submitted as SLURM job: 2217719
==============================================================================

...
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 5
Execution tests failed: 0
Execution tests not yet completed: 0

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

@yantosca
Copy link
Contributor Author

Also tagging @hannahnesser @kbowman77 @dbajones for your reference.

@yantosca
Copy link
Contributor Author

Integration tests on bugfix/carbon-single-tracer locally merged into dev/14.2.1 are now running.

@yantosca
Copy link
Contributor Author

After merging locally atop PR #1957 and PR #1958, all GEOS-Chem Classic integration tests passed, except TOMAS (which will be fixed later).

==============================================================================
GEOS-Chem Classic: Execution Test Results

GCClassic #f73eb7e GEOS-Chem submod update: Merge PR #1957 and PR #1958
GEOS-Chem #155c6b66d Merge PR #1963 (Fixes to allow carbon sims w/ a single advected species)
HEMCO     #daf54d0 Merge PR #235 (Bug fix for vertical regridding)

Using 24 OpenMP threads
Number of execution tests: 27

Submitted as SLURM job: 2284433
==============================================================================
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 25
Execution tests failed: 2
Execution tests not yet completed: 0

Also all integration tests were zero-diff w/r/t the prior integration test, except for these:

Checking gc_4x5_merra2_carbon
   -> 1 difference found in OutputDir
      * GCC_r24/rundirs/gc_4x5_merra2_carbon/OutputDir/HEMCO_diagnostics.201901010000.nc 
        GCC_r25/rundirs/gc_4x5_merra2_carbon/OutputDir/HEMCO_diagnostics.201901010000.nc 

Checking gc_4x5_merra2_fullchem_APM
   -> 2 differences found in OutputDir
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
   -> 1 difference found in Restarts
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 

Checking gc_4x5_merra2_fullchem_RRTMG
   -> 1 difference found in OutputDir
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 

The difference in the carbon simulation is because in this PR, we have now activated the CO2 biomass burning for GFED2, where it was deactivated before:

< 
< #NOTE: Biomass burning doesn't seem to work.  Keep here for now.
< # Uncomment this if GFED is used
< #EmisCO2_Biomass_GFED  CO2    111    1    1   2  kg/m2/s  CO2_biomass_burning_emissions_from_GFED4
< 
< # Uncomment this if FINN is used
---
> EmisCO2_Biomass_GFED  CO2    111    1    1   2  kg/m2/s  CO2_biomass_burning_emissions_from_GFED4
75,148d68

Copy link
Contributor Author

@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.

I will also push the following changes as a post-release commit:

commit c8e0ebefaa143c6d36289858a3fd531c78d9b8ad (HEAD -> dev/14.2.1)
Author: Bob Yantosca <yantosca@seas.harvard.edu>
Date:   Fri Sep 15 12:39:00 2023 -0400

    PR #1963 post-merge fix: Change Emis*_Bioburn to Emis*_BiomassBurn
    
    run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon
    run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon
    - Renamed EmisCO_Bioburn to EmisCO_BiomassBurn
    - Renamed EmisCO2_Bioburn to EmisCO2_BiomassBurn
    - Renamed EmisOCS_Bioburn to EmisOCS_BiomassBurn
    - Now use Cat = -1 and Hier = -1 for Emis*_BiomassBurn containers
      as well as extension 111 (GFED)
    
    run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon
    - Renamed EmisCO_Bioburn to EmisCO_BiomassBurn
    - Renamed EmisCO2_Bioburn to EmisCO2_BiomassBurn
    - Added OCS emission diagnostics
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>

Copy link
Contributor

@msulprizio msulprizio left a comment

Choose a reason for hiding this comment

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

I just had some minor questions and comments. See below.

CHANGELOG.md Outdated Show resolved Hide resolved
run/GCClassic/createRunDir.sh Outdated Show resolved Hide resolved
run/shared/singleCarbonSpecies.sh Outdated Show resolved Hide resolved
run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon
run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon
- Renamed EmisCO_Bioburn to EmisCO_BiomassBurn
- Renamed EmisCO2_Bioburn to EmisCO2_BiomassBurn
- Renamed EmisOCS_Bioburn to EmisOCS_BiomassBurn
- Now use Cat = -1 and Hier = -1 for Emis*_BiomassBurn containers
  as well as extension 111 (GFED)

run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon
- Renamed EmisCO_Bioburn to EmisCO_BiomassBurn
- Renamed EmisCO2_Bioburn to EmisCO2_BiomassBurn
- Added OCS emission diagnostics

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
run/GCClassic/createRunDir.sh
- Removed leftover ls command from debugging

run/GCClassic/singleCarbonSpecies.sh
- Removed commented-out code

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
CHANGELOG.md
- Removed the >>>>>>> line that was left over at line 137

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca
Copy link
Contributor Author

@msulprizio: I have merged these fixes into dev/14.2.1 locally and am running integration tests. Results to follow.

@yantosca
Copy link
Contributor Author

yantosca commented Sep 19, 2023

After making the fixes requested by @msulprizio, all GEOS-Chem Classic integration tests passed (except TOMAS, which is a known issue):

==============================================================================
GEOS-Chem Classic: Execution Test Results

GCClassic #f73eb7e GEOS-Chem submod update: Merge PR #1957 and PR #1958
GEOS-Chem #5d6b1f53e Merge PR #1963 (Add fixes for single-species carbon simulation )
HEMCO     #daf54d0 Merge PR #235 (Bug fix for vertical regridding)

Using 24 OpenMP threads
Number of execution tests: 27

Submitted as SLURM job: 2568433
==============================================================================
 
Summary of test results:
------------------------------------------------------------------------------
Execution tests passed: 25
Execution tests failed: 2
Execution tests not yet completed: 0

All of the GEOS-Chem classic integration tests were identical to the prior integration test except:

Checking gc_4x5_merra2_carbon
   -> 1 difference found in OutputDir
      * GCC_r24/rundirs/gc_4x5_merra2_carbon/OutputDir/HEMCO_diagnostics.201901010000.nc 
        GCC_r25/rundirs/gc_4x5_merra2_carbon/OutputDir/HEMCO_diagnostics.201901010000.nc 
   -> No differences in Restarts

Checking gc_4x5_merra2_fullchem_APM
   -> 2 differences found in OutputDir
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.Metrics.20190701_0000z.nc4 
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_APM/OutputDir/GEOSChem.SpeciesConc.20190701_0000z.nc4 
   -> 1 difference found in Restarts
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_APM/Restarts/GEOSChem.Restart.20190701_0100z.nc4 

Checking gc_4x5_merra2_fullchem_RRTMG
   -> 1 difference found in OutputDir
      * GCC_r24/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 
        GCC_r25/rundirs/gc_4x5_merra2_fullchem_RRTMG/OutputDir/GEOSChem.RRTMG.20190701_0000z.nc4 
   -> No differences in Restarts

We expect the carbon simulation not to be zero-diff, as this simulation contains diagnostics that have been renamed w/r/t the prior integration test. Also the APM and RRTMG are known issues that will be fixed later.

@yantosca
Copy link
Contributor Author

All GCHP integration tests passed

==============================================================================
GCHP: Execution Test Results

GCClassic #d5180cc GEOS-Chem submod update: Merge PR #1957 and PR #1958
GEOS-Chem #5d6b1f53e Merge PR #1963 (Add fixes for single-species carbon simulation )
HEMCO     #daf54d0 Merge PR #235 (Bug fix for vertical regridding)

Number of execution tests: 5

Submitted as SLURM job: 2568462
==============================================================================
 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%  All execution tests passed!  %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

And all were zero-diff w/r/t the prior integration test.

Copy link
Contributor

@msulprizio msulprizio left a comment

Choose a reason for hiding this comment

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

Looks good to merge now!

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 no-diff-to-benchmark This update will not change the results of fullchem benchmark simulations topic: Structural Modifications Related to GEOS-Chem structural modifications (as opposed to scientific updates)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants