Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

FORMAT(A) not working???

turkeydodo
Beginner
3,905 Views
I don't know what's wrong with my computer. The following read file lines are not working now but yesterday still working. The only change is the computer got refreshed or updated. The code breaks at the read line

OPEN(UNIT=MESH,FILE=MESHF,ERR=999)

READ(MESH,1001,END=900)HEADER

1001 FORMAT(A)

I got error message:

Debug Assertion Failed!
Program:
...\\aaa.exe
File: f:\\dd\\vctools\\crt-bld\\self_x86\\crt\\src\\vsprintf.c
Line: 112
Expression: (format != NULL)
For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.

The mesh file has the first line to be read:

DATA BY NASTRAN/EHD INTERFACE MODEL=H --- ALL DATA IN MM

I can read line by line using WORDPAD, but if I open using NOTEPAD, they linked together without lines

Did you guys change some compiling options when you update intel visual fortran? It is painful for me to play the compiling options in IVF. My past experience is different options give different results. Customers likethe default options which has been tuned well.

Can you help on this? So wired!

0 Kudos
16 Replies
mecej4
Honored Contributor III
3,905 Views
> I can read line by line using WORDPAD, but if I open using NOTEPAD, they linked together without lines

Check if you you have corrupted the data file by saving it as a word-processor file rather than a text file. Replace it with a back-up copy if possible.
0 Kudos
Steven_L_Intel1
Employee
3,905 Views
The behavior of NOTEPAD vs. WORDPAD indicates that your input file has been modified to have UNIX-style line endings rather than Windows-style. However, this should not affect the way Intel Fortran reads the file.

When you get this error, look in the console window (may be behind the VS window) to see if there is an error message with traceback there. If there is, what does it say?

Also, what exact version of the compiler are you using?
0 Kudos
turkeydodo
Beginner
3,905 Views
First, it is not the issue of WORDPAD vs NOTEPAD. File is ok no problem.

Console window says that

forrtl: severe (61): format/variable-type mismatch, unit -1, file CONOUT$

I am using IVF version:

Intel Visual Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.1.3471.2008, Copyright (C) 2002-2010 Intel Corporation

It is so wired that the above issue passed. I made no change but somehow it passed.

The question is I met another issue similar to this. The code break at the following WRITE line

IF (IPS .NE. 0) then

WRITE(*,1026) "C HAS"

ENDIF

1026 FORMAT(A)

The question is if I put these lines at the beginning ofthe main program, it passeswithout problem. Butin the real code, these lines are afterlots of subroutine callings.

Itseems theremaybe a conflict inthe IVF with Windows7 (Iguess). I am attaching the output inDisassembly window

IF (IPS .NE. 0) then

004B030B mov eax,dword ptr [IPS]

004B0311 test eax,eax

004B0313 je 004B0379

WRITE(*,1026) "C HAS"

004B0315 mov dword ptr [ebp-750h],0

004B031F mov dword ptr [ebp-61Ch],5

004B0329 mov dword ptr [ebp-618h],5CC264h

004B0333 add esp,0FFFFFFE4h

004B0336 lea eax,[ebp-750h]

004B033C mov dword ptr [esp],eax

004B033F mov dword ptr [esp+4],0FFFFFFFFh

004B0347 mov dword ptr [esp+8],8384FF00h

004B034F mov dword ptr [esp+0Ch],5CC368h

004B0357 lea eax,[ebp-61Ch]

004B035D mov dword ptr [esp+10h],eax

004B0361 mov dword ptr [esp+14h],62FD00h

004B0369 mov dword ptr [esp+18h],20h

004B0371 call _for_write_seq_fmt (4CE760h)

004B0376 add esp,1Ch

ENDIF

1026 FORMAT(A)

The code breaks at


004B0376 add esp,1Ch

Could you help on these?


0 Kudos
Steven_L_Intel1
Employee
3,905 Views
The assembly is not of importance. The format-variable mismatch typically means you are using a numeric format with a character variable or are mixing integer and real formats incorrectly. I don't see how you can get that with an A format.

Can you show a while program and show the traceback from the error?
0 Kudos
turkeydodo
Beginner
3,905 Views

Hello, Sir,

It seems that the code stops atmany WRITE lines. Once I comment out the first, the second comes out

(1)

WRITE (NOISE,89) DEGS-TDIF,add/htp,addr/htp,addh/htp,htph/htp,SQRT(Vr**2+Vt**2),Vr,Vt,&

(CavAv(1)+CavAv(2))*Vt/htp,CavAv(1)*Vt/htp,CavAv(2)*Vt/htp

89 FORMAT(20(1H E13.7))

forrtl: severe (66): output statement overflows record, unit 27, file ....

(2)

WRITE(6,97) STATUS,SECNDS(Runtime),PfMax,RouMin,RouMinLoc,MIN(NLubrication,NFullFilm),NContact,PcMax,Hmin,(VL-VLD)/2,(VL+VLD)/2,FricF(1),FricF(2),hw

97 FORMAT (1X,F7.2,'deg',F7.2,'sec',2E11.4,3I5,7E11.4)

forrtl: severe (66): output statement overflows record, unit 6, file CONOUT$

...

I am maintainning a solver with over 20000 line. I really don't like the things. Do you suggest that I reinstall IVF again or play any compiling options?

0 Kudos
mecej4
Honored Contributor III
3,905 Views
> 97 FORMAT (1X,F7.2,'deg',F7.2,'sec',2E11.4,3I5,7E11.4)

> forrtl: severe (66): output statement overflows record, unit 6, file CONOUT$

The default RECL for standard output is 132 characters (ye olde lineprinters' limit), which is exceeded by your Format statement, which wants to put out a record of length 135. For remedies, look under "OPEN: RECL Specifier" in the Intel Fortran Documentation.

>Do you suggest that I reinstall IVF again or play any compiling options?

That would be as useful as taking a bottlefull of placebo pills.
0 Kudos
turkeydodo
Beginner
3,905 Views
I do not think it is due tocode grammar issue.

Pls note that the code is not new and was still working yesterday. Yesterday it output correctly and runs well. The problem is after I get up this morning, the computer got updated and restarted. Then the code got lots of error.

I am wondering if there is any support number from intel. This forum seems slow to get direct help from IVF.
0 Kudos
anthonyrichards
New Contributor III
3,905 Views
I think it might help to go back to your first post. You highlighted a problem with the following code:

OPEN(UNIT=MESH,FILE=MESHF,ERR=999)

READ(MESH,1001,END=900)HEADER

1001 FORMAT(A)

Please can you

Attach a cut-down version of the text file MESHF with the first couple of lines only.
Show the actual name of the file.
Show your declarations for MESHF, MESH and HEADER
Show your code where MESHF and MESH are defined.

Posting such a small section of code is not at all helpful in diagnosis. How would you recognise a picture of an elephant if all you were shown was a zoomed-in section of 1 square inch of its hide?
0 Kudos
Steven_L_Intel1
Employee
3,905 Views
It looks as if you have several errors in your code. Can you provide us with a small but complete program that demonstrates the problems you are finding?
0 Kudos
turkeydodo
Beginner
3,905 Views
I tried to play compiling options all day but no results. In twice, the code can run through and output correct results with no reasons. But later it fails. I did not change the code. I just restart the computer and restart the IVF and play options.

The problem is the code is too large. If I pick upa piece of error part out and copy them into a small sample code. The runtime errors never happens. It is difficult for me the hold the tail of the error. Is there any good way?

In general, they are the runtime errors (61) and (66) for read and write commands. I can not use any format. If I change the specific format to "*", they pass with no problem.

I am so tired. It seems a system level problem. I don't know what 's update on my machine this Monday. They always automatically do it then need more and more fix.

I will try it tomorrow to see if I can get a sample.
0 Kudos
Steven_L_Intel1
Employee
3,905 Views
Sounds to me as if you have memory corruption going on, or a reference to uninitialized storage, or both. Do you have Diagnostics > Check Routine Interfaces and Run-Time > Array and String Bounds enabled?
0 Kudos
anthonyrichards
New Contributor III
3,905 Views
I think it would be wise not to depend on default behaviour for your OPEN statements

OPEN(UNIT=MESH,FILE=MESHF,ERR=999)

and specify FORM='FORMATTED' if the file is indeed so.
0 Kudos
turkeydodo
Beginner
3,905 Views

It seems to me it looks like a memory corruption. Small deleted version can pass with no problem. I have checked the compiling options you mentioned. As you can see below, they are already enabled

/nologo /debug:full /Od /gen-interfaces /warn:interfaces /real_size:64 /module:"x64\Debug\" /object:"x64\Debug\" /traceback /check:bounds /libs:static /threads /dbglibs /c

Have you heard that recent windows 7 update affect this version ofintel visual fortran?

Intel Visual Fortran Compiler Integration Package ID: w_cprof_p_11.1.067

Intel Visual Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.1.3471.2008, Copyright (C) 2002-2010 Intel Corporation

As I mentioned before, all program runs well before Monday. The issue comes out just after this windows 7 update.

0 Kudos
Steven_L_Intel1
Employee
3,905 Views
I am not aware of any effect of Windows 7 updates. But anything that changes the memory layout can affect programs thast make incorrect address references.

Windows 7 adds the additional complication that running the same (buggy) program twice can give different results because of Address Space Layout Randomization.
0 Kudos
turkeydodo
Beginner
3,905 Views
I found that after many calls to the following subroutine reader(), finally I got the runtime error (66) output overflow, could you help on this? I am using visual studio 2008 and error message is

Debu Assertion Failed

File: f:\dd\vctools\crt_bld\self_x86\crt\src\winsig.c
Line: 419

Expression: ("Invalid signal or error",0)

and in the console window

forrtl: severe (66): output statement overflows record, unit6, file CONNOUT$

see the code:

subroutine Reader(Line,iLine,NLine,Nword,Words)

implicit none

integer :: iLine,NLine

integer :: Nword

character(len=256) :: Words(32)

character(len=256) :: Line(800)

integer :: TWord

integer :: i, j, leng, single, Code


Code=0

Tword = 0

do while(iLine<=NLine)

call Parser(Line(iLine),Nword,Words(Tword+1))

if(Nword==0 .or. Words(Tword+1)(1:1)=="$") then

iLine=iLine+1

cycle

endif

if (Words(Tword+Nword)(1:2)=="+ ") THEN

Tword=Tword+Nword-1

iLine=iLine+1

cycle

else

Tword=Tword+Nword

iLine=iLine+1

exit

endif

enddo

return

end


subroutine Parser(Line,Nword,Words)

use Symbols

implicit none

integer :: i, j, k, l, flag, Nword

character(len=256) :: Line, Words(32)

l=len_trim(Line)

Nword=0

j=0

flag=0

do i=1,l

if(Line(i:i)==QUOTE) then

flag=1

cycle

endif

if(flag==0) then

if(Line(i:i)==SPACE .or. Line(i:i)==COMMA .or. Line(i:i)==char(9)) then !char(9) is tab key

j=0

cycle

endif

endif

if(j==0) then

Nword=Nword+1

k=i

Words(Nword)=""

endif

Words(Nword)(1+i-k:1+i-k)=Line(i:i)

j=1

enddo

do i=Nword+1, 32

Words(i)=""

enddo

return

end





0 Kudos
Steven_L_Intel1
Employee
3,905 Views
There's no I/O in any of that code. On which statement does the error occur?

This particular error happens if you write a record that exceeds the maximum length specified when the file was opened. The default record length for formatted files is 132. You can raise this with a RECL= value on the OPEN.
0 Kudos
Reply