Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!ukma!dftsrv!etac632!joe From: joe@etac632 (Joe Fulson-Woytek) Newsgroups: comp.lang.fortran Subject: Re: Command line arguements? Message-ID: <5513@dftsrv.gsfc.nasa.gov> Date: 31 May 91 11:28:57 GMT References: <24632@lanl.gov> Sender: news@dftsrv.gsfc.nasa.gov Reply-To: joe@etac632.gsfc.nasa.gov (Joe Fulson-Woytek) Organization: NSESCC, Goddard Space Flight Center, Greenbelt MD Lines: 22 In article , eesnyder@boulder.Colorado.EDU (Eric E. Snyder) writes: > I need to write a program that takes arguements from the > command line and passes them to variables with in the program. > > eg: > > a.out arg1 arg2 .... > Most (actually all of the ones I've dealt with (SGI, SUN, HP, Cray UNICOS)) UNIX Fortran compilers have some form of a GETARG routine which returns command line arguments. In the case of SGI there are 2 routines: iargc and getarg. iargc is a function and returns the number og arguments: j = iargc() getarg returns the i'th argument in the character string c: call getarg ( i,c) Check the Fortran reference manual pages for more info. Joe Fulson-Woytek NASA/Goddard Space Flight Center Code 932 joe@etac632.gsfc.nasa.gov