1 |
cnh |
1.4 |
\section{RW Basic binary I/O utilities} |
2 |
cnh |
1.2 |
\label{sec:pkg:rw} |
3 |
cnh |
1.3 |
The {\tt rw} package provides a very rudimentary binary I/O capability |
4 |
|
|
for quickly writing {\it single record} direct-access Fortran binary files. |
5 |
cnh |
1.2 |
It is primarily used for writing diagnostic output. |
6 |
cnh |
1.3 |
|
7 |
cnh |
1.2 |
\subsection{Introduction} |
8 |
cnh |
1.3 |
Package {\tt rw} is an interface to the more general {\tt mdsio} package. |
9 |
|
|
The {\tt rw} package can be used to write or read direct-access Fortran |
10 |
|
|
binary files for two-dimensional XY and three-dimensional XYZ arrays. |
11 |
|
|
The arrays are assumed to have been decalred according to the standard |
12 |
cnh |
1.4 |
MITgcm two-dimensional or the-dimensional floating poit array type |
13 |
|
|
(see figure \ref{fig:pkg:rw:standarddeclaration}). |
14 |
|
|
|
15 |
|
|
\begin{figure} |
16 |
cnh |
1.3 |
\begin{verbatim} |
17 |
|
|
C Example of declaring a standard two dimensional "long" floating |
18 |
|
|
C point type array (the _RL macro is usually mapped to 64-bit |
19 |
|
|
C floats in most configurations) |
20 |
|
|
_RL anArray(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy) |
21 |
|
|
\end{verbatim} |
22 |
cnh |
1.4 |
\caption{An example of the fixed form Fortran declaration for a |
23 |
|
|
standard MITgcm two-dimensional array type. } |
24 |
|
|
\label{fig:pkg:rw:standarddeclaration} |
25 |
|
|
\end{figure} |
26 |
|
|
|
27 |
cnh |
1.3 |
Each call to an {\tt rw} read or write routine will read (or write) to the |
28 |
cnh |
1.4 |
first record of a file. To write direct access Fortran files with |
29 |
|
|
multiple records use the package {\tt mdsio} (see section |
30 |
|
|
\ref{sec:pkg:mdsio}). To write self-describing files that contain |
31 |
|
|
embedded information describing the variables being written and |
32 |
|
|
the spatial and temporal locations of those variables use the |
33 |
|
|
package {\tt mnc} (see section \ref{sec:pkg:mnc}) which produces |
34 |
|
|
\htlink{netCDF}{http://www.unidata.ucar.edu/packages/netcdf} |
35 |
|
|
\cite{rew:97} based output. |
36 |
cnh |
1.2 |
|
37 |
cnh |
1.1 |
\subsection{Key subroutines, parameters and files} |
38 |
|
|
\label{sec:pkg:rw:implementation_synopsis} |
39 |
cnh |
1.4 |
The {\tt rw} package has |
40 |
cnh |
1.1 |
\subsection{Package Reference} |