Topic: How to setup a formatted data file for a FORTRAN code to read

I have a legacy F77 code that uses formatted READ statements to read input from a formatted data file. I know that an OPEN statement should be used to get access to the data file. My OPEN statement is this:

      NIN = 5     
      OPEN(NIN,FILE='BELKNAP5.dat')   

and the file BELKNAP5.dat was originally created as a txt file using Microsoft Notes and then renamed. I included this file with my list of F77 modules, saved everything as a new project, build and launch the project, and the code does indeed seem to access this data file and runs with it OK. However, when I try to change the data file using the SF editor, say change one entry to see what happens, and try to "save" it, nothing gets changed. Perhaps this is not at all the correct way to update the data file? Do I have to go back and re-create the data file in Microsoft Notes?

Re: How to setup a formatted data file for a FORTRAN code to read

You should be able to change any text file in Simply Fortran.  Are you sure the file isn't changing, or are you relying on program output to confirm it isn't changing?

Also, just a warning, but using UNIT=5 is dangerous as it usually represents the console input.  You should really choose a different unit number.

Jeff Armstrong
Approximatrix, LLC