D.5.10 Set_Values_Assembled_Vector Procedure

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

  define([SET_VALUES_ROUTINE],[
    pushdef([DIM], [$1])
    pushdef([Set_Values_Assembled_Vector_DIM], 
      expand(Set_Values_Assembled_Vector_DIM))

    subroutine Set_Values_Assembled_Vector_DIM (AV, Values)

      ! Input variable.
  
      type(real,DIM,np), intent(in) :: Values    ! Values bare naked vector.
  
      ! Input/Output variable.
      
      type(Assembled_Vector_type), intent(inout) :: AV   ! Variable to be set.
  
      !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  
      ! Verify requirements.
  
      VERIFY(Valid_State(AV),5)                               ! AV is valid.
      VERIFY(Valid_State_NP(Values) .or. this_is_not_IO_PE,5) ! Values is valid.
      ! Values shape check.
      VERIFY(SHAPE(Values) == SHAPE(AV%Values$1) .or. this_is_not_IO_PE,5) 
      VERIFY($1 == AV%Dimensionality,5)   ! AV has been set up for this call.

      ! Set the value.
  
      if (this_is_IO_PE) AV%Values$1 = Values

      ! Increment the version number.

      AV%Version = AV%Version + Version_Increment
  
      ! Verify guarantees.

      VERIFY(Valid_State(AV),5)                            ! AV is still valid.

      return
    end subroutine Set_Values_Assembled_Vector_DIM

    popdef([DIM])
    popdef([Set_Values_Assembled_Vector_DIM])
  ])

  forloop([Dim],[1],[4],[
    SET_VALUES_ROUTINE(Dim)
  ])



Michael L. Hall