Skip to content

Commit

Permalink
Merge branch 'develop' into feature/mathomp4/update-esmf-target
Browse files Browse the repository at this point in the history
  • Loading branch information
mathomp4 authored Aug 15, 2024
2 parents fc2d0bb + 1f5ef3a commit d07a000
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 39 deletions.
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Removed all ExtData.rc files

### Changed

- Modified the file paths in carbon, sulfate, and nitrate ExtData.yaml files to used the revised version of the CEDS anthropogenic emissions. Note the previous version has an incorrect seasonal cycle.


### Fixed

- Use 'CA' component name to identify carbonaceous contributions to PM in UFS diagnostic calculations. These contributions were missing due to changes in field names.
Expand All @@ -23,13 +28,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Required attributes for the 2D GOCART export fields in AERO_DP bundle have been set in subroutine append_to_bundle in Chem_AeroGeneric.F90. These export fields are imported by OBIO via Surface GC, and the missing of the attributes was causing the writing of surface import checkpoint to fail. The issue has been explained in detail on https://github.com/GEOS-ESM/GOCART/issues/258

- Additional tuning parameters for the soil moisture and drylimit calculations for application specific tuning.
- Required attributes for the 2D GOCART export fields in AERO_DP bundle have been set in subroutine append_to_bundle in Chem_AeroGeneric.F90. These export fields are imported by OBIO via Surface GC, and the missing of the attributes was causing the writing of surface import checkpoint to fail. The issue has been explained in detail on https://github.com/GEOS-ESM/GOCART/issues/258

### Changed
- Added export line to GOCART2G_GridCompMod to couple allow use of GOCART
SU sulfate production tendency elsewhere in Chemistry, specifically for
CARMA

- Update ESMF CMake target to `ESMF::ESMF`
- Modified the file paths in carbon, sulfate, and nitrate ExtData.yaml files to used the revised version of the CEDS anthropogenic emissions. Note the previous version has an incorrect seasonal cycle.

- Changed SU2G_instance_SU.rc to now have separate filename inputs for explosive and degassing volcanoes
- Moved present volcanic emission inventories to one or the other line for these new entries; set other
line /dev/null; this is stop gap until next time we update volcanic emission inventories, at which
point will provide (for AMIP and AMIP.20C) separate explosive and degassing emissions
- Made accommodating changes for above in SU2G_GridCompMod.F90 and in the Process Library
- Verified zero diff in current configuration (this is true of tracers and restarts, but not diagnostics:
until an actual split is made in the input emissions then the volcanic emissions are being assigned to
one or the other emission diagnostics (explosive or degassing).

- Changed Chem_SettlingSimple in the process library to call Mie Query for radius and rhop inputs to the settling velocity calculation. The calls to Chem_SettlingSimple were then changed accordingly in each of the species' grid comps. Since the RH flag is no longer needed, it was removed from GA_EnvironmentMod.F90 and each of the instance RC files.
- State Spec RC files for GOCART2G, CA, DU, NI, SU, and SS were updated such that the long names for AOD are more intuitive
- Modified ExtData.yaml files to persist as climatological anthropogenic emissions after the end of the CEDS dataset in 2019. Analogous rc files removed as this capability is only available with ExtData2G
Expand Down Expand Up @@ -67,8 +86,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix issue with scattering coefficient calculation with oc
- 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

- Comment out ASSERT to allow `GOCART_DT` to not match the `HEARTBEAT_DT`
Expand Down
3 changes: 3 additions & 0 deletions ESMF/GOCART2G_GridComp/GOCART2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,9 @@ subroutine SetServices (GC, RC)
#include "GOCART2G_Export___.h"
#include "GOCART2G_Import___.h"

! Allow children of Chemistry to connect to these fields
if ((self%SU%instances(1)%is_active)) call MAPL_AddExportSpec (GC, SHORT_NAME='PSO4', CHILD_ID=self%SU%instances(1)%id, __RC__)

! Add connectivities for Nitrate component
! Nitrate currently only supports one Nitrate component. Nitrate only
! uses the first active dust and sea salt instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ aerosol_monochromatic_optics_file: ExtData/chemistry/AerosolOptics/v0.0.0/x/opti
nbins: 4

# Volcanic pointwise sources
volcano_srcfilen: ExtData/chemistry/CARN/v202106/sfc/so2_volcanic_emissions_Carns.%y4%m2%d2.rc
volcano_srcfilen_explosive: ExtData/chemistry/CARN/v202401/explosive/so2_explosive_volcanic_emissions_CARN_v202401.%y4%m2%d2.rc
volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/so2_volcanic_emissions_CARN_v202401.degassing_only.rc

# Heights [m] of LTO, CDS and CRS aviation emissions layers
aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ aerosol_monochromatic_optics_file: ExtData/chemistry/AerosolOptics/v0.0.0/x/opti
nbins: 4

# Volcanic pointwise sources
volcano_srcfilen: ExtData/chemistry/CARN/v202106/sfc/so2_volcanic_emissions_Carns.%y4%m2%d2.rc
volcano_srcfilen_explosive: ExtData/chemistry/CARN/v202401/explosive/so2_explosive_volcanic_emissions_CARN_v202401.%y4%m2%d2.rc
volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/so2_volcanic_emissions_CARN_v202401.degassing_only.rc

# Heights [m] of LTO, CDS and CRS aviation emissions layers
aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3
Expand Down
85 changes: 69 additions & 16 deletions ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_GridCompMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ module SU2G_GridCompMod
!===========================================================================
! !Sulfer state
type :: ThreadWorkspace
integer :: nymd_last = -1 ! Previous nymd. Updated daily

! Degassing volcanoes
integer :: nVolc = 0
real, allocatable, dimension(:) :: vLat, &
vLon, &
Expand All @@ -63,7 +66,17 @@ module SU2G_GridCompMod
vCloud
integer, allocatable, dimension(:) :: vStart, &
vEnd
integer :: nymd_last = -1 ! Previous nymd. Updated daily
! Explosive volcanoes
integer :: nVolcE = 0
real, allocatable, dimension(:) :: vLatE, &
vLonE, &
vSO2E, &
vElevE, &
vCloudE
integer, allocatable, dimension(:) :: vStartE, &
vEndE

! Other point emissions of Sulfate (SO4)
integer :: nPts = -1
integer, allocatable, dimension(:) :: pstart, pend
real, allocatable, dimension(:) :: pLat, &
Expand All @@ -87,8 +100,10 @@ module SU2G_GridCompMod
!real, pointer :: h2o2_init(:,:,:)

! Special handling for volcanic emissions
character(len=255) :: volcano_srcfilen
! !Workspae for point emissions
character(len=255) :: volcano_srcfilen_degassing
character(len=255) :: volcano_srcfilen_explosive

! Workspace for point emissions
logical :: doing_point_emissions = .false.
character(len=255) :: point_emissions_srcfilen ! filename for pointwise emissions
type(ThreadWorkspace), allocatable :: workspaces(:)
Expand Down Expand Up @@ -175,7 +190,8 @@ subroutine SetServices ( GC, RC )
allocate(self%sigma(self%nbins), __STAT__)

! process SU-specific items
call ESMF_ConfigGetAttribute(cfg, self%volcano_srcfilen, label='volcano_srcfilen:', __RC__)
call ESMF_ConfigGetAttribute(cfg, self%volcano_srcfilen_degassing, label='volcano_srcfilen_degassing:', __RC__)
call ESMF_ConfigGetAttribute(cfg, self%volcano_srcfilen_explosive, label='volcano_srcfilen_explosive:', __RC__)
call ESMF_ConfigGetAttribute(cfg, self%eAircraftFuel, label='aircraft_fuel_emission_factor:', __RC__)
call ESMF_ConfigGetAttribute(cfg, self%fSO4anth, label='so4_anthropogenic_fraction:', __RC__)
call ESMF_ConfigGetAttribute(cfg, self%sigma, label='sigma:', __RC__)
Expand Down Expand Up @@ -719,7 +735,7 @@ subroutine Run1 (GC, import, export, clock, RC)
real, dimension(:,:), allocatable :: so2biomass_src, so2biomass_src_, so2anthro_l1_src, &
so2anthro_l2_src, so2ship_src, so4ship_src, dmso_conc, &
aviation_lto_src, aviation_cds_src, aviation_crs_src
integer, dimension(:), allocatable :: iPointVolc, jPointVolc, iPoint, jPoint
integer, dimension(:), allocatable :: iPoint, jPoint
real, dimension(:,:,:), allocatable :: emissions_point
character (len=ESMF_MAXSTR) :: fname ! file name for point source emissions
logical :: fileExists
Expand Down Expand Up @@ -813,34 +829,48 @@ subroutine Run1 (GC, import, export, clock, RC)
where(1.01*aviation_cds_src > MAPL_UNDEF ) aviation_cds_src = 0.
where(1.01*aviation_crs_src > MAPL_UNDEF ) aviation_crs_src = 0.

! Start with a clean emission diagnostic
if(associated(SUEM)) SUEM = 0.0


! Update emissions/production if necessary (daily)
! -----------------------------------------------
thread = MAPL_get_current_thread()
workspace => self%workspaces(thread)

! Update Volcanic SO2 Emissions Daily
if(workspace%nymd_last /= nymd) then
workspace%nymd_last = nymd

! Get pointwise SO2 and altitude of volcanoes from a daily file data base
if(index(self%volcano_srcfilen,'volcanic_') /= 0) then
call StrTemplate(fname, self%volcano_srcfilen, xid='unknown', &
! DEGASSING: Get pointwise SO2 and altitude of volcanoes from a daily file data base
workspace%nVolc = 0 ! case of /dev/null (no volcanoes) or ill-formed filename
if(index(self%volcano_srcfilen_degassing,'volcanic_') /= 0) then
call StrTemplate(fname, self%volcano_srcfilen_degassing, xid='unknown', &
nymd=nymd, nhms=120000 )
call ReadPointEmissions (nymd, fname, workspace%nVolc, workspace%vLat, workspace%vLon, &
workspace%vElev, workspace%vCloud, workspace%vSO2, workspace%vStart, &
workspace%vEnd, label='volcano', __RC__)
workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur
! Special possible case
if(self%volcano_srcfilen(1:9) == '/dev/null') workspace%nVolc = 0
end if

! EXPLOSIVE: Get pointwise SO2 and altitude of volcanoes from a daily file data base
workspace%nVolcE = 0 ! case of /dev/null (no volcanoes) or ill-formed filename
if(index(self%volcano_srcfilen_explosive,'volcanic_') /= 0) then
call StrTemplate(fname, self%volcano_srcfilen_explosive, xid='unknown', &
nymd=nymd, nhms=120000 )
call ReadPointEmissions (nymd, fname, workspace%nVolcE, workspace%vLatE, workspace%vLonE, &
workspace%vElevE, workspace%vCloudE, workspace%vSO2E, workspace%vStartE, &
workspace%vEndE, label='volcano', __RC__)
workspace%vSO2 = workspace%vSO2 * fMassSO2 / fMassSulfur
end if
end if

! Apply volcanic emissions
! ------------------------
! DEGASSING: Apply volcanic emissions
! -----------------------------------
if (workspace%nVolc > 0) then
if (associated(SO2EMVE)) SO2EMVE=0.0
if (associated(SO2EMVN)) SO2EMVN=0.0
allocate(iPointVolc(workspace%nVolc), jPointVolc(workspace%nVolc), __STAT__)
call MAPL_GetHorzIJIndex(workspace%nVolc, iPointVolc, jPointVolc, &
allocate(iPoint(workspace%nVolc), jPoint(workspace%nVolc), __STAT__)
call MAPL_GetHorzIJIndex(workspace%nVolc, iPoint, jPoint, &
grid = grid, &
lon = workspace%vLon/real(MAPL_RADIANS_TO_DEGREES), &
lat = workspace%vLat/real(MAPL_RADIANS_TO_DEGREES), &
Expand All @@ -851,8 +881,30 @@ subroutine Run1 (GC, import, export, clock, RC)
end if

call SUvolcanicEmissions (workspace%nVolc, workspace%vStart, workspace%vEnd, workspace%vSO2, workspace%vElev, &
workspace%vCloud, iPointVolc, jPointVolc, nhms, SO2EMVN, SO2EMVE, SO2, nSO2, SUEM, &
workspace%vCloud, iPoint, jPoint, nhms, SO2EMVN, SO2, nSO2, SUEM, &
self%km, self%cdt, MAPL_GRAV, zle, delp, area, workspace%vLat, workspace%vLon, __RC__)
deallocate(iPoint, jPoint, __STAT__)
end if

! EXPLOSIVE: Apply volcanic emissions
! -----------------------------------
if (workspace%nVolcE > 0) then
if (associated(SO2EMVE)) SO2EMVE=0.0
allocate(iPoint(workspace%nVolcE), jPoint(workspace%nVolcE), __STAT__)
call MAPL_GetHorzIJIndex(workspace%nVolcE, iPoint, jPoint, &
grid = grid, &
lon = workspace%vLon/real(MAPL_RADIANS_TO_DEGREES), &
lat = workspace%vLat/real(MAPL_RADIANS_TO_DEGREES), &
rc = status)
if ( status /= 0 ) then
if (mapl_am_i_root()) print*, trim(Iam), ' - cannot get indices for point emissions'
VERIFY_(status)
end if

call SUvolcanicEmissions (workspace%nVolcE, workspace%vStartE, workspace%vEndE, workspace%vSO2E, workspace%vElevE, &
workspace%vCloudE, iPoint, jPoint, nhms, SO2EMVE, SO2, nSO2, SUEM, &
self%km, self%cdt, MAPL_GRAV, zle, delp, area, workspace%vLatE, workspace%vLonE, __RC__)
deallocate(iPoint, jPoint, __STAT__)
end if

! Apply diurnal cycle if so desired
Expand Down Expand Up @@ -927,6 +979,7 @@ subroutine Run1 (GC, import, export, clock, RC)
workspace%pStart, workspace%pEnd, zle, &
area, iPoint, jPoint, nhms, emissions_point, __RC__)

deallocate(iPoint, jPoint, __STAT__)
SO4 = SO4 + self%cdt * MAPL_GRAV / delp * emissions_point
end if

Expand Down
3 changes: 2 additions & 1 deletion ESMF/GOCART2G_GridComp/SU2G_GridComp/SU2G_instance_SU.rc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ aerosol_monochromatic_optics_file: /discover/nobackup/pcolarco/fvInput/AeroCom/x
nbins: 4

# Volcanic pointwise sources
volcano_srcfilen: ExtData/chemistry/CARN/v202106/sfc/so2_volcanic_emissions_CARN_v202106.degassing_only.rc
volcano_srcfilen_explosive: /dev/null
volcano_srcfilen_degassing: ExtData/chemistry/CARN/v202401/so2_volcanic_emissions_CARN_v202401.degassing_only.rc

# Heights [m] of LTO, CDS and CRS aviation emissions layers
aviation_vertical_layers: 0.0 100.0 9.0e3 10.0e3
Expand Down
23 changes: 6 additions & 17 deletions Process_Library/GOCART2G_Process.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5663,7 +5663,7 @@ end subroutine DMSemission
! !IROUTINE: SUvolcanicEmissions

subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint, &
jPoint, nhms, SO2EMVN, SO2EMVE, SO2, nSO2, SU_emis, km, cdt, grav,&
jPoint, nhms, SO2EMVol, SO2, nSO2, SU_emis, km, cdt, grav,&
hghte, delp, area, vLat, vLon, rc)
! !USES:
implicit NONE
Expand All @@ -5687,8 +5687,7 @@ subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint
real, dimension(:), intent(in) :: vLat ! latitude specified in file [degree]
real, dimension(:), intent(in) :: vLon ! longitude specified in file [degree]
! !INOUT PARAMETERS:
real, pointer, dimension(:,:), intent(inout) :: SO2EMVN ! non-explosive volcanic emissions [kg m-2 s-1]
real, pointer, dimension(:,:), intent(inout) :: SO2EMVE ! explosive volcanic emissions [kg m-2 s-1]
real, pointer, dimension(:,:), intent(inout) :: SO2EMVol ! volcanic emissions [kg m-2 s-1]
real, pointer, dimension(:,:,:), intent(inout) :: SO2 ! SO2 [kg kg-1]
real, pointer, dimension(:,:,:), intent(inout) :: SU_emis ! SU emissions, kg/m2/s
real, dimension(:), intent(inout) :: vElev ! bottom elevation of emissions [m]
Expand All @@ -5712,7 +5711,6 @@ subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint
real :: deltaSO2v
real, dimension(:,:), allocatable :: z0
real, allocatable, dimension(:,:) :: srcSO2volc
real, allocatable, dimension(:,:) :: srcSO2volce

!EOP
!-------------------------------------------------------------------------
Expand All @@ -5721,13 +5719,9 @@ subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint
if (nVolc > 0) then

allocate(srcSO2volc, mold=area)
allocate(srcSO2volce, mold=area)
srcSO2volc = 0.
srcSO2volce = 0.

if (associated(SU_emis)) SU_emis = 0.0
if (associated(SO2EMVN)) SO2EMVN = 0.
if (associated(SO2EMVE)) SO2EMVE = 0.
if (associated(SO2EMVol)) SO2EMVol = 0.

allocate(z0, mold=area)
z0 = hghte(:,:,km)
Expand Down Expand Up @@ -5766,11 +5760,7 @@ subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint

! Diagnostic - sum of volcanos
! ----------------------------
if (hup .eq. hlow) then
srcSO2volc(i,j) = srcSO2volc(i,j) + so2volcano
else
srcSO2volce(i,j) = srcSO2volce(i,j) + so2volcano
endif
srcSO2volc(i,j) = srcSO2volc(i,j) + so2volcano

dzvolc = hup-hlow
do k = km, 1, -1
Expand Down Expand Up @@ -5817,9 +5807,8 @@ subroutine SUvolcanicEmissions (nVolc, vStart, vEnd, vSO2, vElev, vCloud, iPoint
enddo ! it
end if ! nVolc > 0

if (associated(SO2EMVN)) SO2EMVN = SO2EMVN + srcSO2volc
if (associated(SO2EMVE)) SO2EMVE = SO2EMVE + srcSO2volce
if (associated(SU_emis)) SU_emis(:,:,nSO2) = SU_emis(:,:,nSO2) + srcSO2volc + srcSO2volce
if (associated(SO2EMVol)) SO2EMVol = SO2EMVol + srcSO2volc
if (associated(SU_emis)) SU_emis(:,:,nSO2) = SU_emis(:,:,nSO2) + srcSO2volc

__RETURN__(__SUCCESS__)
end subroutine SUvolcanicEmissions
Expand Down

0 comments on commit d07a000

Please sign in to comment.