Quick Start Guide for using io_tools.f90 and read_field.m (Matlab)
------------------------------------------------------------------

1.  Put read_field.m in whatever directory you keep Matlab functions
(defined by environment variable MATLABPATH in your .cshrc or equivalent).

2.  Compile io_tools.f90 in with the rest of your code.  Where ever you
use calls to functions in this module in code, you need a 

    use io_tools

3.  Somewhere near where you initialize the program, put the line

    call Pass_params(datadir,recunit) 

where recunit is an integer (set to 8 for Cray T90, SGI and most Linux
compilers, but 2 for DEC) and datadir is a string giving the location
where you want output written to.  Include final '/' on directory name.
e.g.

    call Pass_params('/home/bob/data/',8)

4.  To write array foo, which can be rank 0,1,2 or 3, real or complex
 
    call write_field(foo,'foofile')

which will write to datadir/foofile.bin
(if you are writing successive frames, as in a time-loop, use

    call write_field(foo,'foofile',frame)

where frame is an integer that you increment each time you call
function - thus if foo is 3D, you will ultimately make a 4D file)

5.  In Matlab, use 

foo = read_field('foofile',nx,ny,nz,frame, <other opts>); 

to read in array.  If foo is rank 0 or 1, only filename argument is
needed.  If rank 2, only filename and nx, etc.

6. The last thing to know is this:  depending on what architecture you
used to write the file originally and what arch you are using to run
Matlab, you may need to alter read_field defaults just slightly.  Right
now it assumes you are running Matlab on Linux or an SGI workstation,
and that data was written on Cray T90.  A likely change would be to change
ftyped = 's' to ftyped = 'n' (for 'native' machine architecture).