From 218398c299f8b800c3d4cd87cb657177282fe23a Mon Sep 17 00:00:00 2001 From: "Michael F. Mehari" Date: Mon, 11 Dec 2023 16:49:30 -0500 Subject: [PATCH 1/6] Attributes added to 2D AERO_DP export fields in subroutine append_to_bundle --- ESMF/Shared/Chem_AeroGeneric.F90 | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ESMF/Shared/Chem_AeroGeneric.F90 b/ESMF/Shared/Chem_AeroGeneric.F90 index e1da972b..52e3a6f9 100644 --- a/ESMF/Shared/Chem_AeroGeneric.F90 +++ b/ESMF/Shared/Chem_AeroGeneric.F90 @@ -142,7 +142,7 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) integer :: dimCount, i real, pointer :: orig_ptr(:,:,:) real, pointer :: ptr2d(:,:) - character(len=ESMF_MAXSTR) :: bin_index, varNameNew + character(len=ESMF_MAXSTR) :: bin_index, varNameNew, units, longname ! Description: Adds deposition variables to deposition bundle @@ -160,6 +160,9 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) else if (dimCount == 3) then ! this handles computational instances call ESMF_FieldGet (field, grid=grid, __RC__) call MAPL_GetPointer (providerState, orig_ptr, trim(prefix)//trim(varName), __RC__) + call ESMF_AttributeGet(field, name='UNITS', value=units, __RC__) + call ESMF_AttributeGet(field, name='LONG_NAME', value=longname, __RC__) + longname=longname(1:index(trim(longname), '(Bin')-1) if ((index(trim(varname), 'DU') > 0) .or. (index(trim(varname), 'SS') > 0)) then do i = 1, size(orig_ptr, 3) @@ -167,6 +170,10 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) ptr2d => orig_ptr(:,:,i) field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& name=trim(varName)//trim(bin_index) , __RC__) + call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) + call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) + call ESMF_AttributeSet(field2d, name='UNITS', value=trim(units), _RC) + call ESMF_AttributeSet(field2d, name='LONG_NAME', value=trim(longname)//' Bin '//trim(bin_index), _RC) call MAPL_AllocateCoupling (field2D, __RC__) call MAPL_FieldBundleAdd (bundle, field2D, __RC__) end do @@ -176,6 +183,10 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) ptr2d => orig_ptr(:,:,3) field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& name=trim(varName)//'003' , __RC__) + call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) + call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) + call ESMF_AttributeSet(field2d, name='UNITS', value=units, _RC) + call ESMF_AttributeSet(field2d, name='LONG_NAME', value=trim(longname)//' Bin 003', _RC) call MAPL_AllocateCoupling (field2D, __RC__) call MAPL_FieldBundleAdd (bundle, field2D, __RC__) end if @@ -187,6 +198,10 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) varNameNew = 'OC'//varName(6:7) field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& name=trim(varNameNew)//trim(bin_index) , __RC__) + call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) + call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) + call ESMF_AttributeSet(field2d, name='UNITS', value=units, _RC) + call ESMF_AttributeSet(field2d, name='LONG_NAME', value=trim(longname)//' Bin '//trim(bin_index), _RC) call MAPL_AllocateCoupling (field2D, __RC__) call MAPL_FieldBundleAdd (bundle, field2D, __RC__) end do @@ -199,6 +214,10 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) varNameNew = 'BC'//varName(6:7) field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& name=trim(varNameNew)//trim(bin_index) , __RC__) + call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) + call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) + call ESMF_AttributeSet(field2d, name='UNITS', value=units, _RC) + call ESMF_AttributeSet(field2d, name='LONG_NAME', value=trim(longname)//' Bin '//trim(bin_index), _RC) call MAPL_AllocateCoupling (field2D, __RC__) call MAPL_FieldBundleAdd (bundle, field2D, __RC__) end do From ff44ba3c93d743cdba970ae583e3328f8ba05e8c Mon Sep 17 00:00:00 2001 From: "Michael F. Mehari" Date: Mon, 13 May 2024 17:57:37 -0400 Subject: [PATCH 2/6] Bug fix due to the recent update to EMSF --- ESMF/Shared/Chem_AeroGeneric.F90 | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/ESMF/Shared/Chem_AeroGeneric.F90 b/ESMF/Shared/Chem_AeroGeneric.F90 index 52e3a6f9..a0f8bbb1 100644 --- a/ESMF/Shared/Chem_AeroGeneric.F90 +++ b/ESMF/Shared/Chem_AeroGeneric.F90 @@ -7,8 +7,8 @@ !BOP ! -! !MODULE: Chem_AeroGeneric - Utilitarian subroutines used by GOCART2G children. -! +! !MODULE: Chem_AeroGeneric - Utilitarian subroutines used by GOCART2G children. +! ! ! !INTERFACE: ! @@ -48,7 +48,7 @@ module Chem_AeroGeneric !==================================================================================== subroutine add_aero (state, label, label2, grid, typekind, ptr, rc) -! Description: Adds fields to aero state for aerosol optics calcualtions. +! Description: Adds fields to aero state for aerosol optics calcualtions. implicit none @@ -109,7 +109,7 @@ recursive subroutine determine_data_driven(COMP_NAME, data_driven, RC) __Iam__('determine_data_driven') -! Begin... +! Begin... ! Is DU data driven? ! ------------------ @@ -155,7 +155,7 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) call ESMF_FieldGet (field, dimCount=dimCount, __RC__) if (dimCount == 2) then ! this handles data instances - call MAPL_FieldBundleAdd (bundle, field, __RC__) + call MAPL_FieldBundleAdd (bundle, field, __RC__) else if (dimCount == 3) then ! this handles computational instances call ESMF_FieldGet (field, grid=grid, __RC__) @@ -168,8 +168,8 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) do i = 1, size(orig_ptr, 3) write (bin_index,'(A, I0.3)') '', i ptr2d => orig_ptr(:,:,i) - field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& - name=trim(varName)//trim(bin_index) , __RC__) + field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farray=ptr2d,& + name=trim(varName)//trim(bin_index) , indexflag=ESMF_INDEX_DELOCAL, __RC__) call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) call ESMF_AttributeSet(field2d, name='UNITS', value=trim(units), _RC) @@ -181,8 +181,8 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) if (index(trim(varname), 'SU') > 0) then ! only use SO4, which is the 3rd index ptr2d => orig_ptr(:,:,3) - field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& - name=trim(varName)//'003' , __RC__) + field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farray=ptr2d,& + name=trim(varName)//'003' , indexflag=ESMF_INDEX_DELOCAL, __RC__) call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) call ESMF_AttributeSet(field2d, name='UNITS', value=units, _RC) @@ -196,8 +196,8 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) write (bin_index,'(A, I0.3)') '', i ptr2d => orig_ptr(:,:,i) varNameNew = 'OC'//varName(6:7) - field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& - name=trim(varNameNew)//trim(bin_index) , __RC__) + field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farray=ptr2d,& + name=trim(varNameNew)//trim(bin_index) , indexflag=ESMF_INDEX_DELOCAL, __RC__) call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) call ESMF_AttributeSet(field2d, name='UNITS', value=units, _RC) @@ -212,8 +212,8 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) write (bin_index,'(A, I0.3)') '', i ptr2d => orig_ptr(:,:,i) varNameNew = 'BC'//varName(6:7) - field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farrayPtr=ptr2d,& - name=trim(varNameNew)//trim(bin_index) , __RC__) + field2D = ESMF_FieldCreate(grid=grid, datacopyflag=ESMF_DATACOPY_REFERENCE, farray=ptr2d,& + name=trim(varNameNew)//trim(bin_index) , indexflag=ESMF_INDEX_DELOCAL, __RC__) call ESMF_AttributeSet(field2d, name='DIMS', value=MAPL_DimsHorzOnly, _RC) call ESMF_AttributeSet(field2d, name='VLOCATION', value=MAPL_VLocationNone, _RC) call ESMF_AttributeSet(field2d, name='UNITS', value=units, _RC) @@ -225,7 +225,7 @@ subroutine append_to_bundle(varName, providerState, prefix, bundle, rc) else if (dimCount > 3) then if(mapl_am_i_root()) print*,'Chem_AeroGenric::append_to_bundle does not currently support fields greater than 3 dimensions' - VERIFY_(824) + VERIFY_(824) end if RETURN_(ESMF_SUCCESS) @@ -251,7 +251,7 @@ subroutine setZeroKlid(km, klid, int_ptr) ! ! !REVISION HISTORY: ! -! 25Aug2020 E.Sherman - Written +! 25Aug2020 E.Sherman - Written ! ! !Local Variables integer :: k @@ -288,7 +288,7 @@ subroutine setZeroKlid4d (km, klid, int_ptr) ! ! !REVISION HISTORY: ! -! 25Aug2020 E.Sherman - Written +! 25Aug2020 E.Sherman - Written ! ! !Local Variables integer :: k, n @@ -331,7 +331,7 @@ subroutine findKlid (klid, plid, ple, rc) ! ! !REVISION HISTORY: ! -! 25Aug2020 E.Sherman - Written +! 25Aug2020 E.Sherman - Written ! ! !Local Variables integer :: k, j, i From 83087c0903719de50d1682d23043522818c8d2a0 Mon Sep 17 00:00:00 2001 From: Michael Mehari <107200142+mfmehari@users.noreply.github.com> Date: Tue, 14 May 2024 14:17:21 -0400 Subject: [PATCH 3/6] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f024e945..b454e367 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +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 ![image](https://github.com/GEOS-ESM/GOCART/assets/107200142/6b8dde42-279a-4b15-90f3-05276506ca9f) + ## [Unreleased] - 2023-07-24 ### Fixed From 2d54f4fa29bba3aa74c19b73869747fa94243bc5 Mon Sep 17 00:00:00 2001 From: Michael Mehari <107200142+mfmehari@users.noreply.github.com> Date: Tue, 14 May 2024 14:19:34 -0400 Subject: [PATCH 4/6] Update CHANGELOG.md --- CHANGELOG.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b454e367..69ae6d4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -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 ![image](https://github.com/GEOS-ESM/GOCART/assets/107200142/6b8dde42-279a-4b15-90f3-05276506ca9f) +[Unreleased] - 2024-05-14 + +### 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 ## [Unreleased] - 2023-07-24 From de1d7af74adc2c4eee26de59286df1f56dcb443e Mon Sep 17 00:00:00 2001 From: Michael Mehari <107200142+mfmehari@users.noreply.github.com> Date: Tue, 14 May 2024 14:20:38 -0400 Subject: [PATCH 5/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ae6d4c..943b0bf0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -[Unreleased] - 2024-05-14 +## [Unreleased] - 2024-05-14 ### Added From d58d778732f3bf567e1066c09d17330df4ed9298 Mon Sep 17 00:00:00 2001 From: Michael Mehari <107200142+mfmehari@users.noreply.github.com> Date: Tue, 14 May 2024 14:32:22 -0400 Subject: [PATCH 6/6] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 943b0bf0..7b149648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ 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 +- 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 ## [Unreleased] - 2023-07-24