- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a problem with fortran_winprintdirect in the following code snippet. The first two times work. The file is opened, print_direct generates the output, the file is closed. The third open fails with iostat=45.
With the calls to print_direct commented, the failure does not occur. It looks like print_direct is currupting something somewhere causing the third open to fail.
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
The original code was a loop passing different file names to print_direct and always failing at the third 'open'. The supplied code was my final test to determine if winprintdirect is involved with the problem.
With the calls to print_direct commented, the failure does not occur. It looks like print_direct is currupting something somewhere causing the third open to fail.
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
qstr="aptrac."
open (unit=12,file=qstr,form="formatted",status="old",
1 action="read",err=1001,iostat=istat)
istat = Print_direct (12, .FALSE.)
close(unit=12,iostat=istat)
The original code was a loop passing different file names to print_direct and always failing at the third 'open'. The supplied code was my final test to determine if winprintdirect is involved with the problem.
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The IOSTAT value of 45 means that there is a keyword value error in an OPEN statement. All of your OPEN statements look identical to me, so that doesn't seem to make sense.
The only thing I can think of is that you are using double quotes to delimit your argument values, while the online documentation always shows its examples with single quotes. Try switching the double quotes for single ones to see if it makes a difference.
Even if this works, though, it would be inconsistent. Why would CVF complain on the third OPEN statement and not the first two?
Mike
The only thing I can think of is that you are using double quotes to delimit your argument values, while the online documentation always shows its examples with single quotes. Try switching the double quotes for single ones to see if it makes a difference.
Even if this works, though, it would be inconsistent. Why would CVF complain on the third OPEN statement and not the first two?
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is truly bizarre. Would you please send your sample code and data file in a ZIP archive to me at steve.lionel@intel.com? I'd like to look at it.
Single vs. double quotes is not an issue here.
Steve
Single vs. double quotes is not an issue here.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it comes down to some conflicting compile specifications between the modules. Attached are the test source that calls fortran_winprintdirect and a 'listing'
of the compiles. I converted the original f77 code to f90
in case that was the problem.
of the compiles. I converted the original f77 code to f90
in case that was the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think it comes down to some conflicting compile specifications between the modules. Attached are the test source that calls fortran_winprintdirect and a 'listing'
of the compiles. I converted the original f77 code to f90
in case that was the problem.
of the compiles. I converted the original f77 code to f90
in case that was the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"conflicting compile specifications" don't seem to be an issue here (nor do I see any).
Your sample code works ok for me, though I notice you close unit 12 again unnecessarily at the end of the program. I don't get an error.
Steve
Your sample code works ok for me, though I notice you close unit 12 again unnecessarily at the end of the program. I don't get an error.
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I figured it out. I was using /iface:cref in our fortran in order to
interface with existing 'other' code. Not knowing fortran 90, I used
the default specs for the fortran_winprintdirect file supplied by visual
fortrans export makefile. I didn't know any better and the original code
worked fine for the first 2 OPENs. The difference between /iface:cref
and /iface=default includes handling of the stack by caller/calee. The
stack got messed up enough by the third call to print_direct to cause
the problem.
thank you
sol
interface with existing 'other' code. Not knowing fortran 90, I used
the default specs for the fortran_winprintdirect file supplied by visual
fortrans export makefile. I didn't know any better and the original code
worked fine for the first 2 OPENs. The difference between /iface:cref
and /iface=default includes handling of the stack by caller/calee. The
stack got messed up enough by the third call to print_direct to cause
the problem.
thank you
sol
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm glad you figured it out.
By the way, you are using Fortran 90 whether you know it or not!
Steve
By the way, you are using Fortran 90 whether you know it or not!
Steve

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