Fortran: Execution and Input in one command line

  • Context: Fortran 
  • Thread starter Thread starter Aerandir90
  • Start date Start date
  • Tags Tags
    Fortran Input Line
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
Aerandir90
Messages
1
Reaction score
0
Hello all,

I wanted to know if there was a way to read in numerical data on the same command line on which you execute a file.

I know you can do that for i/o files like:
test.exe < file1.in > file2.out

But I wanted to know if there's some similar notation that can be used for floating point numbers.

Supposing I have this simple program that reads in 2 numbers and outputs their product.
I want to be able to do something similar to the above example in the command line:

test.exe < 3.2 87.3

Hope what I'm asking is clear enough..
I'm very new to Fortran so I'm not too sure about stuff like this
Thanks!
 
Physics news on Phys.org