- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have Compaq Visual Fortran 6.1 running under Windows 2000. Someone sent me a source file that I compiled and linked with no warnings or errors reported, but it won't run. The problematic code is:
logical ex
inquire (FILE='model_input',exist=ex)
if (.not. ex) then
stop 'model_input not found'
end if
c
c define required properties
c
OPEN (14, FILE='model_input', STATUS='UNKNOWN')
When I execute the program, it writes 'model_input not found' and stops. I added the INQUIRE statement after the OPEN statement failed. The file model_input, in fact, exists and can be opened with Notepad. Copies of the file are located in both the Project and the Debug folders.
Can anyone suggest a trick to get this code to find and open this input file?
Many thanks in advance.
logical ex
inquire (FILE='model_input',exist=ex)
if (.not. ex) then
stop 'model_input not found'
end if
c
c define required properties
c
OPEN (14, FILE='model_input', STATUS='UNKNOWN')
When I execute the program, it writes 'model_input not found' and stops. I added the INQUIRE statement after the OPEN statement failed. The file model_input, in fact, exists and can be opened with Notepad. Copies of the file are located in both the Project and the Debug folders.
Can anyone suggest a trick to get this code to find and open this input file?
Many thanks in advance.
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried your test case in CVF 6.6B and it seemed to work ok. I don't spot anything obviously wrong, but I wondered at first if perhaps the lack of an extension on the filename would cause problems. (Didn't seem to in my test.)
Interesting thing to do would be to do an INQUIRE of the unit after the open and see what NAME= returns as a value.
Steve
Interesting thing to do would be to do an INQUIRE of the unit after the open and see what NAME= returns as a value.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your thoughts, Steve. I have ordered the CVF 6.6 upgrade; it should arrive in a few days.
I would try an INQUIRE after the OPEN if the program did not stop with an error 'file not found' at the OPEN line.
I would try an INQUIRE after the OPEN if the program did not stop with an error 'file not found' at the OPEN line.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My guess is that the default folder has been changed so it's looking somewhere else. You can set this in the Debug project settings tab. I tend to doubt that it's a CVF bug.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, the problem, whatever it was, is solved. The solution was to create a new input file with WordPad and save it as a MS-DOS text file named input.dat. Of course, the code was changed to the new file name, but the file location was the projectDebug folder, where the original model_input file resided.
Thanks for your time and comments.
Thanks for your time and comments.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page