The routine MAOPEN reflects a time when I ran on PC's with Watfor, PC's with MS-Fortran, the MVS system at the NERDC, the MVS vax system, and Unix systems.  There is an open file for each of these, owing to the fact that Fortran opens are not standard.  The Maopen included in the Amoeba is for Watfor.  It has two interesting features, the first of, which is common to all of the open files, in that it gives you a second chance, if you enter a name for an input file that does not exist.  The second feature is the unbelievable change required to make a large block unformatted file in Watfor.  The name of the file has to be made special.  The call to make this file is of course just MAPUF(l,NA,STATUS).

       

        SUBROUTINE MAOPEN(L,NA,STATUS)

        CHARACTER*64 NA,STATUS

5       CONTINUE

        IF(STATUS.EQ.'BIG')THEN

          OPEN(L,FILE=NA,STATUS='UNKNOWN',ERR=1197)

          RETURN

        ENDIF

        OPEN(L,FILE=NA,STATUS=STATUS,BLANK='ZERO',ERR=1197)

        RETURN

1197    PRINT*,' COULD NOT OPEN FILE= ',NA

        PRINT*,' ENTER A NEW NAME OR STOP'

        READ(*,'(A)')NA

        IF(NA.EQ.'STOP'.OR.NA.EQ.'stop')STOP

        GOTO 5

        END

        SUBROUTINE MAOPUF(L,NA,STATUS)

        CHARACTER*64 NA,STATUS,NAT

        NAT='(V:512)'//NA

5       OPEN(L,FILE=NAT,STATUS=STATUS,ERR=1197,FORM='UNFORMATTED')

        RETURN

1197    PRINT*,' COULD NOT OPEN UNFORMATTED FILE= ',NAT

        PRINT*,' ENTER A NEW NAME OR STOP'

        READ(*,'(A)')NAT

        IF(NAT.EQ.'STOP'.OR.NAT.EQ.'stop')STOP

        GOTO 5

        END

        SUBROUTINE ERRSET(I1,I2,I3,I4)

        RETURN

        END