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

Open read data in fortran 90

  1. Mar 5, 2013 #1
    Hi
    I have a problem with reading data in fortran 90. my programs try to read a txt file that only contains one number in it but if the txt file is empty it stops. i want to make it continue what should i do?
     
  2. jcsd
  3. Mar 5, 2013 #2

    SteamKing

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper

    Look up the ERROR= option for the READ statement.
     
  4. Mar 5, 2013 #3

    AlephZero

    User Avatar
    Science Advisor
    Homework Helper

    Even better, look up the END= option.

    ERROR= might pick up any type of error, not just that the file doesn't contain enough data.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook