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

In KPP/carbon/carbon_Funcs.F90 when using PCO_fr_CH4_use was true there
was an extra line taking into account CH4 and OH concentrations. This should
not be needed when using the archived PCO_CH4 fields. In addition,
PCO_CH4 should only be used when using the carbon simulation with CO only.
Otherwise, the CH4 + OH rate function (2.45E-12_dp * EXP( -1775.0E+0_dp /TEMP ))
should be used.

To make is more clear the PCO_CH4 fields are read from file the option in
geoschem_config.yml has been renamed from from "use_fullchem_PCO_from_CH4"
to "use_archived_PCO_from_CH4". This is also set to false by default for
carbon simulations and only set to true in carbon simulations where only
CO is advected.

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 13, 2024
1 parent 0fcf8c4 commit 8f7746c
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 21 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
8 changes: 4 additions & 4 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
3 changes: 1 addition & 2 deletions KPP/carbon/carbon_Funcs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,9 @@ 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 )
ELSE
k_Trop(1) = 2.45E-12_dp * EXP( -1775.0E+0_dp /TEMP ) ! JPL 1997
ENDIF
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 @@ -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: false

#============================================================================
# Options for CO2
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
12 changes: 11 additions & 1 deletion 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 @@ -123,6 +123,16 @@ function updateGeosChemConfig() {
keyValueUpdate "${key}" "true" "false" "${file}"
done
fi

# If CO is in the include list, turn on CO 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}" "false" "true" "${file}"
done
fi
}


Expand Down

0 comments on commit 8f7746c

Please sign in to comment.