D.8.5 Collect_CA_from_OV Procedure

The main documentation of the Collect_CA_from_OV Procedure contains additional explanation of this code listing.

  subroutine Collect_CA_from_OV (CA, OV)
  
    ! Input variable.
  
    type(Overlapped_Vector_type), intent(in) :: OV  ! OV to be collected.
  
    ! Input/Output variable.
    
    type(Collected_Array_type), intent(inout) :: CA ! Resultant CA.
  
    !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
    ! Verify requirements.
  
    VERIFY(Valid_State(CA),5)                           ! CA is valid.
    VERIFY(Valid_State(OV),5)                           ! OV is valid.
    VERIFY(CA%Dimensionality == OV%Dimensionality,5)    ! Same dimensionality.
    VERIFY(CA%Dimensions(1:CA%Dimensionality-1) == dnl
           OV%Dimensions(1:OV%Dimensionality-1),5)      ! Same dimensions.
    ! Same structures and indices.
    VERIFY(ASSOCIATED(CA%One_Structure,OV%One_Structure),5)
    VERIFY(ASSOCIATED(CA%Many_Structure,OV%Many_Structure),5)
    VERIFY(ASSOCIATED(CA%Many_of_One_Index,OV%Many_of_One_Index),5) 

    ! Collect the values, using the Collect_and_Access OV routine.

    select case (CA%A_Dimensionality)
    case (1)
      CA%Values1 = OV
    case (2)
      CA%Values2 = OV
    case (3)
      CA%Values3 = OV
    case (4)
      CA%Values4 = OV
    case (5)
      CA%Values5 = OV
    end select
  
    ! Set version number.
  
    CA = Version(OV)
  
    ! Verify guarantees.
  
    VERIFY(Valid_State(CA),5)    ! CA is valid.
    VERIFY(Valid_State(OV),5)    ! OV is still valid.
  
    return
  end subroutine Collect_CA_from_OV



Michael L. Hall