FillRequestBundle Subroutine

public subroutine FillRequestBundle(request_list, state, rc)

Arguments

Type IntentOptional Attributes Name
type(requestedServiceItemVector), intent(inout) :: request_list
type(ESMF_State), intent(in) :: state
integer, intent(out), optional :: rc

Calls

proc~~fillrequestbundle~~CallsGraph proc~fillrequestbundle FillRequestBundle esmf_fieldbundleadd esmf_fieldbundleadd proc~fillrequestbundle->esmf_fieldbundleadd esmf_stateget esmf_stateget proc~fillrequestbundle->esmf_stateget interface~mapl_assert MAPL_Assert proc~fillrequestbundle->interface~mapl_assert none~begin~93 requestedServiceItemVector%begin proc~fillrequestbundle->none~begin~93 none~get~174 requestedServiceItemVectorIterator%get proc~fillrequestbundle->none~get~174 none~next~94 requestedServiceItemVectorIterator%next proc~fillrequestbundle->none~next~94 proc~mapl_return MAPL_Return proc~fillrequestbundle->proc~mapl_return proc~mapl_verify MAPL_Verify proc~fillrequestbundle->proc~mapl_verify 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

Called by

proc~~fillrequestbundle~~CalledByGraph proc~fillrequestbundle FillRequestBundle proc~mapl_genericinitialize MAPL_GenericInitialize proc~mapl_genericinitialize->proc~fillrequestbundle

Source Code

  subroutine FillRequestBundle(request_list, state, rc)
    type(RequestedServiceItemVector), intent(INOUT) :: request_list
    type(ESMF_State), intent(IN) :: state
    integer, optional, intent(out) :: rc
    
    integer :: status
    integer :: i, nl
    type(ESMF_Field), allocatable :: fields(:)
    type (RequestedServiceItemVectorIterator) :: iter
    type (RequestedServiceType), pointer :: item
    
    _ASSERT(request_list%size()>0,'request_list should not be empty')

    iter = request_list%begin()
    ! loop over requested services
    do while (iter /= request_list%end())
       item => iter%get()
       if (allocated(item%var_list)) then
          nl = size(item%var_list)
          allocate(fields(nl), stat=status)
          _VERIFY(status)
          do i=1, nl
             call ESMF_StateGet(state, item%var_list(i), &
                  fields(i), rc=status)
             _VERIFY(status)
          end do
          call ESMF_FieldBundleAdd(item%bundle, fields, rc=status)
          _VERIFY(status)
          deallocate(fields)
       end if
       call iter%next()
    end do
    
    _RETURN(_SUCCESS)
  end subroutine FillRequestBundle