MAPL_GCGet Subroutine

public recursive subroutine MAPL_GCGet(GC, name, result, rc)

Arguments

Type IntentOptional Attributes Name
type(ESMF_GridComp), intent(inout) :: GC
character(len=*), intent(in) :: name
type(ESMF_GridComp), intent(inout) :: result
integer, intent(out), optional :: rc

Calls

proc~~mapl_gcget~~CallsGraph proc~mapl_gcget MAPL_GCGet ESMF_GridCompGet ESMF_GridCompGet proc~mapl_gcget->ESMF_GridCompGet ESMF_UserCompGetInternalState ESMF_UserCompGetInternalState proc~mapl_gcget->ESMF_UserCompGetInternalState none~get_child_gridcomp MAPL_MetaComp%get_child_gridcomp proc~mapl_gcget->none~get_child_gridcomp none~get_num_children~3 CompositeComponent%get_num_children proc~mapl_gcget->none~get_num_children~3 proc~mapl_return MAPL_Return proc~mapl_gcget->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_gcget->proc~mapl_verify none~get_gridcomp MaplGenericComponent%get_gridcomp none~get_child_gridcomp->none~get_gridcomp none~get_ith_child MAPL_MetaComp%get_ith_child none~get_child_gridcomp->none~get_ith_child none~get_num_children~5 ConcreteComposite%get_num_children none~get_num_children~3->none~get_num_children~5 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 none~is_threading_active MaplGenericComponent%is_threading_active none~get_gridcomp->none~is_threading_active proc~get_current_thread get_current_thread none~get_gridcomp->proc~get_current_thread none~get_child~26 MAPL_MetaComp%get_child none~get_ith_child->none~get_child~26 none~get_child_by_index CompositeComponent%get_child_by_index none~get_child~26->none~get_child_by_index none~get_child_by_name CompositeComponent%get_child_by_name none~get_child~26->none~get_child_by_name

Source Code

   recursive subroutine MAPL_GCGet(GC,name,result,rc)
      type(ESMF_GridComp), intent(inout) :: GC
      character(len=*)   , intent(in   ) :: name
      type(ESMF_GridComp), intent(inout) :: result
      integer, optional  , intent(  out) :: rc

      character(len=ESMF_MAXSTR), parameter :: IAm = "MAPL_GCGet"
      integer                               :: status
      character(len=ESMF_MAXSTR)            :: comp_name
      type(MAPL_MetaComp), pointer          :: state
      type(ESMF_VM)                         :: vm
      integer                               :: i
      type(ESMF_GridComp), pointer :: gridcomp

      call ESMF_GridCompGet(GC,name=comp_name,vm=vm,rc=status)
      _VERIFY(status)
      if (trim(comp_name) == trim(name)) then
         result = GC
         _RETURN(ESMF_SUCCESS)
      end if

      call MAPL_InternalStateGet ( GC, STATE, RC=status)
      _VERIFY(status)
      do I = 1, STATE%get_num_children()
         gridcomp => STATE%GET_CHILD_GRIDCOMP(I)
         call MAPL_GCGet(gridcomp,name,result,rc=status)
         if (status==ESMF_SUCCESS) then
            _RETURN(ESMF_SUCCESS)
         end if
      enddo

      _RETURN(ESMF_FAILURE)
      return

   end subroutine MAPL_GCGet