diff --git a/.circleci/config.yml b/.circleci/config.yml index dbd42c6d..c3925282 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,7 +2,7 @@ version: 2.1 # Anchors to prevent forgetting to update a version baselibs_version: &baselibs_version v7.7.0 -bcs_version: &bcs_version v10.23.0 +bcs_version: &bcs_version v11.00.0 orbs: ci: geos-esm/circleci-tools@1 diff --git a/CHANGELOG.md b/CHANGELOG.md index aee1bf9d..93d20f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,21 +8,31 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Fixed -- Made needed code changes in SS2G_GridCompMod.F90 and CA2G_GridCompMod.F90 to permit data instances of of GOCART aerosols to run + +- Made needed code changes in `SS2G_GridCompMod.F90` and `CA2G_GridCompMod.F90` to permit data instances of of GOCART aerosols to run - Added missing brown carbon (BR) climatology hooks to yaml and rc files for data driven instances -- Changed pointers to climatological deposition inputs in yaml and rc files to "/dev/null" since the files pointed to didn't provide them anyway, and in any case they are being used presently in the model -- Changed pointers to climatological nitrate inputs in yaml and rc files to "/dev/null" since pointing to FP files was inconsistent with MERRA-2 files used for other species +- Changed pointers to climatological deposition inputs in yaml and rc files to `/dev/null` since the files pointed to didn't provide them anyway, and in any case they are being used presently in the model +- Changed pointers to climatological nitrate inputs in yaml and rc files to `/dev/null` since pointing to FP files was inconsistent with MERRA-2 files used for other species - Ensured zero-diff in performance of yaml vs. rc files for ExtData2G vs. ExtData1g for data driven aerosols - To do: remove hooks to old (legacy) GOCART.data instances in CHEM and setup scripts - Fixed rc file in legacy O3 component. -- Fixed issue #223 where Global dimension was being used for allocating a local array -- This fixes a long standing issue that one can not start and stop the model in anything less than 3 hour increments to test start/stop regression because of GOCART. -- +- Fixed issue #223 where Global dimension was being used for allocating a local array +- Fix a long standing issue that one can not start and stop the model in anything less than 3 hour increments to test start/stop regression because of GOCART. + ### Added ### Changed -## [2.1.4] - 2023-05-04 +- Comment out ASSERT to allow `GOCART_DT` to not match the `HEARTBEAT_DT` +- Single-moment moist changes from Donifan +- Change names of microphysics schemes to match refactored physics +- Set `SS_SCALE` default to 0.0 +- Updates in CA2G for OpenMP +- Updates for CI + - Update BCs version + - Update components to match GEOSgcm v11.0.0 + +## [2.1.4] - 2023-05-12 ### Fixed @@ -32,10 +42,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - - Added `*` to CA State specs file to allow for ACG to substitute in the long name -- Changes were made so GOCART2G and its children can be run with component level -OpenMP threading. The key change is to create the data structure ThreadWorkspace +- Changes were made so GOCART2G and its children can be run with component level +OpenMP threading. The key change is to create the data structure ThreadWorkspace to hold variables that should be private to each thread to avoid race conditions. Additionally spatially distributed arrays that are not in any of the ESMF states were added to the ESMF internal state so they could be properly handled when @@ -45,8 +54,6 @@ option so they are not written to restart. - Aerosol single scattering backscatter coefficient for each instances and total at wavelengths_profile - Total (molecular + aerosols) attenuated backscatter coefficient from TOA and sfc at 532nm -### Fixed - ### Changed - Moved to use GitHub Action for label enforcement @@ -65,11 +72,6 @@ option so they are not written to restart. - Extinction/Scattering profile exports at model RH at wavelengths_profile - Extinction/Scattering profile exports with RH=20% and RH=80% at wavelengths_profile -### Fixed - -### Changed - - ## [2.1.1] - 2022-09-16 ### Fixed diff --git a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 index 5e7167f6..9e66db2b 100644 --- a/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/CA2G_GridComp/CA2G_GridCompMod.F90 @@ -3,7 +3,7 @@ !============================================================================= !BOP -! !MODULE: CA2G_GridCompMod - GOCART Carbonaceous Aerosol gridded component +! !MODULE: CA2G_GridCompMod - GOCART Carbonaceous Aerosol gridded component ! !INTERFACE: module CA2G_GridCompMod @@ -11,7 +11,7 @@ module CA2G_GridCompMod ! !USES: use ESMF use MAPL - use GOCART2G_MieMod + use GOCART2G_MieMod use Chem_AeroGeneric use iso_c_binding, only: c_loc, c_f_pointer, c_ptr @@ -61,7 +61,14 @@ module CA2G_GridCompMod logical :: doing_point_emissions = .false. character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions type(ThreadWorkspace), allocatable :: workspaces(:) - end type CA2G_GridComp + integer :: nPts = -1 + integer, allocatable, dimension(:) :: pstart, pend + real, allocatable, dimension(:) :: pLat, & + pLon, & + pBase, & + pTop, & + pEmis + end type CA2G_GridComp type wrap_ type (CA2G_GridComp), pointer :: PTR !=> null() @@ -72,7 +79,7 @@ module CA2G_GridCompMod !============================================================================ !BOP -! !IROUTINE: SetServices +! !IROUTINE: SetServices ! !INTERFACE: subroutine SetServices (GC, RC) @@ -83,11 +90,11 @@ subroutine SetServices (GC, RC) ! !DESCRIPTION: This version uses MAPL_GenericSetServices, which sets ! the Initialize and Finalize services to generic versions. It also -! allocates our instance of a generic state and puts it in the +! allocates our instance of a generic state and puts it in the ! gridded component (GC). Here we only set the two-stage run method ! and declare the data services. -! !REVISION HISTORY: +! !REVISION HISTORY: ! june2019 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring !EOP @@ -218,7 +225,7 @@ subroutine SetServices (GC, RC) units = 'kg kg-1', & restart = MAPL_RestartOptional, & dims = MAPL_DimsHorzVert, & - vlocation = MAPL_VLocationCenter, __RC__) + vlocation = MAPL_VLocationCenter, __RC__) call MAPL_AddInternalSpec(GC, & short_name = trim(comp_name)//'philic', & @@ -226,7 +233,7 @@ subroutine SetServices (GC, RC) units = 'kg kg-1', & restart = MAPL_RestartOptional, & dims = MAPL_DimsHorzVert, & - vlocation = MAPL_VLocationCenter, __RC__) + vlocation = MAPL_VLocationCenter, __RC__) call MAPL_AddImportSpec(GC, & short_name = 'clim'//trim(GCsuffix)//'phobic', & @@ -234,7 +241,7 @@ subroutine SetServices (GC, RC) units = 'kg kg-1', & restart = MAPL_RestartOptional, & dims = MAPL_DimsHorzVert, & - vlocation = MAPL_VLocationCenter, __RC__) + vlocation = MAPL_VLocationCenter, __RC__) call MAPL_AddImportSpec(GC, & short_name = 'clim'//trim(GCsuffix)//'philic', & @@ -255,7 +262,7 @@ subroutine SetServices (GC, RC) vlocation = MAPL_VLocationCenter, & restart = MAPL_RestartSkip, __RC__) -! !wet deposition +! !wet deposition call MAPL_AddImportSpec(GC, & short_name = 'clim'//trim(GCsuffix)//'WT'//trim(field_name), & long_name = 'Organic Carbon Mixing Ratio (bin '//trim(field_name)//')', & @@ -331,22 +338,22 @@ end subroutine SetServices !============================================================================ !BOP -! !IROUTINE: Initialize +! !IROUTINE: Initialize ! !INTERFACE: subroutine Initialize (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: This initializes CA's Grid Component. It primaryily fills -! GOCART's AERO states with its carbonaceous aerosol fields. +! !DESCRIPTION: This initializes CA's Grid Component. It primaryily fills +! GOCART's AERO states with its carbonaceous aerosol fields. -! !REVISION HISTORY: +! !REVISION HISTORY: ! june2019 E.Sherman First attempt at refactoring !EOP @@ -383,7 +390,7 @@ subroutine Initialize (GC, import, export, clock, RC) __Iam__('Initialize') !**************************************************************************** -! Begin... +! Begin... ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- @@ -443,7 +450,7 @@ subroutine Initialize (GC, import, export, clock, RC) call ESMF_ConfigLoadFile (cfg, 'CA2G_instance_'//trim(comp_name(1:5))//'.rc', __RC__) end if -! Call Generic Initialize +! Call Generic Initialize ! ------------------------ call MAPL_GenericInitialize (GC, import, export, clock, __RC__) @@ -457,7 +464,7 @@ subroutine Initialize (GC, import, export, clock, RC) ! If this is a data component, the data is provided in the import ! state via ExtData instead of the actual GOCART children -! ---------------------------------------------------------------- +! ---------------------------------------------------------------- if ( data_driven ) then providerState = import prefix = 'clim' @@ -590,13 +597,13 @@ end subroutine Initialize !============================================================================ !BOP -! !IROUTINE: Run +! !IROUTINE: Run ! !INTERFACE: subroutine Run (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 @@ -617,7 +624,7 @@ subroutine Run (GC, import, export, clock, rc) __Iam__('Run') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -650,13 +657,13 @@ end subroutine Run !============================================================================ !BOP -! !IROUTINE: Run1 +! !IROUTINE: Run1 ! !INTERFACE: 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 @@ -699,7 +706,7 @@ subroutine Run1 (GC, import, export, clock, RC) __Iam__('Run1') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -714,7 +721,7 @@ subroutine Run1 (GC, import, export, clock, RC) ! Get parameters from generic state. ! ----------------------------------- - call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, & + call MAPL_Get (mapl, INTERNAL_ESMF_STATE=internal, & LONS = LONS, & LATS = LATS, __RC__ ) @@ -725,7 +732,7 @@ subroutine Run1 (GC, import, export, clock, RC) else if (comp_name(1:5) == 'CA.bc') then GCsuffix = 'BC' else if (comp_name(1:5) == 'CA.br') then - GCsuffix = 'BR' + GCsuffix = 'BR' end if call MAPL_GetPointer (internal, intPtr_phobic, trim(comp_name)//'phobic', __RC__) @@ -786,7 +793,7 @@ subroutine Run1 (GC, import, export, clock, RC) aviation_cds_src = BC_AVIATION_CDS aviation_crs_src = BC_AVIATION_CRS allocate(biogvoc_src, mold=BC_BIOMASS, __STAT__) -! Black carbon has no biogvoc_src, so we set it to zero. +! Black carbon has no biogvoc_src, so we set it to zero. ! biogvoc_src is still needed for the call to CAEmissions, however it ! effectivly does nothing since we set all its values to zero. biogvoc_src = 0.0 @@ -889,14 +896,14 @@ end subroutine Run1 !============================================================================ !BOP -! !IROUTINE: Run2 +! !IROUTINE: Run2 ! !INTERFACE: 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 @@ -933,7 +940,7 @@ subroutine Run2 (GC, import, export, clock, RC) __Iam__('Run2') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -980,7 +987,7 @@ subroutine Run2 (GC, import, export, clock, RC) end if if (trim(comp_name) == 'CA.br') then - pSOA_VOC = pSOA_BIOB_VOC + pSOA_VOC = pSOA_BIOB_VOC where (1.01 * pSOA_VOC > MAPL_UNDEF) pSOA_VOC = 0.0 intPtr_philic = intPtr_philic + self%cdt * pSOA_VOC/airdens @@ -1089,13 +1096,13 @@ subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, 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_State), intent(inout) :: INTERNAL ! Interal state integer, optional, intent( out) :: RC ! Error code: -! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. !EOP !============================================================================ @@ -1112,7 +1119,7 @@ subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, RC) __Iam__('Run_data') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -1182,7 +1189,7 @@ subroutine aerosol_optics(state, rc) __Iam__('CA2G::aerosol_optics') -! Begin... +! Begin... ! Mie Table instance/index ! ------------------------ @@ -1199,7 +1206,7 @@ subroutine aerosol_optics(state, rc) band = 0 call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) @@ -1302,7 +1309,7 @@ subroutine mie_(mie, nbins, band, q, rh, bext_s, bssa_s, basym_s, rc) bext_s = bext_s + bext ! extinction bssa_s = bssa_s + (bssa*bext) ! scattering extinction - basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction end do @@ -1344,7 +1351,7 @@ subroutine monochromatic_aerosol_optics(state, rc) __Iam__('CA2G::monochromatic_aerosol_optics') -! Begin... +! Begin... ! Mie Table instance/index ! ------------------------ diff --git a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 index db6feff9..72f925d5 100644 --- a/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/DU2G_GridComp/DU2G_GridCompMod.F90 @@ -3,7 +3,7 @@ !============================================================================= !BOP -! !MODULE: DU2G_GridCompMod - GOCART refactoring of the DU gridded component +! !MODULE: DU2G_GridCompMod - GOCART refactoring of the DU gridded component ! !INTERFACE: module DU2G_GridCompMod @@ -11,7 +11,7 @@ module DU2G_GridCompMod ! !USES: use ESMF use MAPL - use GOCART2G_MieMod + use GOCART2G_MieMod use Chem_AeroGeneric use iso_c_binding, only: c_loc, c_f_pointer, c_ptr @@ -19,7 +19,7 @@ module DU2G_GridCompMod use GA_EnvironmentMod use MAPL_StringTemplate, only: StrTemplate !$ use omp_lib - + implicit none private @@ -62,7 +62,7 @@ module DU2G_GridCompMod real :: Ch_DU_res(NHRES) ! resolutions used for Ch_DU real :: Ch_DU ! dust emission tuning coefficient [kg s2 m-5]. logical :: maringFlag=.false. ! maring settling velocity correction - integer :: day_save = -1 + integer :: day_save = -1 character(len=:), allocatable :: emission_scheme ! emission scheme selector integer :: clayFlag ! clay and silt term in K14 real :: f_swc ! soil mosture scaling factor @@ -83,7 +83,7 @@ module DU2G_GridCompMod !============================================================================ !BOP -! !IROUTINE: SetServices +! !IROUTINE: SetServices ! !INTERFACE: subroutine SetServices (GC, RC) @@ -94,11 +94,11 @@ subroutine SetServices (GC, RC) ! !DESCRIPTION: This version uses MAPL_GenericSetServices, which sets ! the Initialize and Finalize services to generic versions. It also -! allocates our instance of a generic state and puts it in the +! allocates our instance of a generic state and puts it in the ! gridded component (GC). Here we only set the two-stage run method ! and declare the data services. -! !REVISION HISTORY: +! !REVISION HISTORY: ! 16oct2019 E.Sherman, A.Da Silva, A.Darmenov, T.Clune First attempt at refactoring !EOP @@ -245,7 +245,7 @@ subroutine SetServices (GC, RC) VLOCATION = MAPL_VLocationCenter, & RESTART = MAPL_RestartSkip, __RC__) - do i = 1, self%nbins + do i = 1, self%nbins write (field_name, '(A, I0.3)') '', i call MAPL_AddImportSpec(GC, & short_name = 'climdu'//trim(field_name), & @@ -264,7 +264,7 @@ subroutine SetServices (GC, RC) vlocation = MAPL_VLocationCenter, & restart = MAPL_RestartSkip, __RC__) -! !wet deposition +! !wet deposition call MAPL_AddImportSpec(GC, & short_name = 'climDUWT'//trim(field_name), & long_name = 'Dust Mixing Ratio (bin '//trim(field_name)//')', & @@ -340,22 +340,22 @@ end subroutine SetServices !============================================================================ !BOP -! !IROUTINE: Initialize +! !IROUTINE: Initialize ! !INTERFACE: subroutine Initialize (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: This initializes DU's Grid Component. It primaryily fills -! GOCART's AERO states with its dust fields. +! !DESCRIPTION: This initializes DU's Grid Component. It primaryily fills +! GOCART's AERO states with its dust fields. -! !REVISION HISTORY: +! !REVISION HISTORY: ! 16oct2019 E.Sherman, A.da Silva, T.Clune, A.Darmenov - First attempt at refactoring !EOP @@ -392,7 +392,7 @@ subroutine Initialize (GC, import, export, clock, RC) __Iam__('Initialize') !**************************************************************************** -! Begin... +! Begin... ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- @@ -430,7 +430,7 @@ subroutine Initialize (GC, import, export, clock, RC) ! Get DTs ! ------- - call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) + call MAPL_GetResource(mapl, HDT, Label='RUN_DT:', __RC__) call MAPL_GetResource(mapl, CDT, Label='GOCART_DT:', default=real(HDT), __RC__) self%CDT = CDT @@ -445,7 +445,7 @@ subroutine Initialize (GC, import, export, clock, RC) call ESMF_ConfigLoadFile (cfg, 'DU2G_instance_DU.rc', __RC__) end if -! Call Generic Initialize +! Call Generic Initialize ! ------------------------ call MAPL_GenericInitialize (GC, import, export, clock, __RC__) @@ -459,7 +459,7 @@ subroutine Initialize (GC, import, export, clock, RC) ! If this is a data component, the data is provided in the import ! state via ExtData instead of the actual GOCART children -! ---------------------------------------------------------------- +! ---------------------------------------------------------------- if ( data_driven ) then providerState = import prefix = 'clim' @@ -587,13 +587,13 @@ end subroutine Initialize !============================================================================ !BOP -! !IROUTINE: Run +! !IROUTINE: Run ! !INTERFACE: subroutine Run (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 @@ -614,7 +614,7 @@ subroutine Run (GC, import, export, clock, rc) __Iam__('Run') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -647,13 +647,13 @@ end subroutine Run !============================================================================ !BOP -! !IROUTINE: Run1 +! !IROUTINE: Run1 ! !INTERFACE: 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 @@ -698,7 +698,7 @@ subroutine Run1 (GC, import, export, clock, RC) __Iam__('Run1') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -871,14 +871,14 @@ end subroutine Run1 !============================================================================ !BOP -! !IROUTINE: Run2 +! !IROUTINE: Run2 ! !INTERFACE: 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 @@ -908,7 +908,7 @@ subroutine Run2 (GC, import, export, clock, RC) __Iam__('Run2') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -1002,8 +1002,8 @@ subroutine Run2 (GC, import, export, clock, RC) wavelengths_vertint=self%wavelengths_vertint*1.0e-9, aerosol=DU, & grav=MAPL_GRAV, tmpu=t, rhoa=airdens, & rh=rh20, u=u, v=v, delp=delp, ple=ple,tropp=tropp, & - extcoef = DUEXTCOEFRH20, scacoef = DUSCACOEFRH20, NO3nFlag=.False., __RC__) - + extcoef = DUEXTCOEFRH20, scacoef = DUSCACOEFRH20, NO3nFlag=.False., __RC__) + RH80(:,:,:) = 0.80 call Aero_Compute_Diags (mie=self%diag_Mie, km=self%km, klid=self%klid, nbegin=1, & @@ -1012,8 +1012,8 @@ subroutine Run2 (GC, import, export, clock, RC) wavelengths_vertint=self%wavelengths_vertint*1.0e-9, aerosol=DU, & grav=MAPL_GRAV, tmpu=t, rhoa=airdens, & rh=rh80, u=u, v=v, delp=delp, ple=ple,tropp=tropp, & - extcoef = DUEXTCOEFRH80, scacoef = DUSCACOEFRH80, NO3nFlag=.False., __RC__) - + extcoef = DUEXTCOEFRH80, scacoef = DUSCACOEFRH80, NO3nFlag=.False., __RC__) + deallocate(RH20,RH80) RETURN_(ESMF_SUCCESS) @@ -1027,13 +1027,13 @@ end subroutine Run2 subroutine Run_data (GC, import, export, internal, 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_State), intent(inout) :: internal ! Interal state integer, optional, intent( out) :: RC ! Error code: -! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. ! Locals character (len=ESMF_MAXSTR) :: COMP_NAME @@ -1050,7 +1050,7 @@ subroutine Run_data (GC, import, export, internal, RC) !EOP !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -1110,7 +1110,7 @@ subroutine aerosol_optics(state, rc) __Iam__('DU2G::aerosol_optics') -! Begin... +! Begin... ! Mie Table instance/index ! ------------------------ @@ -1121,7 +1121,7 @@ subroutine aerosol_optics(state, rc) band = 0 call ESMF_AttributeGet (state, name='band_for_aerosol_optics', value=band, __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet (state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer (state, ple, trim(fld_name), __RC__) @@ -1195,7 +1195,7 @@ subroutine aerosol_optics(state, rc) subroutine mie_(mie, nbins, band, q, rh, bext_s, bssa_s, basym_s, rc) implicit none - + type(GOCART2G_Mie), intent(inout) :: mie ! mie table integer, intent(in ) :: nbins ! number of bins integer, intent(in ) :: band ! channel @@ -1260,7 +1260,7 @@ subroutine monochromatic_aerosol_optics(state, rc) __Iam__('DU2G::monochromatic_aerosol_optics') -! Begin... +! Begin... ! Mie Table instance/index ! ------------------------ @@ -1271,7 +1271,7 @@ subroutine monochromatic_aerosol_optics(state, rc) wavelength = 0. call ESMF_AttributeGet (state, name='wavelength_for_aerosol_optics', value=wavelength, __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet (state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer (state, ple, trim(fld_name), __RC__) diff --git a/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 index 79baa616..58fce249 100644 --- a/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90 @@ -58,8 +58,8 @@ module GOCART2G_GridCompMod ! !DESCRIPTION: ! -! {\tt GOCART} is a gridded component from the GOCART model and includes -! dust, sea salt, sulfates, nitrate, organic and black carbon. +! {\tt GOCART} is a gridded component from the GOCART model and includes +! dust, sea salt, sulfates, nitrate, organic and black carbon. ! ! @@ -67,7 +67,7 @@ module GOCART2G_GridCompMod ! ! 25feb2005 da Silva First crack. ! 19jul2006 da Silva First separate GOCART component. -! 14Oct2019 E.Sherman, A.Darmenov, A. da Silva, T. Clune First attempt at refactoring. +! 14Oct2019 E.Sherman, A.Darmenov, A. da Silva, T. Clune First attempt at refactoring. ! !EOP !============================================================================ @@ -89,11 +89,11 @@ subroutine SetServices (GC, RC) ! !DESCRIPTION: This version uses MAPL_GenericSetServices, which sets ! the Initialize and Finalize services to generic versions. It also -! allocates our instance of a generic state and puts it in the +! allocates our instance of a generic state and puts it in the ! gridded component (GC). Here we only set the two-stage run method and ! declare the data services. -! !REVISION HISTORY: +! !REVISION HISTORY: ! 14oct2019 Sherman, da Silva, Darmenov, Clune - First attempt at refactoring for ESMF compatibility @@ -102,7 +102,7 @@ subroutine SetServices (GC, RC) !============================================================================ ! ! Locals - character (len=ESMF_MAXSTR) :: COMP_NAME + character (len=ESMF_MAXSTR) :: COMP_NAME type (ESMF_Config) :: myCF ! GOCART2G_GridComp.rc type (ESMF_Config) :: cf ! universal config type (GOCART_State), pointer :: self @@ -189,7 +189,7 @@ subroutine SetServices (GC, RC) ! Define EXPORT states -! This state is needed by radiation and moist. It contains +! This state is needed by radiation and moist. It contains ! aerosols and callback methods ! -------------------------------------------------------- call MAPL_AddExportSpec(GC, & @@ -215,7 +215,7 @@ subroutine SetServices (GC, RC) #include "GOCART2G_Import___.h" ! Add connectivities for Nitrate component -! Nitrate currently only supports one Nitrate component. Nitrate only +! Nitrate currently only supports one Nitrate component. Nitrate only ! uses the first active dust and sea salt instance. if (size(self%NI%instances) > 0) then if ((self%DU%instances(1)%is_active)) then @@ -255,7 +255,7 @@ end subroutine SetServices subroutine Initialize (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 @@ -264,13 +264,13 @@ subroutine Initialize (GC, import, export, clock, RC) ! !DESCRIPTION: This initializes the GOCART Grid Component. It primarily creates ! its exports and births its children. -! !REVISION HISTORY: +! !REVISION HISTORY: ! 14oct2019 E.Sherman First attempt at refactoring !EOP !============================================================================ -! Locals +! Locals character (len=ESMF_MAXSTR) :: COMP_NAME type (MAPL_MetaComp), pointer :: MAPL @@ -286,7 +286,7 @@ subroutine Initialize (GC, import, export, clock, RC) type (wrap_) :: wrap integer :: n_modes - integer, parameter :: n_gocart_modes = 14 + integer, parameter :: n_gocart_modes = 14 integer :: dims(3) character(len=ESMF_MAXSTR) :: aero_aci_modes(n_gocart_modes) @@ -296,7 +296,7 @@ subroutine Initialize (GC, import, export, clock, RC) __Iam__('Initialize') !**************************************************************************** -! Begin... +! Begin... ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- @@ -399,8 +399,8 @@ subroutine Initialize (GC, import, export, clock, RC) ! Attach the aerosol optics method. Used in Radiation. call ESMF_MethodAdd (aero, label='run_aerosol_optics', userRoutine=run_aerosol_optics, __RC__) - ! This attribute indicates if the aerosol optics method is implemented or not. - ! Radiation will not call the aerosol optics method unless this attribute is + ! This attribute indicates if the aerosol optics method is implemented or not. + ! Radiation will not call the aerosol optics method unless this attribute is ! explicitly set to true. call ESMF_AttributeSet(aero, name='implements_aerosol_optics_method', value=.true., __RC__) @@ -408,7 +408,7 @@ subroutine Initialize (GC, import, export, clock, RC) ! ------------------------------------------------------------ aero_aci_modes = (/'du001 ', 'du002 ', 'du003 ', & 'du004 ', 'du005 ', & - 'ss001 ', 'ss002 ', 'ss003 ', & + 'ss001 ', 'ss002 ', 'ss003 ', & 'sulforg01', 'sulforg02', 'sulforg03', & 'bcphilic ', 'ocphilic ', 'brcphilic'/) @@ -424,18 +424,9 @@ subroutine Initialize (GC, import, export, clock, RC) call ESMF_ConfigGetAttribute(CF, CCNtuning, default=1.8, label='CCNTUNING:', __RC__) call ESMF_AttributeSet(aero, name='ccn_tuning', value=CCNtuning, __RC__) - call ESMF_ConfigGetAttribute( CF, CLDMICRO, Label='CLDMICRO:', default="1MOMENT", RC=STATUS) + call ESMF_ConfigGetAttribute( CF, CLDMICRO, Label='CLDMICR_OPTION:', default="BACM_1M", RC=STATUS) call ESMF_AttributeSet(aero, name='cldmicro', value=CLDMICRO, __RC__) - ! scaling factor for sea salt - if(adjustl(CLDMICRO)=="2MOMENT") then - call ESMF_ConfigGetAttribute(CF, f_aci_seasalt, default=4.0, label='SS_SCALE:', __RC__) - call ESMF_AttributeSet(aero, name='seasalt_scaling_factor', value=f_aci_seasalt, __RC__) - else - call ESMF_ConfigGetAttribute(CF, f_aci_seasalt, default=14.0, label='SS_SCALE:', __RC__) - call ESMF_AttributeSet(aero, name='seasalt_scaling_factor', value=f_aci_seasalt, __RC__) - endif - ! Add variables to AERO state call add_aero (aero, label='air_temperature', label2='T', grid=grid, typekind=MAPL_R4, __RC__) call add_aero (aero, label='fraction_of_land_type', label2='FRLAND', grid=grid, typekind=MAPL_R4, __RC__) @@ -456,24 +447,24 @@ subroutine Initialize (GC, import, export, clock, RC) contains subroutine add_aero_states_(instances) - type(Instance), intent(in) :: instances(:) + type(Instance), intent(in) :: instances(:) type (ESMF_State) :: child_state type (ESMF_FieldBundle) :: child_bundle type (ESMF_Field), allocatable :: fieldList(:) - + integer :: i integer :: id integer :: fieldCount __Iam__('Initialize::add_aero_states_') - + do i = 1, size(instances) if (.not. instances(i)%is_active) cycle id = instances(i)%id - + call ESMF_GridCompGet (gcs(id), __RC__ ) call ESMF_StateGet (gex(id), trim(instances(i)%name)//'_AERO', child_state, __RC__) call ESMF_StateAdd (aero, [child_state], __RC__) - + if (instances(i)%name(1:2) /= 'NI') then call ESMF_StateGet (gex(id), trim(instances(i)%name)//'_AERO_DP', child_bundle, __RC__) call ESMF_FieldBundleGet (child_bundle, fieldCount=fieldCount, __RC__) @@ -490,7 +481,7 @@ end subroutine Initialize !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !BOP -! !IROUTINE: RUN -- Run method for GOCART2G +! !IROUTINE: RUN -- Run method for GOCART2G ! !INTERFACE: @@ -498,13 +489,13 @@ end subroutine Initialize 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 integer, optional, intent( out) :: RC ! Error code: -! !DESCRIPTION: Run method +! !DESCRIPTION: Run method !EOP !============================================================================ @@ -522,7 +513,7 @@ subroutine Run1 (GC, import, export, clock, RC) __Iam__('Run1') !**************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle @@ -558,7 +549,7 @@ end subroutine Run1 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 @@ -623,7 +614,7 @@ subroutine Run2 (GC, import, export, clock, RC) real, pointer, dimension(:,:,:,:) :: suscacoefrh20, suscacoefrh80 real, pointer, dimension(:,:,:,:) :: subckcoef real, pointer, dimension(:,:) :: suangstr, so4smass - real, pointer, dimension(:,:,:) :: bcexttau, bcstexttau, bcscatau, bcstscatau + real, pointer, dimension(:,:,:) :: bcexttau, bcstexttau, bcscatau, bcstscatau real, pointer, dimension(:,:,:,:) :: bcextcoef, bcscacoef real, pointer, dimension(:,:,:,:) :: bcextcoefrh20, bcextcoefrh80 real, pointer, dimension(:,:,:,:) :: bcscacoefrh20, bcscacoefrh80 @@ -649,7 +640,7 @@ subroutine Run2 (GC, import, export, clock, RC) real, allocatable :: tau_mol(:,:), tau_aer(:,:) real :: c1, c2, c3 real :: nifactor - real, parameter :: pi = 3.141529265 + real, parameter :: pi = 3.141529265 integer :: ind550, ind532 integer :: i1, i2, j1, j2, km, k,kk @@ -658,7 +649,7 @@ subroutine Run2 (GC, import, export, clock, RC) __Iam__('Run2') !**************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -731,7 +722,7 @@ subroutine Run2 (GC, import, export, clock, RC) if (ind550 == 0) then !$omp critical (G2G_1) - print*,trim(Iam),' : 550nm wavelengths is not present in GOCART2G_GridComp.rc.',& + print*,trim(Iam),' : 550nm wavelengths is not present in GOCART2G_GridComp.rc.',& ' Cannot produce TOTANGSTR variable without 550nm wavelength.' !$omp end critical (G2G_1) VERIFY_(100) @@ -780,7 +771,7 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totexttfm) .and. associated(duexttfm)) totexttfm(:,:,w) = totexttfm(:,:,w)+duexttfm(:,:,w) if(associated(totscatfm) .and. associated(duscatfm)) totscatfm(:,:,w) = totscatfm(:,:,w)+duscatfm(:,:,w) end do - + do w = 1, size(self%wavelengths_profile) if(associated(totextcoef) .and. associated(duextcoef)) totextcoef(:,:,:,w) = totextcoef(:,:,:,w)+duextcoef(:,:,:,w) if(associated(totextcoefrh20) .and. associated(duextcoefrh20)) totextcoefrh20(:,:,:,w) = totextcoefrh20(:,:,:,w)+duextcoefrh20(:,:,:,w) @@ -790,7 +781,7 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totscacoefrh80) .and. associated(duscacoefrh80)) totscacoefrh80(:,:,:,w) = totscacoefrh80(:,:,:,w)+duscacoefrh80(:,:,:,w) if(associated(totbckcoef) .and. associated(dubckcoef)) totbckcoef(:,:,:,w) = totbckcoef(:,:,:,w)+dubckcoef(:,:,:,w) end do - + call MAPL_GetPointer (gex(self%DU%instances(n)%id), dusmass, 'DUSMASS', __RC__) call MAPL_GetPointer (gex(self%DU%instances(n)%id), dusmass25, 'DUSMASS25', __RC__) if(associated(pm) .and. associated(dusmass)) pm = pm + dusmass @@ -804,7 +795,7 @@ subroutine Run2 (GC, import, export, clock, RC) tau1 = tau1 + duexttau(:,:,ind550)*exp(c1*duangstr) tau2 = tau2 + duexttau(:,:,ind550)*exp(c2*duangstr) end if - end if + end if end do ! Sea Salt @@ -848,7 +839,7 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totscacoefrh80) .and. associated(ssscacoefrh80)) totscacoefrh80(:,:,:,w) = totscacoefrh80(:,:,:,w)+ssscacoefrh80(:,:,:,w) if(associated(totbckcoef) .and. associated(ssbckcoef)) totbckcoef(:,:,:,w) = totbckcoef(:,:,:,w)+ssbckcoef(:,:,:,w) enddo - + call MAPL_GetPointer (gex(self%SS%instances(n)%id), sssmass, 'SSSMASS', __RC__) call MAPL_GetPointer (gex(self%SS%instances(n)%id), sssmass25, 'SSSMASS25', __RC__) if(associated(pm) .and. associated(sssmass)) pm = pm + sssmass @@ -906,7 +897,7 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totscacoefrh80) .and. associated(niscacoefrh80)) totscacoefrh80(:,:,:,w) = totscacoefrh80(:,:,:,w)+niscacoefrh80(:,:,:,w) if(associated(totbckcoef) .and. associated(nibckcoef)) totbckcoef(:,:,:,w) = totbckcoef(:,:,:,w)+nibckcoef(:,:,:,w) end do - + call MAPL_GetPointer (gex(self%NI%instances(n)%id), nismass, 'NISMASS', __RC__) call MAPL_GetPointer (gex(self%NI%instances(n)%id), nismass25, 'NISMASS25', __RC__) call MAPL_GetPointer (gex(self%NI%instances(n)%id), nh4smass, 'NH4SMASS', __RC__) @@ -966,7 +957,7 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totscacoefrh80) .and. associated(suscacoefrh80)) totscacoefrh80(:,:,:,w) = totscacoefrh80(:,:,:,w)+suscacoefrh80(:,:,:,w) if(associated(totbckcoef) .and. associated(subckcoef)) totbckcoef(:,:,:,w) = totbckcoef(:,:,:,w)+subckcoef(:,:,:,w) end do - + call MAPL_GetPointer (gex(self%SU%instances(n)%id), pso4, 'PSO4', __RC__) if(associated(pso4tot) .and. associated(pso4)) pso4tot = pso4tot + pso4 @@ -1067,22 +1058,22 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totexttfm) .and. associated(ocexttau)) totexttfm(:,:,w) = totexttfm(:,:,w)+ocexttau(:,:,w) if(associated(totscatfm) .and. associated(ocscatau)) totscatfm(:,:,w) = totscatfm(:,:,w)+ocscatau(:,:,w) end do - + do w = 1, size(self%wavelengths_profile) if(associated(totextcoef) .and. associated(ocextcoef)) totextcoef(:,:,:,w) = totextcoef(:,:,:,w)+ocextcoef(:,:,:,w) if(associated(totextcoefrh20) .and. associated(ocextcoefrh20)) totextcoefrh20(:,:,:,w) = totextcoefrh20(:,:,:,w)+ocextcoefrh20(:,:,:,w) if(associated(totextcoefrh80) .and. associated(ocextcoefrh80)) totextcoefrh80(:,:,:,w) = totextcoefrh80(:,:,:,w)+ocextcoefrh80(:,:,:,w) if(associated(totscacoef) .and. associated(ocscacoef)) totscacoef(:,:,:,w) = totscacoef(:,:,:,w)+ocscacoef(:,:,:,w) if(associated(totscacoefrh20) .and. associated(ocscacoefrh20)) totscacoefrh20(:,:,:,w) = totscacoefrh20(:,:,:,w)+ocscacoefrh20(:,:,:,w) - if(associated(totscacoefrh20) .and. associated(ocscacoefrh20)) totscacoefrh20(:,:,:,w) = totscacoefrh20(:,:,:,w)+ocscacoefrh20(:,:,:,w) + if(associated(totscacoefrh80) .and. associated(ocscacoefrh80)) totscacoefrh80(:,:,:,w) = totscacoefrh80(:,:,:,w)+ocscacoefrh80(:,:,:,w) if(associated(totbckcoef) .and. associated(ocbckcoef)) totbckcoef(:,:,:,w) = totbckcoef(:,:,:,w)+ocbckcoef(:,:,:,w) end do - + call MAPL_GetPointer (gex(self%CA%instances(n)%id), ocsmass, 'CA.ocSMASS', __RC__) if(associated(pm) .and. associated(ocsmass)) pm = pm + ocsmass if(associated(pm25) .and. associated(ocsmass)) pm25 = pm25 + ocsmass if(associated(pm_rh35) .and. associated(ocsmass)) pm_rh35 = pm_rh35 + 1.16*ocsmass ! needs to be revisited: OCpho + 1.16 OCphi - if(associated(pm25_rh35) .and. associated(ocsmass)) pm25_rh35 = pm25_rh35 + 1.16*ocsmass ! + if(associated(pm25_rh35) .and. associated(ocsmass)) pm25_rh35 = pm25_rh35 + 1.16*ocsmass ! if(associated(pm_rh50) .and. associated(ocsmass)) pm_rh50 = pm_rh50 + 1.24*ocsmass ! needs to be revisited: OCpho + 1.24 OCphi if(associated(pm25_rh50) .and. associated(ocsmass)) pm25_rh50 = pm25_rh50 + 1.24*ocsmass ! @@ -1127,12 +1118,12 @@ subroutine Run2 (GC, import, export, clock, RC) if(associated(totscacoefrh80) .and. associated(brscacoefrh80)) totscacoefrh80(:,:,:,w) = totscacoefrh80(:,:,:,w)+brscacoefrh80(:,:,:,w) if(associated(totbckcoef) .and. associated(brbckcoef)) totbckcoef(:,:,:,w) = totbckcoef(:,:,:,w)+brbckcoef(:,:,:,w) end do - + call MAPL_GetPointer (gex(self%CA%instances(n)%id), brsmass, 'CA.brSMASS', __RC__) if(associated(pm) .and. associated(brsmass)) pm = pm + brsmass if(associated(pm25) .and. associated(brsmass)) pm25 = pm25 + brsmass if(associated(pm_rh35) .and. associated(brsmass)) pm_rh35 = pm_rh35 + 1.16*brsmass ! needs to be revisited: OCpho + 1.16 OCphi - if(associated(pm25_rh35) .and. associated(brsmass)) pm25_rh35 = pm25_rh35 + 1.16*brsmass ! + if(associated(pm25_rh35) .and. associated(brsmass)) pm25_rh35 = pm25_rh35 + 1.16*brsmass ! if(associated(pm_rh50) .and. associated(brsmass)) pm_rh50 = pm_rh50 + 1.24*brsmass ! needs to be revisited: OCpho + 1.24 OCphi if(associated(pm25_rh50) .and. associated(brsmass)) pm25_rh50 = pm25_rh50 + 1.24*brsmass ! @@ -1144,7 +1135,7 @@ subroutine Run2 (GC, import, export, clock, RC) end do ! Finish calculating totangstr - if(associated(totangstr)) then + if(associated(totangstr)) then totangstr = log(tau1/tau2)/c3 end if @@ -1171,11 +1162,11 @@ subroutine Run2 (GC, import, export, clock, RC) VERIFY_(100) end if - ! Pressure at layer edges (ple shape (im,jm, km+1) on the edge + ! Pressure at layer edges (ple shape (im,jm, km+1) on the edge i1 = lbound(ple, 1); i2 = ubound(ple, 1) j1 = lbound(ple, 2); j2 = ubound(ple, 2) - km = ubound(ple, 3) ! km =72 index starts at 0 + km = ubound(ple, 3) ! km =72 index starts at 0 ! Pressure for each layer allocate(P(i1:i2,j1:j2,km), __STAT__) do k = 1, km @@ -1189,7 +1180,7 @@ subroutine Run2 (GC, import, export, clock, RC) ! tau mol for each layer allocate(tau_mol_layer(i1:i2,j1:j2,km), delz(i1:i2,j1:j2,km),__STAT__) delz = delp / (MAPL_GRAV * airdens) - tau_mol_layer = backscat_mol * 8.* pi /3. * delz + tau_mol_layer = backscat_mol * 8.* pi /3. * delz ! tau aer for each layer allocate(tau_aer_layer(i1:i2,j1:j2,km), __STAT__) @@ -1197,25 +1188,25 @@ subroutine Run2 (GC, import, export, clock, RC) allocate(tau_aer(i1:i2,j1:j2), __STAT__) allocate(tau_mol(i1:i2,j1:j2), __STAT__) - - ! TOTAL ABCK TOA - ! top layer + + ! TOTAL ABCK TOA + ! top layer totabcktoa(:,:,1) = (totbckcoef(:,:,1,ind532) + backscat_mol(:,:,1)) * exp(-tau_aer_layer(:,:,1)) * exp(-tau_mol_layer(:,:,1)) ! layer 2 to the layer at the surface(km) do k = 2, km tau_aer = 0. tau_mol = 0. ! for each layer - do kk = 1, k - tau_aer = tau_aer + tau_aer_layer(:,:,kk) - tau_mol = tau_mol + tau_mol_layer(:,:,kk) + do kk = 1, k + tau_aer = tau_aer + tau_aer_layer(:,:,kk) + tau_mol = tau_mol + tau_mol_layer(:,:,kk) enddo tau_aer = tau_aer + 0.5 * tau_aer_layer(:,:,k) tau_mol = tau_mol + 0.5 * tau_mol_layer(:,:,k) totabcktoa(:,:,k) = (totbckcoef(:,:,k,ind532) + backscat_mol(:,:,k)) * exp(-tau_aer) * exp(-tau_mol) enddo - - ! TOTAL ABCK SFC - ! bottom layer + + ! TOTAL ABCK SFC + ! bottom layer totabcksfc(:,:,km) = (totbckcoef(:,:,km,ind532) + backscat_mol(:,:,km)) * exp(-tau_aer_layer(:,:,km)) * exp(-tau_mol_layer(:,:,km)) ! layer 2nd from the surface to the top of the atmoshere (km) do k = km-1, 1, -1 @@ -1325,9 +1316,9 @@ subroutine createInstances_ (self, GC, rc) RETURN_(ESMF_SUCCESS) contains - + subroutine addChildren__ (gc, species, setServices, rc) - + type (ESMF_GridComp), intent(inout) :: gc type(Constituent), intent(inout) :: species external :: setServices @@ -1377,7 +1368,7 @@ subroutine serialize_bundle (state, rc) __Iam__('GOCART2G::serialize_bundle') -! !Description: Callback for AERO_RAD state used in GAAS module to provide a +! !Description: Callback for AERO_RAD state used in GAAS module to provide a ! serialized ESMF_Bundle of aerosol fields. !----------------------------------------------------------------------------------- ! Begin... @@ -1460,7 +1451,7 @@ subroutine run_aerosol_optics (state, rc) ! Description: Used in Radiation gridded components to provide aerosol properties !----------------------------------------------------------------------------------- -! Begin... +! Begin... ! Radiation band ! -------------- @@ -1471,7 +1462,7 @@ subroutine run_aerosol_optics (state, rc) call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, RH, trim(fld_name), __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, PLE, trim(fld_name), __RC__) @@ -1605,7 +1596,7 @@ subroutine aerosol_activation_properties(state, rc) ! Local ! --------- character(len=ESMF_MAXSTR) :: mode ! mode name - character(len=ESMF_MAXSTR) :: mode_ ! lowercase mode name + character(len=ESMF_MAXSTR) :: mode_ ! lowercase mode name type(ESMF_State) :: child_state @@ -1619,16 +1610,15 @@ subroutine aerosol_activation_properties(state, rc) real, dimension(:,:,:,:), pointer :: ptr_4d ! aerosol mass mixing ratio (temporary) real, dimension(:,:,:), pointer :: ptr_3d ! aerosol mass mixing ratio (temporary) - real, dimension(:,:,:), pointer :: num ! number concentration of aerosol particles + real, dimension(:,:,:), pointer :: num ! number concentration of aerosol particles real, dimension(:,:,:), pointer :: diameter ! dry size of aerosol real, dimension(:,:,:), pointer :: sigma ! width of aerosol mode real, dimension(:,:,:), pointer :: density ! density of aerosol - real, dimension(:,:,:), pointer :: hygroscopicity ! hygroscopicity of aerosol + real, dimension(:,:,:), pointer :: hygroscopicity ! hygroscopicity of aerosol real, dimension(:,:,:), pointer :: f_dust ! fraction of dust aerosol - real, dimension(:,:,:), pointer :: f_soot ! fraction of soot aerosol + real, dimension(:,:,:), pointer :: f_soot ! fraction of soot aerosol real, dimension(:,:,:), pointer :: f_organic ! fraction of organic aerosol - real :: ss_scale ! sea salt scaling factor real :: max_clean ! max mixing ratio before considered polluted real :: ccn_tuning ! tunes conversion factors for sulfate character(LEN=ESMF_MAXSTR) :: cld_micro @@ -1664,7 +1654,7 @@ subroutine aerosol_activation_properties(state, rc) __Iam__('GOCART2G::aerosol_activation_properties') -! Begin... +! Begin... ! Get list of child states within state and add to aeroList ! --------------------------------------------------------- @@ -1694,12 +1684,12 @@ subroutine aerosol_activation_properties(state, rc) ! ------------ call ESMF_AttributeGet(state, name='aerosol_mode', value=mode, __RC__) -! Land fraction +! Land fraction ! ------------- call ESMF_AttributeGet(state, name='fraction_of_land_type', value=fld_name, __RC__) call MAPL_GetPointer(state, f_land, trim(fld_name), __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) @@ -1741,7 +1731,6 @@ subroutine aerosol_activation_properties(state, rc) ! Sea salt scaling fctor ! ---------------------- - call ESMF_AttributeGet(state, name='seasalt_scaling_factor', value=ss_scale, __RC__) call ESMF_AttributeGet(state, name='max_q_clean', value=max_clean, __RC__) call ESMF_AttributeGet(state, name='cldmicro', value=cld_micro, __RC__) call ESMF_AttributeGet(state, name='ccn_tuning', value=ccn_tuning, __RC__) @@ -1772,7 +1761,7 @@ subroutine aerosol_activation_properties(state, rc) else if (index(mode_, 'ss00') > 0) then ! Sea Salt ! compute the total mass mixing ratio and impose a tri-modal size distribution do i = 1, size(aeroList) - if (index(aeroList(i), 'SS') > 0) then + if (index(aeroList(i), 'SS') > 0) then call ESMF_StateGet(state, trim(aeroList(i)), child_state, __RC__) call MAPL_GetPointer(child_state, ptr_4d, 'SS', __RC__) do j = 1, ubound(ptr_4d, 4) @@ -1780,14 +1769,6 @@ subroutine aerosol_activation_properties(state, rc) ptr_3d => ptr_4d(:,:,:,j) end do - ! temperature correction over the ocean - allocate(f(i2,j2, km), __STAT__) - call ocean_correction_(f, f_land, temperature(1:i2,1:j2,km), ss_scale, 1, i2, 1, j2, km) - - ! apply the correction factor - q = f * q - deallocate(f, __STAT__) - hygroscopicity = k_SS density = densSS end if @@ -1817,11 +1798,6 @@ subroutine aerosol_activation_properties(state, rc) density = densORG * ptr_3d + density end if - ! required by the aap_(...) - if((adjustl(cld_micro)/="2MOMENT") .and. (index(aeroList(i), 'SU') > 0)) then ! maintained for compatibility with the single moment - call ESMF_StateGet(state, trim(aeroList(i)), child_state, __RC__) - call MAPL_GetPointer(child_state, ptr_3d, 'SO4', __RC__) - end if end do where (q > 2.0e-12 .and. hygroscopicity > tiny(0.0)) @@ -1914,11 +1890,11 @@ subroutine aap_(mode, q, num, diameter, sigma, f_dust, f_soot, f_organic, dens_, real, intent(in), dimension(i1:i2,j1:j2,km) :: q_ ! auxiliary mass real, intent(in), dimension(i1:i2,j1:j2,km) :: dens_ ! density - real, intent(out), dimension(i1:i2,j1:j2,km) :: num ! number concentration of aerosol particles + real, intent(out), dimension(i1:i2,j1:j2,km) :: num ! number concentration of aerosol particles real, intent(out), dimension(i1:i2,j1:j2,km) :: diameter ! dry size of aerosol - real, intent(out), dimension(i1:i2,j1:j2,km) :: sigma ! width of aerosol mode + real, intent(out), dimension(i1:i2,j1:j2,km) :: sigma ! width of aerosol mode real, intent(out), dimension(i1:i2,j1:j2,km) :: f_dust ! fraction of dust aerosol - real, intent(out), dimension(i1:i2,j1:j2,km) :: f_soot ! fraction of soot aerosol + real, intent(out), dimension(i1:i2,j1:j2,km) :: f_soot ! fraction of soot aerosol real, intent(out), dimension(i1:i2,j1:j2,km) :: f_organic ! fraction of organic aerosol integer, intent(out) :: rc ! return code @@ -1947,22 +1923,10 @@ subroutine aap_(mode, q, num, diameter, sigma, f_dust, f_soot, f_organic, dens_, f_soot = 0.0 f_organic = 0.0 - if(adjustl(cld_micro)=="2MOMENT") then - qaux=q !this corrects a bug - else - qaux = q_ !keep it to get zero diff with the single moment - max_clean = 5.0e-7 - ccn_tuning = 1.0 - end if - + qaux=q !this corrects a bug if (index(mode_, 'ss00') > 0) then - if(adjustl(cld_micro)=="2MOMENT") then - TPI (1) = 230e6 ! num fraction (reduced 091015) - else - TPI (1) = 100e6 ! num fraction (reduced 091015) - end if - + TPI (1) = 230e6 ! num fraction (reduced 091015) DPGI (1) = 0.02e-6 ! modal diameter (m) SIGI (1) = log(1.6) ! geometric dispersion (sigma_g) ! accumulation @@ -2003,11 +1967,11 @@ subroutine aap_(mode, q, num, diameter, sigma, f_dust, f_soot, f_organic, dens_, ! fine TPIclean (1) = 1.0e9 ! total concentration (# m-3) DPGIclean (1) = 0.016e-6 ! modal diameter (m) - SIGIclean (1) = log(1.6) ! geometric dispersion (sigma_g) + SIGIclean (1) = log(1.6) ! geometric dispersion (sigma_g) ! accumulation TPIclean (2) = 8.0e8 ! total concentration (# m-3) DPGIclean (2) = 0.067e-6 ! modal diameter (m) - SIGIclean (2) = log(2.1) ! geometric dispersion (sigma_g) + SIGIclean (2) = log(2.1) ! geometric dispersion (sigma_g) !Coarse TPIclean (3) = 2.0e6 ! total concentration (# m-3) DPGIclean (3) = 0.93e-6 ! modal diameter (m) @@ -2074,7 +2038,7 @@ subroutine aap_(mode, q, num, diameter, sigma, f_dust, f_soot, f_organic, dens_, elsewhere sigma = SIGIclean(1) diameter = DPGIclean(1) - num = TPIclean(1) * qaux*ccn_tuning / (dens_*fmassclean) ! only sulfate + num = TPIclean(1) * qaux*ccn_tuning / (dens_*fmassclean) ! only sulfate end where case ('sulforg02') @@ -2127,44 +2091,6 @@ subroutine aap_(mode, q, num, diameter, sigma, f_dust, f_soot, f_organic, dens_, end subroutine aap_ - subroutine ocean_correction_(f, f_land, t_air_sfc, ss_scale, i1, i2, j1, j2, km) - - implicit none - - integer, intent(in) :: i1, i2 ! dimension bounds - integer, intent(in) :: j1, j2 ! ... // .. - integer, intent(in) :: km ! ... // .. - - real, intent(in ), dimension(i1:i2,j1:j2) :: f_land ! fraction of land - real, intent(in ), dimension(i1:i2,j1:j2) :: t_air_sfc ! air temperature in the surface model layer - real, intent(in ) :: ss_scale ! scaling factor for sea salt at low T - - real, intent(out), dimension(i1:i2,j1:j2, km) :: f ! correction factor - - ! local - integer :: i, j - real :: usurf - - f = 1.0 - - do j = j1, j2 - do i = i1, i2 - if (f_land(i,j) < 0.1) then !ocean - - if(adjustl(cld_micro) .ne."2MOMENT") then - usurf = max(min((t_air_sfc(i,j) - 285.0) / 2.0, 10.0), -10.0) !smooth transition around some T value - else - usurf = max(min((t_air_sfc(i,j) - 285.0) / 2.0, 30.0), -30.0) !smooth transition around some T value - end if - usurf = min(ss_scale / (1.0 + exp(usurf)), 20.0) - - f(i,j,:) = (1.0 + usurf) - end if - end do - end do - - end subroutine ocean_correction_ - end subroutine aerosol_activation_properties @@ -2201,7 +2127,7 @@ subroutine get_monochromatic_aop (state, rc) ! Description: Used in GAAS gridded component to provide aerosol properties !----------------------------------------------------------------------------------- -! Begin... +! Begin... ! Radiation band ! -------------- @@ -2212,7 +2138,7 @@ subroutine get_monochromatic_aop (state, rc) call ESMF_AttributeGet(state, name='relative_humidity_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, RH, trim(fld_name), __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, PLE, trim(fld_name), __RC__) @@ -2322,7 +2248,7 @@ subroutine get_mixRatioSum (state, rc) ! Description: Used in GAAS gridded component to provide sum of aerosol mixing ratio !-------------------------------------------------------------------------------------- -! Begin... +! Begin... call ESMF_AttributeGet(state, name='aerosolName', value=aeroName, __RC__) call ESMF_AttributeGet(state, name='im', value=im, __RC__) @@ -2450,7 +2376,7 @@ subroutine getAerosolSum (aeroToken, state, aeroList, aeroOut, rc) ! Begin... endInd = len_trim(aeroToken) - + aeroOut = 0.0 do i = 1, size(aeroList) if (trim(aeroList(i)(1:endInd)) == trim(aeroToken)) then diff --git a/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 index be3335b4..448ae57a 100644 --- a/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/NI2G_GridComp/NI2G_GridCompMod.F90 @@ -994,10 +994,9 @@ subroutine Run2 (GC, import, export, clock, RC) wavelengths_vertint=self%wavelengths_vertint*1.0e-9, aerosol=aerosol, & grav=MAPL_GRAV, tmpu=t, rhoa=airdens, & rh=rh20,u=u, v=v, delp=delp, ple=ple,tropp=tropp, & - - extcoef = NIEXTCOEFRH20, scacoef=NISCACOEFRH20, __RC__) + extcoef = NIEXTCOEFRH20, scacoef=NISCACOEFRH20, __RC__) ! Save local copy of HNO3 for first pass through run method regardless - + RH80(:,:,:) = 0.80 call Aero_Compute_Diags (mie=self%diag_Mie, km=self%km, klid=self%klid, nbegin=1, & nbins=3, & @@ -1006,10 +1005,10 @@ subroutine Run2 (GC, import, export, clock, RC) grav=MAPL_GRAV, tmpu=t, rhoa=airdens, & rh=rh80,u=u, v=v, delp=delp, ple=ple,tropp=tropp, & - extcoef = NIEXTCOEFRH80, scacoef=NISCACOEFRH80,__RC__) + extcoef = NIEXTCOEFRH80, scacoef=NISCACOEFRH80,__RC__) ! Save local copy of HNO3 for first pass through run method regardless - - deallocate(RH20,RH80) + + deallocate(RH20,RH80) RETURN_(ESMF_SUCCESS) diff --git a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 index 3bf8d5b3..6c4abc37 100644 --- a/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 +++ b/ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90 @@ -3,7 +3,7 @@ !============================================================================= !BOP -! !MODULE: SU2G_GridCompMod - GOCART refactoring of the SU gridded component +! !MODULE: SU2G_GridCompMod - GOCART refactoring of the SU gridded component ! !INTERFACE: module SU2G_GridCompMod @@ -11,7 +11,7 @@ module SU2G_GridCompMod ! !USES: use ESMF use MAPL - use GOCART2G_MieMod + use GOCART2G_MieMod use Chem_AeroGeneric use iso_c_binding, only: c_loc, c_f_pointer, c_ptr @@ -102,7 +102,7 @@ module SU2G_GridCompMod !============================================================================ !BOP -! !IROUTINE: SetServices +! !IROUTINE: SetServices ! !INTERFACE: subroutine SetServices ( GC, RC ) @@ -113,7 +113,7 @@ subroutine SetServices ( GC, RC ) ! DESCRIPTION: This version uses MAPL_GenericSetServices, which sets ! the Initialize and Finalize services to generic versions. It also -! allocates our instance of a generic state and puts it in the +! allocates our instance of a generic state and puts it in the ! gridded component (GC). Here we only set the two-stage run method ! and declare the data services. @@ -205,7 +205,7 @@ subroutine SetServices ( GC, RC ) DEFVAL = 0.0 -! Import and Internal states if data instance +! Import and Internal states if data instance ! ------------------------------------------- if (data_driven) then @@ -245,7 +245,7 @@ subroutine SetServices ( GC, RC ) units='kg kg-1', & dims=MAPL_DimsHorzVert, & vlocation=MAPL_VlocationCenter, & - restart=MAPL_RestartOptional, __RC__) + restart=MAPL_RestartOptional, __RC__) do i = 1, self%nbins write(field_name, '(A, I0.3)') '', i @@ -258,7 +258,7 @@ subroutine SetServices ( GC, RC ) VLOCATION = MAPL_VLocationCenter, & RESTART = MAPL_RestartSkip, __RC__) -! ! wet deposition +! ! wet deposition call MAPL_AddImportSpec(GC, & SHORT_NAME = 'climSUWT'//trim(field_name), & LONG_NAME = 'Sulfate wet deposition (bin '//trim(field_name)//')', & @@ -295,7 +295,7 @@ subroutine SetServices ( GC, RC ) UNITS = '1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, & - RESTART = MAPL_RestartSkip, __RC__) + RESTART = MAPL_RestartSkip, __RC__) call MAPL_AddImportSpec(GC, & SHORT_NAME = 'SU_OH', & @@ -303,7 +303,7 @@ subroutine SetServices ( GC, RC ) UNITS = '1', & DIMS = MAPL_DimsHorzVert, & VLOCATION = MAPL_VLocationCenter, & - RESTART = MAPL_RestartSkip, __RC__) + RESTART = MAPL_RestartSkip, __RC__) call MAPL_AddImportSpec(GC, & SHORT_NAME = 'SU_NO3', & @@ -314,7 +314,7 @@ subroutine SetServices ( GC, RC ) RESTART = MAPL_RestartSkip, __RC__) end if -! Import, Export, Internal states for computational instance +! Import, Export, Internal states for computational instance ! ---------------------------------------------------------- if (.not. data_driven) then #include "SU2G_Export___.h" @@ -359,26 +359,26 @@ end subroutine SetServices !============================================================================ !BOP -! !IROUTINE: Initialize +! !IROUTINE: Initialize ! !INTERFACE: subroutine Initialize (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: This initializes SU Grid Component. +! !DESCRIPTION: This initializes SU Grid Component. -! !REVISION HISTORY: +! !REVISION HISTORY: ! 08July2019 E.Sherman First attempt at refactoring !EOP !============================================================================ -! !Locals +! !Locals character (len=ESMF_MAXSTR) :: COMP_NAME type (MAPL_MetaComp), pointer :: MAPL type (ESMF_Grid) :: grid @@ -419,7 +419,7 @@ subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC) __Iam__('Initialize') !**************************************************************************** -! Begin... +! Begin... ! Get the target components name and set-up traceback handle. ! ----------------------------------------------------------- @@ -470,7 +470,7 @@ subroutine Initialize (GC, IMPORT, EXPORT, CLOCK, RC) call ESMF_ConfigLoadFile (cfg, 'SU2G_instance_SU.rc', __RC__) end if -! Call Generic Initialize +! Call Generic Initialize ! ---------------------------------------- call MAPL_GenericInitialize (GC, import, export, clock, __RC__) @@ -624,13 +624,13 @@ end subroutine Initialize !============================================================================ !BOP -! !IROUTINE: Run +! !IROUTINE: Run ! !INTERFACE: subroutine Run (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 @@ -651,7 +651,7 @@ subroutine Run (GC, import, export, clock, rc) __Iam__('Run') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -684,13 +684,13 @@ end subroutine Run !============================================================================ !BOP -! !IROUTINE: Run1 +! !IROUTINE: Run1 ! !INTERFACE: 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 @@ -732,7 +732,7 @@ subroutine Run1 (GC, import, export, clock, RC) __Iam__('Run1') !***************************************************************************** -! Begin... +! Begin... nullify(dummyMSA) @@ -879,9 +879,9 @@ subroutine Run1 (GC, import, export, clock, RC) self%aviation_layers, & aviation_lto_src, & aviation_cds_src, & - aviation_crs_src, __RC__) + aviation_crs_src, __RC__) - if (associated(dms)) then + if (associated(dms)) then call DMSemission (self%km, self%cdt, MAPL_GRAV, t, u10m, v10m, lwi, delp, & fMassDMS, SU_DMSO, dms, SUEM, nDMS, __RC__) end if @@ -925,7 +925,7 @@ subroutine Run1 (GC, import, export, clock, RC) call updatePointwiseEmissions (self%km, workspace%pBase, workspace%pTop, workspace%pEmis, workspace%nPts, & workspace%pStart, workspace%pEnd, zle, & area, iPoint, jPoint, nhms, emissions_point, __RC__) - + SO4 = SO4 + self%cdt * MAPL_GRAV / delp * emissions_point end if @@ -935,14 +935,14 @@ end subroutine Run1 !============================================================================ !BOP -! !IROUTINE: Run2 +! !IROUTINE: Run2 ! !INTERFACE: 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 @@ -972,8 +972,9 @@ subroutine Run2 (GC, import, export, clock, RC) real, dimension(:,:,:), allocatable :: xoh, xno3, xh2o2 real, dimension(:,:), allocatable :: drydepositionf + real, pointer, dimension(:,:,:) :: dummyMSA !=> null() ! this is so the model can run without MSA enabled - logical :: alarm_is_ringing + logical :: alarm_is_ringing type(ThreadWorkspace), pointer :: workspace integer :: thread integer :: i1, j1, i2, j2, km @@ -984,7 +985,7 @@ subroutine Run2 (GC, import, export, clock, RC) __Iam__('Run2') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -1003,9 +1004,9 @@ subroutine Run2 (GC, import, export, clock, RC) LATS = LATS, __RC__ ) #include "SU2G_GetPointer___.h" - + call MAPL_GetPointer(internal, dummyMSA, 'MSA', rc=status) - + ! Extract nymd(yyyymmdd) from clock ! --------------------------------- call ESMF_ClockGet (clock, currTime=time, __RC__) @@ -1040,7 +1041,7 @@ subroutine Run2 (GC, import, export, clock, RC) !workspace%firstRun = .false. !end if - xh2o2 = h2o2_init + xh2o2 = h2o2_init call SulfateUpdateOxidants (nymd, nhms, LONS, LATS, airdens, self%km, self%cdt, & workspace%nymd_oxidants, MAPL_UNDEF, real(MAPL_RADIANS_TO_DEGREES), & @@ -1107,7 +1108,7 @@ subroutine Run2 (GC, import, export, clock, RC) allocate(RH80(i1:i2,j1:j2,km), __STAT__) RH20(:,:,:) = 0.20 - call SU_Compute_Diags ( km=self%km, klid=self%klid, rmed=self%radius(nSO4), sigma=self%sigma(nSO4),& + call SU_Compute_Diags ( km=self%km, klid=self%klid, rmed=self%radius(nSO4), sigma=self%sigma(nSO4),& rhop=self%rhop(nSO4), & grav=MAPL_GRAV, pi=MAPL_PI, nSO4=nSO4, mie=self%diag_Mie, & wavelengths_profile=self%wavelengths_profile*1.0e-9, & @@ -1117,7 +1118,7 @@ subroutine Run2 (GC, import, export, clock, RC) scacoef = SUSCACOEFRH20, __RC__) RH80(:,:,:) = 0.80 - call SU_Compute_Diags ( km=self%km, klid=self%klid, rmed=self%radius(nSO4), sigma=self%sigma(nSO4),& + call SU_Compute_Diags ( km=self%km, klid=self%klid, rmed=self%radius(nSO4), sigma=self%sigma(nSO4),& rhop=self%rhop(nSO4), & grav=MAPL_GRAV, pi=MAPL_PI, nSO4=nSO4, mie=self%diag_Mie, & wavelengths_profile=self%wavelengths_profile*1.0e-9, & @@ -1141,13 +1142,13 @@ subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, 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_State), intent(inout) :: INTERNAL ! Interal state integer, optional, intent( out) :: RC ! Error code: -! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. +! !DESCRIPTION: Updates pointers in Internal state with fields from ExtData. !EOP !============================================================================ @@ -1161,7 +1162,7 @@ subroutine Run_data (GC, IMPORT, EXPORT, INTERNAL, RC) __Iam__('Run_data') !***************************************************************************** -! Begin... +! Begin... ! Get my name and set-up traceback handle ! --------------------------------------- @@ -1219,7 +1220,7 @@ subroutine aerosol_optics(state, rc) __Iam__('SU2G::aerosol_optics') -! Begin... +! Begin... ! Mie Table instance/index ! ------------------------ @@ -1236,7 +1237,7 @@ subroutine aerosol_optics(state, rc) band = 0 call ESMF_AttributeGet(state, name='band_for_aerosol_optics', value=band, __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) @@ -1340,7 +1341,7 @@ subroutine mie_(mie, nbins, band, q, rh, bext_s, bssa_s, basym_s, rc) bext_s = bext_s + bext ! extinction bssa_s = bssa_s + (bssa*bext) ! scattering extinction - basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction + basym_s = basym_s + gasym*(bssa*bext) ! asymetry parameter multiplied by scatering extiction end do @@ -1382,7 +1383,7 @@ subroutine monochromatic_aerosol_optics(state, rc) __Iam__('SU2G::monochromatic_aerosol_optics') -! Begin... +! Begin... ! Mie Table instance/index ! ------------------------ @@ -1399,7 +1400,7 @@ subroutine monochromatic_aerosol_optics(state, rc) call ESMF_AttributeGet(state, name='wavelength_for_aerosol_optics', value=wavelength, __RC__) -! Pressure at layer edges +! Pressure at layer edges ! ------------------------ call ESMF_AttributeGet(state, name='air_pressure_for_aerosol_optics', value=fld_name, __RC__) call MAPL_GetPointer(state, ple, trim(fld_name), __RC__) @@ -1494,4 +1495,4 @@ function daily_alarm(clock,freq,rc) result(is_ringing) _RETURN(_SUCCESS) end function -end module SU2G_GridCompMod +end module SU2G_GridCompMod diff --git a/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 b/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 index 7d872e15..f24add8e 100644 --- a/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 +++ b/ESMF/GOCART_GridComp/GOCART_GridCompMod.F90 @@ -1162,7 +1162,7 @@ subroutine Run1_ ( gc, impChem, expChem, clock, rc ) ! ---------------------------------------------------------------------------------------- ! Assume that DT is always an integral number of seconds ! Add a fraction to both (and then truncate to int), to avoid cases like 900 /= 899.999999 - _ASSERT(abs(cdt-hdt) < 0.1, 'Implementation of GOCART_DT is problematic; set GOCART_DT = HEARTBEAT_DT') +!! _ASSERT(abs(cdt-hdt) < 0.1, 'Implementation of GOCART_DT is problematic; set GOCART_DT = HEARTBEAT_DT') allocate(r4ZTH(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) allocate( ZTH(SIZE(LATS,1), SIZE(LATS,2)), __STAT__) diff --git a/components.yaml b/components.yaml index 715bcea1..81aa3128 100644 --- a/components.yaml +++ b/components.yaml @@ -5,13 +5,13 @@ GOCART: env: local: ./env@ remote: ../ESMA_env.git - tag: v4.8.0 + tag: v4.9.1 develop: main cmake: local: ./cmake@ remote: ../ESMA_cmake.git - tag: v3.24.0 + tag: v3.28.0 develop: develop ecbuild: @@ -22,17 +22,18 @@ ecbuild: HEMCO: local: ./ESMF/HEMCO_GridComp@ remote: ../HEMCO.git - branch: geos/v2.2.3 + tag: geos/v2.2.3 + develop: geos/develop GMAO_Shared: local: ./ESMF/Shared/GMAO_Shared@ remote: ../GMAO_Shared.git - tag: v1.6.3 + tag: v1.9.0 sparse: ./config/GMAO_Shared.sparse develop: main MAPL: local: ./ESMF/Shared/MAPL@ remote: ../MAPL.git - tag: v2.34.0 + tag: v2.38.1 develop: develop