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