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