od -h output

od -h output

How to interpret this part of the file:
0000000 0018 0000 0000 0000 0000 0000 0000 3f80
0000020 d70a 3ca3 0000 0000 126f 3a03 0000 0000
0000040 0018 0000 0000 0000 0018 0000 0000 0000
0000060 0000 3e80 0000 3f80 d70a 3ca3 0000 0000
0000100 126f 3a03 0000 0000 0018 0000 0000 0000
0000120 0018 0000 0000 0000 0000 3f00 0000 3f80
0000140 d70a 3ca3 0000 0000 126f 3a03 0000 0000
0000160 0018 0000 0000 0000 0018 0000 0000 0000
0000200 0000 3f40 0000 3f80 d70a 3ca3 0000 0000
0000220 126f 3a03 0000 0000 0018 0000 0000 0000
0000240 0018 0000 0000 0000 0000 3f80 0000 3f80
0000260 d70a 3ca3 0000 0000 126f 3a03 0000 0000
How to know record length, data type?
How to see if there is header or trailer?

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

For a given compiler (+options) and platform, the content of a Fortran unformatted file is uniquely determined by the WRITE statement.

The converse, however, is not true. In other words, given only the unformatted file and not knowing the origin of the file, it is generally impossible to reconstruct the data. If you know the compiler and platform used, the number of possibilities get reduced, but the non-uniqueness still remains.

Not every compiler vendor publishes details on the structure of unformatted files. Therefore, what you are asking to be done is next to impossible.

The layout of unformatted records is described in the documentation. There is no "header record". Each record is preceded and followed by a 32-bit record length value. Record lengths longer than about 1GB are represented as a series of subrecords.

I can't make out what the layout of this dump is. It doesn't match any Fortran unformatted format I know of.

Steve - Intel Developer Support

Thanks both of you.
I have actually made this file to use it as input file in a main program.The ASCII file looks like this:
1.000 1.000 .020 .000 .000 -1
.000 1.000 .020 5.215 .050 1
0.250 1.000 .020 5.208 .050 1
0.500 1.000 .020 5.173 .050 1
0.750 1.000 .020 5.308 .050 1
1.000 1.000 .020 5.215 .050 1
1.250 1.000 .020 5.208 .050 1
1.500 1.000 .020 5.173 .050 1
1.750 1.000 .020 5.308 .050 1
2.000 1.000 .020 5.207 .050 1
2.250 1.000 .020 5.208 .050 1
2.500 1.000 .020 5.340 .050 1
2.750 1.000 .020 5.208 .050 1
3.000 1.000 .020 5.348 .050 1
And goes on unitl 30.
I want to correlate this two,because one is ASCII and one binary.I am using Intel 11.1Linux Fortran on X86-64 machine.

Which compiler wrote the binary file? Looking at it again, it looks like g77 or a very old version of gfortran on an x64 system. It has 64-bit record lengths which Intel Fortran does not use.

Steve - Intel Developer Support

Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072

How do you see that it has 64bit record length?
This is the code the I have compiled with ifort.
character*72 ifname,ofname
c
write(*, fmt="(/'Enter input file name')")
read(5,85) ifname
85 format(a72)
write(*, fmt="(/'Enter output file name')")
read(5,85) ofname
open(unit=11, file=ifname, status='old')
open(unit=12, file=ofname, form='unformatted')
n=0
100 read(11,5, end=999) x,y,z,t,u,i
5 format(5f10.3,i3)
write(12) x,y,z,t,u,i
n=n+1
go to 100
999 write(6,1) n
1 format(/'number of lines in file: ',i10/)
stop
end

Leave a Comment

Please sign in to add a comment. Not a member? Join today