<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 2002-2-1 (1.71) original version by: Nikos Drakos, CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>B.2.1 NetCDF files</TITLE> <META NAME="description" CONTENT="B.2.1 NetCDF files"> <META NAME="keywords" CONTENT="GMT_Docs"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1"> <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> <LINK REL="STYLESHEET" HREF="GMT_Docs.css"> <LINK REL="next" HREF="node182.html"> <LINK REL="previous" HREF="node180.html"> <LINK REL="up" HREF="node180.html"> <LINK REL="next" HREF="node182.html"> </HEAD> <BODY bgcolor="#ffffff"> <!--Navigation Panel--> <A NAME="tex2html5225" HREF="node182.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html5219" HREF="node180.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html5213" HREF="node180.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html5221" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html5223" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html5226" HREF="node182.html">B.2.2 Gridline and Pixel</A> <B> Up:</B> <A NAME="tex2html5220" HREF="node180.html">B.2 Grid files</A> <B> Previous:</B> <A NAME="tex2html5214" HREF="node180.html">B.2 Grid files</A> <B> <A NAME="tex2html5222" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html5224" HREF="node256.html">Index</A></B> <BR> <BR> <!--End of Navigation Panel--> <H2><A NAME="SECTION001921000000000000000"></A> <A NAME="29260"></A> <A NAME="29261"></A> <A NAME="29262"></A> <BR> B.2.1 NetCDF files </H2> <P> By default, <A NAME="tex2html1653" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> stores 2-D grids as COARDS-compliant netCDF files. COARDS (which stands for Cooperative Ocean/Atmosphere Research Data Service) is a convention used by many agencies distributing gridded data for ocean and atmosphere research. Sticking to this convention allows <A NAME="tex2html1654" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> to read gridded data provided by other institutes and other programs. Conversely, other general domain programs will be able to read grids created by <A NAME="tex2html1655" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A>. COARDS is a subset of a more extensive convention for netCDF data called CF-1.0 (Climate and Forecast, version 1.0). Hence, <A NAME="tex2html1656" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> grids are also automatically CF-1.0-compliant. However, since CF-1.0 has more general application than COARDS, not all CF-1.0 compliant netCDF files can be read by <A NAME="tex2html1657" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A>. <P> The netCDF grid file in <A NAME="tex2html1658" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> has several attributes (See Table <A HREF="#tbl:netcdf-format">B.1</A>) to describe the content. The routine that deals with netCDF grid files is sufficiently flexible so that grid files slightly deviating from the standards used by <A NAME="tex2html1659" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> can also be read. <P> <BR><P></P> <DIV ALIGN="CENTER"><A NAME="29283"></A> <TABLE> <CAPTION><STRONG>Table:</STRONG> Attributes of default <A NAME="tex2html1650" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> grid file in COARDS-compliant netCDF format.</CAPTION> <TR><TD> <DIV ALIGN="CENTER"><TABLE CELLPADDING=3 BORDER="1"> <TR><TD ALIGN="CENTER" COLSPAN=1><I>Attribute</I></TD> <TD ALIGN="CENTER" COLSPAN=1><I>Description</I></TD> </TR> <TR><TD ALIGN="CENTER" COLSPAN=2><I>Global attributes</I></TD> </TR> <TR><TD ALIGN="LEFT">Conventions</TD> <TD ALIGN="LEFT">COARDS, CF-1.0 (optional)</TD> </TR> <TR><TD ALIGN="LEFT">title</TD> <TD ALIGN="LEFT">Title (optional)</TD> </TR> <TR><TD ALIGN="LEFT">source</TD> <TD ALIGN="LEFT">How file was created (optional)</TD> </TR> <TR><TD ALIGN="LEFT">node_offset</TD> <TD ALIGN="LEFT">0 for gridline node registration (default), 1 for pixel registration</TD> </TR> <TR><TD ALIGN="CENTER" COLSPAN=2><I><IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img4.png" ALT="$x$">- and <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img30.png" ALT="$y$">-variable attributes</I></TD> </TR> <TR><TD ALIGN="LEFT">long_name</TD> <TD ALIGN="LEFT">Coordinate name (default: ``Longitude'' and ``Latitude'')</TD> </TR> <TR><TD ALIGN="LEFT">units</TD> <TD ALIGN="LEFT">Unit of the coordinate (default: ``degrees_east'' and ``degrees_north'')</TD> </TR> <TR><TD ALIGN="LEFT">actual_range</TD> <TD ALIGN="LEFT">Minimum and maximum <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img4.png" ALT="$x$"> and <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img30.png" ALT="$y$"> of region; if absent</TD> </TR> <TR><TD ALIGN="LEFT">(or valid_range)</TD> <TD ALIGN="LEFT">the first and last <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img4.png" ALT="$x$">- and <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img30.png" ALT="$y$">-values are queried</TD> </TR> <TR><TD ALIGN="CENTER" COLSPAN=2><I><IMG WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img20.png" ALT="$z$">-variable attributes</I></TD> </TR> <TR><TD ALIGN="LEFT">long_name</TD> <TD ALIGN="LEFT">Name of the variable (default: ``z'')</TD> </TR> <TR><TD ALIGN="LEFT">units</TD> <TD ALIGN="LEFT">Unit of the variable (no default)</TD> </TR> <TR><TD ALIGN="LEFT">scale_factor</TD> <TD ALIGN="LEFT">Factor to multiply <IMG WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img20.png" ALT="$z$"> with (default: 1)</TD> </TR> <TR><TD ALIGN="LEFT">add_offset</TD> <TD ALIGN="LEFT">Offset to add to scaled <IMG WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img20.png" ALT="$z$"> (default: 0)</TD> </TR> <TR><TD ALIGN="LEFT">actual_range</TD> <TD ALIGN="LEFT">Minimum and maximum <IMG WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img20.png" ALT="$z$"> (optional)</TD> </TR> <TR><TD ALIGN="LEFT">_FillValue</TD> <TD ALIGN="LEFT">Value associated with missing data points; if absent an</TD> </TR> <TR><TD ALIGN="LEFT">(or missing_value)</TD> <TD ALIGN="LEFT">appropriate default value is assumed, depending on data type.</TD> </TR> </TABLE> <A NAME="tbl:netcdf-format"></A></DIV></TD></TR> </TABLE> </DIV><P></P> <BR> <P> By default, the first 2-dimensional variable in a netCDF file will by read as the <IMG WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img20.png" ALT="$z$"> variable and the coordinate axes <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img4.png" ALT="$x$"> and <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img30.png" ALT="$y$"> will be determined from the dimensions of the <IMG WIDTH="10" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img20.png" ALT="$z$"> variable. <A NAME="tex2html1660" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> will recognize whether the <IMG WIDTH="11" HEIGHT="29" ALIGN="MIDDLE" BORDER="0" SRC="img30.png" ALT="$y$"> (latitude) variable increases or decreases. Both forms of data storage are handled appropriately. <P> For more information on the use of COARDS-compliant netCDF files, and on how to load multi-dimensional grids, read Section <A HREF="node73.html#sec:netcdf">4.18</A>. <P> <A NAME="tex2html1661" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> also allows other formats to be read. In addition to the default netCDF format it can use binary floating points, short integers, bytes, and bits, as well as 8-bit Sun raster files (colormap ignored). Additional formats may be used by supplying read/write functions and linking these with the <A NAME="tex2html1662" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> libraries. The source file <U>gmt_customio.c</U> has the information that programmers will need to augment <A NAME="tex2html1663" HREF="http://gmt.soest.hawaii.edu"><B>GMT</B></A> to read custom grid files. We anticipate that the number of pre-programmed formats will increase as enterprising users implement what they need. See Section <A HREF="node72.html#sec:grdformats">4.17</A> for more information. <P> <A NAME="29289"></A> <A NAME="29290"></A> <A NAME="29291"></A> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html5225" HREF="node182.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A> <A NAME="tex2html5219" HREF="node180.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A> <A NAME="tex2html5213" HREF="node180.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A> <A NAME="tex2html5221" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A> <A NAME="tex2html5223" HREF="node256.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="index.png"></A> <BR> <B> Next:</B> <A NAME="tex2html5226" HREF="node182.html">B.2.2 Gridline and Pixel</A> <B> Up:</B> <A NAME="tex2html5220" HREF="node180.html">B.2 Grid files</A> <B> Previous:</B> <A NAME="tex2html5214" HREF="node180.html">B.2 Grid files</A> <B> <A NAME="tex2html5222" HREF="node1.html">Contents</A></B> <B> <A NAME="tex2html5224" HREF="node256.html">Index</A></B> <!--End of Navigation Panel--> <ADDRESS> Paul Wessel 2010-07-14 </ADDRESS> </BODY> </HTML>