From 9e768bf533ef3b11f3044c3b901850acf21c5af3 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 23 Feb 2023 11:43:24 -0500 Subject: [PATCH 01/10] Modify HEMCO_Config.rc.carbon templates for single-species execution 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 --- CHANGELOG.md | 4 + .../HEMCO_Config.rc.carbon | 43 ++--- .../HEMCO_Config.rc.carbon | 159 +++++++++--------- 3 files changed, 110 insertions(+), 96 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0f828f9c..c4b6cb1bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ This file documents all notable changes to the GEOS-Chem repository starting in The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased +### Changed +- Update template `HEMCO_Config.rc.carbon` files to allow running the carbon simulation with only a single species. + ## [Unreleased 14.1.1] ### Added - New integration test functions in `test/GCClassic/integration` and `test/GCHP/integration` diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index 304dfcd6f..186dd8540 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -862,19 +862,19 @@ Mask fractions: false (((USE_CH4_DATA.or.USE_CO2_DATA (((GFED4 -111 GFED_TEMP $ROOT/GFED4/v2020-02/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_TEMP 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 -111 GFED_AGRI $ROOT/GFED4/v2020-02/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_AGRI 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 -111 GFED_DEFO $ROOT/GFED4/v2020-02/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_DEFO 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 -111 GFED_BORF $ROOT/GFED4/v2020-02/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_BORF 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 -111 GFED_PEAT $ROOT/GFED4/v2020-02/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_PEAT 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 -111 GFED_SAVA $ROOT/GFED4/v2020-02/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_SAVA 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 +111 GFED_TEMP $ROOT/GFED4/v2022-11/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_TEMP 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 +111 GFED_AGRI $ROOT/GFED4/v2022-11/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_AGRI 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 +111 GFED_DEFO $ROOT/GFED4/v2022-11/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_DEFO 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 +111 GFED_BORF $ROOT/GFED4/v2022-11/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_BORF 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 +111 GFED_PEAT $ROOT/GFED4/v2022-11/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_PEAT 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 +111 GFED_SAVA $ROOT/GFED4/v2022-11/$YYYY/GFED4_gen.025x025.$YYYY$MM.nc DM_SAVA 1997-2019/1-12/01/0 RF xy kgDM/m2/s * - 1 1 (((GFED_daily -111 GFED_FRAC_DAY $ROOT/GFED4/v2020-02/$YYYY/GFED4_dailyfrac_gen.025x025.$YYYY$MM.nc GFED_FRACDAY 2003-2019/1-12/1-31/0 RF xy 1 * - 1 1 +111 GFED_FRAC_DAY $ROOT/GFED4/v2022-11/$YYYY/GFED4_dailyfrac_gen.025x025.$YYYY$MM.nc GFED_FRACDAY 2003-2019/1-12/1-31/0 RF xy 1 * - 1 1 )))GFED_daily (((GFED_3hourly -111 GFED_FRAC_3HOUR $ROOT/GFED4/v2020-02/$YYYY/GFED4_3hrfrac_gen.025x025.$YYYY$MM.nc GFED_FRAC3HR 2003-2019/1-12/1/0-23 RF xy 1 * - 1 1 +111 GFED_FRAC_3HOUR $ROOT/GFED4/v2022-11/$YYYY/GFED4_3hrfrac_gen.025x025.$YYYY$MM.nc GFED_FRAC3HR 2003-2019/1-12/1/0-23 RF xy 1 * - 1 1 )))GFED_3hourly )))GFED4 @@ -1148,7 +1148,7 @@ Mask fractions: false # --- OH from GEOS-Chem v5-07 [kg/m3] --- (((GLOBAL_OH_GCv5 -* GLOBAL_OH $ROOT/OH/v2014-09/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * - 1 1 +* GLOBAL_OH $ROOT/OH/v2022-11/v5-07-08/OH_3Dglobal.geos5.47L.4x5.nc OH 1985/1-12/1/0 C xyz kg/m3 * - 1 1 )))GLOBAL_OH_GCv5 # --- OH from the last 10-yr benchmark [mol/mol dry air] --- @@ -1161,7 +1161,6 @@ ${RUNDIR_GLOBAL_OH} #------------------------------------------------------------------------------ # --- Quantities needed for CH4 chemistry --- #------------------------------------------------------------------------------ -(((USE_CH4_DATA # --- Global CH4 loss, Cl fields for CH4 simulation [1/s] ----------- (((GMI_CH4_LOSS @@ -1173,12 +1172,9 @@ ${RUNDIR_CH4_LOSS} ${RUNDIR_GLOBAL_Cl} )))GLOBAL_CL -)))USE_CH4_DATA - #------------------------------------------------------------------------------ # --- Quantities needed for CO chemistry --- #------------------------------------------------------------------------------ -(((USE_CO_DATA # -- P(CO) from CH4 and NMVOC from the last 10-yr benchmark [molec/cm3/s] --- (((PROD_CO_CH4 @@ -1190,13 +1186,21 @@ ${RUNDIR_PCO_NMVOC} # --- GMI chemistry: prod/loss rates (for strato-/mesosphere) --- # --- Units: prod [v/v/s]; loss [1/s] --- +(((USE_CO_DATA (((GMI_PROD_LOSS -${RUNDIR_GMI_LOSS_CO} -${RUNDIR_GMI_PROD_CO} +* GMI_LOSS_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc loss 2005/1-12/1/0 C xyz s-1 CO - 1 1 +* GMI_PROD_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc prod 2005/1-12/1/0 C xyz v/v/s CO - 1 1 )))GMI_PROD_LOSS - )))USE_CO_DATA +# If CO is not an advected species, then just read as a chemistry input +(((.not.USE_CO_DATA +(((GMI_PROD_LOSS +* GMI_LOSS_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc loss 2005/1-12/1/0 C xyz s-1 * - 1 1 +* GMI_PROD_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc prod 2005/1-12/1/0 C xyz v/v/s * - 1 1 +)))GMI_PROD_LOSS +))).not.USE_CO_DATA + #------------------------------------------------------------------------------ # --- Quantities needed for CO2 chemistry --- #------------------------------------------------------------------------------ @@ -1204,14 +1208,11 @@ ${RUNDIR_GMI_PROD_CO} # --- CHEMICAL PRODUCTION FROM CO OXIDATION ------ # --- Recommended for use in forward modelling --- # --- Optional for inversion/assimilation -------- -(((USE_CO2_DATA (((CO2_COPROD ${RUNDIR_CO2_COPROD} )))CO2_COPROD -)))USE_CO2_DATA - )))CHEMISTRY_INPUT ### END SECTION BASE EMISSIONS ### @@ -1292,7 +1293,7 @@ ${RUNDIR_CO2_COPROD} # --- EPA NEI day-of-week scale factors --- #============================================================================== (((NEI2016_MONMEAN -211 NEI99_DOW_CO $ROOT/NEI2005/v2023-02/NEI99.dow.geos.corrected.012023.1x1.nc CO 1999/1-12/WD/0 C xy 1 1 +211 NEI99_DOW_CO $ROOT/NEI2005/v2023-02/NEI99.dow.geos.1x1.corrected.012023.nc CO 1999/1-12/WD/0 C xy 1 1 )))NEI2016_MONMEAN #============================================================================== # --- EPA NEI2016 annual scale factors --- @@ -1439,7 +1440,7 @@ ${RUNDIR_CO2_COPROD} # main/national fossil fuel emission field if using avaition emissions. #============================================================================== (((FOSSIL_CDIAC.or.FOSSIL_ODIAC.or.CO2CORR -480 AVIATION_SURF_CORR $ROOT/CO2/v2015-04/FOSSIL/Aviation_SurfCorr_SclFac.1x1.nc CO2 2004/1/1/0 C xy 1 1 +480 AVIATION_SURF_CORR $ROOT/CO2/v2022-11/FOSSIL/Aviation_SurfCorr_SclFac.1x1.nc CO2 2004/1/1/0 C xy 1 1 )))FOSSIL_CDIAC.or.FOSSIL_ODIAC.or.CO2CORR #============================================================================== diff --git a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index b887dcfbe..6f422752a 100644 --- a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -157,74 +157,78 @@ Mask fractions: false # --- CH4: Gridded EPA (Maasakkers et al., Environ. Sci. Technol., 2016) --- # # NOTES: +# - Use Hier=100 to add to Canada and Mexico regional inventories # - Do not use GEPA forest fire emissions. Use QFED instead. # - Apply seasonal scale factors to manure and rice emissions #============================================================================== (((GEPA -0 GEPA_OIL $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2a_Petroleum 2012/1/1/0 C xy molec/cm2/s CH4 1008 1 50 -0 GEPA_GAS_PRODUCTION $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Production 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 50 -0 GEPA_GAS_PROCESSING $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Processing 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 50 -0 GEPA_GAS_TRANSMISSION $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Transmission 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 50 -0 GEPA_GAS_DISTRIBUTION $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Distribution 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 50 -0 GEPA_COAL_UNDERGROUND $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Underground 2012/1/1/0 C xy molec/cm2/s CH4 1008 3 50 -0 GEPA_COAL_SURFACE $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Surface 2012/1/1/0 C xy molec/cm2/s CH4 1008 3 50 -0 GEPA_COAL_ABANDONED $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Abandoned_Coal 2012/1/1/0 C xy molec/cm2/s CH4 1008 3 50 -0 GEPA_LIVESTOCK__4A $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4A_Enteric_Fermentation 2012/1/1/0 C xy molec/cm2/s CH4 1008 4 50 -0 GEPA_LIVESTOCK__4B $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4B_Manure_Management 2012/1/1/0 C xy molec/cm2/s CH4 10/1008 4 50 -0 GEPA_LANDFILLS_MUNI $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Municipal 2012/1/1/0 C xy molec/cm2/s CH4 1008 5 50 -0 GEPA_LANDFILLS_INDU $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1008 5 50 -0 GEPA_WASTEWATER_DOME $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Domestic 2012/1/1/0 C xy molec/cm2/s CH4 1008 6 50 -0 GEPA_WASTEWATER_INDU $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1008 6 50 -0 GEPA_RICE $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4C_Rice_Cultivation 2012/1/1/0 C xy molec/cm2/s CH4 11/1008 7 50 -0 GEPA_OTHER__1A_M $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Mobile 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 50 -0 GEPA_OTHER__1A_S $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Stationary 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 50 -0 GEPA_OTHER__2B5 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2B5_Petrochemical_Production 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 50 -0 GEPA_OTHER__2C2 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2C2_Ferroalloy_Production 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 50 -0 GEPA_OTHER__4F $ROOT/CH4/v2022-11/GEPA/GEPA_Monthly.nc emissions_4F_Field_Burning 2012/1-12/1/0 C xy molec/cm2/s CH4 1008 8 50 -#0 GEPA_OTHER__5 $ROOT/CH4/v2022-11/GEPA_Daily.nc emissions_5_Forest_Fires 2012/1/1/0 C xy molec/cm2/s CH4 1008 9 50 -0 GEPA_OTHER__6D $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6D_Composting 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 50 -0 GEPA_COAST_OIL $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2a_Petroleum 2012/1/1/0 C xy molec/cm2/s CH4 1009 1 1 -0 GEPA_COAST_GAS_PR $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Production 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 1 -0 GEPA_COAST_GAS_PC $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Processing 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 1 -0 GEPA_COAST_GAS_TR $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Transmission 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 1 -0 GEPA_COAST_GAS_DS $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Distribution 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 1 -0 GEPA_COAST_COAL_U $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Underground 2012/1/1/0 C xy molec/cm2/s CH4 1009 3 1 -0 GEPA_COAST_COAL_S $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Surface 2012/1/1/0 C xy molec/cm2/s CH4 1009 3 1 -0 GEPA_COAST_COAL_A $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Abandoned_Coal 2012/1/1/0 C xy molec/cm2/s CH4 1009 3 1 -0 GEPA_COAST_LVSTK_F $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4A_Enteric_Fermentation 2012/1/1/0 C xy molec/cm2/s CH4 1009 4 1 -0 GEPA_COAST_LVSTK_M $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4B_Manure_Management 2012/1/1/0 C xy molec/cm2/s CH4 10/1009 4 1 -0 GEPA_COAST_LDF_M $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Municipal 2012/1/1/0 C xy molec/cm2/s CH4 1009 5 1 -0 GEPA_COAST_LDF_I $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1009 5 1 -0 GEPA_COAST_WSTW_D $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Domestic 2012/1/1/0 C xy molec/cm2/s CH4 1009 6 1 -0 GEPA_COAST_WSTW_I $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1009 6 1 -0 GEPA_COAST_RICE $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4C_Rice_Cultivation 2012/1/1/0 C xy molec/cm2/s CH4 11/1009 7 1 -0 GEPA_COAST_OTH_1AM $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Mobile 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 1 -0 GEPA_COAST_OTH_1AS $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Stationary 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 1 -0 GEPA_COAST_OTH_2B5 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2B5_Petrochemical_Production 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 1 -0 GEPA_COAST_OTH_2C2 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2C2_Ferroalloy_Production 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 1 -0 GEPA_COAST_OTH_4F $ROOT/CH4/v2022-11/GEPA/GEPA_Monthly.nc emissions_4F_Field_Burning 2012/1-12/1/0 C xy molec/cm2/s CH4 1009 8 1 -#0 GEPA_COAST_OTH_5 $ROOT/CH4/v2022-11/GEPA_Daily.nc emissions_5_Forest_Fires 2012/1/1/0 C xy molec/cm2/s CH4 1009 9 1 -0 GEPA_COAST_OTH_6D $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6D_Composting 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 1 +0 GEPA_OIL $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2a_Petroleum 2012/1/1/0 C xy molec/cm2/s CH4 1008 1 100 +0 GEPA_GAS_PRODUCTION $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Production 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 100 +0 GEPA_GAS_PROCESSING $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Processing 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 100 +0 GEPA_GAS_TRANSMISSION $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Transmission 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 100 +0 GEPA_GAS_DISTRIBUTION $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Distribution 2012/1/1/0 C xy molec/cm2/s CH4 1008 2 100 +0 GEPA_COAL_UNDERGROUND $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Underground 2012/1/1/0 C xy molec/cm2/s CH4 1008 3 100 +0 GEPA_COAL_SURFACE $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Surface 2012/1/1/0 C xy molec/cm2/s CH4 1008 3 100 +0 GEPA_COAL_ABANDONED $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Abandoned_Coal 2012/1/1/0 C xy molec/cm2/s CH4 1008 3 100 +0 GEPA_LIVESTOCK__4A $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4A_Enteric_Fermentation 2012/1/1/0 C xy molec/cm2/s CH4 1008 4 100 +0 GEPA_LIVESTOCK__4B $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4B_Manure_Management 2012/1/1/0 C xy molec/cm2/s CH4 10/1008 4 100 +0 GEPA_LANDFILLS_MUNI $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Municipal 2012/1/1/0 C xy molec/cm2/s CH4 1008 5 100 +0 GEPA_LANDFILLS_INDU $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1008 5 100 +0 GEPA_WASTEWATER_DOME $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Domestic 2012/1/1/0 C xy molec/cm2/s CH4 1008 6 100 +0 GEPA_WASTEWATER_INDU $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1008 6 100 +0 GEPA_RICE $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4C_Rice_Cultivation 2012/1/1/0 C xy molec/cm2/s CH4 11/1008 7 100 +0 GEPA_OTHER__1A_M $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Mobile 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 100 +0 GEPA_OTHER__1A_S $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Stationary 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 100 +0 GEPA_OTHER__2B5 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2B5_Petrochemical_Production 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 100 +0 GEPA_OTHER__2C2 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2C2_Ferroalloy_Production 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 100 +0 GEPA_OTHER__4F $ROOT/CH4/v2022-11/GEPA/GEPA_Monthly.nc emissions_4F_Field_Burning 2012/1-12/1/0 C xy molec/cm2/s CH4 1008 8 100 +#0 GEPA_OTHER__5 $ROOT/CH4/v2022-11/GEPA_Daily.nc emissions_5_Forest_Fires 2012/1/1/0 C xy molec/cm2/s CH4 1008 9 100 +0 GEPA_OTHER__6D $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6D_Composting 2012/1/1/0 C xy molec/cm2/s CH4 1008 8 100 +0 GEPA_COAST_OIL $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2a_Petroleum 2012/1/1/0 C xy molec/cm2/s CH4 1009 1 5 +0 GEPA_COAST_GAS_PR $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Production 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 5 +0 GEPA_COAST_GAS_PC $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Processing 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 5 +0 GEPA_COAST_GAS_TR $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Transmission 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 5 +0 GEPA_COAST_GAS_DS $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B2b_Natural_Gas_Distribution 2012/1/1/0 C xy molec/cm2/s CH4 1009 2 5 +0 GEPA_COAST_COAL_U $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Underground 2012/1/1/0 C xy molec/cm2/s CH4 1009 3 5 +0 GEPA_COAST_COAL_S $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Coal_Mining_Surface 2012/1/1/0 C xy molec/cm2/s CH4 1009 3 5 +0 GEPA_COAST_COAL_A $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1B1a_Abandoned_Coal 2012/1/1/0 C xy molec/cm2/s CH4 1009 3 5 +0 GEPA_COAST_LVSTK_F $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4A_Enteric_Fermentation 2012/1/1/0 C xy molec/cm2/s CH4 1009 4 5 +0 GEPA_COAST_LVSTK_M $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4B_Manure_Management 2012/1/1/0 C xy molec/cm2/s CH4 10/1009 4 5 +0 GEPA_COAST_LDF_M $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Municipal 2012/1/1/0 C xy molec/cm2/s CH4 1009 5 5 +0 GEPA_COAST_LDF_I $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6A_Landfills_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1009 5 5 +0 GEPA_COAST_WSTW_D $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Domestic 2012/1/1/0 C xy molec/cm2/s CH4 1009 6 5 +0 GEPA_COAST_WSTW_I $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6B_Wastewater_Treatment_Industrial 2012/1/1/0 C xy molec/cm2/s CH4 1009 6 5 +0 GEPA_COAST_RICE $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_4C_Rice_Cultivation 2012/1/1/0 C xy molec/cm2/s CH4 11/1009 7 5 +0 GEPA_COAST_OTH_1AM $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Mobile 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 5 +0 GEPA_COAST_OTH_1AS $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_1A_Combustion_Stationary 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 5 +0 GEPA_COAST_OTH_2B5 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2B5_Petrochemical_Production 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 5 +0 GEPA_COAST_OTH_2C2 $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_2C2_Ferroalloy_Production 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 5 +0 GEPA_COAST_OTH_4F $ROOT/CH4/v2022-11/GEPA/GEPA_Monthly.nc emissions_4F_Field_Burning 2012/1-12/1/0 C xy molec/cm2/s CH4 1009 8 5 +#0 GEPA_COAST_OTH_5 $ROOT/CH4/v2022-11/GEPA_Daily.nc emissions_5_Forest_Fires 2012/1/1/0 C xy molec/cm2/s CH4 1009 9 5 +0 GEPA_COAST_OTH_6D $ROOT/CH4/v2022-11/GEPA/GEPA_Annual.nc emissions_6D_Composting 2012/1/1/0 C xy molec/cm2/s CH4 1009 8 5 )))GEPA #============================================================================== # --- CH4: Mexico emissions (Scarpelli et. al, Environ. Res. Lett., 2020) --- +# +# NOTES: +# - Use Hier=100 to add to Canada and USA regional inventories #============================================================================== (((Scarpelli_Mexico -0 MEX_OIL $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_oil_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 1 30 -0 MEX_GAS $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_gas_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 2 30 -0 MEX_COAL $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_coal_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 3 30 -0 MEX_LIVESTOCK_A $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_livestock_A_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 4 30 -0 MEX_LIVESTOCK_B $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_livestock_B_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 10/1001 4 30 -0 MEX_LANDFILLS $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_landfill_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 5 30 -0 MEX_WASTEWATER $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_waste_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 6 30 -0 MEX_RICE $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_rice_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 11/1001 7 30 -0 MEX_OTHER $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_other_anthro_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 8 30 - -### Make sure to include offshore/coastal emissions (Hier=1 to add to EDGAR) ### -0 MEX_OIL_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_oil_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 1 1 -0 MEX_GAS_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_gas_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 2 1 -0 MEX_COAL_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_coal_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 3 1 +0 MEX_OIL $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_oil_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 1 100 +0 MEX_GAS $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_gas_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 2 100 +0 MEX_COAL $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_coal_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 3 100 +0 MEX_LIVESTOCK_A $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_livestock_A_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 4 100 +0 MEX_LIVESTOCK_B $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_livestock_B_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 10/1001 4 100 +0 MEX_LANDFILLS $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_landfill_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 5 100 +0 MEX_WASTEWATER $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_waste_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 6 100 +0 MEX_RICE $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_rice_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 11/1001 7 100 +0 MEX_OTHER $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_other_anthro_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1001 8 100 + +### Make sure to include offshore/coastal emissions (Hier=1 to add to EDGAR, Hier=5 to add to GFEI) ### +0 MEX_OIL_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_oil_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 1 5 +0 MEX_GAS_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_gas_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 2 5 +0 MEX_COAL_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_coal_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 3 5 0 MEX_LIVESTOCK_A_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_livestock_A_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 4 1 0 MEX_LIVESTOCK_B_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_livestock_B_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 10/1010 4 1 0 MEX_LANDFILLS_COAST $ROOT/CH4/v2022-11/Scarpelli_Mexico/MEX_Tia2020_landfill_2015.nc emis_ch4 2015/1/1/0 C xy molec/cm2/s CH4 1010 5 1 @@ -235,6 +239,9 @@ Mask fractions: false #============================================================================== # --- CH4: Canada emissions (Scarpelli et al., Environ. Res. Lett., 2022) --- +# +# NOTES: +# - Use Hier=100 to add to USA and Mexico regional inventories #============================================================================== (((Scarpelli_Canada 0 CAN_OIL_GAS_COMBUSTION $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_combustion_2018.nc oil_gas_combustion_total 2018/1/1/0 C xy kg/m2/s CH4 1002 1/2 100 @@ -246,11 +253,11 @@ Mask fractions: false 0 CAN_WASTEWATER $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_wastewater_2018.nc wastewater_total 2018/1/1/0 C xy kg/m2/s CH4 1002 6 100 0 CAN_OTHER $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_other_minor_sources_2018.nc other_minor_sources_total 2018/1/1/0 C xy kg/m2/s CH4 1002 8 100 -### Make sure to include offshore/coastal emissions (Hier=1 to add to EDGAR) ### -0 CAN_OIL_GAS_COMBUSTION_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_combustion_2018.nc oil_gas_combustion_total 2018/1/1/0 C xy kg/m2/s CH4 1011 1/2 100 -0 CAN_OIL_GAS_LEAKAGE_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_leakage_2018.nc oil_gas_leakage_total 2018/1/1/0 C xy kg/m2/s CH4 1011 1/2 100 -0 CAN_OIL_GAS_VENT_FLARE_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_vent_flare_2018.nc oil_gas_vent_flare_total 2018/1/1/0 C xy kg/m2/s CH4 1011 1/2 100 -0 CAN_COAL_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_coal_2018.nc coal_total 2018/1/1/0 C xy kg/m2/s CH4 1011 3 100 +### Make sure to include offshore/coastal emissions (Hier=1 to add to EDGAR, Hier=5 to add to GFEI) ### +0 CAN_OIL_GAS_COMBUSTION_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_combustion_2018.nc oil_gas_combustion_total 2018/1/1/0 C xy kg/m2/s CH4 1011 1/2 5 +0 CAN_OIL_GAS_LEAKAGE_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_leakage_2018.nc oil_gas_leakage_total 2018/1/1/0 C xy kg/m2/s CH4 1011 1/2 5 +0 CAN_OIL_GAS_VENT_FLARE_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_oil_gas_vent_flare_2018.nc oil_gas_vent_flare_total 2018/1/1/0 C xy kg/m2/s CH4 1011 1/2 5 +0 CAN_COAL_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_coal_2018.nc coal_total 2018/1/1/0 C xy kg/m2/s CH4 1011 3 5 0 CAN_LIVESTOCK_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_livestock_2018.nc livestock_total 2018/1/1/0 C xy kg/m2/s CH4 1011 4 1 0 CAN_SOLID_WASTE_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_solid_waste_2018.nc solid_waste_total 2018/1/1/0 C xy kg/m2/s CH4 1011 5 1 0 CAN_WASTEWATER_COAST $ROOT/CH4/v2022-01/Scarpelli_Canada/can_emis_wastewater_2018.nc wastewater_total 2018/1/1/0 C xy kg/m2/s CH4 1011 6 1 @@ -350,7 +357,7 @@ Mask fractions: false )))SEEPS #============================================================================== -# --- CH4: Emissions from Lakes (Maasakkers et al., in prep) --- +# --- CH4: Emissions from Lakes (Maasakkers et al., 2019) --- #============================================================================== (((LAKES 0 CH4_LAKES $ROOT/CH4/v2017-10/Lakes/Maasakkers_Lakes_$YYYY.01x01.nc emi_ch4 $YYYY/1-12/1/0 C xy molec/cm2/s CH4 - 12 1 @@ -716,7 +723,7 @@ Mask fractions: false )))OCEAN_EXCH_TAKA09 (((OCEAN_EXCH_SCALED -0 OCEANCO2_SCALED_MONTHLY $ROOT/CO2/v2022-11/OCEAN/Scaled_Ocean_CO2_monthly.nc CO2 2000-2013/1-12/1/0 C xy kg/m2/s CO2 - 2 3 +0 OCEANCO2_SCALED_MONTHLY $ROOT/CO2/v2022-11/OCEAN/Scaled_Ocean_CO2_monthly.nc CO2 2000-2013/1-12/1/0 C xy kg/m2/s CO2 - 2 3 )))OCEAN_EXCH_SCALED #============================================================================== @@ -748,7 +755,7 @@ Mask fractions: false # inversion/assimilation #============================================================================== (((NET_TERR_EXCH -0 CO2_NET_TERRESTRIAL $ROOT/CO2/v2022-11/BIO/Net_terrestrial_exch_5.29Pg.generic.1x1.nc CO2 2000/1/1/0 C xy kg/m2/s CO2 - 5 1 +0 CO2_NET_TERRESTRIAL $ROOT/CO2/v2022-11/BIO/Net_terrestrial_exch_5.29Pg.generic.1x1.nc CO2 2000/1/1/0 C xy kg/m2/s CO2 - 5 1 )))NET_TERR_EXCH #============================================================================== @@ -1231,7 +1238,6 @@ ${RUNDIR_GLOBAL_OH} #------------------------------------------------------------------------------ # --- Quantities needed for CH4 chemistry --- #------------------------------------------------------------------------------ -(((USE_CH4_DATA # --- Global CH4 loss, Cl fields for CH4 simulation [1/s] ----------- # --- NOTE: GCHP must use the 72 layer file!! ----------- @@ -1244,8 +1250,6 @@ ${RUNDIR_GLOBAL_OH} ${RUNDIR_GLOBAL_Cl} )))GLOBAL_CL -)))USE_CH4_DATA - #------------------------------------------------------------------------------ # --- Quantities needed for CO chemistry --- #------------------------------------------------------------------------------ @@ -1261,13 +1265,21 @@ ${RUNDIR_PCO_NMVOC} # --- GMI chemistry: prod/loss rates (for strato-/mesosphere) --- # --- Units: prod [v/v/s]; loss [1/s] --- +(((USE_CO_DATA (((GMI_PROD_LOSS -${RUNDIR_GMI_LOSS_CO} -${RUNDIR_GMI_PROD_CO} +* GMI_LOSS_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc loss 2005/1-12/1/0 C xyz s-1 CO - 1 1 +* GMI_PROD_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc prod 2005/1-12/1/0 C xyz v/v/s CO - 1 1 )))GMI_PROD_LOSS - )))USE_CO_DATA +# If CO is not an advected species, then just read as a chemistry input +(((.not.USE_CO_DATA +(((GMI_PROD_LOSS +* GMI_LOSS_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc loss 2005/1-12/1/0 C xyz s-1 * - 1 1 +* GMI_PROD_CO $ROOT/GMI/v2022-11/gmi.clim.CO.geos5.2x25.nc prod 2005/1-12/1/0 C xyz v/v/s * - 1 1 +)))GMI_PROD_LOSS +))).not.USE_CO_DATA + #------------------------------------------------------------------------------ # --- Quantities needed for CO2 chemistry --- #------------------------------------------------------------------------------ @@ -1275,14 +1287,11 @@ ${RUNDIR_GMI_PROD_CO} # --- CHEMICAL PRODUCTION FROM CO OXIDATION ------ # --- Recommended for use in forward modelling --- # --- Optional for inversion/assimilation -------- -(((USE_CO2_DATA (((CO2_COPROD ${RUNDIR_CO2_COPROD} )))CO2_COPROD -)))USE_CO2_DATA - )))CHEMISTRY_INPUT ### END SECTION BASE EMISSIONS ### From 362a55a3e50809fb92b5c3bf18bb4729392e9d07 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 9 Mar 2023 14:31:31 -0500 Subject: [PATCH 02/10] Add timers for carbon simulation 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 --- GeosCore/carbon_gases_mod.F90 | 22 ++++++++++++++++++++-- GeosCore/chemistry_mod.F90 | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/GeosCore/carbon_gases_mod.F90 b/GeosCore/carbon_gases_mod.F90 index 138b0ff3e..95b919f90 100644 --- a/GeosCore/carbon_gases_mod.F90 +++ b/GeosCore/carbon_gases_mod.F90 @@ -367,7 +367,7 @@ END SUBROUTINE Emiss_Carbon_Gases ! !INTERFACE: ! SUBROUTINE Chem_Carbon_Gases( Input_Opt, State_Met, State_Chm, & - State_Grid, State_Diag, RC ) + State_Grid, State_Diag, RC ) ! ! !USES: ! @@ -682,7 +682,16 @@ SUBROUTINE Chem_Carbon_Gases( Input_Opt, State_Met, State_Chm, & ! Update reaction rates !=================================================================== - ! Start timer + ! Stop KPP timer + IF ( Input_Opt%useTimers ) THEN + CALL Timer_End( & + timerName = " -> KPP", & + inLoop = .TRUE., & + threadNum = ThreadNum, & + RC = RC ) + ENDIF + + ! Start RCONST timer IF ( Input_Opt%useTimers ) THEN CALL Timer_Start( & timerName = " RCONST", & @@ -754,6 +763,15 @@ SUBROUTINE Chem_Carbon_Gases( Input_Opt, State_Met, State_Chm, & ! Trap potential errors IF ( IERR /= 1 ) failed = .TRUE. + ! Start KPP timer + IF ( Input_Opt%useTimers ) THEN + CALL Timer_End( & + timerName = " -> KPP", & + inLoop = .TRUE., & + threadNum = ThreadNum, & + RC = RC ) + ENDIF + !===================================================================== ! HISTORY: Archive KPP solver diagnostics !===================================================================== diff --git a/GeosCore/chemistry_mod.F90 b/GeosCore/chemistry_mod.F90 index eab0604d9..547781137 100644 --- a/GeosCore/chemistry_mod.F90 +++ b/GeosCore/chemistry_mod.F90 @@ -970,6 +970,11 @@ SUBROUTINE Do_Chemistry( Input_Opt, State_Chm, State_Diag, & !===================================================================== ELSE IF ( Input_Opt%ITS_A_CARBON_SIM ) THEN + ! Start "FlexChem" timer + IF ( Input_Opt%useTimers ) THEN + CALL Timer_Start( "=> FlexChem", RC ) + ENDIF + ! Do carbon chemistry CALL Chem_Carbon_Gases( Input_Opt = Input_Opt, & State_Met = State_Met, & @@ -985,11 +990,21 @@ SUBROUTINE Do_Chemistry( Input_Opt, State_Chm, State_Diag, & RETURN ENDIF + ! Stop "FlexChem" timer + IF ( Input_Opt%useTimers ) THEN + CALL Timer_End( "=> FlexChem", RC ) + ENDIF + !==================================================================== ! Mercury (configure with -DMECH=Hg) !===================================================================== ELSE IF ( Input_Opt%ITS_A_MERCURY_SIM ) THEN + ! Start "FlexChem" timer + IF ( Input_Opt%useTimers ) THEN + CALL Timer_Start( "=> FlexChem", RC ) + ENDIF + ! Do Hg chemistry CALL ChemMercury( Input_Opt = Input_Opt, & State_Chm = State_Chm, & @@ -1005,6 +1020,11 @@ SUBROUTINE Do_Chemistry( Input_Opt, State_Chm, State_Diag, & RETURN ENDIF + ! Stop "FlexChem" timer + IF ( Input_Opt%useTimers ) THEN + CALL Timer_End( "=> FlexChem", RC ) + ENDIF + !===================================================================== ! POPs (only used when compiled with BPCH_DIAG=y) !===================================================================== From e4a7130c9c75001fae2de00b147ee4c5d31761c6 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 24 Aug 2023 17:22:10 -0400 Subject: [PATCH 03/10] Update carbon sim template files; add script for single species 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 --- .../HEMCO_Config.rc.carbon | 10 +- .../HEMCO_Diagn.rc.carbon | 84 +----- .../HEMCO_Config.rc.carbon | 10 +- .../HEMCO_Diagn.rc.carbon | 83 +----- run/shared/single_carbon_species.sh | 262 ++++++++++++++++++ 5 files changed, 278 insertions(+), 171 deletions(-) create mode 100755 run/shared/single_carbon_species.sh diff --git a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index d22f1bdac..3d859e8e7 100644 --- a/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCClassic/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -39,8 +39,7 @@ Separator: / Unit tolerance: 1 Negative values: 2 Only unitless scale factors: false -Verbose: 0 -Warnings: 1 +Verbose: false Mask fractions: false ### END SECTION SETTINGS ### @@ -1589,12 +1588,15 @@ ${RUNDIR_CO2_COPROD} 2008 AFRICA_MASK $ROOT/MASKS/v2018-09/AF_LANDMASK.geos.05x0666.global.nc LANDMASK 1985/1/1/0 C xy 1 1 -20/-37/54/40 )))DICE_Africa +)))USE_CO_DATA.or.USE_CO2_DATA + +#============================================================================== +# --- Masks used for CH4, CO and CO2 simulation emissions --- +#============================================================================== (((CEDSv2.or.CEDS_GBDMAPS.or.CEDS_GBDMAPS_byFuelType 2009 CHINA_MASK $ROOT/MASKS/v2018-09/China_mask.generic.1x1.nc MASK 2000/1/1/0 C xy 1 1 70/10/150/60 )))CEDSv2.or.CEDS_GBDMAPS.or.CEDS_GBDMAPS_byFuelType -)))USE_CO_DATA.or.USE_CO2_DATA - )))EMISSIONS ### END SECTION MASKS ### diff --git a/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon b/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon index 43ed75773..9b82bd752 100644 --- a/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon +++ b/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon @@ -16,9 +16,8 @@ # Name Spec ExtNr Cat Hier Dim OutUnit LongName ############################################################################### -##### CH4 sources ##### +##### CH4 sources ##### ############################################################################### - EmisCH4_Total CH4 -1 -1 -1 2 kg/m2/s CH4_emissions_from_all_sectors EmisCH4_Oil CH4 0 1 -1 2 kg/m2/s CH4_emissions_from_oil EmisCH4_Gas CH4 0 2 -1 2 kg/m2/s CH4_emissions_from_gas @@ -56,12 +55,7 @@ EmisCO2_NetTerrExch CO2 0 5 -1 2 kg/m2/s CO2_net_terrestrial_exc EmisCO2_Ship CO2 0 6 -1 2 kg/m2/s CO2_ship_emissions EmisCO2_Aviation CO2 0 7 -1 3 kg/m2/s CO2_aviation_emissions EmisCO2_CO2SurfCorr CO2 0 8 -1 2 kg/m2/s CO2_surface_correction_for_CO_oxidation - -#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 #EmisCO2_Biomass_FINN CO2 114 1 1 2 kg/m2/s CO2_biomass_burning_emissions_from_FINN ############################################################################### @@ -72,77 +66,3 @@ EmisOCS_Anthro OCS 0 1 -1 2 kg/m2/s OCS_emission_flux_from_ EmisOCS_Bioburn OCS 0 2 -1 2 kg/m2/s OCS_emission_flux_from_biomass_burning EmisOCS_MissingOcean OCS 0 3 -1 2 kg/m2/s OCS_emission_flux_from_missing_ocean EmisOCS_Ocean OCS 0 4 -1 2 kg/m2/s OCS_emission_flux_from_ocean - -# Tagged CO species, uncomment if needed -# -################################################################################ -###### COus sources ##### -################################################################################ -#EmisCOus_Total COus -1 -1 -1 3 kg/m2/s COus_emission_flux_from_all_sectors -#EmisCOus_Aircraft COus 0 20 -1 3 kg/m2/s COus_emission_flux_from_aircraft -#EmisCOus_Anthro COus 0 1 -1 3 kg/m2/s COus_emission_flux_from_anthropogenic -#EmisCOus_BioBurn COus 0 5 -1 2 kg/m2/s COus_emission_flux_from_biomass_burning -#EmisCOus_Ship COus 0 10 -1 2 kg/m2/s COus_emission_flux_from_ships -# -################################################################################ -###### COeur sources ##### -################################################################################ -#EmisCOeur_Total COeur -1 -1 -1 3 kg/m2/s COeur_emission_flux_from_all_sectors -#EmisCOeur_Aircraft COeur 0 20 -1 3 kg/m2/s COeur_emission_flux_from_aircraft -#EmisCOeur_Anthro COeur 0 1 -1 3 kg/m2/s COeur_emission_flux_from_anthropogenic -#EmisCOeur_BioBurn COeur 0 5 -1 2 kg/m2/s COeur_emission_flux_from_biomass_burning -#EmisCOeur_Ship COeur 0 10 -1 2 kg/m2/s COeur_emission_flux_from_ships -# -################################################################################ -###### COasia sources ##### -################################################################################ -#EmisCOasia_Total COasia -1 -1 -1 3 kg/m2/s COasia_emission_flux_from_all_sectors -#EmisCOasia_Aircraft COasia 0 20 -1 3 kg/m2/s COasia_emission_flux_from_aircraft -#EmisCOasia_Anthro COasia 0 1 -1 3 kg/m2/s COasia_emission_flux_from_anthropogenic -#EmisCOasia_BioBurn COasia 0 5 -1 2 kg/m2/s COasia_emission_flux_from_biomass_burning -#EmisCOasia_Ship COasia 0 10 -1 2 kg/m2/s COasia_emission_flux_from_ships -# -################################################################################ -###### COoth sources ##### -################################################################################ -#EmisCOoth_Total COoth -1 -1 -1 3 kg/m2/s COoth_emission_flux_from_all_sectors -#EmisCOoth_Aircraft COoth 0 20 -1 3 kg/m2/s COoth_emission_flux_from_aircraft -#EmisCOoth_Anthro COoth 0 1 -1 3 kg/m2/s COoth_emission_flux_from_anthropogenic -#EmisCOoth_BioBurn COoth 0 5 -1 2 kg/m2/s COoth_emission_flux_from_biomass_burning -#EmisCOoth_Ship COoth 0 10 -1 2 kg/m2/s COoth_emission_flux_from_ships -# -################################################################################ -###### COus sources ##### -################################################################################ -#EmisCOus_Total COus -1 -1 -1 3 kg/m2/s COus_emission_flux_from_all_sectors -#EmisCOus_Aircraft COus 0 20 -1 3 kg/m2/s COus_emission_flux_from_aircraft -#EmisCOus_Anthro COus 0 1 -1 3 kg/m2/s COus_emission_flux_from_anthropogenic -#EmisCOus_BioBurn COus 0 5 -1 2 kg/m2/s COus_emission_flux_from_biomass_burning -#EmisCOus_Ship COus 0 10 -1 2 kg/m2/s COus_emission_flux_from_ships -# -################################################################################ -###### COeur sources ##### -################################################################################ -#EmisCOeur_Total COeur -1 -1 -1 3 kg/m2/s COeur_emission_flux_from_all_sectors -#EmisCOeur_Aircraft COeur 0 20 -1 3 kg/m2/s COeur_emission_flux_from_aircraft -#EmisCOeur_Anthro COeur 0 1 -1 3 kg/m2/s COeur_emission_flux_from_anthropogenic -#EmisCOeur_BioBurn COeur 0 5 -1 2 kg/m2/s COeur_emission_flux_from_biomass_burning -#EmisCOeur_Ship COeur 0 10 -1 2 kg/m2/s COeur_emission_flux_from_ships -# -################################################################################ -###### COasia sources ##### -################################################################################ -#EmisCOasia_Total COasia -1 -1 -1 3 kg/m2/s COasia_emission_flux_from_all_sectors -#EmisCOasia_Aircraft COasia 0 20 -1 3 kg/m2/s COasia_emission_flux_from_aircraft -#EmisCOasia_Anthro COasia 0 1 -1 3 kg/m2/s COasia_emission_flux_from_anthropogenic -#EmisCOasia_BioBurn COasia 0 5 -1 2 kg/m2/s COasia_emission_flux_from_biomass_burning -#EmisCOasia_Ship COasia 0 10 -1 2 kg/m2/s COasia_emission_flux_from_ships -# -################################################################################ -###### COoth sources ##### -################################################################################ -#EmisCOoth_Total COoth -1 -1 -1 3 kg/m2/s COoth_emission_flux_from_all_sectors -#EmisCOoth_Aircraft COoth 0 20 -1 3 kg/m2/s COoth_emission_flux_from_aircraft -#EmisCOoth_Anthro COoth 0 1 -1 3 kg/m2/s COoth_emission_flux_from_anthropogenic -#EmisCOoth_BioBurn COoth 0 5 -1 2 kg/m2/s COoth_emission_flux_from_biomass_burning -#EmisCOoth_Ship COoth 0 10 -1 2 kg/m2/s COoth_emission_flux_from_ships \ No newline at end of file diff --git a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon index ee53af733..7ca5673d0 100644 --- a/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon +++ b/run/GCHP/HEMCO_Config.rc.templates/HEMCO_Config.rc.carbon @@ -37,8 +37,7 @@ Separator: / Unit tolerance: 1 Negative values: 2 Only unitless scale factors: false -Verbose: 0 -Warnings: 1 +Verbose: false Mask fractions: false ### END SECTION SETTINGS ### @@ -1578,12 +1577,15 @@ ${RUNDIR_CO2_COPROD} 2008 AFRICA_MASK $ROOT/MASKS/v2018-09/AF_LANDMASK.geos.05x0666.global.nc LANDMASK 1985/1/1/0 C xy 1 1 -20/-37/54/40 )))DICE_Africa +)))USE_CO_DATA.or.USE_CO2_DATA + +#============================================================================== +# --- Masks used for CH4, CO and CO2 simulation emissions --- +#============================================================================== (((CEDSv2.or.CEDS_GBDMAPS.or.CEDS_GBDMAPS_byFuelType 2009 CHINA_MASK $ROOT/MASKS/v2018-09/China_mask.generic.1x1.nc MASK 2000/1/1/0 C xy 1 1 70/10/150/60 )))CEDSv2.or.CEDS_GBDMAPS.or.CEDS_GBDMAPS_byFuelType -)))USE_CO_DATA.or.USE_CO2_DATA - )))EMISSIONS ### END SECTION MASKS ### diff --git a/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon b/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon index 43ed75773..42106ed06 100644 --- a/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon +++ b/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon @@ -16,9 +16,8 @@ # Name Spec ExtNr Cat Hier Dim OutUnit LongName ############################################################################### -##### CH4 sources ##### +##### CH4 sources ##### ############################################################################### - EmisCH4_Total CH4 -1 -1 -1 2 kg/m2/s CH4_emissions_from_all_sectors EmisCH4_Oil CH4 0 1 -1 2 kg/m2/s CH4_emissions_from_oil EmisCH4_Gas CH4 0 2 -1 2 kg/m2/s CH4_emissions_from_gas @@ -56,12 +55,7 @@ EmisCO2_NetTerrExch CO2 0 5 -1 2 kg/m2/s CO2_net_terrestrial_exc EmisCO2_Ship CO2 0 6 -1 2 kg/m2/s CO2_ship_emissions EmisCO2_Aviation CO2 0 7 -1 3 kg/m2/s CO2_aviation_emissions EmisCO2_CO2SurfCorr CO2 0 8 -1 2 kg/m2/s CO2_surface_correction_for_CO_oxidation - -#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 #EmisCO2_Biomass_FINN CO2 114 1 1 2 kg/m2/s CO2_biomass_burning_emissions_from_FINN ############################################################################### @@ -73,76 +67,3 @@ EmisOCS_Bioburn OCS 0 2 -1 2 kg/m2/s OCS_emission_flux_from_ EmisOCS_MissingOcean OCS 0 3 -1 2 kg/m2/s OCS_emission_flux_from_missing_ocean EmisOCS_Ocean OCS 0 4 -1 2 kg/m2/s OCS_emission_flux_from_ocean -# Tagged CO species, uncomment if needed -# -################################################################################ -###### COus sources ##### -################################################################################ -#EmisCOus_Total COus -1 -1 -1 3 kg/m2/s COus_emission_flux_from_all_sectors -#EmisCOus_Aircraft COus 0 20 -1 3 kg/m2/s COus_emission_flux_from_aircraft -#EmisCOus_Anthro COus 0 1 -1 3 kg/m2/s COus_emission_flux_from_anthropogenic -#EmisCOus_BioBurn COus 0 5 -1 2 kg/m2/s COus_emission_flux_from_biomass_burning -#EmisCOus_Ship COus 0 10 -1 2 kg/m2/s COus_emission_flux_from_ships -# -################################################################################ -###### COeur sources ##### -################################################################################ -#EmisCOeur_Total COeur -1 -1 -1 3 kg/m2/s COeur_emission_flux_from_all_sectors -#EmisCOeur_Aircraft COeur 0 20 -1 3 kg/m2/s COeur_emission_flux_from_aircraft -#EmisCOeur_Anthro COeur 0 1 -1 3 kg/m2/s COeur_emission_flux_from_anthropogenic -#EmisCOeur_BioBurn COeur 0 5 -1 2 kg/m2/s COeur_emission_flux_from_biomass_burning -#EmisCOeur_Ship COeur 0 10 -1 2 kg/m2/s COeur_emission_flux_from_ships -# -################################################################################ -###### COasia sources ##### -################################################################################ -#EmisCOasia_Total COasia -1 -1 -1 3 kg/m2/s COasia_emission_flux_from_all_sectors -#EmisCOasia_Aircraft COasia 0 20 -1 3 kg/m2/s COasia_emission_flux_from_aircraft -#EmisCOasia_Anthro COasia 0 1 -1 3 kg/m2/s COasia_emission_flux_from_anthropogenic -#EmisCOasia_BioBurn COasia 0 5 -1 2 kg/m2/s COasia_emission_flux_from_biomass_burning -#EmisCOasia_Ship COasia 0 10 -1 2 kg/m2/s COasia_emission_flux_from_ships -# -################################################################################ -###### COoth sources ##### -################################################################################ -#EmisCOoth_Total COoth -1 -1 -1 3 kg/m2/s COoth_emission_flux_from_all_sectors -#EmisCOoth_Aircraft COoth 0 20 -1 3 kg/m2/s COoth_emission_flux_from_aircraft -#EmisCOoth_Anthro COoth 0 1 -1 3 kg/m2/s COoth_emission_flux_from_anthropogenic -#EmisCOoth_BioBurn COoth 0 5 -1 2 kg/m2/s COoth_emission_flux_from_biomass_burning -#EmisCOoth_Ship COoth 0 10 -1 2 kg/m2/s COoth_emission_flux_from_ships -# -################################################################################ -###### COus sources ##### -################################################################################ -#EmisCOus_Total COus -1 -1 -1 3 kg/m2/s COus_emission_flux_from_all_sectors -#EmisCOus_Aircraft COus 0 20 -1 3 kg/m2/s COus_emission_flux_from_aircraft -#EmisCOus_Anthro COus 0 1 -1 3 kg/m2/s COus_emission_flux_from_anthropogenic -#EmisCOus_BioBurn COus 0 5 -1 2 kg/m2/s COus_emission_flux_from_biomass_burning -#EmisCOus_Ship COus 0 10 -1 2 kg/m2/s COus_emission_flux_from_ships -# -################################################################################ -###### COeur sources ##### -################################################################################ -#EmisCOeur_Total COeur -1 -1 -1 3 kg/m2/s COeur_emission_flux_from_all_sectors -#EmisCOeur_Aircraft COeur 0 20 -1 3 kg/m2/s COeur_emission_flux_from_aircraft -#EmisCOeur_Anthro COeur 0 1 -1 3 kg/m2/s COeur_emission_flux_from_anthropogenic -#EmisCOeur_BioBurn COeur 0 5 -1 2 kg/m2/s COeur_emission_flux_from_biomass_burning -#EmisCOeur_Ship COeur 0 10 -1 2 kg/m2/s COeur_emission_flux_from_ships -# -################################################################################ -###### COasia sources ##### -################################################################################ -#EmisCOasia_Total COasia -1 -1 -1 3 kg/m2/s COasia_emission_flux_from_all_sectors -#EmisCOasia_Aircraft COasia 0 20 -1 3 kg/m2/s COasia_emission_flux_from_aircraft -#EmisCOasia_Anthro COasia 0 1 -1 3 kg/m2/s COasia_emission_flux_from_anthropogenic -#EmisCOasia_BioBurn COasia 0 5 -1 2 kg/m2/s COasia_emission_flux_from_biomass_burning -#EmisCOasia_Ship COasia 0 10 -1 2 kg/m2/s COasia_emission_flux_from_ships -# -################################################################################ -###### COoth sources ##### -################################################################################ -#EmisCOoth_Total COoth -1 -1 -1 3 kg/m2/s COoth_emission_flux_from_all_sectors -#EmisCOoth_Aircraft COoth 0 20 -1 3 kg/m2/s COoth_emission_flux_from_aircraft -#EmisCOoth_Anthro COoth 0 1 -1 3 kg/m2/s COoth_emission_flux_from_anthropogenic -#EmisCOoth_BioBurn COoth 0 5 -1 2 kg/m2/s COoth_emission_flux_from_biomass_burning -#EmisCOoth_Ship COoth 0 10 -1 2 kg/m2/s COoth_emission_flux_from_ships \ No newline at end of file diff --git a/run/shared/single_carbon_species.sh b/run/shared/single_carbon_species.sh new file mode 100755 index 000000000..069351d3b --- /dev/null +++ b/run/shared/single_carbon_species.sh @@ -0,0 +1,262 @@ +#!/bin/bash + +#------------------------------------------------------------------------------ +# GEOS-Chem Global Chemical Transport Model ! +#------------------------------------------------------------------------------ +#BOP +# +# !IROUTINE: single_carbon_species.sh +# +# !DESCRIPTION: Updates carbon simulation configuration files so that +# a simulation with a single species can be performed. +# +# !CALLING SEQUENCE: +# ./single_carbon +# +# !REVISION HISTORY: +# 06 Jan 2015 - R. Yantosca - Initial version +# See the subsequent Git history with the gitk browser! +#EOP +#------------------------------------------------------------------------------ +#BOC + +# List of all advected species in the carbon simulation +ALL_SPECIES=(CO2 CO CH4 OCS) + + +function is_item_in_list() { + + #========================================================================= + # Test if an item is in a list. + # + # Arguments: + # ${1}: The item + # $(2}: Thie list + # + # Returns: + # 0 if item is in the list + # 1 if item is not in the list + # + # See stackoverflow.com/questions/8063228/check-if-a-variable-exists-in-a-list-in-bash + #========================================================================= + echo "${2}" | tr ' ' '\n' | grep -F -x -q "${1}" +} + + +function key_val_update() { + + #========================================================================= + # Runs an sed command to update a "key: value" pair in a file + # + # Arguments: + # ${1} : Key + # ${2} : Value + # $(3} : Replacement value + # $(4) : File in which the text is found + #========================================================================= + cmd="s/${1}: ${2}/${1}: ${3}/" + sed -i -e "$cmd" "${4}" +} + + +function species_to_exclude() { + + #======================================================================== + # Returns the list of species to exclude + # + # Arguments: + # ${1} : Species to keep + # + # Returns: + # List of species to exclude + #======================================================================== + + # All species + list=("${ALL_SPECIES[@]}") + + # Keep all species except for the 1st argument + for i in "${!list[@]}"; do + if [[ "x${list[i]}" == "x${1}" ]]; then + unset 'list[i]' + fi + done + + # Print the result (that's how we return strings) + result="" + for spc in "${list[@]}"; do + result+="${spc} " + done + echo $result +} + + +function update_geoschem_config() { + + #======================================================================== + # Removes advected species from geoschem_config.yml + # + # Arguments: + # ${1} : List of species to exclude + #======================================================================== + + # File to modify + file="geoschem_config.yml" + + # Remove advected species (use \< and \> for exact match in order + # to prevent inadvertently removing CO2 with when spc is CO. + for spc in ${1}; do + cmd="/\s*\-\s*\<${spc}\>/d" + sed -i -e "${cmd}" "${file}" + done + + # NOTE: CH4 options are already deactivated + # in the out-of-the-box geoschem_config.yml + +# # If CO is in the exclude list, turn off CO options +# is_item_in_list "CO2" "${1}" +# if [[ $? == 0 ]]; then +# keys=("use_fullchem_PCO_from_CH4" \ +# "use_fullchem_PCO_from_NMVOC") +# for key in ${keys[@]}; do +# key_val_update "${key}" "true" "false" "${file}" +# done +# fi + + + # If CO2 is in the exclude list, turn off CO2 options + is_item_in_list "CO2" "${1}" + if [[ $? == 0 ]]; then + keys=("fossil_fuel_emissions" \ + "ocean_exchange" \ + "balanced_biosphere_exchange" \ + "net_terrestrial_exchange" \ + "ship_emissions" \ + "aviation_emissions" \ + "3D_chemical_oxidation_source" \ + "save_fossil_fuel_in_background" \ + "tag_bio_and_ocean_CO2" \ + "tag_land_fossil_fuel_CO2" \ + "tag_global_ship_CO2" \ + "tag_global_aircraft_CO2" ) + for key in ${keys[@]}; do + key_val_update "${key}" "true" "false" "${file}" + done + fi +} + + +function update_hemco_config() { + + #======================================================================== + # Removes advected species from geoschem_config.yml + # + # Arguments: + # ${1} : List of species to exclude + #======================================================================== + + # File to be modified + file="HEMCO_Config.rc" + + # True/False values in the HEMCO extension switches section + true=" true" + false=" false" + + # If CO2 is in the exclude list, turn off CO2 options + is_item_in_list "CO2" "${1}" + if [[ $? == 0 ]]; then + key="--> USE_CO2_DATA " + key_val_update "${key}" "${true}" "${false}" "${file}" + fi + + # If CO is in the exclude list, turn off CO options + is_item_in_list "CO" "${1}" + if [[ $? == 0 ]]; then + key="--> USE_CO_DATA " + key_val_update "${key}" "${true}" "${false}" "${file}" + fi + + # If CH4 is in the exclude list, turn off CH4 options + is_item_in_list "CH4" "${1}" + if [[ $? == 0 ]]; then + key="--> USE_CH4_DATA " + key_val_update "${key}" "${true}" "${false}" "${file}" + fi + + + # If OCS is in the exclude list, turn off OCS options + is_item_in_list "OCS" "${1}" + if [[ $? == 0 ]]; then + key="--> USE_OCS_DATA " + key_val_update "${key}" "${true}" "${false}" "${file}" + fi +} + + +function update_hemco_diagn() { + + #======================================================================== + # Comments out lines for unused species in HEMCO_Diagn.rc + # + # Arguments:q + # ${1} : List of species to exclude + #======================================================================== + + # File to modify + file="HEMCO_Diagn.rc" + + # Remove entries for excluded species + exclude=("${1}") + for spc in ${exclude[@]}; do + sed -i "/Emis${spc}_/d" "${file}" + done + sed -i "/#####/d" "${file}" +} + + +function update_history() { + + #======================================================================== + # Removes entries in HISTORY.rc for unused species + # + # Arguments: + # ${1} : List of species to exclude + #======================================================================== + + # File to be modiied + file="HISTORY.rc" + + # For GCHP: remove entries for species to be excluded + for spc in ${ALL_SPECIES[@]}; do + is_item_in_list "${spc}" "${1}" + if [[ $? == 0 ]]; then + sed -i "/\_${spc}/d" "${file}" + sed -i "/Emis${spc}/d" "${file}" + fi + done +} + + +function single_carbon_species() { + + #======================================================================== + # Main function + # + # Arguments: + # ${1} : Species that you wish to retain + #======================================================================== + + # Error check arguments + if [[ "x${1}" == "x" ]]; then + echo "Need to pass the species to retain!" + exit 1 + fi + + # Get species to exclude + exclude=$(species_to_exclude "${1}") + + # Update configuration files + update_geoschem_config "${exclude}" + update_hemco_config "${exclude}" + update_hemco_diagn "${exclude}" + update_history "${exclude}" +} From fc410735d1148271f564fb2ae7dcbc47bb686422 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 14 Sep 2023 13:47:55 -0400 Subject: [PATCH 04/10] Add option to use a single advected species in the carbon simulation 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 --- CHANGELOG.md | 1 + run/GCClassic/createRunDir.sh | 51 ++++++-- run/GCHP/createRunDir.sh | 35 ++++++ ...rbon_species.sh => singleCarbonSpecies.sh} | 119 +++++++++++------- 4 files changed, 153 insertions(+), 53 deletions(-) rename run/shared/{single_carbon_species.sh => singleCarbonSpecies.sh} (72%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0940b4037..8218d5033 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Added several new run directory files for use with GEOS-Chem in GEOS - Stopped OCEAN_CONC from needlessly being pushed through vertical regridding for Hg simulations - Added warning in GCHP HISTORY.rc about outputting area-dependent variables on custom grids +- Added option to use a single advected species in the carbon simulation ### Changed - Update `DiagnFreq` in GCClassic integration tests to ensure HEMCO diagnostic output diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index d97e5d95a..a67969fde 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -43,6 +43,7 @@ cd ${srcrundir} # Source common bash functions from scripts in the run/shared folder . ${gcdir}/run/shared/setupConfigFiles.sh # Config file editing . ${gcdir}/run/shared/newUserRegistration.sh # 1st-time user registration +. ${gcdir}/run/shared/singleCarbonSpecies.sh # Single carbon species setup # Initialize run directory variables RUNDIR_VARS="" @@ -247,6 +248,33 @@ elif [[ ${sim_name} = "POPs" ]]; then printf "Invalid POPs type. Try again.\n" fi done + +# Ask user to specify carbon simulation options +elif [[ "x${sim_name}" == "xcarbon" ]]; then + printf "${thinline}Do you wish to use a single advected species?${thinline}" + printf " 1. Use all species\n" + printf " 2. Use CH4 only\n" + printf " 3. Use CO2 only\n" + printf " 4. Use CO only\n" + printf " 5. Use OCS only\n" + valid=0 + while [ "${valid}" -eq 0 ]; do + read -p "${USER_PROMPT}" prompt + valid=1 + sim_extra_option="" + if [[ "x${prompt}" == "x2" ]]; then + sim_extra_option="CH4" + elif [[ "x${prompt}" == "x3" ]]; then + sim_extra_option="CO2" + elif [[ "x${prompt}" == "x4" ]]; then + sim_extra_option="CO" + elif [[ "x${prompt}" == "x5" ]]; then + sim_extra_option="OCS" + else + valid=0 + printf "Invalid selection. Try again.\n" + fi + done fi RUNDIR_VARS+="RUNDIR_SIM_EXTRA_OPTION=$sim_extra_option\n" @@ -717,12 +745,11 @@ while [ "$valid_path" -eq 0 ]; do exit 1 fi - # Replace ~ with the user's home directory - # NOTE: This is a safe algorithm. - if [[ "${rundir_path}" =~ '~' ]]; then - rundir_path="${rundir_path/#\~/$HOME}" - echo "Expanding to: ${rundir_path}" - fi + # Expand $rundir_path to an absolute path. + # Also replace ~ with $HOME. + rundir_path="${rundir_path/#\~/$HOME}" + rundir_path=$(realpath "${rundir_path}") + echo "Expanding to ${rundir_path}" # If this is just a new directory within an existing one, # give the user the option to proceed @@ -796,6 +823,7 @@ done mkdir -p ${rundir} mkdir -p ${rundir}/Restarts +ls ${rundir}/Restarts # Define a subdirectory for rundir configuration files rundir_config=${rundir}/CreateRunDirLogs @@ -878,6 +906,7 @@ else startdate='20190701' enddate='20190801' fi + if [[ ${met} = "ModelE2.1" ]] || [[ ${met} = "ModelE2.2" ]]; then if [[ "$scenario" == "HIST" ]]; then startdate='20050701' @@ -969,6 +998,7 @@ echo -e "$RUNDIR_VARS" > ${rundir_config_log} #sort -o ${rundir_config_log} ${rundir_config_log} # Initialize run directory +# NOTE: This also copies configuration files to the run directory! ${srcrundir}/init_rd.sh ${rundir_config_log} #-------------------------------------------------------------------- @@ -1132,9 +1162,14 @@ fi # input_options.yml and modifies diagnostic output based on simulation type. if [[ "x${sim_name}" = "xfullchem" ]]; then set_common_settings "${sim_extra_option}" "GCClassic" -fi +fi -# +# If necessary, edit config files for a carbon single species simulation +if [[ "x${sim_name}" == "xcarbon" ]]; then + if [[ "x${sim_extra_option}" != "x" ]]; then + singleCarbonSpecies "${sim_extra_option}" "${rundir}" + fi +fi #-------------------------------------------------------------------- # Navigate back to source code directory diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index 6c353882c..cc29d3363 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -42,6 +42,7 @@ cd ${srcrundir} # Source common bash functions from scripts in the run/shared folder . ${gcdir}/run/shared/setupConfigFiles.sh # Config file editing . ${gcdir}/run/shared/newUserRegistration.sh # 1st-time user registration +. ${gcdir}/run/shared/singleCarbonSpecies.sh # Single carbon species setup # Initialize run directory variables RUNDIR_VARS="" @@ -204,6 +205,33 @@ if [[ ${sim_name} = "fullchem" ]]; then # Currently no transport tracer extra options elif [[ ${sim_name} = "TransportTracers" ]]; then sim_extra_option=none + +# Ask user to specify carbon simulation options +elif [[ "x${sim_name}" == "xcarbon" ]]; then + printf "${thinline}Do you wish to use a single advected species?${thinline}" + printf " 1. Use all species\n" + printf " 2. Use CH4 only\n" + printf " 3. Use CO2 only\n" + printf " 4. Use CO only\n" + printf " 5. Use OCS only\n" + valid=0 + while [ "${valid}" -eq 0 ]; do + read -p "${USER_PROMPT}" prompt + valid=1 + sim_extra_option="" + if [[ "x${prompt}" == "x2" ]]; then + sim_extra_option="CH4" + elif [[ "x${prompt}" == "x3" ]]; then + sim_extra_option="CO2" + elif [[ "x${prompt}" == "x4" ]]; then + sim_extra_option="CO" + elif [[ "x${prompt}" == "x5" ]]; then + sim_extra_option="OCS" + else + valid=0 + printf "Invalid selection. Try again.\n" + fi + done fi RUNDIR_VARS+="RUNDIR_SIM_EXTRA_OPTION=$sim_extra_option\n" @@ -562,6 +590,13 @@ if [[ "x${sim_name}" = "xfullchem" ]]; then set_common_settings "${sim_extra_option}" "GCHP" fi +# If necessary, edit config files for a carbon single species simulation +if [[ "x${sim_name}" == "xcarbon" ]]; then + if [[ "x${sim_extra_option}" != "x" ]]; then + singleCarbonSpecies "${sim_extra_option}" "${rundir}" + fi +fi + # Call setCommonRunSettings.sh so that all config files are consistent with its # default settings. Suppress informational prints. chmod +x setCommonRunSettings.sh diff --git a/run/shared/single_carbon_species.sh b/run/shared/singleCarbonSpecies.sh similarity index 72% rename from run/shared/single_carbon_species.sh rename to run/shared/singleCarbonSpecies.sh index 069351d3b..c7cf5abd8 100755 --- a/run/shared/single_carbon_species.sh +++ b/run/shared/singleCarbonSpecies.sh @@ -24,16 +24,16 @@ ALL_SPECIES=(CO2 CO CH4 OCS) -function is_item_in_list() { +function isItemInList() { #========================================================================= # Test if an item is in a list. # # Arguments: # ${1}: The item - # $(2}: Thie list + # ${2}: Thie list # - # Returns: + # Returns (via $?) # 0 if item is in the list # 1 if item is not in the list # @@ -43,7 +43,7 @@ function is_item_in_list() { } -function key_val_update() { +function keyValueUpdate() { #========================================================================= # Runs an sed command to update a "key: value" pair in a file @@ -51,21 +51,21 @@ function key_val_update() { # Arguments: # ${1} : Key # ${2} : Value - # $(3} : Replacement value - # $(4) : File in which the text is found + # ${3} : Replacement value + # ${4) : File in which the text is found #========================================================================= cmd="s/${1}: ${2}/${1}: ${3}/" sed -i -e "$cmd" "${4}" } -function species_to_exclude() { +function speciesToExclude() { #======================================================================== # Returns the list of species to exclude # # Arguments: - # ${1} : Species to keep + # ${1} : Species to retain # # Returns: # List of species to exclude @@ -73,7 +73,7 @@ function species_to_exclude() { # All species list=("${ALL_SPECIES[@]}") - + # Keep all species except for the 1st argument for i in "${!list[@]}"; do if [[ "x${list[i]}" == "x${1}" ]]; then @@ -90,17 +90,18 @@ function species_to_exclude() { } -function update_geoschem_config() { +function updateGeosChemConfig() { #======================================================================== # Removes advected species from geoschem_config.yml # # Arguments: # ${1} : List of species to exclude + # ${2} : Path to the run directory #======================================================================== # File to modify - file="geoschem_config.yml" + file="${2}/geoschem_config.yml" # Remove advected species (use \< and \> for exact match in order # to prevent inadvertently removing CO2 with when spc is CO. @@ -108,23 +109,23 @@ function update_geoschem_config() { cmd="/\s*\-\s*\<${spc}\>/d" sed -i -e "${cmd}" "${file}" done - + # NOTE: CH4 options are already deactivated # in the out-of-the-box geoschem_config.yml # # If CO is in the exclude list, turn off CO options -# is_item_in_list "CO2" "${1}" -# if [[ $? == 0 ]]; then +# isItemInList "CO2" "${1}" +# if [[ $? == 0 ]]; then # keys=("use_fullchem_PCO_from_CH4" \ # "use_fullchem_PCO_from_NMVOC") # for key in ${keys[@]}; do -# key_val_update "${key}" "true" "false" "${file}" +# keyValueUpdate "${key}" "true" "false" "${file}" # done # fi # If CO2 is in the exclude list, turn off CO2 options - is_item_in_list "CO2" "${1}" + isItemInList "CO2" "${1}" if [[ $? == 0 ]]; then keys=("fossil_fuel_emissions" \ "ocean_exchange" \ @@ -139,95 +140,98 @@ function update_geoschem_config() { "tag_global_ship_CO2" \ "tag_global_aircraft_CO2" ) for key in ${keys[@]}; do - key_val_update "${key}" "true" "false" "${file}" + keyValueUpdate "${key}" "true" "false" "${file}" done fi } -function update_hemco_config() { +function updateHemcoConfig() { #======================================================================== # Removes advected species from geoschem_config.yml # # Arguments: # ${1} : List of species to exclude + # ${2} : Path to the run directory #======================================================================== # File to be modified - file="HEMCO_Config.rc" + file="${2}/HEMCO_Config.rc" # True/False values in the HEMCO extension switches section true=" true" false=" false" # If CO2 is in the exclude list, turn off CO2 options - is_item_in_list "CO2" "${1}" + isItemInList "CO2" "${1}" if [[ $? == 0 ]]; then key="--> USE_CO2_DATA " - key_val_update "${key}" "${true}" "${false}" "${file}" + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi # If CO is in the exclude list, turn off CO options - is_item_in_list "CO" "${1}" + isItemInList "CO" "${1}" if [[ $? == 0 ]]; then key="--> USE_CO_DATA " - key_val_update "${key}" "${true}" "${false}" "${file}" + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi - + # If CH4 is in the exclude list, turn off CH4 options - is_item_in_list "CH4" "${1}" + isItemInList "CH4" "${1}" if [[ $? == 0 ]]; then key="--> USE_CH4_DATA " - key_val_update "${key}" "${true}" "${false}" "${file}" - fi + keyValueUpdate "${key}" "${true}" "${false}" "${file}" + fi # If OCS is in the exclude list, turn off OCS options - is_item_in_list "OCS" "${1}" + isItemInList "OCS" "${1}" if [[ $? == 0 ]]; then key="--> USE_OCS_DATA " - key_val_update "${key}" "${true}" "${false}" "${file}" + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi } -function update_hemco_diagn() { +function updateHemcoDiagn() { #======================================================================== # Comments out lines for unused species in HEMCO_Diagn.rc # - # Arguments:q + # Arguments: # ${1} : List of species to exclude + # ${2} : Path to the run directory #======================================================================== # File to modify - file="HEMCO_Diagn.rc" + file="${2}/HEMCO_Diagn.rc" # Remove entries for excluded species exclude=("${1}") for spc in ${exclude[@]}; do sed -i "/Emis${spc}_/d" "${file}" done - sed -i "/#####/d" "${file}" + sed -i "/#####/d" "${file}" } -function update_history() { +function updateHistory() { #======================================================================== # Removes entries in HISTORY.rc for unused species # # Arguments: # ${1} : List of species to exclude + # ${2} : Path to the run directory #======================================================================== - # File to be modiied - file="HISTORY.rc" - + # File to be modified + file="${2}/HISTORY.rc" + # For GCHP: remove entries for species to be excluded for spc in ${ALL_SPECIES[@]}; do - is_item_in_list "${spc}" "${1}" + isItemInList "${spc}" "${1}" if [[ $? == 0 ]]; then sed -i "/\_${spc}/d" "${file}" sed -i "/Emis${spc}/d" "${file}" @@ -236,13 +240,30 @@ function update_history() { } -function single_carbon_species() { +function updateExtData() { + + #======================================================================== + # Removes entries in ExtData.rc for unused species (GCHP only) + # + # Arguments: + # ${1} : List of species to exclude + # ${2} : Path to the run directory + #======================================================================== + + # Skip if there is no ExtData.rc file + [[ ! -f "${2}/ExtData.rc" ]] && return 0 + +} + + +function singleCarbonSpecies() { #======================================================================== # Main function # # Arguments: - # ${1} : Species that you wish to retain + # ${1} : Species that you wish to retain + # ${2} : Path to the run directory #======================================================================== # Error check arguments @@ -251,12 +272,20 @@ function single_carbon_species() { exit 1 fi + # Path to the run directory + if [[ "x${2}" == "x" ]]; then + rundir="." + else + rundir="${2}" + fi + # Get species to exclude - exclude=$(species_to_exclude "${1}") + exclude=$(speciesToExclude "${1}") # Update configuration files - update_geoschem_config "${exclude}" - update_hemco_config "${exclude}" - update_hemco_diagn "${exclude}" - update_history "${exclude}" + updateGeosChemConfig "${exclude}" "${rundir}" + updateHemcoConfig "${exclude}" "${rundir}" + updateHemcoDiagn "${exclude}" "${rundir}" + updateHistory "${exclude}" "${rundir}" + updateExtData "${exclude}" "${rundir}" } From 90a9381f6672ba0cfdfdd72560064e9715d40237 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 14 Sep 2023 15:50:21 -0400 Subject: [PATCH 05/10] singleCarbonSpecies.sh now edits ExtData.rc for single-species sims 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 --- run/shared/singleCarbonSpecies.sh | 115 +++++++++++++++++++++++------- 1 file changed, 89 insertions(+), 26 deletions(-) diff --git a/run/shared/singleCarbonSpecies.sh b/run/shared/singleCarbonSpecies.sh index c7cf5abd8..c3918fe4b 100755 --- a/run/shared/singleCarbonSpecies.sh +++ b/run/shared/singleCarbonSpecies.sh @@ -5,16 +5,16 @@ #------------------------------------------------------------------------------ #BOP # -# !IROUTINE: single_carbon_species.sh +# !IROUTINE: singleCarbonSpecies.sh # # !DESCRIPTION: Updates carbon simulation configuration files so that # a simulation with a single species can be performed. # # !CALLING SEQUENCE: -# ./single_carbon +# ./singleCarbonSpecies.sh # # !REVISION HISTORY: -# 06 Jan 2015 - R. Yantosca - Initial version +# 14 Sep 2023 - R. Yantosca - Initial version # See the subsequent Git history with the gitk browser! #EOP #------------------------------------------------------------------------------ @@ -106,7 +106,7 @@ function updateGeosChemConfig() { # Remove advected species (use \< and \> for exact match in order # to prevent inadvertently removing CO2 with when spc is CO. for spc in ${1}; do - cmd="/\s*\-\s*\<${spc}\>/d" + cmd="/\s*\-\s*\<${spc}\>/d" sed -i -e "${cmd}" "${file}" done @@ -164,32 +164,32 @@ function updateHemcoConfig() { false=" false" # If CO2 is in the exclude list, turn off CO2 options + # NOTE: This must precede CO to avoid unintended deletions isItemInList "CO2" "${1}" if [[ $? == 0 ]]; then - key="--> USE_CO2_DATA " - keyValueUpdate "${key}" "${true}" "${false}" "${file}" + key="--> USE_CO2_DATA " + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi # If CO is in the exclude list, turn off CO options isItemInList "CO" "${1}" if [[ $? == 0 ]]; then key="--> USE_CO_DATA " - keyValueUpdate "${key}" "${true}" "${false}" "${file}" + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi # If CH4 is in the exclude list, turn off CH4 options isItemInList "CH4" "${1}" if [[ $? == 0 ]]; then - key="--> USE_CH4_DATA " - keyValueUpdate "${key}" "${true}" "${false}" "${file}" + key="--> USE_CH4_DATA " + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi - # If OCS is in the exclude list, turn off OCS options isItemInList "OCS" "${1}" if [[ $? == 0 ]]; then key="--> USE_OCS_DATA " - keyValueUpdate "${key}" "${true}" "${false}" "${file}" + keyValueUpdate "${key}" "${true}" "${false}" "${file}" fi } @@ -210,7 +210,7 @@ function updateHemcoDiagn() { # Remove entries for excluded species exclude=("${1}") for spc in ${exclude[@]}; do - sed -i "/Emis${spc}_/d" "${file}" + sed -i "/Emis${spc}_/d" "${file}" done sed -i "/#####/d" "${file}" } @@ -231,17 +231,17 @@ function updateHistory() { # For GCHP: remove entries for species to be excluded for spc in ${ALL_SPECIES[@]}; do - isItemInList "${spc}" "${1}" - if [[ $? == 0 ]]; then - sed -i "/\_${spc}/d" "${file}" - sed -i "/Emis${spc}/d" "${file}" - fi + isItemInList "${spc}" "${1}" + if [[ $? == 0 ]]; then + sed -i "/\_${spc}/d" "${file}" + sed -i "/Emis${spc}/d" "${file}" + fi done } function updateExtData() { - + #======================================================================== # Removes entries in ExtData.rc for unused species (GCHP only) # @@ -250,9 +250,72 @@ function updateExtData() { # ${2} : Path to the run directory #======================================================================== - # Skip if there is no ExtData.rc file - [[ ! -f "${2}/ExtData.rc" ]] && return 0 - + # File to be modified + file="${2}/ExtData.rc" + + # Skip if there is no ExtData.rc file (e.g. for GCClassic) + [[ ! -f "${file}" ]] && return 0 + + # If CH4 is in the exclude list, remove CH4 entries. + isItemInList "CH4" "${1}" + if [[ $? == 0 ]]; then + sed -i "/^GHGI_/d" "${file}" + sed -i "/^MEX_/d" "${file}" + sed -i "/^CAN_/d" "${file}" + sed -i "/^GFEI_/d" "${file}" + sed -i "/^EDGAR7_CH4_/d" "${file}" + sed -i "/^CAN_/d" "${file}" + sed -i "/^UPDATED_GFED4_CH4/d" "${file}" + sed -i "/^JPLW_CH4/d" "${file}" + sed -i "/^CH4_/d" "${file}" + sed -i "/^\#CH4_/d" "${file}" + sed -i "/CMIP6_CH4_/d" "${file}" + sed -i "/CMIP6_BB_CH4/d" "${file}" + sed -i "/RCP3PD_CH4/d" "${file}" + sed -i "/RCP45_CH4/d" "${file}" + sed -i "/RCP60_CH4/d" "${file}" + sed -i "/RCP85_CH4/d" "${file}" + fi + + # If CO2 is in the exclude list, remove CO2 entries. + # NOTE: CO2 deletions must prececde CO deletions. + isItemInList "CO2" "${1}" + if [[ $? == 0 ]]; then + sed -i "/AEIC19_DAILY_CO2 /d" "${file}" # trailing space required + sed -i "/AEIC19_MONMEAN_CO2 /d" "${file}" # trailing space required + sed -i "/BBIOCO2_/d" "${file}" + sed -i "/^CEDS_CO2_/d" "${file}" + sed -i "/^CO2_/d" "${file}" + sed -i "/COPROD/d" "${file}" + sed -i "/FOSSILCO2_/d" "${file}" + sed -i "/ICOADS_CO2_/d" "${file}" + sed -i "/OCEANCO2_/d" "${file}" + sed -i "/SIB_BBIO_CO2/d" "${file}" + fi + + # If CO is in the exclude list, remove CO entries + isItemInList "CO" "${1}" + if [[ $? == 0 ]]; then + sed -i "/AEIC19_DAILY_CO /d" "${file}" # trailing space required + sed -i "/AEIC19_MONMEAN_CO /d" "${file}" # trailing space required + sed -i "/APEI_CO/d" "${file}" + sed -i "/^CEDS_CO/d" "${file}" + sed -i "/CMIP6_CO/d" "${file}" + sed -i "/\#DICE_/d" "${file}" + sed -i "/EDGAR_CO/d" "${file}" + sed -i "/EPA16_CO_/d" "${file}" + sed -i "/HTAP_CO_/d" "${file}" + sed -i "/RCP3PD_CO/d" "${file}" + sed -i "/RCP45_CO/d" "${file}" + sed -i "/RCP60_CO/d" "${file}" + sed -i "/RCP85_CO/d" "${file}" + fi + + # If OSC is in the exclude list, remove OCS entries + isItemInList "OCS" "${1}" + if [[ $? == 0 ]]; then + sed -i "/^OCS_/d" "${file}" + fi } @@ -263,7 +326,7 @@ function singleCarbonSpecies() { # # Arguments: # ${1} : Species that you wish to retain - # ${2} : Path to the run directory + # ${2} : Path to the run directory #======================================================================== # Error check arguments @@ -274,14 +337,14 @@ function singleCarbonSpecies() { # Path to the run directory if [[ "x${2}" == "x" ]]; then - rundir="." + rundir="." else - rundir="${2}" + rundir="${2}" fi - + # Get species to exclude exclude=$(speciesToExclude "${1}") - + # Update configuration files updateGeosChemConfig "${exclude}" "${rundir}" updateHemcoConfig "${exclude}" "${rundir}" From f03d7b9edce4cda58108872e9cec0247f0e90019 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 14 Sep 2023 16:39:19 -0400 Subject: [PATCH 06/10] Bug fix: Prevent infinite loop in createRunDir.sh for carbon 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 --- run/GCClassic/createRunDir.sh | 7 ++++--- run/GCHP/createRunDir.sh | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index a67969fde..90109a148 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -261,8 +261,9 @@ elif [[ "x${sim_name}" == "xcarbon" ]]; then while [ "${valid}" -eq 0 ]; do read -p "${USER_PROMPT}" prompt valid=1 - sim_extra_option="" - if [[ "x${prompt}" == "x2" ]]; then + if [[ "x${prompt}" == "x1" ]]; then + sim_extra_option="none" + elif [[ "x${prompt}" == "x2" ]]; then sim_extra_option="CH4" elif [[ "x${prompt}" == "x3" ]]; then sim_extra_option="CO2" @@ -1166,7 +1167,7 @@ fi # If necessary, edit config files for a carbon single species simulation if [[ "x${sim_name}" == "xcarbon" ]]; then - if [[ "x${sim_extra_option}" != "x" ]]; then + if [[ "x${sim_extra_option}" != "xnone" ]]; then singleCarbonSpecies "${sim_extra_option}" "${rundir}" fi fi diff --git a/run/GCHP/createRunDir.sh b/run/GCHP/createRunDir.sh index cc29d3363..985df82df 100755 --- a/run/GCHP/createRunDir.sh +++ b/run/GCHP/createRunDir.sh @@ -218,8 +218,9 @@ elif [[ "x${sim_name}" == "xcarbon" ]]; then while [ "${valid}" -eq 0 ]; do read -p "${USER_PROMPT}" prompt valid=1 - sim_extra_option="" - if [[ "x${prompt}" == "x2" ]]; then + if [[ "x${prompt}" == "x1" ]]; then + sim_extra_option="none" + elif [[ "x${prompt}" == "x2" ]]; then sim_extra_option="CH4" elif [[ "x${prompt}" == "x3" ]]; then sim_extra_option="CO2" @@ -592,7 +593,7 @@ fi # If necessary, edit config files for a carbon single species simulation if [[ "x${sim_name}" == "xcarbon" ]]; then - if [[ "x${sim_extra_option}" != "x" ]]; then + if [[ "x${sim_extra_option}" != "xnone" ]]; then singleCarbonSpecies "${sim_extra_option}" "${rundir}" fi fi From 24a6b77ef99d6df96ad9f299a2d3d463e299ed47 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Thu, 14 Sep 2023 16:52:44 -0400 Subject: [PATCH 07/10] Update int test scripts for single-species carbon simulation 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 --- test/integration/GCClassic/integrationTestCreate.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/integration/GCClassic/integrationTestCreate.sh b/test/integration/GCClassic/integrationTestCreate.sh index b8df7e701..f630dbc6c 100755 --- a/test/integration/GCClassic/integrationTestCreate.sh +++ b/test/integration/GCClassic/integrationTestCreate.sh @@ -166,7 +166,11 @@ create_rundir "4\n1\n1\n1\n${rundirsDir}\n\nn\n" "${log}" create_rundir "2\n1\n1\n1\n${rundirsDir}\n\nn\n" "${log}" # 4x5 merra2 carbon -create_rundir "12\n1\n1\n1\n${rundirsDir}\n\nn\n" "${log}" +create_rundir "12\n1\n1\n1\n1\n${rundirsDir}\n\nn\n" "${log}" + +# 4x5 merra2 carbon CH4 only +dir="gc_4x5_merra2_carbon_CH4only" +create_rundir "12\n2\n1\n1\n1\n${rundirsDir}\n${dir}\nn\n" "${log}" # 4x5 merra2 fullchem create_rundir "1\n1\n1\n1\n1\n${rundirsDir}\n\nn\n" "${log}" From 5036a8a210970869b5343b5a8b8bd5de06dff362 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 19 Sep 2023 10:00:13 -0400 Subject: [PATCH 08/10] Change Emis*_Bioburn to Emis*_BiomassBurn in carbon config files 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 --- .../HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon | 5 ++--- run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon | 7 +++---- run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon b/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon index c67a7d677..47504a22c 100644 --- a/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon +++ b/run/GCClassic/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon @@ -41,7 +41,7 @@ EmisCH4_Reservoirs CH4 0 15 -1 2 kg/m2/s CH4_emissions_from_hydr EmisCO_Total CO -1 -1 -1 3 kg/m2/s CO_emission_flux_from_all_sectors EmisCO_Aircraft CO 0 20 -1 3 kg/m2/s CO_emission_flux_from_aircraft EmisCO_Anthro CO 0 1 -1 3 kg/m2/s CO_emission_flux_from_anthropogenic -EmisCO_BioBurn CO 0 5 -1 2 kg/m2/s CO_emission_flux_from_biomass_burning +EmisCO_BiomassBurn CO 111 -1 -1 2 kg/m2/s CO_emission_flux_from_biomass_burning EmisCO_Ship CO 0 10 -1 2 kg/m2/s CO_emission_flux_from_ships ############################################################################### @@ -55,8 +55,7 @@ EmisCO2_NetTerrExch CO2 0 5 -1 2 kg/m2/s CO2_net_terrestrial_exc EmisCO2_Ship CO2 0 6 -1 2 kg/m2/s CO2_ship_emissions EmisCO2_Aviation CO2 0 7 -1 3 kg/m2/s CO2_aviation_emissions EmisCO2_CO2SurfCorr CO2 0 8 -1 2 kg/m2/s CO2_surface_correction_for_CO_oxidation -EmisCO2_Biomass_GFED CO2 111 1 1 2 kg/m2/s CO2_biomass_burning_emissions_from_GFED4 -#EmisCO2_Biomass_FINN CO2 114 1 1 2 kg/m2/s CO2_biomass_burning_emissions_from_FINN +EmisCO2_BiomassBurn CO2 111 -1 -1 2 kg/m2/s CO2_biomass_burning_emissions_from_GFED4 ############################################################################### ##### OCS sources ##### diff --git a/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon b/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon index 42106ed06..73c1d3129 100644 --- a/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon +++ b/run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.carbon @@ -27,7 +27,7 @@ EmisCH4_Landfills CH4 0 5 -1 2 kg/m2/s CH4_emissions_from_land EmisCH4_Wastewater CH4 0 6 -1 2 kg/m2/s CH4_emissions_from_wastewater EmisCH4_Rice CH4 0 7 -1 2 kg/m2/s CH4_emissions_from_rice EmisCH4_OtherAnth CH4 0 8 -1 2 kg/m2/s CH4_emissions_from_other_anthropogenic_sources -EmisCH4_BiomassBurn CH4 0 9 -1 2 kg/m2/s CH4_emissions_from_biomass_burning +EmisCH4_BiomassBurn CH4 111 -1 -1 2 kg/m2/s CH4_emissions_from_biomass_burning EmisCH4_Wetlands CH4 0 10 -1 2 kg/m2/s CH4_emissions_from_wetlands EmisCH4_Seeps CH4 0 11 -1 2 kg/m2/s CH4_emissions_from_geological_seeps EmisCH4_Lakes CH4 0 12 -1 2 kg/m2/s CH4_emissions_from_lakes @@ -41,7 +41,7 @@ EmisCH4_Reservoirs CH4 0 15 -1 2 kg/m2/s CH4_emissions_from_hydr EmisCO_Total CO -1 -1 -1 3 kg/m2/s CO_emission_flux_from_all_sectors EmisCO_Aircraft CO 0 20 -1 3 kg/m2/s CO_emission_flux_from_aircraft EmisCO_Anthro CO 0 1 -1 3 kg/m2/s CO_emission_flux_from_anthropogenic -EmisCO_BioBurn CO 0 5 -1 2 kg/m2/s CO_emission_flux_from_biomass_burning +EmisCO_BiomassBurn CO 111 -1 -1 2 kg/m2/s CO_emission_flux_from_biomass_burning EmisCO_Ship CO 0 10 -1 2 kg/m2/s CO_emission_flux_from_ships ############################################################################### @@ -55,8 +55,7 @@ EmisCO2_NetTerrExch CO2 0 5 -1 2 kg/m2/s CO2_net_terrestrial_exc EmisCO2_Ship CO2 0 6 -1 2 kg/m2/s CO2_ship_emissions EmisCO2_Aviation CO2 0 7 -1 3 kg/m2/s CO2_aviation_emissions EmisCO2_CO2SurfCorr CO2 0 8 -1 2 kg/m2/s CO2_surface_correction_for_CO_oxidation -EmisCO2_Biomass_GFED CO2 111 1 1 2 kg/m2/s CO2_biomass_burning_emissions_from_GFED4 -#EmisCO2_Biomass_FINN CO2 114 1 1 2 kg/m2/s CO2_biomass_burning_emissions_from_FINN +EmisCO2_BiomassBurn CO2 111 -1 -1 2 kg/m2/s CO2_biomass_burning_emissions_from_GFED4 ############################################################################### ##### OCS sources ##### diff --git a/run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon b/run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon index fa74116d8..690b02fea 100644 --- a/run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon +++ b/run/GCHP/HISTORY.rc.templates/HISTORY.rc.carbon @@ -130,7 +130,7 @@ COLLECTIONS: 'Emissions', 'EmisCO_Total ', 'GCHPchem', 'EmisCO_Aircraft ', 'GCHPchem', 'EmisCO_Anthro ', 'GCHPchem', - 'EmisCO_BioBurn ', 'GCHPchem', + 'EmisCO_BiomassBurn ', 'GCHPchem', 'EmisCO_Ship ', 'GCHPchem', 'EmisCO2_Total ', 'GCHPchem', 'EmisCO2_FossilFuel ', 'GCHPchem', @@ -140,7 +140,7 @@ COLLECTIONS: 'Emissions', 'EmisCO2_Ship ', 'GCHPchem', 'EmisCO2_Aviation ', 'GCHPchem', 'EmisCO2_CO2SurfCorr ', 'GCHPchem', - #'EmisCO2_Biomass_GFED ', 'GCHPchem', + 'EmisCO2_BiomassBurn ', 'GCHPchem', :: #============================================================================== # Budget defined as species kg/s in the column (full, troposphere, or PBL) From 610d00ba89baac5d822b779469c58615ab3d7bb8 Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 19 Sep 2023 10:05:58 -0400 Subject: [PATCH 09/10] Clean up run directory scripts for carbon simulation run/GCClassic/createRunDir.sh - Removed leftover ls command from debugging run/GCClassic/singleCarbonSpecies.sh - Removed commented-out code Signed-off-by: Bob Yantosca --- run/GCClassic/createRunDir.sh | 1 - run/shared/singleCarbonSpecies.sh | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/run/GCClassic/createRunDir.sh b/run/GCClassic/createRunDir.sh index 90109a148..751f2c3e0 100755 --- a/run/GCClassic/createRunDir.sh +++ b/run/GCClassic/createRunDir.sh @@ -824,7 +824,6 @@ done mkdir -p ${rundir} mkdir -p ${rundir}/Restarts -ls ${rundir}/Restarts # Define a subdirectory for rundir configuration files rundir_config=${rundir}/CreateRunDirLogs diff --git a/run/shared/singleCarbonSpecies.sh b/run/shared/singleCarbonSpecies.sh index c3918fe4b..775a11574 100755 --- a/run/shared/singleCarbonSpecies.sh +++ b/run/shared/singleCarbonSpecies.sh @@ -113,17 +113,6 @@ function updateGeosChemConfig() { # NOTE: CH4 options are already deactivated # in the out-of-the-box geoschem_config.yml -# # If CO is in the exclude list, turn off CO options -# isItemInList "CO2" "${1}" -# if [[ $? == 0 ]]; then -# keys=("use_fullchem_PCO_from_CH4" \ -# "use_fullchem_PCO_from_NMVOC") -# for key in ${keys[@]}; do -# keyValueUpdate "${key}" "true" "false" "${file}" -# done -# fi - - # If CO2 is in the exclude list, turn off CO2 options isItemInList "CO2" "${1}" if [[ $? == 0 ]]; then From c27337460fdf6e8ad7042a5d537e67da3fc5e97b Mon Sep 17 00:00:00 2001 From: Bob Yantosca Date: Tue, 19 Sep 2023 10:12:01 -0400 Subject: [PATCH 10/10] Removed leftover text from a Git merge from CHANGELOG.md CHANGELOG.md - Removed the >>>>>>> line that was left over at line 137 Signed-off-by: Bob Yantosca --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8218d5033..591ffb5d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -134,7 +134,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Fixed entries for CH4 emissions in `HEMCO_Config.rc.carbon` ## [14.1.1] - 2023-03-03 ->>>>>>> 4722f288e90291ba904222f4bbe4fc216d17c34a ### Added - New integration test functions in `test/GCClassic/integration` and `test/GCHP/integration` - New parallelization test functions in `test/GCClassic/parallel`