Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28543 ディスカッション

Runtime error 47 after conversion from CVF to IntelVF

irpug
ビギナー
2,008件の閲覧回数

I have been trying to nail down a problem with some legacy code that was originally compiled on Compaq Visual Fortran. I have tried many compiler options and code modifications, but it seems to be a .DLL issue. The source code is all *.F files and I am using Intel Visual Fortran and MS Visual Studio .NET 2005. The code compiles fine with no warnings or errors, but when I run the file it breaks on the following line:

write (4000+inum1,2000) iyr, iida, ii-1, (varii(j), j = 1, 22)

The open statement that is run previous to the write is:

open (4000+inum1s(idum), file='autocal1.out', ACTION='READWRITE')

note: inum1 = 1, and inum1s(idum) = 1

The run-time errorI keep getting when executing from the console isas follows:

forrtl: severe (47): write to READONLY file, unit 1112, file C:SWAT TestREVSIE
D NUTRIENTS Skalkaho phos calib Oct 2007fort.1112
Image PC Routine Line Source
myfile.exe 00A78376 Unknown Unknown Unknown
myfile.exe 00A75A49 Unknown Unknown Unknown
myfile.exe 009C0E36 Unknown Unknown Unknown
myfile.exe 009C096D Unknown Unknown Unknown
myfile.exe 009C87A4 Unknown Unknown Unknown
myfile.exe 004D7312 _READFILE.J 594 readfile.f
myfile.exe 00626228 _RERUN 87 rerun.f
myfile.exe 0042F7B9 _RERUNFILE 48 rerunfile.f
myfile.exe 008A169F _AUTOMET 55 automet.f
myfile.exe 00463D71 _MAIN__.J 128 main.f
myfile.exe 00A7EE55 Unknown Unknown Unknown
myfile.exe 00A1F223 Unknown Unknown Unknown
myfile.exe 0 0A1EFED Unknown Unknown Unknown
kernel32.dll 7C816FD7 Unknown Unknown Unknown

The error I am getting when executing within the Visual Studio IDE is:

'myfile.exe': Loaded 'C:SWAT TestDevelopmentMy2005Myfile2005Debugmyfile.exe', Symbols loaded.

'myfile.exe': Loaded 'C:WINNTsystem32 tdll.dll', No symbols loaded.

'myfile.exe': Loaded 'C:WINNTsystem32kernel32.dll', No symbols loaded.

'myfile.exe': Loaded 'C:WINNTsystem32imagehlp.dll', No symbols loaded.

'myfile.exe': Loaded 'C:WINNTsystem32msvcrt.dll', No symbols loaded.

'myfile.exe has triggered a breakpoint

I have checked the file that isattempted to bewritten to and it is not a readonly file. When I change: write (4000+inum1,2000) iyr, iida, ii-1, (varii(j), j = 1, 22) to: write (8001,2000) iyr, iida, ii-1, (varii(j), j = 1, 22), the file fort.8001 is written with the correct data. This leads me to believe it has something to do with the open statement, or some missing DLL's.

We want to move to the Intel compilerifwe can get this to work, soany suggestions would be appreciated.

Respectfully, Pug

0 件の賞賛
11 返答(返信)
Steven_L_Intel1
従業員
2,008件の閲覧回数
What exact version of the compiler are you using? How many of these files does the program open?

One thing to try - in the project properties, select Fortran > Data. Change the "Local variable storage" to "All variables SAVE" and rebuild.
irpug
ビギナー
2,008件の閲覧回数

Compiler version: 10.1

The downloaded and installed compiler is: w_fc_p_10.1.011_novsppe.exe

I have tried your suggestion but had the same result. In this instance the program is writing to 6 files, but it iterates through close and open statements (sample below):

close(4000+inum1s(idum))

if (inum1s(idum) <= 70 .and. inum1s(idum) > 0) then

open (9000+inum1s(idum),file=auto_in,recl=350)

select case (inum1s(idum))

case(1)

open (4000+inum1s(idum), file='autocal1.out', &

& ACTION='READWRITE')

case(2)

open (4000+inum1s(idum), file='autocal2.out', &

& ACTION='READWRITE')

... etc

The compiler is set to optimize for maximum speed, triedIntel Pentium and Pentium 4, tried I/O Buferring Yes and No.

Steven_L_Intel1
従業員
2,008件の閲覧回数
Please try 10.1.019 and see what happens. If the problem is still there, please submit a test case to Intel Premier Support and we'll be glad to look at it.
irpug
ビギナー
2,008件の閲覧回数

Well, I downloaded and installed 10.1.019 (which is reported as: Intel Fortran Compiler Integration for Microsoft Visual Studio 2005, 10.1.4156.2005, Copyright (C) 2002-2008 Intel Corporation), recompiled all the modules, but the same results.

I am wondering why I am getting the no symbols loaded for the 4 dll's (ntdll, kernel32,...)? I checked the C:WINNTsystem32 subdir and they are in there.

Will experiment some more. Thanks for your quick responses. If there is something else you think I should try, let me know.

Pug

Steven_L_Intel1
従業員
2,008件の閲覧回数
Help > About in Visual Studio shows you the VS integration version, not the compiler version.

The messages about no symbols loaded can be ignored. It's saying that there's no debug information for those system DLLs and that's of interest only if you want to debug those DLLs.

I note that the error message names fort.1112 as the file name. This tells me that at the time the WRITE is done, that unit is not open, or maybe something else is at work. I note that the WRITE has 4000+inum1 as the unit number, so I doubt inum1 is 1 at that point! Something you may want to look at.

irpug
ビギナー
2,008件の閲覧回数

Steve,

The current message I am now getting is:

forrtl: severe (47): write to READONLY file, unit 4001, file c:SWAT Testworking dir largeautocal1.out

I am stepping through the code from the point of just after the OPEN to see if something is changing the attributes.

Pug

Steven_L_Intel1
従業員
2,008件の閲覧回数
Right click on the project, select Properties, Fortran, Command Line. Copy all of the text shown under All Options and paste it into a reply here.
irpug
ビギナー
2,008件の閲覧回数
/nologo /Zi /G6 /assume:buffered_io /noinclude /gen-interfaces /warn:interfaces /Qsave /fpe:1 /Op /Qftz /iface:cvf /module:"Debug" /object:"Debug" /traceback /check:all /libs:static /threads /dbglibs /c
Steven_L_Intel1
従業員
2,008件の閲覧回数
I don't see anything in those options to suggest an issue.

Given the varying symptoms you've reported, I'd suggest you provide Intel Premier Support with the whole program and let us help you that way. I don't think it will get solved in this forum.
irpug
ビギナー
2,008件の閲覧回数

Steve,

Everything seems okay now. It seems that even though I installed the later version of the compiler (10.1.019), the old version remains installed and Visual Studio keeps the previous version as the default. I had to go into ToolsIntel FortranCompilers to change the compiler to the new version and then recompile. After that the I/O problem went away.

Thanks for your help.

Pug

Steven_L_Intel1
従業員
2,008件の閲覧回数
Yes, that's right. Not a behavior I am fond of... Glad to hear it worked out.
返信