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