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

Fortran read in flags?

  1. Nov 7, 2009 #1
    Hi All,

    Just like to know if it's possible for a Fortran program to read in data on execution.

    For example, in JAVA, say if I've written a program for matrix factorization, I can type in the command line:
    "java mfact q" for QR factorization or "java mfact c" for Cholesky decomposition, where mfact is my compiled JAVA program.

    When I run my Fortran program in command line-interface, the best I can do is run the program, then have the program to ask me for a flag, like:

    Code (Text):

      PRINT *, 'Please input the type of factorization you require:'
      READ *, factype
    So I'd have to run the program, then it asks me what I want to do. But I'd like to supply the argument as I'm executing the program. Is this possible in Fortran?


  2. jcsd
  3. Nov 7, 2009 #2


    Staff: Mentor

    Last edited by a moderator: Apr 24, 2017
  4. Nov 7, 2009 #3
    Ah, thanks!!

    This is what I needed.
    Last edited by a moderator: Apr 24, 2017
  5. Nov 7, 2009 #4
    You can do (just about) anything in Fortran that you need to do. Fortran was used to:

    1. Write an operating system (Prime mini's had an OS written mainly in Fortran)
    2. Write a 80386 DOS extender (DBOS)
    3. Write a Fortran compiler
    4. Write a LISP compiler (really)
    5. Write a terminal emulator
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Threads - Fortran read flags Date
Fortran How does Fortran Execute this Statement? Mar 15, 2017
Fortran Reading data from a table file Dec 29, 2016
Fortran: reading the data from file Mar 11, 2016
Fortran 95 read statement Oct 9, 2015