The main documentation of the Set_Values_Distributed_Vector Procedure contains additional explanation of this code listing.
define([SET_VALUES_ROUTINE],[ pushdef([DIM], [$1]) pushdef([Set_Values_Distributed_Vector_DIM], expand(Set_Values_Distributed_Vector_DIM)) subroutine Set_Values_Distributed_Vector_DIM (DV, Values) ! Input variable. type(real,DIM,np), intent(in) :: Values ! Values bare naked vector. ! Input/Output variable. type(Distributed_Vector_type), intent(inout) :: DV ! Variable to be set. !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ! Verify requirements. VERIFY(Valid_State(DV),5) ! DV is valid. VERIFY(Valid_State_NP(Values),5) ! Values is valid. VERIFY($1 == DV%Dimensionality,5) ! DV has been set up for this call. VERIFY(SHAPE(Values) == SHAPE(DV%Values$1),5) ! Values shape check. ! Set the value. DV%Values$1 = Values ! Increment the version number. DV%Version = DV%Version + Version_Increment ! Verify guarantees. VERIFY(Valid_State(DV),5) ! DV is still valid. return end subroutine Set_Values_Distributed_Vector_DIM popdef([DIM]) popdef([Set_Values_Distributed_Vector_DIM]) ]) forloop([Dim],[1],[4],[ SET_VALUES_ROUTINE(Dim) ])