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 updates for CH4 analytical inversion #2218

Merged
merged 6 commits into from
Mar 28, 2024

Conversation

msulprizio
Copy link
Contributor

Name and Institution (Required)

Name: Melissa Sulprizio
Institution: Harvard

Describe the update

This pull request includes two major changes to the CH4 simulation:

1) Move CH4 emissions handling out of GEOS-Chem code and into HEMCO_Config.rc

Code for handling CH4 emissions has been removed from both global_ch4_mod.F90 and carbon_mod.F90. Previously, emissions from all sectors were combined into the State_Chm%CH4_EMIS (or CH4_EMIS_J in carbon_mod.F90). This was done so that total emissions could be perturbed for use in analytical inversions. With this update, the emissions are now perturbed within HEMCO_Config.rc using scale factors defined for each state vector element (read from a netCDF file). The perturbations are meant to be used on total CH4 emissions (i.e. using output from a HEMCO standalone simulation) to avoid having to apply the scale factor(s) for every emissions inventory and sector throughout HEMCO_Config.rc. A new logical switch UseTotalPriorEmis has been added to HEMCO_Config.rc for this purpose, though users will need to modify the file path to point to their prior emissions.

For example:

#==============================================================================
# ---Total CH4 emissions (all sectors) from prior simulation ---
#==============================================================================
(((UseTotalPriorEmis
0 CH4_Emis_Prior ../prior_run/OutputDir/HEMCO_diagnostics.$YYYY$MM$DD0000.nc EmisCH4_Total $YYYY/$MM/$DD/0 C xy kg/m2/s CH4 - 1 500
0 CH4_Emis_Prior_0001 - - - - - - CH4_0001 2001 1 500
)))UseTotalPriorEmis

#==============================================================================
# --- Scale factors for analytical inversions ---
#==============================================================================
(((AnalyticalInversion
# Add perturbations to individual state vector element (N) following the format
# Start scale factor ID at 2000 to avoid conflicts with other SFs/masks
#200N SCALE_ELEM000N ./Perturbations.txt - - - xy count 1
2001 SCALE_ELEM_0001 ./Perturbations.txt - - - xy count 1
)))AnalyticalInversion

The Emis_PosteriorSF and OH_PosteriorSF options have also been updated so they are also applied directly within HEMCO_Config.rc instead of within global_ch4_mod.F90/carbon_mod.F90. Emis_PosteriorSF applies the field EMIS_SF to the total CH4 emissions field and OH_PosteriorSF applies OH_SF to the GLOBAL_OH field.

Several options have also been removed from the CH4 menu in geoschem_config.yml since the were used in code that was removed from global_ch4_mod.F90.

2) Allow for multiple CH4 tracers

Routine CH4_DECAY in global_ch4_mod.F90 has been modified to loop over all advected species instead of assuming there is only one CH4 tracer. This allow components of the state vector to be added as individual CH4 tracers (e.g. CH4_0001, CH4_0002) so that jacobian simulations within the Integrated Methane Inversion (IMI) framework can be combined into fewer runs. The IMI automatically updates the geoschem_config.rc and species database files for the additional tracers so that does not need to be done by GEOS-Chem.

Expected changes

This is a zero-difference update with respect to the full-chemistry benchmark simulation.

Related Github Issue(s)

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…nstead

To facilitate CH4 simulations with multiple tracers representing the different
state vector elements within an analytical inversion, we now remove the
emissions perturbation applied within global_ch4_mod.F90 (and carbon_mod.F90).
Instead, emissions are perturbed directly in HEMCO_Config.rc via scale factors
applied to the state vector element IDs read from a netCDF file. The perturbations
are meant to be used on total CH4 emissions (i.e. using output from a HEMCO
standalone simulation) to avoid having to apply the scale factor(s) for every
emissions inventory and sector throughout HEMCO_Config.rc.

For example:

  #==============================================================================
  # ---Total CH4 emissions (all sectors) from prior simulation ---
  #==============================================================================
  (((UseTotalPriorEmis
  0 CH4_Emis_Prior ../prior_run/OutputDir/HEMCO_diagnostics.$YYYY$MM$DD0000.nc EmisCH4_Total $YYYY/$MM/$DD/0 C xy kg/m2/s CH4 - 1 500
  0 CH4_Emis_Prior_0001 - - - - - - CH4_0001 2001 1 500
  )))UseTotalPriorEmis

  #==============================================================================
  # --- Scale factors for analytical inversions ---
  #==============================================================================
  (((AnalyticalInversion

  # Add perturbations to individual state vector element (N) following the format
  # Start scale factor ID at 2000 to avoid conflicts with other SFs/masks
  #200N SCALE_ELEM000N ./Perturbations.txt - - - xy count 1
  2001 SCALE_ELEM_0001 ./Perturbations.txt - - - xy count 1

  )))AnalyticalInversion

The Emis_PosteriorSF and OH_PosteriorSF options have also been updated here
so they are also applied directly within HEMCO_Config.rc instead of within
global_ch4_mod.F90/carbon_mod.F90. Emis_PosteriorSF applies the field EMIS_SF
to the total CH4 emissions field and OH_PosteriorSF applies OH_SF to the
GLOBAL_OH field.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
…e CH4 tracers

Subroutines CH4_DECAY and CH4_STRAT have been modified to loop over the
number of advected species in the CH4 simulation. This allows for multiple
CH4 tracers (as used in the analytical inversion framework to represent
individual state vector elements).

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
The file path to CH4_Emis_Prior is specific to the IMI. If users want to use
this option in a different framework then they can modify the path manually.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
@msulprizio msulprizio added this to the 14.3.1 milestone Mar 26, 2024
@msulprizio msulprizio requested a review from yantosca March 26, 2024 18:21
@msulprizio msulprizio self-assigned this Mar 26, 2024
@yantosca yantosca added category: Feature Request New feature or request specialty simulations topic: Analytical Inversions Related to analytical inversions or IMI-related updates labels Mar 26, 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 noted a couple of minor things to be updated.

CHANGELOG.md Outdated Show resolved Hide resolved
GeosCore/input_mod.F90 Show resolved Hide resolved
Headers/species_database_mod.F90 Show resolved Hide resolved
Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
@msulprizio msulprizio requested a review from yantosca March 27, 2024 17:52
msulprizio added a commit to geoschem/GCClassic that referenced this pull request Mar 27, 2024
In pull request geoschem/geos-chem#2218 several
options were retired from the CH4 menu in geoschem_config.rc. These options
were removed in favor of handling emissions perturbations and scale factors
directly in HEMCO_Config.rc.

Signed-off-by: Melissa Sulprizio <mpayer@seas.harvard.edu>
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.

All remaining items have now been addressed. Good to merge. Thank you @msulprizio!

@yantosca
Copy link
Contributor

All GEOS_Chem Classic integration tests passed:

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

GCClassic #50d8dd0 GEOS-Chem submod update: Merge PR #2199 (GCHP advection diags)
GEOS-Chem #afd1f596b Merge PR #2218 (Add updates for CH4 analytical inversion)
HEMCO     #2a4bb12 Merge PR #268 (Handle 3D NEI emissions)

Using 24 OpenMP threads
Number of execution tests: 26

Submitted as SLURM job: 25565699
==============================================================================

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

All GEOS-Chem Classic integration tests were zero-diff w/r/t 14.3.0 except:

  • APM (known parallelization issue)
  • RRTMG (numerical noise in RRTMG collection file)
  • CH4, tagCH4 (updates related to this PR)

@yantosca
Copy link
Contributor

All GCHP integration tests passed:

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

GCHP      #4b6eb6a FvDyCoreCubed_GridComp update: Merge PR #8 (Add PLEadv diagnostic)
GEOS-Chem #afd1f596b Merge PR #2218 (Add updates for CH4 analytical inversion)
HEMCO     #2a4bb12 Merge PR #268 (Handle 3D NEI emissions)

Number of execution tests: 6

Submitted as SLURM job: 25565991
==============================================================================
 

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

Also, all GCHP integration tests were zero-diff w/r/t 14.3.0.

@yantosca yantosca merged commit afd1f59 into dev/no-diff-to-benchmark Mar 28, 2024
@yantosca yantosca deleted the feature/ch4-tracers-for-inv branch March 28, 2024 17:43
@msulprizio msulprizio added the topic: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO) label Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request topic: Analytical Inversions Related to analytical inversions or IMI-related updates topic: Carbon Gases Simulations Related to simulations with carbon gases (carbon, CO2, CH4, tagCH4, tagCO)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants