×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Fortran runtime error: file does not exist

Fortran runtime error: file does not exist

Fortran runtime error: file does not exist

(OP)
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.

RE: Fortran runtime error: file does not exist

Add the following before your open statement

CODE

print *,inwealthfilnam 
Does R_CLI_Arg_Str strip off /Documents/Data?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close