      SUBROUTINE LDOVAR
      COMMON /LISTDO/ LPT, LEN, LS(64)
C
C     CHECKS PROPER NESTING OF DOS WITHIN LIST CONSTRUCT
C
      IF (LPT.GE.61) GO TO 50
      DO 40 KQ=LPT,60,4
        KK = KQ + 4
        DO 30 L=1,4
          LL = L + KQ - 1
          IF (LS(LL)) 10, 30, 10
   10     DO 20 K=KK,61,4
      IF (LS(K).EQ.LS(LL)) CALL ERROR1(
     *57H ILLEGAL TO CHANGE VALUE OF CONTROL VARIABLE OR DO LIMITS, 57)
   20     CONTINUE
   30   CONTINUE
   40 CONTINUE
   50 RETURN
      END
