Fortran Fortran 90: giving the variable's value on the execution of a program

AI Thread Summary
In Fortran 90, it is possible to define a variable whose value can be provided at runtime through command line arguments. Instead of using the "read" command, which requires input after the program starts, users can pass values directly when executing the program, such as with the command "./exe 100". The discussion highlights the importance of searching for "Fortran 90 command line arguments" to find relevant resources and examples. This approach allows for more efficient input handling during program execution.
arhangela
Messages
2
Reaction score
0
Hello

I wondered if in Fortran 90 I can define a variable whose value will be given only while executing the program, in the same line as the execution command, for example like this:

./exe 100

I know one can use the "read" command, but that way you only enter the variable's value once the program is executed (in a new line)

I tried to Google it but I'm new to Fortran and I'm not sure to know the right terms to look for it efficiently.

Thanks!
 
Technology news on Phys.org
arhangela said:
I tried to Google it but I'm new to Fortran and I'm not sure to know the right terms to look for it efficiently.

Try Googling for

fortran 90 command line arguments

The first page has several references that look promising.
 
Thanks jtbell! It works now :)
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

Similar threads

Replies
25
Views
3K
Replies
4
Views
2K
Replies
8
Views
4K
Replies
5
Views
5K
Replies
59
Views
11K
Replies
1
Views
2K
Replies
1
Views
4K
Back
Top