Let me restate your problem, just to make sure I understand it correctly; please correct me if I'm wrong.
- You have a subroutine that calculates 1000 values in two separate arrays: array_1 and array_2.
- From your main program you would like to call this subroutine many times, each time generating a unique sets of 1000 values.
Let's say you want to call your subroutine N times, do you want to compare the N sets of numbers out side of the subroutine, ie in your main program, or do you want to do the comparison inside the subroutine?
Either way, I declare the arrays like so:
real, dimension(N,1000) :: array_1, array_2
If you would like to do the comparison outside the subroutine, you will make the above declaration in the main program. Then you will call the subroutine N times, and after each i'th time copy the values into the main's array_1(i,*) and array_2(i,*). In this, the subroutine will only have the arrays defined like so:
real, dimension(1000) :: array_1, array_2
Each time the subroutine is called, it will reuse these arrays, overwriting the previous values. This should be OK if you recorded the previous values in the main's arrays.
If you are doing this in f90, you can dynamically allocate array_1 and array_2 and let N be variable length. Alternatively, you can allocate the arrays initially with enough space to store all possible calls to the subroutine. Lets say you are not going to run more than 100 calls to the subroutine:
real array_1(100,1000), array_2(100,1000)
I'm sorry if this is not what you are looking for, but please clarify if I miss understood your question.