D.8.10 Get_Values_Collected_Array Procedure

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

  define([GET_VALUES_ROUTINE],[
    pushdef([DIM], [$1])
    pushdef([ValuesDIM], expand(Values[]DIM))
    pushdef([Get_Values_Collected_Array_DIM], 
      expand(Get_Values_Collected_Array_DIM))

    subroutine Get_Values_Collected_Array_DIM (Values, CA)

      ! Input variable.
  
      type(Collected_Array_type), intent(in) :: CA ! Variable to be queried.
  
      ! Input/Output variable.
      
      type(real,DIM,np), intent(inout) :: Values   ! Values bare naked array.
  
      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      ! Verify requirements.
  
      VERIFY(Valid_State(CA),5)                      ! CA is valid.
      VERIFY(Valid_State_NP(Values),5)               ! Values is valid.
      VERIFY(DIM == CA%A_Dimensionality,5)   ! CA has been set up for this call.  
      VERIFY(SHAPE(Values) == SHAPE(CA%ValuesDIM),5) ! Values shape check.

      ! Set the values.

      Values = CA%ValuesDIM

      ! Verify guarantees.

      VERIFY(Valid_State(CA),5)          ! CA is still valid.
      VERIFY(Valid_State_NP(Values),5)   ! Values is valid.

      return
    end subroutine Get_Values_Collected_Array_DIM

    popdef([DIM])
    popdef([ValuesDIM])
    popdef([Get_Values_Collected_Array_DIM])
  ])

  forloop([Dim],[1],[5],[
    GET_VALUES_ROUTINE(Dim)
  ])



Michael L. Hall