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

Problems due to change in unformatted file structure

ferrad01
Beginner
948 Views
As detailed in a previous thread, we have discovered that the structure of unformatted files has changed between CVF6.6 and Intel 11.1.

Intel built executables cannot read the CVF 6.6 structure unless the project is compiled with /fpscomp:ioformat.

We have a dilemma regarding this backwards incompatibility: all our products currently in the marketplace use CVF 6.6 and hence all our users have all their unformatted files in the CVF structure. Various of our products are designed to read these files, and will now fail in the READ unless we specify /fpscomp:ioformat.

However if we specify /fpscomp:ioformat, I understand this will affect the WRITE behavior as well as the READ: hence we will be pertuating the (old) CVF format within our products into the future, which I am reluctant to do, since this feature may well be deprecated in the future.

I also understand there is no conversion utility to convert from one file type to the other.

Please advise how best we should proceed.

Adrian
0 Kudos
11 Replies
Steven_L_Intel1
Employee
948 Views
Provide a program which wrote and read the file in CVF, and a sample of the data file which you say Intel Fortran can't read. Zip these and attach to a reply here.

The unformatted file format did not change. It may be that you unintentionally used /fpscomp:ioformat under CVF.
0 Kudos
ferrad01
Beginner
948 Views
Steve,
I replied under separate thread, but I attach the examples here as well.

Here is a zip file containing 2 identical fortran files which write 3 values to an unformatted file, one compiled with CVF 6.6, the other with Intel 11.1. The generated unformatted output files are also attached which show the different structures.

test_dig.for compiled with:

c:\progra~1"microsoft visual studio"\df98\bin\dfvars
fl32 test_dig.for

test_intel.for compiled with:

C:\Program Files\Intel\Compiler\11.1\060\Bin\ifortvars.bat" ia32
ifort test_intel.for

Adrian
0 Kudos
Steven_L_Intel1
Employee
948 Views
Answered in the other thread. It's your use of "fl32", the Microsoft Fortran PowerStation command verb (which CVF supported) that gives you /fpscomp:ioformat implicitly. The default unformatted I/O format did not change.
0 Kudos
ferrad01
Beginner
948 Views
Steve,
Is there a description of the old PowerStation structure? If so, it should be relatively easy to write a converter program to read the old format and write the new.

Adrian
0 Kudos
bbradley
Beginner
948 Views
This link:

<>

provides a good description of PowerStation file formats, including one for "unformatted sequential file". These appear to be identical to those found in

"Fortran PowerStation Programmer's Guide" Version 4.0 1995: Page 170, Unformatted Sequential Files

0 Kudos
mecej4
Honored Contributor III
948 Views
Converting the MS format is a bit more complicated because you don't know how long the whole record is until you reach the end of it

and, one may add, having to provide for the possibility that there may be records in the file whose logical length is too big to be represented as a four-byte integer.
0 Kudos
Steven_L_Intel1
Employee
948 Views
MS didn't support such large records, so that should not be a problem. The DEC/Intel format allows for larger records - the layout is also documented - but the Lahey program I wrote assumes that there won't be records larger than 1GB.
0 Kudos
ferrad01
Beginner
948 Views
Thanks for this. Is there an equivalent page in the documentation for the 'new' format? ie. I'd like to see the differences between olfd and new formats for :

Formatted Sequential
Formatted Direct
Unformatted Sequential
Unformatted Direct
Binary Sequential
Binary Direct

Adrian
0 Kudos
Steven_L_Intel1
Employee
948 Views
The default DEC/Compaq/Intel layout is also documented in that chapter. I will note that the unformatted format has not changed in our product since - um - forever, so I would not call it 'new'. The difference you are seeing is strictly between Microsoft Fortran PowerStation and the DEC layout (shared with most Linux, UNIX and Windows compilers).

For "Binary" files, these are just a stream of bytes - there is no record layout. Formatted files for both compilers have CR-LF line terminators. Direct access files have no record lengths in the data. The last time we made a change of any nature was when we introduced a method for representing records longer than 1GB, which appears only for those records. That was back in the 1990s. This is the same method current gfortran uses (they switched to adopt our approach.)
0 Kudos
ferrad01
Beginner
948 Views
I'm writing code now to deal with the structure changes for unformatted sequential files between PS and Intel.

So I just need to make sure that I do not have to worry about the other 5 formats. Please confirm.

Adrian
0 Kudos
Steven_L_Intel1
Employee
948 Views
As far as I know, you do not have to worry about the other formats.
0 Kudos
Reply