I have an array, from which I want to have some information.
I wrote a small DO-loop, but I don't know why it always returns
integer :: inn=0
parameter :: m=115200
real*8 :: da1(m)
DO i=1, 115200
IF( i<=19200 .and. da1(i)>1 .and. da1(i)<999.9999 .and. da1(i)<-1 )then
inn=inn+1
END IF
END DO
write(*,*) 'inn=',inn
The problem is your conditional:
da1(i).gt.1.00 .and. da1(i).lt.999.9999 .and. da1(i).lt.-1.000
How can a number (here: da1(i)
) be > 1
and < -1
at the same time? That conditional is always false, and inn
is never incremented.