Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(ESMF_GridComp), | intent(inout) | :: | GC | |||
character(len=*), | intent(in) | :: | name | |||
type(ESMF_State), | intent(out) | :: | result | |||
integer, | intent(out) | :: | rc |
recursive subroutine MAPL_InternalESMFStateGet ( GC, name, result, rc ) type(ESMF_GridComp), intent(INout) :: GC character(len=*), intent(IN ) :: name type (ESMF_State), intent( OUT) :: result integer, intent( OUT) :: rc character(len=ESMF_MAXSTR), parameter :: IAm="MAPL_InternalESMFStateGet" integer :: status integer :: I logical :: have_ens character(len=ESMF_MAXSTR) :: sname type (MAPL_MetaComp),pointer :: STATE type(ESMF_State) :: internal type(ESMF_GridComp), pointer :: gridcomp have_ens = index(name,":") /= 0 call MAPL_InternalStateGet ( GC, STATE, RC=status) _VERIFY(status) call MAPL_Get(STATE,INTERNAL_ESMF_STATE=internal,rc=status) _VERIFY(status) call ESMF_StateGet(internal, name=sname, rc=status) _VERIFY(status) if (have_ens) then if (sname == trim(name) // '_INTERNAL') then result = internal _RETURN(ESMF_SUCCESS) end if else if (sname(index(sname,":")+1:) == trim(name) // '_INTERNAL') then result = internal _RETURN(ESMF_SUCCESS) end if end if do I = 1, STATE%get_num_children() gridcomp => STATE%GET_CHILD_GRIDCOMP(I) call MAPL_InternalESMFStateGet(gridcomp, name, result, RC=status) if (status == ESMF_SUCCESS) then _RETURN(ESMF_SUCCESS) end if end do rc = ESMF_FAILURE return end subroutine MAPL_InternalESMFStateGet