JOINT   INSTITUTE   FOR   NUCLEAR   RESEARCH
lit PROGRAM   LIBRARY   JINRLIB

UFF2UFF - unformatted data files convertor


Author: A.P.Sapozhnikov
rus
You are
counter
visitor here.

Language: Pascal/Delphi


Unconsistence of files written via "unformatted WRITE" operators is a common problem for Fortran-users.
Here is a typical complaint:

'I have 2 Fortran-written programs, "W" and "R".
"W" creates binary files using WRITE(1) ... operators.
"R" reads these files using the same READ(1)... operators.
Yesterday all was fine. But now I'd recollected "R" using another fortran-compiler, and all got broken!!!'

Actually the binary file, opened via OPEN(1, form=unformatted, ...) clause, is not quite unformatted! Each logical record, written by WRITE(1) operator, contains incorporated auxiliary data. Different compilers have different structure of these auxiliary data, even these compilers leave in the same computer!

The problem may get rather serious, if the source of "W" program is unavailable or lost, but migration "R" program under new compiler is absolutely necessary. It's for this problem UFF2UFF was developed.

The usage is easy: run UFF2UFF.EXE, choose source and target filenames and their types, then press "Start" button.

A bit about these types:
  • MicroSoft Fortran 5.xx hashes each logical record into the pieces not more then 128-bytes length, adding 1 auxiliary byte before each piece.
  • WatCom Fortran hashes each logical record into the pieces not more then 1024-bytes length, enclosing each piece by 4 auxiliary bytes.
  • MicroSoft PowerStation Fortran, called later Visual DEC Fortran, called later Compaq Fortran, encloses the whole logical record by 4-bytes numbers, containing record length.
  • Lahey Fortran tries to minimize auxiliary bytes, using rather complicated algorithm for short logical records.

It's not always possible to automatically recognize source file type. That's way you must know, what compiler was used for "W"-program! As for target file, we added a feature to write it as "Binary", i.e. without any auxiliary data.

Sources of UFF2UFF are submitted.




home up e-mail