I want to apply the results from a WHERE construct to other arrays that have a higher dimension, so that in the following the "-" marks the indices from WHERE. I was wondering if FINDLOC could help, but seems it can not use a logical expression. Is there some kind of ARGWHERE intrinsic I am unaware of to return the indices and apply them ?
PROGRAM test
REAL :: a(3,20,20),b(20,20),c(20,20)
CALL random_number(c)
a=1
b=1
WHERE (c<0.5)
c=0
b=0 ! this is fine
a(:,-,-)=0 ! how to do this???
ENDWHERE
END PROGRAM test