End of File in GFortran using NetBeans IDE 7.4

We are facing trouble with the syntax of the below given routine.
Below subroutine related to GFortran:
KEY,LOCATE,SCRLUP,SCRLDN are the assembly subroutines to reassign the keys,scrollup,scrolldown.

  1. SUBROUTINE SCROLL (IREC,,)
    IB=0
    110 CALL KEY (KS,KA)
    IF (KS.EQ.80) THEN
    IF (IB.GE.1) THEN
    IF (.NOT.EOF(400)) THEN
    IREC=IREC+16
    DO 111 IA=1,17
    111 READ (400,’(1X,A77)’) CL
    IB=0
    ELSE
    GO TO 110
    ENDIF
    ENDIF
    IF (.NOT.EOF(400)) THEN
    READ (400,’(1X,A77)’) CL
    ELSE
    GO TO 110
    ENDIF
    IREC=IREC+1
    CALL SCRLUP (6,1,22,77,1,10)
    CALL Locate (23,2)
    Write(400,001)
    GO TO 110
    ELSEIF (KS.EQ.72) THEN
    IREC=IREC-1
    IF (IREC.LE.0.OR.IB.EQ.0.AND.IREC.LE.16) THEN
    IREC=IREC+1
    GO TO 110
    ENDIF
    IB=IB+1
    IF (IB.EQ.1) THEN
    IREC=IREC-16
    DO 115 IA=1,17
    115 BACKSPACE 400
    ENDIF
    CALL SCRLDN (6,1,22,77,1,10)
    BACKSPACE 400
    READ (400,’(1X,A77)’) CL
    CALL Locate(7,2)
    Write(400,001) (CL)
    BACKSPACE 400
    GO TO 110
    ELSEIF (KS.EQ.1) THEN
    CLOSE (400)
    KR=1
    RETURN 1
    ELSEIF (KS.EQ.28) THEN
    REWIND 400
    RETURN 2
    ELSE
    GO TO 110
    ENDIF
    RETURN
    END

    In the above mentioned subroutine it gives error displayed below:
    IF (.NOT.EOF(400)) THEN
    1
    Error: Operand of .not. operator at (1) is REAL(4)

  2. We are using Toshiba Satellite A 205,Intel Core*2 Duo Centrino 386 Laptop with Windows 7 OS.

    Please let us know the correct syntax of this subroutine.
    (removed by moderator)