Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29261 Discussions

Need intrinsic for comparing arrays (?)

WSinc
New Contributor I
352 Views
Hello -

I looked thru the Fortran handbooks, and to my surprise I could not find the intrinsic I need.

I just need a LOGICAL function for comparing two arrays. Of course I could easily code one up,
but that may not be as fast as a machine-coded intrinsic, if one exists.

The arrays would usualy be integer types. The purpose is to compare a record to see if if already exists somewhere before storing it.

Unfortunately, this doesNOT work:

integer*1 A(8,8), B(8,8)
if (A == B)then
! they are equal
else
! they are not equal
endif

It says it expects a scalar there.

Any ideas? Thanks !
0 Kudos
1 Reply
TimP
Honored Contributor III
352 Views
Study the ANY intrinsic, maybe that will help.
0 Kudos
Reply