Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fortran runtime error: file does not exist

Status
Not open for further replies.

agwilliamson41

Programmer
Apr 5, 2014
1
GB
I'm new to programming, so apologies for not providing sufficient information for this to be solved.

I was provided with some code for a surface-energy-balance model. I've successfully compiled and created an executable file.

The source code has the following written in it:
c Read Parameters from Command Line
c -----------------------------------
inweathfilnam = R_CLI_Arg_Str ('Weather_File')
inlu1 = Get_Lu ()
open (inlu1,file=inweathfilnam,form='formatted',status='old')
write(61,*)'done met'

When running the program, I get asked for the following at the first step: (Str) Weather_File:

Here I am currently typing the file pathway (e.g., '/Documents/Data/MetData.txt'). The following message is returned:

At line 188 of file demscalemain_ns_gfortSG.for (unit = 118, file = '')
Fortran runtime error: File 'SvalMetData.txt' does not exist
logout

[Process completed]


Can anyone offer any help/advice on this? The file does exist in the specified directory. Am I typing the correct file pathway? Do I need to modify the source code?

Thanks.
 
Add the following before your open statement
Code:
print *,inwealthfilnam
Does R_CLI_Arg_Str strip off /Documents/Data?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top