I am using Linux, and after I compile my program, which is supposed to read information from a data file, I don't know what the command is to include the file. What do I type after a.out to include the file?
You have to get the filename first. There is an intrinsic called getarg. eg
Code:
program main
character*40 arg
integer i
intrinsic getarg
do 10 i = 1, 10, 1
call getarg (i, arg)
! check for the last parameter
if (arg(1:1) .eq. ' ') goto 20
print *, 'Arg ', i, ' = ', arg
10 continue
20 continue
stop
end
Basically use getarg to get the filename and then feed it into the open command to access your datafile.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.