ARGS
Command Line Argument Retrieval


ARGS is an executable FORTRAN90 program that demonstrates command line argument retrieval.

In particular, ARGS is a demonstration of the IARGC and GETARG routines, commonly available on UNIX systems.

These routines allow a FORTRAN program to count and retrieve the command line arguments with which it was invoked. Thus, if an executable program is called fu and we invoke it with the command

fu man chu
then IARGC will return the value 2, and GETARG, with an input of 0, 1 or 2, will return the values fu, man or chu.

Related Data and Programs:

ARGS is also available in a C version and a C++ version and a FORTRAN77 version and a MATLAB version.

GFORTRAN_INTRINSICS is a FORTRAN90 program which demonstrates the use of intrinsic programs provided by the GFORTRAN compiler, which include versions of IARGC and GETARG.

Source code:

List of Routines:

You can go up one level to the FORTRAN90 source codes.


Last revised on 15 March 2008.