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 :)
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

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