      SUBROUTINE OPNFIL                                                 OPNF001
                                                                        OPNF002
      INCLUDE 'anglen.inc'                                              OPNF003
                                                                        OPNF004
C---- Initialise variables                                              OPNF005
      IFAIL = .FALSE.                                                   OPNF006
                                                                        OPNF007
C---- Open input .new file                                              OPNF008
      OPEN(UNIT=1,FILE=FILNEW,STATUS='OLD',ERR=900,FORM='FORMATTED',    OPNF009
CVAX     -     READONLY,                                                OPNF010
     &     ACCESS='SEQUENTIAL')                                         OPNF011
                                                                        OPNF012
C---- Open output file, <filename>.lan                                  OPNF013
      OPEN(UNIT=2,FILE=FILLAN,STATUS='UNKNOWN',ERR=904,                 OPNF014
CVAX     -     CARRIAGECONTROL='LIST',                                  OPNF015
     &     FORM='FORMATTED',ACCESS='SEQUENTIAL')                        OPNF016
                                                                        OPNF017
CHECK v.2.2-->                                                          OPNF018
C---- Open output file, <filename>.pln                                  OPNF019
      OPEN(UNIT=3,FILE=FILPLN,STATUS='UNKNOWN',ERR=906,                 OPNF020
CVAX     -     CARRIAGECONTROL='LIST',                                  OPNF021
     &     FORM='FORMATTED',ACCESS='SEQUENTIAL')                        OPNF022
CHECK v.2.2<--                                                          OPNF023
                                                                        OPNF024
      GO TO 999                                                         OPNF025
                                                                        OPNF026
C---- Fatal errors                                                      OPNF027
900   CONTINUE                                                          OPNF028
CHECK v.2.2-->                                                          OPNF029
C      PRINT*, '*** ERROR. Unable to open data file: ', FILNEW          OPNF030
      PRINT*, '*** ERROR. Unable to open data file: '                   OPNF031
      PRINT*, FILNEW, '*'                                               OPNF032
CHECK v.2.2<--                                                          OPNF033
      PRINT*, '***        Run program CLEAN to create it'               OPNF034
      GO TO 990                                                         OPNF035
                                                                        OPNF036
904   CONTINUE                                                          OPNF037
CHECK v.2.2-->                                                          OPNF038
C      PRINT*, '*** ERROR. Unable to open output file: ', FILLAN        OPNF039
      PRINT*, '*** ERROR. Unable to open output file: '                 OPNF040
      PRINT*, FILLAN, '*'                                               OPNF041
CHECK v.2.2<--                                                          OPNF042
      GO TO 990                                                         OPNF043
                                                                        OPNF044
CHECK v.2.2-->                                                          OPNF045
906   CONTINUE                                                          OPNF046
      PRINT*, '*** ERROR. Unable to open output file: '                 OPNF047
      PRINT*, FILPLN, '*'                                               OPNF048
      GO TO 990                                                         OPNF049
CHECK v.2.2<--                                                          OPNF050
                                                                        OPNF051
990   CONTINUE                                                          OPNF052
      IFAIL = .TRUE.                                                    OPNF053
                                                                        OPNF054
999   CONTINUE                                                          OPNF055
      RETURN                                                            OPNF056
      END                                                               OPNF057
