I wish to check if one 2D array contains a value from other 1D array.
do i=1,nlines
do j=1,nchecks(i)
if (type(i).eq.4) then
do k=1,nlines
do l=1,nchecks(k)
if (type(k).eq.3) then
if (ANY(con(i,j)==id(k))) then
...
But I face following error:
test1.f(98): error #6361: An array-valued argument is required in this context. [ANY]
if (ANY(conn(i,j)==id2(k))) then
What am I doing wrong? I also tried something like
do i=1,nlines
do j=1,nchecks(i)
if (type(i).eq.4) then
r1=conn(i,j)
do k=1,nlines
do l=1,nchecks(k)
if (type(k).eq.3) then
if (ANY(r1==id(k))) then
...
But this also brought the same error. All variables are properly defined, and no mistakes in format. Am I using ANY command in wrong way?
ANYincorrectly. At the moment you are just testing individual scalar elements of the arrays, so noANYrequired. However, we don't know what's in the loops so it's impossible to know what you really want to do. Also, you can probably hoist thoseiftests oniandkoutside the innerjandlloops respectively and/or reorder the loops by the looks.