A file is opened with
ret = zio_uf_open(filedesc,iocomm,unit,file,access,recl,...)
Variables will be written to or read from the file file using unit number unit in access mode access, using the I/O staging communicator, iocomm. Note that unit, file, access, recl, etc. are the usual Fortran open statement arguments. Such an I/O channel is established and the handle for that is returned in filedesc.
When sequential-access is specified, the process 0 of the staging communicator will be the staging process for subsequent serial I/O.
Variables are written to or read from the file associated with the file descriptor filedesc using
ret = zio_uf_read_double(filedesc,distarray,arr,rec)
ret = zio_uf_write_double(filedesc,distarray,arr,rec)
where rec is the global record number in the file (direct-access I/O; can be omitted for sequential-access I/O), distarray is the distributed array descriptor for the variable, and arr is the buffer containing the local distributed data. If the current process's parallel subdomain is made of multiple separate blocks, arr contains all the local data contiguously one block after another, following the block order used to define distarray.
When only an array section of a variable is to be written or read, the section must be specified with istart (beginning indices; one-based) and icount (numbers of array elements) arrays.
ret = zio_uf_read_double(filedesc,distarray,arr,rec,istart,icount)
ret = zio_uf_write_double(filedesc,distarray,arr,rec,istart,icount)
Note that istart and icount must be in the local array's index order (not the output index order, if those index orders are different).
If a distributed array descriptor is stored in the descriptor list,
one can use instead of the descriptor the variable's name (that
is, character string) that was used to store it in the list. See
Section
.
ret = zio_uf_read_double_name(filedesc,varname,arr,rec,istart,icount)
ret = zio_uf_write_double_name(filedesc,varname,arr,rec,istart,icount)
I/O for four-byte real and four-byte integer arrays can be similarly
done with zio_uf_read_real, zio_uf_read_real_name,
zio_uf_read_int, zio_uf_read_int_name,
zio_uf_write_real,
zio_uf_write_real_name,
zio_uf_write_int, and zio_uf_read_int_name.
A file is closed with
ret = zio_uf_close(filedesc)