11! > @brief Implementation of additional ESMF Field utilities
22!
33! This computer program is part of MOSSCO.
4- ! > @copyright 2021-2022 Helmholtz-Zentrum Hereon
4+ ! > @copyright 2021-2025 Helmholtz-Zentrum hereon GmbH
55! > @copyright 2015-2021 Helmholtz-Zentrum Geesthacht
66! > @author Carsten Lemmen <carsten.lemmen@hereon.de>
77! > @author Richard Hofmeister
@@ -2570,6 +2570,8 @@ subroutine MOSSCO_FieldWeightField(exportField, importField, weight, kwe, &
25702570 type (ESMF_Grid) :: grid
25712571 character (len= ESMF_MAXSTR), allocatable :: options(:)
25722572
2573+ type (ESMF_Info) :: exportInfo, importInfo
2574+
25732575 rc_ = ESMF_SUCCESS
25742576 owner_ = ' --'
25752577 if (present (rc)) rc = rc_
@@ -2649,18 +2651,29 @@ subroutine MOSSCO_FieldWeightField(exportField, importField, weight, kwe, &
26492651 if (allocated (exportUbnd)) deallocate (exportUbnd)
26502652 if (allocated (exportLbnd)) deallocate (exportLbnd)
26512653
2652- call MOSSCO_AttributeGet(importField, ' missing_value' , importMissingValue, &
2653- defaultValue=- 1D30 , convert= .true. , rc= localrc)
2654+ call ESMF_InfoGetFromHost(importField, info= importInfo, rc= localrc)
2655+ _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc)
2656+
2657+ call ESMF_InfoGet(importInfo, key= ' missing_value' , value= importMissingValue, &
2658+ default=- 1D30 , rc= localrc)
2659+ ! call MOSSCO_AttributeGet(importField, 'missing_value', importMissingValue, &
2660+ ! defaultValue=-1D30, convert=.true., rc=localrc)
26542661 _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
26552662
2656- call MOSSCO_AttributeGet(exportField, ' missing_value' , exportMissingValue, &
2657- defaultValue=- 1D30 , convert= .true. , rc= localrc)
2663+ call ESMF_InfoGetFromHost(exportField, info= exportInfo, rc= localrc)
2664+ _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
2665+
2666+ call ESMF_InfoGet(exportInfo, key= ' missing_value' , value= exportMissingValue, &
2667+ default=- 1D30 , rc= localrc)
2668+ ! call MOSSCO_AttributeGet(exportField, 'missing_value', exportMissingValue, &
2669+ ! defaultValue=-1D30, convert=.true., rc=localrc)
26582670 _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
26592671
26602672 ! > @todo The has_boundary_data attribute is set to .true. by default here,
26612673 ! > this should be changed by a configuration attribute and the attribute name MOSSCO_AttributeGet
26622674 ! > be synchronized with the transporting component (e.g. getm_component)
2663- call ESMF_AttributeSet(exportField, ' has_boundary_data' , .true. , rc= localrc)
2675+ call ESMF_InfoSet(exportInfo, key= ' has_boundary_data' , value= .true. , rc= localrc)
2676+ ! call ESMF_AttributeSet(exportField, 'has_boundary_data', .true., rc=localrc)
26642677 _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
26652678
26662679 if (.not. tagOnly_) then
@@ -2735,6 +2748,12 @@ subroutine MOSSCO_FieldWeightField(exportField, importField, weight, kwe, &
27352748 endif
27362749 endif
27372750
2751+ call ESMF_InfoGetFromHost(importField, info= importInfo, rc= localrc)
2752+ _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
2753+
2754+ call ESMF_InfoGetFromHost(exportField, info= exportInfo, rc= localrc)
2755+ _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
2756+
27382757 select case (rank)
27392758 case (2 )
27402759 call ESMF_FieldGet(importField, farrayPtr= importPtr2, rc= localrc)
@@ -2753,20 +2772,25 @@ subroutine MOSSCO_FieldWeightField(exportField, importField, weight, kwe, &
27532772
27542773 ! > @todo add infinity to mask
27552774
2756- call ESMF_AttributeGet(importField, ' valid_min' , isPresent= isPresent, rc= localrc)
2775+ isPresent = ESMF_InfoIsPresent(importInfo, " valid_min" , rc= rc)
2776+ ! call ESMF_AttributeGet(importField, 'valid_min', rc=localrc)
27572777 _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
27582778
27592779 if (isPresent) then
2760- call MOSSCO_AttributeGet(importField, label= ' valid_min' , value= real8, &
2761- convert= .true. , rc= localrc)
2780+ ! call MOSSCO_AttributeGet(importField, label='valid_min', value=real8, &
2781+ ! convert=.true., rc=localrc)
2782+ call ESMF_InfoGet(importInfo, key= ' valid_min' , value= real8, rc= localrc)
27622783 _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
27632784 mask2 = (mask2 .and. importPtr2(RANGE2D) >= real8)
27642785 endif
27652786
2766- call ESMF_AttributeGet(exportField, ' valid_min' , isPresent= isPresent, rc= localrc)
2787+ ! call ESMF_AttributeGet(exportField, 'valid_min', isPresent=isPresent, rc=localrc)
2788+ isPresent = ESMF_InfoIsPresent(exportInfo, " valid_min" , rc= rc)
2789+ _MOSSCO_LOG_AND_FINALIZE_ON_ERROR_(rc_)
27672790 if (isPresent) then
2768- call MOSSCO_AttributeGet(importField, label= ' valid_min' , value= real8, &
2769- convert= .true. , rc= localrc)
2791+ ! call MOSSCO_AttributeGet(importField, label='valid_min', value=real8, &
2792+ ! convert=.true., rc=localrc)
2793+ call ESMF_InfoGet(exportInfo, key= ' valid_min' , value= real8, rc= localrc)
27702794 mask2 = (mask2 .and. importPtr2(RANGE2D) >= real8)
27712795 endif
27722796
0 commit comments