I am trying to create a Fortan program, which when compiled to an executable, can take a file as a parameter (e.g., progexe afile).
I need to code the program in such a way that the filename passed (afile) is available within the Fortran program. I cannot figure out how to do this. I am using gfortran in MingW on windows.
Use GET_COMMAND_ARGUMENT. It works for me with gfortran 4.6.3. Example use:
Compile and run: