I have a program that pulls input files from a working folder, runs calculations, and produces an output file. It then steps through all files in the folder. To recognize the input files, it reads in a text file containing every file name. I would rather not have to create this text file and have the program read in the input files directly, no matter their name. Is there a way in Fortran 90 to read file names directly and step through all the input files in my directory, without having to physically type in their names?
Here's an example of how it works now:
Program reads in LIST.TXT:
57
46
68
30
etc...
Assigns variable name to each line:
57 --> PSE(1)
46 --> PSE(2)
etc...
Program adds extensions to 57 and reads in input files:
57.IN
57.SPEC.DAT
Program spits out output file with same name:
57.OUT
Program steps on to next set of input files and adds extensions to 46:
46.IN
46.SPEC.DAT
Program spits out:
46.OUT
etc...
I would rather the program read directly from the working folder and step through every set of input files:
57.IN
57.SPEC.DAT
46.IN
46.SPEC.DAT
68.IN
68.SPEC.DAT
30.IN
30.SPEC.DAT
Is this possible?
Here's an example of how it works now:
Program reads in LIST.TXT:
57
46
68
30
etc...
Assigns variable name to each line:
57 --> PSE(1)
46 --> PSE(2)
etc...
Program adds extensions to 57 and reads in input files:
57.IN
57.SPEC.DAT
Program spits out output file with same name:
57.OUT
Program steps on to next set of input files and adds extensions to 46:
46.IN
46.SPEC.DAT
Program spits out:
46.OUT
etc...
I would rather the program read directly from the working folder and step through every set of input files:
57.IN
57.SPEC.DAT
46.IN
46.SPEC.DAT
68.IN
68.SPEC.DAT
30.IN
30.SPEC.DAT
Is this possible?