Commit 0d84e48d authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

Docu update

parent 7c711ada
...@@ -7,15 +7,28 @@ CDI - Climate Data Interface ...@@ -7,15 +7,28 @@ CDI - Climate Data Interface
CDI is a C and Fortran Interface to access Climate model Data. CDI is a C and Fortran Interface to access Climate model Data.
Supported file formats are GRIB, netCDF, SERVICE, EXTRA and IEG. Supported file formats are GRIB, netCDF, SERVICE, EXTRA and IEG.
CDI is licensed under the GNU General Public License, version 2.
Read the file COPYING in the source distribution for details.
Documentation: Documentation:
Not available. ANSI C Manual: ./doc/cdi_cman.pdf
Fortran Manual: ./doc/cdi_fman.pdf
Installation: Installation:
Read INSTALL on how to configure, compile and install the library. 1. Run ./configure, with some options if you wish. The standard
The configuration script has some more environment variables. options are documented in the INSTALL file. The configuration
Type 'configure -h' to see them. script has some more options; type 'configure -h' to see them.
The most interesting ones are the usual
--prefix=<installation directory> and
--with-netcdf=<netCDF root directory> to enable netCDF support.
2. Do "make" to compile the library.
3. (Optional) Do "make install", possibly as root if the destination
permissions require that. This installs CDI in the directory
specified during configuration. The default prefix is /usr/local.
Porting: Porting:
...@@ -27,5 +40,5 @@ Porting: ...@@ -27,5 +40,5 @@ Porting:
Contact: Contact:
Send questions, comments and bug reports to schulzweida@dkrz.de Send questions, comments and bug reports to Uwe.Schulzweida@zmaw.de
\chapter{\label{example}Examples} \chapter{\label{example}Examples}
This appendix contains complete examples to write, read This appendix contains complete examples to write, read
and copy a dataset with the CDI library. and copy a dataset with the \CDI library.
\section{\label{example_write}Write a dataset} \section{\label{example_write}Write a dataset}
Here is an example using CDI to write a netCDF dataset with Here is an example using \CDI to write a netCDF dataset with
2 variables on 3 time steps. The first variable is a 2D field 2 variables on 3 time steps. The first variable is a 2D field
on surface level and the second variable is a 3D field on 5 pressure on surface level and the second variable is a 3D field on 5 pressure
levels. Both variables are on the same lon/lat grid. levels. Both variables are on the same lon/lat grid.
......
...@@ -15,8 +15,8 @@ The function {\tt gridCreate} creates a horizontal Grid. ...@@ -15,8 +15,8 @@ The function {\tt gridCreate} creates a horizontal Grid.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt gridtype\ } \begin{deflist}{\tt gridtype\ }
\item[{\tt gridtype}] \item[{\tt gridtype}]
The type of the grid, one of the set of predefined CDI grid types. The type of the grid, one of the set of predefined \CDI grid types.
The valid CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN}, The valid \CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN},
{\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME}, {\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME},
{\tt GRID\_CURVILINEAR} and {\tt GRID\_CELL}. {\tt GRID\_CURVILINEAR} and {\tt GRID\_CELL}.
\item[{\tt size}] \item[{\tt size}]
...@@ -88,7 +88,7 @@ The function {\tt gridDuplicate} duplicates a horizontal Grid. ...@@ -88,7 +88,7 @@ The function {\tt gridDuplicate} duplicates a horizontal Grid.
\begin{deflist}{\tt gridID\ } \begin{deflist}{\tt gridID\ }
\item[{\tt gridID}] \item[{\tt gridID}]
Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}}, Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}},
{\tt gridDuplicate} or {\tt vlistInqVarGrid}. {\htmlref{\tt gridDuplicate}{gridDuplicate}} or {\htmlref{\tt vlistInqVarGrid}{vlistInqVarGrid}}.
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -122,8 +122,8 @@ Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}} ...@@ -122,8 +122,8 @@ Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}}
\subsubsection*{Result} \subsubsection*{Result}
{\tt gridInqType} returns the type of the grid, {\tt gridInqType} returns the type of the grid,
one of the set of predefined CDI grid types. one of the set of predefined \CDI grid types.
The valid CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN}, The valid \CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN},
{\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME}, {\tt GRID\_CURVILINEAR} {\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME}, {\tt GRID\_CURVILINEAR}
and {\tt GRID\_CELL}. and {\tt GRID\_CELL}.
......
Every C file that references CDI functions or constants must contain Every C file that references \CDI functions or constants must contain
an appropriate {\tt include} statement before the first such reference: an appropriate {\tt include} statement before the first such reference:
\begin{verbatim} \begin{verbatim}
...@@ -15,11 +15,11 @@ the compiler, to specify a directory where {\tt cdi.h} is installed, for example ...@@ -15,11 +15,11 @@ the compiler, to specify a directory where {\tt cdi.h} is installed, for example
Alternatively, you could specify an absolute path name in the {\tt include} Alternatively, you could specify an absolute path name in the {\tt include}
statement, but then your program would not compile on another platform statement, but then your program would not compile on another platform
where CDI is installed in a different location. where \CDI is installed in a different location.
Unless the CDI library is installed in a standard directory where the linker Unless the \CDI library is installed in a standard directory where the linker
always looks, you must use the {\tt -L} and {\tt -l} options to links an object file that always looks, you must use the {\tt -L} and {\tt -l} options to links an object file that
uses the CDI library. For example: uses the \CDI library. For example:
\begin{verbatim} \begin{verbatim}
cc -o myprogram myprogram.o -L/usr/local/cdi/lib -lcdi -lm cc -o myprogram myprogram.o -L/usr/local/cdi/lib -lcdi -lm
...@@ -31,7 +31,7 @@ Alternatively, you could specify an absolute path name for the library: ...@@ -31,7 +31,7 @@ Alternatively, you could specify an absolute path name for the library:
cc -o myprogram myprogram.o -L/usr/local/cdi/lib/libcdi -lm cc -o myprogram myprogram.o -L/usr/local/cdi/lib/libcdi -lm
\end{verbatim} \end{verbatim}
If the CDI library is using other external libraries, you must add this If the \CDI library is using other external libraries, you must add this
libraries in the same way. libraries in the same way.
For example with the netCDF library: For example with the netCDF library:
......
...@@ -16,8 +16,8 @@ The function {\tt streamOpenWrite} creates a new datset. ...@@ -16,8 +16,8 @@ The function {\tt streamOpenWrite} creates a new datset.
\item[{\tt path}] \item[{\tt path}]
The name of the new dataset The name of the new dataset
\item[{\tt filetype}] \item[{\tt filetype}]
The type of the file format, one of the set of predefined CDI file format types. The type of the file format, one of the set of predefined \CDI file format types.
The valid CDI file format types are {\tt FILETYPE\_GRB}, {\tt FILETYPE\_NC}, The valid \CDI file format types are {\tt FILETYPE\_GRB}, {\tt FILETYPE\_NC},
{\tt FILETYPE\_NC2}, {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} and {\tt FILETYPE\_IEG}. {\tt FILETYPE\_NC2}, {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} and {\tt FILETYPE\_IEG}.
\end{deflist} \end{deflist}
...@@ -167,8 +167,8 @@ Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead} ...@@ -167,8 +167,8 @@ Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead}
\subsubsection*{Result} \subsubsection*{Result}
{\tt streamInqFiletype} returns the type of the file format, {\tt streamInqFiletype} returns the type of the file format,
one of the set of predefined CDI file format types. one of the set of predefined \CDI file format types.
The valid CDI file format types are {\tt FILETYPE\_GRB}, {\tt FILETYPE\_NC}, The valid \CDI file format types are {\tt FILETYPE\_GRB}, {\tt FILETYPE\_NC},
{\tt FILETYPE\_NC2}, {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} and {\tt FILETYPE\_IEG}. {\tt FILETYPE\_NC2}, {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} and {\tt FILETYPE\_IEG}.
...@@ -191,7 +191,7 @@ with the file format type {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} or {\tt FILET ...@@ -191,7 +191,7 @@ with the file format type {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} or {\tt FILET
\item[{\tt streamID}] \item[{\tt streamID}]
Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead}} or {\htmlref{\tt streamOpenWrite}{streamOpenWrite}} Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead}} or {\htmlref{\tt streamOpenWrite}{streamOpenWrite}}
\item[{\tt byteorder}] \item[{\tt byteorder}]
The byte order of a dataset, one of the CDI constants {\tt CDI\_BIGENDIAN} and The byte order of a dataset, one of the \CDI constants {\tt CDI\_BIGENDIAN} and
{\tt CDI\_LITTLEENDIAN}. {\tt CDI\_LITTLEENDIAN}.
\end{deflist} \end{deflist}
...@@ -222,7 +222,7 @@ Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead} ...@@ -222,7 +222,7 @@ Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead}
\subsubsection*{Result} \subsubsection*{Result}
{\tt streamInqByteorder} returns the type of the byte order. {\tt streamInqByteorder} returns the type of the byte order.
The valid CDI byte order types are {\tt CDI\_BIGENDIAN} and {\tt CDI\_LITTLEENDIAN} The valid \CDI byte order types are {\tt CDI\_BIGENDIAN} and {\tt CDI\_LITTLEENDIAN}
......
...@@ -15,8 +15,8 @@ The function {\tt taxisCreate} creates a Time axis. ...@@ -15,8 +15,8 @@ The function {\tt taxisCreate} creates a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxistype\ } \begin{deflist}{\tt taxistype\ }
\item[{\tt taxistype}] \item[{\tt taxistype}]
The type of the Time axis, one of the set of predefined CDI time axis types. The type of the Time axis, one of the set of predefined \CDI time axis types.
The valid CDI time axis types are {\tt TAXIS\_ABSOLUTE} and {\tt TAXIS\_RELATIVE}. The valid \CDI time axis types are {\tt TAXIS\_ABSOLUTE} and {\tt TAXIS\_RELATIVE}.
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -78,7 +78,7 @@ The function {\tt taxisDefVdate} defines the reference date of a Time axis. ...@@ -78,7 +78,7 @@ The function {\tt taxisDefVdate} defines the reference date of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\item[{\tt rdate}] \item[{\tt rdate}]
Reference date (YYYYMMDD) Reference date (YYYYMMDD)
...@@ -101,7 +101,7 @@ The function {\tt taxisInqRdate} returns the reference date of a Time axis. ...@@ -101,7 +101,7 @@ The function {\tt taxisInqRdate} returns the reference date of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -127,7 +127,7 @@ The function {\tt taxisDefVdate} defines the reference time of a Time axis. ...@@ -127,7 +127,7 @@ The function {\tt taxisDefVdate} defines the reference time of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\item[{\tt rtime}] \item[{\tt rtime}]
Reference time (HHMM) Reference time (HHMM)
...@@ -150,7 +150,7 @@ The function {\tt taxisInqRtime} returns the reference time of a Time axis. ...@@ -150,7 +150,7 @@ The function {\tt taxisInqRtime} returns the reference time of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -176,7 +176,7 @@ The function {\tt taxisDefVdate} defines the verification date of a Time axis. ...@@ -176,7 +176,7 @@ The function {\tt taxisDefVdate} defines the verification date of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\item[{\tt vdate}] \item[{\tt vdate}]
Verification date (YYYYMMDD) Verification date (YYYYMMDD)
...@@ -199,7 +199,7 @@ The function {\tt taxisInqVdate} returns the verification date of a Time axis. ...@@ -199,7 +199,7 @@ The function {\tt taxisInqVdate} returns the verification date of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -225,7 +225,7 @@ The function {\tt taxisDefVtime} defines the verification time of a Time axis. ...@@ -225,7 +225,7 @@ The function {\tt taxisDefVtime} defines the verification time of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\item[{\tt vtime}] \item[{\tt vtime}]
Verification time (HHMM) Verification time (HHMM)
...@@ -248,7 +248,7 @@ The function {\tt taxisInqVtime} returns the verification time of a Time axis. ...@@ -248,7 +248,7 @@ The function {\tt taxisInqVtime} returns the verification time of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -274,10 +274,10 @@ The function {\tt taxisDefCalendar} defines the calendar of a Time axis. ...@@ -274,10 +274,10 @@ The function {\tt taxisDefCalendar} defines the calendar of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt calendar\ } \begin{deflist}{\tt calendar\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\item[{\tt calendar}] \item[{\tt calendar}]
The type of the calendar, one of the set of predefined CDI calendar types. The type of the calendar, one of the set of predefined \CDI calendar types.
The valid CDI calendar types are {\tt CALENDAR\_STANDARD}, {\tt CALENDAR\_360DAYS}, The valid \CDI calendar types are {\tt CALENDAR\_STANDARD}, {\tt CALENDAR\_360DAYS},
{\tt CALENDAR\_365DAYS} and {\tt CALENDAR\_366DAYS}. {\tt CALENDAR\_365DAYS} and {\tt CALENDAR\_366DAYS}.
\end{deflist} \end{deflist}
...@@ -299,7 +299,7 @@ The function {\tt taxisInqCalendar} returns the calendar of a Time axis. ...@@ -299,7 +299,7 @@ The function {\tt taxisInqCalendar} returns the calendar of a Time axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt taxisID\ } \begin{deflist}{\tt taxisID\ }
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -307,7 +307,7 @@ Time axis ID, from a previous call to {\tt taxisCreate} ...@@ -307,7 +307,7 @@ Time axis ID, from a previous call to {\tt taxisCreate}
\subsubsection*{Result} \subsubsection*{Result}
{\tt taxisInqCalendar} returns the type of the calendar, {\tt taxisInqCalendar} returns the type of the calendar,
one of the set of predefined CDI calendar types. one of the set of predefined \CDI calendar types.
The valid CDI calendar types are {\tt CALENDAR\_STANDARD}, {\tt CALENDAR\_360DAYS}, The valid \CDI calendar types are {\tt CALENDAR\_STANDARD}, {\tt CALENDAR\_360DAYS},
{\tt CALENDAR\_365DAYS} and {\tt CALENDAR\_366DAYS}. {\tt CALENDAR\_365DAYS} and {\tt CALENDAR\_366DAYS}.
...@@ -238,7 +238,7 @@ The function {\tt vlistDefTaxis} defines the time axis of a variable list. ...@@ -238,7 +238,7 @@ The function {\tt vlistDefTaxis} defines the time axis of a variable list.
\item[{\tt vlistID}] \item[{\tt vlistID}]
Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}} Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate}}
\item[{\tt taxisID}] \item[{\tt taxisID}]
Time axis ID, from a previous call to {\tt taxisCreate} Time axis ID, from a previous call to {\htmlref{\tt taxisCreate}{taxisCreate}}
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
......
...@@ -21,8 +21,8 @@ Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}} ...@@ -21,8 +21,8 @@ Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}}
\item[{\tt zaxisID}] \item[{\tt zaxisID}]
Z-axis ID, from a previous call to {\htmlref{\tt zaxisCreate}{zaxisCreate}} Z-axis ID, from a previous call to {\htmlref{\tt zaxisCreate}{zaxisCreate}}
\item[{\tt timeID}] \item[{\tt timeID}]
One of the set of predefined CDI time identifiers. One of the set of predefined \CDI time identifiers.
The valid CDI time identifiers are {\tt TIME\_CONSTANT} and {\tt TIME\_VARIABLE}. The valid \CDI time identifiers are {\tt TIME\_CONSTANT} and {\tt TIME\_VARIABLE}.
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -291,7 +291,7 @@ Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate ...@@ -291,7 +291,7 @@ Variable list ID, from a previous call to {\htmlref{\tt vlistCreate}{vlistCreate
Variable identifier Variable identifier
\item[{\tt datatype}] \item[{\tt datatype}]
The data type identifier. The data type identifier.
The valid CDI data types are {\tt DATATYPE\_PACK1}, {\tt DATATYPE\_PACK2}, The valid \CDI data types are {\tt DATATYPE\_PACK1}, {\tt DATATYPE\_PACK2},
{\tt DATATYPE\_PACK3}, {\tt DATATYPE\_REAL4} and {\tt DATATYPE\_REAL8}. {\tt DATATYPE\_PACK3}, {\tt DATATYPE\_REAL4} and {\tt DATATYPE\_REAL8}.
...@@ -324,7 +324,7 @@ Variable identifier ...@@ -324,7 +324,7 @@ Variable identifier
\subsubsection*{Result} \subsubsection*{Result}
{\tt vlistInqVarDatatype} returns an identifier to the data type of the variable. {\tt vlistInqVarDatatype} returns an identifier to the data type of the variable.
The valid CDI data types are {\tt DATATYPE\_PACK1}, {\tt DATATYPE\_PACK2}, {\tt DATATYPE\_PACK3}, The valid \CDI data types are {\tt DATATYPE\_PACK1}, {\tt DATATYPE\_PACK2}, {\tt DATATYPE\_PACK3},
{\tt DATATYPE\_REAL4} and {\tt DATATYPE\_REAL8}. {\tt DATATYPE\_REAL4} and {\tt DATATYPE\_REAL8}.
......
...@@ -15,8 +15,8 @@ The function {\tt zaxisCreate} creates a vertical Z-axis. ...@@ -15,8 +15,8 @@ The function {\tt zaxisCreate} creates a vertical Z-axis.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt zaxistype\ } \begin{deflist}{\tt zaxistype\ }
\item[{\tt zaxistype}] \item[{\tt zaxistype}]
The type of the Z-axis, one of the set of predefined CDI Z-axis types. The type of the Z-axis, one of the set of predefined \CDI Z-axis types.
The valid CDI Z-axis types are {\tt ZAXIS\_GENERIC}, {\tt ZAXIS\_SURFACE}, The valid \CDI Z-axis types are {\tt ZAXIS\_GENERIC}, {\tt ZAXIS\_SURFACE},
{\tt ZAXIS\_HYBRID}, {\tt ZAXIS\_PRESSURE}, {\tt ZAXIS\_HEIGHT}, {\tt ZAXIS\_HYBRID}, {\tt ZAXIS\_PRESSURE}, {\tt ZAXIS\_HEIGHT},
{\tt ZAXIS\_DEPTH\_BELOW\_SEA} and {\tt ZAXIS\_DEPTH\_BELOW\_LAND}. {\tt ZAXIS\_DEPTH\_BELOW\_SEA} and {\tt ZAXIS\_DEPTH\_BELOW\_LAND}.
\item[{\tt size}] \item[{\tt size}]
...@@ -90,8 +90,8 @@ Z-axis ID, from a previous call to {\htmlref{\tt zaxisCreate}{zaxisCreate}} ...@@ -90,8 +90,8 @@ Z-axis ID, from a previous call to {\htmlref{\tt zaxisCreate}{zaxisCreate}}
\subsubsection*{Result} \subsubsection*{Result}
{\tt zaxisInqType} returns the type of the Z-axis, {\tt zaxisInqType} returns the type of the Z-axis,
one of the set of predefined CDI Z-axis types. one of the set of predefined \CDI Z-axis types.
The valid CDI Z-axis types are {\tt ZAXIS\_GENERIC}, {\tt ZAXIS\_SURFACE}, The valid \CDI Z-axis types are {\tt ZAXIS\_GENERIC}, {\tt ZAXIS\_SURFACE},
{\tt ZAXIS\_HYBRID}, {\tt ZAXIS\_PRESSURE}, {\tt ZAXIS\_HEIGHT}, {\tt ZAXIS\_HYBRID}, {\tt ZAXIS\_PRESSURE}, {\tt ZAXIS\_HEIGHT},
{\tt ZAXIS\_DEPTH\_BELOW\_SEA} and {\tt ZAXIS\_DEPTH\_BELOW\_LAND}. {\tt ZAXIS\_DEPTH\_BELOW\_SEA} and {\tt ZAXIS\_DEPTH\_BELOW\_LAND}.
......
This module contains functions to read and write the data. This module contains functions to read and write the data.
To create a new dataset the output format must be specified To create a new dataset the output format must be specified
with one of the following predefined file types: with one of the following predefined file format types:
\vspace*{3mm} \vspace*{3mm}
\hspace*{8mm}\begin{minipage}{15cm} \hspace*{8mm}\begin{minipage}{15cm}
...@@ -15,9 +15,11 @@ with one of the following predefined file types: ...@@ -15,9 +15,11 @@ with one of the following predefined file types:
\end{minipage} \end{minipage}
\vspace*{3mm} \vspace*{3mm}
NetCDF is only available if the \CDI library was compiled with netCDF support!
To set the byte order of a binary dataset with the file format To set the byte order of a binary dataset with the file format
type {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} or {\tt FILETYPE\_IEG} use one of the type {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} or {\tt FILETYPE\_IEG} use one of the
following constants in the call to {\htmlref{\tt streamDefByteorder}{streamDefByteorder}}: following predefined constants in the call to {\htmlref{\tt streamDefByteorder}{streamDefByteorder}}:
\vspace*{3mm} \vspace*{3mm}
\hspace*{8mm}\begin{minipage}{15cm} \hspace*{8mm}\begin{minipage}{15cm}
......
\chapter{\label{example}Examples} \chapter{\label{example}Examples}
This appendix contains complete examples to write, read This appendix contains complete examples to write, read
and copy a dataset with the CDI library. and copy a dataset with the \CDI library.
\section{\label{example_write}Write a dataset} \section{\label{example_write}Write a dataset}
Here is an example using CDI to write a netCDF dataset with Here is an example using \CDI to write a netCDF dataset with
2 variables on 3 time steps. The first variable is a 2D field 2 variables on 3 time steps. The first variable is a 2D field
on surface level and the second variable is a 3D field on 5 pressure on surface level and the second variable is a 3D field on 5 pressure
levels. Both variables are on the same lon/lat grid. levels. Both variables are on the same lon/lat grid.
......
...@@ -15,8 +15,8 @@ The function {\tt gridCreate} creates a horizontal Grid. ...@@ -15,8 +15,8 @@ The function {\tt gridCreate} creates a horizontal Grid.
\hspace*{4mm}\begin{minipage}[]{15cm} \hspace*{4mm}\begin{minipage}[]{15cm}
\begin{deflist}{\tt gridtype\ } \begin{deflist}{\tt gridtype\ }
\item[{\tt gridtype}] \item[{\tt gridtype}]
The type of the grid, one of the set of predefined CDI grid types. The type of the grid, one of the set of predefined \CDI grid types.
The valid CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN}, The valid \CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN},
{\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME}, {\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME},
{\tt GRID\_CURVILINEAR} and {\tt GRID\_CELL}. {\tt GRID\_CURVILINEAR} and {\tt GRID\_CELL}.
\item[{\tt size}] \item[{\tt size}]
...@@ -88,7 +88,7 @@ The function {\tt gridDuplicate} duplicates a horizontal Grid. ...@@ -88,7 +88,7 @@ The function {\tt gridDuplicate} duplicates a horizontal Grid.
\begin{deflist}{\tt gridID\ } \begin{deflist}{\tt gridID\ }
\item[{\tt gridID}] \item[{\tt gridID}]
Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}}, Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}},
{\tt gridDuplicate} or {\tt vlistInqVarGrid}. {\htmlref{\tt gridDuplicate}{gridDuplicate}} or {\htmlref{\tt vlistInqVarGrid}{vlistInqVarGrid}}.
\end{deflist} \end{deflist}
\end{minipage} \end{minipage}
...@@ -122,8 +122,8 @@ Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}} ...@@ -122,8 +122,8 @@ Grid ID, from a previous call to {\htmlref{\tt gridCreate}{gridCreate}}
\subsubsection*{Result} \subsubsection*{Result}
{\tt gridInqType} returns the type of the grid, {\tt gridInqType} returns the type of the grid,
one of the set of predefined CDI grid types. one of the set of predefined \CDI grid types.
The valid CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN}, The valid \CDI grid types are {\tt GRID\_GENERIC}, {\tt GRID\_GAUSSIAN},
{\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME}, {\tt GRID\_CURVILINEAR} {\tt GRID\_LONLAT}, {\tt GRID\_SPECTRAL}, {\tt GRID\_GME}, {\tt GRID\_CURVILINEAR}
and {\tt GRID\_CELL}. and {\tt GRID\_CELL}.
......
Every FORTRAN file that references CDI functions or constants must contain Every FORTRAN file that references \CDI functions or constants must contain
an appropriate {\tt INCLUDE} statement before the first such reference: an appropriate {\tt INCLUDE} statement before the first such reference:
\begin{verbatim} \begin{verbatim}
...@@ -15,11 +15,11 @@ the compiler, to specify a directory where {\tt cdi.inc} is installed, for examp ...@@ -15,11 +15,11 @@ the compiler, to specify a directory where {\tt cdi.inc} is installed, for examp
Alternatively, you could specify an absolute path name in the {\tt INCLUDE} Alternatively, you could specify an absolute path name in the {\tt INCLUDE}
statement, but then your program would not compile on another platform statement, but then your program would not compile on another platform
where CDI is installed in a different location. where \CDI is installed in a different location.
Unless the CDI library is installed in a standard directory where the linker Unless the \CDI library is installed in a standard directory where the linker
always looks, you must use the {\tt -L} and {\tt -l} options to links an object file that always looks, you must use the {\tt -L} and {\tt -l} options to links an object file that
uses the CDI library. For example: uses the \CDI library. For example:
\begin{verbatim} \begin{verbatim}
f77 -o myprogram myprogram.o -L/usr/local/cdi/lib -lcdi f77 -o myprogram myprogram.o -L/usr/local/cdi/lib -lcdi
...@@ -31,7 +31,7 @@ Alternatively, you could specify an absolute path name for the library: ...@@ -31,7 +31,7 @@ Alternatively, you could specify an absolute path name for the library:
f77 -o myprogram myprogram.o -L/usr/local/cdi/lib/libcdi f77 -o myprogram myprogram.o -L/usr/local/cdi/lib/libcdi
\end{verbatim} \end{verbatim}
If the CDI library is using other external libraries, you must add this If the \CDI library is using other external libraries, you must add this
libraries in the same way. libraries in the same way.
For example with the netCDF library: For example with the netCDF library:
......
...@@ -16,8 +16,8 @@ The function {\tt streamOpenWrite} creates a new datset. ...@@ -16,8 +16,8 @@ The function {\tt streamOpenWrite} creates a new datset.
\item[{\tt path}] \item[{\tt path}]
The name of the new dataset The name of the new dataset
\item[{\tt filetype}] \item[{\tt filetype}]
The type of the file format, one of the set of predefined CDI file format types. The type of the file format, one of the set of predefined \CDI file format types.
The valid CDI file format types are {\tt FILETYPE\_GRB}, {\tt FILETYPE\_NC}, The valid \CDI file format types are {\tt FILETYPE\_GRB}, {\tt FILETYPE\_NC},
{\tt FILETYPE\_NC2}, {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} and {\tt FILETYPE\_IEG}. {\tt FILETYPE\_NC2}, {\tt FILETYPE\_SRV}, {\tt FILETYPE\_EXT} and {\tt FILETYPE\_IEG}.
\end{deflist} \end{deflist}
...@@ -167,8 +167,8 @@ Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead} ...@@ -167,8 +167,8 @@ Stream ID, from a previous call to {\htmlref{\tt streamOpenRead}{streamOpenRead}