From 174e3724d7fe88679947aef1294a8b969662f784 Mon Sep 17 00:00:00 2001 From: acollow Date: Wed, 4 Jun 2025 08:23:54 -0400 Subject: [PATCH 1/4] allow aerosol emissions to enter through HEMCO --- GEOS_ChemGridComp.F90 | 240 +++++------------- HEMCO_GridComp/HEMCOgocart2g_Config.rc | 12 +- .../HEMCOgocart2g_Config.rc.withscaling | 154 +++++++++++ HEMCO_GridComp/HEMCOgocart2g_Diagn.rc | 23 +- HEMCO_GridComp/HEMCOgocart2g_ExtData.yaml | 81 ++++++ HEMCO_GridComp/HEMCOgocart2g_Spec.rc | 5 + 6 files changed, 330 insertions(+), 185 deletions(-) create mode 100644 HEMCO_GridComp/HEMCOgocart2g_Config.rc.withscaling diff --git a/GEOS_ChemGridComp.F90 b/GEOS_ChemGridComp.F90 index b1cb31e8..9cef0e37 100644 --- a/GEOS_ChemGridComp.F90 +++ b/GEOS_ChemGridComp.F90 @@ -21,15 +21,14 @@ module GEOS_ChemGridCompMod use GEOS_ChemEnvGridCompMod, only : ChemEnv_SetServices => SetServices use GOCART_GridCompMod, only : GOCART_SetServices => SetServices use GOCART2G_GridCompMod, only : GOCART2G_SetServices => SetServices !GOCART REFACTOR - use RRG_GridCompMod, only : RRG_SetServices => SetServices !Carbon gases refactor use StratChem_GridCompMod, only : StratChem_SetServices => SetServices use GMIchem_GridCompMod, only : GMI_SetServices => SetServices use CARMAchem_GridCompMod, only : CARMA_SetServices => SetServices use GEOSCHEMchem_GridCompMod, only : GCChem_SetServices => SetServices - use MATRIX_GridCompMod, only : MATRIX_SetServices => SetServices - use MAM_GridCompMod, only : MAM_SetServices => SetServices + use MATRIXchem_GridCompMod, only : MATRIX_SetServices => SetServices + use MAMchem_GridCompMod, only : MAM_SetServices => SetServices use GEOS_PChemGridCompMod, only : PChem_SetServices => SetServices - use ACHEM_GridCompMod, only : AChem_SetServices => SetServices + use GEOS_AChemGridCompMod, only : AChem_SetServices => SetServices use GAAS_GridCompMod, only : GAAS_SetServices => SetServices use H2O_GridCompMod, only : H2O_SetServices => SetServices use TR_GridCompMod, only : TR_SetServices => SetServices @@ -44,7 +43,7 @@ module GEOS_ChemGridCompMod public SetServices ! ----------- - + ! Private state ! ------------- TYPE GEOS_ChemGridComp @@ -55,7 +54,6 @@ module GEOS_ChemGridCompMod LOGICAL :: enable_GOCART LOGICAL :: enable_GOCARTdata LOGICAL :: enable_GOCART2G ! GOCART REFACTOR - LOGICAL :: enable_RRG ! Carbon gases refactor (MSL) LOGICAL :: enable_GAAS LOGICAL :: enable_H2O LOGICAL :: enable_STRATCHEM @@ -71,7 +69,7 @@ module GEOS_ChemGridCompMod LOGICAL :: strict_child_timing ! Call a barrier before and after each child is run ! Only use this to test timings, not operationally INTEGER :: AERO_PROVIDER - INTEGER :: RATS_PROVIDER ! WARNING: May be multiple RATS_PROVIDERs + INTEGER :: RATS_PROVIDER ! WARNING: May be multiple RATS_PROVIDERs END TYPE GEOS_ChemGridComp ! Hook for the ESMF @@ -82,8 +80,8 @@ module GEOS_ChemGridCompMod !============================================================================= -! !DESCRIPTION: This gridded component (GC) combines - +! !DESCRIPTION: This gridded component (GC) combines + !EOP ! IMPORTANT: If adding a new component, make sure to update private function GetProvider_() @@ -94,7 +92,6 @@ module GEOS_ChemGridCompMod integer :: ACHEM = -1 integer :: GOCART = -1 integer :: GOCART2G = -1 - integer :: RRG = -1 integer :: GOCARTdata = -1 integer :: GAAS = -1 integer :: H2O = -1 @@ -124,8 +121,8 @@ subroutine SetServices ( GC, RC ) integer, intent( OUT) :: RC ! return code ! !DESCRIPTION: The SetServices for the Chemistry GC needs to register its -! Initialize and Run. It uses the MAPL\_Generic construct for defining -! state specs and couplings among its children. In addition, it creates the +! Initialize and Run. It uses the MAPL\_Generic construct for defining +! state specs and couplings among its children. In addition, it creates the ! children GCs and runs their respective SetServices. !EOP @@ -144,11 +141,11 @@ subroutine SetServices ( GC, RC ) type (ESMF_GridComp), pointer :: GCS(:) - integer :: I, J, RATS_PROVIDER, AERO_PROVIDER, OX_ID + integer :: I, RATS_PROVIDER, AERO_PROVIDER type (ESMF_Config), target :: CF, myCF integer :: n, id - + INTEGER, PARAMETER :: numRATs = 8 INTEGER :: RATsProviderNumber(numRATs) CHARACTER(LEN=ESMF_MAXSTR) :: RATsProviderName(numRATs) @@ -158,7 +155,7 @@ subroutine SetServices ( GC, RC ) CHARACTER(LEN=ESMF_MAXSTR) :: shortName CHARACTER(LEN=ESMF_MAXSTR) :: str - !GMI MEGAN isoprene related + !GMI MEGAN isoprene related CHARACTER(LEN=255) :: gmi_rcfilen = 'GMI_GridComp.rc' TYPE(ESMF_Config) :: gmi_config LOGICAL doMEGANemission, doMEGANviaHEMCO @@ -179,11 +176,6 @@ subroutine SetServices ( GC, RC ) logical :: GOCART_instance_of_HEMCO ! TRUE if HEMCO is running a GOCART instance logical :: GMI_instance_of_HEMCO ! TRUE if HEMCO is running a GMI instance -! For RATs diagnostics - character(LEN=ESMF_MAXSTR) :: RATsLabel, gen_str - character(len=ESMF_MAXSTR), allocatable :: nameRATS(:) - logical :: getout - !============================================================================= ! Begin... @@ -216,7 +208,7 @@ subroutine SetServices ( GC, RC ) call ESMF_ConfigGetAttribute(cf, chem_gridcomp_rc_file, label = "GEOS_ChemGridComp_RC_File:", & default = "GEOS_ChemGridComp.rc", __RC__) - + ! Identify which children to run ! ------------------------------ myCF = ESMF_ConfigCreate(__RC__) @@ -227,8 +219,7 @@ subroutine SetServices ( GC, RC ) call ESMF_ConfigGetAttribute(myCF, myState%enable_ACHEM, Default=.FALSE., Label="ENABLE_ACHEM:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCART, Default=.FALSE., Label="ENABLE_GOCART:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCARTdata, Default=.FALSE., Label="ENABLE_GOCART_DATA:", __RC__ ) - call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCART2G, Default=.FALSE., Label="ENABLE_GOCART2G:", __RC__ ) - call ESMF_ConfigGetAttribute(myCF, myState%enable_RRG, Default=.FALSE., Label="ENABLE_RRG:", __RC__ ) + call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCART2G, Default=.FALSE., Label="ENABLE_GOCART2G:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_GAAS, Default=.FALSE., Label="ENABLE_GAAS:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_H2O, Default=.FALSE., Label="ENABLE_H2O:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_STRATCHEM, Default=.FALSE., Label="ENABLE_STRATCHEM:", __RC__ ) @@ -263,7 +254,6 @@ subroutine SetServices ( GC, RC ) if (myState%enable_GOCART ) GOCART = MAPL_AddChild(GC, NAME= 'GOCART', SS=GOCART_SetServices, __RC__) if (myState%enable_GOCARTdata) GOCARTdata = MAPL_AddChild(GC, NAME= 'GOCART.data', SS=GOCART_SetServices, __RC__) if (myState%enable_GOCART2G ) GOCART2G = MAPL_AddChild(GC, NAME= 'GOCART2G', SS=GOCART2G_SetServices, __RC__) - if (myState%enable_RRG ) RRG = MAPL_AddChild(GC, NAME= 'RRG', SS=RRG_SetServices, __RC__) if (myState%enable_GAAS ) GAAS = MAPL_AddChild(GC, NAME= 'GAAS', SS=GAAS_SetServices, __RC__) if (myState%enable_H2O ) H2O = MAPL_AddChild(GC, NAME= 'H2O', SS=H2O_SetServices, __RC__) if (myState%enable_STRATCHEM ) STRATCHEM = MAPL_AddChild(GC, NAME= 'STRATCHEM', SS=StratChem_SetServices, __RC__) @@ -321,101 +311,11 @@ subroutine SetServices ( GC, RC ) ! Priority for first three RATs, OX, O3 and O3PPMV, goes to the ANALYSIS_OX_PROVIDER. ! ----------------------------------------------------------------------------------- - call GetProvider_(CF, Label='ANALYSIS_OX_PROVIDER:', ID=OX_ID, Name=providerName, Default='PCHEM', __RC__) + call GetProvider_(CF, Label='ANALYSIS_OX_PROVIDER:', ID=i, Name=providerName, Default='PCHEM', __RC__) - RATsProviderNumber(1:3) = OX_ID + RATsProviderNumber(1:3) = i RATsProviderName(1:3) = trim(providerName) -! Allow setting individual RAT sources via AGCM.rc - DO i = 1, numRATs - write(RATsLabel,'(a)') trim(speciesName(i))//'_PROVIDER:' - call ESMF_ConfigGetAttribute(CF, providerName, Default='none', Label=RATsLabel, __RC__) - call ESMF_ConfigFindLabel( CF,RATsLabel,rc=RC ) ! Godda reset! - n = ESMF_ConfigGetLen(CF,label=RATsLabel,rc=status) - if (ESMF_UtilStringLowerCase(trim(ProviderName)) .ne. 'none' .and. n .gt. 0) then ! If *_PROVIDER looks like a valid GridComp tag - call GetProvider_(CF, Label=trim(RATsLabel), ID=RATsProviderNumber(i), Name=providerName, Default=trim(RATsProviderName(i)), __RC__) ! - RATsProviderName(i) = trim(ProviderName) - if (MAPL_am_I_Root()) write(*,*) '<<>>: ', trim(speciesName(i))," Provider: ",trim(RATsProviderName(i)) - endif ! Else, don't change PROVIDER info set by RATS_PROVIDER - END DO - -! CO2 is not listed as a RAT, so add it here outside of the RATs code logic - ! -- get info from AGCM.rc - call ESMF_ConfigGetAttribute(CF, providerName, Default='None', & - Label="CO2_PROVIDER:", __RC__ ) - - str = trim(providerName) - str = ESMF_UtilStringLowerCase(str, __RC__) - - ! -- Make sure, if label is there, that it is an approved name. - if (trim(providerName) .ne. 'GOCART' .and. trim(str) .ne. 'none' .and. trim(providerName) .ne. 'RRG' .and. len_trim(providerName) .ne. 0) then - write(*,*) 'CHEM ERROR: CO2_PROVIDER can only be None, GOCART or RRG. It is ',trim(providerName) - RC = -1 - return - - ! -- else, if 'None', do nothing. - else if (trim(str) .eq. 'none') then - if (MAPL_am_I_root()) write(*,*) 'CHEM: CO2 is not added as a RAT from GOCART or RRG.' - - ! -- else, if GOCART or RRG, set up export - else if (trim(providerName) .eq. 'GOCART') then - CALL MAPL_AddExportSpec( GC, SHORT_NAME = 'CO2', & - CHILD_ID = GOCART, __RC__ ) - else if (trim(providerName) .eq. 'RRG' ) then - CALL MAPL_AddExportSpec( GC, SHORT_NAME = 'CO2', & - CHILD_ID = RRG, __RC__ ) - endif - - call ESMF_ConfigFindLabel(CF, 'RATS_DIAGNOSTICS:', RC=STATUS) ! Use STATUS to test if label was found - - n = 0 - IF (STATUS .eq. ESMF_SUCCESS) THEN - n = ESMF_ConfigGetLen(CF,label='RATS_DIAGNOSTICS:',RC=STATUS) - VERIFY_(STATUS) - ENDIF - - ! No error thrown. Just go around this if nothing learnable from config. - IF (STATUS .eq. ESMF_SUCCESS .and. n .ne. 0 ) THEN ! if the label was found... - - ! Get number of words in config line - n = ESMF_ConfigGetLen(CF,label='RATS_DIAGNOSTICS:',RC=STATUS) - VERIFY_(STATUS) - - allocate(nameRATS(n), STAT=STATUS) - VERIFY_(STATUS) - - ! Put the cursor at the label - call ESMF_ConfigFindLabel(CF, 'RATS_DIAGNOSTICS:', RC=STATUS) - VERIFY_(STATUS) - - ! Loop over RATS in list - DO i=1,n - call ESMF_ConfigGetAttribute(CF,gen_str,RC=STATUS) - VERIFY_(STATUS) - nameRATS(i) = trim(gen_str) - ENDDO - - DO i=1,n - - if (trim(nameRATs(i)) .eq. 'CO2') cycle ! Since CO2 isn't listed as a RAT in the species list - getout = .false. - DO j=1,numRATs - if (index(trim(speciesName(j)),trim(nameRATs(i))).gt.0) getout = .true. - ENDDO - if (getout) cycle - - CALL MAPL_AddExportSpec( GC, & - SHORT_NAME = trim(nameRATs(i)), & - CHILD_ID = RRG, RC=STATUS ) - VERIFY_(STATUS) - - ENDDO - - deallocate(nameRATs, STAT=STATUS) - VERIFY_(STATUS) - - ENDIF - ! Add export specs for the RATs ... ! --------------------------------- DO i = 1, numRATs @@ -426,7 +326,7 @@ subroutine SetServices ( GC, RC ) IF(MAPL_AM_I_ROOT()) THEN PRINT *," " PRINT *, TRIM(Iam)//": strict_child_timing =", myState%strict_child_timing - PRINT *, TRIM(Iam)//": RATs Provider List" + PRINT *, TRIM(Iam)//": RATs Provider List" DO i = 1, numRATs PRINT *," "//TRIM(speciesName(i))//": "//TRIM(RATsProviderName(i)) END DO @@ -469,13 +369,13 @@ subroutine SetServices ( GC, RC ) DATATYPE = MAPL_StateItem, __RC__ ) #endif - + call MAPL_AddExportSpec(GC, & SHORT_NAME = 'AERO_DP', & LONG_NAME = 'aerosol_deposition', & UNITS = 'kg m-2 s-1', & DIMS = MAPL_DimsHorzOnly, & - DATATYPE = MAPL_BundleItem, __RC__) + DATATYPE = MAPL_BundleItem, __RC__) else ! Determine Id of the aerosol provider @@ -498,7 +398,7 @@ subroutine SetServices ( GC, RC ) ! by the other components. ! ---------------------------------------------------------------- if ( AERO_PROVIDER == GOCART2G ) then - call MAPL_AddExportSpec ( GC, TO_NAME = 'AERO_ACI', & + call MAPL_AddExportSpec ( GC, TO_NAME = 'AERO_ACI', & SHORT_NAME = 'AERO', & CHILD_ID = AERO_PROVIDER, __RC__ ) else @@ -516,7 +416,7 @@ subroutine SetServices ( GC, RC ) CHILD_ID = GOCART, __RC__ ) end if -! Save this information in private state for later use. +! Save this information in private state for later use. ! WARNING: Dangerous if there is more than one RATS_PROVIDER ! ---------------------------------------------------------- myState%RATS_PROVIDER = RATS_PROVIDER @@ -550,17 +450,6 @@ subroutine SetServices ( GC, RC ) DST_ID = GOCART2G, SRC_ID = CHEMENV, __RC__ ) ENDIF - IF(myState%enable_RRG) then - CALL MAPL_AddConnectivity ( GC, & - SHORT_NAME = (/'DELP ', 'AIRDENS ' /), & - DST_ID = RRG, SRC_ID = CHEMENV, __RC__ ) - IF(myState%enable_PCHEM) then - CALL MAPL_AddConnectivity ( GC, & - SHORT_NAME = (/'O3'/), & - DST_ID = RRG, SRC_ID = PCHEM, __RC__ ) - ENDIF - ENDIF - IF(myState%enable_GAAS) then CALL MAPL_AddConnectivity ( GC, & SHORT_NAME = (/ 'AIRDENS ', 'DELP ' /), & @@ -582,13 +471,13 @@ subroutine SetServices ( GC, RC ) CALL MAPL_AddConnectivity ( GC, & SHORT_NAME = (/'AIRDENS ', 'CN_PRCP ', 'NCN_PRCP'/), & DST_ID = CARMA, SRC_ID = CHEMENV, __RC__ ) - + if(myState%enable_GOCART2G) then CALL MAPL_AddConnectivity ( GC, & SRC_NAME = (/'PSO4'/), & DST_NAME = (/'CARMA_PSO4TOT'/), & DST_ID=CARMA, SRC_ID=GOCART2G, __RC__) - endif + endif if(myState%enable_ACHEM) then CALL MAPL_AddConnectivity ( GC, & SRC_NAME = (/'pSOA_ANTHRO_VOC', 'pSOA_BIOB_VOC '/), & @@ -605,8 +494,8 @@ subroutine SetServices ( GC, RC ) endif if(myState%enable_GMICHEM .AND. TRIM(providerName) == "CARMA") then CALL MAPL_AddConnectivity ( GC, & - SRC_NAME = (/ 'CARMA_SUSAREA ', 'CARMA_SUREFF '/), & - DST_NAME = (/ 'SO4SAREA ', 'SO4REFF '/), & + SRC_NAME = (/ 'CARMA_SUSAREA '/), & + DST_NAME = (/ 'SO4SAREA '/), & DST_ID = GMICHEM, SRC_ID = CARMA, __RC__) endif if(myState%enable_STRATCHEM .AND. TRIM(providerName) == "CARMA") then @@ -728,7 +617,7 @@ subroutine SetServices ( GC, RC ) DST_NAME = (/'O3P ', 'OHSTRAT ', 'O3 ', 'OCS_JRATE'/), & DST_ID = ACHEM, SRC_ID = GMICHEM, __RC__ ) ENDIF - + ! GOCART <=> ACHEM (OCS CHEMISTRY) ! --------------------------------- @@ -778,20 +667,12 @@ subroutine SetServices ( GC, RC ) ! --------------------------------- IF(myState%enable_GMICHEM .AND. TRIM(providerName) == "GOCART2G") THEN - IF(myState%enable_GOCART2G) THEN + IF(myState%enable_GOCART2G) & CALL MAPL_AddConnectivity ( GC, & SHORT_NAME = (/'AERO'/), & DST_ID = GMICHEM, SRC_ID = GOCART2G, __RC__ ) - ! ... For GOCART::SU,NI - ! --------------------- - CALL MAPL_AddConnectivity ( GC, & - SRC_NAME = (/ "OH ", "H2O2", "NO3 " /), & - DST_NAME = (/ "GMI_OH ", "GMI_H2O2", "GMI_NO3 " /), & - DST_ID=GOCART2G, SRC_ID=GMICHEM, __RC__) - - END IF END IF ! GOCART.data <=> GMICHEM coupling ... @@ -861,7 +742,7 @@ subroutine SetServices ( GC, RC ) SRC_NAME = (/"OX"/), & DST_NAME = (/"O3"/), & DST_ID=GOCART, SRC_ID=GMICHEM, __RC__) - + END IF ! GMICHEM connections to MAM @@ -916,7 +797,7 @@ subroutine SetServices ( GC, RC ) ENDIF ENDIF -! GEOS-Chem import of CO2 +! GEOS-Chem import of CO2 ! ----------------------------- IF(myState%enable_GEOSCHEM .AND. myState%enable_GOCART .AND. chemReg%doing_CO2) then CALL MAPL_AddConnectivity ( GC, & @@ -936,7 +817,7 @@ subroutine SetServices ( GC, RC ) CALL MAPL_AddConnectivity ( GC, SHORT_NAME = (/ 'AIRDENS', 'BYNCY ' /), DST_ID=HEMCO, SRC_ID=CHEMENV, __RC__) !!!!!!!!!!!!!!!!!! - ! Determine if GOCART or GMI expect data from HEMCO: + ! Determine if GOCART or GMI expect data from HEMCO: ! (adapted from HEMCO_GridCompMod.F90) !!!!!!!!!!!!!!!!!! @@ -975,11 +856,16 @@ subroutine SetServices ( GC, RC ) ! --------------- IF( myState%enable_HEMCO .AND. myState%enable_GOCART2G ) THEN CALL MAPL_AddConnectivity ( GC, & - SHORT_NAME = (/ 'OC_ISOPRENE', 'OC_MTPA ', 'OC_MTPO ', 'OC_LIMO '/), & + SHORT_NAME = [character(len=11) :: & + 'OC_ISOPRENE', 'OC_MTPA', 'OC_MTPO', 'OC_LIMO', & + 'SU_ANTHROL1', 'SU_ANTHROL2', 'SU_SHIPSO2', & + 'OC_ANTEOC1', 'OC_ANTEOC2', 'OC_SHIP', 'BC_ANTEBC1', & + 'BC_ANTEBC2', 'BC_SHIP', 'EMI_NH3_EN', 'SU_SHIPSO4'], & SRC_ID=HEMCO, DST_ID=GOCART2G, __RC__) END IF -! HEMCO -> GMI + +! HEMCO -> GMI ! ------------ IF( myState%enable_HEMCO .AND. myState%enable_GMICHEM ) THEN @@ -1000,7 +886,7 @@ subroutine SetServices ( GC, RC ) call ESMF_ConfigGetAttribute(gmi_config, value=doMEGANviaHEMCO, & label="doMEGANviaHEMCO:", default=.FALSE., __RC__ ) - + ! make sure we don't have inconsistent HEMCO flags IF ( GMI_instance_of_HEMCO .neqv. doMEGANviaHEMCO ) THEN PRINT*,'Inconsistency --- HEMCO GMI instance = ', GMI_instance_of_HEMCO @@ -1031,7 +917,7 @@ subroutine SetServices ( GC, RC ) call MAPL_GenericSetServices ( GC, __RC__ ) RETURN_(ESMF_SUCCESS) - + end subroutine SetServices @@ -1045,13 +931,13 @@ subroutine Init ( GC, IMPORT, EXPORT, CLOCK, RC ) ! !ARGUMENTS: - type(ESMF_GridComp), intent(inout) :: GC ! Gridded component + type(ESMF_GridComp), intent(inout) :: GC ! Gridded component type(ESMF_State), intent(inout) :: IMPORT ! Import state type(ESMF_State), intent(inout) :: EXPORT ! Export state type(ESMF_Clock), intent(inout) :: CLOCK ! The clock integer, optional, intent( out) :: RC ! Error code -! !DESCRIPTION: The Initialize method of the Chemistry Composite Gridded +! !DESCRIPTION: The Initialize method of the Chemistry Composite Gridded ! Component. It acts as a driver for the initializtion of the children. !EOP @@ -1077,8 +963,8 @@ subroutine Init ( GC, IMPORT, EXPORT, CLOCK, RC ) type (GEOS_ChemGridComp_Wrap) :: wrap !============================================================================= - -! Begin... + +! Begin... ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- @@ -1134,12 +1020,12 @@ subroutine Init ( GC, IMPORT, EXPORT, CLOCK, RC ) ! need to be determined inside the child component. ! -------------------------------------------------------------------------- if (myState%AERO_PROVIDER < 0) then - ! Radiation will not call the aerosol optics method + ! Radiation will not call the aerosol optics method ! unless this attribute is explicitly set to true. call ESMF_StateGet(EXPORT, 'AERO', AERO, __RC__) call ESMF_AttributeSet(AERO, name='implements_aerosol_optics_method', value=.false., __RC__) - ! Moist will not call the aerosol activation method + ! Moist will not call the aerosol activation method ! unless this attribute is explicitly set to true. call ESMF_AttributeSet(AERO, name='implements_aerosol_activation_properties_method', value=.false., __RC__) end if @@ -1150,15 +1036,15 @@ subroutine Init ( GC, IMPORT, EXPORT, CLOCK, RC ) ! ------------------------ if ( MAPL_am_I_root() ) then - print *, trim(Iam)//": IMPORT State" + print *, trim(Iam)//": IMPORT State" call ESMF_StatePrint ( IMPORT ) - print *, trim(Iam)//": INTERNAL State" + print *, trim(Iam)//": INTERNAL State" call ESMF_StatePrint ( INTERNAL ) - print *, trim(Iam)//": EXPORT State" + print *, trim(Iam)//": EXPORT State" call ESMF_StatePrint ( EXPORT ) print *, trim(Iam)//": AERO State (EXPORT)" - call ESMF_StateGet ( EXPORT, 'AERO', AERO, __RC__ ) + call ESMF_StateGet ( EXPORT, 'AERO', AERO, __RC__ ) call ESMF_StatePrint ( AERO, nestedFlag=.false., __RC__ ) print *, trim(Iam)//": AERO State (PROVIDER)", myState%AERO_PROVIDER if (myState%AERO_PROVIDER > 0) then @@ -1187,7 +1073,7 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC ) ! !ARGUMENTS: - type(ESMF_GridComp), intent(inout) :: GC ! Gridded component + type(ESMF_GridComp), intent(inout) :: GC ! Gridded component type(ESMF_State), intent(inout) :: IMPORT ! Import state type(ESMF_State), intent(inout) :: EXPORT ! Export state type(ESMF_Clock), intent(inout) :: CLOCK ! The clock @@ -1226,7 +1112,7 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC ) !============================================================================= -! Begin... +! Begin... ! Get parameters from generic state. The RUNALARM is used to control ! the calling of the full chemistry @@ -1249,7 +1135,7 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC ) if ( ESMF_AlarmIsRinging (ALARM, RC=STATUS) ) then - ! Don't turn alarm off in phase 1, otherwise phase 2 will not be + ! Don't turn alarm off in phase 1, otherwise phase 2 will not be ! executed! ! call ESMF_AlarmRingerOff(ALARM, RC=STATUS) ! VERIFY_(STATUS) @@ -1287,9 +1173,9 @@ subroutine Run1 ( GC, IMPORT, EXPORT, CLOCK, RC ) if(associated(GCS)) then NCHLD = SIZE(GCS) ! # of children IPHASE = 1 ! phase to be called - ! do for every child: get child state, determine number of + ! do for every child: get child state, determine number of ! of run phases and call phase one if more than one phase - ! exists. Also updated MAPL_Get to accept the output + ! exists. Also updated MAPL_Get to accept the output ! argument NumRunPhases (ckeller, 09/10/2014) ! -------------------------------------------------------- @@ -1347,7 +1233,7 @@ subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC ) ! !ARGUMENTS: - type(ESMF_GridComp), intent(inout) :: GC ! Gridded component + type(ESMF_GridComp), intent(inout) :: GC ! Gridded component type(ESMF_State), intent(inout) :: IMPORT ! Import state type(ESMF_State), intent(inout) :: EXPORT ! Export state type(ESMF_Clock), intent(inout) :: CLOCK ! The clock @@ -1392,7 +1278,7 @@ subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC ) type (GEOS_ChemGridComp_Wrap) :: wrap type (ESMF_VM) :: VM !------------------------------------------------------------------- -! Begin... +! Begin... ! Get parameters from generic state. The RUNALARM is used to control ! the calling of the full chemistry @@ -1400,7 +1286,7 @@ subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC ) call MAPL_GetObjectFromGC ( GC, MAPL, RC=STATUS) VERIFY_(STATUS) - call MAPL_Get(MAPL, RUNALARM = ALARM, __RC__ ) + call MAPL_Get(MAPL, RUNALARM = ALARM, __RC__ ) ! Get my internal state ! --------------------- @@ -1421,7 +1307,7 @@ subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC ) ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- call ESMF_GridCompGet ( GC, name=COMP_NAME, __RC__ ) - Iam = trim(COMP_NAME) // "::Run2" + Iam = trim(COMP_NAME) // "::Run2" ! Call Run for every Child. This is either phase 1 (for components ! with only one phase) or phase 2 (for components with two phases). @@ -1440,7 +1326,7 @@ subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC ) if(associated(GCS)) then NCHLD = SIZE(GCS) ! # of children - ! do for every child: get child state, determine number of + ! do for every child: get child state, determine number of ! run phases and phase to call, execute. ! -------------------------------------------------------- @@ -1477,7 +1363,7 @@ subroutine Run2 ( GC, IMPORT, EXPORT, CLOCK, RC ) enddo !I endif - !Compute chemistry tracer increments + !Compute chemistry tracer increments !--------------------------------------- call Compute_IncBundle(INTERNAL, EXPORT, CHMincR2, MAPL, __RC__) @@ -1539,7 +1425,7 @@ subroutine GetProvider_ ( CF, Label, ID, Name, Default, RC ) call ESMF_ConfigGetAttribute(CF, providerName, Default=trim(default), & Label=Label, __RC__) - ID = -1 + ID = -1 name = trim(providerName) select case ( trim(name) ) @@ -1574,15 +1460,13 @@ subroutine GetProvider_ ( CF, Label, ID, Name, Default, RC ) ID = TR case ('DNA') ID = DNA - case ('RRG') - ID = RRG case DEFAULT message = "unknown provider "//trim(name) __raise__(MAPL_RC_ERROR, message) end select - + if ( ID < 0 ) then message = "Component "//trim(name)//" is NOT enabled; cannot specify it for "//trim(label) __raise__(MAPL_RC_ERROR, message) diff --git a/HEMCO_GridComp/HEMCOgocart2g_Config.rc b/HEMCO_GridComp/HEMCOgocart2g_Config.rc index 8edc9d53..baa77c45 100644 --- a/HEMCO_GridComp/HEMCOgocart2g_Config.rc +++ b/HEMCO_GridComp/HEMCOgocart2g_Config.rc @@ -80,7 +80,17 @@ BEGIN SECTION BASE EMISSIONS 108 CLM4_PFT_C4_GRSS /dev/null PFT_C4_GRSS 2000/1/1/0 C xy 1 * - 1 1 108 CLM4_PFT_CROP /dev/null PFT_CROP 2000/1/1/0 C xy 1 * - 1 1 108 MEGAN_ORVC /dev/null OCPI 1990/1-12/1/0 C xy kgC/m2/s * - 1 1 - +0 GOCART_SU_ANTHROL1 /see/ExtData.yaml so2_nonenergy 2000-2019/1-12/1-31/0 C xy kg/m2/s SO2 - 1 1 +0 GOCART_SU_ANTHROL2 /see/ExtData.yaml so2_energy 2000-2019/1-12/1-31/0 C xy kg/m2/s SO2 - 1 1 +0 GOCART_SU_SHIPSO2 /see/ExtData.yaml so2_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s SO2 - 1 1 +0 GOCART_SU_SHIPSO4 /see/ExtData.yaml so4_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s SO4 - 1 1 +0 GOCART_OC_ANTEOC1 /see/ExtData.yaml oc_nonenergy 2000-2019/1-12/1-31/0 C xy kg/m2/s OC - 1 1 +0 GOCART_OC_ANTEOC2 /see/ExtData.yaml oc_energy 2000-2019/1-12/1-31/0 C xy kg/m2/s OC - 1 1 +0 GOCART_OC_SHIP /see/ExtData.yaml oc_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s OC - 1 1 +0 GOCART_BC_ANTEBC1 /see/ExtData.yaml bc_nonenergy 2000-2019/1-12/1-31/0 C xy kg/m2/s BC - 1 1 +0 GOCART_BC_ANTEBC2 /see/ExtData.yaml bc_energy 2000-2019/1-12/1-31/0 C xy kg/m2/s BC - 1 1 +0 GOCART_BC_SHIP /see/ExtData.yaml bc_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s BC - 1 1 +0 GOCART_EMI_NH3_EN /see/ExtData.yaml nh3 2000-2019/1-12/1-31/0 C xy kg/m2/s NH3 - 1 1 #============================================================================== # --- time zones (offset to UTC) --- #============================================================================== diff --git a/HEMCO_GridComp/HEMCOgocart2g_Config.rc.withscaling b/HEMCO_GridComp/HEMCOgocart2g_Config.rc.withscaling new file mode 100644 index 00000000..4b7de7a4 --- /dev/null +++ b/HEMCO_GridComp/HEMCOgocart2g_Config.rc.withscaling @@ -0,0 +1,154 @@ +### HEMCO INPUT FILE ### +# ================================================================================================== + +#################################################################################### +BEGIN SECTION SETTINGS +#################################################################################### +# +ROOT : /dev/null # not relevant in GEOS, only when running in Harvard CTM +Logfile : HEMCOgocart2g.log +DiagnPrefix : HEMCOgocart2g_diagnostics +DiagnFreq : 00000000 010000 +Negative values : 2 +Unit tolerance : 1 +Verbose : 0 +Warnings : 0 +DiagnTimeStamp : Start +DiagnNoLevDim : true +SpecFile : HEMCOgocart2g_Spec.rc +DiagnFile : HEMCOgocart2g_Diagn.rc +DefaultDiagnOn : false +DefaultDiagnSname : HEMCOgocart2g_ +DefaultDiagnLname : HEMCOgocart2g_emissions_species +DefaultDiagnDim : 2 +# +END SECTION SETTINGS + +#################################################################################### +BEGIN SECTION EXTENSION SWITCHES +#################################################################################### +# Make sure that the ExtNr provided here matches with the ExtNr provided in the base +# emissions sections. Otherwise, the listed files won't be read! +# +# ExtNr ExtName on/off Species +0 Base : on * + --> TIMEZONES : false +108 MEGAN : on ISOP/ACET/PRPE/C2H4/ALD2/MOH/EOH/MTPA/MTPO/LIMO/SESQ/SOAP/SOAS + --> Isoprene scaling : 1.0 + --> CO2 inhibition : true + --> CO2 conc (ppmv) : 390.0 + --> Isoprene to SOAP : 0.015 + --> Isoprene to SOAS : 0.015 + --> Monoterp to SOAP : 0.050 + --> Monoterp to SOAS : 0.050 + --> Othrterp to SOAP : 0.050 + --> Othrterp to SOAS : 0.050 +# +END SECTION EXTENSION SWITCHES + +#################################################################################### +BEGIN SECTION BASE EMISSIONS +#################################################################################### + +#======================================================================================================================================= +# --- MEGAN biogenic emissions (Extension 108) +#======================================================================================================================================= +# NOTE: These are the base emissions, which will be converted to kgC/m2/s by HEMCO. The specified species (OCPI/ISOP/ACET) are required +# for proper unit conversion. Since netCDF files are already in mass carbon (ug(C)), the only important thing is to specify a VOC +# with a specified MW of 12g/mol. This is the case for OCPI, ISOP and ACET. +108 MEGAN_AEF_ISOP /dev/null AEF_ISOPRENE 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 MEGAN_AEF_MBOX /dev/null AEF_MBO 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 MEGAN_AEF_BPIN /dev/null AEF_BETA_PINENE 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 MEGAN_AEF_CARE /dev/null AEF_CARENE 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 MEGAN_AEF_LIMO /dev/null AEF_LIMONENE 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 MEGAN_AEF_OCIM /dev/null AEF_OCIMENE 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 MEGAN_AEF_SABI /dev/null AEF_SABINENE 1985/1/1/0 C xy kgC/m2/s * - 1 1 +108 CLM4_PFT_BARE /dev/null PFT_BARE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_NDLF_EVGN_TMPT_TREE /dev/null PFT_NDLF_EVGN_TMPT_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_NDLF_EVGN_BORL_TREE /dev/null PFT_NDLF_EVGN_BORL_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_NDLF_DECD_BORL_TREE /dev/null PFT_NDLF_DECD_BORL_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_EVGN_TROP_TREE /dev/null PFT_BDLF_EVGN_TROP_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_EVGN_TMPT_TREE /dev/null PFT_BDLF_EVGN_TMPT_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_DECD_TROP_TREE /dev/null PFT_BDLF_DECD_TROP_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_DECD_TMPT_TREE /dev/null PFT_BDLF_DECD_TMPT_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_DECD_BORL_TREE /dev/null PFT_BDLF_DECD_BORL_TREE 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_EVGN_SHRB /dev/null PFT_BDLF_EVGN_SHRB 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_DECD_TMPT_SHRB /dev/null PFT_BDLF_DECD_TMPT_SHRB 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_BDLF_DECD_BORL_SHRB /dev/null PFT_BDLF_DECD_BORL_SHRB 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_C3_ARCT_GRSS /dev/null PFT_C3_ARCT_GRSS 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_C3_NARC_GRSS /dev/null PFT_C3_NARC_GRSS 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_C4_GRSS /dev/null PFT_C4_GRSS 2000/1/1/0 C xy 1 * - 1 1 +108 CLM4_PFT_CROP /dev/null PFT_CROP 2000/1/1/0 C xy 1 * - 1 1 +108 MEGAN_ORVC /dev/null OCPI 1990/1-12/1/0 C xy kgC/m2/s * - 1 1 +0 GOCART_SU_ANTHROL1 /see/ExtData.yaml so2_nonenergy 2000-2019/1-12/1-31/0 C xy kg/m2/s SO2 206/216 1 1 +0 GOCART_SU_ANTHROL2 /see/ExtData.yaml so2_energy 2000-2019/1-12/1-31/0 C xy kg/m2/s SO2 202/212 2 1 +0 GOCART_SU_SHIPSO2 /see/ExtData.yaml so2_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s SO2 - 3 1 +0 GOCART_SU_SHIPSO4 /see/ExtData.yaml so4_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s SO4 - 3 1 +0 GOCART_OC_ANTEOC1 /see/ExtData.yaml oc_nonenergy 2000-2019/1-12/1-31/0 C xy kg/m2/s OC 206/216 1 1 +0 GOCART_OC_ANTEOC2 /see/ExtData.yaml oc_energy 2000-2019/1-12/1-31/0 C xy kg/m2/s OC 202/212 2 1 +0 GOCART_OC_SHIP /see/ExtData.yaml oc_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s OC - 3 1 +0 GOCART_BC_ANTEBC1 /see/ExtData.yaml bc_nonenergy 2000-2019/1-12/1-31/0 C xy kg/m2/s BC 206/216 1 1 +0 GOCART_BC_ANTEBC2 /see/ExtData.yaml bc_energy 2000-2019/1-12/1-31/0 C xy kg/m2/s BC 202/212 2 1 +0 GOCART_BC_SHIP /see/ExtData.yaml bc_shipping 2000-2019/1-12/1-31/0 C xy kg/m2/s BC - 3 1 +0 GOCART_EMI_NH3_EN /see/ExtData.yaml nh3 2000-2019/1-12/1-31/0 C xy kg/m2/s NH3 - 1 1 +#============================================================================== +# --- time zones (offset to UTC) --- +#============================================================================== +(((TIMEZONES +* TIMEZONES $ROOT/timezones_esmf.2x25.nc UTC_OFFSET 2000/1/1/0 C xy count * - 1 1 +)))TIMEZONES + +END SECTION BASE EMISSIONS + +#################################################################################### +BEGIN SECTION SCALE FACTORS +#################################################################################### + +# ScalID Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Oper + +# --- VOC speciations --- +52 COPROD_FOSSIL 1.02 - - - xy unitless 1 + +# --- SOx to SO2 conversion (Chin et al., 2000) --- +63 SO2toSO4 0.031 - - - xy unitless 1 + +# --- conversion factor to convert mass carbon (12g/mol) to mass GOCART carbon (18g/mol) +71 CtoGocartC 1.5 - - - xy unitless 1 + +# --- SNAP scale factors from TNO report --- +# Binning: +# SNAP categories 1. 5 (power generation, extract/distribution of fossil fuels ) --> ENERGY +# SNAP categories 3, 4, 6 (industrial combustion, industrial processing, solvent use) --> INDUSTRY +# SNAP categories 2 (combustion ) --> RESIDENTIAL +# SNAP categories 7, 8 (road transport, other mobile ) --> TRANSPORT + +# day-of-week scale factors: Sun/Mon/.../Sat +201 INDUSTRY_DOW 0.73/1.10/1.10/1.10/1.10/1.10/0.77 - - - xy 1 1 +202 ENERGY_DOW 0.93/1.03/1.03/1.03/1.03/1.03/0.93 - - - xy 1 1 +203 TRANSPORT_DOW 0.90/1.01/1.03/1.04/1.05/1.07/0.91 - - - xy 1 1 +204 RESIDENTIAL_DOW 0.80/1.08/1.08/1.08/1.08/1.08/0.80 - - - xy 1 1 +205 AGRICULTURE_DOW 1.00/1.00/1.00/1.00/1.00/1.00/1.00 - - - xy 1 1 +206 AVERAGE_DOW 0.84/1.06/1.06/1.06/1.07/1.07/0.85 - - - xy 1 1 + +# diurnal scale factors: 0am/1am/.../23pm +211 INDUSTRY_TOD 0.82/0.75/0.70/0.66/0.64/0.66/0.72/0.92/1.11/1.19/1.24/1.26/1.27/1.24/1.25/1.25/1.22/1.19/1.14/1.07/1.00/0.95/0.90/0.86 - - - xy 1 1 +212 ENERGY_TOD 0.94/0.90/0.86/0.86/0.86/0.87/0.90/0.96/1.04/1.10/1.11/1.11/1.11/1.09/1.08/1.07/1.07/1.05/1.04/1.02/1.01/1.01/1.01/0.98 - - - xy 1 1 +213 TRANSPORT_TOD 0.72/0.60/0.55/0.53/0.53/0.55/0.61/0.93/1.42/1.43/1.21/1.12/1.10/1.16/1.22/1.23/1.30/1.52/1.54/1.26/1.03/0.87/0.81/0.81 - - - xy 1 1 +214 RESIDENTIAL_TOD 0.42/0.38/0.36/0.36/0.36/0.37/0.50/1.19/1.53/1.57/1.56/1.35/1.16/1.07/1.06/1.00/0.98/0.99/1.12/1.41/1.52/1.39/1.35/1.00 - - - xy 1 1 +215 AGRICULTURE_TOD 0.60/0.60/0.60/0.60/0.60/0.60/0.65/0.75/0.90/1.10/1.35/1.45/1.60/1.65/1.75/1.70/1.55/1.35/1.10/0.90/0.75/0.65/0.60/0.60 - - - xy 1 1 +216 AVERAGE_TOD 0.72/0.66/0.62/0.60/0.60/0.61/0.68/1.00/1.28/1.32/1.28/1.21/1.16/1.14/1.15/1.14/1.14/1.19/1.21/1.19/1.14/1.06/1.02/0.91 - - - xy 1 1 + +# +END SECTION SCALE FACTORS + +#################################################################################### +BEGIN SECTION MASKS +#################################################################################### +# +# ScalID Name sourceFile sourceVar sourceTime C/R/E SrcDim SrcUnit Oper Lon1/Lat1/Lon2/Lat2 +# +# Country/region masks +# +END SECTION MASKS + +### END OF HEMCO INPUT FILE ### diff --git a/HEMCO_GridComp/HEMCOgocart2g_Diagn.rc b/HEMCO_GridComp/HEMCOgocart2g_Diagn.rc index e9576863..5b3ea109 100644 --- a/HEMCO_GridComp/HEMCOgocart2g_Diagn.rc +++ b/HEMCO_GridComp/HEMCOgocart2g_Diagn.rc @@ -1,9 +1,20 @@ # This file defines the diagnostics to be written # out by the HEMCO standalone model # -# Name Spec ExtNr Cat Hier Dim Unit -OC_ISOPRENE ISOP 108 -1 -1 2 kgC/m2/s -OC_MTPA MTPA 108 -1 -1 2 kg/m2/s -OC_MTPO MTPO 108 -1 -1 2 kg/m2/s -OC_LIMO LIMO 108 -1 -1 2 kg/m2/s -OC_SESQ SESQ 108 -1 -1 2 kg/m2/s +# Name Spec ExtNr Cat Hier Dim Unit +OC_ISOPRENE ISOP 108 -1 -1 2 kgC/m2/s +OC_MTPA MTPA 108 -1 -1 2 kg/m2/s +OC_MTPO MTPO 108 -1 -1 2 kg/m2/s +OC_LIMO LIMO 108 -1 -1 2 kg/m2/s +OC_SESQ SESQ 108 -1 -1 2 kg/m2/s +SU_ANTHROL1 SO2 0 1 -1 2 kg/m2/s +SU_ANTHROL2 SO2 0 2 -1 2 kg/m2/s +SU_SHIPSO2 SO2 0 3 -1 2 kg/m2/s +SU_SHIPSO4 SO4 0 1 -1 2 kg/m2/s +OC_ANTEOC1 OC 0 1 -1 2 kg/m2/s +OC_ANTEOC2 OC 0 2 -1 2 kg/m2/s +OC_SHIP OC 0 3 -1 2 kg/m2/s +BC_ANTEBC1 BC 0 1 -1 2 kg/m2/s +BC_ANTEBC2 BC 0 2 -1 2 kg/m2/s +BC_SHIP BC 0 3 -1 2 kg/m2/s +EMI_NH3_EN NH3 0 1 -1 2 kg/m2/s diff --git a/HEMCO_GridComp/HEMCOgocart2g_ExtData.yaml b/HEMCO_GridComp/HEMCOgocart2g_ExtData.yaml index 8e6588df..4d20f2bd 100644 --- a/HEMCO_GridComp/HEMCOgocart2g_ExtData.yaml +++ b/HEMCO_GridComp/HEMCOgocart2g_ExtData.yaml @@ -5,6 +5,28 @@ Collections: template: ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc HEMCOgocart2g_NVOC.geos.1x1.esmf.nc: template: ExtData/chemistry/HEMCO/v0.0.0/sfc/NVOC.geos.1x1.esmf.nc + HEMCOgocart2g_BC-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/BC-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_BC-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/BC-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_BC-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/BC-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_OC-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/OC-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_OC-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/OC-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_OC-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/OC-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_SO2-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/SO2-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_SO2-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/SO2-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_SO2-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/SO2-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_SO4-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/SO4-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + HEMCOgocart2g_NH3-em-anthro_CMIP_CEDS_gn.x2304_y1441_t12.%y4.nc4: + template: ExtData/chemistry/CEDS/v2021-04-21-revised/sfc/NH3-em-anthro_CMIP_CEDS_gn.x2304_y1441_t12.%y4.nc4 Samplings: HEMCOgocart2g_sample_0: @@ -13,6 +35,10 @@ Samplings: extrapolation: clim update_frequency: P1M update_reference_time: '0' + HEMCOgocart2g_sample_2: + update_frequency: PT24H + update_offset: PT12H + update_reference_time: '0' Exports: CLM4_PFT_BARE: @@ -119,4 +145,59 @@ Exports: regrid: CONSERVE sample: HEMCOgocart2g_sample_1 variable: OCPI + GOCART_BC_ANTEBC1: + collection: HEMCOgocart2g_BC-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: bc_nonenergy + GOCART_BC_ANTEBC2: + collection: HEMCOgocart2g_BC-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: bc_energy + GOCART_BC_SHIP: + collection: HEMCOgocart2g_BC-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: bc_shipping + GOCART_OC_ANTEOC1: + collection: HEMCOgocart2g_OC-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: oc_nonenergy + GOCART_OC_ANTEOC2: + collection: HEMCOgocart2g_OC-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: oc_energy + GOCART_OC_SHIP: + collection: HEMCOgocart2g_OC-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: oc_shipping + GOCART_SU_ANTHROL1: + collection: HEMCOgocart2g_SO2-em-anthro_CMIP_CEDS_gn_nonenergy.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: so2_nonenergy + GOCART_SU_ANTHROL2: + collection: HEMCOgocart2g_SO2-em-anthro_CMIP_CEDS_gn_energy.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: so2_energy + GOCART_EMI_NH3_EN: + collection: HEMCOgocart2g_NH3-em-anthro_CMIP_CEDS_gn.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: nh3 + GOCART_SU_SHIPSO2: + collection: HEMCOgocart2g_SO2-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: so2_shipping + GOCART_SU_SHIPSO4: + collection: HEMCOgocart2g_SO4-em-anthro_CMIP_CEDS_gn_shipping.x2304_y1441_t12.%y4.nc4 + regrid: CONSERVE + sample: HEMCOgocart2g_sample_2 + variable: so4_shipping diff --git a/HEMCO_GridComp/HEMCOgocart2g_Spec.rc b/HEMCO_GridComp/HEMCOgocart2g_Spec.rc index 0bc2ae93..5b3f152d 100644 --- a/HEMCO_GridComp/HEMCOgocart2g_Spec.rc +++ b/HEMCO_GridComp/HEMCOgocart2g_Spec.rc @@ -22,3 +22,8 @@ 5 MTPO 136.23 136.23 1.0 0.0 0.0 0.0 6 SESQ 136.23 136.23 1.0 0.0 0.0 0.0 7 LIMO 136.23 136.23 1.0 0.0 0.0 0.0 +8 SO2 64.07 64.07 1.0 0.0 0.0 0.0 +9 OC 180.0 180.0 1.0 0.0 0.0 0.0 +10 NH3 17.03 17.03 1.0 0.0 0.0 0.0 +11 BC 180.0 180.0 1.0 0.0 0.0 0.0 +12 SO4 96.06 96.06 1.0 0.0 0.0 0.0 From 6b7486d8413551fc34d5ea11257c98fc68f8b65d Mon Sep 17 00:00:00 2001 From: acollow Date: Wed, 4 Jun 2025 08:28:50 -0400 Subject: [PATCH 2/4] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 760f0687..bcbd9090 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added +- anthropogenic emissions were added to HEMCO with connectivity to GOCART ### Removed ### Changed ### Fixed From 2b6a9a81c84162070b2129686b4523bb2b481f04 Mon Sep 17 00:00:00 2001 From: acollow Date: Wed, 4 Jun 2025 11:09:31 -0400 Subject: [PATCH 3/4] remove depracated rc file for ExtData --- HEMCO_GridComp/HEMCOgocart2g_ExtData.rc | 49 ------------------------- 1 file changed, 49 deletions(-) delete mode 100644 HEMCO_GridComp/HEMCOgocart2g_ExtData.rc diff --git a/HEMCO_GridComp/HEMCOgocart2g_ExtData.rc b/HEMCO_GridComp/HEMCOgocart2g_ExtData.rc deleted file mode 100644 index ca8fd474..00000000 --- a/HEMCO_GridComp/HEMCOgocart2g_ExtData.rc +++ /dev/null @@ -1,49 +0,0 @@ -# -Include%% -## -%% - -# -PrimaryExports%% -# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| -# Import | | | Regrid | Refresh | OffSet | Scale | Variable On | File | -# Name | Units | Clim | Method | Time Template | Factor | Factor | File | Template | -# -------------|-------|-------|--------|----------------------|--------|--------|-------------|----------| - -# --- MEGAN --- -MEGAN_AEF_ISOP 'kgC/m2/s' N Y - none none AEF_ISOPRENE ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -MEGAN_AEF_MBOX 'kgC/m2/s' N Y - none none AEF_MBO ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -MEGAN_AEF_BPIN 'kgC/m2/s' N Y - none none AEF_BETA_PINENE ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -MEGAN_AEF_CARE 'kgC/m2/s' N Y - none none AEF_CARENE ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -MEGAN_AEF_LIMO 'kgC/m2/s' N Y - none none AEF_LIMONENE ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -MEGAN_AEF_OCIM 'kgC/m2/s' N Y - none none AEF_OCIMENE ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -MEGAN_AEF_SABI 'kgC/m2/s' N Y - none none AEF_SABINENE ExtData/chemistry/HEMCO/v0.0.0/sfc/MEGAN2.1_EF.geos.025x03125.esmf.nc -CLM4_PFT_BARE '1' N N - none none PFT_BARE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_NDLF_EVGN_TMPT_TREE '1' N N - none none PFT_NDLF_EVGN_TMPT_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_NDLF_EVGN_BORL_TREE '1' N N - none none PFT_NDLF_EVGN_BORL_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_NDLF_DECD_BORL_TREE '1' N N - none none PFT_NDLF_DECD_BORL_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_EVGN_TROP_TREE '1' N N - none none PFT_BDLF_EVGN_TROP_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_EVGN_TMPT_TREE '1' N N - none none PFT_BDLF_EVGN_TMPT_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_DECD_TROP_TREE '1' N N - none none PFT_BDLF_DECD_TROP_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_DECD_TMPT_TREE '1' N N - none none PFT_BDLF_DECD_TMPT_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_DECD_BORL_TREE '1' N N - none none PFT_BDLF_DECD_BORL_TREE ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_EVGN_SHRB '1' N N - none none PFT_BDLF_EVGN_SHRB ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_DECD_TMPT_SHRB '1' N N - none none PFT_BDLF_DECD_TMPT_SHRB ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_BDLF_DECD_BORL_SHRB '1' N N - none none PFT_BDLF_DECD_BORL_SHRB ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_C3_ARCT_GRSS '1' N N - none none PFT_C3_ARCT_GRSS ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_C3_NARC_GRSS '1' N N - none none PFT_C3_NARC_GRSS ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_C4_GRSS '1' N N - none none PFT_C4_GRSS ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -CLM4_PFT_CROP '1' N N - none none PFT_CROP ExtData/chemistry/HEMCO/v0.0.0/sfc/CLM4_PFT.geos.025x03125.esmf.nc -MEGAN_ORVC 'kgC/m2/s' Y Y 1999-%m2-01T00:00:00 none none OCPI ExtData/chemistry/HEMCO/v0.0.0/sfc/NVOC.geos.1x1.esmf.nc - -# --- Mask --- -#TIMEZONES NA N V - none none UTC_OFFSET ExtData/chemistry/HEMCO/v0.0.0/sfc/timezones_esmf.2x25.nc -%% - -DerivedExports%% -# ---------|---------|--------------------------------------------| -# Export | Primary |_________________ Mask _____________________| -# Name | Name | Name | Expression | -# ---------|---------|------------|-------------------------------| -# ---------|---------|------------|-------------------------------| -%% From be6f0b6a04eafb7b2fa4bd7b4592a2c8474bcff2 Mon Sep 17 00:00:00 2001 From: acollow Date: Wed, 4 Jun 2025 12:47:39 -0400 Subject: [PATCH 4/4] fix conflicting GEOS_ChemGridComp --- GEOS_ChemGridComp.F90 | 141 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 131 insertions(+), 10 deletions(-) diff --git a/GEOS_ChemGridComp.F90 b/GEOS_ChemGridComp.F90 index 9cef0e37..2fd54a64 100644 --- a/GEOS_ChemGridComp.F90 +++ b/GEOS_ChemGridComp.F90 @@ -21,14 +21,15 @@ module GEOS_ChemGridCompMod use GEOS_ChemEnvGridCompMod, only : ChemEnv_SetServices => SetServices use GOCART_GridCompMod, only : GOCART_SetServices => SetServices use GOCART2G_GridCompMod, only : GOCART2G_SetServices => SetServices !GOCART REFACTOR + use RRG_GridCompMod, only : RRG_SetServices => SetServices !Carbon gases refactor use StratChem_GridCompMod, only : StratChem_SetServices => SetServices use GMIchem_GridCompMod, only : GMI_SetServices => SetServices use CARMAchem_GridCompMod, only : CARMA_SetServices => SetServices use GEOSCHEMchem_GridCompMod, only : GCChem_SetServices => SetServices - use MATRIXchem_GridCompMod, only : MATRIX_SetServices => SetServices - use MAMchem_GridCompMod, only : MAM_SetServices => SetServices + use MATRIX_GridCompMod, only : MATRIX_SetServices => SetServices + use MAM_GridCompMod, only : MAM_SetServices => SetServices use GEOS_PChemGridCompMod, only : PChem_SetServices => SetServices - use GEOS_AChemGridCompMod, only : AChem_SetServices => SetServices + use ACHEM_GridCompMod, only : AChem_SetServices => SetServices use GAAS_GridCompMod, only : GAAS_SetServices => SetServices use H2O_GridCompMod, only : H2O_SetServices => SetServices use TR_GridCompMod, only : TR_SetServices => SetServices @@ -54,6 +55,7 @@ module GEOS_ChemGridCompMod LOGICAL :: enable_GOCART LOGICAL :: enable_GOCARTdata LOGICAL :: enable_GOCART2G ! GOCART REFACTOR + LOGICAL :: enable_RRG ! Carbon gases refactor (MSL) LOGICAL :: enable_GAAS LOGICAL :: enable_H2O LOGICAL :: enable_STRATCHEM @@ -92,6 +94,7 @@ module GEOS_ChemGridCompMod integer :: ACHEM = -1 integer :: GOCART = -1 integer :: GOCART2G = -1 + integer :: RRG = -1 integer :: GOCARTdata = -1 integer :: GAAS = -1 integer :: H2O = -1 @@ -141,7 +144,7 @@ subroutine SetServices ( GC, RC ) type (ESMF_GridComp), pointer :: GCS(:) - integer :: I, RATS_PROVIDER, AERO_PROVIDER + integer :: I, J, RATS_PROVIDER, AERO_PROVIDER, OX_ID type (ESMF_Config), target :: CF, myCF integer :: n, id @@ -176,6 +179,11 @@ subroutine SetServices ( GC, RC ) logical :: GOCART_instance_of_HEMCO ! TRUE if HEMCO is running a GOCART instance logical :: GMI_instance_of_HEMCO ! TRUE if HEMCO is running a GMI instance +! For RATs diagnostics + character(LEN=ESMF_MAXSTR) :: RATsLabel, gen_str + character(len=ESMF_MAXSTR), allocatable :: nameRATS(:) + logical :: getout + !============================================================================= ! Begin... @@ -219,7 +227,8 @@ subroutine SetServices ( GC, RC ) call ESMF_ConfigGetAttribute(myCF, myState%enable_ACHEM, Default=.FALSE., Label="ENABLE_ACHEM:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCART, Default=.FALSE., Label="ENABLE_GOCART:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCARTdata, Default=.FALSE., Label="ENABLE_GOCART_DATA:", __RC__ ) - call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCART2G, Default=.FALSE., Label="ENABLE_GOCART2G:", __RC__ ) + call ESMF_ConfigGetAttribute(myCF, myState%enable_GOCART2G, Default=.FALSE., Label="ENABLE_GOCART2G:", __RC__ ) + call ESMF_ConfigGetAttribute(myCF, myState%enable_RRG, Default=.FALSE., Label="ENABLE_RRG:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_GAAS, Default=.FALSE., Label="ENABLE_GAAS:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_H2O, Default=.FALSE., Label="ENABLE_H2O:", __RC__ ) call ESMF_ConfigGetAttribute(myCF, myState%enable_STRATCHEM, Default=.FALSE., Label="ENABLE_STRATCHEM:", __RC__ ) @@ -254,6 +263,7 @@ subroutine SetServices ( GC, RC ) if (myState%enable_GOCART ) GOCART = MAPL_AddChild(GC, NAME= 'GOCART', SS=GOCART_SetServices, __RC__) if (myState%enable_GOCARTdata) GOCARTdata = MAPL_AddChild(GC, NAME= 'GOCART.data', SS=GOCART_SetServices, __RC__) if (myState%enable_GOCART2G ) GOCART2G = MAPL_AddChild(GC, NAME= 'GOCART2G', SS=GOCART2G_SetServices, __RC__) + if (myState%enable_RRG ) RRG = MAPL_AddChild(GC, NAME= 'RRG', SS=RRG_SetServices, __RC__) if (myState%enable_GAAS ) GAAS = MAPL_AddChild(GC, NAME= 'GAAS', SS=GAAS_SetServices, __RC__) if (myState%enable_H2O ) H2O = MAPL_AddChild(GC, NAME= 'H2O', SS=H2O_SetServices, __RC__) if (myState%enable_STRATCHEM ) STRATCHEM = MAPL_AddChild(GC, NAME= 'STRATCHEM', SS=StratChem_SetServices, __RC__) @@ -311,11 +321,101 @@ subroutine SetServices ( GC, RC ) ! Priority for first three RATs, OX, O3 and O3PPMV, goes to the ANALYSIS_OX_PROVIDER. ! ----------------------------------------------------------------------------------- - call GetProvider_(CF, Label='ANALYSIS_OX_PROVIDER:', ID=i, Name=providerName, Default='PCHEM', __RC__) + call GetProvider_(CF, Label='ANALYSIS_OX_PROVIDER:', ID=OX_ID, Name=providerName, Default='PCHEM', __RC__) - RATsProviderNumber(1:3) = i + RATsProviderNumber(1:3) = OX_ID RATsProviderName(1:3) = trim(providerName) +! Allow setting individual RAT sources via AGCM.rc + DO i = 1, numRATs + write(RATsLabel,'(a)') trim(speciesName(i))//'_PROVIDER:' + call ESMF_ConfigGetAttribute(CF, providerName, Default='none', Label=RATsLabel, __RC__) + call ESMF_ConfigFindLabel( CF,RATsLabel,rc=RC ) ! Godda reset! + n = ESMF_ConfigGetLen(CF,label=RATsLabel,rc=status) + if (ESMF_UtilStringLowerCase(trim(ProviderName)) .ne. 'none' .and. n .gt. 0) then ! If *_PROVIDER looks like a valid GridComp tag + call GetProvider_(CF, Label=trim(RATsLabel), ID=RATsProviderNumber(i), Name=providerName, Default=trim(RATsProviderName(i)), __RC__) ! + RATsProviderName(i) = trim(ProviderName) + if (MAPL_am_I_Root()) write(*,*) '<<>>: ', trim(speciesName(i))," Provider: ",trim(RATsProviderName(i)) + endif ! Else, don't change PROVIDER info set by RATS_PROVIDER + END DO + +! CO2 is not listed as a RAT, so add it here outside of the RATs code logic + ! -- get info from AGCM.rc + call ESMF_ConfigGetAttribute(CF, providerName, Default='None', & + Label="CO2_PROVIDER:", __RC__ ) + + str = trim(providerName) + str = ESMF_UtilStringLowerCase(str, __RC__) + + ! -- Make sure, if label is there, that it is an approved name. + if (trim(providerName) .ne. 'GOCART' .and. trim(str) .ne. 'none' .and. trim(providerName) .ne. 'RRG' .and. len_trim(providerName) .ne. 0) then + write(*,*) 'CHEM ERROR: CO2_PROVIDER can only be None, GOCART or RRG. It is ',trim(providerName) + RC = -1 + return + + ! -- else, if 'None', do nothing. + else if (trim(str) .eq. 'none') then + if (MAPL_am_I_root()) write(*,*) 'CHEM: CO2 is not added as a RAT from GOCART or RRG.' + + ! -- else, if GOCART or RRG, set up export + else if (trim(providerName) .eq. 'GOCART') then + CALL MAPL_AddExportSpec( GC, SHORT_NAME = 'CO2', & + CHILD_ID = GOCART, __RC__ ) + else if (trim(providerName) .eq. 'RRG' ) then + CALL MAPL_AddExportSpec( GC, SHORT_NAME = 'CO2', & + CHILD_ID = RRG, __RC__ ) + endif + + call ESMF_ConfigFindLabel(CF, 'RATS_DIAGNOSTICS:', RC=STATUS) ! Use STATUS to test if label was found + + n = 0 + IF (STATUS .eq. ESMF_SUCCESS) THEN + n = ESMF_ConfigGetLen(CF,label='RATS_DIAGNOSTICS:',RC=STATUS) + VERIFY_(STATUS) + ENDIF + + ! No error thrown. Just go around this if nothing learnable from config. + IF (STATUS .eq. ESMF_SUCCESS .and. n .ne. 0 ) THEN ! if the label was found... + + ! Get number of words in config line + n = ESMF_ConfigGetLen(CF,label='RATS_DIAGNOSTICS:',RC=STATUS) + VERIFY_(STATUS) + + allocate(nameRATS(n), STAT=STATUS) + VERIFY_(STATUS) + + ! Put the cursor at the label + call ESMF_ConfigFindLabel(CF, 'RATS_DIAGNOSTICS:', RC=STATUS) + VERIFY_(STATUS) + + ! Loop over RATS in list + DO i=1,n + call ESMF_ConfigGetAttribute(CF,gen_str,RC=STATUS) + VERIFY_(STATUS) + nameRATS(i) = trim(gen_str) + ENDDO + + DO i=1,n + + if (trim(nameRATs(i)) .eq. 'CO2') cycle ! Since CO2 isn't listed as a RAT in the species list + getout = .false. + DO j=1,numRATs + if (index(trim(speciesName(j)),trim(nameRATs(i))).gt.0) getout = .true. + ENDDO + if (getout) cycle + + CALL MAPL_AddExportSpec( GC, & + SHORT_NAME = trim(nameRATs(i)), & + CHILD_ID = RRG, RC=STATUS ) + VERIFY_(STATUS) + + ENDDO + + deallocate(nameRATs, STAT=STATUS) + VERIFY_(STATUS) + + ENDIF + ! Add export specs for the RATs ... ! --------------------------------- DO i = 1, numRATs @@ -450,6 +550,17 @@ subroutine SetServices ( GC, RC ) DST_ID = GOCART2G, SRC_ID = CHEMENV, __RC__ ) ENDIF + IF(myState%enable_RRG) then + CALL MAPL_AddConnectivity ( GC, & + SHORT_NAME = (/'DELP ', 'AIRDENS ' /), & + DST_ID = RRG, SRC_ID = CHEMENV, __RC__ ) + IF(myState%enable_PCHEM) then + CALL MAPL_AddConnectivity ( GC, & + SHORT_NAME = (/'O3'/), & + DST_ID = RRG, SRC_ID = PCHEM, __RC__ ) + ENDIF + ENDIF + IF(myState%enable_GAAS) then CALL MAPL_AddConnectivity ( GC, & SHORT_NAME = (/ 'AIRDENS ', 'DELP ' /), & @@ -494,8 +605,8 @@ subroutine SetServices ( GC, RC ) endif if(myState%enable_GMICHEM .AND. TRIM(providerName) == "CARMA") then CALL MAPL_AddConnectivity ( GC, & - SRC_NAME = (/ 'CARMA_SUSAREA '/), & - DST_NAME = (/ 'SO4SAREA '/), & + SRC_NAME = (/ 'CARMA_SUSAREA ', 'CARMA_SUREFF '/), & + DST_NAME = (/ 'SO4SAREA ', 'SO4REFF '/), & DST_ID = GMICHEM, SRC_ID = CARMA, __RC__) endif if(myState%enable_STRATCHEM .AND. TRIM(providerName) == "CARMA") then @@ -667,12 +778,20 @@ subroutine SetServices ( GC, RC ) ! --------------------------------- IF(myState%enable_GMICHEM .AND. TRIM(providerName) == "GOCART2G") THEN - IF(myState%enable_GOCART2G) & + IF(myState%enable_GOCART2G) THEN CALL MAPL_AddConnectivity ( GC, & SHORT_NAME = (/'AERO'/), & DST_ID = GMICHEM, SRC_ID = GOCART2G, __RC__ ) + ! ... For GOCART::SU,NI + ! --------------------- + CALL MAPL_AddConnectivity ( GC, & + SRC_NAME = (/ "OH ", "H2O2", "NO3 " /), & + DST_NAME = (/ "GMI_OH ", "GMI_H2O2", "GMI_NO3 " /), & + DST_ID=GOCART2G, SRC_ID=GMICHEM, __RC__) + + END IF END IF ! GOCART.data <=> GMICHEM coupling ... @@ -1460,6 +1579,8 @@ subroutine GetProvider_ ( CF, Label, ID, Name, Default, RC ) ID = TR case ('DNA') ID = DNA + case ('RRG') + ID = RRG case DEFAULT message = "unknown provider "//trim(name)