Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_GridComp), | intent(inout) | :: | GC | |||
integer(kind=INT64), | pointer | :: | LSADDR(:) | |||
integer, | intent(out) | :: | RC |
recursive subroutine MAPL_GetAllExchangeGrids ( GC, LSADDR, RC ) type(ESMF_GridComp), intent(INOUT) :: GC ! Gridded component integer(kind=INT64), pointer :: LSADDR(:) integer, intent( OUT) :: RC ! Return code integer :: status type (MAPL_MetaComp), pointer :: MAPLOBJ type (MAPL_LocStream) :: LocStream character(len=ESMF_MAXSTR) :: CNAME integer(kind=INT64) :: ADDR integer :: I integer :: N integer(kind=INT64), pointer :: TMP(:) logical :: found type(ESMF_GridComp), pointer :: gridcomp ! Retrieve the pointer to the internal state ! -------------------------------------------- call MAPL_GetObjectFromGC ( GC, MAPLOBJ, RC=status) _VERIFY(status) LocStream = MAPLOBJ%LocStream call c_MAPL_LocStreamRetrievePtr(LocStream, ADDR) call ESMF_GridCompGet(GC, NAME = cname, rc=status) _VERIFY(status) if (ADDR /= 0) then N = 0 if (associated(LSADDR)) then N = SIZE(LSADDR) end if found = .false. do I = 1, N if (addr == LSADDR(I)) then found = .true. exit end if end do if (.not. found) then allocate(tmp(N+1), stat=status) _VERIFY(status) if (N > 0) then tmp(1:N) = LSADDR deallocate(LSADDR) end if N = N + 1 tmp(N) = addr LSADDR => TMP end if end if do I = 1, MAPLOBJ%get_num_children() gridcomp => MAPLOBJ%GET_CHILD_GRIDCOMP(I) call MAPL_GetAllExchangeGrids(gridcomp, LSADDR, RC=status) _VERIFY(status) end do _RETURN(ESMF_SUCCESS) end subroutine MAPL_GetAllExchangeGrids