Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help in fortran 77

  1. Dec 22, 2008 #1
    Hi, I have some doubts about how to open files in fortran 77.
    The file must to be inside some particular directory?
    Sorry about my english.
  2. jcsd
  3. Dec 22, 2008 #2
    If you are using Windows, try the following code. If you are using Unix or Linux, change the back-slash to slash, and use the appropriate directory name, for example:
    The status could be 'new', 'old', 'unknown', and there are other options.

    Code (Text):
    C      open(10, file='testopen.dat',status='unknown')
    C      open(10, file='..\testopen.dat',status='unknown')
           open(10, file='c:\proj\f77\testopen.dat',status='unknown')
    C      read(10,*)x
    C      read(10,*)y
    C      print *,x,y
    C      rewind 10
          print *,10.0,12.0
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook