Ok now i recall the logical comparison can only use a redefined scalar so the following
gives no error.
integer:: ls1(2,4),mlis(2,4)
lenrec=1
nps=4
write(1,*)"ls1(1,1)",ls1(1,1)
write(1,*)"ls1(1,:)",ls1(1,:)
write(1,*)"ls1",ls1,"nps",nps
i1=ls1(1,1) ; i2=ls1(2,1)
i=1
do while(i1==i2.and.i<nps)...