do i=iturn4_start,iturn4_end if (itype(i).eq.21 .or. itype(i+1).eq.21 .or. c-----> Probably bug; should also handle itype(i+2) & .or. itype(i+3).eq.21 & .or. itype(i+4).eq.21) cycle