Quote:
Originally Posted by colucix
To compare arrays you might subtract them and check if the difference is /= 0. Using masks (take a look at the WHERE statement) you can easily count elements and store the results in an integer array of the same length.
As previously stated, it would be far more easy to help by seeing what have you tried so far. Moreover, we could have an idea of your fortran skills.
|
I think using WHERE works better in fortran 90, if you don't want to compile your codes on a CRAY machine. In line with element by element comparison I suggest using:
(suppose you want to compare elements of A(g,m) and B(g,m)...)
(specifically I compare column "k" of A with column "t" of B)
check = 0
DO i = 1,g
if (A(i,k) /= A(i,t)) then
check = check + 1
EXIT
end if
END DO
then you can make use of check later. having changed check from 0 to 1 we can conclude matrix columns are not equal.
Its a lengthy line but it worked.
Good luck,