From 11522b8e8e12661d9d956e27ae4759ff86a35446 Mon Sep 17 00:00:00 2001 From: Christoph Keller Date: Wed, 18 Oct 2023 12:11:45 -0400 Subject: [PATCH 1/2] Minor updates to make sure that GEOSCHEMchem can serve as the OX and RATS provider (cherry picked from commit dcd5eb1cc9876bbb3a55b34f9db89ef62cd67264) --- .../GEOSCHEMchem_Registry.rc | 14 ++++++------ GEOS_ChemGridComp.F90 | 22 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/GEOSCHEMchem_GridComp/GEOSCHEMchem_Registry.rc b/GEOSCHEMchem_GridComp/GEOSCHEMchem_Registry.rc index a29b7d6c..8b367507 100644 --- a/GEOSCHEMchem_GridComp/GEOSCHEMchem_Registry.rc +++ b/GEOSCHEMchem_GridComp/GEOSCHEMchem_Registry.rc @@ -181,7 +181,7 @@ #====================== # O3PPMV | ppmv | xyz | C | | | | | ozone_volume_mixing_ratio_in_ppm # OX_TEND | kg kg-1 s-1 | xyz | C | | | | | tendency_of_odd_oxygen_mixing_ratio_due_to_chemistry - H2O_TEND | kg kg-1 s-1 | xyz | C | | | | | Tendency_of_water_vapor_mixing_ratio_due_to_chemistry +# H2O_TEND | kg kg-1 s-1 | xyz | C | | | | | Tendency_of_water_vapor_mixing_ratio_due_to_chemistry #=========== # GCHP only: #=========== @@ -250,12 +250,12 @@ SO2AfterChem | vv-1 | xyz | C | | | | | | | | S | soluble_fraction_SO2 KPPHvalue | 1 | xyz | C | | | | | | | | S | HSAVE_for_KPP SESQ_CARBDENS | kgCm-3 | xyz | C | | | | | | | | S | sesquiterpene_conc_restart - Iso_Hplus_coarse | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_H+_concentration_coarse - Iso_Hplus_fine | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_H+_concentration_fine - Iso_sulfate | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_sulfate_concentratio - Iso_nitrate_coarse | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_Na+_concentration_coarse - Iso_nitrate_fine | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_Na+_concentration_fine - Iso_bisulfate | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_bisulfate_concentration +# Iso_Hplus_coarse | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_H+_concentration_coarse +# Iso_Hplus_fine | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_H+_concentration_fine +# Iso_sulfate | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_sulfate_concentratio +# Iso_nitrate_coarse | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_Na+_concentration_coarse +# Iso_nitrate_fine | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_Na+_concentration_fine +# Iso_bisulfate | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_bisulfate_concentration ### the following are not needed # Iso_acidpur | molL-1 | xyz | C | | | | |0.0 | | | S | Isorropia_acid # Iso_pH | 1 | xyz | C | | | | |0.0 | | | S | Isorropia_aerosol_pH diff --git a/GEOS_ChemGridComp.F90 b/GEOS_ChemGridComp.F90 index 010641df..ae1d6934 100644 --- a/GEOS_ChemGridComp.F90 +++ b/GEOS_ChemGridComp.F90 @@ -555,21 +555,21 @@ subroutine SetServices ( GC, RC ) ! Ozone mole fraction needed by GOCART for ! CFC-12 photolysis. For GMICHEM case, see below. ! ------------------------------------------------ - IF(myState%enable_GOCART .AND. myState%enable_PCHEM) then + IF(myState%enable_GOCART .AND. myState%enable_PCHEM .AND. RATsProviderNumber(1)==PCHEM ) THEN CALL MAPL_AddConnectivity ( GC, & SRC_NAME = (/"OX"/), & DST_NAME = (/"O3"/), & DST_ID = GOCART, SRC_ID = PCHEM, __RC__ ) ENDIF - IF(myState%enable_GOCART .AND. myState%enable_STRATCHEM) then + IF(myState%enable_GOCART .AND. myState%enable_STRATCHEM .AND. RATsProviderNumber(1)==STRATCHEM ) then CALL MAPL_AddConnectivity ( GC, & SRC_NAME = (/"O3CHEM"/), & DST_NAME = (/"O3"/), & DST_ID = GOCART, SRC_ID = STRATCHEM, __RC__ ) ENDIF - IF(myState%enable_ACHEM .AND. myState%enable_PCHEM) then + IF(myState%enable_ACHEM .AND. myState%enable_PCHEM .AND. RATsProviderNumber(1)==ACHEM ) then CALL MAPL_AddConnectivity ( GC, & SRC_NAME = (/"O3"/), & DST_NAME = (/"O3"/), & @@ -732,10 +732,12 @@ subroutine SetServices ( GC, RC ) ! ... For GOCART::CFC ! ------------------- + IF( RATsProviderNumber(1)==GMICHEM ) then CALL MAPL_AddConnectivity ( GC, & SRC_NAME = (/"OX"/), & DST_NAME = (/"O3"/), & DST_ID=GOCART, SRC_ID=GMICHEM, __RC__) + END IF END IF @@ -781,14 +783,12 @@ subroutine SetServices ( GC, RC ) END IF ! GOCART needs ozone for CFC12 photolysis. - ! Only provide it from GEOS-Chem if PCHEM is not running. - IF(myState%enable_GOCART .AND. myState%enable_GEOSCHEM) then - IF ( .NOT. myState%enable_PCHEM ) THEN - CALL MAPL_AddConnectivity ( GC, & - SRC_NAME = (/"TRC_O3"/), & - DST_NAME = (/"O3"/), & - DST_ID=GOCART, SRC_ID=GEOSCHEM, __RC__ ) - ENDIF + ! Provide from GEOS-Chem if it is the OX provider + IF(myState%enable_GOCART .AND. myState%enable_GEOSCHEM .AND. RATsProviderNumber(1)==GEOSCHEM ) then + CALL MAPL_AddConnectivity ( GC, & + SRC_NAME = (/"OX"/), & + DST_NAME = (/"O3"/), & + DST_ID=GOCART, SRC_ID=GEOSCHEM, __RC__ ) ENDIF ! GEOS-Chem import of CO2 From a558d09c12184aba852df21b9a5a7be7345ecc79 Mon Sep 17 00:00:00 2001 From: Christoph Keller Date: Tue, 5 Dec 2023 15:44:17 -0500 Subject: [PATCH 2/2] Add verbose option to Chem_Group to stop printing excessive CL/N LOOP COUNT statements (cherry picked from commit 707b7b5e14e080ae262de39de408ea4bf9de9a01) --- Shared/Chem_Shared/Chem_GroupMod.F90 | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Shared/Chem_Shared/Chem_GroupMod.F90 b/Shared/Chem_Shared/Chem_GroupMod.F90 index a045f620..ba26446a 100644 --- a/Shared/Chem_Shared/Chem_GroupMod.F90 +++ b/Shared/Chem_Shared/Chem_GroupMod.F90 @@ -456,9 +456,9 @@ END SUBROUTINE Pack_Chem_Groups ! !INTERFACE: #ifdef CHEM_INFO - SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate, bry_ratio, aBRCL, aCL2, aOCLO, aCL2O2, aCLO, aHCL, aHOCL, zBRCL, zCL2, zOCLO, zCL2O2, zCLO, zHCL, zHOCL, zBRY, aCLY, zCLY ) + SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate, verbose, bry_ratio, aBRCL, aCL2, aOCLO, aCL2O2, aCLO, aHCL, aHOCL, zBRCL, zCL2, zOCLO, zCL2O2, zCLO, zHCL, zHOCL, zBRY, aCLY, zCLY ) #else - SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate) + SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate, verbose ) #endif IMPLICIT NONE @@ -470,6 +470,7 @@ SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate) REAL*4, POINTER, DIMENSION(:,:,:), INTENT(IN), OPTIONAL :: Q_separate ! water vapor [kg vapor / kg moist air] ! option to provide Q separate from the advection bundle, ! otherwise we get Q from that bundle (TRADV) + LOGICAL, INTENT(IN), OPTIONAL :: verbose ! if true (default), print CL/N LOOP COUNT #ifdef CHEM_INFO REAL*4, POINTER, DIMENSION(:,:,:) :: bry_ratio, aBRCL, aCL2, aOCLO, aCL2O2, aCLO, aHCL, aHOCL REAL*4, POINTER, DIMENSION(:,:,:) :: zBRCL, zCL2, zOCLO, zCL2O2, zCLO, zHCL, zHOCL @@ -513,8 +514,14 @@ SUBROUTINE Unpack_Chem_Groups(state, PLE, AREA, Q_separate) REAL, PARAMETER :: MAXFRAC = 0.99 ! Do not reduce more than this REAL, PARAMETER :: VERY_SMALL = 1.0e-25 + LOGICAL :: verb + Iam = "Unpack_Chem_Groups" + ! verbose flag + verb = .TRUE. + IF ( PRESENT(verbose) ) verb = verbose + IF ( GMI_groups_active ) THEN ! IF (MAPL_AM_I_ROOT()) print*,'Unpacking GMI groups Bry and Cly' @@ -1274,7 +1281,7 @@ SUBROUTINE GMI_reduce_Cly_vmr ( ) END DO - IF ( loop_count > 0 ) print*,'CL LOOP COUNT = ', loop_count, COUNT(in_play(:)) + IF ( loop_count > 0 .and. verb ) print*,'CL LOOP COUNT = ', loop_count, COUNT(in_play(:)) if ( vsum_EXTRA > 0.0d0 ) then print*,'Cannot conserve Cl !!' @@ -1474,7 +1481,7 @@ SUBROUTINE GMI_reduce_N_vmr ( ) END DO - IF ( loop_count > 0 ) print*,'N LOOP COUNT = ', loop_count, COUNT(in_play(:)) + IF ( loop_count > 0 .and. verb ) print*,'N LOOP COUNT = ', loop_count, COUNT(in_play(:)) if ( vsum_EXTRA > 0.0d0 ) then print*,'Cannot conserve N!!' @@ -1698,7 +1705,7 @@ SUBROUTINE GCC_reduce_Cly_mmr ( ) END DO - IF ( loop_count > 0 ) print*,'CL LOOP COUNT = ', loop_count, COUNT(in_play(:)) + IF ( loop_count > 0 .and. verb ) print*,'CL LOOP COUNT = ', loop_count, COUNT(in_play(:)) if ( vsum_EXTRA > 0.0d0 ) then print*,'Cannot conserve Cl !!' @@ -1879,7 +1886,7 @@ SUBROUTINE GCC_reduce_N_mmr ( ) END DO - IF ( loop_count > 0 ) print*,'N LOOP COUNT = ', loop_count, COUNT(in_play(:)) + IF ( loop_count > 0 .and. verb ) print*,'N LOOP COUNT = ', loop_count, COUNT(in_play(:)) if ( vsum_EXTRA > 0.0d0 ) then print*,'Cannot conserve N!!'