next up previous contents index
Next: 4.2 Example of UIO Up: 4 UIO Data Format Previous: 4 UIO Data Format   Contents   Index

4.1 Quickstart: Introduction to UIO

The UIO (``Universal Input Output'') routines are a set of routines in Fortran90 and IDL to manage I/O of scalars, arrays and a certain table type. Files can be formatted or unformatted. The formatted (ASCII text) data representation is machine-independent and appropriate for human reading (for short files).

The binary representation uses the Fortran ``unformatted'' read and write routines, provides much faster I/O, gives smaller files, and the IEEE format is a quasi-standard among many platforms/compilers. On all machines the native binary representation can be chosen. On some platforms additional conversion types are offered (IEEE on most machines, CRAY format an CRAYs).

The Fortran standard does not guarantee that unformatted (i.e. also UIO) files are readable on all machines. But it is always possible to produce (formatted) UIO files on a machine which are readable on all others. And with some fiddling with compile options or the call of machine-specific subroutines provided by the compiler vendor it was up to now always possible to enable the access to binary UIO files (of one common format: IEEE big_endian) on all machines and compilers tested: Compaq alpha, Cray, Hitachi, HP V2500, HP Itanium2, IBM, Intel/AMD (with Linux OS and PGI, Intel, or Pathscale compiler), NEC SX-5, SGI, and Sun. Problems might arise with the transition to records larger than 2 GByte which require an extension of the current standard. The GNU Fortran compilers (particularly g95) might introduce a 64-bit system that does not allow to read older 32-bit files (even small ones).

Each file entry is a header-data-unit. The header contains information to identify the entry and to specify the format and size of the following data block. This block usually consists of a scalar or an array. In some cases it is empty (e.g. for labels) or it contains more complex information (for tables).

The first version of UIO routines was written in FORTRAN77. It still exists. However, further development was done with the Fortran90 versions. Therefore, the use of the FORTRAN77 routines is not recommended anymore. The current Fortran version of the UIO routines is a set of Fortran90 modules.

To allow a communication between Fortran and IDL programs, an IDL version of the UIO routines has been written. The correspondence between Fortran and IDL routines is rather close. But in detail, there are differences. Currently, IDL Version 6.0 is used. Amazingly, the UIO routines also used to work under PV-WAVE (Version 6.01, sun4 solaris sparc).

So far, there exist three UNIX shell scripts (calling Fortran routines) useful to quickly examine data sets or to change the format or conversion type of files. The installation of these scripts with a ``configure-make-make install'' sequence is described in Sect. 4.6.1.

Without these scripts an UIO file in ASCII format can be examined with any text editor or with more. To get an overview about the contents of a binary file the command

  strings -30 uio_example_file.dat
can be useful.

next up previous contents index
Next: 4.2 Example of UIO Up: 4 UIO Data Format Previous: 4 UIO Data Format   Contents   Index