From 8baf973716abb66209c931451db7cb2c3a1b3457 Mon Sep 17 00:00:00 2001 From: Melissa Sulprizio Date: Fri, 13 Dec 2024 11:34:32 -0500 Subject: [PATCH] Added fixes to only apply archived PCO_CH4 field for carbon simulations 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 --- CHANGELOG.md | 1 + GeosCore/input_mod.F90 | 14 +++++------ KPP/carbon/carbon_Funcs.F90 | 2 +- KPP/carbon/gckpp_Function.F90 | 2 +- KPP/carbon/gckpp_Global.F90 | 2 +- KPP/carbon/gckpp_Initialize.F90 | 2 +- KPP/carbon/gckpp_Integrator.F90 | 2 +- KPP/carbon/gckpp_Jacobian.F90 | 2 +- KPP/carbon/gckpp_LinearAlgebra.F90 | 2 +- KPP/carbon/gckpp_Monitor.F90 | 2 +- KPP/carbon/gckpp_Parameters.F90 | 2 +- KPP/carbon/gckpp_Rates.F90 | 2 +- KPP/carbon/gckpp_Util.F90 | 2 +- .../geoschem_config.yml.CO2 | 2 +- .../geoschem_config.yml.carbon | 6 ++--- .../geoschem_config.yml.tagCO | 4 +-- run/shared/singleCarbonSpecies.sh | 25 +++++++++++-------- 17 files changed, 40 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b696ccef0..ef8a7ab8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/GeosCore/input_mod.F90 b/GeosCore/input_mod.F90 index 0812c9924..1e2c1c180 100644 --- a/GeosCore/input_mod.F90 +++ b/GeosCore/input_mod.F90 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/KPP/carbon/carbon_Funcs.F90 b/KPP/carbon/carbon_Funcs.F90 index cfe12a7d2..734604aa2 100644 --- a/KPP/carbon/carbon_Funcs.F90 +++ b/KPP/carbon/carbon_Funcs.F90 @@ -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 ) diff --git a/KPP/carbon/gckpp_Function.F90 b/KPP/carbon/gckpp_Function.F90 index 31145e8f7..05a1fe789 100644 --- a/KPP/carbon/gckpp_Function.F90 +++ b/KPP/carbon/gckpp_Function.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Global.F90 b/KPP/carbon/gckpp_Global.F90 index ab0d870d2..35126180f 100644 --- a/KPP/carbon/gckpp_Global.F90 +++ b/KPP/carbon/gckpp_Global.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Initialize.F90 b/KPP/carbon/gckpp_Initialize.F90 index b04d661ad..fc2a3904c 100644 --- a/KPP/carbon/gckpp_Initialize.F90 +++ b/KPP/carbon/gckpp_Initialize.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Integrator.F90 b/KPP/carbon/gckpp_Integrator.F90 index 3a267e9fa..15e1ee7dd 100644 --- a/KPP/carbon/gckpp_Integrator.F90 +++ b/KPP/carbon/gckpp_Integrator.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Jacobian.F90 b/KPP/carbon/gckpp_Jacobian.F90 index a79264e6f..65cfcc29d 100644 --- a/KPP/carbon/gckpp_Jacobian.F90 +++ b/KPP/carbon/gckpp_Jacobian.F90 @@ -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) diff --git a/KPP/carbon/gckpp_LinearAlgebra.F90 b/KPP/carbon/gckpp_LinearAlgebra.F90 index 655002792..afd23849e 100644 --- a/KPP/carbon/gckpp_LinearAlgebra.F90 +++ b/KPP/carbon/gckpp_LinearAlgebra.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Monitor.F90 b/KPP/carbon/gckpp_Monitor.F90 index 7063190ad..126258534 100644 --- a/KPP/carbon/gckpp_Monitor.F90 +++ b/KPP/carbon/gckpp_Monitor.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Parameters.F90 b/KPP/carbon/gckpp_Parameters.F90 index 70d35690b..874e5dfeb 100644 --- a/KPP/carbon/gckpp_Parameters.F90 +++ b/KPP/carbon/gckpp_Parameters.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Rates.F90 b/KPP/carbon/gckpp_Rates.F90 index 8d0b302e7..0195411f7 100644 --- a/KPP/carbon/gckpp_Rates.F90 +++ b/KPP/carbon/gckpp_Rates.F90 @@ -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) diff --git a/KPP/carbon/gckpp_Util.F90 b/KPP/carbon/gckpp_Util.F90 index 7fd3d92fb..4fd4fee48 100644 --- a/KPP/carbon/gckpp_Util.F90 +++ b/KPP/carbon/gckpp_Util.F90 @@ -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) diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CO2 b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CO2 index 54e8554a8..24fd480d1 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CO2 +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.CO2 @@ -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 diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon index c35423f8b..fcf79603d 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.carbon @@ -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 @@ -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 diff --git a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCO b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCO index 6ac1a9500..e47984860 100644 --- a/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCO +++ b/run/GCClassic/geoschem_config.yml.templates/geoschem_config.yml.tagCO @@ -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) diff --git a/run/shared/singleCarbonSpecies.sh b/run/shared/singleCarbonSpecies.sh index a727dc2e8..ac9a166ff 100755 --- a/run/shared/singleCarbonSpecies.sh +++ b/run/shared/singleCarbonSpecies.sh @@ -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 @@ -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 }