Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_GridComp), | intent(inout) | :: | GC | |||
type(MAPL_LocStream), | intent(out) | :: | result | |||
character(len=*), | intent(in) | :: | name | |||
integer, | intent(out) | :: | rc |
recursive subroutine MAPL_GetChildLocstream(GC, result, name, rc) type(ESMF_GridComp), intent(INout) :: GC type (MAPL_LocStream), intent( OUT) :: result character(len=*), intent(IN ) :: name integer, intent( OUT) :: rc character(len=ESMF_MAXSTR), parameter :: IAm="MAPL_GetChildLocstream" integer :: status integer :: I logical :: have_ens character(len=ESMF_MAXSTR) :: comp_name type (MAPL_MetaComp),pointer :: STATE type(ESMF_GridComp), pointer :: gridcomp call ESMF_GridCompGet(GC, name=comp_name, rc=status) _VERIFY(status) call MAPL_InternalStateGet ( GC, STATE, RC=status) _VERIFY(status) have_ens = index(name,":") /= 0 if (have_ens) then ! the name contains ensemble # if (name == comp_name) then result = state%locstream _RETURN(status) end if else if (name == comp_name(index(comp_name,":")+1:)) then result = state%locstream _RETURN(status) end if end if do I = 1, STATE%get_num_children() gridcomp => STATE%GET_CHILD_GRIDCOMP(I) call MAPL_GetChildLocstream(gridcomp, result, name, rc=status) if (status == ESMF_SUCCESS) then _RETURN(ESMF_SUCCESS) end if end do rc = ESMF_FAILURE return end subroutine MAPL_GetChildLocstream