Skip to content

Commit

Permalink
Added fixes to only apply archived PCO_CH4 field for carbon simulatio…
Browse files Browse the repository at this point in the history
…ns with CO only

To make it more clear that the PCO_CH4 fields are read from file, the option in
in the CO2 menu of geoschem_config.yml has been renamed from from "use_fullchem_PCO_from_CH4"
to "use_archived_PCO_from_CH4 (same for NMVOC source)". The use_archived_PCO_from_CH4
option is now set to false by default for carbon simulations and only set to true in carbon simulations
where only CO is advected. Similarly, "3D_chemical_oxidation_source" in the CO2 menu
has been renamed to "use_archived_PCO2_from_CO".

The carbon mechanism was rebuilt with KPP 3.1.1 here but that is a zero-
difference update simply changing the headers of the KPP/carbon/gckpp* files.

Signed-off-by: Melissa Sulprizio <[email protected]>
  • Loading branch information
msulprizio committed Dec 20, 2024
1 parent 0fcf8c4 commit f408db9
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Removed extraneous pressure correction in GCHP carbon simulations by adding 'activate: true' to geoschem_config.yml
- Fixed bug in GC-Classic OCS emissions where unit conversion of km2 to m2 occurred twice
- Changed dimension of EmisOCS_Total from 2D to 3D since all emissions for all sectors are 2D
- Added fixes to only apply archived PCO_CH4 field for carbon simulations with CO only

### Removed
- Removed duplicate `WD_RetFactor` tag for HgClHO2 in `species_database.yml`
Expand Down
14 changes: 7 additions & 7 deletions GeosCore/input_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ SUBROUTINE Config_CO( Config, Input_Opt, RC )
!------------------------------------------------------------------------
! Use P(CO) from CH4 (archived from a fullchem simulation)?
!------------------------------------------------------------------------
key = "CO_simulation_options%use_fullchem_PCO_from_CH4"
key = "CO_simulation_options%use_archived_PCO_from_CH4"
v_bool = MISSING_BOOL
CALL QFYAML_Add_Get( Config, key, v_bool, "", RC )
IF ( RC /= GC_SUCCESS ) THEN
Expand All @@ -2033,7 +2033,7 @@ SUBROUTINE Config_CO( Config, Input_Opt, RC )
!------------------------------------------------------------------------
! Use P(CO) from NMVOC (archived from a fullchem simulation)?
!------------------------------------------------------------------------
key = "CO_simulation_options%use_fullchem_PCO_from_NMVOC"
key = "CO_simulation_options%use_archived_PCO_from_NMVOC"
v_bool = MISSING_BOOL
CALL QFYAML_Add_Get( Config, key, v_bool, "", RC )
IF ( RC /= GC_SUCCESS ) THEN
Expand All @@ -2050,8 +2050,8 @@ SUBROUTINE Config_CO( Config, Input_Opt, RC )
WRITE(6,90 ) 'TAGGED CO SIMULATION SETTINGS'
WRITE(6,95 ) '(overwrites any other settings related to CO)'
WRITE(6,95 ) '---------------------------------------------'
WRITE(6,100) 'Use full chem. P(CO) from CH4? :', Input_Opt%LPCO_CH4
WRITE(6,100) 'Use full chem. P(CO) from NMVOC? :', Input_Opt%LPCO_NMVOC
WRITE(6,100) 'Use archived P(CO) from CH4? :', Input_Opt%LPCO_CH4
WRITE(6,100) 'Use archived P(CO) from NMVOC? :', Input_Opt%LPCO_NMVOC
ENDIF

! FORMAT statements
Expand Down Expand Up @@ -2113,9 +2113,9 @@ SUBROUTINE Config_CO2( Config, Input_Opt, RC )
thisLoc = ' -> at Config_CO2 (in module GeosCore/input_mod.F90)'

!------------------------------------------------------------------------
! Turn on CO2 3D chemical source and surface correction?
! Use archived fields of CO2 production from CO oxidation?
!------------------------------------------------------------------------
key = "CO2_simulation_options%sources%3D_chemical_oxidation_source"
key = "CO2_simulation_options%sources%use_archived_PCO2_from_CO"
v_bool = MISSING_BOOL
CALL QFYAML_Add_Get( Config, key, v_bool, "", RC )
IF ( RC /= GC_SUCCESS ) THEN
Expand Down Expand Up @@ -2158,7 +2158,7 @@ SUBROUTINE Config_CO2( Config, Input_Opt, RC )
WRITE( 6,90 ) 'CO2 SIMULATION SETTINGS'
WRITE( 6,95 ) '(overwrites any other settings related to CO2)'
WRITE( 6,95 ) '----------------------------------------------'
WRITE( 6,100 ) 'CO2 from oxidation (CO,CH4,..):', Input_Opt%LCHEMCO2
WRITE( 6,100 ) 'Use archived P(CO2) from CO? :', Input_Opt%LCHEMCO2
WRITE( 6, 95 ) 'Tagged CO2 settings'
WRITE( 6,100 ) ' Tag Biosphere/Ocean CO2 :', Input_Opt%LBIOSPHTAG
WRITE( 6,100 ) ' Tag Fossil Fuel CO2 :', Input_Opt%LFOSSILTAG
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/carbon_Funcs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ SUBROUTINE carbon_ComputeRateConstants( &
C(ind_FixedCl) = ConcClMnd

! CH4 + offline OH reaction rate [1/s]
! This is a pseudo-2nd order rate appropriate for CH4 + OH
! Use rates saved from full-chemistry run (if CH4 is not advected)
IF ( PCO_fr_CH4_use ) THEN
k_Trop(1) = PCO_fr_CH4 * OHdiurnalFac
k_Trop(1) = SafeDiv( k_Trop(1), C(ind_CH4)*C(ind_FixedOH), 0.0_dp )
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Function.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! The ODE Function of Chemical Model File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Global.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Global Data Module File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Initialize.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Initialization File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Integrator.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Numerical Integrator (Time-Stepping) File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Jacobian.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! The ODE Jacobian of Chemical Model File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_LinearAlgebra.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Linear Algebra Data and Routines File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Monitor.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Utility Data Module File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Parameters.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Parameter Module File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Rates.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! The Reaction Rates File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
2 changes: 1 addition & 1 deletion KPP/carbon/gckpp_Util.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
!
! Auxiliary Routines File
!
! Generated by KPP-3.0.0 symbolic chemistry Kinetics PreProcessor
! Generated by KPP-3.1.1 symbolic chemistry Kinetics PreProcessor
! (https:/github.com/KineticPreProcessor/KPP
! KPP is distributed under GPL, the general public licence
! (http://www.gnu.org/copyleft/gpl.html)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ operations:
CO2_simulation_options:

sources:
3D_chemical_oxidation_source: true
use_archived_PCO2_from_CO: true

tagged_species:
tag_bio_and_ocean_CO2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ CH4_simulation_options:
#============================================================================

CO_simulation_options:
use_fullchem_PCO_from_CH4: true
use_fullchem_PCO_from_NMVOC: true
use_archived_PCO_from_CH4: false
use_archived_PCO_from_NMVOC: true

#============================================================================
# Options for CO2
Expand All @@ -96,7 +96,7 @@ CO_simulation_options:
CO2_simulation_options:

sources:
3D_chemical_oxidation_source: true
use_archived_PCO2_from_CO: false

tagged_species:
tag_bio_and_ocean_CO2: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ operations:
#============================================================================

CO_simulation_options:
use_fullchem_PCO_from_CH4: true
use_fullchem_PCO_from_NMVOC: true
use_archived_PCO_from_CH4: true
use_archived_PCO_from_NMVOC: true

#============================================================================
# Settings for diagnostics (other than HISTORY and HEMCO)
Expand Down
25 changes: 15 additions & 10 deletions run/shared/singleCarbonSpecies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function isItemInList() {
#
# Arguments:
# ${1}: The item
# ${2}: Thie list
# ${2}: The list
#
# Returns (via $?)
# 0 if item is in the list
Expand Down Expand Up @@ -110,17 +110,22 @@ function updateGeosChemConfig() {
sed -i -e "${cmd}" "${file}"
done

# NOTE: CH4 options are already deactivated
# in the out-of-the-box geoschem_config.yml

# If CO2 is in the exclude list, turn off CO2 options
# If CO2 is in the include list, turn on CO2 production options
isItemInList "CO2" "${1}"
if [[ $? == 0 ]]; then
keys=("3D_chemical_oxidation_source" \
"tag_bio_and_ocean_CO2" \
"tag_land_fossil_fuel_CO2" )
if [[ $? == 1 ]]; then
keys=("use_archived_PCO2_from_CO" )
for key in ${keys[@]}; do
keyValueUpdate "${key}" "false" "true" "${file}"
done
fi

# If CO is in the include list, turn on CO production options
isItemInList "CO" "${1}"
if [[ $? == 1 ]]; then
keys=("use_archived_PCO_from_CH4" \
"use_archived_PCO_from_NMVOC" )
for key in ${keys[@]}; do
keyValueUpdate "${key}" "true" "false" "${file}"
keyValueUpdate "${key}" "false" "true" "${file}"
done
fi
}
Expand Down

0 comments on commit f408db9

Please sign in to comment.