Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fortran77 parameter when executing program

I am currently doing a Fortran77 assignment, so please don't tell me the exact coding, but please give me a hint of what I want to do:

Using UNIX terminal, I would like to get the parameter passed on by executing

./program.exe parameter
like image 883
Henry Cho Avatar asked Feb 17 '23 16:02

Henry Cho


1 Answers

In standard Fortran77 you can't. End of story. Accessing command line arguments with fortran programs wasn't standardized until Fortran 2003.

If you're using the GNU fortran compiler, you can use the iargc() and getarg(i, arg) functions, which return the number of arguments and the value of a specific argument, resepectively.

like image 73
Carl Norum Avatar answered Mar 19 '23 00:03

Carl Norum