MAPL_FriendlyGet Subroutine

public subroutine MAPL_FriendlyGet(GC, NAME, FIELD, REQUESTER, RC)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp), intent(inout) :: GC
character(len=*), intent(in) :: NAME
type(ESMF_Field), intent(out) :: FIELD
character(len=*), intent(in), optional :: REQUESTER
integer, intent(out), optional :: RC

Calls

proc~~mapl_friendlyget~~CallsGraph proc~mapl_friendlyget MAPL_FriendlyGet ESMF_AttributeGet ESMF_AttributeGet proc~mapl_friendlyget->ESMF_AttributeGet esmf_stateget esmf_stateget proc~mapl_friendlyget->esmf_stateget interface~mapl_assert MAPL_Assert proc~mapl_friendlyget->interface~mapl_assert interface~mapl_varspecget MAPL_VarSpecGet proc~mapl_friendlyget->interface~mapl_varspecget interface~mapl_varspecgetindex MAPL_VarSpecGetIndex proc~mapl_friendlyget->interface~mapl_varspecgetindex none~get_internal_state~3 MaplGenericComponent%get_internal_state proc~mapl_friendlyget->none~get_internal_state~3 proc~mapl_internalstateretrieve MAPL_InternalStateRetrieve proc~mapl_friendlyget->proc~mapl_internalstateretrieve proc~mapl_return MAPL_Return proc~mapl_friendlyget->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_friendlyget->proc~mapl_verify none~is_threading_active MaplGenericComponent%is_threading_active none~get_internal_state~3->none~is_threading_active proc~get_current_thread get_current_thread none~get_internal_state~3->proc~get_current_thread proc~mapl_internalstateretrieve->proc~mapl_return proc~mapl_internalstateretrieve->proc~mapl_verify ESMF_GridCompGet ESMF_GridCompGet proc~mapl_internalstateretrieve->ESMF_GridCompGet ESMF_UserCompGetInternalState ESMF_UserCompGetInternalState proc~mapl_internalstateretrieve->ESMF_UserCompGetInternalState proc~mapl_internalstatecreate MAPL_InternalStateCreate proc~mapl_internalstateretrieve->proc~mapl_internalstatecreate at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception proc~mapl_internalstatecreate->proc~mapl_return proc~mapl_internalstatecreate->proc~mapl_verify proc~mapl_internalstatecreate->ESMF_GridCompGet ESMF_UserCompSetInternalState ESMF_UserCompSetInternalState proc~mapl_internalstatecreate->ESMF_UserCompSetInternalState none~get_component~4 ConcreteComposite%get_component proc~mapl_internalstatecreate->none~get_component~4 none~initialize~19 ConcreteComposite%initialize proc~mapl_internalstatecreate->none~initialize~19 none~set_composite~2 CompositeComponent%set_composite proc~mapl_internalstatecreate->none~set_composite~2

Source Code

   subroutine MAPL_FriendlyGet ( GC, NAME, FIELD, REQUESTER, RC )

      ! !ARGUMENTS:

      type(ESMF_GridComp),           intent(INOUT)  :: GC
      character(len=*),              intent(IN   )  :: NAME
      character(len=*),    optional, intent(IN   )  :: REQUESTER !ALT (set to optional TEMPORARY)
      type(ESMF_Field),              intent(  OUT)  :: FIELD
      integer,             optional, intent(  OUT)  :: RC

      !=============================================================================
      !
      ! ErrLog Variables

      integer                               :: status

      ! Local variables
      ! ---------------

      type (MAPL_MetaComp),              pointer  :: STATE
      logical                                     :: FRIENDLY

      integer                                     :: N, STAT


      ! Retrieve the pointer to the internal state of Root.
      ! ----------------------------------------------------

      call MAPL_InternalStateRetrieve ( GC, STATE, RC=status )
      _VERIFY(status)

      N =  MAPL_VarSpecGetIndex(STATE%COMPONENT_SPEC%INTERNAL%OLD_VAR_SPECS, NAME, RC=status)
      if(N /= -1) then
         _VERIFY(status)
      else
         _RETURN(ESMF_FAILURE)
      endif

      call MAPL_VarSpecGet(STATE%COMPONENT_SPEC%INTERNAL%OLD_VAR_SPECS(N), STAT=STAT, RC=status)
      _VERIFY(status)

      _ASSERT(iand(STAT, MAPL_FriendlyVariable) /= 0,'needs informative message')

      call ESMF_StateGet(STATE%get_internal_state(), NAME, FIELD, RC=status)
      _VERIFY(status)

      if (present(REQUESTER)) then
         call ESMF_AttributeGet  (FIELD, NAME="FriendlyTo"//trim(REQUESTER),VALUE=FRIENDLY, RC=status)
         _VERIFY(status)
         _ASSERT(FRIENDLY,'needs informative message')
      end if

      _RETURN(ESMF_SUCCESS)
   end subroutine MAPL_FriendlyGet