open(1,file='data.xyz',status='old')
where data.xyz is present in the directory where you run the program.
If the file is not present and you want your program to create it, use
status='unknown'
Joost
Thanks for the reply. When I include the name of the data file the
program executes and I get output. Unfortunately, I run batches of
input files and I need an input statement that will look in the
directry in which it is running and find the name of the input file.
I hope my explination isn't too confusing.
0) in your script that runs your batch of jobs, always copy the
inputfile to a temporary one with the same name...
1) get it from the command line
./a.out filename.dat
you can code that easily like this
character(LEN=200) :: filename
CALL get_command_argument(1,filename)
open(1,file=filename,status='old')
2) read the name of that file that always has the same name
('INPUTFILE')
open(1,file='INPUTFILE')
read(1,*) filename
close(1)
open(1,file=filename, ...)
Cheers,
Joost