<html lang="en">
<head>
<title>NCO 3.0.0 User's Guide</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="NCO 3.0.0 User's Guide">
<meta name="generator" content="makeinfo 4.7">
<link title="Top" rel="top" href="#Top">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc { font-variant:small-caps }
  span.roman { font-family: serif; font-weight: normal; } 
--></style>
</head>
<body>
This file documents <acronym>NCO</acronym>, a collection of utilities to
manipulate and analyze netCDF files.

   <p>Copyright &copy; 1995&ndash;2005 Charlie Zender

   <p>This is the first edition of the <cite>NCO User's Guide</cite>,<br>
and is consistent with version&nbsp;2<!-- /@w --> of <span class="file">texinfo.tex</span>.

   <p>Permission is granted to copy, distribute and/or modify this document
under the terms of the <acronym>GNU</acronym> Free Documentation License, Version&nbsp;1.1<!-- /@w -->
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. The license is available online at
<a href="http://www.gnu.ai.mit.edu/copyleft/fdl.html">http://www.gnu.ai.mit.edu/copyleft/fdl.html</a>

   <p>The original author of this software, Charlie Zender, wants to improve it
with the help of your suggestions, improvements, bug-reports, and patches.<br>
Charlie Zender &lt;zender at uci dot edu&gt;<br>
Department of Earth System Science<br>
University of California at Irvine<br>
Irvine, CA 92697-3100<br>

<div class="node">
<p><hr>
<a name="Top"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Foreword">Foreword</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#dir">(dir)</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#dir">(dir)</a>
<br>
</div>

<h2 class="unnumbered">NCO User's Guide</h2>

<!-- node format: node-name, next, previous, up -->
<p><table class="cartouche" summary="cartouche" border="1"><tr><td>
<p><b>Note to readers of the NCO User's Guide in HTML format</b>:
<b>The <a href="./nco.pdf">NCO User's Guide in PDF format</a>
(also on <a href="http://nco.sf.net/nco.pdf">SourceForge</a>)
contains the complete NCO documentation.</b>
<br>This HTML documentation is equivalent except it refers you to the
printed (i.e., DVI, PostScript, and PDF) documentation for description
of complex mathematical expressions. </td></tr></table>

<p>The netCDF Operators, or <acronym>NCO</acronym>, are a suite of programs known as
operators. 
The operators facilitate manipulation and analysis of self-describing
data stored in the netCDF or HDF4 formats, which are freely available
(<a href="http://www.unidata.ucar.edu/packages/netcdf">http://www.unidata.ucar.edu/packages/netcdf</a> and
<a href="http://hdf.ncsa.uiuc.edu">http://hdf.ncsa.uiuc.edu</a>, respectively). 
Each <acronym>NCO</acronym> operator (e.g., ncks) takes netCDF or HDF input
file(s), performs an operation (e.g., averaging, hyperslabbing, or
renaming), and outputs a processed netCDF file. 
Although most users of netCDF and HDF data are involved in scientific
research, these data formats, and thus <acronym>NCO</acronym>, are generic and
are equally useful in fields like finance. 
The <acronym>NCO</acronym> User's Guide illustrates <acronym>NCO</acronym> use with
examples from the field of climate modeling and analysis. 
The <acronym>NCO</acronym> homepage is <a href="http://nco.sf.net">http://nco.sf.net</a>, and
there is a mirror at <a href="http://dust.ess.uci.edu/nco">http://dust.ess.uci.edu/nco</a>.

   <p>This documentation is for <acronym>NCO</acronym> version 3.0.0. 
Corrections, additions, and rewrites of this documentation are very
welcome.

   <p>Enjoy,<br>
Charlie Zender

<ul class="menu">
<li><a accesskey="1" href="#Foreword">Foreword</a>
<li><a accesskey="2" href="#Summary">Summary</a>
<li><a accesskey="3" href="#Introduction">Introduction</a>
<li><a accesskey="4" href="#Strategies">Strategies</a>
<li><a accesskey="5" href="#Common-features">Common features</a>
<li><a accesskey="6" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<li><a accesskey="7" href="#Contributing">Contributing</a>
<li><a accesskey="8" href="#General-Index">General Index</a>
</ul>

   <p><a name="fwd"></a> <!-- http://nco.sf.net/nco.html#fwd --><div class="node">
<p><hr>
<a name="Foreword"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Summary">Summary</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Top">Top</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="unnumbered">Foreword</h2>

<p><a name="index-foreword-1"></a><a name="index-Charlie-Zender-2"></a><acronym>NCO</acronym> is the result of software needs that arose while I worked
on projects funded by <acronym>NCAR</acronym>, <acronym>NASA</acronym>, and <acronym>ARM</acronym>. 
Thinking they might prove useful as tools or templates to others,
it is my pleasure to provide them freely to the scientific community. 
Many users (most of whom I have never met) have encouraged the
development of <acronym>NCO</acronym>. 
Thanks espcially to Jan Polcher, Keith Lindsay, Arlindo da Silva, John
Sheldon, and William Weibel for stimulating suggestions and
correspondence. 
Your encouragment motivated me to complete the <cite>NCO User's Guide</cite>. 
So if you like <acronym>NCO</acronym>, send me a note! 
I&nbsp;should<!-- /@w --> mention that <acronym>NCO</acronym> is not connected to or
officially endorsed by Unidata, <acronym>ACD</acronym>, <acronym>ASP</acronym>,
<acronym>CGD</acronym>, or Nike.<br>
   <pre class="sp">

</pre>
Charlie Zender<br>
May 1997<br>
Boulder, Colorado<br>

   <pre class="sp">


</pre>
Major feature improvements entitle me to write another Foreword. 
In the last five years a lot of work has been done refining
<acronym>NCO</acronym>. 
<a name="index-open-source-3"></a><acronym>NCO</acronym> is now an open source project and appears to be much
healthier for it. 
The list of illustrious institutions which do not endorse <acronym>NCO</acronym>
continues to grow, and now includes <acronym>UCI</acronym>.<br>
   <pre class="sp">

</pre>
Charlie Zender<br>
October 2000<br>
Irvine, California<br>

   <pre class="sp">


</pre>
The most remarkable advances in  <acronym>NCO</acronym> capabilities in the last
few years are due to contributions from the Open Source community. 
Especially noteworthy are the contributions of Henry Butowsky and Rorik
Peterson.<br>
   <pre class="sp">

</pre>
Charlie Zender<br>
January 2003<br>
Irvine, California<br>

   <p><a name="smr"></a> <!-- http://nco.sf.net/nco.html#smr --><div class="node">
<p><hr>
<a name="Summary"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Introduction">Introduction</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Foreword">Foreword</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="unnumbered">Summary</h2>

<p><a name="index-operators-4"></a><a name="index-summary-5"></a>This manual describes <acronym>NCO</acronym>, which stands for netCDF Operators. 
<acronym>NCO</acronym> is a suite of programs known as <dfn>operators</dfn>. 
Each operator is a standalone, command line program executed at the
shell-level like, e.g., <span class="command">ls</span> or <span class="command">mkdir</span>. 
The operators take netCDF file(s) (or <acronym>HDF4</acronym> files) as input,
perform an operation (e.g., averaging or hyperslabbing), and produce a
netCDF file as output. 
The operators are primarily designed to aid manipulation and analysis of
data. 
The examples in this documentation are typical applications of the
operators for processing climate model output. 
This reflects their origin, but the operators are as general as netCDF
itself.

   <p><a name="ntr"></a> <!-- http://nco.sf.net/nco.html#ntr --><div class="node">
<p><hr>
<a name="Introduction"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Strategies">Strategies</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Summary">Summary</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">1 Introduction</h2>

<p><a name="index-introduction-6"></a>

<ul class="menu">
<li><a accesskey="1" href="#Availability">Availability</a>
<li><a accesskey="2" href="#Compatability">Compatability</a>
<li><a accesskey="3" href="#Libraries">Libraries</a>
<li><a accesskey="4" href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a>
<li><a accesskey="5" href="#Help-and-Bug-reports">Help and Bug reports</a>
</ul>

<div class="node">
<p><hr>
<a name="Availability"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Compatability">Compatability</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.1 Availability</h3>

<p><a name="index-_0040acronym_007bNCO_007d-availability-7"></a><a name="index-source-code-8"></a>The complete <acronym>NCO</acronym> source distribution is currently distributed
as a <dfn>compressed tarfile</dfn> from
<a href="http://sf.net/projects/nco">http://sf.net/projects/nco</a>
and from
<a href="http://dust.ess.uci.edu/nco/nco.tar.gz">http://dust.ess.uci.edu/nco/nco.tar.gz</a>. 
The compressed tarfile must be uncompressed and untarred before building
<acronym>NCO</acronym>. 
Uncompress the file with <span class="samp">gunzip nco.tar.gz</span>. 
Extract the source files from the resulting tarfile with <span class="samp">tar -xvf
nco.tar</span>. 
<acronym>GNU</acronym> <code>tar</code> lets you perform both operations in one step
with <span class="samp">tar -xvzf nco.tar.gz</span>.

   <p><a name="index-documentation-9"></a><a name="index-WWW-documentation-10"></a><a name="index-on_002dline-documentation-11"></a><a name="index-_0040acronym_007bHTML_007d-12"></a><a name="index-_0040TeX_007b_007dinfo-13"></a><a name="index-Info-14"></a><a name="index-_0040cite_007bUser_0027s-Guide_007d-15"></a><a name="index-_0040cite_007bNCO-User_0027s-Guide_007d-16"></a>The documentation for <acronym>NCO</acronym> is called the
<cite>NCO User's Guide</cite>. 
The <cite>User's Guide</cite> is available in Postscript, <acronym>HTML</acronym>,
<acronym>DVI</acronym>, TeXinfo, and Info formats. 
These formats are included in the source distribution in the files
<span class="file">nco.ps</span>, <span class="file">nco.html</span>, <span class="file">nco.dvi</span>, <span class="file">nco.texi</span>, and
<span class="file">nco.info*</span>, respectively. 
All the documentation descends from a single source file,
<span class="file">nco.texi</span>
<a rel="footnote" href="#fn-1" name="fnd-1"><sup>1</sup></a>. 
Hence the documentation in every format is very similar. 
However, some of the complex mathematical expressions needed to describe
<span class="command">ncwa</span> can only be displayed in <acronym>DVI</acronym>, Postscript, and
<acronym>PDF</acronym> formats.

   <p><a name="index-_0040acronym_007bNCO_007d-homepage-17"></a>If you want to quickly see what the latest improvements in <acronym>NCO</acronym>
are (without downloading the entire source distribution), visit the
<acronym>NCO</acronym> homepage at
<a href="http://nco.sf.net">http://nco.sf.net</a>. 
The <acronym>HTML</acronym> version of the <cite>User's Guide</cite> is also available
online through the World Wide Web at <acronym>URL</acronym>
<a href="http://nco.sf.net/nco.html">http://nco.sf.net/nco.html</a>. 
<a name="index-netCDF-18"></a>To build and use <acronym>NCO</acronym>, you must have netCDF installed. 
The netCDF homepage is
<a href="http://www.unidata.ucar.edu/packages/netcdf">http://www.unidata.ucar.edu/packages/netcdf</a>.

   <p>New <acronym>NCO</acronym> releases are announced on the netCDF list
and on the <code>nco-announce</code> mailing list
<a href="http://lists.sf.net/mailman/listinfo/nco-announce">http://lists.sf.net/mailman/listinfo/nco-announce</a>.

<div class="node">
<p><hr>
<a name="Compatability"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Libraries">Libraries</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Availability">Availability</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.2 Operating systems compatible with <acronym>NCO</acronym></h3>

<p><a name="index-_0040acronym_007bOS_007d-19"></a><a name="index-_0040acronym_007bIBM_007d-20"></a><a name="index-_0040acronym_007bNEC_007d-21"></a><a name="index-_0040acronym_007bSGI_007d-22"></a><a name="index-_0040acronym_007bHP_007d-23"></a><a name="index-_0040acronym_007bDEC_007d-24"></a><a name="index-Cray-25"></a><a name="index-Digital-26"></a><a name="index-Sun-27"></a><a name="index-Intel-28"></a><a name="index-Comeau-29"></a><a name="index-Compaq-30"></a><a name="index-Macintosh-31"></a><a name="index-Microsoft-32"></a><a name="index-Windows-33"></a><a name="index-compatability-34"></a><a name="index-portability-35"></a><a name="index-installation-36"></a><acronym>NCO</acronym> has been successfully ported and tested and is known to
work on the following 32- and 64-bit platforms:
<!-- alphabetize by OS name -->
<acronym>IBM AIX</acronym> 4.x, 5.x,
FreeBSD 4.x,
<acronym>GNU</acronym>/Linux 2.x, LinuxPPC, LinuxAlpha, LinuxARM, LinuxSparc64,
<acronym>SGI IRIX</acronym> 5.x and 6.x,
MacOS&nbsp;X<!-- /@w --> 10.x,
<acronym>NEC</acronym> Super-UX 10.x,
<acronym>DEC OSF</acronym>,
Sun SunOS 4.1.x, Solaris 2.x,
<acronym>Cray UNICOS</acronym> 8.x&ndash;10.x,
and MS Windows95 and all later versions. 
If you port the code to a new operating system, please send me a note
and any patches you required.

   <p><a name="index-_0040acronym_007bUNIX_007d-37"></a><a name="index-Unidata-38"></a><a name="index-UDUnits-39"></a>The major prerequisite for installing <acronym>NCO</acronym> on a particular
platform is the successful, prior installation of the netCDF library
(and, as of 2003, the UDUnits library). 
Unidata has shown a commitment to maintaining netCDF and UDUnits on all
popular <acronym>UNIX</acronym> platforms, and is moving towards full support for
the Microsoft Windows operating system (<acronym>OS</acronym>). 
Given this, the only difficulty in implementing <acronym>NCO</acronym> on a
particular platform is standardization of various C and Fortran
interface and system calls. 
<acronym>NCO</acronym> code is tested for <acronym>ANSI</acronym> compliance by
compiling with C&nbsp;compilers<!-- /@w --> including those from
<a name="index-_0040command_007bCC_007d-40"></a><a name="index-_0040command_007bc_002b_002b_007d-41"></a><a name="index-_0040command_007bcc_007d-42"></a><a name="index-_0040command_007bcomo_007d-43"></a><a name="index-_0040command_007bcxx_007d-44"></a><a name="index-_0040command_007bgcc_007d-45"></a><a name="index-_0040command_007bicc_007d-46"></a><a name="index-_0040command_007bxlC_007d-47"></a><a name="index-_0040command_007bxlc_007d-48"></a><acronym>GNU</acronym> (<span class="samp">gcc -std=c99 -pedantic -D_BSD_SOURCE -D_POSIX_SOURCE</span> -Wall)
<a rel="footnote" href="#fn-2" name="fnd-2"><sup>2</sup></a>,
Comeau Computing (<span class="samp">como --c99</span>),
Cray (<span class="samp">cc</span>),
<acronym>HP</acronym>/Compaq/<acronym>DEC</acronym> (<span class="samp">cc</span>),
<acronym>IBM</acronym> (<span class="samp">xlc -c -qlanglvl=extc99</span>),
Intel (<span class="samp">icc</span>),
<acronym>NEC</acronym> (<span class="samp">cc</span>),
<acronym>SGI</acronym> (<span class="samp">cc -LANG:std</span>),
and
Sun (<span class="samp">cc</span>). 
<a name="index-C_002b_002b-49"></a><a name="index-_0040acronym_007bISO_007d-50"></a><a name="index-_0040command_007blibnco_007d-51"></a><acronym>NCO</acronym> (all commands and the <span class="command">libnco</span> library) and
the C++ interface to netCDF (called <span class="command">libnco_c++</span>) comply with
the <acronym>ISO</acronym> C++ standards as implemented by
Comeau Computing (<span class="samp">como</span>),
Cray (<span class="samp">CC</span>),
<acronym>GNU</acronym> (<span class="samp">g++ -Wall</span>),
<acronym>HP</acronym>/Compaq/<acronym>DEC</acronym> (<span class="samp">cxx</span>),
<acronym>IBM</acronym> (<span class="samp">xlC</span>),
Intel (<span class="samp">icc</span>),
<acronym>NEC</acronym> (<span class="samp">c++</span>),
<acronym>SGI</acronym> (<span class="samp">CC -LANG:std</span>),
and
Sun (<span class="samp">CC -LANG:std</span>). 
<a name="index-_0040file_007bMakefile_007d-52"></a>See <span class="file">nco/bld/Makefile</span> and <span class="file">nco/src/nco_c++/Makefile.old</span> for
more details and exact settings.

   <p><a name="index-_0040acronym_007bANSI_007d-53"></a><a name="index-C89-54"></a><a name="index-_0040code_007bprintf_007d-55"></a>Until recently (and not even yet), <acronym>ANSI</acronym>-compliant has meant
compliance with the 1989 <acronym>ISO</acronym> C-standard, usually called C89 (with
minor revisions made in 1994 and 1995). 
C89 lacks variable-size arrays, restricted pointers, some useful
<code>printf</code> formats, and many mathematical special functions. 
<a name="index-C99-56"></a>These are valuable features of C99, the 1999 <acronym>ISO</acronym> C-standard. 
<acronym>NCO</acronym> is C99-compliant where possible and C89-compliant where
necessary. 
Certain branches in the code are required to satisfy the native
<acronym>SGI</acronym> and SunOS C&nbsp;compilers<!-- /@w -->, which are strictly <acronym>ANSI</acronym>
C89 compliant, and cannot benefit from C99 features. 
However, C99 features are fully supported by modern <acronym>AIX</acronym>,
<acronym>GNU</acronym>, Intel, <acronym>NEC</acronym>, Solaris, and <acronym>UNICOS</acronym>
compilers. 
<acronym>NCO</acronym> requires a C99-compliant compiler as of <acronym>NCO</acronym>
version&nbsp;2.9.8<!-- /@w -->, released in August, 2004.

   <p>The most time-intensive portion of <acronym>NCO</acronym> execution is spent in
arithmetic operations, e.g., multiplication, averaging, subtraction. 
These operations were performed in Fortran by default until August,
1999. 
This was a design decision based on the relative speed of Fortran-based
object code vs. C-based object code in late 1994. 
C&nbsp;compiler<!-- /@w --> vectorization capabilities have dramatically improved
since 1994. 
We have accordingly replaced all Fortran subroutines with C&nbsp;functions<!-- /@w -->. 
This greatly simplifies the task of building <acronym>NCO</acronym> on nominally
unsupported platforms. 
<a name="index-C-language-57"></a>As of August 1999, <acronym>NCO</acronym> built entirely in&nbsp;C<!-- /@w --> by default. 
This allowed <acronym>NCO</acronym> to compile on any machine with an
<acronym>ANSI</acronym> C&nbsp;compiler<!-- /@w -->. 
<a name="index-C99-58"></a><a name="index-C89-59"></a><a name="index-_0040code_007brestrict_007d-60"></a>In August 2004, the first C99 feature, the <code>restrict</code> type
qualifier, entered <acronym>NCO</acronym> in version 2.9.8. 
C&nbsp;compilers<!-- /@w --> can obtain better performance with C99 restricted
pointers since they inform the compiler when it may make Fortran-like
assumptions regarding pointer contents alteration. 
Subsequently, <acronym>NCO</acronym> requires a C99 compiler to build correctly
<a rel="footnote" href="#fn-3" name="fnd-3"><sup>3</sup></a>.

   <p><a name="index-_0040var_007bgamma_007d-61"></a>In June 2005, <acronym>NCO</acronym> version 3.0.1 began to take advantage
of C99 mathematical special functions. 
These include the standarized gamma function (called <code>tgamma()</code>
for &ldquo;true gamma&rdquo;). 
<a name="index-automagic-62"></a><acronym>NCO</acronym> may automagically takes advantage of some extensions
to <acronym>ANSI</acronym>&nbsp;C<!-- /@w --> when compiled with the <acronym>GNU</acronym> Compiler
Collection, <acronym>GCC</acronym>.

   <p>As of July 2000 and <acronym>NCO</acronym> version&nbsp;1.2<!-- /@w -->, <acronym>NCO</acronym> no
longer supports performing arithmetic operations in Fortran. 
We decided to sacrifice executable speed for code maintainability. 
Since no objective statistics were ever performed to quantify
the difference in speed between the Fortran and C&nbsp;code<!-- /@w -->,
the performance penalty incurred by this decision is unknown. 
Supporting Fortran involves maintaining two sets of routines for every
arithmetic operation. 
The <code>USE_FORTRAN_ARITHMETIC</code> flag is still retained in the
<span class="file">Makefile</span>. 
The file containing the Fortran code, <span class="file">nco_fortran.F</span>, has been
deprecated but a volunteer (Dr.&nbsp;Frankenstein<!-- /@w -->?) could resurrect it. 
If you would like to volunteer to maintain <span class="file">nco_fortran.F</span> please
contact me.

<!-- Following section is obsolete -->
<ul class="menu">
<li><a accesskey="1" href="#Windows-Operating-System">Windows Operating System</a>
</ul>

   <p><a name="wnd"></a> <!-- http://nco.sf.net/nco.html#wnd --><div class="node">
<p><hr>
<a name="Windows-Operating-System"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Compatability">Compatability</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Compatability">Compatability</a>
<br>
</div>

<h4 class="subsection">1.2.1 Compiling <acronym>NCO</acronym> for Microsoft Windows <acronym>OS</acronym></h4>

<p><a name="index-Windows-63"></a><a name="index-Microsoft-64"></a><a name="index-XP-_0028Microsoft-operating-system_0029-65"></a><a name="index-NT-_0028Microsoft-operating-system_0029-66"></a>
<acronym>NCO</acronym> has been successfully ported and tested on the Microsoft
Windows (95/98/NT/2000/XP) operating systems. 
The switches necessary to accomplish this are included in the standard
distribution of <acronym>NCO</acronym>. 
Using the freely available Cygwin (formerly gnu-win32) development
environment
<a rel="footnote" href="#fn-4" name="fnd-4"><sup>4</sup></a>, the compilation process is very similar to
installing <acronym>NCO</acronym> on a <acronym>UNIX</acronym> system. 
<a name="index-preprocessor-tokens-67"></a><a name="index-Cygwin-68"></a><a name="index-_0040code_007bgnu_002dwin32_007d-69"></a><a name="index-_0040code_007bWIN32_007d-70"></a><a name="index-_0040file_007bGNUmakefile_007d-71"></a><a name="index-_0040file_007bMakefile_007d-72"></a><a name="index-_0040code_007bf90_007d-73"></a>Set the <code>PVM_ARCH</code> preprocessor token to <code>WIN32</code>. 
Note that defining <code>WIN32</code> has the side effect of disabling
Internet features of <acronym>NCO</acronym> (see below). 
<acronym>NCO</acronym> should now build like it does on <acronym>UNIX</acronym>.

   <p><a name="index-_0040acronym_007bUNIX_007d-74"></a><a name="index-_0040code_007bgetuid_007d-75"></a><a name="index-_0040code_007bgethostname_007d-76"></a><a name="index-_0040file_007b_003carpa_002fnameser_002eh_003e_007d-77"></a><a name="index-_0040file_007b_003cresolv_002eh_003e_007d-78"></a>The least portable section of the code is the use of standard
<acronym>UNIX</acronym> and Internet protocols (e.g., <code>ftp</code>, <code>rcp</code>,
<code>scp</code>, <code>getuid</code>, <code>gethostname</code>, and header files
<span class="file">&lt;arpa/nameser.h&gt;</span> and
<span class="file">&lt;resolv.h&gt;</span>). 
<a name="index-_0040code_007bftp_007d-79"></a><a name="index-_0040code_007brcp_007d-80"></a><a name="index-_0040code_007bscp_007d-81"></a><a name="index-_0040acronym_007bSSH_007d-82"></a><a name="index-remote-files-83"></a>Fortunately, these <acronym>UNIX</acronym>-y calls are only invoked by the single
<acronym>NCO</acronym> subroutine which is responsible for retrieving files
stored on remote systems (see <a href="#Remote-storage">Remote storage</a>). 
In order to support <acronym>NCO</acronym> on the Microsoft Windows platforms,
this single feature was disabled (on Windows <acronym>OS</acronym> only). 
This was required by Cygwin&nbsp;18.x<!-- /@w -->&mdash;newer versions of Cygwin may
support these protocols (let me know if this is the case). 
The <acronym>NCO</acronym> operators should behave identically on Windows and
<acronym>UNIX</acronym> platforms in all other respects.

   <p><a name="lbr"></a> <!-- http://nco.sf.net/nco.html#lbr --><div class="node">
<p><hr>
<a name="Libraries"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Compatability">Compatability</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.3 Libraries</h3>

<p><a name="index-libraries-84"></a><a name="index-_0040code_007bLD_005fLIBRARY_005fPATH_007d-85"></a><a name="index-dynamic-linking-86"></a><a name="index-static-linking-87"></a>Like all executables, the <acronym>NCO</acronym> operators can be built using dynamic
linking. 
<a name="index-performance-88"></a><a name="index-operator-speed-89"></a><a name="index-speed-90"></a><a name="index-execution-time-91"></a>This reduces the size of the executable and can result in significant
performance enhancements on multiuser systems. 
Unfortunately, if your library search path (usually the
<span class="env">LD_LIBRARY_PATH</span> environment variable) is not set correctly, or if
the system libraries have been moved, renamed, or deleted since
<acronym>NCO</acronym> was installed, it is possible <acronym>NCO</acronym> operators
will fail with a message that they cannot find a dynamically loaded (aka
<dfn>shared object</dfn> or <span class="samp">.so</span>) library. 
This will produce a distinctive error message, such as
<span class="samp">ld.so.1: /usr/local/bin/ncea: fatal: libsunmath.so.1: can't
open file: errno=2</span>. 
If you received an error message like this, ask your system
administrator to diagnose whether the library is truly missing
<a rel="footnote" href="#fn-5" name="fnd-5"><sup>5</sup></a>, or whether you
simply need to alter your library search path. 
As a final remedy, you may re-compile and install <acronym>NCO</acronym> with all
operators statically linked.

<div class="node">
<p><hr>
<a name="netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Help-and-Bug-reports">Help and Bug reports</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Libraries">Libraries</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.4 netCDF 2.x vs. 3.x and HDF Support</h3>

<p><a name="index-netCDF-2_002ex-92"></a><a name="index-netCDF-3_002ex-93"></a>netCDF version&nbsp;2.x<!-- /@w --> was released in 1993. 
<acronym>NCO</acronym> (specifically <span class="command">ncks</span>) began soon after this in 1994. 
netCDF&nbsp;3.0<!-- /@w --> was released in 1996, and we were eager to reap the
performance advantages of the newer netCDF implementation. 
One netCDF&nbsp;3.x<!-- /@w --> interface call (<code>nc_inq_libvers</code>) was added to
<acronym>NCO</acronym> in January, 1998, to aid in maintainance and debugging. 
In March, 2001, the final conversion of <acronym>NCO</acronym> to netCDF&nbsp;3.x<!-- /@w -->
was completed (coincidentally on the same day netCDF&nbsp;3.5<!-- /@w --> was
released). 
<acronym>NCO</acronym> versions&nbsp;2.0<!-- /@w --> and higher are built with the
<code>-DNO_NETCDF_2</code> flag to ensure no netCDF&nbsp;2.x<!-- /@w --> interface calls
are used. 
<a name="index-_0040code_007bNO_005fNETCDF_005f2_007d-94"></a>
<a name="index-_0040acronym_007bHDF_007d-95"></a><a name="index-Hierarchical-Data-Format-96"></a><a name="index-Mike-Folk-97"></a>However, the ability to compile <acronym>NCO</acronym> with only netCDF&nbsp;2.x<!-- /@w -->
calls is worth maintaining because <acronym>HDF</acronym> version&nbsp;4<!-- /@w -->
<a rel="footnote" href="#fn-6" name="fnd-6"><sup>6</sup></a>
(available from <a href="http://hdf.ncsa.uiuc.edu">HDF</a>)
supports only the netCDF&nbsp;2.x<!-- /@w --> library calls
(see <a href="http://hdf.ncsa.uiuc.edu/UG41r3_html/SDS_SD.fm12.html#47784">http://hdf.ncsa.uiuc.edu/UG41r3_html/SDS_SD.fm12.html#47784</a>). 
Note that there are multiple versions of <acronym>HDF</acronym>. 
Currently <acronym>HDF</acronym> version&nbsp;4.x<!-- /@w --> supports netCDF&nbsp;2.x<!-- /@w --> and thus
<acronym>NCO</acronym> version&nbsp;1.2.x<!-- /@w -->. 
If <acronym>NCO</acronym> version&nbsp;1.2.x<!-- /@w --> (or earlier) is built with only
netCDF&nbsp;2.x<!-- /@w --> calls then all <acronym>NCO</acronym> operators should work with
<acronym>HDF4</acronym> files as well as netCDF files
<a rel="footnote" href="#fn-7" name="fnd-7"><sup>7</sup></a>. 
<a name="index-_0040code_007bNETCDF2_005fONLY_007d-98"></a>The preprocessor token <code>NETCDF2_ONLY</code> exists
in <acronym>NCO</acronym> version&nbsp;1.2.x<!-- /@w --> to eliminate all netCDF&nbsp;3.x<!-- /@w -->
calls. 
Only versions of <acronym>NCO</acronym> numbered 1.2.x and earlier have this
capability. 
The <acronym>NCO</acronym>&nbsp;1.2.x<!-- /@w --> branch will be maintained with bugfixes only
(no new features) until <acronym>HDF</acronym> begins to fully support the
netCDF&nbsp;3.x<!-- /@w --> interface (which is employed by <acronym>NCO</acronym>&nbsp;2.x<!-- /@w -->). 
If, at compilation time, <code>NETCDF2_ONLY</code> is defined, then
<acronym>NCO</acronym> version&nbsp;1.2.x<!-- /@w --> will not use any netCDF&nbsp;3.x<!-- /@w --> calls
and, if linked properly, the resulting <acronym>NCO</acronym> operators will work
with <acronym>HDF4</acronym> files. 
<a name="index-_0040file_007bMakefile_007d-99"></a>The <span class="file">Makefile</span> supplied with <acronym>NCO</acronym>&nbsp;1.2.x<!-- /@w --> is written
to simplify building in this <acronym>HDF</acronym> capability. 
When <acronym>NCO</acronym> is built with <code>make HDF4=Y</code>, the <span class="file">Makefile</span>
sets all required preprocessor flags and library links to build
with the <acronym>HDF4</acronym> libraries (which are assumed to reside under
<code>/usr/local/hdf4</code>, edit the <span class="file">Makefile</span> to suit your
installation).

   <p><a name="index-Unidata-100"></a><a name="index-_0040acronym_007bNCSA_007d-101"></a><acronym>HDF</acronym> version&nbsp;5.x<!-- /@w --> became available in 1999, but did not
support netCDF (or, for that matter, Fortran) as of December 1999. 
By early 2001, <acronym>HDF</acronym> version&nbsp;5.x<!-- /@w --> did support Fortran90. 
However, support for netCDF&nbsp;3.x<!-- /@w --> in <acronym>HDF</acronym>&nbsp;5.x<!-- /@w --> is
incomplete. 
Much of the HDF5-netCDF3 interface is complete, however, and it may be
separately downloaded from the
<a href="http://hdf.ncsa.uiuc.edu/HDF5/papers/netcdfh5.html">HDF5-netCDF</a>
website. 
Now that <acronym>NCO</acronym> uses only netCDF&nbsp;3.x<!-- /@w --> system calls we are
eager for HDF5 to add complete netCDF&nbsp;3.x<!-- /@w --> support. 
This is scheduled to occur sometime in 2005, with the release of netCDF
version&nbsp;4<!-- /@w -->, a collaboration between Unidata and <acronym>NCSA</acronym>.

   <p><a name="help"></a> <!-- http://nco.sf.net/nco.html#help -->
<a name="hlp"></a> <!-- http://nco.sf.net/nco.html#hlp -->
<a name="bug"></a> <!-- http://nco.sf.net/nco.html#bug --><div class="node">
<p><hr>
<a name="Help-and-Bug-reports"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Introduction">Introduction</a>
<br>
</div>

<h3 class="section">1.5 Help and Bug reports</h3>

<p><a name="index-reporting-bugs-102"></a><a name="index-bugs_002c-reporting-103"></a><a name="index-core-dump-104"></a><a name="index-help-105"></a><a name="index-features_002c-requesting-106"></a>We generally receive three categories of mail from users: help requests,
bug reports, and feature requests. 
Notes saying the equivalent of "Hey, <acronym>NCO</acronym> continues to work
great and it saves me more time everyday than it took to write this
note" are a distant fourth.

   <p>There is a different protocol for each type of request. 
The common procedural etiquette is to communicate with us via
<acronym>NCO</acronym> Project Forums. 
Unless your request comes with money or you have damaging information
about our personal lives, use the Forums. 
They preserve a record of the questions and answers so that others
might learn from our exchange. 
Also, should <acronym>NCO</acronym> ever be funded (as is our hope), this record
will provide program officers with information they need to evaluate us.

   <p>Before posting to the <acronym>NCO</acronym> forums described below, you might
first <a href="https://sf.net/account/register.php">register</a>
your name and email address with SourceForge.net or else all of your
postings will be attributed to "nobody". 
Once registered you may choose to "monitor" any forum and to receive
(or not) email when there are any postings including responses to your
questions. 
We usually reply to the forum message, not to the original poster.

   <p>If you want us to include a new feature in <acronym>NCO</acronym>, check first to
see if that feature is already on the <a href="file:./TODO">TODO</a> list. 
If it is, why not implement that feature yourself and send us the patch? 
If the feature is not yet on the list, then send a note to the
<a href="http://sf.net/forum/forum.php?forum_id=9829">NCO Discussion forum</a>.

   <p>Read the manual before reporting a bug or posting a help request. 
Sending questions whose answers are not in the manual is the best
way to motivate us to write more documentation. 
We would also like to accentuate the contrapositive of this statement. 
If you think you have found a real bug <em>the most helpful thing you
can do is simplify the problem to a manageable size and then report it</em>. 
The first thing to do is to make sure you are running the latest
publicly released version of <acronym>NCO</acronym>.

   <p>Once you have read the manual, if you are still unable to get
<acronym>NCO</acronym> to perform a documented function, submit a help request. 
Follow the same procedure as described below for reporting bugs
(after all, it might be a bug). 
<a name="index-debugging-107"></a><a name="index-_0040code_007b_002dr_007d-108"></a><a name="index-_0040code_007b_002dD_007d-109"></a>That is, describe what you are trying to do, and include the complete
commands (run with <span class="samp">-D 5</span>), error messages, and version of
<acronym>NCO</acronym> (with <span class="samp">-r</span>). 
Post your help request to the
<a href="http://sf.net/forum/forum.php?forum_id=9830">NCO Help forum</a>.

   <p>If you think you used the right command when <acronym>NCO</acronym> misbehaves,
then you might have found a bug. 
Incorrect numerical answers are the highest priority. 
We usually fix those within one or two days. 
Core dumps and sementation violations receive lower priority. 
They are always fixed, eventually.

   <p>How do you simplify a problem that reveal a bug? 
Cut out extraneous variables, dimensions, and metadata from the
offending files and re-run the command until it no longer breaks. 
Then back up one step and report the problem. 
Usually the file(s) will be very small, i.e., one variable with one or
two small dimensions ought to suffice. 
<a name="dbg"></a> <!-- http://nco.sf.net/nco.html#dbg -->
<a name="-D"></a> <!-- http://nco.sf.net/nco.html#-D --><a name="index-_0040code_007b_002dr_007d-110"></a><a name="index-_0040code_007b_002d_002drevision_007d-111"></a><a name="index-_0040code_007b_002d_002dversion_007d-112"></a><a name="index-_0040code_007b_002d_002dvrs_007d-113"></a><a name="index-_0040code_007b_002dD-_0040var_007bdebug_002dlevel_007d_007d-114"></a><a name="index-_0040code_007b_002d_002ddebug_002dlevel-_0040var_007bdebug_002dlevel_007d_007d-115"></a><a name="index-_0040code_007b_002d_002ddbg_005flvl-_0040var_007bdebug_002dlevel_007d_007d-116"></a><a name="index-_0040var_007bdebug_002dlevel_007d-117"></a><a name="index-_0040var_007bdbg_005flvl_007d-118"></a>Run the operator with <span class="samp">-r</span> and then run the command with
<span class="samp">-D 5</span> to increase the verbosity of the debugging output. 
It is very important that your report contain the exact error messages
and compile-time environment. 
Include a copy of your sample input file, or place one on a
publically accessible location, of the file(s). 
Post the full bug report to the
<a href="http://sf.net/bugs/?group_id=3331">NCO Project buglist</a>.

   <p><a name="index-installation-119"></a><a name="index-_0040command_007bautoconf_007d-120"></a><a name="index-_0040file_007bnco_002econfigure_002e_0024_0040_007bGNU_005fTRP_0040_007d_002efoo_007d-121"></a><a name="index-_0040file_007bnco_002econfig_002elog_002e_0024_0040_007bGNU_005fTRP_0040_007d_002efoo_007d-122"></a><a name="index-_0040file_007bnco_002emake_002e_0024_0040_007bGNU_005fTRP_0040_007d_002efoo_007d-123"></a><a name="index-_0040file_007bconfig_002eguess_007d-124"></a><a name="index-_0040file_007bconfigure_002eeg_007d-125"></a>Build failures count as bugs. 
Our limited machine access means we cannot fix all build failures. 
The information we need to diagnose, and often fix, build failures
are the three files output by <acronym>GNU</acronym> build tools,
<span class="file">nco.config.log.${GNU_TRP}.foo</span>,
<span class="file">nco.configure.${GNU_TRP}.foo</span>,
and <span class="file">nco.make.${GNU_TRP}.foo</span>. 
The file <span class="file">configure.eg</span> shows how to produce these files. 
Here <code>${GNU_TRP}</code> is the "<acronym>GNU</acronym> architecture triplet",
the <var>chip-vendor-OS</var> string returned by <span class="file">config.guess</span>. 
Please send us your improvements to the examples supplied in
<span class="file">configure.eg</span>. 
<a name="index-regressions-archive-126"></a>The regressions archive at <a href="http://dust.ess.uci.edu/nco/rgr">http://dust.ess.uci.edu/nco/rgr</a>
contains the build output from our standard test systems. 
You may find you can solve the build problem yourself by examining the
differences between these files and your own.

   <p><a name="str"></a> <!-- http://nco.sf.net/nco.html#str --><div class="node">
<p><hr>
<a name="Strategies"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Common-features">Common features</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Introduction">Introduction</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">2 Operator Strategies</h2>

<ul class="menu">
<li><a accesskey="1" href="#Philosophy">Philosophy</a>
<li><a accesskey="2" href="#Climate-model-paradigm">Climate model paradigm</a>
<li><a accesskey="3" href="#Output-files">Output files</a>
<li><a accesskey="4" href="#Appending">Appending</a>
<li><a accesskey="5" href="#Addition-Subtraction-Division-Multiplication-and-Interpolation">Addition Subtraction Division Multiplication and Interpolation</a>
<li><a accesskey="6" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>
<li><a accesskey="7" href="#Large-numbers-of-input-files">Large numbers of input files</a>
<li><a accesskey="8" href="#Large-Datasets-and-Memory">Large Datasets and Memory</a>
<li><a accesskey="9" href="#Memory-usage">Memory usage</a>
<li><a href="#Operator-limitations">Operator limitations</a>
</ul>

<p><a name="phl"></a> <!-- http://nco.sf.net/nco.html#phl --><div class="node">
<p><hr>
<a name="Philosophy"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Climate-model-paradigm">Climate model paradigm</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Strategies">Strategies</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.1 <acronym>NCO</acronym> operator philosophy</h3>

<p><a name="index-philosophy-127"></a><a name="index-climate-model-128"></a>
The main design goal has been to produce operators that can be invoked
from the command line to perform useful operations on netCDF files. 
Many scientists work with models and observations which produce too much
data to analyze in tabular format. 
Thus, it is often natural to reduce and massage this raw or primary
level data into summary, or second level data, e.g., temporal or spatial
averages. 
These second level data may become the inputs to graphical and
statistical packages, and are often more suitable for archival and
dissemination to the scientific community. 
<acronym>NCO</acronym> performs a suite of operations useful in manipulating data
from the primary to the second level state. 
<a name="index-_0040acronym_007bNCL_007d-129"></a><a name="index-_0040acronym_007bIDL_007d-130"></a><a name="index-Perl-131"></a><a name="index-Yorick-132"></a>Higher level interpretive languages (e.g., <acronym>IDL</acronym>, Yorick,
Matlab, <acronym>NCL</acronym>, Perl, Python),
and lower level compiled languages (e.g., C, Fortran) can always perform
any task performed by <acronym>NCO</acronym>, but often with more overhead. 
NCO, on the other hand, is limited to a much smaller set of arithmetic
and metadata operations than these full blown languages.

   <p><a name="index-command-line-switches-133"></a>Another goal has been to implement enough command line switches so that
frequently used sequences of these operators can be executed from a
shell script or batch file. 
Finally, <acronym>NCO</acronym> was written to consume the absolute minimum
amount of system memory required to perform a given job. 
The arithmetic operators are extremely efficient; their exact memory
usage is detailed in <a href="#Memory-usage">Memory usage</a>.

   <p><a name="clm"></a> <!-- http://nco.sf.net/nco.html#clm --><div class="node">
<p><hr>
<a name="Climate-model-paradigm"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Output-files">Output files</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Philosophy">Philosophy</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.2 Climate model paradigm</h3>

<p><a name="index-climate-model-134"></a><a name="index-_0040acronym_007bNCAR_007d-135"></a><a name="index-_0040acronym_007bGCM_007d-136"></a>
<acronym>NCO</acronym> was developed at <acronym>NCAR</acronym> to aid analysis and
manipulation of datasets produced by General Circulation Models
(<acronym>GCM</acronym>s). 
Datasets produced by <acronym>GCM</acronym>s share many features with all gridded
scientific datasets and so provide a useful paradigm for the explication
of the <acronym>NCO</acronym> operator set. 
Examples in this manual use a <acronym>GCM</acronym> paradigm because latitude,
longitude, time, temperature and other fields related to our natural
environment are as easy to visualize for the layman as the expert.

   <p><a name="out"></a> <!-- http://nco.sf.net/nco.html#out --><div class="node">
<p><hr>
<a name="Output-files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Appending">Appending</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Climate-model-paradigm">Climate model paradigm</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.3 Temporary output files</h3>

<p><a name="index-data-safety-137"></a><a name="index-error-tolerance-138"></a><a name="index-safeguards-139"></a><a name="index-temporary-output-files-140"></a><acronym>NCO</acronym> operators are designed to be reasonably fault tolerant, so
that if there is a system failure or the user aborts the operation (e.g.,
with <kbd>C-c</kbd>), then no data are lost. 
The user-specified <var>output-file</var> is only created upon successful
completion of the operation
<a rel="footnote" href="#fn-8" name="fnd-8"><sup>8</sup></a>. 
This is accomplished by performing all operations in a temporary copy
of <var>output-file</var>. 
The name of the temporary output file is constructed by appending
<code>.pid</code><var>&lt;process ID&gt;</var><code>.</code><var>&lt;operator name&gt;</var><code>.tmp</code> to the
user-specified <var>output-file</var> name. 
When the operator completes its task with no fatal errors, the temporary
output file is moved to the user-specified <var>output-file</var>. 
Note the construction of a temporary output file uses more disk space
than just overwriting existing files &ldquo;in place&rdquo; (because there may be
two copies of the same file on disk until the <acronym>NCO</acronym> operation
successfully concludes and the temporary output file overwrites the
existing <var>output-file</var>). 
<a name="index-performance-141"></a><a name="index-operator-speed-142"></a><a name="index-speed-143"></a><a name="index-execution-time-144"></a>Also, note this feature increases the execution time of the operator
by approximately the time it takes to copy the <var>output-file</var>. 
Finally, note this feature allows the <var>output-file</var> to be the same
as the <var>input-file</var> without any danger of &ldquo;overlap&rdquo;.

   <p><a name="-A"></a> <!-- http://nco.sf.net/nco.html#-A -->
<a name="-O"></a> <!-- http://nco.sf.net/nco.html#-O --><a name="index-_0040code_007b_002dA_007d-145"></a><a name="index-_0040code_007b_002dO_007d-146"></a><a name="index-_0040code_007b_002d_002dapn_007d-147"></a><a name="index-_0040code_007b_002d_002dappend_007d-148"></a><a name="index-_0040code_007b_002d_002dovr_007d-149"></a><a name="index-_0040code_007b_002d_002doverwrite_007d-150"></a><a name="index-overwriting-files-151"></a><a name="index-appending-to-files-152"></a>Other safeguards exist to protect the user from inadvertently
overwriting data. 
If the <var>output-file</var> specified for a command is a pre-existing file,
then the operator will prompt the user whether to overwrite (erase) the
existing <var>output-file</var>, attempt to append to it, or abort the
operation. 
However, in processing large amounts of data, too many interactive
questions slows productivity. 
Therefore <acronym>NCO</acronym> also implements two ways to override its own
safety features, the <span class="samp">-O</span> and <span class="samp">-A</span> switches. 
Specifying <span class="samp">-O</span> tells the operator to overwrite any existing
<var>output-file</var> without prompting the user interactively. 
Specifying <span class="samp">-A</span> tells the operator to attempt to append to any
existing <var>output-file</var> without prompting the user interactively. 
These switches are useful in batch environments because they suppress
interactive keyboard input.

   <p><a name="apn"></a> <!-- http://nco.sf.net/nco.html#apn --><div class="node">
<p><hr>
<a name="Appending"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Addition-Subtraction-Division-Multiplication-and-Interpolation">Addition Subtraction Division Multiplication and Interpolation</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Output-files">Output files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.4 Appending variables to a file</h3>

<p>A&nbsp;frequently<!-- /@w --> useful operation is adding variables from one file to
another. 
<a name="index-concatenation-153"></a><a name="index-appending-variables-154"></a><a name="index-merging-files-155"></a><a name="index-pasting-variables-156"></a>This is referred to as <dfn>appending</dfn>, although some prefer the
terminology <dfn>merging</dfn> <a rel="footnote" href="#fn-9" name="fnd-9"><sup>9</sup></a> or <dfn>pasting</dfn>. 
Appending is often confused with what <acronym>NCO</acronym> calls
<dfn>concatenation</dfn>. 
In <acronym>NCO</acronym>, concatenation refers to splicing a variable along the
record dimension. 
Appending, on the other hand, refers to adding variables from one file
to another
<a rel="footnote" href="#fn-10" name="fnd-10"><sup>10</sup></a>. 
In this sense, <span class="command">ncks</span> can append variables from one file to
another file. 
This capability is invoked by naming two files on the command line,
<var>input-file</var> and <var>output-file</var>. 
When <var>output-file</var> already exists, the user is prompted whether to
<dfn>overwrite</dfn>, <dfn>append/replace</dfn>, or <dfn>exit</dfn> from the command. 
Selecting <dfn>overwrite</dfn> tells the operator to erase the existing
<var>output-file</var> and replace it with the results of the operation. 
Selecting <dfn>exit</dfn> causes the operator to exit&mdash;the <var>output-file</var>
will not be touched in this case. 
Selecting <dfn>append/replace</dfn> causes the operator to attempt to place
the results of the operation in the existing <var>output-file</var>,
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>.

   <p><a name="unn"></a> <!-- http://nco.sf.net/nco.html#unn --><a name="index-union-of-two-files-157"></a><a name="index-disjoint-files-158"></a>The simplest way to create the union of two files is
<pre class="example">     ncks -A fl_1.nc fl_2.nc
</pre>
   <p>This puts the contents of <span class="file">fl_1.nc</span> into <span class="file">fl_2.nc</span>. 
The <span class="samp">-A</span> is optional. 
On output, <span class="file">fl_2.nc</span> is the union of the input files,
regardless of whether they share dimensions and variables,
or are completely disjoint. 
The append fails if the input files have differently named record
dimensions (since netCDF supports only one), or have dimensions of the
same name but different sizes.

   <p><a name="bnr"></a> <!-- http://nco.sf.net/nco.html#bnr --><div class="node">
<p><hr>
<a name="Addition-Subtraction-Division-Multiplication-and-Interpolation"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Appending">Appending</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.5 Addition Subtraction Division Multiplication and Interpolation</h3>

<p>Users comfortable with <acronym>NCO</acronym> semantics may find it easier to
perform some simple mathematical operations in <acronym>NCO</acronym> rather than
higher level languages. 
<span class="command">ncbo</span> (see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>) does file
addition, subtraction, multiplication, division, and broadcasting. 
<span class="command">ncflint</span> (see <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>) does
file addition, subtraction, multiplication and interpolation. 
Sequences of these commands can accomplish simple but powerful
operations from the command line.

   <p><a name="averagers"></a> <!-- http://nco.sf.net/nco.html#averagers --><div class="node">
<p><hr>
<a name="Averaging-vs_002e-Concatenating"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Large-numbers-of-input-files">Large numbers of input files</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Addition-Subtraction-Division-Multiplication-and-Interpolation">Addition Subtraction Division Multiplication and Interpolation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.6 Averagers vs. Concatenators</h3>

<p><a name="sym_ncea"></a> <!-- http://nco.sf.net/nco.html#sym_ncea -->
<a name="sym_ncrcat"></a> <!-- http://nco.sf.net/nco.html#sym_ncrcat --><a name="index-symbolic-links-159"></a>The most frequently used operators of <acronym>NCO</acronym> are probably the
averagers and concatenators. 
Because there are so many permutations of averaging (e.g., across files,
within a file, over the record dimension, over other dimensions, with or
without weights and masks) and of concatenating (across files, along the
record dimension, along other dimensions), there are currently no fewer
than five operators which tackle these two purposes: <span class="command">ncra</span>,
<span class="command">ncea</span>, <span class="command">ncwa</span>, <span class="command">ncrcat</span>, and <span class="command">ncecat</span>. 
These operators do share many capabilities <a rel="footnote" href="#fn-11" name="fnd-11"><sup>11</sup></a>, but each has its unique specialty. 
Two of these operators, <span class="command">ncrcat</span> and <span class="command">ncecat</span>, are for
concatenating hyperslabs across files. 
The other two operators, <span class="command">ncra</span> and <span class="command">ncea</span>, are for
averaging hyperslabs across files
<a rel="footnote" href="#fn-12" name="fnd-12"><sup>12</sup></a>. 
First, let's describe the concatenators, then the averagers.

<ul class="menu">
<li><a accesskey="1" href="#Concatenation">Concatenation</a>
<li><a accesskey="2" href="#Averaging">Averaging</a>
<li><a accesskey="3" href="#Interpolating">Interpolating</a>
</ul>

<p><a name="cnc"></a> <!-- http://nco.sf.net/nco.html#cnc --><div class="node">
<p><hr>
<a name="Concatenation"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Averaging">Averaging</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>
<br>
</div>

<h4 class="subsection">2.6.1 Concatenators <span class="command">ncrcat</span> and <span class="command">ncecat</span></h4>

<p><a name="index-_0040command_007bncecat_007d-160"></a><a name="index-_0040command_007bncrcat_007d-161"></a>
Joining independent files together along a record dimension is called
<dfn>concatenation</dfn>. 
<span class="command">ncrcat</span> is designed for concatenating record variables, while
<span class="command">ncecat</span> is designed for concatenating fixed length variables. 
Consider five files, <span class="file">85.nc</span>, <span class="file">86.nc</span>,
<small class="dots">...</small>&nbsp;<span class="file">89.nc</span><!-- /@w --> each containing a year's worth of data. 
Say you wish to create from them a single file, <span class="file">8589.nc</span>
containing all the data, i.e., spanning all five years. 
If the annual files make use of the same record variable, then
<span class="command">ncrcat</span> will do the job nicely with, e.g.,
<code>ncrcat 8?.nc 8589.nc</code>. 
The number of records in the input files is arbitrary and can vary from
file to file. 
See <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>, for a complete description of
<span class="command">ncrcat</span>.

   <p>However, suppose the annual files have no record variable, and thus
their data are all fixed length. 
<a name="index-ensemble-162"></a><a name="index-climate-model-163"></a>For example, the files may not be conceptually sequential, but rather
members of the same group, or <dfn>ensemble</dfn>. 
Members of an ensemble may have no reason to contain a record dimension. 
<span class="command">ncecat</span> will create a new record dimension (named <var>record</var>
by default) with which to glue together the individual files into the
single ensemble file. 
If <span class="command">ncecat</span> is used on files which contain an existing record
dimension, that record dimension is converted to a fixed-length
dimension of the same name and a new record dimension (named
<code>record</code>) is created. 
Consider five realizations, <span class="file">85a.nc</span>, <span class="file">85b.nc</span>,
<small class="dots">...</small>&nbsp;<span class="file">85e.nc</span><!-- /@w --> of 1985 predictions from the same climate
model. 
Then <code>ncecat 85?.nc 85_ens.nc</code> glues the individual realizations
together into the single file, <span class="file">85_ens.nc</span>. 
If an input variable was dimensioned [<code>lat</code>,<code>lon</code>], it will
have dimensions [<code>record</code>,<code>lat</code>,<code>lon</code>] in the output file. 
A&nbsp;restriction<!-- /@w --> of <span class="command">ncecat</span> is that the hyperslabs of the
processed variables must be the same from file to file. 
Normally this means all the input files are the same size, and contain
data on different realizations of the same variables. 
See <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a>, for a complete description
of <span class="command">ncecat</span>.

   <p><a name="index-_0040command_007bncpdq_007d-164"></a><a name="dmn_cat"></a> <!-- http://nco.sf.net/nco.html#dmn_cat --><span class="command">ncpdq</span> makes it possible to concatenate files along any
dimension, not just the record dimension. 
First, use <span class="command">ncpdq</span> to convert the dimension to be concatenated
(i.e., extended with data from other files) into the record dimension. 
Second, use <span class="command">ncrcat</span> to concatenate these files. 
Finally, if desirable, use <span class="command">ncpdq</span> to revert to the original
dimensionality. 
As a concrete example, say that files <span class="file">x_01.nc</span>, <span class="file">x_02.nc</span>,
<small class="dots">...</small>&nbsp;<span class="file">x_10.nc</span><!-- /@w --> contain time-evolving datasets from spatially
adjacent regions. 
The time and spatial coordinates are <code>time</code> and <code>x</code>, respectively. 
Initially the record dimension is <code>time</code>. 
Our goal is to create a single file that contains joins all the
spatially adjacent regions into one single time-evolving dataset.
<pre class="example">     for idx in 01 02 03 04 05 06 07 08 09 10; do # Bourne Shell
       ncpdq -a x,time x_${idx}.nc foo_${idx}.nc # Make x record dimension
     done
     ncrcat foo_??.nc out.nc       # Concatenate along x
     ncpdq -a time,x out.nc out.nc # Revert to time as record dimension
</pre>
   <p>Note that <span class="command">ncrcat</span> will not concatenate fixed-length variables,
whereas <span class="command">ncecat</span> concatenates both fixed-length and record
variables along a new record variable. 
To conserve system memory, use <span class="command">ncrcat</span> where possible.

   <p><a name="avg"></a> <!-- http://nco.sf.net/nco.html#avg --><div class="node">
<p><hr>
<a name="Averaging"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Interpolating">Interpolating</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Concatenation">Concatenation</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>
<br>
</div>

<h4 class="subsection">2.6.2 Averagers <span class="command">ncea</span>, <span class="command">ncra</span>, and <span class="command">ncwa</span></h4>

<p><a name="index-_0040command_007bncea_007d-165"></a><a name="index-_0040command_007bncra_007d-166"></a><a name="index-_0040command_007bncwa_007d-167"></a>
The differences between the averagers <span class="command">ncra</span> and <span class="command">ncea</span>
are analogous to the differences between the concatenators. 
<span class="command">ncra</span> is designed for averaging record variables from at least
one file, while <span class="command">ncea</span> is designed for averaging fixed length
variables from multiple files. 
<span class="command">ncra</span> performs a simple arithmetic average over the record
dimension of all the input files, with each record having an equal
weight in the average. 
<span class="command">ncea</span> performs a simple arithmetic average of all the input
files, with each file having an equal weight in the average. 
Note that <span class="command">ncra</span> cannot average fixed-length variables,
but <span class="command">ncea</span> can average both fixed-length and record variables. 
To conserve system memory, use <span class="command">ncra</span> rather than
<span class="command">ncea</span> where possible (e.g., if each <var>input-file</var> is one
record long). 
The file output from <span class="command">ncea</span> will have the same dimensions
(meaning dimension names as well as sizes) as the input hyperslabs
(see <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a>, for a complete description of
<span class="command">ncea</span>). 
The file output from <span class="command">ncra</span> will have the same dimensions as
the input hyperslabs except for the record dimension, which will have a
size of&nbsp;1<!-- /@w --> (see <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>, for a complete
description of <span class="command">ncra</span>).

   <p><a name="ntp"></a> <!-- http://nco.sf.net/nco.html#ntp --><div class="node">
<p><hr>
<a name="Interpolating"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Averaging">Averaging</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>
<br>
</div>

<h4 class="subsection">2.6.3 Interpolator <span class="command">ncflint</span></h4>

<p><a name="index-_0040command_007bncflint_007d-168"></a>
<span class="command">ncflint</span> can interpolate data between or two files. 
Since no other operators have this ability, the description of
interpolation is given fully on the <span class="command">ncflint</span> reference page
(see <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>). 
Note that this capability also allows <span class="command">ncflint</span> to linearly
rescale any data in a netCDF file, e.g., to convert between differing
units.

   <p><a name="lrg"></a> <!-- http://nco.sf.net/nco.html#lrg --><div class="node">
<p><hr>
<a name="Large-numbers-of-input-files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Large-Datasets-and-Memory">Large Datasets and Memory</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.7 Working with large numbers of input files</h3>

<p><a name="index-files_002c-numerous-input-169"></a><a name="index-_0040code_007b_002dn-_0040var_007bloop_007d_007d-170"></a>
Occasionally one desires to digest (i.e., concatenate or average)
hundreds or thousands of input files. 
<a name="index-automagic-171"></a><a name="index-_0040acronym_007bNASA-EOSDIS_007d-172"></a>Unfortunately, data archives (e.g., <acronym>NASA EOSDIS</acronym>) may not
name netCDF files in a format understood by the <span class="samp">-n </span><var>loop</var>
switch (see <a href="#Specifying-input-files">Specifying input files</a>) that automagically generates
arbitrary numbers of input filenames. 
The <span class="samp">-n </span><var>loop</var> switch has the virtue of being concise,
and of minimizing the command line. 
This helps keeps output file small since the command line is stored
as metadata in the <code>history</code> attribute
(see <a href="#History-attribute">History attribute</a>). 
However, the <span class="samp">-n </span><var>loop</var> switch is useless when there is no
simple, arithmetic pattern to the input filenames (e.g.,
<span class="file">h00001.nc</span>, <span class="file">h00002.nc</span>, <small class="dots">...</small>&nbsp;<span class="file">h90210.nc</span><!-- /@w -->). 
Moreover, filename globbing does not work when the input files are too
numerous or their names are too lengthy (when strung together as a
single argument) to be passed by the calling shell to the <acronym>NCO</acronym>
operator
<a rel="footnote" href="#fn-13" name="fnd-13"><sup>13</sup></a>. 
When this occurs, the <acronym>ANSI</acronym> C-standard <code>argc</code>-<code>argv</code>
method of passing arguments from the calling shell to a C-program (i.e.,
an <acronym>NCO</acronym> operator) breaks down. 
There are (at least) three alternative methods of specifying the input
filenames to <acronym>NCO</acronym> in environment-limited situations.

   <p><a name="stdin"></a> <!-- http://nco.sf.net/nco.html#stdin --><a name="index-standard-input-173"></a><a name="index-_0040code_007bstdin_007d-174"></a>The recommended method for sending very large numbers (hundreds or
more, typically) of input filenames to the multi-file operators is
to pass the filenames with the <acronym>UNIX</acronym> <dfn>standard input</dfn>
feature, aka <code>stdin</code>:
<pre class="example">     # Pipe large numbers of filenames to stdin
     /bin/ls | grep ${CASEID}_'......'.nc | ncecat -O -o foo.nc
</pre>
   <p>This method avoids all constraints on command line size imposed by
the operating system. 
A drawback to this method is that the <code>history</code> attribute
(see <a href="#History-attribute">History attribute</a>) does not record the name of any input
files since the names were not passed on the command line. 
This makes determining the data provenance at a later date difficult. 
<a name="index-_0040code_007bnco_005finput_005ffile_005fnumber_007d-175"></a><a name="index-_0040code_007bnco_005finput_005ffile_005flist_007d-176"></a><a name="index-global-attributes-177"></a>To remedy this situation, multi-file operators store the number of
input files in the <code>nco_input_file_number</code> global attribute and the
input file list itself in the <code>nco_input_file_list</code> global attribute
(see <a href="#Input-file-list-attributes">Input file list attributes</a>). 
Although this does not preserve the exact command used to generate the
file, it does retains all the information required to reconstruct the
command and determine the data provenance.

   <p><a name="index-globbing-178"></a><a name="index-shell-179"></a><a name="index-extended-regular-expressions-180"></a><a name="index-regular-expressions-181"></a><a name="index-pattern-matching-182"></a><a name="index-_0040command_007bxargs_007d-183"></a><a name="index-_0040acronym_007bUNIX_007d-184"></a>A second option is to use the <acronym>UNIX</acronym> <span class="command">xargs</span> command. 
This simple example selects as input to <span class="command">xargs</span> all the
filenames in the current directory that match a given pattern. 
For illustration, consider a user trying to average millions of
files which each have a six character filename. 
If the shell buffer can not hold the results of the corresponding
globbing operator, <span class="file">??????.nc</span>, then the filename globbing
technique will fail. 
Instead we express the filename pattern as an extended regular
expression, <span class="file">......\.nc</span> (see <a href="#Variable-subsetting">Variable subsetting</a>). 
We use <span class="command">grep</span> to filter the directory listing for this pattern
and to pipe the results to <span class="command">xargs</span> which, in turn, passes the
matching filenames to an <acronym>NCO</acronym> multi-file operator, e.g.,
<span class="command">ncecat</span>.
<pre class="example">     # Use xargs to transfer filenames on the command line
     /bin/ls | grep ${CASEID}_'......'.nc | xargs -x ncecat -o foo.nc
</pre>
   <p><a name="index-pipes-185"></a>The single quotes protect the only sensitive parts of the extended
regular expression (the <span class="command">grep</span> argument), and allow shell
interpolation (the <code>${CASEID}</code> variable substitution) to
proceed unhindered on the rest of the command. 
<span class="command">xargs</span> uses the <acronym>UNIX</acronym> pipe feature to append the
suitably filtered input file list to the end of the <span class="command">ncecat</span>
command options. 
<a name="index-output-file-186"></a><a name="index-input-files-187"></a><a name="index-_0040code_007b_002do-_0040var_007bfl_005fout_007d_007d-188"></a>The <code>-o foo.nc</code> switch ensures that the input files supplied by
<span class="command">xargs</span> are not confused with the output file name. 
<span class="command">xargs</span> does, unfortunately, have its own limit (usually about
20,000 characters) on the size of command lines it can pass. 
Give <span class="command">xargs</span> the <span class="samp">-x</span> switch to ensure it dies if it
reaches this internal limit. 
When this occurs, use either the <code>stdin</code> method above, or the
symbolic link presented next.

   <p><a name="index-symbolic-links-189"></a>Even when its internal limits have not been reached, the
<span class="command">xargs</span> technique may not be sophisticated enough to handle
all situations. 
A full scripting language like Perl can handle any level of complexity
of filtering input filenames, and any number of filenames. 
The technique of last resort is to write a script that creates symbolic
links between the irregular input filenames and a set of regular,
arithmetic filenames that the <span class="samp">-n </span><var>loop</var> switch understands. 
<a name="index-Perl-190"></a>For example, the following Perl script a monotonically enumerated
symbolic link to up to one million <span class="file">.nc</span> files in a directory. 
If there are 999,999 netCDF files present, the links are named
<span class="file">000001.nc</span> to <span class="file">999999.nc</span>:
<a name="index-_0040code_007b_002dn-_0040var_007bloop_007d_007d-191"></a>
<pre class="example">     # Create enumerated symbolic links
     /bin/ls | grep \.nc | perl -e \
     '$idx=1;while(&lt;STDIN&gt;){chop;symlink $_,sprintf("%06d.nc",$idx++);}'
     ncecat -O -n 999999,6,1 000001.nc foo.nc
     # Remove symbolic links when finished
     /bin/rm ??????.nc
</pre>
   <p>The <span class="samp">-n </span><var>loop</var> option tells the <acronym>NCO</acronym> operator to
automatically generate the filnames of the symbolic links. 
This circumvents any <acronym>OS</acronym> and shell limits on command line size. 
The symbolic links are easily removed once <acronym>NCO</acronym> is finished. 
<a name="index-_0040code_007bhistory_007d-192"></a>One drawback to this method is that the <code>history</code> attribute
(see <a href="#History-attribute">History attribute</a>) retains the filename list of the symbolic
links, rather than the data files themselves. 
This makes it difficult to determine the data provenance at a later date.

<div class="node">
<p><hr>
<a name="Large-Datasets-and-Memory"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Memory-usage">Memory usage</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Large-numbers-of-input-files">Large numbers of input files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.8 Working with large datasets</h3>

<p><a name="index-large-datasets-193"></a><a name="index-LFS-194"></a><a name="index-Large-File-Support-195"></a>
<dfn>Large datasets</dfn> are those files that are comparable in size to the
amount of random access memory (<acronym>RAM</acronym>) in your computer. 
Many users of <acronym>NCO</acronym> work with files larger than 100&nbsp;MB<!-- /@w -->. 
Files this large not only push the current edge of storage technology,
they present special problems for programs which attempt to access the
entire file at once, such as <span class="command">ncea</span> and <span class="command">ncecat</span>. 
<a name="index-swap-space-196"></a>If you work with a 300&nbsp;MB<!-- /@w --> files on a machine with only 32&nbsp;MB<!-- /@w --> of
memory then you will need large amounts of swap space (virtual memory on
disk) and <acronym>NCO</acronym> will work slowly, or even fail. 
There is no easy solution for this. 
The best strategy is to work on a machine with sufficient amounts of
memory and swap space. 
Since about 2004, many users have begun to produce or analyze files
exceeding 2&nbsp;GB<!-- /@w --> in size. 
These users should familiarize themselves with <acronym>NCO</acronym>'s Large
File Support (<acronym>LFS</acronym>) capabilities (see <a href="#Large-File-Support">Large File Support</a>). 
The next section will increase your familiarity with <acronym>NCO</acronym>'s
memory requirements. 
With this knowledge you may re-design your data reduction approach to
divide the problem into pieces solvable in memory-limited situations.

   <p><a name="index-server-197"></a><a name="index-_0040acronym_007bUNICOS_007d-198"></a><a name="index-Cray-199"></a>If your local machine has problems working with large files, try running
<acronym>NCO</acronym> from a more powerful machine, such as a network server. 
Certain machine architectures, e.g., Cray <acronym>UNICOS</acronym>, have special
commands which allow one to increase the amount of interactive memory. 
<a name="index-_0040code_007bilimit_007d-200"></a>On Cray systems, try to increase the available memory with the
<code>ilimit</code> command. 
<a name="index-_0040acronym_007bGNU_007d_002fLinux-201"></a><a name="index-_0040code_007bulimit_007d-202"></a><a name="index-_0040code_007bcore-dump_007d-203"></a>If you get a memory-related core dump
(e.g., <span class="samp">Error exit (core dumped)</span>) on a <acronym>GNU</acronym>/Linux system,
try increasing the process-available memory with <code>ulimit</code>.

   <p><a name="index-speed-204"></a>The speed of the <acronym>NCO</acronym> operators also depends on file size. 
When processing large files the operators may appear to hang, or do
nothing, for large periods of time. 
In order to see what the operator is actually doing, it is useful to
activate a more verbose output mode. 
This is accomplished by supplying a number greater than&nbsp;0<!-- /@w --> to the
<span class="samp">-D </span><var>debug-level</var> (or <span class="samp">--debug-level</span>, or
<span class="samp">--dbg_lvl</span>) switch. 
<a name="index-_0040code_007b_002dD-_0040var_007bdebug_002dlevel_007d_007d-205"></a><a name="index-_0040code_007b_002d_002ddebug_002dlevel-_0040var_007bdebug_002dlevel_007d_007d-206"></a><a name="index-_0040code_007b_002d_002ddbg_005flvl-_0040var_007bdebug_002dlevel_007d_007d-207"></a><a name="index-_0040var_007bdebug_002dlevel_007d-208"></a><a name="index-_0040var_007bdbg_005flvl_007d-209"></a><a name="index-debugging-210"></a>When the <var>debug-level</var> is nonzero, the operators report their
current status to the terminal through the <var>stderr</var> facility. 
Using <span class="samp">-D</span> does not slow the operators down. 
Choose a <var>debug-level</var> between&nbsp;1<!-- /@w --> and&nbsp;3<!-- /@w --> for most situations,
e.g., <code>ncea -D 2 85.nc 86.nc 8586.nc</code>. 
A&nbsp;full<!-- /@w --> description of how to estimate the actual amount of memory the
multi-file <acronym>NCO</acronym> operators consume is given in
<a href="#Memory-usage">Memory usage</a>.

   <p><a name="mmr"></a> <!-- http://nco.sf.net/nco.html#mmr --><div class="node">
<p><hr>
<a name="Memory-usage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Operator-limitations">Operator limitations</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Large-Datasets-and-Memory">Large Datasets and Memory</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.9 Approximate <acronym>NCO</acronym> memory requirements</h3>

<p><a name="index-memory-requirements-211"></a><a name="index-memory-available-212"></a><a name="index-RAM-213"></a><a name="index-swap-space-214"></a><a name="index-peak-memory-usage-215"></a>
Many people use <acronym>NCO</acronym> on gargantuan files which dwarf the
memory available (free <acronym>RAM</acronym> plus swap space) even on today's powerful
machines. 
These users will want <acronym>NCO</acronym> to consume the absolute minimum
peak memory possible so that their scripts do not have to tediously cut
files into smaller pieces that fit into memory. 
We commend these greedy users for pushing <acronym>NCO</acronym> to its limits!

   <p><a name="index-threads-216"></a><a name="index-OpenMP-217"></a><a name="index-shared-memory-machines-218"></a>This section describes the memory <acronym>NCO</acronym> requires during
operation. 
The required memory is based on the underlying algorithms. 
The description below is the memory usage per thread. 
Users with shared memory machines may use the threaded <acronym>NCO</acronym>
operators (see <a href="#OpenMP-threading">OpenMP threading</a>). 
The peak and sustained memory usage will scale accordingly,
i.e., by the number of threads. 
Memory consumption patterns of all operators are similar, with
the exception of <span class="command">ncap</span>.

<ul class="menu">
<li><a accesskey="1" href="#Memory-Usage-of-Single-and-Multi_002dfile-Operators">Memory Usage of Single and Multi-file Operators</a>
<li><a accesskey="2" href="#Memory-Usage-of-ncap">Memory Usage of ncap</a>
</ul>

<div class="node">
<p><hr>
<a name="Memory-Usage-of-Single-and-Multi_002dfile-Operators"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Memory-Usage-of-ncap">Memory Usage of ncap</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Memory-usage">Memory usage</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Memory-usage">Memory usage</a>
<br>
</div>

<h4 class="subsection">2.9.1 Memory Usage of Single and Multi-file Operators</h4>

<p><a name="index-multi_002dfile-operators-219"></a>The multi-file operators currently comprise the record operators,
<span class="command">ncra</span> and <span class="command">ncrcat</span>, and the ensemble operators,
<span class="command">ncea</span> and <span class="command">ncecat</span>. 
The record operators require <em>much less</em> memory than the ensemble
operators. 
This is because the record operators operate on one single record (i.e.,
time-slice) at a time, wherease the ensemble operators retrieve the
entire variable into memory. 
Let MS be the peak sustained memory demand of an operator,
FT be the memory required to store the entire contents of all the
variables to be processed in an input file,
FR be the memory required to store the entire contents of a
single record of each of the variables to be processed in an input file,
VR be the memory required to store a single record of the
largest record variable to be processed in an input file,
VT be the memory required to store the largest variable
to be processed in an input file,
VI be the memory required to store the largest variable
which is not processed, but is copied from the initial file to the
output file. 
All operators require MI = VI during the initial copying of
variables from the first input file to the output file. 
This is the <em>initial</em> (and transient) memory demand. 
The <em>sustained</em> memory demand is that memory required by the
operators during the processing (i.e., averaging, concatenation)
phase which lasts until all the input files have been processed. 
The operators have the following memory requirements:
<span class="command">ncrcat</span> requires MS &lt;= VR. 
<span class="command">ncecat</span> requires MS &lt;= VT. 
<span class="command">ncra</span> requires MS = 2FR + VR. 
<span class="command">ncea</span> requires MS = 2FT + VT. 
<span class="command">ncbo</span> requires MS &lt;= 2VT. 
<span class="command">ncpdq</span> requires MS &lt;= 2VT. 
<span class="command">ncflint</span> requires MS &lt;= 2VT. 
Note that only variables which are processed, i.e., averaged or
concatenated, contribute to MS. 
Memory is never allocated to hold variables which do not appear in the
output file (see <a href="#Variable-subsetting">Variable subsetting</a>).

<div class="node">
<p><hr>
<a name="Memory-Usage-of-ncap"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Memory-Usage-of-Single-and-Multi_002dfile-Operators">Memory Usage of Single and Multi-file Operators</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Memory-usage">Memory usage</a>
<br>
</div>

<h4 class="subsection">2.9.2 Memory Usage of <span class="command">ncap</span></h4>

<p><a name="index-_0040command_007bncap_007d-220"></a><a name="index-binary-operations-221"></a><a name="index-unary-operations-222"></a><a name="index-memory-leaks-223"></a><a name="index-left-hand-casting-224"></a><span class="command">ncap</span> has unique memory requirements due its ability to process
arbitrarily long scripts of any complexity. 
All script acceptable to <span class="command">ncap</span> are ultimately processed as a
sequence of binary or unary operations. 
<span class="command">ncap</span> requires MS &lt;= 2VT under most conditions. 
An exception to this is when left hand casting (see <a href="#Left-hand-casting">Left hand casting</a>) is used to stretch the size of derived variables beyond the
size of any input variables. 
Let VC be the memory required to store the largest variable
defined by left hand casting. 
In this case, MS &lt;= 2VC.

   <p><a name="index-malloc_0028_0029-225"></a><span class="command">ncap</span> scripts are complete dynamic and may be of arbitrary
length. 
A script that contains many thousands of operations, may uncover a
slow memory leak even though each single operation consumes little
additional memory. 
Memory leaks are usually identifiable by their memory usage signature. 
Leaks cause peak memory usage to increase monotonically with time
regardless of script complexity. 
Slow leaks are very difficult to find. 
Sometimes a <span class="command">malloc()</span> failure is the only noticeable clue to
their existance. 
If you have good reasons to believe that a <span class="command">malloc()</span> failure
is ultimately due to an <acronym>NCO</acronym> memory leak (rather than
inadequate <acronym>RAM</acronym> on your system), then we would be very
interested in receiving a detailed bug report.

<div class="node">
<p><hr>
<a name="Operator-limitations"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Memory-usage">Memory usage</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Strategies">Strategies</a>
<br>
</div>

<h3 class="section">2.10 Performance limitations of the operators</h3>

     <ol type=1 start=1>
<li><a name="index-buffering-226"></a>No date buffering is performed during <span class="command">ncvarget</span> and
<span class="command">ncvarput</span> operations. 
<a name="index-performance-227"></a><a name="index-operator-speed-228"></a><a name="index-speed-229"></a><a name="index-execution-time-230"></a>Hyperslabs too large too hold in core memory will suffer substantial
performance penalties because of this.

     <li><a name="index-monotonic-coordinates-231"></a>Since coordinate variables are assumed to be monotonic, the search for
bracketing the user-specified limits should employ a quicker algorithm,
like bisection, than the two-sided incremental search currently
implemented.

     <li><a name="index-_0040var_007bC_005fformat_007d-232"></a><a name="index-_0040var_007bFORTRAN_005fformat_007d-233"></a><a name="index-_0040var_007bsignedness_007d-234"></a><a name="index-_0040var_007bscale_005fformat_007d-235"></a><a name="index-_0040var_007badd_005foffset_007d-236"></a><var>C_format</var>, <var>FORTRAN_format</var>, <var>signedness</var>,
<var>scale_format</var> and <var>add_offset</var> attributes are ignored by
<span class="command">ncks</span> when printing variables to screen.

     <li><a name="index-Yorick-237"></a>Some random access operations on large files on certain architectures
(e.g., 400&nbsp;MB<!-- /@w --> on <acronym>UNICOS</acronym>) are <em>much</em> slower with these
operators than with similar operations performed using languages that
bypass the netCDF interface (e.g., Yorick). 
The cause for this is not understood at present.
     </ol>

   <p><a name="ftr"></a> <!-- http://nco.sf.net/nco.html#ftr --><div class="node">
<p><hr>
<a name="Common-features"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Operator-Reference-Manual">Operator Reference Manual</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Strategies">Strategies</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">3 Features common to most operators</h2>

<p>Many features have been implemented in more than one operator and are
described here for brevity. 
The description of each feature is preceded by a box listing the
operators for which the feature is implemented. 
<a name="index-command-line-switches-238"></a>Command line switches for a given feature are consistent across all
operators wherever possible. 
If no &ldquo;key switches&rdquo; are listed for a feature, then that particular
feature is automatic and cannot be controlled by the user.

<ul class="menu">
<li><a accesskey="1" href="#Internationalization">Internationalization</a>
<li><a accesskey="2" href="#OpenMP-threading">OpenMP threading</a>
<li><a accesskey="3" href="#Large-File-Support">Large File Support</a>
<li><a accesskey="4" href="#Command-line-options">Command line options</a>
<li><a accesskey="5" href="#Specifying-input-files">Specifying input files</a>
<li><a accesskey="6" href="#Specifying-output-files">Specifying output files</a>
<li><a accesskey="7" href="#Remote-storage">Remote storage</a>
<li><a accesskey="8" href="#File-retention">File retention</a>
<li><a accesskey="9" href="#Variable-subsetting">Variable subsetting</a>
<li><a href="#Coordinate-variables">Coordinate variables</a>
<li><a href="#Fortran-indexing">Fortran indexing</a>
<li><a href="#Hyperslabs">Hyperslabs</a>
<li><a href="#Multislabs">Multislabs</a>
<li><a href="#UDUnits-Support">UDUnits Support</a>
<li><a href="#Wrapped-coordinates">Wrapped coordinates</a>
<li><a href="#Stride">Stride</a>
<li><a href="#Missing-values">Missing values</a>
<li><a href="#Operation-Types">Operation Types</a>
<li><a href="#Type-conversion">Type conversion</a>
<li><a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a>
<li><a href="#History-attribute">History attribute</a>
<li><a href="#Input-file-list-attributes">Input file list attributes</a>
<li><a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a>
<li><a href="#ARM-Conventions">ARM Conventions</a>
<li><a href="#Operator-version">Operator version</a>
</ul>

   <p><a name="i18n"></a> <!-- http://nco.sf.net/nco.html#i18n --><div class="node">
<p><hr>
<a name="Internationalization"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#OpenMP-threading">OpenMP threading</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Common-features">Common features</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.1 Internationalization</h3>

<p><a name="index-Internationalization-239"></a><a name="index-I18N-240"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: All<br>
Long options: All<br>
</td></tr></table>
   <a name="index-L10N-241"></a><acronym>NCO</acronym> support for <dfn>internationalization</dfn> of textual input
and output (e.g., Warning messages) is nascent. 
We hope to produce foreign language string catalogues in 2004. 
<!-- fxm: Work on this section -->

   <p><a name="omp"></a> <!-- http://nco.sf.net/nco.html#omp -->
<a name="openmp"></a> <!-- http://nco.sf.net/nco.html#openmp --><div class="node">
<p><hr>
<a name="OpenMP-threading"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Large-File-Support">Large File Support</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Internationalization">Internationalization</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.2 OpenMP threading</h3>

<p><a name="index-OpenMP-242"></a><a name="index-threads-243"></a><a name="index-_0040acronym_007bSMP_007d-244"></a><a name="index-shared-memory-parallelism-245"></a><a name="index-parallelism-246"></a><a name="index-_0040code_007bnco_005fopenmp_005fthread_005fnumber_007d-247"></a><a name="index-_0040code_007b_002d_002dthr_005fnbr-_0040var_007bthr_005fnbr_007d_007d-248"></a><a name="index-_0040code_007b_002d_002dthreads-_0040var_007bthr_005fnbr_007d_007d-249"></a><a name="index-_0040code_007b_002d_002domp_005fnum_005fthreads-_0040var_007bthr_005fnbr_007d_007d-250"></a><a name="index-_0040code_007b_002dt-_0040var_007bthr_005fnbr_007d_007d-251"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncbo</span>, <span class="command">ncea</span>, <span class="command">ncpdq</span>,
<span class="command">ncra</span>, <span class="command">ncrcat</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-t</span><br>
Long options: <span class="samp">--thr_nbr</span>, <span class="samp">--threads</span>,
<span class="samp">--omp_num_threads</span><br>
</td></tr></table>
   <acronym>NCO</acronym> supports shared memory parallelism (<acronym>SMP</acronym>) when
compiled with an OpenMP-enabled compiler. 
Threads requests and allocations occur in two stages. 
First, users may request a specific number of threads <var>thr_nbr</var> with
the <span class="samp">-t</span> switch (or its long option equivalents, <span class="samp">--thr_nbr</span>,
<span class="samp">--threads</span>, and <span class="samp">--omp_num_threads</span>). 
If not user-specified, OpenMP obtains <var>thr_nbr</var> from the
<code>OMP_NUM_THREADS</code> environment variable, if present, or from the
<acronym>OS</acronym>, if not.

   <p><a name="index-_0040var_007bthr_005fnbr_007d-252"></a><a name="index-_0040code_007bOMP_005fNUM_005fTHREADS_007d-253"></a><a name="index-_0040command_007bncrcat_007d-254"></a><a name="index-_0040command_007bncwa_007d-255"></a><a name="index-_0040command_007bncpdq_007d-256"></a><a name="index-large-datasets-257"></a><acronym>NCO</acronym> may modify <var>thr_nbr</var> according to its own internal
settings before it requests any threads from the system. 
Certain operators contain hard-code limits to the number of threads they
request. 
We base these limits on our experience and common sense, and to reduce
potentially wasteful system usage by inexperienced users. 
For example, <code>ncrcat</code> is extremely I/O-intensive. 
No one has demonstrated that threading improves <code>ncrcat</code>
performance so we restrict <var>thr_nbr</var> &lt;= 1 for <code>ncrcat</code>. 
Compute-intensive operators (<code>ncwa</code> and <code>ncpdq</code>)
are expected to benefit the most from threading. 
The greatest increases in throughput due to threading will occur on
large dataset where each thread performs millions or more floating
point operations. 
Otherwise, the system overhead of setting up threads may outweigh
the theoretical speed enhancements due to <acronym>SMP</acronym> parallelism. 
However, no one has ever demonstrated that the <acronym>SMP</acronym> parallelism
scales well beyone four threads for these operators. 
Hence we restrict <var>thr_nbr</var> &lt;= 4 for all operators. 
We encourage users to play with these limits (edit file
<span class="file">nco_omp.c</span>) and send us their feedback.

   <p><a name="index-debugging-258"></a><a name="index-_0040var_007bdbg_005flvl_007d-259"></a>Once the initial <var>thr_nbr</var> has been modified for any
operator-specific limits, <acronym>NCO</acronym> requests the system to allocate
a team of <var>thr_nbr</var> threads for the body of the code. 
The operating system then decides how many threads to allocate
based on this request. 
Users may keep track of this information by running the operator with
<var>dbg_lvl</var> &gt; 0.

   <p>By default, operators with thread attach one global attribute to any
file they create or modify. 
The <code>nco_openmp_thread_number</code> global attribute contains the
number of threads the operator used to process the input files. 
This information helps to verify that the answers with threaded and
non-threaded operators are equal to within machine precision. 
<a name="index-benchmarks-260"></a>This information is also useful for benchmarking.

   <p><a name="lfs"></a> <!-- http://nco.sf.net/nco.html#lfs --><div class="node">
<p><hr>
<a name="Large-File-Support"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Command-line-options">Command line options</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#OpenMP-threading">OpenMP threading</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.3 Large File Support</h3>

<p><a name="index-LFS-261"></a><a name="index-Large-File-Support-262"></a><a name="index-_0040code_007b_002dZ_007d-263"></a><a name="index-_0040code_007b_002d_002d64_002dbit_002doffset_007d-264"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: All, <span class="samp">-Z</span><br>
Long options: All, <span class="samp">--64-bit-offset</span><br>
</td></tr></table>
   <acronym>NCO</acronym> support for large files is in place and works but is not
well documented yet. 
<acronym>NCO</acronym> honors <acronym>LFS</acronym> capabilities on platforms which
support them
<a rel="footnote" href="#fn-14" name="fnd-14"><sup>14</sup></a>.

   <p>The netCDF large file support FAQ at
<a href="http://my.unidata.ucar.edu/content/software/netcdf/faq-lfs.html">http://my.unidata.ucar.edu/content/software/netcdf/faq-lfs.html</a>
describes the various file size limitations imposed by different
versions of the netCDF standard. 
To discover whether a netCDF file is a classic (32-bit offset) format
or newer 64-bit offset file format file, examine it with the
(octal dump) command. 
<a name="index-_0040command_007bod_007d-265"></a><a name="index-octal-dump-266"></a><a name="index-classic-files-format-267"></a><a name="index-32_002dbit-offset-file-format-268"></a><a name="index-64_002dbit-offset-file-format-269"></a>
<pre class="example">     % od -An -c -N4 ~/nco/data/in.nc
        C   D   F 001
</pre>
   <p>Values of <span class="samp">C D F 001</span> and <span class="samp">C D F 002</span> indicate 32-bit
(classic) and 64-bit formats, respectively.

   <p>All operators write classic (32-bit offset) format files unless
told otherwise by toggling the <span class="samp">-Z</span> switch (or it long option
equivalent <span class="samp">--64-bit-offset</span>). 
<acronym>NCO</acronym> must be built with netCDF&nbsp;3.6<!-- /@w --> or higher to honor
64-bit offset file formats. 
Users are advised to use the default classic format until
netCDF&nbsp;3.6<!-- /@w --> is more widespread.

   <p><a name="cmd_ln"></a> <!-- http://nco.sf.net/nco.html#cmd_ln --><div class="node">
<p><hr>
<a name="Command-line-options"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Specifying-input-files">Specifying input files</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Large-File-Support">Large File Support</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.4 Command line options</h3>

<p><a name="index-command-line-options-270"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: All<br>
Long options: All<br>
</td></tr></table>
   <a name="index-_0040acronym_007bPOSIX_007d-271"></a><a name="index-_0040acronym_007bUNIX_007d-272"></a><a name="index-_0040acronym_007bGNU_007d-273"></a><a name="index-switches-274"></a><acronym>NCO</acronym> achieves flexibility by using <dfn>command line options</dfn>. 
These options are implemented in all traditional <acronym>UNIX</acronym> commands
as single letter <dfn>switches</dfn>, e.g., <span class="samp">ls -l</span>. 
For many years <acronym>NCO</acronym> used only single letter option names. 
In late 2002, we implemented <acronym>GNU</acronym>/<acronym>POSIX</acronym> extended
or long option names for all options. 
This was done in a backward compatible way such that the full
functionality of <acronym>NCO</acronym> is still available through the familiar
single letter options. 
In the future, however, some features of <acronym>NCO</acronym> may require the
use of long options, simply because we have nearly run out of single
letter options. 
More importantly, mnemonics for single letter options are often
non-intuitive so that long options provide a more natural way of
expressing intent.

   <p><a name="index-long-options-275"></a>Extended options, also called long options, are implemented using the
system-supplied <span class="file">getopt.h</span> header file, if possible. 
<a name="index-_0040code_007bBSD_007d-276"></a><a name="index-_0040code_007bgetopt_007d-277"></a><a name="index-_0040code_007bgetopt_005flong_007d-278"></a><a name="index-_0040file_007bgetopt_002eh_007d-279"></a>This provides the <span class="command">getopt_long</span> function to <acronym>NCO</acronym>
<a rel="footnote" href="#fn-15" name="fnd-15"><sup>15</sup></a>.

   <p><a name="index-_0040code_007b_002dD-_0040var_007bdebug_002dlevel_007d_007d-280"></a><a name="index-_0040code_007b_002d_002ddbg_005flvl-_0040var_007bdebug_002dlevel_007d_007d-281"></a>The syntax of <dfn>short options</dfn> (single letter options) is
<kbd>-</kbd><var>key</var> <var>value</var> (dash-key-space-value). 
Here, <var>key</var> is the single letter option name, e.g.,
<span class="samp">-D 2</span>.

   <p>The syntax of <dfn>long options</dfn> (multi-letter options) is
<kbd>--</kbd><var>long_name</var> <var>value</var>
(dash-dash-key-space-value), e.g., <span class="samp">--dbg_lvl 2</span> or
<kbd>--</kbd><var>long_name</var><kbd>=</kbd><var>value</var>
(dash-dash-key-equal-value), e.g., <span class="samp">--dbg_lvl=2</span>. 
Thus the following are all valid for the <span class="samp">-D</span> (short version)
or <span class="samp">--dbg_lvl</span> (long version) command line option.
<pre class="example">     ncks -D 3 in.nc        # Short option
     ncks --dbg_lvl=3 in.nc # Long option, preferred form
     ncks --dbg_lvl 3 in.nc # Long option, alternate form
</pre>
   <p class="noindent">The last example is preferred for two reasons. 
First, <span class="samp">--dbg_lvl</span> is more specific and less ambiguous than
<span class="samp">-D</span>. 
The long option form makes scripts more self documenting and less error
prone. 
Often long options are named after the source code variable whose value
they carry. 
Second, the equals sign <kbd>=</kbd> joins the key (i.e., <var>long_name</var>) to
the value in an uninterruptible text block. 
Experience shows that users are less likely to mis-parse commands when
restricted to this form.

   <p><acronym>GNU</acronym> implements a superset of the <acronym>POSIX</acronym> standard
which allows any unambiguous truncation of a valid option to be used.
<pre class="example">     ncks -D 3 in.nc        # Short option
     ncks --dbg_lvl=3 in.nc # Long option, full form
     ncks --dbg=3 in.nc     # Long option, unambiguous truncation
     ncks --db=3 in.nc      # Long option, unambiguous truncation
     ncks --d=3 in.nc       # Long option, ambiguous truncation
</pre>
   <p class="noindent">The first four examples are equivalent and will work as expected. 
The final example will exit with an error since <span class="command">ncks</span> cannot
disambiguate whether <span class="samp">--d</span> is intended as a truncation of
<span class="samp">--dbg_lvl</span>, of <span class="samp">--dimension</span>, or of some other long option.

   <p><acronym>NCO</acronym> provides many long options for common switches. 
For example, the debugging level may be set in all operators with any
of the switches <span class="samp">-D</span>, <span class="samp">--debug-level</span>, or <span class="samp">--dbg_lvl</span>. 
This flexibility allows users to choose their favorite mnemonic. 
For some, it will be <span class="samp">--debug</span> (an unambiguous truncation of
<span class="samp">--debug-level</span>, and other will prefer <span class="samp">--dbg</span>. 
Interactive users usually prefer the minimal amount of typing, i.e.,
<span class="samp">-D</span>. 
We recommend that scripts which are re-usable employ some form of
the long options for future maintainability.

   <p>This manual generally uses the short option syntax. 
This is for historical reasons and to conserve space. 
The remainder of this manual specifies the full <var>long_name</var> of
each option. 
Users are expected to pick the unambiguous truncation of each option
name that most suits their taste.

   <p><a name="fl_in"></a> <!-- http://nco.sf.net/nco.html#fl_in -->
<a name="in"></a> <!-- http://nco.sf.net/nco.html#in -->
<a name="input"></a> <!-- http://nco.sf.net/nco.html#input --><div class="node">
<p><hr>
<a name="Specifying-input-files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Specifying-output-files">Specifying output files</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Command-line-options">Command line options</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.5 Specifying input files</h3>

<p><a name="index-input-files-282"></a><a name="index-globbing-283"></a><a name="index-regular-expressions-284"></a><a name="index-wildcards-285"></a><a name="index-_0040code_007bNINTAP_007d-286"></a><a name="index-Processor_002c-_0040acronym_007bCCM_007d-287"></a><a name="index-_0040acronym_007bCCM_007d-Processor-288"></a><a name="index-_0040code_007b_002dn-_0040var_007bloop_007d_007d-289"></a><a name="index-_0040code_007b_002d_002dnintap-_0040var_007bloop_007d_007d-290"></a><a name="index-_0040code_007b_002dp-_0040var_007binput_002dpath_007d_007d-291"></a><a name="index-_0040code_007b_002d_002dpth-_0040var_007binput_002dpath_007d_007d-292"></a><a name="index-_0040code_007b_002d_002dpath-_0040var_007binput_002dpath_007d_007d-293"></a><a name="index-_0040var_007binput_002dpath_007d-294"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability (<code>-n</code>): <span class="command">ncea</span>, <span class="command">ncecat</span>, <span class="command">ncra</span>, <span class="command">ncrcat</span><br>
Availability (<code>-p</code>): All operators<br>
Short options: <span class="samp">-n</span>, <span class="samp">-p</span><br>
Long options: <span class="samp">--nintap</span>, <span class="samp">--pth</span>, <span class="samp">--path</span><br>
</td></tr></table>
   It is important that users be able to specify multiple input files
without typing every filename in full, often a tedious task even
by graduate student standards. 
<a name="index-_0040acronym_007bUNIX_007d-295"></a>There are four different ways of specifying input files to <acronym>NCO</acronym>:
explicitly typing each, using <acronym>UNIX</acronym> shell wildcards, and using
the <acronym>NCO</acronym> <span class="samp">-n</span> and <span class="samp">-p</span> switches (or their long option
equivalents, <span class="samp">--nintap</span> or <span class="samp">--pth</span> and <span class="samp">--path</span>,
respectively). 
To illustrate these methods, consider the simple problem of using
<span class="command">ncra</span> to average five input files, <span class="file">85.nc</span>, <span class="file">86.nc</span>,
<small class="dots">...</small>&nbsp;<span class="file">89.nc</span><!-- /@w -->, and store the results in <span class="file">8589.nc</span>. 
Here are the four methods in order. 
They produce identical answers.
<pre class="example">     ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
     ncra 8[56789].nc 8589.nc
     ncra -p <var>input-path</var> 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
     ncra -n 5,2,1 85.nc 8589.nc
</pre>
   <p>The first method (explicitly specifying all filenames) works by brute
force. 
The second method relies on the operating system shell to <dfn>glob</dfn>
(expand) the <dfn>regular expression</dfn> <code>8[56789].nc</code>. 
The shell passes valid filenames which match the expansion to
<span class="command">ncra</span>. 
The third method uses the <span class="samp">-p </span><var>input-path</var> argument to specify
the directory where all the input files reside. 
<acronym>NCO</acronym> prepends <var>input-path</var> (e.g.,
<span class="file">/data/usrname/model</span>) to all <var>input-files</var> (but not to
<var>output-file</var>). 
Thus, using <span class="samp">-p</span>, the path to any number of input files need only
be specified once. 
Note <var>input-path</var> need not end with <span class="samp">/</span>; the <span class="samp">/</span> is
automatically generated if necessary.

   <p>The last method passes (with <span class="samp">-n</span>) syntax concisely describing
the entire set of filenames
<a rel="footnote" href="#fn-16" name="fnd-16"><sup>16</sup></a>. 
<a name="index-multi_002dfile-operators-296"></a><a name="index-files_002c-multiple-297"></a>This option is only available with the <dfn>multi-file operators</dfn>:
<span class="command">ncra</span>, <span class="command">ncrcat</span>, <span class="command">ncea</span>, and <span class="command">ncecat</span>. 
By definition, multi-file operators are able to process an arbitrary
number of <var>input-files</var>. 
This option is very useful for abbreviating lists of filenames
representable as
<var>alphanumeric_prefix</var>+<var>numeric_suffix</var>+<span class="file">.</span>+<var>filetype</var>
where <var>alphanumeric_prefix</var> is a string of arbitrary length and
composition, <var>numeric_suffix</var> is a fixed width field of digits, and
<var>filetype</var> is a standard filetype indicator. 
For example, in the file <span class="file">ccm3_h0001.nc</span>, we have
<var>alphanumeric_prefix</var> = <span class="file">ccm3_h</span>, <var>numeric_suffix</var> =
<span class="file">0001</span>, and <var>filetype</var> = <span class="file">nc</span>.

   <p><acronym>NCO</acronym> is able to decode lists of such filenames encoded using the
<span class="samp">-n</span> option. 
The simpler (3-argument) <span class="samp">-n</span> usage takes the form
<code>-n </code><var>file_number</var><code>,</code><var>digit_number</var><code>,</code><var>numeric_increment</var>
where <var>file_number</var> is the number of files, <var>digit_number</var> is
the fixed number of numeric digits comprising the <var>numeric_suffix</var>,
and <var>numeric_increment</var> is the constant, integer-valued difference
between the <var>numeric_suffix</var> of any two consecutive files. 
The value of <var>alphanumeric_prefix</var> is taken from the input file,
which serves as a template for decoding the filenames. 
In the example above, the encoding <code>-n 5,2,1</code> along with the input
file name <span class="file">85.nc</span> tells <acronym>NCO</acronym> to
construct five (5) filenames identical to the template <span class="file">85.nc</span>
except that the final two (2) digits are a numeric suffix to be
incremented by one (1) for each successive file. 
Currently <var>filetype</var> may be either be empty, <span class="file">nc</span>,
<span class="file">cdf</span>, <span class="file">hdf</span>, or <span class="file">hd5</span>. 
If present, these <var>filetype</var> suffixes (and the preceding <span class="file">.</span>)
are ignored by <acronym>NCO</acronym> as it uses the <span class="samp">-n</span> arguments to
locate, evaluate, and compute the <var>numeric_suffix</var> component of
filenames.

   <p><a name="index-wrapped-filenames-298"></a><a name="index-climate-model-299"></a>Recently the <span class="samp">-n</span> option has been extended to allow convenient
specification of filenames with &ldquo;circular&rdquo; characteristics. 
This means it is now possible for <acronym>NCO</acronym> to automatically
generate filenames which increment regularly until a specified maximum
value, and then wrap back to begin again at a specified minimum value. 
The corresponding <span class="samp">-n</span> usage becomes more complex, taking one or
two additional arguments for a total of four or five, respectively:
<code>-n
</code><var>file_number</var><code>,</code><var>digit_number</var><code>,</code><var>numeric_increment</var><code>[,</code><var>numeric_max</var><code>[,</code><var>numeric_min</var><code>]]</code>
where <var>numeric_max</var>, if present, is the maximum integer-value of
<var>numeric_suffix</var> and <var>numeric_min</var>, if present, is the minimum
integer-value of <var>numeric_suffix</var>. 
Consider, for example, the problem of specifying non-consecutive input
files where the filename suffixes end with the month index. 
In climate modeling it is common to create summertime and wintertime
averages which contain the averages of the months June&ndash;July&ndash;August,
and December&ndash;January&ndash;February, respectively:
<pre class="example">     ncra -n 3,2,1 85_06.nc 85_0608.nc
     ncra -n 3,2,1,12 85_12.nc 85_1202.nc
     ncra -n 3,2,1,12,1 85_12.nc 85_1202.nc
</pre>
   <p>The first example shows that three arguments to the <span class="samp">-n</span> option
suffice to specify consecutive months (<code>06, 07, 08</code>) which do not
&ldquo;wrap&rdquo; back to a minimum value. 
The second example shows how to use the optional fourth and fifth
elements of the <span class="samp">-n</span> option to specify a wrap value to <acronym>NCO</acronym>. 
The fourth argument to <span class="samp">-n</span>, if present, specifies the maximum
integer value of <var>numeric_suffix</var>. 
In this case the maximum value is&nbsp;12,<!-- /@w --> and will be formatted as
<span class="file">12</span> in the filename string. 
The fifth argument to <span class="samp">-n</span>, if present, specifies the minimum
integer value of <var>numeric_suffix</var>. 
The default minimum filename suffix is&nbsp;1,<!-- /@w --> which is formatted as
<span class="file">01</span> in this case. 
Thus the second and third examples have the same effect, that is, they
automatically generate, in order, the filenames <span class="file">85_12.nc</span>,
<span class="file">85_01.nc</span>, and <span class="file">85_02.nc</span> as input to <acronym>NCO</acronym>.

   <p><a name="fl_out"></a> <!-- http://nco.sf.net/nco.html#fl_out -->
<a name="out"></a> <!-- http://nco.sf.net/nco.html#out -->
<a name="output"></a> <!-- http://nco.sf.net/nco.html#output --><div class="node">
<p><hr>
<a name="Specifying-output-files"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Remote-storage">Remote storage</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Specifying-input-files">Specifying input files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.6 Specifying output files</h3>

<p><a name="index-output-file-300"></a><a name="index-input-files-301"></a><a name="index-positional-arguments-302"></a><a name="index-command-line-switches-303"></a><a name="index-_0040code_007b_002do-_0040var_007bfl_005fout_007d_007d-304"></a><a name="index-_0040code_007b_002d_002doutput-_0040var_007bfl_005fout_007d_007d-305"></a><a name="index-_0040code_007b_002d_002dfl_005fout-_0040var_007bfl_005fout_007d_007d-306"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: <span class="samp">-o</span><br>
Long options: <span class="samp">--fl_out</span>, <span class="samp">--output</span><br>
</td></tr></table>
   <acronym>NCO</acronym> commands produce no more than one output file, <var>fl_out</var>. 
Traditionally, users specify <var>fl_out</var> as the final argument to the
operator, following all input file names. 
This is the <dfn>positional argument</dfn> method of specifying input and
ouput file names. 
The positional argument method works well in most applications. 
<acronym>NCO</acronym> also supports specifying <var>fl_out</var> using the command
line switch argument method, <span class="samp">-o </span><var>fl_out</var>.

   <p>Specifying <var>fl_out</var> with a switch, rather than as a positional
argument, allows <var>fl_out</var> to precede input files in the argument
list. 
<a name="index-multi_002dfile-operators-307"></a>This is particularly useful with multi-file operators for three reasons. 
Multi-file operators may be invoked with hundreds (or more) filenames. 
Visual or automatic location of <var>fl_out</var> in such a list is
difficult when the only syntactic distinction between input and output
files is their position. 
<a name="index-_0040command_007bxargs_007d-308"></a><a name="index-input-files-309"></a>Second, specification of a long list of input files may be difficult
(see <a href="#Large-numbers-of-input-files">Large numbers of input files</a>). 
Making the input file list the final argument to an operator facilitates
using <span class="command">xargs</span> for this purpose. 
Some alternatives to <span class="command">xargs</span> are very ugly and undesirable. 
Finally, many users are more comfortable specifying output files
with <span class="samp">-o </span><var>fl_out</var> near the beginning of an argument list. 
<a name="index-compilers-310"></a><a name="index-linkers-311"></a>Compilers and linkers are usually invoked this way.

   <p><a name="rmt"></a> <!-- http://nco.sf.net/nco.html#rmt --><div class="node">
<p><hr>
<a name="Remote-storage"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#File-retention">File retention</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Specifying-output-files">Specifying output files</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.7 Accessing files stored remotely</h3>

<p><a name="index-_0040code_007brcp_007d-312"></a><a name="index-_0040code_007bscp_007d-313"></a><a name="index-_0040file_007b_002erhosts_007d-314"></a><a name="index-_0040acronym_007bNCAR-MSS_007d-315"></a><a name="index-_0040acronym_007bMSS_007d-316"></a><a name="index-Mass-Store-System-317"></a><a name="index-_0040acronym_007bURL_007d-318"></a><a name="index-_0040code_007bftp_007d-319"></a><a name="index-remote-files-320"></a><a name="index-synchronous-file-access-321"></a><a name="index-asynchronous-file-access-322"></a><a name="index-_0040code_007b_002d_002dpth-_0040var_007binput_002dpath_007d_007d-323"></a><a name="index-_0040code_007b_002d_002dpath-_0040var_007binput_002dpath_007d_007d-324"></a><a name="index-_0040code_007b_002d_002dlcl-_0040var_007boutput_002dpath_007d_007d-325"></a><a name="index-_0040code_007b_002d_002dlocal-_0040var_007boutput_002dpath_007d_007d-326"></a><a name="index-_0040code_007b_002dl-_0040var_007boutput_002dpath_007d_007d-327"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: <span class="samp">-p</span>, <span class="samp">-l</span><br>
Long options: <span class="samp">--pth</span>, <span class="samp">--path</span>, <span class="samp">--lcl</span>, <span class="samp">--local</span><br>
</td></tr></table>
   All <acronym>NCO</acronym> operators can retrieve files from remote sites as well
as from the local file system. 
A&nbsp;remote<!-- /@w --> site can be an anonymous <acronym>FTP</acronym> server, a machine on
which the user has <span class="command">rcp</span> or <span class="command">scp</span> privileges, or
<acronym>NCAR</acronym>'s Mass Storage System (<acronym>MSS</acronym>). 
To access a file via an anonymous <acronym>FTP</acronym> server, supply the
remote file's <acronym>URL</acronym>. 
To access a file using <span class="command">rcp</span> or <span class="command">scp</span>, specify the
Internet address of the remote file. 
Of course in this case you must have <span class="command">rcp</span> or <span class="command">scp</span>
privileges which allow transparent (no password entry required) access
to the remote machine. 
This means that <span class="file">~/.rhosts</span> or <span class="file">~/ssh/authorized_keys</span> must
be set accordingly on both local and remote machines.

   <p><a name="index-_0040command_007bmsrcp_007d-328"></a><a name="index-_0040command_007bmsread_007d-329"></a><a name="index-_0040command_007bnrnet_007d-330"></a>To access a file on <acronym>NCAR</acronym>'s <acronym>MSS</acronym>, specify the full <acronym>MSS</acronym> pathname of the
remote file. 
<acronym>NCO</acronym> will attempt to detect whether the local machine has direct
(synchronous) <acronym>MSS</acronym> access. 
In this case, <acronym>NCO</acronym> attempts to use the <acronym>NCAR</acronym>
<span class="command">msrcp</span> command
<a rel="footnote" href="#fn-17" name="fnd-17"><sup>17</sup></a>, or, failing that, <code>/usr/local/bin/msread</code>. 
Otherwise <acronym>NCO</acronym> attempts to retrieve the <acronym>MSS</acronym> file
through the (asynchronous) Masnet Interface Gateway System
(<acronym>MIGS</acronym>) using the <span class="command">nrnet</span> command.

   <p>The following examples show how one might analyze files stored on
remote systems.
<pre class="example">     ncks -l ./ ftp://dust.ess.uci.edu/pub/zender/nco/in.nc
     ncks -l ./ dust.ess.uci.edu:/home/zender/nco/in.nc
     ncks -l ./ /ZENDER/nco/in.nc
     ncks -l ./ mss:/ZENDER/nco/in.nc
     ncks -l ./ -p http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/\
     ncep.reanalysis.dailyavgs/surface air.sig995.1975.nc
</pre>
   <p class="noindent">The first example will work verbatim on your system if your system is
connected to the Internet and is not behind a firewall. 
The second example will work on your system if you have <span class="command">rcp</span>
or <span class="command">scp</span> access to the machine <code>dust.ess.uci.edu</code>. 
The third example will work from <acronym>NCAR</acronym> computers with local
access to  the <span class="command">msrcp</span>, <span class="command">msread</span>, or <span class="command">nrnet</span>
commands. 
The fourth command will work if your local version of <acronym>NCO</acronym> was
built with <acronym>OPeNDAP</acronym> capability (see <a href="#OPeNDAP">OPeNDAP</a>). 
The above commands can be rewritten using the <span class="samp">-p </span><var>input-path</var>
option as follows:
<a name="index-_0040code_007b_002dp-_0040var_007binput_002dpath_007d_007d-331"></a><a name="index-_0040var_007binput_002dpath_007d-332"></a><a name="index-_0040code_007b_002dl-_0040var_007boutput_002dpath_007d_007d-333"></a><a name="index-_0040var_007boutput_002dpath_007d-334"></a>
<pre class="example">     ncks -p ftp://dust.ess.uci.edu/pub/zender/nco -l ./ in.nc
     ncks -p dust.ess.uci.edu:/home/zender/nco -l ./ in.nc
     ncks -p /ZENDER/nco -l ./ in.nc
     ncks -p mss:/ZENDER/nco -l ./ in.nc
</pre>
   <p class="noindent">Using <span class="samp">-p</span> is recommended because it clearly separates the
<var>input-path</var> from the filename itself, sometimes called the
<dfn>stub</dfn>. 
<a name="index-stub-335"></a>When <var>input-path</var> is not explicitly specified using <span class="samp">-p</span>,
<acronym>NCO</acronym> internally generates an <var>input-path</var> from the first
input filename. 
The automatically generated <var>input-path</var> is constructed by stripping
the input filename of everything following the final <span class="samp">/</span> character
(i.e., removing the stub). 
The <span class="samp">-l </span><var>output-path</var> option tells <acronym>NCO</acronym> where to
store the remotely retrieved file and the output file. 
Often the path to a remotely retrieved file is quite different than the
path on the local machine where you would like to store the file. 
If <span class="samp">-l</span> is not specified then <acronym>NCO</acronym> internally generates an
<var>output-path</var> by simply setting <var>output-path</var> equal to
<var>input-path</var> stripped of any machine names. 
If <span class="samp">-l</span> is not specified and the remote file resides on the
<acronym>NCAR</acronym> <acronym>MSS</acronym> system, then the leading character of
<var>input-path</var>, <span class="samp">/</span>, is also stripped from <var>output-path</var>. 
Specifying <var>output-path</var> as <span class="samp">-l ./</span> tells <acronym>NCO</acronym> to
store the remotely retrieved file and the output file in the current
directory. 
Note that <span class="samp">-l .</span> is equivalent to <span class="samp">-l ./</span> though the latter is
recommended as it is syntactically more clear.

<ul class="menu">
<li><a accesskey="1" href="#OPeNDAP">OPeNDAP</a>
</ul>

   <p><a name="DODS"></a> <!-- http://nco.sf.net/nco.html#DODS -->
<a name="OPeNDAP"></a> <!-- http://nco.sf.net/nco.html#OPeNDAP -->
<a name="dods"></a> <!-- http://nco.sf.net/nco.html#dods -->
<a name="opendap"></a> <!-- http://nco.sf.net/nco.html#opendap --><div class="node">
<p><hr>
<a name="OPeNDAP"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Remote-storage">Remote storage</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Remote-storage">Remote storage</a>
<br>
</div>

<h4 class="subsection">3.7.1 <acronym>OPeNDAP</acronym></h4>

<p><a name="index-_0040acronym_007bDODS_007d-336"></a><a name="index-_0040acronym_007bHTTP_007d-protocol-337"></a><a name="index-_0040env_007bDODS_005fROOT_007d-338"></a><a name="index-Distributed-Oceanographic-Data-System-339"></a><a name="index-oceanography-340"></a><a name="index-data-access-protocol-341"></a><a name="index-Open_002dsource-Project-for-a-Network-Data-Access-Protocol-342"></a><a name="index-_0040acronym_007bOPeNDAP_007d_002e-343"></a><a name="index-server-344"></a><a name="index-client_002dserver-345"></a>The Distributed Oceanographic Data System (<acronym>DODS</acronym>) provides
useful replacements for common data interface libraries like netCDF. 
The <acronym>DODS</acronym> versions of these libraries implement network
transparent access to data via a client-server data access protocol
that uses the <acronym>HTTP</acronym> protocol for communication. 
Although <acronym>DODS</acronym>-technology originated with oceanography data,
it applyies to virtually all scientific data. 
In recognition of this, the data access protocol underlying
<acronym>DODS</acronym> (which is what <acronym>NCO</acronym> cares about) has been
renamed the Open-source Project for a Network Data Access Protocol,
<acronym>OPeNDAP</acronym>. 
We use the terms <acronym>DODS</acronym> and <acronym>OPeNDAP</acronym> interchangeably,
and often write <acronym>DODS</acronym>/<acronym>OPeNDAP</acronym> for now. 
In the future we will deprecate <acronym>DODS</acronym> in favor of
<acronym>OPeNDAP</acronym>
<a rel="footnote" href="#fn-18" name="fnd-18"><sup>18</sup></a>.

   <p><acronym>NCO</acronym> may be <acronym>OPeNDAP</acronym>-enabled by linking
<acronym>NCO</acronym> to the <acronym>OPeNDAP</acronym> libraries. 
<a name="index-_0040file_007bMakefile_007d-346"></a>This is described in the <acronym>OPeNDAP</acronym> documentation and
automagically implemented in <acronym>NCO</acronym> build mechanisms
<a rel="footnote" href="#fn-19" name="fnd-19"><sup>19</sup></a>. 
The <span class="file">./configure</span> mechanism automatically enables <acronym>NCO</acronym> as
<acronym>OPeNDAP</acronym> clients if it can find the required
<acronym>OPeNDAP</acronym> libraries
<a rel="footnote" href="#fn-20" name="fnd-20"><sup>20</sup></a>. 
 in the usual locations. 
The <span class="env">$DODS_ROOT</span> environment variable may be used to override the
default <acronym>OPeNDAP</acronym> library location at <acronym>NCO</acronym>
compile-time. 
Building <acronym>NCO</acronym> with <span class="file">bld/Makefile</span> and the command
<code>make DODS=Y</code> adds the (non-intuitive) commands to link to the
<acronym>OPeNDAP</acronym> libraries installed in the <span class="env">$DODS_ROOT</span>
directory. 
The file <span class="file">doc/dods.sh</span> contains a generic script intended to help
users install <acronym>OPeNDAP</acronym> before building <acronym>NCO</acronym>. 
The documentation at the
<a href="http://www.opendap.org">OPeNDAP Homepage</a>
is voluminous. 
Check there and on the
<a href="http://www.unidata.ucar.edu/packages/dods/home/mailLists/">DODS mail lists</a>. 
to learn more about the extensive capabilities of <acronym>OPeNDAP</acronym>
<a rel="footnote" href="#fn-21" name="fnd-21"><sup>21</sup></a>.

   <p>Once <acronym>NCO</acronym> is <acronym>OPeNDAP</acronym>-enabled the operators are
<acronym>OPeNDAP</acronym> clients. 
All <acronym>OPeNDAP</acronym> clients have network transparent access to
any files controlled by a <acronym>OPeNDAP</acronym> server. 
Simply specify the input file path(s) in <acronym>URL</acronym> notation and all
<acronym>NCO</acronym> operations may be performed on remote files made
accessible by a <acronym>OPeNDAP</acronym> server. 
For example, this extracts (remotely) an equatorial hyperslab,
from <acronym>NCEP daily reanalyses</acronym> data of the year 1969 made freely
available by a <acronym>NOAA</acronym> <acronym>OPeNDAP</acronym> server. 
Then it sends the hyperslab to the local <span class="command">ncwa</span> client which
computes and stores (locally) the regional mean surface pressure
(in&nbsp;Pa)<!-- /@w -->.
<pre class="example">     ncwa -O -C -a lat,lon,time -d lon,-10.,10. -d lat,-10.,10. -l ./ -p \
     http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.reanalysis.dailyavgs/surface \
     pres.sfc.1969.nc foo.nc
</pre>
   <p class="noindent"><a name="index-packing-347"></a><a name="index-unpacking-348"></a>All with one command! 
The data in this particular input file also happen to be packed
(see <a href="#Intrinsic-functions">Intrinsic functions</a>), although this is completely transparent
to the user since <acronym>NCO</acronym> automatically unpacks data before
attempting arithmetic.

   <p><acronym>NCO</acronym> obtains remote files from the <acronym>OPeNDAP</acronym> server
(e.g., <span class="file">www.cdc.noaa.gov</span>) rather than the local machine. 
Input files are first copied to the local machine, then processed. 
The <acronym>OPeNDAP</acronym> server performs data access, hyperslabbing,
and transfer to the local machine. 
<a name="index-I_002fO-349"></a>This allows the I/O to appear to <acronym>NCO</acronym> as if the input files
were local. 
The local machine performs all arithmetic operations. 
Only the hyperslabbed output data are transferred over the network (to
the local machine) for the number-crunching to begin. 
The advantages of this are obvious if you are examining small parts of
large files stored at remote locations.

   <p><a name="rtn"></a> <!-- http://nco.sf.net/nco.html#rtn --><div class="node">
<p><hr>
<a name="File-retention"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Variable-subsetting">Variable subsetting</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Remote-storage">Remote storage</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.8 Retention of remotely retrieved files</h3>

<p><a name="index-file-deletion-350"></a><a name="index-file-removal-351"></a><a name="index-file-retention-352"></a><a name="index-_0040code_007b_002dR_007d-353"></a><a name="index-_0040code_007b_002d_002drtn_007d-354"></a><a name="index-_0040code_007b_002d_002dretain_007d-355"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: <span class="samp">-R</span><br>
Long options: <span class="samp">--rtn</span>, <span class="samp">--retain</span><br>
</td></tr></table>
   In order to conserve local file system space, files retrieved from
remote locations are automatically deleted from the local file system
once they have been processed. 
Many <acronym>NCO</acronym> operators were constructed to work with numerous
large (e.g., 200&nbsp;MB<!-- /@w -->) files. 
Retrieval of multiple files from remote locations is done serially. 
Each file is retrieved, processed, then deleted before the cycle
repeats. 
In cases where it is useful to keep the remotely-retrieved files on the
local file system after processing, the automatic removal feature may be
disabled by specifying <span class="samp">-R</span> on the command line.

   <p>Invoking <code>-R</code> disables the default printing behavior of
<span class="command">ncks</span>. 
This allows <span class="command">ncks</span> to retrieve remote files without
automatically trying to print them. 
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>, for more details.

   <p><a name="index-_0040acronym_007bFTP_007d-356"></a><a name="index-_0040acronym_007bSSH_007d-357"></a><a name="index-_0040acronym_007bmsrcp_007d-358"></a>Note that the remote retrieval features of <acronym>NCO</acronym> can always be
used to retrieve <em>any</em> file, including non-netCDF files, via
<span class="command">SSH</span>, anonymous <acronym>FTP</acronym>, or <span class="command">msrcp</span>. 
Often this method is quicker than using a browser, or running an
<acronym>FTP</acronym> session from a shell window yourself. 
<a name="index-server-359"></a>For example, say you want to obtain a <acronym>JPEG</acronym> file from a weather
server.
<pre class="example">     ncks -R -p ftp://weather.edu/pub/pix/jpeg -l ./ storm.jpg
</pre>
   <p class="noindent">In this example, <span class="command">ncks</span> automatically performs an anonymous
<acronym>FTP</acronym> login to the remote machine and retrieves the specified
file. 
When <span class="command">ncks</span> attempts to read the local copy of <span class="file">storm.jpg</span>
as a netCDF file, it fails and exits, leaving  <span class="file">storm.jpg</span> in
the current directory.

   <p><a name="index-_0040acronym_007bDODS_007d-360"></a><a name="index-server-361"></a>If your <acronym>NCO</acronym> is <acronym>OPeNDAP</acronym>-enabled (see <a href="#OPeNDAP">OPeNDAP</a>),
then you may use <acronym>NCO</acronym> to retrieve any files (including netCDF,
<acronym>HDF</acronym>, etc.) served by a <acronym>OPeNDAP</acronym> server to your local
machine. 
For example,
<pre class="example">     ncks -R -l ./ -p \
     http://www.cdc.noaa.gov/cgi-bin/nph-nc/Datasets/ncep.reanalysis.dailyavgs/surface \
     pres.sfc.1969.nc
</pre>
   <p>Note that <acronym>NCO</acronym> is never the preffered way to transport files
from remote machines. 
For large jobs, that is best handled by <acronym>FTP</acronym>, <acronym>SSH</acronym>,
or <span class="command">wget</span>. 
It may occasionally be useful to use <acronym>NCO</acronym> to transfer files
when your other preferred methods are not available locally.

   <p><a name="var"></a> <!-- http://nco.sf.net/nco.html#var --><div class="node">
<p><hr>
<a name="Variable-subsetting"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Coordinate-variables">Coordinate variables</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#File-retention">File retention</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.9 Including/Excluding specific variables</h3>

<p><a name="index-_0040code_007b_002dv-_0040var_007bvar_007d_007d-362"></a><a name="index-_0040code_007b_002d_002dvariable-_0040var_007bvar_007d_007d-363"></a><a name="index-_0040code_007b_002dx_007d-364"></a><a name="index-_0040code_007b_002d_002dexclude_007d-365"></a><a name="index-_0040code_007b_002d_002dxcl_007d-366"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: (<span class="command">ncap</span>), <span class="command">ncbo</span>, <span class="command">ncea</span>,
<span class="command">ncecat</span>, <span class="command">ncflint</span>, <span class="command">ncks</span>, <span class="command">ncpdq</span>,
<span class="command">ncra</span>, <span class="command">ncrcat</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-v</span>, <span class="samp">-x</span><br>
Long options: <span class="samp">--variable</span>, <span class="samp">--exclude</span> or <span class="samp">--xcl</span><br>
</td></tr></table>
   Variable subsetting is implemented with the <span class="samp">-v
</span><var>var</var><span class="samp">[,...]</span> and <span class="samp">-x</span> options. 
A&nbsp;list<!-- /@w --> of variables to extract is specified following the <span class="samp">-v</span>
option, e.g., <span class="samp">-v time,lat,lon</span>. 
Not using the <span class="samp">-v</span> option is equivalent to specifying all
variables. 
The <span class="samp">-x</span> option causes the list of variables specified with
<span class="samp">-v</span> to be <em>excluded</em> rather than <em>extracted</em>. 
Thus <span class="samp">-x</span> saves typing when you only want to extract fewer than
half of the variables in a file. 
<a name="index-memory-requirements-367"></a>Remember, if averaging or concatenating large files stresses your
systems memory or disk resources, then the easiest solution is often to
use the <span class="samp">-v</span> option to retain only the variables you
really need (see <a href="#Memory-usage">Memory usage</a>). 
Note that, due to its special capabilities, <span class="command">ncap</span> interprets
the <span class="samp">-v</span> switch differently
(see <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>). 
For <span class="command">ncap</span>, the <span class="samp">-v</span> switch takes no arguments and indicates
that <em>only</em> user-defined variables should be output. 
<span class="command">ncap</span> neither accepts nor understands the <var>-x</var> switch.

   <p><a name="rx"></a> <!-- http://nco.sf.net/nco.html#rx -->
<a name="wildcarding"></a> <!-- http://nco.sf.net/nco.html#wildcarding --><a name="index-extended-regular-expressions-368"></a><a name="index-regular-expressions-369"></a><a name="index-pattern-matching-370"></a><a name="index-wildcards-371"></a><a name="index-_0040command_007begrep_007d-372"></a><a name="index-_0040acronym_007bGNU_007d-373"></a>As of <acronym>NCO</acronym> 2.8.1 (August, 2003), variable name arguments
of the <span class="samp">-v</span> switch may contain <dfn>extended regular expressions</dfn>. 
For example, <span class="samp">-v '^DST'</span> selects all variables beginning with the
string <span class="samp">DST</span>. 
Extended regular expressions are defined by the <acronym>GNU</acronym>
<span class="command">egrep</span> command. 
The meta-characters used to express pattern matching operations are
<span class="samp">^$+?.*[]{}|</span>. 
If the regular expression pattern matches <em>any</em> part of a variable
name then that variable is selected. 
This capability is called <dfn>wildcarding</dfn>, and is very useful for
sub-setting large data files.

   <p><a name="index-_0040acronym_007bPOSIX_007d-374"></a><a name="index-_0040code_007bregex_007d-375"></a>Because of its wide availability, <acronym>NCO</acronym> uses the <acronym>POSIX</acronym>
regular expression library <code>regex</code>. 
Regular expressions of arbitary complexity may be used. 
Since netCDF variable names are relatively simple constructs, only a
few varieties of variable wildcards are likely to be useful. 
For convenience, we define the most useful pattern matching operators
here:
<a name="index-_0040code_007b_002e_007d-_0028wildcard-character_0029-376"></a><a name="index-_0040code_007b_0024_007d-_0028wildcard-character_0029-377"></a><a name="index-_0040code_007b_005e_007d-_0028wildcard-character_0029-378"></a><a name="index-_0040code_007b_003f_007d-_0028filename-expansion_0029-379"></a><a name="index-_0040code_007b_002a_007d-_0028filename-expansion_0029-380"></a>
     <dl>
<dt><span class="samp">^</span><dd>Matches the beginning of a string
<br><dt><span class="samp">$</span><dd>Matches the end of a string
<br><dt><span class="samp">.</span><dd>Matches any single character
</dl>
   The most useful repetition and combination operators are
<a name="index-_0040code_007b_003f_007d-_0028wildcard-character_0029-381"></a><a name="index-_0040code_007b_002a_007d-_0028wildcard-character_0029-382"></a><a name="index-_0040code_007b_002b_007d-_0028wildcard-character_0029-383"></a><a name="index-_0040code_007b_007c_007d-_0028wildcard-character_0029-384"></a>
     <dl>
<dt><span class="samp">?</span><dd>The preceding regular expression is optional and matched at most once
<br><dt><span class="samp">*</span><dd>The preceding regular expression will be matched zero or more times
<br><dt><span class="samp">+</span><dd>The preceding regular expression will be matched one or more times
<br><dt><span class="samp">|</span><dd>The preceding regular expression will be joined to the following regular
expression. 
The resulting regular expression matches any string matching either
subexpression. 
</dl>
   To illustrate the use of these operators in extracting variables,
consider a file with variables <code>Q</code>, <code>Q01</code>&ndash;<code>Q99</code>,
<code>Q100</code>, <code>QAA</code>&ndash;<code>QZZ</code>, <code>Q_H2O</code>, <code>X_H2O</code>,
<code>Q_CO2</code>, <code>X_CO2</code>.
<pre class="example">     ncks -v 'Q+' in.nc               # Select variables that start with Q
     ncks -v '^Q+.?.' in.nc           # Select Q, Q01--Q99, QAA--QZZ, etc.
     ncks -v '^Q..' in.nc             # Select Q01--Q99, QAA--QZZ, etc.
     ncks -v '^Q[0-9][0-9]' in.nc     # Select Q01--Q99
     ncks -v '^Q[[:digit:]]{2}' in.nc # Select Q01--Q99
     ncks -v 'H2O$' in.nc             # Select Q_H2O, X_H2O
     ncks -v 'H2O$|CO2$' in.nc        # Select Q_H2O, X_H2O, Q_CO2, X_CO2
     ncks -v '^Q[0-9][0-9]' in.nc     # Select Q01--Q99, Q100
     ncks -v '^Q[0-9][0-9]$' in.nc    # Select Q01--Q99
     ncks -v '^[a-z]_[a-z]{3}$' in.nc # Select Q_H2O, X_H2O, Q_CO2, X_CO2
</pre>
   <p>Beware&mdash;two of the most frequently used repetition pattern matching
operators, <span class="samp">*</span> and <span class="samp">?</span>, are also valid pattern matching
operators for filename expansion (globbing) at the shell-level. 
Confusingly, their meanings in extended regular expressions and in
shell-level filename expansion are significantly different. 
In an extended regular expression, <span class="samp">*</span> matches zero or more
occurences of the preceding regular expression. 
Thus <span class="samp">Q*</span> selects all variables, and <span class="samp">Q+.*</span> selects all
variables containing <span class="samp">Q</span> (the <span class="samp">+</span> ensures the preceding item
matches at least once). 
To match zero or one occurence of the preceding regular expression,
use <span class="samp">?</span>. 
Documentation for the <acronym>UNIX</acronym> <span class="command">egrep</span> command details the
extended regular expressions which <acronym>NCO</acronym> supports.

   <p><a name="index-globbing-385"></a><a name="index-shell-386"></a><a name="index-_0040command_007bbash_007d-387"></a><a name="index-_0040command_007bcsh_007d-388"></a><a name="index-quotes-389"></a>One must be careful to protect any special characters in the regular
expression specification from being interpreted (globbed) by the shell. 
This is accomplish by enclosing special characters within single or
double quotes
<pre class="example">     ncra -v Q?? in.nc out.nc   # Error: Shell attempts to glob wildcards
     ncra -v '^Q+..' in.nc out.nc # Correct: NCO interprets wildcards
     ncra -v '^Q+..' in*.nc out.nc # Correct: NCO interprets, Shell globs
</pre>
   <p>The final example shows that commands may use a combination of variable
wildcarding and shell filename expansion (globbing). 
For globbing, <span class="samp">*</span> and <span class="samp">?</span> <em>have nothing to do</em> with the
preceding regular expression! 
In shell-level filename expansion, <span class="samp">*</span> matches any string,
including the null string and <span class="samp">?</span> matches any single character. 
Documentation for <span class="command">bash</span> and <span class="command">csh</span> describe the rules of
filename expansion (globbing).

   <p><a name="crd"></a> <!-- http://nco.sf.net/nco.html#crd -->
<a name="-C"></a> <!-- http://nco.sf.net/nco.html#-C -->
<a name="-c"></a> <!-- http://nco.sf.net/nco.html#-c --><div class="node">
<p><hr>
<a name="Coordinate-variables"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Fortran-indexing">Fortran indexing</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Variable-subsetting">Variable subsetting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.10 Including/Excluding coordinate variables</h3>

<p><a name="index-_0040code_007b_002dC_007d-390"></a><a name="index-_0040code_007b_002dc_007d-391"></a><a name="index-_0040code_007b_002d_002dno_002dcoords_007d-392"></a><a name="index-_0040code_007b_002d_002dno_002dcrd_007d-393"></a><a name="index-_0040code_007b_002d_002dcoords_007d-394"></a><a name="index-_0040code_007b_002d_002dcrd_007d-395"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncap</span>, <span class="command">ncbo</span>, <span class="command">ncea</span>,
<span class="command">ncecat</span>, <span class="command">ncflint</span>, <span class="command">ncks</span>, <span class="command">ncpdq</span>,
<span class="command">ncra</span>, <span class="command">ncrcat</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-C</span>, <span class="samp">-c</span><br>
Long options: <span class="samp">--no-coords</span>, <span class="samp">--no-crd</span>, <span class="samp">--crd</span>, <span class="samp">--coords</span><br>
</td></tr></table>
   By default, coordinates variables associated with any variable appearing
in the <var>output-file</var> will also appear in the <var>output-file</var>, even
if they are not explicitly specified, e.g., with the <span class="samp">-v</span> switch. 
Thus variables with a latitude coordinate <code>lat</code> always carry the
values of <code>lat</code> with them into the <var>output-file</var>. 
This feature can be disabled with <span class="samp">-C</span>, which causes <acronym>NCO</acronym>
to not automatically add coordinates to the variables appearing in the
<var>output-file</var>. 
However, using <span class="samp">-C</span> does not preclude the user from including some
coordinates in the output files simply by explicitly selecting the
coordinates with the <var>-v</var> option. 
The <span class="samp">-c</span> option, on the other hand, is a shorthand way of
automatically specifying that <em>all</em> coordinate variables in the
<var>input-files</var> should appear in the <var>output-file</var>. 
Thus <span class="samp">-c</span> allows the user to select all the coordinate variables
without having to know their names.

   <p><a name="ftn"></a> <!-- http://nco.sf.net/nco.html#ftn -->
<a name="-F"></a> <!-- http://nco.sf.net/nco.html#-F --><div class="node">
<p><hr>
<a name="Fortran-indexing"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Hyperslabs">Hyperslabs</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Coordinate-variables">Coordinate variables</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.11 C &amp; Fortran index conventions</h3>

<p><a name="index-index-conventions-396"></a><a name="index-Fortran-index-convention-397"></a><a name="index-C-index-convention-398"></a><a name="index-_0040code_007b_002dF_007d-399"></a><a name="index-_0040code_007b_002d_002dfortran_007d-400"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncbo</span>, <span class="command">ncea</span>, <span class="command">ncecat</span>,
<span class="command">ncflint</span>, <span class="command">ncks</span>, <span class="command">ncpdq</span>, <span class="command">ncra</span>,
<span class="command">ncrcat</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-F</span><br>
Long options: <span class="samp">--fortran</span><br>
</td></tr></table>
   <a name="index-I_002fO-401"></a>The <span class="samp">-F</span> switch changes <acronym>NCO</acronym> to read and write with
Fortran index conventions. 
By default, <acronym>NCO</acronym> uses C-style (0-based) indices for all I/O. 
In&nbsp;C<!-- /@w -->, indices count from&nbsp;0<!-- /@w --> (rather than&nbsp;1<!-- /@w -->), and
dimensions are ordered from slowest (inner-most) to fastest
(outer-most) varying. 
In Fortran, indices count from&nbsp;1<!-- /@w --> (rather than&nbsp;0<!-- /@w -->), and
dimensions are ordered from fastest (inner-most) to slowest
(outer-most) varying. 
<a name="index-transpose-402"></a>Hence C&nbsp;and<!-- /@w --> Fortran data storage conventions represent mathematical
transposes of eachother. 
<a name="index-record-variable-403"></a>Note that record variables contain the record dimension as the most
slowly varying dimension. 
See <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a> for techniques
to re-order (including transpose) dimensions and to reverse data
storage order.

   <p><a name="index-record-dimension-404"></a>Consider a file <span class="file">85.nc</span> containing 12&nbsp;months<!-- /@w --> of data in the
record dimension <code>time</code>. 
The following hyperslab operations produce identical results, a
June-July-August average of the data:
<pre class="example">     ncra -d time,5,7 85.nc 85_JJA.nc
     ncra -F -d time,6,8 85.nc 85_JJA.nc
</pre>
   <p>Printing variable <var>three_dmn_var</var> in file <span class="file">in.nc</span> first with
C&nbsp;indexing<!-- /@w --> conventions, then with Fortran indexing conventions
results in the following output formats:
<pre class="example">     % ncks -v three_dmn_var in.nc
     lat[0]=-90 lev[0]=1000 lon[0]=-180 three_dmn_var[0]=0
     ...
     % ncks -F -v three_dmn_var in.nc
     lon(1)=0 lev(1)=100 lat(1)=-90 three_dmn_var(1)=0
     ...
</pre>
   <p><a name="dmn"></a> <!-- http://nco.sf.net/nco.html#dmn -->
<a name="-d"></a> <!-- http://nco.sf.net/nco.html#-d --><div class="node">
<p><hr>
<a name="Hyperslabs"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Multislabs">Multislabs</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Fortran-indexing">Fortran indexing</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.12 Hyperslabs</h3>

<p><a name="index-hyperslab-405"></a><a name="index-dimension-limits-406"></a><a name="index-coordinate-limits-407"></a><a name="index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-408"></a><a name="index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-409"></a><a name="index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-410"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncbo</span>, <span class="command">ncea</span>, <span class="command">ncecat</span>,
<span class="command">ncflint</span>, <span class="command">ncks</span>, <span class="command">ncpdq</span>, <span class="command">ncra</span>,
<span class="command">ncrcat</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-d</span><br>
Long options: <span class="samp">--dimension</span>, <span class="samp">--dmn</span><br>
</td></tr></table>
   A&nbsp;<dfn>hyperslab</dfn><!-- /@w --> is a subset of a variable's data. 
The coordinates of a hyperslab are specified with the <code>-d
</code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code> short option (or with the
<span class="samp">--dimension</span> or <span class="samp">--dmn</span> long options). 
The bounds of the hyperslab to be extracted are specified by the
associated <var>min</var> and <var>max</var> values. 
A&nbsp;half<!-- /@w -->-open range is specified by omitting either the <var>min</var> or
<var>max</var> parameter but including the separating comma. 
The unspecified limit is interpreted as the maximum or minimum value in
the unspecified direction. 
A&nbsp;cross<!-- /@w -->-section at a specific coordinate is extracted by specifying only
the <var>min</var> limit and omitting a trailing comma. 
Dimensions not mentioned are passed with no reduction in range. 
The dimensionality of variables is not reduced (in the case of a
cross-section, the size of the constant dimension will be one). 
If values of a coordinate-variable are used to specify a range or
cross-section, then the coordinate variable must be monotonic (values
either increasing or decreasing). 
In this case, command-line values need not exactly match coordinate
values for the specified dimension. 
Ranges are determined by seeking the first coordinate value to occur in
the closed range [<var>min</var>,<var>max</var>] and including all subsequent
values until one falls outside the range. 
The coordinate value for a cross-section is the coordinate-variable
value closest to the specified value and must lie within the range or
coordinate-variable values.

   <p>Coordinate values should be specified using real notation with a decimal
point required in the value, whereas dimension indices are specified
using integer notation without a decimal point. 
This convention serves only to differentiate coordinate values from
dimension indices. 
It is independent of the type of any netCDF coordinate variables. 
For a given dimension, the specified limits must both be coordinate
values (with decimal points) or dimension indices (no decimal points).

   <p><a name="index-_0040code_007bNC_005fBYTE_007d-411"></a><a name="index-_0040code_007bNC_005fCHAR_007d-412"></a>User-specified coordinate limits are promoted to double precision values
while searching for the indices which bracket the range. 
Thus, hyperslabs on coordinates of type <code>NC_BYTE</code> and
<code>NC_CHAR</code> are computed numerically rather than lexically, so the
results are unpredictable.

   <p><a name="index-wrapped-coordinates-413"></a>The relative magnitude of <var>min</var> and <var>max</var> indicate to the
operator whether to expect a <dfn>wrapped coordinate</dfn>
(see <a href="#Wrapped-coordinates">Wrapped coordinates</a>), such as longitude. 
If <var>min</var> &gt; <var>max</var>, the <acronym>NCO</acronym> expects the
coordinate to be wrapped, and a warning message will be printed. 
When this occurs, <acronym>NCO</acronym> selects all values outside the domain
[<var>max</var> &lt; <var>min</var>], i.e., all the values exclusive of the
values which would have been selected if <var>min</var> and <var>max</var> were
swapped. 
If this seems confusing, test your command on just the coordinate
variables with <span class="command">ncks</span>, and then examine the output to ensure
<acronym>NCO</acronym> selected the hyperslab you expected (coordinate wrapping
is currently only supported by <span class="command">ncks</span>).

   <p>Because of the way wrapped coordinates are interpreted, it is very
important to make sure you always specify hyperslabs in the
monotonically increasing sense, i.e., <var>min</var> &lt; <var>max</var>
(even if the underlying coordinate variable is monotonically
decreasing). 
The only exception to this is when you are indeed specifying a wrapped
coordinate. 
The distinction is crucial to understand because the points selected by,
e.g., <code>-d longitude,50.,340.</code>, are exactly the complement of the
points selected by <code>-d longitude,340.,50.</code>.

   <p>Not specifying any hyperslab option is equivalent to specifying full
ranges of all dimensions. 
This option may be specified more than once in a single command
(each hyperslabed dimension requires its own <code>-d</code> option).

   <p><a name="msa"></a> <!-- http://nco.sf.net/nco.html#msa --><div class="node">
<p><hr>
<a name="Multislabs"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#UDUnits-Support">UDUnits Support</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Hyperslabs">Hyperslabs</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.13 Multislabs</h3>

<p><a name="index-multislab-414"></a><a name="index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-415"></a><a name="index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-416"></a><a name="index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-417"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncks</span><br>
Short options: <span class="samp">-d</span><br>
Long options: <span class="samp">--dimension</span>, <span class="samp">--dmn</span><br>
</td></tr></table>
   In late 2002, <span class="command">ncks</span> added support for specifying a
<dfn>multislab</dfn> for any variable. 
A&nbsp;multislab<!-- /@w --> is a union of one or more hyperslabs
which is specified by chaining together hyperslab commands, i.e.,
<kbd>-d</kbd> options (see <a href="#Hyperslabs">Hyperslabs</a>). 
This allows multislabs to overcome some restraints which limit
hyperslabs.

   <p>A&nbsp;single<!-- /@w --> <kbd>-d</kbd> option can only specify a contiguous and/or regularly
spaced multi-dimensional array of data. 
Multislabs are constructed from multiple <kbd>-d</kbd> options and may
therefore have non-regularly spaced arrays. 
For example, suppose it is desired to operate on all longitudes
from 10.0 to 20.0 and from 80.0 to 90.0&nbsp;degrees<!-- /@w -->. 
The combined range of longitudes is not selectable in a single
hyperslab specfication of the form
<span class="samp">-d </span><var>lon</var><span class="samp">,</span><var>min</var><span class="samp">,</span><var>max</var> or
<span class="samp">-d </span><var>lon</var><span class="samp">,</span><var>min</var><span class="samp">,</span><var>max</var><span class="samp">,</span><var>stride</var> because its
elements are irregularly spaced in coordinate space (and presumably
in index space too). 
The multislab specification for obtaining these values is simply
the union of the hyperslabs specifications that comprise the multislab,
i.e.,
<pre class="example">     ncks -d lon,10.,20. -d lon,80.,90. in.nc out.nc
     ncks -d lon,10.,15. -d lon,15.,20. -d lon,80.,90. in.nc out.nc
</pre>
   <p class="noindent">Any number of hyperslabs specifications may be chained together
to specify the multislab. 
Multislabs are more efficient than the alternative of sequentially
performing hyperslab operations and concatenating the results. 
<a name="index-I_002fO-418"></a>This is because <acronym>NCO</acronym> employs a novel multislab algorithm to
minimize the number of I/O operations when retrieving irregularly spaced
data from disk.

   <p>Users may specify redundant ranges of indices in a multislab, e.g.,
<pre class="example">     ncks -d lon,0,4 -d lon,2,9,2 in.nc out.nc
</pre>
   <p class="noindent">This command retrieves the first five longitudes, and then every other
longitude value up to the tenth. 
Elements 0, 2, and&nbsp;4<!-- /@w --> are specified by both hyperslab arguments (hence
this is redundant) but will count only once if an arithmetic operation
is being performed. 
The <acronym>NCO</acronym> multislab algorithm retrieves each element from disk
once and only once. 
Thus users may take some shortcuts in specifying multislabs and the
algorithm will obtain the intended values. 
Specifying redundant ranges is not encouraged, but may be useful on
occasion and will not result in unintended consequences.

   <p>A&nbsp;final<!-- /@w --> example shows the real power of multislabs. 
Suppose the <var>Q</var> variable contains three dimensional arrays of
distinct chemical constituents in no particular order. 
We are interested in the NOy species in a certain geographic range. 
Say that NO, NO2, and N2O5 are elements&nbsp;0<!-- /@w -->, 1, and&nbsp;5<!-- /@w --> of the
<var>species</var> dimension of <var>Q</var>. 
The multislab specification might look something like
<pre class="example">     ncks -d species,0,1 -d species,5 -d lon,0,4 -d lon,2,9,2 in.nc out.nc
</pre>
   <p class="noindent">Multislabs are powerful because they may be specified for every
dimension at the same time. 
Thus multislabs obsolete the need to execute multiple <span class="command">ncks</span>
commands to gather the desired range of data. 
We envision adding multislab support to all arithmetic operators in the
future.

   <p><a name="UDUnits"></a> <!-- http://nco.sf.net/nco.html#UDUnits --><div class="node">
<p><hr>
<a name="UDUnits-Support"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Wrapped-coordinates">Wrapped coordinates</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Multislabs">Multislabs</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.14 UDUnits Support</h3>

<p><a name="index-UDUnits-419"></a><a name="index-Unidata-420"></a><a name="index-_0040code_007bunits_007d-421"></a><a name="index-attribute_002c-_0040code_007bunits_007d-422"></a><a name="index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-423"></a><a name="index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-424"></a><a name="index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-425"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncbo</span>, <span class="command">ncea</span>, <span class="command">ncecat</span>,
<span class="command">ncflint</span>, <span class="command">ncks</span>, <span class="command">ncpdq</span>, <span class="command">ncra</span>,
<span class="command">ncrcat</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-d</span><br>
Long options: <span class="samp">--dimension</span>, <span class="samp">--dmn</span><br>
</td></tr></table>
   There is more than one way to hyperslab a cat. 
The <a href="http://www.unidata.ucar.edu/packages/udunits">UDUnits</a> package
provides a library which, if present, <acronym>NCO</acronym> uses to translate
user-specified physical dimensions into the physical dimensions of data
stored in netCDF files. 
Unidata provides UDUnits under the same terms as netCDF, so sites should
install both. 
Compiling <acronym>NCO</acronym> with UDUnits support is currently optional but
may become required in a future version of <acronym>NCO</acronym>.

   <p>Two examples suffice to demonstrate the power and convenience of UDUnits
support. 
<a name="index-MKS-units-426"></a>First, consider extraction of a variable containing non-record
coordinates with physical dimensions stored in MKS units. 
In the following example, the user extracts all wavelengths
in the visible portion of the spectrum in terms of the units
very frequently used in visible spectroscopy, microns:
<pre class="example">     % ncks -O -C -H -v wvl -d wvl,"0.4 micron","0.7 micron" in.nc
     wvl[0]=5e-07 meter
</pre>
   <p class="noindent"><a name="index-_0040code_007bunits_007d-427"></a>The hyperslab returns the correct values because the <var>wvl</var> variable
is stored on disk with a length dimension that UDUnits recognizes in the
<code>units</code> attribute. 
The automagical algorithm that implements this functionality is worth
describing since understanding it helps one avoid some potential
pitfalls. 
First, the user includes the physical units of the hyperslab dimensions
she supplies, separated by a simple space from the numerical values of
the hyperslab limits. 
She encloses each coordinate specifications in quotes so that the shell
does not break the <em>value-space-unit</em> string into separate
arguments before passing them to <acronym>NCO</acronym>. 
Double quotes (<kbd>"foo"</kbd>) or single quotes (<kbd>'foo'</kbd>) are equally
valid for this purpose. 
Second, <acronym>NCO</acronym> recognizes that units translation is requested
because each hyperslab argument contains text characters and non-initial
spaces. 
Third, <acronym>NCO</acronym> determines whether the <var>wvl</var> is dimensioned
with a coordinate variable that has a <code>units</code> attribute. 
<a name="index-coordinate-variable-428"></a>In this case, <var>wvl</var> itself is a coordinate variable. 
The value of its <code>units</code> attribute is <code>meter</code>. 
Thus <var>wvl</var> passes this test so UDUnits conversion is attempted. 
If the coordinate associated with the variable does not contain a
<code>units</code> attribute, then <acronym>NCO</acronym> aborts. 
Fourth, <acronym>NCO</acronym> passes the specified and desired dimension strings
(microns are specified by the user, meters are required by
<acronym>NCO</acronym>) to the UDUnits library. 
Fifth, the UDUnits library that these dimension are commensurate
and it returns the appropriate linear scaling factors to convert from
microns to meters to <acronym>NCO</acronym>. 
If the units are incommensurate (i.e., not expressible in the same
fundamental MKS units), or are not listed in the UDUnits database, then
NCO aborts since it cannot determine the user's intent. 
Finally, <acronym>NCO</acronym> uses the scaling information to convert the
user-specified hyperslab limits into the same physical dimensions as
those of the corresponding cooridinate variable on disk. 
At this point, <acronym>NCO</acronym> can perform a coordinate hyperslab using
the same algorithm as if the user had specified the hyperslab without
requesting units conversion.

   <p><a name="index-_0040code_007bunits_007d-429"></a><a name="index-_0040code_007btime_007d-430"></a>The translation and dimennterpretation of time coordinates shows a more
powerful, and probably more common, application of the UDUnits feature. 
In this example, the user prints all data between the eighth and ninth
of December, 1999, from a variable whose time dimension is hours
since the year 1900:
<pre class="example">     % ncks -O -C -v time_udunits -d time_udunits,"1999-12-08 \
     12:00:0.0","1999-12-09 00:00:0.0",2 in.nc foo2.nc
     % time_udunits[1]=876018 hours since 1900-01-01 00:00:0.0
</pre>
   <p class="noindent"><a name="index-stride-431"></a><a name="index-whitespace-432"></a>Here, the user invokes the stride (see <a href="#Stride">Stride</a>) capability to obtain
every other timeslice. 
This is possible because the UDUnits feature is additive, not
exclusive&mdash;it works in conjunction with all other hyperslabbing
(see <a href="#Hyperslabs">Hyperslabs</a>) options and in all operators which support
hyperslabbing. 
The following example shows how one might average data in a
time period spread across multiple input files
<pre class="example">     ncra -O -d time,"1939-09-09 12:00:0.0","1945-05-08 00:00:0.0" \
     in1.nc in2.nc in3.nc out.nc
</pre>
   <p class="noindent">Note that there is no excess whitespace before or after the individual
elements of the <span class="samp">-d</span> argument. 
<a name="index-shell-433"></a>This is important since, as far as the shell knows, <span class="samp">-d</span> takes
only <em>one</em> command-line argument. 
Parsing this argument into its component
<var>dim</var><code>,[</code><var>min</var><code>],[</code><var>max</var><code>],</code><var>stride</var> elements
(see <a href="#Hyperslabs">Hyperslabs</a>) is the job of <acronym>NCO</acronym>. 
When unquoted whitespace is present between these elements, the shell
passes <acronym>NCO</acronym> arugment fragments which will not parse as
intended.

   <p><a name="index-Climate-and-Forecast-Metadata-Convention-434"></a><a name="index-CF-convention-435"></a>The <a href="http://www.unidata.ucar.edu/packages/udunits">UDUnits</a>
package documentation describes the supported formats of time
dimensions. 
Among the metadata conventions which adhere to these formats are the
<a href="http://www.cgd.ucar.edu/cms/eaton/cf-metadata/CF-working.html">Climate and Forecast (CF) Conventions</a> and the
<a href="http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html">Cooperative Ocean/Atmosphere Research Data Service (COARDS) Conventions</a>. 
The following <span class="samp">-d arguments</span> extract the same data using
commonly encountered time dimension formats:
<!-- fxm add more formats here -->
<pre class="example">     -d time,"1918-11-11 11:00:0.0","1939-09-09 00:00:0.0"
</pre>
   <p class="noindent">All of these formats include at least one dash <kbd>-</kbd> in a
non-leading character position (a dash in a leading character position
is a negative sign). 
<acronym>NCO</acronym> assumes that a non-leading dash in a limit string
indicates that a UDUnits date conversion is requested.

   <p><a name="index-MKS-units-436"></a><a name="index-God-437"></a>netCDF variables should always be stored with MKS (i.e., God's) units,
so that application programs may assume MKS dimensions apply to all
input variables. 
The UDUnits feature is intended to alleviate some of the <acronym>NCO</acronym>
user's pain when handling MKS units. 
It connects users who think in human-friendly units (e.g.,
miles, millibars, days) to extract data which are always stored in God's
units, MKS (e.g., meters, Pascals, seconds). 
The feature is not intended to encourage writers to store data in
esoteric units (e.g., furlongs, pounds per square inch, fortnights).

   <p><a name="wrp"></a> <!-- http://nco.sf.net/nco.html#wrp --><div class="node">
<p><hr>
<a name="Wrapped-coordinates"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Stride">Stride</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#UDUnits-Support">UDUnits Support</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.15 Wrapped coordinates</h3>

<p><a name="index-wrapped-coordinates-438"></a><a name="index-longitude-439"></a><a name="index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-440"></a><a name="index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-441"></a><a name="index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-442"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncks</span><br>
Short options: <span class="samp">-d</span><br>
Long options: <span class="samp">--dimension</span>, <span class="samp">--dmn</span><br>
</td></tr></table>
   A&nbsp;<dfn>wrapped&nbsp;coordinate</dfn><!-- /@w --> is a coordinate whose values increase or
decrease monotonically (nothing unusual so far), but which represents a
dimension that ends where it begins (i.e., wraps around on itself). 
Longitude (i.e., degrees on a circle) is a familiar example of a wrapped
coordinate. 
Longitude increases to the East of Greenwich, England, where it is
defined to be zero. 
Halfway around the globe, the longitude is 180&nbsp;degrees<!-- /@w --> East (or West). 
Continuing eastward, longitude increases to 360&nbsp;degrees<!-- /@w --> East at
Greenwich. 
The longitude values of most geophysical data are either in the range
[0,360), or [&minus;180,180). 
In either case, the Westernmost and Easternmost longitudes are
numerically separated by 360&nbsp;degrees<!-- /@w -->, but represent contiguous
regions on the globe. 
For example, the Saharan desert stretches from roughly 340 to
50&nbsp;degrees<!-- /@w --> East. 
Extracting the hyperslab of data representing the Sahara from a global
dataset presents special problems when the global dataset is stored
consecutively in longitude from 0 to 360&nbsp;degrees<!-- /@w -->. 
This is because the data for the Sahara will not be contiguous in the
<var>input-file</var> but is expected by the user to be contiguous in the
<var>output-file</var>. 
In this case, <span class="command">ncks</span> must invoke special software routines to
assemble the desired output hyperslab from multiple reads of the
<var>input-file</var>.

   <p>Assume the domain of the monotonically increasing longitude coordinate
<code>lon</code> is 0 &lt; <var>lon</var> &lt; 360. 
<span class="command">ncks</span> will extract a hyperslab which crosses the Greenwich
meridian simply by specifying the westernmost longitude as <var>min</var> and
the easternmost longitude as <var>max</var>. 
The following commands extract a hyperslab containing the Saharan desert:
<pre class="example">     ncks -d lon,340.,50. in.nc out.nc
     ncks -d lon,340.,50. -d lat,10.,35. in.nc out.nc
</pre>
   <p class="noindent">The first example selects data in the same longitude range as the Sahara. 
The second example further constrains the data to having the same
latitude as the Sahara. 
The coordinate <code>lon</code> in the <var>output-file</var>, <span class="file">out.nc</span>, will
no longer be monotonic! 
The values of <code>lon</code> will be, e.g., <span class="samp">340, 350, 0, 10, 20, 30,
40, 50</span>. 
This can have serious implications should you run <span class="file">out.nc</span> through
another operation which expects the <code>lon</code> coordinate to be
monotonically increasing. 
Fortunately, the chances of this happening are slim, since <code>lon</code>
has already been hyperslabbed, there should be no reason to hyperslab
<code>lon</code> again. 
Should you need to hyperslab <code>lon</code> again, be sure to give
dimensional indices as the hyperslab arguments, rather than coordinate
values (see <a href="#Hyperslabs">Hyperslabs</a>).

   <p><a name="srd"></a> <!-- http://nco.sf.net/nco.html#srd --><div class="node">
<p><hr>
<a name="Stride"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Missing-values">Missing values</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Wrapped-coordinates">Wrapped coordinates</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.16 Stride</h3>

<p><a name="index-stride-443"></a><a name="index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_002c_005b_0040var_007bmax_007d_005d_002c_0040var_007bstride_007d_007d-444"></a><a name="index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_002c_005b_0040var_007bmax_007d_005d_002c_0040var_007bstride_007d_007d-445"></a><a name="index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_002c_005b_0040var_007bmax_007d_005d_002c_0040var_007bstride_007d_007d-446"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncks</span>, <span class="command">ncra</span>, <span class="command">ncrcat</span><br>
Short options: <span class="samp">-d</span><br>
Long options: <span class="samp">--dimension</span>, <span class="samp">--dmn</span><br>
</td></tr></table>
   <span class="command">ncks</span> offers support for specifying a <dfn>stride</dfn> for any
hyperslab, while <span class="command">ncra</span> and <span class="command">ncrcat</span> suport the
<var>stride</var> argument only for the record dimension.
The <var>stride</var> is the spacing between consecutive points in a
hyperslab. 
A&nbsp;<var>stride</var><!-- /@w --> of&nbsp;1<!-- /@w --> means pick all the elements of the
hyperslab, but a <var>stride</var> of&nbsp;2<!-- /@w --> means skip every other element,
etc. 
Using the <var>stride</var> option with <span class="command">ncra</span> and <span class="command">ncrcat</span>
makes it possible, for instance, to average or concatenate regular
intervals across multi-file input data sets.

   <p>The <var>stride</var> is specified as the optional fourth argument to the
<span class="samp">-d</span> hyperslab specification:
<code>-d </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]][,[</code><var>stride</var><code>]]</code>. 
Specify <var>stride</var> as an integer (i.e., no decimal point) following
the third comma in the <span class="samp">-d</span> argument. 
There is no default value for <var>stride</var>. 
Thus using <span class="samp">-d time,,,2</span> is valid but <span class="samp">-d time,,,2.0</span> and
<span class="samp">-d time,,,</span> are not. 
When <var>stride</var> is specified but <var>min</var> is not, there is an
ambiguity as to whether the extracted hyperslab should begin with (using
C-style, 0-based indexes) element&nbsp;0<!-- /@w --> or element <span class="samp">stride-1</span>. 
<acronym>NCO</acronym> must resolve this ambiguity and it chooses element&nbsp;0<!-- /@w -->
as the first element of the hyperslab when <var>min</var> is not specified. 
Thus <span class="samp">-d time,,,</span><var>stride</var> is syntactically equivalent to
<span class="samp">-d time,0,,</span><var>stride</var>. 
This means, for example, that specifying the operation
<span class="samp">-d time,,,2</span> on the array <span class="samp">1,2,3,4,5</span> selects the hyperslab
<span class="samp">1,3,5</span>. 
To obtain the hyperslab <span class="samp">2,4</span> instead, simply explicitly specify
the starting index as&nbsp;1,<!-- /@w --> i.e., <span class="samp">-d time,1,,2</span>.

   <p>For example, consider a file <span class="file">8501_8912.nc</span> which contains 60
consecutive months of data. 
Say you wish to obtain just the March data from this file. 
Using 0-based subscripts (see <a href="#Fortran-indexing">Fortran indexing</a>) these
data are stored in records 2,&nbsp;14,&nbsp;<small class="dots">...</small>&nbsp;50<!-- /@w --> so the desired
<var>stride</var> is&nbsp;12.<!-- /@w -->
Without the <var>stride</var> option, the procedure is very awkward. 
One could use <span class="command">ncks</span> five times and then use <span class="command">ncrcat</span> to
concatenate the resulting files together:
<a name="index-Bourne-Shell-447"></a><a name="index-C-Shell-448"></a>
<pre class="example">     for idx in 02 14 26 38 50; do # Bourne Shell
       ncks -d time,${idx} 8501_8912.nc foo.${idx}
     done
     foreach idx (02 14 26 38 50) # C Shell
       ncks -d time,${idx} 8501_8912.nc foo.${idx}
     end
     ncrcat foo.?? 8589_03.nc
     rm foo.??
</pre>
   <p>With the <var>stride</var> option, <span class="command">ncks</span> performs this hyperslab
extraction in one operation:
<pre class="example">     ncks -d time,2,,12 8501_8912.nc 8589_03.nc
</pre>
   <p>See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>, for more information on <span class="command">ncks</span>.

   <p>The <var>stride</var> option is supported by <span class="command">ncra</span> and
<span class="command">ncrcat</span> for the record dimension only. 
This makes it possible, for instance, to average or concatenate regular
intervals across multi-file input data sets.
<pre class="example">     ncra -F -d time,3,,12 85.nc 86.nc 87.nc 88.nc 89.nc 8589_03.nc
     ncrcat -F -d time,3,,12 85.nc 86.nc 87.nc 88.nc 89.nc 8503_8903.nc
</pre>
   <p><a name="mss_val"></a> <!-- http://nco.sf.net/nco.html#mss_val --><div class="node">
<p><hr>
<a name="Missing-values"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Operation-Types">Operation Types</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Stride">Stride</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.17 Missing values</h3>

<p><a name="index-missing-values-449"></a><a name="index-data_002c-missing-450"></a><a name="index-averaging-data-451"></a><a name="index-_0040code_007bmissing_005fvalue_007d-452"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncap</span>, <span class="command">ncbo</span>, <span class="command">ncea</span>,
<span class="command">ncflint</span>, <span class="command">ncpdq</span>, <span class="command">ncra</span>, <span class="command">ncwa</span><br>
Short options: None<br>
</td></tr></table>

   <p>The phrase <dfn>missing data</dfn> refers to data points that are missing,
invalid, or for any reason not intended to be arithmetically processed
in the same fashion as valid data. 
<a name="index-arithmetic-operators-453"></a>The <acronym>NCO</acronym> arithmetic operators attempt to handle missing data in
an intelligent fashion. 
There are four steps in the <acronym>NCO</acronym> treatment of missing data:
     <ol type=1 start=1>
<li>Identifying variables which may contain missing data.

     <p><acronym>NCO</acronym> follows the convention that missing data should be stored
with the <var>missing_value</var> specified in the variable's
<code>missing_value</code> attribute. 
The <em>only</em> way <acronym>NCO</acronym> recognizes that a variable <em>may</em>
contain missing data is if the variable has a <code>missing_value</code>
attribute. 
In this case, any elements of the variable which are numerically equal
to the <var>missing_value</var> are treated as missing data.

     <li>Converting the <var>missing_value</var> to the type of the variable, if
neccessary.

     <p>Consider a variable <var>var</var> of type <var>var_type</var> with a
<code>missing_value</code> attribute of type <var>att_type</var> containing the
value <var>missing_value</var>. 
As a guideline, the type of the <code>missing_value</code> attribute should be
the same as the type of the variable it is attached to. 
If <var>var_type</var> equals <var>att_type</var> then <acronym>NCO</acronym>
straightforwardly compares each value of <var>var</var> to
<var>missing_value</var> to determine which elements of <var>var</var> are to be
treated as missing data. 
<a name="index-C-language-454"></a>If not, then <acronym>NCO</acronym> converts <var>missing_value</var> from
<var>att_type</var> to <var>var_type</var> by using the implicit conversion rules
of&nbsp;C<!-- /@w -->, or, if <var>att_type</var> is <code>NC_CHAR</code>
<a rel="footnote" href="#fn-22" name="fnd-22"><sup>22</sup></a>, by typecasting the results of the C&nbsp;function<!-- /@w -->
<code>strtod(</code><var>missing_value</var><code>)</code>. 
<a name="index-_0040command_007bncatted_007d-455"></a>You may use the <acronym>NCO</acronym> operator <span class="command">ncatted</span> to change the
<code>missing_value</code> attribute and all data whose data is
<var>missing_value</var> to a new value
(see <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>).

     <li>Identifying missing data during arithmetic operations.

     <p><a name="index-performance-456"></a><a name="index-operator-speed-457"></a><a name="index-speed-458"></a><a name="index-execution-time-459"></a><a name="index-arithmetic-operators-460"></a>When an <acronym>NCO</acronym> arithmetic operator processes a variable <var>var</var>
with a <code>missing_value</code> attribute, it compares each value of
<var>var</var> to <var>missing_value</var> before performing an operation. 
Note the <var>missing_value</var> comparison inflicts a performance penalty
on the operator. 
Arithmetic processing of variables which contain the
<code>missing_value</code> attribute always incurs this penalty, even when
none of the data are missing. 
Conversely, arithmetic processing of variables which do not contain the
<code>missing_value</code> attribute never incurs this penalty. 
In other words, do not attach a <code>missing_value</code> attribute to a
variable which does not contain missing data. 
This exhortation can usually be obeyed for model generated data, but it
may be harder to know in advance whether all observational data will be
valid or not.

     <li>Treatment of any data identified as missing in arithmetic operators.

     <p><a name="index-_0040command_007bncea_007d-461"></a><a name="index-_0040command_007bncra_007d-462"></a><a name="index-_0040command_007bncwa_007d-463"></a><a name="index-_0040command_007bncbo_007d-464"></a><a name="index-_0040command_007bncflint_007d-465"></a><acronym>NCO</acronym> averagers (<span class="command">ncra</span>, <span class="command">ncea</span>, <span class="command">ncwa</span>)
do not count any element with the value <var>missing_value</var> towards the
average. 
<span class="command">ncbo</span> and <span class="command">ncflint</span> define a <var>missing_value</var> result
when either of the input values is a <var>missing_value</var>. 
Sometimes the <var>missing_value</var> may change from file to file in a
multi-file operator, e.g., <span class="command">ncra</span>. 
<acronym>NCO</acronym> is written to account for this (it always compares a
variable to the <var>missing_value</var> assigned to that variable in the
current file). 
Suffice it to say that, in all known cases, <acronym>NCO</acronym> does &ldquo;the
right thing&rdquo;.

     <p>It is impossible to determine and store the correct result of a binary
operation in a single variable. 
One such corner case occurs when both operands have differing
<var>missing_value</var> attributes, i.e., attributes with different
numerical values. 
Since the output (result) of the operation can only have one
<var>missing_value</var>, some information may be lost. 
In this case, <acronym>NCO</acronym> always defines the output variable to have
the same <var>missing_value</var> as the first input variable. 
Prior to performing the arithmetic operation, all values of the second
operand equal to the second <var>missing_value</var> are replaced with the
first <var>missing_value</var>. 
Then the arithmetic operation proceeds as normal, comparing each element
of each operand to a single <var>missing_value</var>. 
Comparing each element to two distinct <var>missing_value</var>'s would be
much slower and would be no likelier to yield a more satisfactory
answer. 
In practice, judicious choice of <var>missing_value</var> values prevents any
important information from being lost.

        </ol>

   <p><a name="op_typ"></a> <!-- http://nco.sf.net/nco.html#op_typ --><div class="node">
<p><hr>
<a name="Operation-Types"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Type-conversion">Type conversion</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Missing-values">Missing values</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.18 Operation Types</h3>

<p><a name="index-operation-types-466"></a><a name="index-_0040code_007bavg_007d-467"></a><a name="index-_0040code_007bsqravg_007d-468"></a><a name="index-_0040code_007bavgsqr_007d-469"></a><a name="index-_0040code_007bmin_007d-470"></a><a name="index-_0040code_007bmax_007d-471"></a><a name="index-_0040code_007brmssdn_007d-472"></a><a name="index-_0040code_007brms_007d-473"></a><a name="index-_0040code_007bttl_007d-474"></a><a name="index-_0040code_007bsqrt_007d-475"></a><a name="index-average-476"></a><a name="index-mean-477"></a><a name="index-total-478"></a><a name="index-minimum-479"></a><a name="index-maximum-480"></a><a name="index-root_002dmean_002dsquare-481"></a><a name="index-standard-deviation-482"></a><a name="index-variance-483"></a><a name="index-_0040code_007b_002dy-_0040var_007bop_005ftyp_007d_007d-484"></a><a name="index-_0040code_007b_002d_002doperation-_0040var_007bop_005ftyp_007d_007d-485"></a><a name="index-_0040code_007b_002d_002dop_005ftyp-_0040var_007bop_005ftyp_007d_007d-486"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncra</span>, <span class="command">ncea</span>, <span class="command">ncwa</span><br>
Short options: <span class="samp">-y</span><br>
Long options: <span class="samp">--operation</span>, <span class="samp">--op_typ</span><br>
</td></tr></table>
   The <span class="samp">-y </span><var>op_typ</var> switch allows specification of many different
types of operations
Set <var>op_typ</var> to the abbreviated key for the corresponding operation:
     <dl>
<dt><code>avg</code><dd>Mean value (default)
<br><dt><code>sqravg</code><dd>Square of the mean
<br><dt><code>avgsqr</code><dd>Mean of sum of squares
<br><dt><code>max</code><dd>Maximium value
<br><dt><code>min</code><dd>Minimium value
<br><dt><code>rms</code><dd>Root-mean-square (normalized by <var>N</var>)
<br><dt><code>rmssdn</code><dd>Root-mean square (normalized by <var>N-1</var>)
<br><dt><code>sqrt</code><dd>Square root of the mean
<br><dt><code>ttl</code><dd>Sum of values
</dl>
   If an operation type is not specified with <span class="samp">-y</span> then the operator
will perform an arithmetic average by default. 
The mathematical definition of each operation is given below. 
See <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>, for additional information on
masks and normalization. 
Averaging is the default, and will be described first so the
terminology for the other operations is familiar.

   <p><table class="cartouche" summary="cartouche" border="1"><tr><td>
<p><b>Note for HTML users</b>:
<br>The definition of mathematical operations involving rank reduction
(e.g., averaging) relies heavily on mathematical expressions which
cannot easily be represented in HTML. 
<b>See the <a href="./nco.pdf">printed manual</a> for much more detailed
and complete documentation of this subject.</b></td></tr></table>

   <p>The definitions of some of these operations are not universally useful. 
Mostly they were chosen to facilitate standard statistical
computations within the <acronym>NCO</acronym> framework. 
We are open to redefining and or adding to the above. 
If you are interested in having other statistical quantities
defined in <acronym>NCO</acronym> please contact the <acronym>NCO</acronym> project
(see <a href="#Help-and-Bug-reports">Help and Bug reports</a>).

<p class="noindent">EXAMPLES

   <p><a name="min"></a> <!-- http://nco.sf.net/nco.html#min -->
<a name="max"></a> <!-- http://nco.sf.net/nco.html#max -->
<a name="rms"></a> <!-- http://nco.sf.net/nco.html#rms -->Suppose you wish to examine the variable <code>prs_sfc(time,lat,lon)</code>
which contains a time series of the surface pressure as a function of
latitude and longitude. 
Find the minimium value of <code>prs_sfc</code> over all dimensions:
<pre class="example">     ncwa -y min -v prs_sfc in.nc foo.nc
</pre>
   <p class="noindent">Find the maximum value of <code>prs_sfc</code> at each time interval for each
latitude:
<pre class="example">     ncwa -y max -v prs_sfc -a lon in.nc foo.nc
</pre>
   <p class="noindent">Find the root-mean-square value of the time-series of <code>prs_sfc</code> at
every gridpoint:
<pre class="example">     ncra -y rms -v prs_sfc in.nc foo.nc
     ncwa -y rms -v prs_sfc -a time in.nc foo.nc
</pre>
   <p class="noindent">The previous two commands give the same answer but <span class="command">ncra</span> is
preferred because it has a smaller memory footprint. 
<a name="index-degenerate-dimension-487"></a>Also, <span class="command">ncra</span> leaves the (degenerate) <code>time</code> dimension in the
output file (which is usually useful) whereas <span class="command">ncwa</span> removes the
<code>time</code> dimension.

<p class="noindent">These operations work as expected in multi-file operators. 
Suppose that <code>prs_sfc</code> is stored in multiple timesteps per file
across multiple files, say <span class="file">jan.nc</span>, <span class="file">feb.nc</span>,
<span class="file">march.nc</span>. 
We can now find the three month maximium surface pressure at every point.
<pre class="example">     ncea -y max -v prs_sfc jan.nc feb.nc march.nc out.nc
</pre>
   <p><a name="stddvn"></a> <!-- http://nco.sf.net/nco.html#stddvn -->It is possible to use a combination of these operations to compute
the variance and standard deviation of a field stored in a single file
or across multiple files. 
The procedure to compute the temporal standard deviation of the surface
pressure at all points in a single file <span class="file">in.nc</span> involves three
steps.
<pre class="example">     ncwa -O -v prs_sfc -a time in.nc out.nc
     ncbo -O --op_typ=sub -v prs_sfc in.nc out.nc out.nc
     ncra -O -y rmssdn out.nc out.nc
</pre>
   <p>First the output file <span class="file">out.nc</span> is contructed containing the
temporal mean of <code>prs_sfc</code>. 
Next <span class="file">out.nc</span> is overwritten with the deviation from the mean. 
Finally <span class="file">out.nc</span> is overwritten with the root-mean-square of
itself. 
Note the use of <span class="samp">-y rmssdn</span> (rather than <span class="samp">-y rms</span>) in the
final step. 
This ensures the standard deviation is correctly normalized by one fewer
than the number of time samples. 
The procedure to compute the variance is identical except for the use of
<span class="samp">-y var</span> instead of <span class="samp">-y rmssdn</span> in the final step.

   <p>The procedure to compute the spatial standard deviation of a field
in a single file <span class="file">in.nc</span> involves three steps.
<pre class="example">     ncwa -O -v prs_sfc,gw -a lat,lon -w gw in.nc out.nc
     ncbo -O --op_typ=sub -v prs_sfc,gw in.nc out.nc out.nc
     ncwa -O -y rmssdn -v prs_sfc -a lat,lon -w gw out.nc out.nc
</pre>
   <p>First the appropriately weighted (with <span class="samp">-w gw</span>) spatial mean values
are written to the output file. 
This example includes the use of a weighted variable specified with
<span class="samp">-w gw</span>. 
When using weights to compute standard deviations one must remember to
include the weights in the initial output files so that they may be used
again in the final step. 
The initial output file is then overwritten with the gridpoint
deviations from the spatial mean. 
Finally the root-mean-square of the appropriately weighted spatial
deviations is taken.

   <p>The procedure to compute the standard deviation of a time-series across
multiple files involves one extra step since all the input must first be
collected into one file.
<pre class="example">     ncrcat -O -v tpt in.nc in.nc foo1.nc
     ncwa -O -a time foo1.nc foo2.nc
     ncbo -O --op_typ=sub -v tpt foo1.nc foo2.nc foo2.nc
     ncra -O -y rmssdn foo2.nc out.nc
</pre>
   <p>The first step assembles all the data into a single file. 
This may require a lot of temporary disk space, but is more or less
required by the <span class="command">ncbo</span> operation in the third step.

   <p><a name="typ_cnv"></a> <!-- http://nco.sf.net/nco.html#typ_cnv --><div class="node">
<p><hr>
<a name="Type-conversion"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Operation-Types">Operation Types</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.19 Type conversion</h3>

<p><a name="index-type-conversion-488"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncap</span>, <span class="command">ncbo</span>, <span class="command">ncea</span>,
<span class="command">ncra</span>, <span class="command">ncwa</span><br>
Short options: None<br>
</td></tr></table>
   <a name="index-promotion-489"></a><a name="index-demotion-490"></a><a name="index-automatic-type-conversion-491"></a><a name="index-manual-type-conversion-492"></a>Type conversion (often called <dfn>promotion</dfn> or <dfn>demotion</dfn>) refers
to the casting of one fundamental data type to another, e.g., converting
<code>NC_SHORT</code> (two bytes) to <code>NC_DOUBLE</code> (eight bytes). 
Type conversion is automatic when the language carries out this
promotion according to an internal set of rules without explicit user
intervention. 
In contrast, manual type conversion refers to explicit user commands to
change the type of a variable or attribute. 
Most type conversion happens automatically, yet there are situations in
which manual type conversion is advantageous.

<ul class="menu">
<li><a accesskey="1" href="#Automatic-type-conversion">Automatic type conversion</a>
<li><a accesskey="2" href="#Manual-type-conversion">Manual type conversion</a>
</ul>

<div class="node">
<p><hr>
<a name="Automatic-type-conversion"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Manual-type-conversion">Manual type conversion</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Type-conversion">Type conversion</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Type-conversion">Type conversion</a>
<br>
</div>

<h4 class="subsection">3.19.1 Automatic type conversion</h4>

<p>As a general rule, automatic type conversions should be avoided for at
least two reasons. 
First, type conversions are expensive since they require creating
(temporary) buffers and casting each element of a variable from
the type it was stored at to some other type. 
Second, the dataset's creator probably had a good reason
for storing data as, say, <code>NC_FLOAT</code> rather than <code>NC_DOUBLE</code>. 
In a scientific framework there is no reason to store data with more
precision than the observations were made. 
Thus <acronym>NCO</acronym> tries to avoid performing automatic type conversions
when performing arithmetic.

   <p><a name="index-C-language-493"></a><a name="index-Fortran-494"></a>Automatic type conversion during arithmetic in the languages&nbsp;C<!-- /@w --> and
Fortran is performed only when necessary. 
All operands in an operation are converted to the most precise type
before the operation takes place. 
However, following this parsimonious conversion rule dogmatically
results in numerous headaches. 
For example, the average of the two <code>NC_SHORT</code>s <code>17000s</code> and
<code>17000s</code> results in garbage since the intermediate value which
holds their sum is also of type <code>NC_SHORT</code> and thus cannot
represent values greater than 32,767
<a rel="footnote" href="#fn-23" name="fnd-23"><sup>23</sup></a>. 
There are valid reasons for expecting this operation to succeed and
the <acronym>NCO</acronym> philosophy is to make operators do what you want, not
what is most pure. 
Thus, unlike C and Fortran, but like many other higher level interpreted
languages, <acronym>NCO</acronym> arithmetic operators will perform automatic type
conversion when all the following conditions are met
<a rel="footnote" href="#fn-24" name="fnd-24"><sup>24</sup></a>:
     <ol type=1 start=1>
<li>The operator is <span class="command">ncea</span>, <span class="command">ncra</span>, or <span class="command">ncwa</span>. 
<span class="command">ncbo</span> is not yet included in this list because subtraction did
not benefit from type conversion. 
This will change in the future
<!-- fxm TODO #265 -->
<li>The arithmetic operation could benefit from type conversion. 
Operations that could benefit (e.g., from larger representable sums)
include averaging, summation, or any "hard" arithmetic. 
Type conversion does not benefit searching for minima and maxima
(<span class="samp">-y min</span>, or <span class="samp">-y max</span>). 
<li>The variable on disk is of type <code>NC_BYTE</code>, <code>NC_CHAR</code>,
<code>NC_SHORT</code>, or <code>NC_INT</code>. 
Type <code>NC_DOUBLE</code> is not type converted because there is no type of
higher precision to convert to. 
Type <code>NC_FLOAT</code> is not type converted because, in our judgement,
the performance penalty of always doing so would outweigh the (extremely
rare) potential benefits.
        </ol>

   <p>When these criteria are all met, the operator promotes the variable in
question to type <code>NC_DOUBLE</code>, performs all the arithmetic
operations, casts the <code>NC_DOUBLE</code> type back to the original type,
and finally writes the result to disk. 
The result written to disk may not be what you expect, because of
incommensurate ranges represented by different types, and because of
(lack of) rounding. 
First, continuing the above example, the average (e.g., <span class="samp">-y avg</span>)
of <code>17000s</code> and <code>17000s</code> is written to disk as <code>17000s</code>. 
The type conversion feature of <acronym>NCO</acronym> makes this possible since
the arithmetic and intermediate values are stored as <code>NC_DOUBLE</code>s,
i.e., <code>34000.0d</code> and only the final result must be represented
as an <code>NC_SHORT</code>. 
Without the type conversion feature of <acronym>NCO</acronym>, the average would
have been garbage (albeit predictable garbage near <code>-15768s</code>). 
Similarly, the total (e.g., <span class="samp">-y ttl</span>) of <code>17000s</code> and
<code>17000s</code> written to disk is garbage (actually <code>-31536s</code>) since
the final result (the true total) of 34000 is outside the range
of type <code>NC_SHORT</code>.

   <p><a name="index-_0040code_007bfloor_007d-495"></a>Type conversions use the <code>floor</code> function to convert floating point
number to integers. 
Type conversions do not attempt to round floating point numbers to the
nearest integer. 
Thus the average of <code>1s</code> and <code>2s</code> is computed in double
precisions arithmetic as
(<code>1.0d</code> + <code>1.5d</code>)/2) = <code>1.5d</code>. 
This result is converted to <code>NC_SHORT</code> and stored on disk as
<code>floor(1.5d)</code> = <code>1s</code>
<a rel="footnote" href="#fn-25" name="fnd-25"><sup>25</sup></a>. 
Thus no "rounding up" is performed. 
The type conversion rules of&nbsp;C<!-- /@w --> can be stated as follows:
If <var>n</var> is an integer then any floating point value <var>x</var>
satisfying

   <p>n &lt;= x &lt; n+1

   <p>will have the value <var>n</var> when converted to an integer.

<div class="node">
<p><hr>
<a name="Manual-type-conversion"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Automatic-type-conversion">Automatic type conversion</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Type-conversion">Type conversion</a>
<br>
</div>

<h4 class="subsection">3.19.2 Manual type conversion</h4>

<p><a name="index-_0040command_007bncap_007d-496"></a><span class="command">ncap</span> provides intrinsic functions for performing manual type
conversions. 
This, for example, converts variable <code>tpt</code> to external type
<code>NC_SHORT</code> (a C-type <code>short</code>), and variable <code>prs</code> to
external type <code>NC_DOUBLE</code> (a C-type <code>double</code>).
<pre class="example">     ncap -O -s "tpt=short(tpt);prs=double(prs);" in.nc out.nc
</pre>
   <p>See <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>, for more details.

   <p><a name="ovr"></a> <!-- http://nco.sf.net/nco.html#ovr --><div class="node">
<p><hr>
<a name="Suppressing-interactive-prompts"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#History-attribute">History attribute</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Type-conversion">Type conversion</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.20 Suppressing interactive prompts</h3>

<p><a name="index-overwriting-files-497"></a><a name="index-appending-to-files-498"></a><a name="index-force-overwrite-499"></a><a name="index-force-append-500"></a><a name="index-_0040code_007b_002dO_007d-501"></a><a name="index-_0040code_007b_002dA_007d-502"></a><a name="index-_0040code_007b_002d_002doverwrite_007d-503"></a><a name="index-_0040code_007b_002d_002dovr_007d-504"></a><a name="index-_0040code_007b_002d_002dapn_007d-505"></a><a name="index-_0040code_007b_002d_002dappend_007d-506"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: <span class="samp">-O</span>, <span class="samp">-A</span><br>
Long options: <span class="samp">--ovr</span>, <span class="samp">--overwrite</span>, <span class="samp">--apn</span>, <span class="samp">--append</span><br>
</td></tr></table>
   If the <var>output-file</var> specified for a command is a pre-existing file,
then the operator will prompt the user whether to overwrite (erase) the
existing <var>output-file</var>, attempt to append to it, or abort the
operation. 
However, in processing large amounts of data, too many interactive
questions can be a curse to productivity. 
Therefore <acronym>NCO</acronym> also implements two ways to override its own safety
features, the <span class="samp">-O</span> and <span class="samp">-A</span> switches. 
Specifying <span class="samp">-O</span> tells the operator to overwrite any existing
<var>output-file</var> without prompting the user interactively. 
Specifying <span class="samp">-A</span> tells the operator to attempt to append to any
existing <var>output-file</var> without prompting the user interactively. 
These switches are useful in batch environments because they suppress
interactive keyboard input.

   <p><a name="hst"></a> <!-- http://nco.sf.net/nco.html#hst -->
<a name="-h"></a> <!-- http://nco.sf.net/nco.html#-h --><div class="node">
<p><hr>
<a name="History-attribute"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Input-file-list-attributes">Input file list attributes</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.21 History attribute</h3>

<p><a name="index-_0040code_007bhistory_007d-507"></a><a name="index-timestamp-508"></a><a name="index-global-attributes-509"></a><a name="index-attributes_002c-global-510"></a><a name="index-_0040code_007b_002dh_007d-511"></a><a name="index-_0040code_007b_002d_002dhst_007d-512"></a><a name="index-_0040code_007b_002d_002dhistory_007d-513"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: <span class="samp">-h</span><br>
Long options: <span class="samp">--hst</span>, <span class="samp">--history</span><br>
</td></tr></table>
   All operators automatically append a <code>history</code> global attribute to
any file they create or modify. 
The <code>history</code> attribute consists of a timestamp and the full string
of the invocation command to the operator, e.g., <span class="samp">Mon May 26 20:10:24
1997: ncks in.nc foo.nc</span>. 
The full contents of an existing <code>history</code> attribute are copied
from the first <var>input-file</var> to the <var>output-file</var>. 
The timestamps appear in reverse chronological order, with the most
recent timestamp appearing first in the <code>history</code> attribute. 
Since <acronym>NCO</acronym> and many other netCDF operators adhere to the
<code>history</code> convention, the entire data processing path of a given
netCDF file may often be deduced from examination of its <code>history</code>
attribute. 
As of May, 2002, <acronym>NCO</acronym> is case-insensitive to the spelling
of the <code>history</code> attribute name. 
Thus attributes named <code>History</code> or <code>HISTORY</code> (which are
non-standard and not recommended) will be treated as valid history
attributes. 
When more than one global attribute fits the case-insensitive search
for "history", the first one found will be used. 
<code>history</code> attribute
<a name="index-_0040command_007bncatted_007d-514"></a>To avoid information overkill, all operators have an optional switch
(<span class="samp">-h</span>, <span class="samp">--hst</span>, or <span class="samp">--history</span>) to override
automatically appending the <code>history</code> attribute
(see <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>). 
Note that the <span class="samp">-h</span> switch also turns off writing the
<code>nco_input_file_list</code> attribute for multi-file operators
(see <a href="#Input-file-list-attributes">Input file list attributes</a>).

   <p><a name="fl_lst_in_att"></a> <!-- http://nco.sf.net/nco.html#fl_lst_in_att --><div class="node">
<p><hr>
<a name="Input-file-list-attributes"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#History-attribute">History attribute</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.22 Input file list attributes</h3>

<p><a name="index-_0040code_007bnco_005finput_005ffile_005flist_007d-515"></a><a name="index-_0040code_007bnco_005finput_005ffile_005fnumber_007d-516"></a><a name="index-_0040code_007bstdin_007d-517"></a><a name="index-global-attributes-518"></a><a name="index-attributes_002c-global-519"></a><a name="index-_0040code_007b_002dH_007d-520"></a><a name="index-_0040code_007b_002d_002dfl_005flst_005fin_007d-521"></a><a name="index-_0040code_007b_002d_002dfile_005flist_007d-522"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncea</span>, <span class="command">ncecat</span>, <span class="command">ncra</span>, <span class="command">ncrcat</span><br>
Short options: <span class="samp">-H</span><br>
Long options: <span class="samp">--fl_lst_in</span>, <span class="samp">--file_list</span><br>
</td></tr></table>
   Many methods of specifying large numbers of input file names pass
these names via pipes, encodings, or argument transfer programs
(see <a href="#Large-numbers-of-input-files">Large numbers of input files</a>). 
When these methods are used, the input file list is not explicitly
passed on the command line. 
This results in a loss of information since the <code>history</code>
attribute no longer contains the exact command by which the file
was created.

   <p><acronym>NCO</acronym> solves this dilemma by archiving input file list
attributes. 
When the input file list to a multi-file operator is specified
via <code>stdin</code>, the operator, by default, attaches two global
attributes to any file they create or modify. 
The <code>nco_input_file_number</code> global attribute contains the number of
input files, and <code>nco_input_file_list</code> contains the file names,
specified as standard input to the multi-file operator. 
This information helps to verify that all input files the user thinks
were piped through <code>stdin</code> actually arrived. 
Without the <code>nco_input_file_list</code> attribute, the information is lost
forever and the &ldquo;chain of evidence&rdquo; would be broken.

   <p>The <span class="samp">-H</span> switch overrides (turns off) the default behavior of
writing the input file list global attributes when input is from
<code>stdin</code>. 
The <span class="samp">-h</span> switch does this too, and turns off the <code>history</code>
attribute as well (see <a href="#History-attribute">History attribute</a>). 
Hence both switches allows space-conscious users to avoid storing what
may amount to many thousands of filenames in a metadata attribute.

   <p><a name="cnv_CCSM"></a> <!-- http://nco.sf.net/nco.html#cnv_CCSM --><div class="node">
<p><hr>
<a name="NCAR-CCSM-Conventions"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ARM-Conventions">ARM Conventions</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Input-file-list-attributes">Input file list attributes</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.23 <acronym>NCAR CCSM</acronym> Conventions</h3>

<p><a name="index-_0040acronym_007bNCAR-CCSM_007d-conventions-523"></a><a name="index-_0040acronym_007bCCSM_007d-conventions-524"></a><a name="index-UDUnits-525"></a><a name="index-_0040code_007bgw_007d-526"></a><a name="index-_0040code_007bORO_007d-527"></a><a name="index-_0040code_007bdate_007d-528"></a><a name="index-_0040code_007bdatesec_007d-529"></a><a name="index-_0040code_007btime_007d-530"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncbo</span>, <span class="command">ncea</span>, <span class="command">ncecat</span>,
<span class="command">ncflint</span>, <span class="command">ncra</span>, <span class="command">ncwa</span><br>
Short options: None<br>
</td></tr></table>
   <acronym>NCO</acronym> recognizes <acronym>NCAR CCSM</acronym> history tapes, and treats
them specially. 
If you do not work with <acronym>NCAR CCSM</acronym> data then you may skip this
section. 
The <acronym>CCSM</acronym> netCDF convention is described at
<a href="http://www.cgd.ucar.edu/csm/experiments/output.format.html">http://www.cgd.ucar.edu/csm/experiments/output.format.html</a>. 
Most of the <acronym>CCSM</acronym> netCDF convention is transparent to
<acronym>NCO</acronym>
<a rel="footnote" href="#fn-26" name="fnd-26"><sup>26</sup></a>. 
There are no known pitfalls associated with using any <acronym>NCO</acronym>
operator on files adhering to this convention
<a rel="footnote" href="#fn-27" name="fnd-27"><sup>27</sup></a>. 
However, to facilitate maximum user friendliness, <acronym>NCO</acronym> does
treat certain variables in some <acronym>CCSM</acronym> files specially. 
The special functions are not required by the <acronym>CCSM</acronym> netCDF
convention, but experience has shown they do make life easier.

   <p>Currently, <acronym>NCO</acronym> determines whether a datafile is a
<acronym>CCSM</acronym> output datafile simply by checking whether value of the
global attribute <code>convention</code> (if it exists) equals
<span class="samp">NCAR-CSM</span>. 
Should <code>convention</code> equal <span class="samp">NCAR-CSM</span> in the (first)
<var>input-file</var>, <acronym>NCO</acronym> will attempt to treat certain variables
specially, because of their meaning in <acronym>CCSM</acronym> files. 
<acronym>NCO</acronym> will not average the following variables often found in
<acronym>CCSM</acronym> files:
<code>ntrm</code>, <code>ntrn</code>, <code>ntrk</code>, <code>ndbase</code>, <code>nsbase</code>,
<code>nbdate</code>, <code>nbsec</code>, <code>mdt</code>, <code>mhisf</code>. 
These variables contain scalar metadata such as the resolution of the
host <acronym>CCSM</acronym> model and it makes no sense to change their values. 
Furthermore, the <span class="command">ncbo</span> operator does not operate on (i.e., add,
subtract, etc.) the following variables:
<code>gw</code>, <code>ORO</code>, <code>date</code>, <code>datesec</code>, <code>hyam</code>,
<code>hybm</code>, <code>hyai</code>, <code>hybi</code>. 
These variables represent the Gaussian weights, the orography field,
time fields, and hybrid pressure coefficients. 
These are fields which you virtually always want to remain unaltered in
the output file. 
If you decide you would like any of the above <acronym>CCSM</acronym> fields
processed, you must spoof <acronym>NCO</acronym>. 
For example rename the variables first with <span class="command">ncrename</span>,
or alter the <code>convention</code> attribute.

   <p><a name="cnv_ARM"></a> <!-- http://nco.sf.net/nco.html#cnv_ARM --><div class="node">
<p><hr>
<a name="ARM-Conventions"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Operator-version">Operator version</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.24 <acronym>ARM</acronym> Conventions</h3>

<p><a name="index-_0040acronym_007bARM_007d-conventions-531"></a><a name="index-_0040code_007btime_005foffset_007d-532"></a><a name="index-_0040code_007bbase_005ftime_007d-533"></a><a name="index-_0040code_007btime_007d-534"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: <span class="command">ncrcat</span><br>
Short options: None<br>
</td></tr></table>
   <span class="command">ncrcat</span> has been programmed to recognize <acronym>ARM</acronym>
(Atmospheric Radiation Measurement Program) data files. 
If you do not work with <acronym>ARM</acronym> data then you may skip this
section. 
<acronym>ARM</acronym> data files store time information in two variables, a
scalar, <code>base_time</code>, and a record variable, <code>time_offset</code>. 
Subtle but serious problems can arise when these type of files are
just blindly concatenated. 
Therefore <span class="command">ncrcat</span> has been specially programmed to be able to
chain together consecutive <acronym>ARM</acronym> <var>input-files</var> and produce
and an <var>output-file</var> which contains the correct time information. 
Currently, <span class="command">ncrcat</span> determines whether a datafile is an
<acronym>ARM</acronym> datafile simply by testing for the existence of the
variables <code>base_time</code>, <code>time_offset</code>, and the dimension
<code>time</code>. 
If these are found in the <var>input-file</var> then <span class="command">ncrcat</span> will
automatically perform two non-standard, but hopefully useful,
procedures. 
First, <span class="command">ncrcat</span> will ensure that values of <code>time_offset</code>
appearing in the <var>output-file</var> are relative to the <code>base_time</code>
appearing in the first <var>input-file</var> (and presumably, though not
necessarily, also appearing in the <var>output-file</var>). 
Second, if a coordinate variable named <code>time</code> is not found in the
<var>input-files</var>, then <span class="command">ncrcat</span> automatically creates the
<code>time</code> coordinate in the <var>output-file</var>. 
The values of <code>time</code> are defined by the <acronym>ARM</acronym> convention
<var>time</var> = <var>base_time</var> + <var>time_offset</var>. 
Thus, if <var>output-file</var> contains the <code>time_offset</code>
variable, it will also contain the <code>time</code> coordinate. 
<a name="index-_0040code_007bhistory_007d-535"></a><a name="index-global-attributes-536"></a><a name="index-attributes_002c-global-537"></a>A&nbsp;short<!-- /@w --> message is added to the <code>history</code> global attribute
whenever these <acronym>ARM</acronym>-specific procedures are executed.

   <p><a name="vrs"></a> <!-- http://nco.sf.net/nco.html#vrs --><div class="node">
<p><hr>
<a name="Operator-version"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ARM-Conventions">ARM Conventions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Common-features">Common features</a>
<br>
</div>

<h3 class="section">3.25 Operator version</h3>

<p><a name="index-version-538"></a><a name="index-_0040acronym_007bRCS_007d-539"></a><a name="index-_0040code_007b_002dr_007d-540"></a><a name="index-_0040code_007b_002d_002drevision_007d-541"></a><a name="index-_0040code_007b_002d_002dversion_007d-542"></a><a name="index-_0040code_007b_002d_002dvrs_007d-543"></a><p><table class="cartouche" summary="cartouche" border="1"><tr><td>
Availability: All operators<br>
Short options: <span class="samp">-r</span><br>
Long options: <span class="samp">--revision</span>, <span class="samp">--version</span>, or <span class="samp">--vrs</span><br>
</td></tr></table>
   All operators can be told to print their internal version number and
copyright notice and then quit with the <span class="samp">-r</span> switch. 
The internal version number varies between operators, and indicates the
most recent change to a particular operator's source code. 
This is useful in making sure you are working with the most recent
operators. 
The version of <acronym>NCO</acronym> you are using might be, e.g., <code>1.2</code>. 
However using <span class="samp">-r</span> on, say, <span class="command">ncks</span>, will produce something
like <span class="samp">NCO netCDF Operators version 1.2
Copyright (C) 1995--2000 Charlie Zender
ncks version 1.30 (2000/07/31) "Bolivia"</span>. 
This tells you <span class="command">ncks</span> contains all patches up to version
<code>1.30</code>, which dates from July&nbsp;31<!-- /@w -->, 2000.

   <p><a name="rfr"></a> <!-- http://nco.sf.net/nco.html#rfr --><div class="node">
<p><hr>
<a name="Operator-Reference-Manual"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Contributing">Contributing</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Common-features">Common features</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">4 Reference manual for all operators</h2>

<p>This chapter presents reference pages for each of the operators
individually. 
The operators are presented in alphabetical order. 
<a name="index-command-line-switches-544"></a>All valid command line switches are included in the syntax statement. 
Recall that descriptions of many of these command line switches are
provided only in <a href="#Common-features">Common features</a>, to avoid redundancy. 
Only options specific to, or most useful with, a particular operator are
described in any detail in the sections below.

<ul class="menu">
<li><a accesskey="1" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>
<li><a accesskey="2" href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>
<li><a accesskey="3" href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>
<li><a accesskey="4" href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a>
<li><a accesskey="5" href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a>
<li><a accesskey="6" href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>
<li><a accesskey="7" href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>
<li><a accesskey="8" href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>
<li><a accesskey="9" href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>
<li><a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>
<li><a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>
<li><a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>
</ul>

   <p><a name="ncap"></a> <!-- http://nco.sf.net/nco.html#ncap --><div class="node">
<p><hr>
<a name="ncap-netCDF-Arithmetic-Processor"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Operator-Reference-Manual">Operator Reference Manual</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.1 <span class="command">ncap</span> netCDF Arithmetic Processor</h3>

<p><a name="index-parser-545"></a><a name="index-lexer-546"></a><a name="index-arithmetic-processor-547"></a><a name="index-ncap-548"></a>
SYNTAX
<pre class="example">     ncap [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]][,[<var>stride</var>]]] [-F] [-f]
     [-l <var>path</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
     [-s <var>algebra</var>] [-S <var>fl.nco</var>] [-v] [-Z]
     <var>input-file</var> [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncap</span> arithmetically processes a netCDF file. 
<a name="index-script-file-549"></a><a name="index-_0040code_007b_002d_002dscript_002dfile_007d-550"></a><a name="index-_0040code_007b_002d_002dfl_005fspt_007d-551"></a><a name="index-_0040code_007b_002d_002dscript_007d-552"></a><a name="index-_0040code_007b_002d_002dspt_007d-553"></a>The processing instructions are contained either in the <acronym>NCO</acronym>
script file <span class="file">fl.nco</span> or in a sequence of command line arguments. 
The options <span class="samp">-s</span> (or long options <span class="samp">--spt</span> or <span class="samp">--script</span>)
are used for in-line scripts and <span class="samp">-S</span> (or long options
<span class="samp">--fl_spt</span> or <span class="samp">--script-file</span>) are used to provide the
filename where (usually multiple) scripting commands are pre-stored. 
<span class="command">ncap</span> was written to perform arbitrary albebraic
transformations of data and archive the results as easily as possible. 
<a name="index-derived-fields-554"></a>See <a href="#Missing-values">Missing values</a>, for treatment of missing values. 
The results of the algebraic manipulations are called
<dfn>derived fields</dfn>.

   <p>Unlike the other operators, <span class="command">ncap</span> does not accept a list of
variables to be operated on as an argument to <span class="samp">-v</span>
(see <a href="#Variable-subsetting">Variable subsetting</a>). 
Rather, the <span class="samp">-v</span> switch takes no arguments and indicates
that <span class="command">ncap</span> should output <em>only</em> user-defined variables. 
<span class="command">ncap</span> does not accept or understand the <var>-x</var> switch.

<!-- @subsection Scripting Mathematical Processing with @command{ncap} -->
<ul class="menu">
<li><a accesskey="1" href="#Left-hand-casting">Left hand casting</a>
<li><a accesskey="2" href="#Syntax-of-ncap-statements">Syntax of ncap statements</a>
<li><a accesskey="3" href="#Intrinsic-functions">Intrinsic functions</a>
<li><a accesskey="4" href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a>
</ul>

   <p><a name="lhc"></a> <!-- http://nco.sf.net/nco.html#lhc --><div class="node">
<p><hr>
<a name="Left-hand-casting"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Syntax-of-ncap-statements">Syntax of ncap statements</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>
<br>
</div>

<h4 class="subsection">4.1.1 Left hand casting</h4>

<p><a name="index-hybrid-coordinate-system-555"></a><a name="index-left-hand-casting-556"></a><a name="index-_0040acronym_007bLHS_007d-557"></a>The following examples demonstrate the utility of the
<dfn>left hand casting</dfn> ability of <span class="command">ncap</span>. 
Consider first this simple, artificial, example. 
If <var>lat</var> and <var>lon</var> are one dimensional coordinates of
dimensions <var>lat</var> and <var>lon</var>, respectively, then addition
of these two one-dimensional arrays is intrinsically ill-defined because
whether <var>lat_lon</var> should be dimensioned <var>lat</var> by <var>lon</var>
or <var>lon</var> by <var>lat</var> is ambiguous (assuming that addition is to
remain a <dfn>commutative</dfn> procedure, i.e., one that does not depend on
the order of its arguments). 
Differing dimensions are said to be <dfn>orthogonal</dfn> to one another,
and sets of dimensions which are mutually exclusive are orthogonal
as a set and any arithmetic operation between variables in orthogonal
dimensional spaces is ambiguous without further information.

   <p>The ambiguity may be resolved by enumerating the desired dimension
ordering of the output expression inside square brackets on the
left hand side (<acronym>LHS</acronym>) of the equals sign. 
This is called <dfn>left hand casting</dfn> because the user resolves the
dimensional ordering of the <acronym>RHS</acronym> of the expression by
specifying the desired ordering on the <acronym>LHS</acronym>.
<pre class="example">     ncap -O -s "lat_lon[lat,lon]=lat+lon" in.nc out.nc
     ncap -O -s "lon_lat[lon,lat]=lat+lon" in.nc out.nc
</pre>
   <p>The explicit list of dimensions on the <acronym>LHS</acronym>, <code>[lat,lon]</code>
resolves the otherwise ambiguous ordering of dimensions in
<var>lat_lon</var>. 
In effect, the <acronym>LHS</acronym> <dfn>casts</dfn> its rank properties onto the
<acronym>RHS</acronym>. 
Without <acronym>LHS</acronym> casting, the dimensional ordering of <var>lat_lon</var>
would be undefined and, hopefully, <span class="command">ncap</span> would print an error
message.

   <p>Consider now a slightly more complex example. 
In geophysical models, a coordinate system based on
a blend of terrain-following and density-following surfaces is
called a <dfn>hybrid coordinate system</dfn>. 
In this coordinate system, four variables must be manipulated to
obtain the pressure of the vertical coordinate:
<var>PO</var> is the domain-mean surface pressure offset (a scalar),
<var>PS</var> is the local (time-varying) surface pressure (usually two
horizontal spatial dimensions, i.e, latitude by longitude), <var>hyam</var>
is the weight given to surfaces of constant density (one spatial
dimension, pressure, which is orthogonal to the horizontal
dimensions), and <var>hybm</var> is the weight given to surfaces of
constant elevation (also one spatial dimension). 
This command constructs a four-dimensional pressure <code>prs_mdp</code>
from the four input variables of mixed rank and orthogonality:
<pre class="example">     ncap -O -s "prs_mdp[time,lat,lon,lev]=P0*hyam+PS*hybm" in.nc out.nc
</pre>
   <p>Manipulating the four fields which define the pressure in a hybrid
coordinate system is easy with left hand casting.

   <p><a name="syn"></a> <!-- http://nco.sf.net/nco.html#syn --><div class="node">
<p><hr>
<a name="Syntax-of-ncap-statements"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Intrinsic-functions">Intrinsic functions</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Left-hand-casting">Left hand casting</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>
<br>
</div>

<h4 class="subsection">4.1.2 Syntax of <span class="command">ncap</span> statements</h4>

<p><a name="index-statement-558"></a><a name="index-syntax-559"></a>Mastering <span class="command">ncap</span> is relatively simple. 
Each valid statement <var>statement</var> consists of standard forward
algebraic expression. 
The <span class="file">fl.nco</span>, if present, is simply a list of such statements,
whitespace, and comments. 
<a name="index-C-language-560"></a>The syntax of statements is most like the computer language&nbsp;C<!-- /@w -->. 
The following characteristics of&nbsp;C<!-- /@w --> are preserved:
     <dl>
<dt>Array syntax<dd><a name="index-array-syntax-561"></a><a name="index-_0040code_007b_005b_005d_007d-_0028array-delimiters_0029-562"></a>Arrays elements are placed within <code>[]</code> characters;
<br><dt>Array indexing<dd><a name="index-array-indexing-563"></a>Arrays are 0-based;
<br><dt>Array storage<dd><a name="index-array-storage-564"></a>Last dimension is most rapidly varying;
<br><dt>Assignment statements<dd><a name="index-assignment-statement-565"></a><a name="index-semi_002dcolon-566"></a><a name="index-_0040code_007b_003b_007d-_0028end-of-statement_0029-567"></a>A&nbsp;semi<!-- /@w -->-colon <span class="samp">;</span> indicates the end of an assignment statement. 
<br><dt>Comments<dd><a name="index-comments-568"></a><a name="index-_0040code_007b_002f_002a_002e_002e_002e_002a_002f_007d-_0028comment_0029-569"></a><a name="index-_0040code_007b_002f_002f_007d-_0028comment_0029-570"></a>Multi-line comments are enclosed within <code>/* */</code> characters. 
Single line comments are preceded by <code>//</code> characters. 
<br><dt>Nesting<dd><a name="index-including-files-571"></a><a name="index-nesting-572"></a><a name="index-_0040code_007b_0023include_007d-573"></a>Files may be nested in scripts using <code>#include </code><var>script</var>. 
Note that the <code>#include</code> command is not followed by a semi-colon
because it is a pre-processor directive, not an assignment statement. 
The filename <span class="file">script</span> is interpreted relative to the run directory. 
<br><dt>Attribute syntax<dd><a name="index-attribute-syntax-574"></a><a name="index-_0040code_007b_0040_0040_007d-_0028attribute_0029-575"></a>The at-sign <code>@</code> is used to delineate an attribute name from a
variable name. 
</dl>

   <p><a name="fnc"></a> <!-- http://nco.sf.net/nco.html#fnc --><div class="node">
<p><hr>
<a name="Intrinsic-functions"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Syntax-of-ncap-statements">Syntax of ncap statements</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>
<br>
</div>

<h4 class="subsection">4.1.3 Intrinsic functions</h4>

<p><span class="command">ncap</span> contains a small (and growing) library of intrinsic
functions. 
In addition to the standard mathematical functions
(see <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a>), <span class="command">ncap</span> currently
supports packing and unpacking.

<h4 class="unnumberedsubsec">Packing and Unpacking Algorithms</h4>

<p><a name="index-packing-576"></a><a name="index-unpacking-577"></a><a name="index-_0040code_007badd_005foffset_007d-578"></a><a name="index-_0040code_007bscale_005ffactor_007d-579"></a><a name="index-_0040code_007bmissing_005fvalue_007d-580"></a><a name="index-_0040command_007bpack_0028x_0029_007d-581"></a><a name="index-_0040command_007bunpack_0028x_0029_007d-582"></a>
     <dl>
<dt><code>pack(x)</code><dd><dfn>Packing</dfn>
The standard packing algorithm is applied to variable <var>x</var>. 
The packing algorithm is lossy, and produces data with the same dynamic
range as the original but which requires no more than half the space
to store. 
The packed variable is stored (usually) as type <code>NC_SHORT</code>
with the two attributes required to unpack the variable,
<code>scale_factor</code> and <code>add_offset</code>, stored at the original
(unpacked) precision of the variable
<a rel="footnote" href="#fn-28" name="fnd-28"><sup>28</sup></a>. 
Let <var>min</var> and <var>max</var> be the minimum and maximum values
of&nbsp;<var>x</var>.<!-- /@w -->
     <pre class="sp">
     
     </pre>
     <var>scale_factor</var> = (<var>max</var>-<var>min</var>)/<var>ndrv</var><br>
<var>add_offset</var> = 0.5*(<var>min</var>+<var>max</var>)<br>
<var>pck</var> = (<var>upk</var>-<var>add_offset</var>)/<var>scale_factor</var> = (<var>upk</var>-0.5*(<var>min</var>+<var>max</var>))*<var>ndrv</var>/(<var>max</var>-<var>min</var>)<br>
     <pre class="sp">
     
     </pre>
     where <var>ndrv</var> is the number of discrete representable values for
given type of packed variable. 
The theoretical maximum value for <var>ndrv</var> is two raised to the
number of bits used to store the packed variable. 
Thus if the variable is packed into type <code>NC_SHORT</code>, a two-byte
datatype, then there are at most 2^16 = 65536 distinct values
representible. 
In practice, the number of discretely representible values is taken
to be one less than the theoretical maximum. 
This leaves extra space and solves potential problems with rounding
which can occur during the unpacking of the variable. 
Thus for <code>NC_SHORT</code>, ndrv = 65536 - 1 = 65535. 
Less often, the variable may be packed into type <code>NC_CHAR</code>,
where ndrv = 256 - 1 = 255, or type <code>NC_INT</code> where
where ndrv = 4294967295 - 1 = 4294967294. 
<br><dt><code>unpack(x)</code><dd><dfn>Unpacking</dfn>
The standard unpacking algorithm is applied to variable <var>x</var>. 
The unpacking algorithm depends on the presence of two attributes,
<code>scale_factor</code> and <code>add_offset</code>. 
If <code>scale_factor</code> is present for a variable, the data are
multiplied by the value <var>scale_factor</var> after the data are read. 
If <code>add_offset</code> is present for a variable, then the
<var>add_offset</var> value is added to the data after the data are read. 
If both <code>scale_factor</code> and <code>add_offset</code> attributes are
present, the data are first scaled by <var>scale_factor</var> before the
offset <var>add_offset</var> is added.
     <pre class="sp">
     
     </pre>
     <var>upk</var> = <var>scale_factor</var>*<var>pck</var> + <var>add_offset</var> = (<var>max</var>-<var>min</var>)*<var>pck</var>/<var>ndrv</var> + 0.5*(<var>min</var>+<var>max</var>)<br>
     <pre class="sp">
     
     </pre>
     When <code>scale_factor</code> and <code>add_offset</code> are used for packing, the
associated variable (containing the packed data) is typically of type
<code>byte</code> or <code>short</code>, whereas the unpacked values are intended to
be of type <code>int</code>, <code>float</code>, or <code>double</code>. 
An attribute's <code>scale_factor</code> and <code>add_offset</code> and
<code>missing_value</code>, if any, should all be of the type intended for the
unpacked data, i.e., <code>int</code>, <code>float</code> or <code>double</code>. 
</dl>
   One useful feature of (lossy) netCDF packing algorithm is that
additional, loss-less packing algorithms perform well on top of it.

<h4 class="unnumberedsubsec">Type Conversion Functions</h4>

<p>These intrinsic functions allow <span class="command">ncap</span> to convert variables on
disk among the available types supported by netCDF. 
<a name="index-type-conversion-583"></a><a name="index-promotion-584"></a><a name="index-demotion-585"></a><a name="index-_0040code_007bbyte_0028x_0029_007d-586"></a><a name="index-_0040code_007bchar_0028x_0029_007d-587"></a><a name="index-_0040code_007bdouble_0028x_0029_007d-588"></a><a name="index-_0040code_007bfloat_0028x_0029_007d-589"></a><a name="index-_0040code_007bint_0028x_0029_007d-590"></a><a name="index-_0040code_007bshort_0028x_0029_007d-591"></a>
     <dl>
<dt><code>byte(x)</code><dd><dfn>Convert to </dfn><code>NC_BYTE</code>
Converts <var>x</var> to external type <code>NC_BYTE</code>, a C-type <code>signed char</code>. 
<br><dt><code>char(x)</code><dd><dfn>Convert to </dfn><code>NC_CHAR</code>
Converts <var>x</var> to external type <code>NC_CHAR</code>, a C-type <code>unsigned char</code>. 
<br><dt><code>double(x)</code><dd><dfn>Convert to </dfn><code>NC_DOUBLE</code>
Converts <var>x</var> to external type <code>NC_DOUBLE</code>, a C-type <code>double</code>. 
<br><dt><code>float(x)</code><dd><dfn>Convert to </dfn><code>NC_FLOAT</code>
Converts <var>x</var> to external type <code>NC_FLOAT</code>, a C-type <code>float</code>. 
<br><dt><code>int(x)</code><dd><dfn>Convert to </dfn><code>NC_INT</code>
Converts <var>x</var> to external type <code>NC_INT</code>, a C-type <code>int</code>. 
<br><dt><code>short(x)</code><dd><dfn>Convert to </dfn><code>NC_SHORT</code>
Converts <var>x</var> to external type <code>NC_SHORT</code>, a C-type <code>short</code>. 
</dl>
   See <a href="#Type-conversion">Type conversion</a>, for more details on automatic and manual type conversion.

   <p><a name="mth"></a> <!-- http://nco.sf.net/nco.html#mth --><div class="node">
<p><hr>
<a name="Intrinsic-mathematical-functions"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Intrinsic-functions">Intrinsic functions</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>
<br>
</div>

<h4 class="subsection">4.1.4 Intrinsic mathematical functions</h4>

<p><span class="command">ncap</span> supports the standard mathematical functions supplied with
most operating systems. 
<a name="index-addition-592"></a><a name="index-subtraction-593"></a><a name="index-multiplication-594"></a><a name="index-division-595"></a><a name="index-exponentiation-596"></a><a name="index-power-597"></a><a name="index-modulus-598"></a><a name="index-_0040code_007b_002b_007d-_0028addition_0029-599"></a><a name="index-_0040code_007b_002d_007d-_0028subtraction_0029-600"></a><a name="index-_0040code_007b_002a_007d-_0028multiplication_0029-601"></a><a name="index-_0040code_007b_002f_007d-_0028division_0029-602"></a><a name="index-_0040code_007b_005e_007d-_0028power_0029-603"></a><a name="index-_0040code_007b_0025_007d-_0028modulus_0029-604"></a>Standard calculator notation is used for addition <kbd>+</kbd>, subtraction
<kbd>-</kbd>, multiplication <kbd>*</kbd>, division <kbd>/</kbd>, exponentiation
<kbd>^</kbd>, and modulus <kbd>%</kbd>. 
The available elementary mathematical functions are:
<a name="index-_0040var_007babs_007d-605"></a><a name="index-_0040var_007bacosh_007d-606"></a><a name="index-_0040var_007bacos_007d-607"></a><a name="index-_0040var_007basinh_007d-608"></a><a name="index-_0040var_007basin_007d-609"></a><a name="index-_0040var_007batanh_007d-610"></a><a name="index-_0040var_007batan_007d-611"></a><a name="index-_0040var_007bceil_007d-612"></a><a name="index-_0040var_007bcosh_007d-613"></a><a name="index-_0040var_007bcos_007d-614"></a><a name="index-_0040var_007berfc_007d-615"></a><a name="index-_0040var_007berf_007d-616"></a><a name="index-_0040var_007bexp_007d-617"></a><a name="index-_0040var_007bfloor_007d-618"></a><a name="index-_0040var_007bgamma_007d-619"></a><a name="index-_0040var_007bln_007d-620"></a><a name="index-_0040var_007blog10_007d-621"></a><a name="index-_0040var_007blog_007d-622"></a><a name="index-_0040var_007bnearbyint_007d-623"></a><a name="index-_0040var_007bpow_007d-624"></a><a name="index-_0040var_007brint_007d-625"></a><a name="index-_0040var_007bround_007d-626"></a><a name="index-_0040var_007bsinh_007d-627"></a><a name="index-_0040var_007bsin_007d-628"></a><a name="index-_0040var_007bsqrt_007d-629"></a><a name="index-_0040var_007btanh_007d-630"></a><a name="index-_0040var_007btan_007d-631"></a><a name="index-_0040var_007btrunc_007d-632"></a><a name="index-mathematical-functions-633"></a><a name="index-nearest-integer-function-_0028inexact_0029-634"></a><a name="index-nearest-integer-function-_0028exact_0029-635"></a><a name="index-rounding-functions-636"></a><a name="index-truncation-function-637"></a><a name="index-absolute-value-638"></a><a name="index-arccosine-function-639"></a><a name="index-arcsine-function-640"></a><a name="index-arctangent-function-641"></a><a name="index-ceiling-function-642"></a><a name="index-complementary-error-function-643"></a><a name="index-cosine-function-644"></a><a name="index-error-function-645"></a><a name="index-exponentiation-function-646"></a><a name="index-floor-function-647"></a><a name="index-gamma-function-648"></a><a name="index-hyperbolic-arccosine-function-649"></a><a name="index-hyperbolic-arcsine-function-650"></a><a name="index-hyperbolic-arctangent-function-651"></a><a name="index-hyperbolic-cosine-function-652"></a><a name="index-hyperbolic-sine-function-653"></a><a name="index-hyperbolic-tangent-654"></a><a name="index-logarithm_002c-base-10-655"></a><a name="index-logarithm_002c-natural-656"></a><a name="index-power-function-657"></a><a name="index-sine-function-658"></a><a name="index-square-root-function-659"></a>
     <dl>
<dt><code>abs(x)</code><dd><dfn>Absolute value</dfn>
Absolute value of <var>x</var>. 
Example:
abs(-1) = 1
<br><dt><code>acos(x)</code><dd><dfn>Arc-cosine</dfn>
Arc-cosine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
acos(1.0) = 0.0
<br><dt><code>acosh(x)</code><dd><dfn>Hyperbolic arc-cosine</dfn>
Hyperbolic arc-cosine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
acosh(1.0) = 0.0
<br><dt><code>asin(x)</code><dd><dfn>Arc-sine</dfn>
Arc-sine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
asin(1.0) = 1.57079632679489661922
<br><dt><code>asinh(x)</code><dd><dfn>Hyperbolic arc-sine</dfn>
Hyperbolic arc-sine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
asinh(1.0) = 0.88137358702
<br><dt><code>atan(x)</code><dd><dfn>Arc-tangent</dfn>
Arc-tangent of <var>x</var> where <var>x</var> is specified in radians between
-pi/2 and pi/2. 
Example:
atan(1.0) = 0.78539816339744830961
<br><dt><code>atanh(x)</code><dd><dfn>Hyperbolic arc-tangent</dfn>
Hyperbolic arc-tangent of <var>x</var> where <var>x</var> is specified in radians between
-pi/2 and pi/2. 
Example:
atanh(3.14159265358979323844) = 1.0
<br><dt><code>ceil(x)</code><dd><dfn>Ceil</dfn>
Ceiling of <var>x</var>. Smallest integral value not less than argument. 
Example:
ceil(0.1) = 1.0
<br><dt><code>cos(x)</code><dd><dfn>Cosine</dfn>
Cosine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
cos(0.0) = 1.0
<br><dt><code>cosh(x)</code><dd><dfn>Hyperbolic cosine</dfn>
Hyperbolic cosine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
cosh(0.0) = 1.0
<br><dt><code>erf(x)</code><dd><dfn>Error function</dfn>
Error function of <var>x</var> where <var>x</var> is specified between
-1 and 1. 
Example:
erf(1.0) = 0.842701
<br><dt><code>erfc(x)</code><dd><dfn>Complementary error function</dfn>
Complementary error function of <var>x</var> where <var>x</var> is specified between
-1 and 1. 
Example:
erfc(1.0) = 0.15729920705
<br><dt><code>exp(x)</code><dd><dfn>Exponential</dfn>
Exponential of <var>x</var>,
e^x. 
Example:
exp(1.0) = 2.71828182845904523536
<br><dt><code>floor(x)</code><dd><dfn>Floor</dfn>
Floor of <var>x</var>. Largest integral value not greater than argument. 
Example:
floor(1.9) = 1
<br><dt><code>gamma(x)</code><dd><dfn>Gamma function</dfn>
Gamma function of <var>x</var>,
Gamma(x). 
The well-known and loved continuous factorial function. 
Example:
gamma(0.5) = sqrt(pi)
<br><dt><code>ln(x)</code><dd><dfn>Natural Logarithm</dfn>
Natural logarithm of <var>x</var>,
ln(x). 
Example:
ln(2.71828182845904523536) = 1.0
<br><dt><code>log(x)</code><dd><dfn>Natural Logarithm</dfn>
Exact synonym for <code>ln(x)</code>. 
<br><dt><code>log10(x)</code><dd><dfn>Base 10 Logarithm</dfn>
Base&nbsp;10<!-- /@w --> logarithm of <var>x</var>,
log10(x). 
Example:
log(10.0) = 1.0
<br><dt><code>nearbyint(x)</code><dd><dfn>Round inexactly</dfn>
Nearest integer to <var>x</var> is returned in floating point format. 
<a name="index-inexact-conversion-660"></a>No exceptions are raised for <dfn>inexact conversions</dfn>. 
Example:
nearbyint(0.1) = 0.0
<br><dt><code>pow(x,y)</code><dd><dfn>Power</dfn>
<a name="index-promotion-661"></a><a name="index-automatic-type-conversion-662"></a>Value of <var>x</var> is raised to the power of <var>y</var>. 
Exceptions are raised for <dfn>domain errors</dfn>. 
Due to type-limitations in the C&nbsp;language<!-- /@w --> <code>pow</code> function,
integer arguments are promoted (see <a href="#Type-conversion">Type conversion</a>) to type
<code>NC_FLOAT</code> before evaluation. 
Example:
pow(2,3) = 8
<br><dt><code>rint(x)</code><dd><dfn>Round exactly</dfn>
Nearest integer to <var>x</var> is returned in floating point format. 
Exceptions are raised for <dfn>inexact conversions</dfn>. 
Example:
rint(0.1) = 0
<br><dt><code>round(x)</code><dd><dfn>Round</dfn>
Nearest integer to <var>x</var> is returned in floating point format. 
Round halfway cases away from zero, regardless of current IEEE rounding direction. 
Example:
round(0.5) = 1.0
<br><dt><code>sin(x)</code><dd><dfn>Sine</dfn>
Sine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
sin(1.57079632679489661922) = 1.0
<br><dt><code>sinh(x)</code><dd><dfn>Hyperbolic sine</dfn>
Hyperbolic sine of <var>x</var> where <var>x</var> is specified in radians. 
Example:
sinh(1.0) = 1.1752
<br><dt><code>sqrt(x)</code><dd><dfn>Square Root</dfn>
Square Root of <var>x</var>,
sqrt(x). 
Example:
sqrt(4.0) = 2.0
<br><dt><code>tan(x)</code><dd><dfn>Tangent</dfn>
Tangent of <var>x</var> where <var>x</var> is specified in radians. 
Example:
tan(0.78539816339744830961) = 1.0
<br><dt><code>tanh(x)</code><dd><dfn>Hyperbolic tangent</dfn>
Hyperbolic tangent of <var>x</var> where <var>x</var> is specified in radians. 
Example:
tanh(1.0) = 0.761594155956
<br><dt><code>trunc(x)</code><dd><dfn>Truncate</dfn>
Nearest integer to <var>x</var> is returned in floating point format. 
Round halfway cases toward zero, regardless of current IEEE rounding direction. 
Example:
trunc(0.5) = 0.0
</dl>
   The complete list of mathematical functions supported is
platform-specific. 
Functions mandated by ANSI&nbsp;C<!-- /@w --> are <em>guaranteed</em> to be present
and are indicated with an asterisk
<!-- fxm No they're not, not yet -->
<a name="index-_0040code_007bANSI-C_007d-663"></a><a name="index-_0040code_007bfloat_007d-664"></a><a name="index-precision-665"></a><a name="index-quadruple-precision-666"></a><a name="index-single-precision-667"></a><a name="index-double-precision-668"></a><a name="index-_0040code_007blong-double_007d-669"></a><a name="index-_0040code_007bNC_005fDOUBLE_007d-670"></a><a rel="footnote" href="#fn-29" name="fnd-29"><sup>29</sup></a>. 
and are indicated with an asterisk. 
<a name="index-_0040code_007b_002df_007d-671"></a><a name="index-_0040code_007b_002d_002dprn_005ffnc_005ftbl_007d-672"></a><a name="index-_0040code_007b_002d_002dfnc_005ftbl_007d-673"></a>Use the <span class="samp">-f</span> (or <span class="samp">fnc_tbl</span> or <span class="samp">prn_fnc_tbl</span>) switch
to print a complete list of functions supported on your platform. 
This prints a list of functions and whether they are supported
for netCDF variables of intrinsic type <code>NC_FLOAT</code> and <code>NC_DOUBLE</code>. 
<a name="index-Linux-674"></a><a rel="footnote" href="#fn-30" name="fnd-30"><sup>30</sup></a>

<p class="noindent">EXAMPLES

   <p>Define new attribute <var>new</var> for existing variable <var>one</var>
as twice the existing attribute <var>double_att</var> of variable
<var>att_var</var>:
<pre class="example">     ncap -O -s "one@new=2*att_var@double_att" in.nc out.nc
</pre>
   <p>Average variables of mixed types (result is of type <code>double</code>):
<pre class="example">     ncap -O -s "average=(var_float+var_double+var_int)/3" in.nc out.nc
</pre>
   <p>Multiple commands may be given to <span class="command">ncap</span> in three ways. 
First, the commands may be placed in a script which is executed, e.g.,
<span class="file">tst.nco</span>. 
Second, the commands may be individually specified with multiple
<span class="samp">-s</span> arguments to the same <span class="command">ncap</span> invocation. 
Third, the commands may be chained together into a single <span class="samp">-s</span>
argument to <span class="command">ncap</span>. 
Assuming the file <span class="file">tst.nco</span> contains the commands
<code>a=3;b=4;c=sqrt(a^2+b^2);</code>, then the following <span class="command">ncap</span>
invocations produce identical results:
<pre class="example">     ncap -O -v -S tst.nco in.nc out.nc
     ncap -O -v -s "a=3" -s "b=4" -s "c=sqrt(a^2+b^2)" in.nc out.nc
     ncap -O -v -s "a=3;b=4;c=sqrt(a^2+b^2)" in.nc out.nc
</pre>
   <p>The second and third examples show that <span class="command">ncap</span> does not require
that a trailing semi-colon <span class="samp">;</span> be placed at the end of a <span class="samp">-s</span>
argument, although a trailing semi-colon <span class="samp">;</span> is always allowed. 
However, semi-colons are required to separate individual assignment
statements chained together as a single <span class="samp">-s</span> argument.

   <p><a name="flg"></a> <!-- http://nco.sf.net/nco.html#flg --><a name="index-flags-675"></a>Imagine you wish to create a binary flag based on the value of
an array. 
The flag should have value&nbsp;1.0<!-- /@w --> where the array exceeds&nbsp;1.0<!-- /@w -->,
and value&nbsp;0.0<!-- /@w --> elsewhere. 
Assume the array named <code>ORO</code> is in <span class="file">in.nc</span>. 
The variable <code>ORO_flg</code> in <span class="file">out.nc</span>
<a name="index-masked-average-676"></a><a name="index-ncecat-677"></a><a name="index-ncwa-678"></a><a name="index-degenerate-dimension-679"></a>
<pre class="example">     # Add degenerate "record" dimension to ORO for averaging
     ncecat -O -v ORO in.nc foo.nc
     # Average degenerate "record" dimension using ORO as mask
     ncwa -a record -O -m ORO -T gt -M 1.0 foo.nc foo.nc
     # ORO is either 0.0 or &gt; 1.0 everywhere
     # Create ORO_frc in [0.0,1.0) then add 0.99 and convert to int
     ncap -O -s "ORO_frc=ORO-int(ORO)" -s "ORO_flg=int(ORO_frc+0.99)" foo.nc out.nc
     # ORO_flg now equals 0 or 1
</pre>
   <p><a name="cvr"></a> <!-- http://nco.sf.net/nco.html#cvr -->This example uses <span class="command">ncap</span> to compute the covariance of two
variables. 
Let the variables <var>u</var> and <var>v</var> be the horizontal
wind components. 
<a name="index-covariance-680"></a><!-- fxm 20030423: texi2html 1.64 has problems with this legal syntax but makeinfo -html does not -->
The <dfn>covariance</dfn> of <var>u</var> and <var>v</var> is defined
as the time mean product of the deviations of <var>u</var> and
<var>v</var> from their respective time means. 
Symbolically, the covariance

   <p>[<var>u'v'</var>] =
[<var>uv</var>]-[<var>u</var>][<var>v</var>]
where [<var>x</var>] denotes the time-average of
<var>x</var> and <var>x'</var>

   <p>denotes the deviation from the time-mean. 
The covariance tells us how much of the correlation of two signals
arises from the signal fluctuations versus the mean signals. 
<a name="index-eddy-covariance-681"></a>Sometimes this is called the <dfn>eddy covariance</dfn>. 
We will store the covariance in the variable <code>uprmvprm</code>.
<pre class="example">     ncwa -O -a time -v u,v in.nc foo.nc # Compute time mean of u,v
     ncrename -O -v u,uavg -v v,vavg foo.nc # Rename to avoid conflict
     ncks -A -v uavg,vavg foo.nc in.nc # Place time means with originals
     ncap -O -s "uprmvprm=u*v-uavg*vavg" in.nc in.nc # Covariance
     ncra -O -v uprmvprm in.nc foo.nc # Time-mean covariance
</pre>
   <p>The mathmatically inclined will note that the same covariance would be
obtained by replacing the step involving <span class="command">ncap</span> with
<pre class="example">     ncap -O -s "uprmvprm=(u-uavg)*(v-vavg)" foo.nc foo.nc # Covariance
</pre>
   <p><a name="index-appending-data-682"></a><a name="index-time_002daveraging-683"></a><a name="index-ncks-684"></a><a name="index-ncwa-685"></a><a name="index-ncra-686"></a><a name="index-degenerate-dimension-687"></a>Whether a degenerate record dimension is a desirable or undesirable
feature depends on the application. 
Often a degenerate <var>time</var> dimension is useful, e.g., for
concatentating, but it may cause problems with arithmetic. 
Such is the case in the above example, where the first step employs
<span class="command">ncwa</span> rather than <span class="command">ncra</span> for the time-averaging. 
Of course the numerical results are the same with both operators. 
The difference is that <span class="command">ncwa</span> writes no <var>time</var> dimension to
the output file, while <span class="command">ncra</span> would write a degenerate
(size&nbsp;1<!-- /@w -->) dimension. 
Appending <code>u</code> and <code>v</code> to the output file would cause
<span class="command">ncks</span> to try to expand the degenerate time axis of <code>uavg</code>
and <code>vavg</code> to the size of the non-degenerate <var>time</var> dimension
in the input file. 
Thus the append (<span class="command">ncks -A</span>) command would be undefined (and
should fail) in this case. 
<a name="index-_0040code_007b_002dC_007d-688"></a>Equally important is the <span class="samp">-C</span> argument (see <a href="#Coordinate-variables">Coordinate variables</a>) to <span class="command">ncwa</span> to prevent any scalar <var>time</var> variable
from being written to the output file. 
Knowing when to use <span class="command">ncwa -a time</span> rather than the default
<span class="command">ncra</span> for time-averaging takes, well, time.

   <p><a name="ncatted"></a> <!-- http://nco.sf.net/nco.html#ncatted --><div class="node">
<p><hr>
<a name="ncatted-netCDF-Attribute-Editor"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.2 <span class="command">ncatted</span> netCDF Attribute Editor</h3>

<p><a name="index-attributes-689"></a><a name="index-attribute-names-690"></a><a name="index-editing-attributes-691"></a><a name="index-ncatted-692"></a>
SYNTAX
<pre class="example">     ncatted [-a <var>att_dsc</var>] [-a ...] [-D <var>dbg</var>] [-h]
     [-l <var>path</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [-Z]
     <var>input-file</var> [[<var>output-file</var>]]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncatted</span> edits attributes in a netCDF file. 
If you are editing attributes then you are spending too much time in the
world of metadata, and <span class="command">ncatted</span> was written to get you back out as
quickly and painlessly as possible. 
<span class="command">ncatted</span> can <dfn>append</dfn>, <dfn>create</dfn>, <dfn>delete</dfn>,
<dfn>modify</dfn>, and <dfn>overwrite</dfn> attributes (all explained below). 
Furthermore, <span class="command">ncatted</span> allows each editing operation to be applied
to every variable in a file. 
This saves time when changing attribute conventions throughout a file. 
Note that <span class="command">ncatted</span> interprets character attributes
(i.e., attributes of type <code>NC_CHAR</code>) as strings.

   <p><a name="index-_0040code_007bhistory_007d-693"></a><a name="index-_0040code_007b_002dh_007d-694"></a>Because repeated use of <span class="command">ncatted</span> can considerably increase the size
of the <code>history</code> global attribute (see <a href="#History-attribute">History attribute</a>), the
<span class="samp">-h</span> switch is provided to override automatically appending the
command to the <code>history</code> global attribute in the <var>output-file</var>.

   <p><a name="index-missing-values-695"></a><a name="index-data_002c-missing-696"></a><a name="index-_0040code_007bmissing_005fvalue_007d-697"></a>When <span class="command">ncatted</span> is used to change the <code>missing_value</code> attribute,
it changes the associated missing data self-consistently. 
If the internal floating point representation of a missing value,
e.g., 1.0e36, differs between two machines then netCDF files produced
on those machines will have incompatible missing values. 
This allows <span class="command">ncatted</span> to change the missing values in files from
different machines to a single value so that the files may then be
concatenated together, e.g., by <span class="command">ncrcat</span>, without losing any
information. 
See <a href="#Missing-values">Missing values</a>, for more information.

   <p>The key to mastering <span class="command">ncatted</span> is understanding the meaning of the
structure describing the attribute modification, <var>att_dsc</var> specified by the required option <span class="samp">-a</span> or <span class="samp">--attribute</span>. 
Each <var>att_dsc</var> contains five elements, which makes using
<span class="command">ncatted</span> somewhat complicated, but powerful. 
The <var>att_dsc</var> argument structure contains five arguments in the
following order:<br>

   <p><var>att_dsc</var> = <var>att_nm</var>, <var>var_nm</var>, <var>mode</var>, <var>att_type</var>,
<var>att_val</var><br>

     <dl>
<dt><var>att_nm</var><dd>Attribute name. 
Example: <code>units</code>
<br><dt><var>var_nm</var><dd>Variable name. 
Example: <code>pressure</code>
<br><dt><var>mode</var><dd>Edit mode abbreviation. 
Example: <code>a</code>. 
See below for complete listing of valid values of <var>mode</var>. 
<br><dt><var>att_type</var><dd>Attribute type abbreviation. 
Example: <code>c</code>. 
See below for complete listing of valid values of <var>att_type</var>. 
<br><dt><var>att_val</var><dd>Attribute value. 
Example: <code>pascal</code>. 
</dl>
   There should be no empty space between these five consecutive
arguments. 
The description of these arguments follows in their order of
appearance.

   <p>The value of <var>att_nm</var> is the name of the attribute you want to edit. 
This meaning of this should be clear to all users of the <span class="command">ncatted</span>
operator. 
If <var>att_nm</var> is omitted (i.e., left blank) and <dfn>Delete</dfn> mode is
selected, then all attributes associated with the specified variable
will be deleted.

   <p><a name="index-global-attributes-698"></a><a name="index-attributes_002c-global-699"></a>The value of <var>var_nm</var> is the name of the variable containing the
attribute (named <var>att_nm</var>) that you want to edit. 
There are two very important and useful exceptions to this rule. 
The value of <var>var_nm</var> can also be used to direct <span class="command">ncatted</span> to
edit global attributes, or to repeat the editing operation for every
variable in a file. 
A&nbsp;value<!-- /@w --> of <var>var_nm</var> of &ldquo;global&rdquo; indicates that <var>att_nm</var> refers
to a global attribute, rather than a particular variable's attribute. 
This is the method <span class="command">ncatted</span> supports for editing global
attributes. 
If <var>var_nm</var> is left blank, on the other hand, then <span class="command">ncatted</span>
attempts to perform the editing operation on every variable in the file. 
This option may be convenient to use if you decide to change the
conventions you use for describing the data.

   <p>The value of <var>mode</var> is a single character abbreviation (<code>a</code>,
<code>c</code>, <code>d</code>, <code>m</code>, or <code>o</code>) standing for one of
five editing modes:<br>
<a name="index-attributes_002c-appending-700"></a><a name="index-attributes_002c-creating-701"></a><a name="index-attributes_002c-deleting-702"></a><a name="index-attributes_002c-modifying-703"></a><a name="index-attributes_002c-editing-704"></a><a name="index-attributes_002c-overwriting-705"></a>
     <dl>
<dt><code>a</code><dd><dfn>Append</dfn>. 
Append value <var>att_val</var> to current <var>var_nm</var> attribute
<var>att_nm</var> value <var>att_val</var>, if any. 
If <var>var_nm</var> does not have an attribute <var>att_nm</var>, there is no
effect. 
<br><dt><code>c</code><dd><dfn>Create</dfn>. 
Create variable <var>var_nm</var> attribute <var>att_nm</var> with <var>att_val</var>
if <var>att_nm</var> does not yet exist. 
If <var>var_nm</var> already has an attribute <var>att_nm</var>, there is no
effect. 
<br><dt><code>d</code><dd><dfn>Delete</dfn>. 
Delete current <var>var_nm</var> attribute <var>att_nm</var>. 
If <var>var_nm</var> does not have an attribute <var>att_nm</var>, there is no
effect. 
If <var>att_nm</var> is omitted (left blank), then all attributes associated
with the specified variable are automatically deleted. 
When <dfn>Delete</dfn> mode is selected, the <var>att_type</var> and <var>att_val</var>
arguments are superfluous and may be left blank. 
<br><dt><code>m</code><dd><dfn>Modify</dfn>. 
Change value of current <var>var_nm</var> attribute <var>att_nm</var> to value
<var>att_val</var>. 
If <var>var_nm</var> does not have an attribute <var>att_nm</var>, there is no
effect. 
<br><dt><code>o</code><dd><dfn>Overwrite</dfn>. 
Write attribute <var>att_nm</var> with value <var>att_val</var> to variable
<var>var_nm</var>, overwriting existing attribute <var>att_nm</var>, if any. 
This is the default mode. 
</dl>

   <p>The value of <var>att_type</var> is a single character abbreviation (<code>f</code>,
<code>d</code>, <code>l</code>, <code>i</code>, <code>s</code>, <code>c</code>, or <code>b</code>) standing
for one of the seven primitive netCDF data types:<br>
     <dl>
<dt><code>f</code><dd><dfn>Float</dfn>. 
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_FLOAT</code>. 
<br><dt><code>d</code><dd><dfn>Double</dfn>. 
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_DOUBLE</code>. 
<br><dt><code>i</code><dd><dfn>Integer</dfn>. 
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_INT</code>. 
<br><dt><code>l</code><dd><dfn>Long</dfn>. 
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_LONG</code>. 
<br><dt><code>s</code><dd><dfn>Short</dfn>. 
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_SHORT</code>. 
<br><dt><code>c</code><dd><dfn>Char.</dfn>
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_CHAR</code>. 
<br><dt><code>b</code><dd><dfn>Byte</dfn>. 
Value(s) specified in <var>att_val</var> will be stored as netCDF intrinsic
type <code>NC_BYTE</code>. 
</dl>
   The specification of <var>att_type</var> is optional (and is ignored) in
<dfn>Delete</dfn> mode.

   <p>The value of <var>att_val</var> is what you want to change attribute
<var>att_nm</var> to contain. 
The specification of <var>att_val</var> is optional in <dfn>Delete</dfn> (and is
ignored) mode. 
Attribute values for all types besides <code>NC_CHAR</code> must have an
attribute length of at least one. 
Thus <var>att_val</var> may be a single value or one-dimensional array of
elements of type <code>att_type</code>. 
If the <var>att_val</var> is not set or is set to empty space,
and the <var>att_type</var> is <code>NC_CHAR</code>, e.g., <code>-a units,T,o,c,""</code>
or <code>-a units,T,o,c,</code>, then the corresponding attribute is set to
have zero length. 
When specifying an array of values, it is safest to enclose
<var>att_val</var> in single or double quotes, e.g.,
<code>-a levels,T,o,s,"1,2,3,4"</code> or
<code>-a levels,T,o,s,'1,2,3,4'</code>. 
The quotes are strictly unnecessary around <var>att_val</var> except
when <var>att_val</var> contains characters which would confuse the calling
shell, such as spaces, commas, and wildcard characters.

   <p><a name="index-Perl-706"></a><a name="index-_0040acronym_007bASCII_007d-707"></a><acronym>NCO</acronym> processing of <code>NC_CHAR</code> attributes is a bit like Perl in
that it attempts to do what you want by default (but this sometimes
causes unexpected results if you want unusual data storage). 
<a name="index-_0040code_007bprintf_0028_0029_007d-708"></a><a name="index-_0040code_007b_005cn_007d-_0028_0040acronym_007bASCII_007d-LF_002c-linefeed_0029-709"></a><a name="index-characters_002c-special-710"></a><a name="index-_0040code_007b_005ct_007d-_0028_0040acronym_007bASCII_007d-HT_002c-horizontal-tab_0029-711"></a>If the <var>att_type</var> is <code>NC_CHAR</code> then the argument is interpreted as a
string and it may contain C-language escape sequences, e.g., <code>\n</code>,
which <acronym>NCO</acronym> will interpret before writing anything to disk. 
<acronym>NCO</acronym> translates valid escape sequences and stores the
appropriate <acronym>ASCII</acronym> code instead. 
Since two byte escape sequences, e.g., <code>\n</code>, represent one-byte
<acronym>ASCII</acronym> codes, e.g., <acronym>ASCII</acronym> 10 (decimal), the stored
string attribute is one byte shorter than the input string length for
each embedded escape sequence. 
The most frequently used C-language escape sequences are <code>\n</code> (for
linefeed) and <code>\t</code> (for horizontal tab). 
These sequences in particular allow convenient editing of formatted text
attributes. 
<a name="index-_0040code_007b_005ca_007d-_0028_0040acronym_007bASCII_007d-BEL_002c-bell_0029-712"></a><a name="index-_0040code_007b_005cb_007d-_0028_0040acronym_007bASCII_007d-BS_002c-backspace_0029-713"></a><a name="index-_0040code_007b_005cf_007d-_0028_0040acronym_007bASCII_007d-FF_002c-formfeed_0029-714"></a><a name="index-_0040code_007b_005cr_007d-_0028_0040acronym_007bASCII_007d-CR_002c-carriage-return_0029-715"></a><a name="index-_0040code_007b_005cv_007d-_0028_0040acronym_007bASCII_007d-VT_002c-vertical-tab_0029-716"></a><a name="index-_0040code_007b_005c_005c_007d-_0028_0040acronym_007bASCII_007d-_005c_002c-backslash_0029-717"></a>The other valid <acronym>ASCII</acronym> codes are <code>\a</code>, <code>\b</code>, <code>\f</code>,
<code>\r</code>, <code>\v</code>, and <code>\\</code>. 
See <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>, for more examples of string formatting
(with the <span class="command">ncks</span> <span class="samp">-s</span> option) with special characters.

   <p><a name="index-_0040code_007b_005c_0027_007d-_0028protected-end-quote_0029-718"></a><a name="index-_0040code_007b_005c_0022_007d-_0028protected-double-quote_0029-719"></a><a name="index-_0040code_007b_005c_003f_007d-_0028protected-question-mark_0029-720"></a><a name="index-_0040code_007b_005c_005c_007d-_0028protected-backslash_0029-721"></a><a name="index-_0040code_007b_0027_007d-_0028end-quote_0029-722"></a><a name="index-_0040code_007b_0022_007d-_0028double-quote_0029-723"></a><a name="index-_0040code_007b_003f_007d-_0028question-mark_0029-724"></a><a name="index-_0040code_007b_005c_007d-_0028backslash_0029-725"></a><a name="index-special-characters-726"></a><a name="index-_0040acronym_007bASCII_007d-727"></a>Analogous to <code>printf</code>, other special characters are also allowed by
<span class="command">ncatted</span> if they are "protected" by a backslash. 
The characters <code>"</code>, <code>'</code>, <code>?</code>, and <code>\</code> may be
input to the shell as <code>\"</code>, <code>\'</code>, <code>\?</code>, and <code>\\</code>. 
<acronym>NCO</acronym> simply strips away the leading backslash from these
characters before editing the attribute. 
No other characters require protection by a backslash. 
Backslashes which precede any other character (e.g., <code>3</code>, <code>m</code>,
<code>$</code>, <code>|</code>, <code>&amp;</code>, <code>@</code>, <code>%</code>, <code>{</code>, and
<code>}</code>) will not be filtered and will be included in the attribute.

   <p><a name="index-strings-728"></a><a name="index-NUL_002dtermination-729"></a><a name="index-NUL-730"></a><a name="index-C-language-731"></a><a name="index-_0040code_007b0_007d-_0028NUL_0029-732"></a>Note that the NUL character <code>\0</code> which terminates C&nbsp;language<!-- /@w -->
strings is assumed and need not be explicitly specified. 
If <code>\0</code> is input, it will not be translated (because it would
terminate the string in an additional location). 
Because of these context-sensitive rules, if wish to use an attribute of
type <code>NC_CHAR</code> to store data, rather than text strings, you should use
<span class="command">ncatted</span> with care.

<p class="noindent">EXAMPLES

   <p>Append the string "Data version 2.0.\n" to the global attribute
<code>history</code>:
<pre class="example">     ncatted -O -a history,global,a,c,"Data version 2.0\n" in.nc
</pre>
   <p>Note the use of embedded C&nbsp;language<!-- /@w --> <code>printf()</code>-style escape
sequences.

   <p>Change the value of the <code>long_name</code> attribute for variable <code>T</code>
from whatever it currently is to "temperature":
<pre class="example">     ncatted -O -a long_name,T,o,c,temperature in.nc
</pre>
   <p>Delete all existing <code>units</code> attributes:
<pre class="example">     ncatted -O -a units,,d,, in.nc
</pre>
   <p class="noindent">The value of <var>var_nm</var> was left blank in order to select all
variables in the file. 
The values of <var>att_type</var> and <var>att_val</var> were left blank because
they are superfluous in <dfn>Delete</dfn> mode.

   <p><a name="index-global-attributes-733"></a>Delete all attributes associated with the <code>tpt</code> variable:
<pre class="example">     ncatted -O -a ,tpt,d,, in.nc
</pre>
   <p class="noindent">The value of <var>att_nm</var> was left blank in order to select all
attributes associated with the variable. 
To delete all global attributes, simply replace <code>tpt</code> with
<code>global</code> in the above.

   <p><a name="index-_0040code_007bunits_007d-734"></a>Modify all existing <code>units</code> attributes to "meter second-1"
<pre class="example">     ncatted -O -a units,,m,c,"meter second-1" in.nc
</pre>
   <p>Overwrite the <code>quanta</code> attribute of variable
<code>energy</code> to an array of four integers.
<pre class="example">     ncatted -O -a quanta,energy,o,s,"010,101,111,121" in.nc
</pre>
   <p>Demonstrate input of C-language escape sequences (e.g., <code>\n</code>) and
other special characters (e.g., <code>\"</code>)
<pre class="example">     ncatted -h -a special,global,o,c,
     '\nDouble quote: \"\nTwo consecutive double quotes: \"\"\n
     Single quote: Beyond my shell abilities!\nBackslash: \\\n
     Two consecutive backslashes: \\\\\nQuestion mark: \?\n' in.nc
</pre>
   <p>Note that the entire attribute is protected from the shell by single
quotes. 
These outer single quotes are necessary for interactive use, but may be
omitted in batch scripts.

   <p><a name="ncbo"></a> <!-- http://nco.sf.net/nco.html#ncbo -->
<a name="ncdiff"></a> <!-- http://nco.sf.net/nco.html#ncdiff -->
<a name="ncadd"></a> <!-- http://nco.sf.net/nco.html#ncadd -->
<a name="ncsub"></a> <!-- http://nco.sf.net/nco.html#ncsub -->
<a name="ncsubtract"></a> <!-- http://nco.sf.net/nco.html#ncsubtract -->
<a name="ncmult"></a> <!-- http://nco.sf.net/nco.html#ncmult -->
<a name="ncmultiply"></a> <!-- http://nco.sf.net/nco.html#ncmultiply -->
<a name="ncdivide"></a> <!-- http://nco.sf.net/nco.html#ncdivide --><div class="node">
<p><hr>
<a name="ncbo-netCDF-Binary-Operator"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.3 <span class="command">ncbo</span> netCDF Binary Operator</h3>

<p><a name="index-ncbo-735"></a><a name="index-ncdiff-736"></a><a name="index-ncadd-737"></a><a name="index-ncsub-738"></a><a name="index-ncsubtract-739"></a><a name="index-ncmult-740"></a><a name="index-ncmultiply-741"></a><a name="index-ncdivide-742"></a><a name="index-binary-operations-743"></a><a name="index-addition-744"></a><a name="index-subtraction-745"></a><a name="index-multiplication-746"></a><a name="index-adding-data-747"></a><a name="index-subtracting-data-748"></a><a name="index-multiplying-data-749"></a><a name="index-dividing-data-750"></a>
SYNTAX
<pre class="example">     ncbo [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]] [-F] [-h]
     [-l <var>path</var>] [-O] [-o <var>file_3</var>] [-p <var>path</var>] [-R] [-r]
     [-t <var>thr_nbr</var>] [-v <var>var</var>[,...]] [-x] [-y <var>op_typ</var>] [-Z]
     <var>file_1</var> <var>file_2</var> [<var>file_3</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncbo</span> performs binary operations on variables in <var>file_1</var>
and the corresponding variables (those with the same name) in
<var>file_2</var> and stores the results in <var>file_3</var>. 
The binary operation operates on the entire files (modulo any excluded
variables). 
See <a href="#Missing-values">Missing values</a>, for treatment of missing values. 
One of the four standard arithmetic binary operations currently
supported must be selected with the <span class="samp">-y </span><var>op_typ</var> switch (or
long options <span class="samp">--op_typ</span> or <span class="samp">--operation</span>). 
<a name="index-_0040code_007badd_007d-751"></a><a name="index-_0040code_007bsubtract_007d-752"></a><a name="index-_0040code_007bmultiply_007d-753"></a><a name="index-_0040code_007bdivide_007d-754"></a><a name="index-_0040code_007b_002b_007d-755"></a><a name="index-_0040code_007b_002d_007d-756"></a><a name="index-_0040code_007b_002a_007d-757"></a><a name="index-_0040code_007b_002f_007d-758"></a><a name="index-_0040code_007b_002dy-_0040var_007bop_005ftyp_007d_007d-759"></a><a name="index-_0040code_007b_002d_002doperation-_0040var_007bop_005ftyp_007d_007d-760"></a><a name="index-_0040code_007b_002d_002dop_005ftyp-_0040var_007bop_005ftyp_007d_007d-761"></a><a name="index-alternate-invocations-762"></a>The valid binary operations for <span class="command">ncbo</span>, their definitions,
corresponding values of the <var>op_typ</var> key, and alternate invocations
are:
     <dl>
<dt><dfn>Addition</dfn><dd><!-- Internal operation code: @{nco_op_add}@* -->
Definition: <var>file_3</var> = <var>file_1</var> + <var>file_2</var><br>
Alternate invocation: <span class="command">ncadd</span><br>
<var>op_typ</var> key values: <span class="samp">add</span>, <span class="samp">+</span>, <span class="samp">addition</span><br>
Examples: <span class="samp">ncbo --op_typ=add 1.nc 2.nc 3.nc</span>, <span class="samp">ncadd 1.nc 2.nc 3.nc</span><br>
<br><dt><dfn>Subtraction</dfn><dd>Definition: <var>file_3</var> = <var>file_1</var> - <var>file_2</var><br>
Alternate invocations: <span class="command">ncdiff</span>, <span class="command">ncsub</span>, <span class="command">ncsubtract</span><br>
<var>op_typ</var> key values: <span class="samp">sbt</span>, <span class="samp">-</span>, <span class="samp">dff</span>, <span class="samp">diff</span>, <span class="samp">sub</span>, <span class="samp">subtract</span>, <span class="samp">subtraction</span><br>
Examples: <span class="samp">ncbo --op_typ=- 1.nc 2.nc 3.nc</span>, <span class="samp">ncdiff 1.nc 2.nc 3.nc</span><br>
<br><dt><dfn>Multiplication</dfn><dd>Definition: <var>file_3</var> = <var>file_1</var> * <var>file_2</var><br>
Alternate invocations: <span class="command">ncmult</span>, <span class="command">ncmultiply</span><br>
<var>op_typ</var> key values: <span class="samp">mlt</span>, <span class="samp">*</span>, <span class="samp">mult</span>, <span class="samp">multiply</span>, <span class="samp">multiplication</span><br>
Examples: <span class="samp">ncbo --op_typ=mlt 1.nc 2.nc 3.nc</span>, <span class="samp">ncmult 1.nc 2.nc 3.nc</span><br>
<br><dt><dfn>Division</dfn><dd>Definition: <var>file_3</var> = <var>file_1</var> / <var>file_2</var><br>
Alternate invocation: <span class="command">ncdivide</span><br>
<var>op_typ</var> key values: <span class="samp">dvd</span>, <span class="samp">/</span>, <span class="samp">divide</span>, <span class="samp">division</span><br>
Examples: <span class="samp">ncbo --op_typ=/ 1.nc 2.nc 3.nc</span>, <span class="samp">ncdivide 1.nc 2.nc 3.nc</span><br>
</dl>
   Care should be taken when using the shortest form of key values,
i.e., <span class="samp">+</span>, <span class="samp">-</span>, <span class="samp">*</span>, and&nbsp;<span class="samp">/</span><!-- /@w -->. 
Some of these single characters may have special meanings to the shell
<a name="index-naked-characters-763"></a><a rel="footnote" href="#fn-31" name="fnd-31"><sup>31</sup></a>. 
<a name="index-Bash-shell-764"></a>Place these characters inside quotes to keep them from being interpreted
(globbed) by the shell
<a rel="footnote" href="#fn-32" name="fnd-32"><sup>32</sup></a>. 
<a name="index-globbing-765"></a><a name="index-shell-766"></a><a name="index-quotes-767"></a>For example, the following commands are equivalent
<pre class="example">     ncbo --op_typ=* 1.nc 2.nc 3.nc # Dangerous (shell may try to glob)
     ncbo --op_typ='*' 1.nc 2.nc 3.nc # Safe ('*' protected from shell)
     ncbo --op_typ="*" 1.nc 2.nc 3.nc # Safe ('*' protected from shell)
     ncbo --op_typ=mlt 1.nc 2.nc 3.nc
     ncbo --op_typ=mult 1.nc 2.nc 3.nc
     ncbo --op_typ=multiply 1.nc 2.nc 3.nc
     ncbo --op_typ=multiplication 1.nc 2.nc 3.nc
     ncmult 1.nc 2.nc 3.nc # First do 'ln -s ncbo ncmult'
     ncmultiply 1.nc 2.nc 3.nc # First do 'ln -s ncbo ncmultiply'
</pre>
   <p>No particular argument or invocation form is preferred. 
Users are encouraged to use the forms which are most intuitive to them.

   <p><a name="index-_0040command_007balias_007d-768"></a><a name="index-_0040command_007bln-_002ds_007d-769"></a><a name="index-symbolic-links-770"></a>Normally, <span class="command">ncbo</span> will fail unless an operation type is specified
with <span class="samp">-y</span> (equivalent to <span class="samp">--op_typ</span>). 
You may create exceptions to this rule to suit your particular tastes,
in conformance with your site's policy on <dfn>symbolic links</dfn> to
executables (files of a different name point to the actual executable). 
For many years, <span class="command">ncdiff</span> was the main binary file operator. 
As a result, many users prefer to continue invoking <span class="command">ncdiff</span>
rather than memorizing a new command (<span class="samp">ncbo -y </span><var>sbt</var>) which
behaves identically to the original <span class="command">ncdiff</span> command. 
However, from a software maintenance standpoint, maintaining a distinct
executable for each binary operation (e.g., <span class="command">ncadd</span>) is untenable,
and a single executable, <span class="command">ncbo</span>, is desirable. 
To maintain backward compatibility, therefore, <acronym>NCO</acronym>
automatically creates a symbolic link from <span class="command">ncbo</span> to
<span class="command">ncdiff</span>. 
Thus <span class="command">ncdiff</span> is called an <dfn>alternate invocation</dfn> of
<span class="command">ncbo</span>. 
<span class="command">ncbo</span> supports many additional alternate invocations which must
be manually activated. 
Should users or system adminitrators decide to activate them, the
procedure is simple. 
For example, to use <span class="samp">ncadd</span> instead of <span class="samp">ncbo --op_typ=add</span>,
simply create a symbolic link from <span class="command">ncbo</span> to <span class="command">ncadd</span>
<a rel="footnote" href="#fn-33" name="fnd-33"><sup>33</sup></a>. 
The alternatate invocations supported for each operation type are listed
above. 
Alternatively, users may always define <span class="samp">ncadd</span> as an <dfn>alias</dfn> to
<span class="samp">ncbo --op_typ=add</span>
<a rel="footnote" href="#fn-34" name="fnd-34"><sup>34</sup></a>.

   <p>It is important to maintain portability in <acronym>NCO</acronym> scripts. 
Therefore we recommend that site-specfic invocations (e.g.,
<span class="samp">ncadd</span>) be used only in interactive sessions from the
command-line. 
For scripts, we recommend using the full invocation (e.g.,
<span class="samp">ncbo --op_typ=add</span>). 
This ensures portability of scripts between users and sites.

   <p><span class="command">ncbo</span> operates (e.g., adds) variables in <var>file_2</var> with the
corresponding variables (those with the same name) in <var>file_1</var> and
stores the results in <var>file_3</var>. 
<a name="index-broadcasting-variables-771"></a>Variables in <var>file_2</var> are <dfn>broadcast</dfn> to conform to the
corresponding variable in <var>file_1</var> if necessary, but the reverse is
not true. 
Broadcasting a variable means creating data in non-existing dimensions
from the data in existing dimensions. 
For example, a two dimensional variable in <var>file_2</var> can be
subtracted from a four, three, or two (but not one or zero)
dimensional variable (of the same name) in <code>file_1</code>. 
<a name="index-anomalies-772"></a>This functionality allows the user to compute anomalies from the mean. 
Note that variables in <var>file_1</var> are <em>not</em> broadcast to conform
to the dimensions in <var>file_2</var>. 
In the future, we will broadcast variables in <var>file_1</var>, if necessary
to conform to their counterparts in <var>file_2</var>. 
<!-- TODO #268 -->
<a name="index-rank-773"></a>Thus, presently, the number of dimensions, or <dfn>rank</dfn>, of any
processed variable in <var>file_1</var> must be greater than or equal to the
rank of the same variable in <var>file_2</var>. 
Furthermore, the size of all dimensions common to both <var>file_1</var> and
<var>file_2</var> must be equal.

   <p>When computing anomalies from the mean it is often the case that
<var>file_2</var> was created by applying an averaging operator to a file
with initially the same dimensions as <var>file_1</var> (often <var>file_1</var>
itself). 
In these cases, creating <var>file_2</var> with <span class="command">ncra</span> rather than
<span class="command">ncwa</span> will cause the <span class="command">ncbo</span> operation to fail. 
For concreteness say the record dimension in <code>file_1</code> is
<code>time</code>. 
If <var>file_2</var> were created by averaging <var>file_1</var> over the
<code>time</code> dimension with the <span class="command">ncra</span> operator rather than with
the <span class="command">ncwa</span> operator, then <var>file_2</var> will have a <code>time</code>
dimension of size&nbsp;1<!-- /@w --> rather than having no <code>time</code> dimension at
all
<a name="index-degenerate-dimension-774"></a><a rel="footnote" href="#fn-35" name="fnd-35"><sup>35</sup></a>. 
In this case the input files to <span class="command">ncbo</span>, <var>file_1</var> and
<var>file_2</var>, will have unequally sized <code>time</code> dimensions which
causes <span class="command">ncbo</span> to fail. 
To prevent this from occuring, use <span class="command">ncwa</span> to remove the
<code>time</code> dimension from <var>file_2</var>. 
See the example below.

   <p><a name="index-coordinate-variable-775"></a><a name="index-_0040code_007bNC_005fBYTE_007d-776"></a><a name="index-_0040code_007bNC_005fCHAR_007d-777"></a><span class="command">ncbo</span> never operates on coordinate variables or variables
of type <code>NC_CHAR</code> or <code>NC_BYTE</code>. 
This ensures that coordinates like (e.g., latitude and longitude) are
physically meaningful in the output file, <var>file_3</var>. 
This behavior is hardcoded. 
<a name="index-_0040acronym_007bNCAR-CCSM_007d-conventions-778"></a><a name="index-_0040acronym_007bCCSM_007d-conventions-779"></a><span class="command">ncbo</span> applies special rules to some <acronym>NCAR CCSM</acronym> fields
(e.g., <code>ORO</code>). 
See <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a> for a complete description. 
Finally, we note that <span class="command">ncflint</span> (see <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>) is designed for file interpolation. 
As such, it also performs file subtraction, addition, multiplication,
albeit in a more convoluted way than <span class="command">ncbo</span>.

<p class="noindent">EXAMPLES

   <p>Say files <span class="file">85_0112.nc</span> and <span class="file">86_0112.nc</span> each contain 12 months
of data. 
Compute the change in the monthly averages from 1985 to 1986:
<pre class="example">     ncbo -op_typ=sub 86_0112.nc 85_0112.nc 86m85_0112.nc
     ncdiff 86_0112.nc 85_0112.nc 86m85_0112.nc
</pre>
   <p>The following examples demonstrate the broadcasting feature of
<span class="command">ncbo</span>. 
Say we wish to compute the monthly anomalies of <code>T</code> from the yearly
average of <code>T</code> for the year 1985. 
First we create the 1985 average from the monthly data, which is stored
with the record dimension <code>time</code>.
<pre class="example">     ncra 85_0112.nc 85.nc
     ncwa -O -a time 85.nc 85.nc
</pre>
   <p class="noindent">The second command, <span class="command">ncwa</span>, gets rid of the <code>time</code> dimension
of size&nbsp;1<!-- /@w --> that <span class="command">ncra</span> left in <span class="file">85.nc</span>. 
Now none of the variables in <span class="file">85.nc</span> has a <code>time</code> dimension. 
A&nbsp;quicker<!-- /@w --> way to accomplish this is to use <span class="command">ncwa</span> from the
beginning:
<pre class="example">     ncwa -a time 85_0112.nc 85.nc
</pre>
   <p class="noindent">We are now ready to use <span class="command">ncbo</span> to compute the anomalies for 1985:
<pre class="example">     ncdiff -v T 85_0112.nc 85.nc t_anm_85_0112.nc
</pre>
   <p class="noindent">Each of the 12 records in <span class="file">t_anm_85_0112.nc</span> now contains the
monthly deviation of <code>T</code> from the annual mean of <code>T</code> for each
gridpoint.

   <p>Say we wish to compute the monthly gridpoint anomalies from the zonal
annual mean. 
A&nbsp;<dfn>zonal&nbsp;mean</dfn><!-- /@w --> is a quantity that has been averaged over the
longitudinal (or <var>x</var>) direction. 
First we use <span class="command">ncwa</span> to average over longitudinal direction
<code>lon</code>, creating <span class="file">85_x.nc</span>, the zonal mean of <span class="file">85.nc</span>. 
Then we use <span class="command">ncbo</span> to subtract the zonal annual means from the
monthly gridpoint data:
<pre class="example">     ncwa -a lon 85.nc 85_x.nc
     ncdiff 85_0112.nc 85_x.nc tx_anm_85_0112.nc
</pre>
   <p class="noindent">This examples works assuming <span class="file">85_0112.nc</span> has dimensions
<code>time</code> and <code>lon</code>, and that <span class="file">85_x.nc</span> has no <code>time</code>
or <code>lon</code> dimension.

   <p><a name="csn_anm"></a> <!-- http://nco.sf.net/nco.html#csn_anm -->As a final example, say we have five years of monthly data (i.e.,
60&nbsp;months<!-- /@w -->) stored in <span class="file">8501_8912.nc</span> and we wish to create a
file which contains the twelve month seasonal cycle of the average
monthly anomaly from the five-year mean of this data. 
The following method is just one permutation of many which will
accomplish the same result. 
First use <span class="command">ncwa</span> to create the five-year mean:
<pre class="example">     ncwa -a time 8501_8912.nc 8589.nc
</pre>
   <p class="noindent">Next use <span class="command">ncbo</span> to create a file containing the difference of
each month's data from the five-year mean:
<pre class="example">     ncbo 8501_8912.nc 8589.nc t_anm_8501_8912.nc
</pre>
   <p class="noindent">Now use <span class="command">ncks</span> to group the five January anomalies together in
one file, and use <span class="command">ncra</span> to create the average anomaly for all
five Januarys. 
These commands are embedded in a shell loop so they are repeated for all
twelve months:
<a name="index-Bash-Shell-780"></a><a name="index-Bourne-Shell-781"></a><a name="index-C-Shell-782"></a>
<pre class="example">     for idx in {01..12}; do # Bash Shell (version 3.0+, beware ordering!)
       ncks -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
       ncra foo.${idx} t_anm_8589_${idx}.nc
     done
     for idx in 01 02 03 04 05 06 07 08 09 10 11 12; do # Bourne Shell
       ncks -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
       ncra foo.${idx} t_anm_8589_${idx}.nc
     done
     foreach idx (01 02 03 04 05 06 07 08 09 10 11 12) # C Shell
       ncks -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
       ncra foo.${idx} t_anm_8589_${idx}.nc
     end
</pre>
   <p class="noindent">Note that <span class="command">ncra</span> understands the <code>stride</code> argument so the
two commands inside the loop may be combined into the single command
<pre class="example">     ncra -F -d time,${idx},,12 t_anm_8501_8912.nc foo.${idx}
</pre>
   <p class="noindent">Finally, use <span class="command">ncrcat</span> to concatenate the 12&nbsp;average<!-- /@w --> monthly
anomaly files into one twelve-record file which contains the entire
seasonal cycle of the monthly anomalies:
<pre class="example">     ncrcat t_anm_8589_??.nc t_anm_8589_0112.nc
</pre>
   <p class="noindent">
<a name="ncea"></a> <!-- http://nco.sf.net/nco.html#ncea --><div class="node">
<p><hr>
<a name="ncea-netCDF-Ensemble-Averager"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.4 <span class="command">ncea</span> netCDF Ensemble Averager</h3>

<p><a name="index-averaging-data-783"></a><a name="index-ensemble-average-784"></a><a name="index-ncea-785"></a>
SYNTAX
<pre class="example">     ncea [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]] [-F] [-h] [-l <var>path</var>]
     [-n <var>loop</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
     [-t <var>thr_nbr</var>] [-v <var>var</var>[,...]] [-x] [-y <var>op_typ</var>] [-Z]
     [<var>input-files</var>] [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncea</span> performs gridpoint averages of variables across an
arbitrary number (an <dfn>ensemble</dfn>) of <var>input-files</var>, with each
file receiving an equal weight in the average. 
<a name="index-ensemble-786"></a>Each variable in the <var>output-file</var> will be the same size as the same
variable in any one of the in the <var>input-files</var>, and all
<var>input-files</var> must be the same size. 
<span class="command">ncea</span> averages entire files, and weights each file evenly. 
This is distinct from <span class="command">ncra</span>, which only averages over the
record dimension (e.g., time), and weights each record in the record
dimension evenly,
<a name="index-record-dimension-787"></a>All dimensions, including the record dimension, are treated identically
and preserved in the <var>output-file</var>. 
See <a href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>, for a description of the
distinctions between the various averagers and concatenators. 
<a name="index-multi_002dfile-operators-788"></a><a name="index-standard-input-789"></a><a name="index-_0040code_007bstdin_007d-790"></a>As a multi-file operator, <span class="command">ncea</span> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-numbers-of-input-files">Large numbers of input files</a>).

   <p>The file is the logical unit of organization for the results of many
scientific studies. 
Often one wishes to generate a file which is the gridpoint average of
many separate files. 
This may be to reduce statistical noise by combining the results of a
large number of experiments, or it may simply be a step in a procedure
whose goal is to compute anomalies from a mean state. 
In any case, when one desires to generate a file whose properties are
the mean of all the input files, then <span class="command">ncea</span> is the operator to
use. 
<span class="command">ncea</span> assumes coordinate variable are properties common to all
of the experiments and so does not average them across files. 
Instead, <span class="command">ncea</span> copies the values of the coordinate variables
from the first input file to the output file.

<p class="noindent">EXAMPLES

   <p>Consider a model experiment which generated five realizations of one
year of data, say 1985. 
You can imagine that the experimenter slightly perturbs the
initial conditions of the problem before generating each new solution. 
Assume each file contains all twelve months (a seasonal cycle) of data
and we want to produce a single file containing the ensemble average
(mean) seasonal cycle. 
Here the numeric filename suffix denotes the experiment number
(<em>not</em> the month):
<pre class="example">     ncea 85_01.nc 85_02.nc 85_03.nc 85_04.nc 85_05.nc 85.nc
     ncea 85_0[1-5].nc 85.nc
     ncea -n 5,2,1 85_01.nc 85.nc
</pre>
   <p class="noindent">These three commands produce identical answers. 
See <a href="#Specifying-input-files">Specifying input files</a>, for an explanation of the distinctions
between these methods. 
The output file, <span class="file">85.nc</span>, is the same size as the inputs files. 
It contains 12 months of data (which might or might not be stored in the
record dimension, depending on the input files), but each value in the
output file is the average of the five values in the input files.

   <p>In the previous example, the user could have obtained the ensemble
average values in a particular spatio-temporal region by adding a
hyperslab argument to the command, e.g.,
<pre class="example">     ncea -d time,0,2 -d lat,-23.5,23.5 85_??.nc 85.nc
</pre>
   <p class="noindent">In this case the output file would contain only three slices of data in
the <var>time</var> dimension. 
These three slices are the average of the first three slices from the
input files. 
Additionally, only data inside the tropics is included.

   <p><a name="ncecat"></a> <!-- http://nco.sf.net/nco.html#ncecat --><div class="node">
<p><hr>
<a name="ncecat-netCDF-Ensemble-Concatenator"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.5 <span class="command">ncecat</span> netCDF Ensemble Concatenator</h3>

<p><a name="index-concatenation-791"></a><a name="index-ensemble-concatenation-792"></a><a name="index-ncecat-793"></a>
SYNTAX
<pre class="example">     ncecat [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]] [-F] [-h] [-l <var>path</var>]
     [-n <var>loop</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
     [-v <var>var</var>[,...]] [-x] [-Z] [<var>input-files</var>] [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncecat</span> concatenates an arbitrary number of input files into a
single output file. 
<a name="index-record-dimension-794"></a>A new record dimension acts as the glue to bind the input files data
together. 
Each variable in each input file becomes one record in the same variable
in the output file. 
All <var>input-files</var> must contain all extracted variables (or else
there would be "gaps" in the output file). 
Each extracted variable must be constant in size and rank across all
<var>input-files</var>. 
The <var>input-files</var> are stored consecutively as a single record in
<var>output file</var>. 
Thus, the <var>output file</var> size is the sum of the sizes of the
extracted variable in the input files. 
See <a href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>, for a description of the
distinctions between the various averagers and concatenators. 
<a name="index-multi_002dfile-operators-795"></a><a name="index-standard-input-796"></a><a name="index-_0040code_007bstdin_007d-797"></a>As a multi-file operator, <span class="command">ncecat</span> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-numbers-of-input-files">Large numbers of input files</a>).

   <p><a name="index-climate-model-798"></a>Consider five realizations, <span class="file">85a.nc</span>, <span class="file">85b.nc</span>,
<small class="dots">...</small>&nbsp;<span class="file">85e.nc</span><!-- /@w --> of 1985 predictions from the same climate
model. 
Then <code>ncecat 85?.nc 85_ens.nc</code> glues the individual realizations
together into the single file, <span class="file">85_ens.nc</span>. 
If an input variable was dimensioned [<code>lat</code>,<code>lon</code>], it will
have dimensions [<code>record</code>,<code>lat</code>,<code>lon</code>] in the output
file. 
A&nbsp;restriction<!-- /@w --> of <span class="command">ncecat</span> is that the hyperslabs of the
processed variables must be the same from file to file. 
Normally this means all the input files are the same size, and contain
data on different realizations of the same variables.

<p class="noindent">EXAMPLES

   <p>Consider a model experiment which generated five realizations of one
year of data, say 1985. 
You can imagine that the experimenter slightly perturbs the
initial conditions of the problem before generating each new solution. 
Assume each file contains all twelve months (a seasonal cycle) of data
and we want to produce a single file containing all the seasonal
cycles. 
Here the numeric filename suffix denotes the experiment number
(<em>not</em> the month):
<pre class="example">     ncecat 85_01.nc 85_02.nc 85_03.nc 85_04.nc 85_05.nc 85.nc
     ncecat 85_0[1-5].nc 85.nc
     ncecat -n 5,2,1 85_01.nc 85.nc
</pre>
   <p class="noindent">These three commands produce identical answers. 
See <a href="#Specifying-input-files">Specifying input files</a>, for an explanation of the distinctions
between these methods. 
The output file, <span class="file">85.nc</span>, is five times the size as a single
<var>input-file</var>. 
It contains 60&nbsp;months<!-- /@w --> of data (which might or might not be stored in
the record dimension, depending on the input files).

   <p><a name="dmn_rcd_rm"></a> <!-- http://nco.sf.net/nco.html#dmn_rcd_rm --><a name="index-record-dimension-799"></a>Consider a file with an existing record dimension named <code>time</code>. 
and suppose the user wishes to convert <code>time</code> from a record
dimension to a non-record dimension. 
This may be useful, for example, when the user has another use for the
record variable. 
The procedure is to use <span class="command">ncecat</span> followed by <span class="command">ncwa</span>
<a name="index-degenerate-dimension-800"></a>
<pre class="example">     ncecat in.nc out.nc # Convert time to non-record dimension
     ncwa -a record in.nc out.nc # Remove new degenerate record dimension
</pre>
   <p class="noindent">The second step removes the degenerate record dimension. 
See <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a> for other methods
of changing variable dimensionality, including the record dimension.

   <p><a name="ncflint"></a> <!-- http://nco.sf.net/nco.html#ncflint --><div class="node">
<p><hr>
<a name="ncflint-netCDF-File-Interpolator"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.6 <span class="command">ncflint</span> netCDF File Interpolator</h3>

<p><a name="index-interpolation-801"></a><a name="index-adding-data-802"></a><a name="index-multiplying-data-803"></a><a name="index-addition-804"></a><a name="index-ncflint-805"></a>
SYNTAX
<pre class="example">     ncflint [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]] [-F] [-h] [-i <var>var</var>,<var>val3</var>]
     [-l <var>path</var>] [-O] [-o <var>file_3</var>] [-p <var>path</var>] [-R] [-r]
     [-v <var>var</var>[,...]] [-w <var>wgt1</var>[,<var>wgt2</var>]] [-x] [-Z]
     <var>file_1</var> <var>file_2</var> [<var>file_3</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncflint</span> creates an output file that is a linear combination of
the input files. 
This linear combination is a weighted average, a normalized weighted
average, or an interpolation of the input files. 
Coordinate variables are not acted upon in any case, they are simply
copied from <var>file_1</var>.

   <p>There are two conceptually distinct methods of using <span class="command">ncflint</span>. 
The first method is to specify the weight each input file contributes to
the output file. 
In this method, the value <var>val3</var> of a variable in the output file
<var>file_3</var> is determined from its values <var>val1</var> and <var>val2</var> in
the two input files according to

   <p><var>val3</var> = <var>wgt1</var>*<var>val1</var> + <var>wgt2</var>*<var>val2</var>

   <p>. 
Here at least <var>wgt1</var>, and, optionally, <var>wgt2</var>, are specified on
the command line with the <span class="samp">-w</span> (or <span class="samp">--weight</span> or
<span class="samp">--wgt_var</span>) switch. 
<a name="index-_0040code_007b_002dw-_0040var_007bwgt1_007d_005b_002c_0040var_007bwgt2_007d_005d_007d-806"></a><a name="index-_0040code_007b_002d_002dweight-_0040var_007bwgt1_007d_005b_002c_0040var_007bwgt2_007d_005d_007d-807"></a><a name="index-_0040code_007b_002d_002dwgt_005fvar-_0040var_007bwgt1_007d_005b_002c_0040var_007bwgt2_007d_005d_007d-808"></a>If only <var>wgt1</var> is specified then <var>wgt2</var> is automatically
computed as <var>wgt2</var> = 1 &minus; <var>wgt1</var>. 
Note that weights larger than&nbsp;1<!-- /@w --> are allowed. 
Thus it is possible to specify <var>wgt1</var> = 2 and
<var>wgt2</var> = -3. 
One can use this functionality to multiply all the values in a given
file by a constant.

   <p>The second method of using <span class="command">ncflint</span> is to specify the
interpolation option with&nbsp;<span class="samp">-i</span><!-- /@w --> (or with the <span class="samp">--ntp</span> or
<span class="samp">--interpolate</span> long options). 
This is really the inverse of the first method in the following sense. 
When the user specifies the weights directly, <span class="command">ncflint</span> has no
work to do besides multiplying the input values by their respective
weights and adding the results together to produce the output values. 
It makes sense to use this when the weights are known
<em>a&nbsp;priori<!-- /@w --></em>.

   <p><a name="index-arrival-value-809"></a>Another class of problems has the <dfn>arrival value</dfn> (i.e., <var>val3</var>)
of a particular variable <var>var</var> known <em>a&nbsp;priori<!-- /@w --></em>. 
In this case, the implied weights can always be inferred by examining
the values of <var>var</var> in the input files. 
This results in one equation in two unknowns, <var>wgt1</var> and <var>wgt2</var>:

   <p><var>val3</var> = <var>wgt1</var>*<var>val1</var> + <var>wgt2</var>*<var>val2</var>

   <p>. 
Unique determination of the weights requires imposing the additional
constraint of normalization on the weights:
<var>wgt1</var> + <var>wgt2</var> = 1. 
Thus, to use the interpolation option, the user specifies <var>var</var>
and <var>val3</var> with the <span class="samp">-i</span> option. 
<span class="command">ncflint</span> then computes <var>wgt1</var> and <var>wgt2</var>, and uses these
weights on all variables to generate the output file. 
Although <var>var</var> may have any number of dimensions in the input
files, it must represent a single, scalar value. 
<a name="index-degenerate-dimension-810"></a>Thus any dimensions associated with <var>var</var> must be <dfn>degenerate</dfn>,
i.e., of size one.

   <p>If neither <span class="samp">-i</span> nor <span class="samp">-w</span> is specified on the command line,
<span class="command">ncflint</span> defaults to weighting each input file equally in the
output file. 
This is equivalent to specifying <span class="samp">-w 0.5</span> or <span class="samp">-w 0.5,0.5</span>. 
Attempting to specify both <span class="samp">-i</span> and <span class="samp">-w</span> methods in the same
command is an error.

   <p><span class="command">ncflint</span> does not interpolate variables of type <code>NC_CHAR</code>
and <code>NC_BYTE</code>. 
This behavior is hardcoded.

   <p><a name="index-missing-values-811"></a><a name="index-_0040code_007bmissing_005fvalue_007d-812"></a>Depending on your intuition, <span class="command">ncflint</span> may treat missing values
unexpectedly. 
Consider a point where the value in one input file, say <var>val1</var>,
equals the missing value <var>mss_val_1</var> and, at the same point,
the corresponding value in the other input file <var>val2</var> is not
misssing (i.e., does not equal <var>mss_val_2</var>). 
There are three plausible answers, and this creates ambiguity.

   <p>Option&nbsp;one<!-- /@w --> is to set <var>val3</var> = <var>mss_val_1</var>. 
The rationale is that <span class="command">ncflint</span> is, at heart, an interpolator
and interpolation involving a missing value is intrinsically undefined. 
<span class="command">ncflint</span> currently implements this behavior since it is the
most conservative and least likely to lead to misinterpretation.

   <p>Option&nbsp;two<!-- /@w --> is to output the weighted valid data point, i.e.,

   <p><var>val3</var> = <var>wgt2</var>*<var>val2</var>

   <p>. 
The rationale for this behavior is that interpolation is really a
weighted average of known points, so <span class="command">ncflint</span> should weight the
valid point.

   <p>Option&nbsp;three<!-- /@w --> is to return the <em>unweighted</em> valid point, i.e.,
<var>val3</var> = <var>val2</var>. 
This behavior would appeal to those who use <span class="command">ncflint</span> to
estimate data using the closest available data. 
When a point is not bracketed by valid data on both sides, it is better
to return the known datum than no datum at all.

   <p>The current implementation uses the first approach, Option&nbsp;one<!-- /@w -->. 
If you have strong opinions on this matter, let us know, since we are
willing to implement the other approaches as options if there is enough
interest.

<p class="noindent">EXAMPLES

   <p>Although it has other uses, the interpolation feature was designed
to interpolate <var>file_3</var> to a time between existing files. 
Consider input files <span class="file">85.nc</span> and <span class="file">87.nc</span> containing variables
describing the state of a physical system at times <code>time</code> =
85 and <code>time</code> = 87. 
Assume each file contains its timestamp in the scalar variable
<code>time</code>. 
Then, to linearly interpolate to a file <span class="file">86.nc</span> which describes
the state of the system at time at <code>time</code> = 86, we would use
<pre class="example">     ncflint -i time,86 85.nc 87.nc 86.nc
</pre>
   <p>Say you have observational data covering January and April 1985 in two
files named <span class="file">85_01.nc</span> and <span class="file">85_04.nc</span>, respectively. 
Then you can estimate the values for February and March by interpolating
the existing data as follows. 
Combine <span class="file">85_01.nc</span> and <span class="file">85_04.nc</span> in a 2:1 ratio to make
<span class="file">85_02.nc</span>:
<pre class="example">     ncflint -w 0.667 85_01.nc 85_04.nc 85_02.nc
     ncflint -w 0.667,0.333 85_01.nc 85_04.nc 85_02.nc
</pre>
   <p>Multiply <span class="file">85.nc</span> by&nbsp;3<!-- /@w --> and by&nbsp;&minus;2<!-- /@w --> and add them
together to make <span class="file">tst.nc</span>:
<pre class="example">     ncflint -w 3,-2 85.nc 85.nc tst.nc
</pre>
   <p class="noindent"><a name="index-null-operation-813"></a>This is an example of a null operation, so <span class="file">tst.nc</span> should be
identical (within machine precision) to <span class="file">85.nc</span>.

   <p>Add <span class="file">85.nc</span> to <span class="file">86.nc</span> to obtain <span class="file">85p86.nc</span>,
then subtract <span class="file">86.nc</span> from <span class="file">85.nc</span> to obtain <span class="file">85m86.nc</span>
<pre class="example">     ncflint -w 1,1 85.nc 86.nc 85p86.nc
     ncflint -w 1,-1 85.nc 86.nc 85m86.nc
     ncdiff 85.nc 86.nc 85m86.nc
</pre>
   <p class="noindent">Thus <span class="command">ncflint</span> can be used to mimic some <span class="command">ncbo</span>
operations. 
<a name="index-broadcasting-variables-814"></a>However this is not a good idea in practice because <span class="command">ncflint</span>
does not broadcast (see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>) conforming
variables during arithmetic. 
Thus the final two commands would produce identical results except that
<span class="command">ncflint</span> would fail if any variables needed to be broadcast.

   <p><a name="index-_0040code_007bunits_007d-815"></a>Rescale the dimensional units of the surface pressure <code>prs_sfc</code>
from Pascals to hectopascals (millibars)
<pre class="example">     ncflint -O -C -v prs_sfc -w 0.01,0.0 in.nc in.nc out.nc
     ncatted -O -a units,prs_sfc,o,c,millibar out.nc
</pre>
   <p class="noindent">
<a name="ncks"></a> <!-- http://nco.sf.net/nco.html#ncks --><div class="node">
<p><hr>
<a name="ncks-netCDF-Kitchen-Sink"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.7 <span class="command">ncks</span> netCDF Kitchen Sink</h3>

<p><a name="index-kitchen-sink-816"></a><a name="index-printing-files-contents-817"></a><a name="index-printing-variables-818"></a><a name="index-ncks-819"></a>
SYNTAX
<pre class="example">     ncks [-A] [-a] [-B] [-b <var>binary-file</var>] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]][,[<var>stride</var>]]]
     [-F] [-H] [-h] [-l <var>path</var>] [-M] [-m] [-O] [-o <var>output-file</var>]
     [-P] [-p <var>path</var>] [-Q] [-q] [-R] [-r] [-s <var>format</var>] [-u]
     [-v <var>var</var>[,...]] [-x] [-Z] <var>input-file</var> [[<var>output-file</var>]]
</pre>
   <p class="noindent">DESCRIPTION

   <p><a name="index-_0040command_007bncextr_007d-820"></a><span class="command">ncks</span> combines selected features of <span class="command">ncdump</span>,
<span class="command">ncextr</span>, and the nccut and ncpaste specifications into one
versatile utility. 
<span class="command">ncks</span> extracts a subset of the data from <var>input-file</var> and
prints it as <acronym>ASCII</acronym> text to <span class="file">stdout</span>, writes it in
flat binary format to <span class="file">binary-file</span>, and writes (or pastes) it in
netCDF format to <var>output-file</var>.

   <p><span class="command">ncks</span> will print netCDF data in <acronym>ASCII</acronym> format to
<code>stdout</code>, like <span class="command">ncdump</span>, but with these differences:
<span class="command">ncks</span> prints data in a tabular format intended to be easy to
search for the data you want, one datum per screen line, with all
dimension subscripts and coordinate values (if any) preceding the datum. 
Option <span class="samp">-s</span> (or lon options <span class="samp">--sng</span>, <span class="samp">--string</span>,
<span class="samp">--fmt</span>, or <span class="samp">--format</span>) allows the user the format the data
using C-style format strings.

   <p>Options <span class="samp">-a</span>, <span class="samp">-F</span> , <span class="samp">-H</span>, <span class="samp">-M</span>, <span class="samp">-m</span>,
<span class="samp">-P</span>, <span class="samp">-Q</span>, <span class="samp">-q</span>, <span class="samp">-s</span>, and <span class="samp">-u</span> (and their
long option counterparts) control the formatted appearance of the data.

   <p><a name="index-global-attributes-821"></a><a name="index-attributes_002c-global-822"></a><span class="command">ncks</span> extracts (and optionally creates a new netCDF file
comprised of) only selected variables from the input file
(similar to the old <span class="command">ncextr</span> specification). 
Only variables and coordinates may be specifically included or
excluded&mdash;all global attributes and any attribute associated with an
extracted variable are copied to the screen and/or output netCDF file. 
Options <span class="samp">-c</span>, <span class="samp">-C</span>, <span class="samp">-v</span>, and <span class="samp">-x</span> (and their long
option synonyms) control which variables are extracted.

   <p><span class="command">ncks</span> extracts hyperslabs from the specified variables
(<span class="command">ncks</span> implements the original <span class="command">nccut</span> specification). 
Option <span class="samp">-d</span> controls the hyperslab specification. 
Input dimensions that are not associated with any output variable do
not appear in the output netCDF. 
This feature removes superfluous dimensions from netCDF files.

   <p><a name="index-appending-data-823"></a><a name="index-merging-files-824"></a><span class="command">ncks</span> will append variables and attributes from the
<var>input-file</var> to <var>output-file</var> if <var>output-file</var> is a
pre-existing netCDF file whose relevant dimensions conform to dimension
sizes of <var>input-file</var>. 
The append features of <span class="command">ncks</span> are intended to provide a
rudimentary means of adding data from one netCDF file to another,
conforming, netCDF file. 
If naming conflicts exist between the two files, data in
<var>output-file</var> is usually overwritten by the corresponding data from
<var>input-file</var>. 
Thus, when appending, the user should backup <var>output-file</var> in case
valuable data are inadvertantly overwritten.

   <p>If <var>output-file</var> exists, the user will be queried whether to
<dfn>overwrite</dfn>, <dfn>append</dfn>, or <dfn>exit</dfn> the <span class="command">ncks</span> call
completely. 
Choosing <dfn>overwrite</dfn> destroys the existing <var>output-file</var> and
create an entirely new one from the output of the <span class="command">ncks</span> call. 
Append has differing effects depending on the uniqueness of the
variables and attributes output by <span class="command">ncks</span>: If a variable or
attribute extracted from <var>input-file</var> does not have a name conflict
with the members of <var>output-file</var> then it will be added to
<var>output-file</var> without overwriting any of the existing contents of
<var>output-file</var>. 
In this case the relevant dimensions must agree (conform) between the
two files; new dimensions are created in <var>output-file</var> as required. 
<a name="index-global-attributes-825"></a><a name="index-attributes_002c-global-826"></a>When a name conflict occurs, a global attribute from <var>input-file</var>
will overwrite the corresponding global attribute from
<var>output-file</var>. 
If the name conflict occurs for a non-record variable, then the
dimensions and type of the variable (and of its coordinate dimensions,
if any) must agree (conform) in both files. 
Then the variable values (and any coordinate dimension values)
from <var>input-file</var> will overwrite the corresponding variable values
(and coordinate dimension values, if any) in <var>output-file</var>
<a rel="footnote" href="#fn-36" name="fnd-36"><sup>36</sup></a>.

   <p>Since there can only be one record dimension in a file, the record
dimension must have the same name (but not necessarily the same size) in
both files if a record dimension variable is to be appended. 
If the record dimensions are of differing sizes, the record dimension of
<var>output-file</var> will become the greater of the two record dimension
sizes, the record variable from <var>input-file</var> will overwrite any
counterpart in <var>output-file</var> and fill values will be written to any
gaps left in the rest of the record variables (I think). 
In all cases variable attributes in <var>output-file</var> are superseded by
attributes of the same name from <var>input-file</var>, and left alone if
there is no name conflict.

   <p>Some users may wish to avoid interactive <span class="command">ncks</span> queries about
whether to overwrite existing data. 
For example, batch scripts will fail if <span class="command">ncks</span> does not receive
responses to its queries. 
Options <span class="samp">-O</span> and <span class="samp">-A</span> are available to force overwriting
existing files and variables, respectively.

<h4 class="unnumberedsubsec">Options specific to <span class="command">ncks</span></h4>

<p>The following list provides a short summary of the features unique to
<span class="command">ncks</span>. 
Features common to many operators are described in
<a href="#Common-features">Common features</a>.

     
<a name="index-alphabetization-827"></a>
<a name="index-sort-alphabetically-828"></a>
<a name="index-_0040code_007b_002da_007d-829"></a>
<a name="index-_0040code_007b_002d_002dabc_007d-830"></a>
<a name="index-_0040code_007b_002d_002dalphabetize_007d-831"></a>
<dl><dt><span class="samp">-a</span><dd>Do not alphabetize extracted fields. 
By default, the specified output variables are extracted, printed, and
written to disk in alphabetical order. 
This tends to make long output lists easier to search for particular
variables. 
Specifying <code>-a</code> results in the variables being extracted, printed,
and written to disk in the order in which they were saved in the input
file. 
Thus <code>-a</code> retains the original ordering of the variables. 
Also <span class="samp">--abc</span> and <span class="samp">--alphabetize</span>.

     <p><a name="index-binary-format-832"></a><a name="index-_0040code_007b_002dB_007d-833"></a><a name="index-_0040code_007b_002d_002dbnr_007d-834"></a><a name="index-_0040code_007b_002d_002dbinary_007d-835"></a><br><dt><span class="samp">-B file</span><dd>Activate native machine binary output writing to the default binary
file, <span class="file">ncks.bnr</span>. 
The <code>-B</code> switch is redundant when the <code>-b</code>&nbsp;<span class="file">file</span><!-- /@w -->
option is specified, and native binary output will be directed to the
binary file <span class="file">file</span>. 
Also <span class="samp">--bnr</span> and <span class="samp">--binary</span>. 
Writing packed variables in binary format is not supported.

     <p><a name="index-_0040code_007b_002db_007d-836"></a><a name="index-_0040code_007b_002d_002dfl_005fbnr_007d-837"></a><br><dt><span class="samp">-b file</span><dd>Activate native machine binary output writing to binary file
<span class="file">file</span>. 
Also <span class="samp">--fl_bnr</span> and <span class="samp">--binary-file</span>. 
Writing packed variables in binary format is not supported.

     <p><a name="index-stride-838"></a><br><dt><span class="samp">-d </span><var>dim</var><span class="samp">,[</span><var>min</var><span class="samp">][,[</span><var>max</var><span class="samp">]][,[</span><var>stride</var><span class="samp">]]</span><dd>Add <dfn>stride</dfn> argument to hyperslabber. 
For a complete description of the <var>stride</var> argument, See <a href="#Stride">Stride</a>.

     <p><a name="index-_0040code_007b_002dH_007d-839"></a><a name="index-_0040code_007b_002d_002dhieronymus_007d-840"></a><br><dt><span class="samp">-H</span><dd>Print data to screen. 
Also activated using <span class="samp">--print</span> or <span class="samp">--prn</span>. 
By default <span class="command">ncks</span> prints all metadata and data to screen if
no netCDF output file is specified. 
Use <span class="samp">-H</span> to print data to screen if a netCDF output is specified,
or to restrict printing to data (no metadata) when no netCDF output is
specified. 
Unless otherwise specified (with <code>-s</code>), each element of the data
hyperslab prints on a separate line containing the names, indices,
and, values, if any, of all of the variables dimensions. 
The dimension and variable indices refer to the location of the
corresponding data element with respect to the variable as stored on
disk (i.e., not the hyperslab).
     <pre class="example">          % ncks -C -v three_dmn_var in.nc
          lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
          lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
          lat[0]=-90 lev[0]=100 lon[2]=180 three_dmn_var[2]=2
          ...
          lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
          lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
          lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
     </pre>
     <p>Printing the same variable with the <span class="samp">-F</span> option shows the same
variable indexed with Fortran conventions
     <pre class="example">          % ncks -F -C -v three_dmn_var in.nc
          lon(1)=0 lev(1)=100 lat(1)=-90 three_dmn_var(1)=0
          lon(2)=90 lev(1)=100 lat(1)=-90 three_dmn_var(2)=1
          lon(3)=180 lev(1)=100 lat(1)=-90 three_dmn_var(3)=2
          ...
     </pre>
     <p>Printing a hyperslab does not affect the variable or dimension indices
since these indices are relative to the full variable (as stored in the
input file), and the input file has not changed. 
However, if the hypserslab is saved to an output file and those values
are printed, the indices will change:
<!-- fxm: replace with new MSA output style -->
     <pre class="example">          % ncks -O -H -d lat,90.0 -d lev,1000.0 -v three_dmn_var in.nc out.nc
          ...
          lat[1]=90 lev[2]=1000 lon[0]=0 three_dmn_var[20]=20
          lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
          lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
          lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
          % ncks -C -v three_dmn_var out.nc
          lat[0]=90 lev[0]=1000 lon[0]=0 three_dmn_var[0]=20
          lat[0]=90 lev[0]=1000 lon[1]=90 three_dmn_var[1]=21
          lat[0]=90 lev[0]=1000 lon[2]=180 three_dmn_var[2]=22
          lat[0]=90 lev[0]=1000 lon[3]=270 three_dmn_var[3]=23
     </pre>
     <p><a name="index-_0040code_007b_002dM_007d-841"></a><a name="index-_0040code_007b_002d_002dMtd_007d-842"></a><a name="index-_0040code_007b_002d_002dMetadata_007d-843"></a><a name="index-metadata_002c-global-844"></a><br><dt><span class="samp">-M</span><dd>Print to screen the global metadata describing the file. 
This includes file summary information and global attributes. 
Also <span class="samp">--Mtd</span> and <span class="samp">--Metadata</span>. 
By default <span class="command">ncks</span> prints global metadata to screen if no netCDF
output file and no variable extraction list is specified (with <span class="samp">-v</span>). 
Use <span class="samp">-M</span> to print global metadata to screen if a netCDF output is
specified, or if a variable extraction list is specified (with <span class="samp">-v</span>).

     <p><a name="index-_0040command_007bncdump_007d-845"></a><a name="index-_0040code_007b_002dm_007d-846"></a><a name="index-_0040code_007b_002d_002dmtd_007d-847"></a><a name="index-_0040code_007b_002d_002dmetadata_007d-848"></a><a name="index-metadata-849"></a><br><dt><span class="samp">-m</span><dd>Print variable metadata to screen (similar to <kbd>ncdump -h</kbd>). 
This displays all metadata pertaining to each variable, one variable
at a time. 
Also <span class="samp">--mtd</span> and <span class="samp">--metadata</span>. 
The <span class="command">ncks</span> default behavior is to print variable metadata to
screen if no netCDF output file is specified. 
Use <span class="samp">-m</span> to print variable metadata to screen if a netCDF output is
specified.

     <p><a name="index-_0040code_007b_002dP_007d-850"></a><a name="index-_0040code_007b_002d_002dprint_007d-851"></a><a name="index-_0040code_007b_002d_002dprn_007d-852"></a><br><dt><span class="samp">-P</span><dd>Print data, metadata, and units to screen. 
The <span class="samp">-P</span> switch is a convenience abbreviation for
<span class="samp">-C -H -M -m -u</span>. 
Also activated using <span class="samp">--print</span> or <span class="samp">--prn</span>. 
This set of switches is useful for exploring file contents.

     <p><a name="index-_0040code_007b_002dQ_007d-853"></a><br><dt><span class="samp">-Q</span><dd>Toggle printing of dimension indices and coordinate values when printing
arrays. 
Each variable's name appears flush left in the output. 
This helps locate specific variables in lists with many variables and
different dimensions.

     <p><a name="index-_0040code_007b_002dq_007d-854"></a><a name="index-_0040code_007b_002d_002dquiet_007d-855"></a><a name="index-quiet-856"></a><br><dt><span class="samp">-q</span><dd>Turn off all printing to screen. 
This overrides the setting of all print-related switches, equivalent to
<kbd>-H -M -m</kbd> when in single-file printing mode. 
When invoked with <code>-R</code> (see <a href="#File-retention">File retention</a>), <span class="command">ncks</span>
automatically sets <code>-q</code>. 
This allows <span class="command">ncks</span> to retrieve remote files without
automatically trying to print them. 
Also <span class="samp">--quiet</span>.

     <p><a name="index-_0040code_007b_002ds_007d-857"></a><a name="index-_0040code_007b_002d_002dstring_007d-858"></a><a name="index-_0040code_007b_002d_002dfmt_007d-859"></a><a name="index-_0040code_007b_002d_002dformat_007d-860"></a><a name="index-_0040code_007bprintf_0028_0029_007d-861"></a><a name="index-C-language-862"></a><br><dt><span class="samp">-s </span><var>format</var><dd>String format for text output. 
Accepts C&nbsp;language<!-- /@w --> escape sequences and <code>printf()</code> formats. 
Also <span class="samp">--string</span>, <span class="samp">--format</span>, and <span class="samp">--fmt</span>.

     <p><a name="index-_0040code_007b_002du_007d-863"></a><a name="index-_0040code_007b_002d_002dunits_007d-864"></a><br><dt><span class="samp">-u</span><dd>Toggle the printing of a variable's <code>units</code> attribute, if any,
with its values. 
Also <span class="samp">--units</span>.

   </dl>

<p class="noindent">EXAMPLES

   <p>View all data in netCDF <span class="file">in.nc</span>, printed with Fortran indexing
conventions:
<pre class="example">     ncks -F in.nc
</pre>
   <p>Copy the netCDF file <span class="file">in.nc</span> to file <span class="file">out.nc</span>.
<pre class="example">     ncks -O in.nc out.nc
</pre>
   <p>Now the file <span class="file">out.nc</span> contains all the data from <span class="file">in.nc</span>. 
There are, however, two differences between <span class="file">in.nc</span> and
<span class="file">out.nc</span>. 
<a name="index-_0040code_007bhistory_007d-865"></a>First, the <code>history</code> global attribute (see <a href="#History-attribute">History attribute</a>)
will contain the command used to create <span class="file">out.nc</span>. 
<a name="index-alphabetize-output-866"></a><a name="index-sort-alphabetically-867"></a><a name="index-_0040code_007b_002da_007d-868"></a>Second, the variables in <span class="file">out.nc</span> will be defined in alphabetical
order. 
Of course the internal storage of variable in a netCDF file should be
transparent to the user, but there are cases when alphabetizing a file
is useful (see description of <code>-a</code> switch).

   <p><a name="index-_0040code_007bprintf_0028_0029_007d-869"></a><a name="index-_0040code_007b_005cn_007d-_0028linefeed_0029-870"></a><a name="index-_0040code_007b_005ct_007d-_0028horizontal-tab_0029-871"></a>Print variable <code>three_dmn_var</code> from file <span class="file">in.nc</span> with
default notations. 
Next print <code>three_dmn_var</code> as an un-annotated text column. 
Then print <code>three_dmn_var</code> signed with very high precision. 
Finally, print <code>three_dmn_var</code> as a comma-separated list.
<pre class="example">     % ncks -C -v three_dmn_var in.nc
     lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
     lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
     ...
     lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
     % ncks -s "%f\n" -C -v three_dmn_var in.nc
     0.000000
     1.000000
     ...
     23.000000
     % ncks -s "%+16.10f\n" -C -v three_dmn_var in.nc
        +0.0000000000
        +1.0000000000
     ...
       +23.0000000000
     % ncks -s "%f, " -C -v three_dmn_var in.nc
     0.000000, 1.000000, ..., 23.000000,
</pre>
   <p class="noindent">The second and third options are useful when pasting data into text
files like reports or papers. 
See <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a>, for more details on string
formatting and special characters.

   <p>One dimensional arrays of characters stored as netCDF variables are
automatically printed as strings, whether or not they are
NUL-terminated, e.g.,
<pre class="example">     ncks -v fl_nm in.nc
</pre>
   <p class="noindent">The <code>%c</code> formatting code is useful for printing
multidimensional arrays of characters representing fixed length strings
<pre class="example">     ncks -s "%c" -v fl_nm_arr in.nc
</pre>
   <p class="noindent"><a name="index-_0040code_007bcore-dump_007d-872"></a>Using the <code>%s</code> format code on strings which are not NUL-terminated
(and thus not technically strings) is likely to result in a core dump.

   <p>Create netCDF <span class="file">out.nc</span> containing all variables, and any associated
coordinates, except variable <code>time</code>, from netCDF <span class="file">in.nc</span>:
<pre class="example">     ncks -x -v time in.nc out.nc
</pre>
   <p>Extract variables <code>time</code> and <code>pressure</code> from netCDF
<span class="file">in.nc</span>. 
If <span class="file">out.nc</span> does not exist it will be created. 
Otherwise the you will be prompted whether to append to or to
overwrite <span class="file">out.nc</span>:
<pre class="example">     ncks -v time,pressure in.nc out.nc
     ncks -C -v time,pressure in.nc out.nc
</pre>
   <p class="noindent">The first version of the command creates an <span class="file">out.nc</span> which contains
<code>time</code>, <code>pressure</code>, and any coordinate variables associated
with <var>pressure</var>. 
The <span class="file">out.nc</span> from the second version is guaranteed to contain only
two variables <code>time</code> and <code>pressure</code>.

   <p>Create netCDF <span class="file">out.nc</span> containing all variables from file
<span class="file">in.nc</span>. 
Restrict the dimensions of these variables to a hyperslab. 
Print (with <code>-H</code>) the hyperslabs to the screen for good measure. 
The specified hyperslab is: the fifth value in dimension <code>time</code>;
the
half-open range <var>lat</var> &gt; 0. in coordinate <code>lat</code>; the
half-open range <var>lon</var> &lt; 330. in coordinate <code>lon</code>; the
closed interval 0.3 &lt; <var>band</var> &lt; 0.5 in coordinate <code>band</code>;
and cross-section closest to 1000. in coordinate <code>lev</code>. 
Note that limits applied to coordinate values are specified with a
decimal point, and limits applied to dimension indices do not have a
decimal point See <a href="#Hyperslabs">Hyperslabs</a>.
<pre class="example">     ncks -H -d time,5 -d lat,,0.0 -d lon,330.0, -d band,0.3,0.5
     -d lev,1000.0 in.nc out.nc
</pre>
   <p><a name="index-wrapped-coordinates-873"></a>Assume the domain of the monotonically increasing longitude coordinate
<code>lon</code> is 0 &lt; <var>lon</var> &lt; 360. 
Here, <code>lon</code> is an example of a wrapped coordinate. 
<span class="command">ncks</span> will extract a hyperslab which crosses the Greenwich
meridian simply by specifying the westernmost longitude as <var>min</var> and
the easternmost longitude as <var>max</var>, as follows:
<pre class="example">     ncks -d lon,260.0,45.0 in.nc out.nc
</pre>
   <p>For more details See <a href="#Wrapped-coordinates">Wrapped coordinates</a>.

   <p><a name="ncpdq"></a> <!-- http://nco.sf.net/nco.html#ncpdq -->
<a name="ncpack"></a> <!-- http://nco.sf.net/nco.html#ncpack -->
<a name="ncunpack"></a> <!-- http://nco.sf.net/nco.html#ncunpack --><div class="node">
<p><hr>
<a name="ncpdq-netCDF-Permute-Dimensions-Quickly"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.8 <span class="command">ncpdq</span> netCDF Permute Dimensions Quickly</h3>

<p><a name="index-ncpdq-874"></a><a name="index-ncpack-875"></a><a name="index-ncunpack-876"></a><a name="index-reshape-variables-877"></a><a name="index-permute-dimensions-878"></a><a name="index-reverse-dimensions-879"></a><a name="index-re_002dorder-dimensions-880"></a><a name="index-re_002ddimension-881"></a><a name="index-packing-882"></a><a name="index-unpacking-883"></a>
SYNTAX
<pre class="example">     ncpdq [-A] [-a [-]<var>dim</var>[,...]] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]] [-F] [-h] [-l <var>path</var>]
     [-M <var>pck_map</var>] [-O] [-o <var>output-file</var>] [-P <var>pck_plc</var>] [-p <var>path</var>]
     [-R] [-r] [-t <var>thr_nbr</var>] [-U] [-v <var>var</var>[,...]] [-x] [-Z]
     <var>input-file</var> [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncpdq</span> performs one of two distinct functions, packing or
dimension permutation, but not both, when invoked. 
<span class="command">ncpdq</span> is optimized to perform these actions in a parallel
fashion with a minimum of time and memory. 
The <dfn>pdq</dfn> may stand for &ldquo;Permute Dimensions Quickly&rdquo;,
&ldquo;Pack Data Quietly&rdquo;, &ldquo;Pillory Dan Quayle&rdquo;, or other silly uses.

   <p><a name="index-_0040code_007badd_005foffset_007d-884"></a><a name="index-_0040code_007bscale_005ffactor_007d-885"></a><a name="index-_0040command_007bncap_007d-886"></a><a name="index-packing-policy-887"></a>

<h4 class="unnumberedsubsec">Packing and Unpacking Functions</h4>

<p>The <span class="command">ncpdq</span> packing (and unpacking) algorithms are described
in <a href="#Intrinsic-functions">Intrinsic functions</a>, and are also implemented in
<span class="command">ncap</span>. 
<span class="command">ncpdq</span> extends the functionality of these algorithms by
providing high level control of the <dfn>packing policy</dfn> so that
users can pack (and unpack) entire files consistently with one command. 
<a name="index-_0040var_007bpck_005fplc_007d-888"></a><a name="index-_0040code_007b_002dP-_0040var_007bpck_005fplc_007d_007d-889"></a><a name="index-_0040code_007b_002d_002dpck_005fplc-_0040var_007bpck_005fplc_007d_007d-890"></a><a name="index-_0040code_007b_002d_002dpack_005fpolicy-_0040var_007bpck_005fplc_007d_007d-891"></a>The user specifies the desired packing policy with the <span class="samp">-P</span> switch
(or its long option equivalents, <span class="samp">--pck_plc</span> and
<span class="samp">--pack_policy</span>) and its <var>pck_plc</var> argument. 
Four packing policies are currently implemented:<br>
     <dl>
<dt><dfn>Packing (and Re-Packing) Variables [</dfn><em>default</em><dfn>]</dfn><dd>Definition: Pack unpacked variables, re-pack packed variables<br>
Alternate invocation: <code>ncpack</code><br>
<var>pck_plc</var> key values: <span class="samp">all_new</span>, <span class="samp">pck_all_new_att</span><br>
<br><dt><dfn>Packing (and not Re-Packing) Variables</dfn><dd>Definition: Pack unpacked variables, copy packed variables<br>
Alternate invocation: none<br>
<var>pck_plc</var> key values: <span class="samp">all_xst</span>, <span class="samp">pck_all_xst_att</span><br>
<br><dt><dfn>Re-Packing Variables</dfn><dd>Definition: Re-pack packed variables, copy unpacked variables<br>
Alternate invocation: none<br>
<var>pck_plc</var> key values: <span class="samp">xst_new</span>, <span class="samp">pck_xst_new_att</span><br>
<br><dt><dfn>Unpacking</dfn><dd>Definition: Unpack packed variables, copy unpacked variables<br>
Alternate invocation: <code>ncunpack</code><br>
<var>pck_plc</var> key values: <span class="samp">upk</span>, <span class="samp">unpack</span>, <span class="samp">pck_upk</span><br>
</dl>
   Equivalent key values are fully interchangeable. 
Multiple equivalent options are provided to satisfy disparate needs
and tastes of <acronym>NCO</acronym> users working with scripts and from the
command line.

   <p>To reduce required memorization of these complex policy switches,
<span class="command">ncpdq</span> may also be invoked via a synonym or with switches
that imply a particular policy. 
<span class="command">ncpack</span> is a synonym for <span class="command">ncpdq</span> and behaves the same
in all respects. 
Both <span class="command">ncpdq</span> and <span class="command">ncpack</span> assume a default packing
policy request of <span class="samp">all_new</span>. 
Hence <span class="command">ncpack</span> may be invoked without any <span class="samp">-P</span> switch,
unlike <span class="command">ncpdq</span>. 
Similarly, <span class="command">ncunpack</span> is a synonym for <span class="command">ncpdq</span>
except that <span class="command">ncpack</span> implicitly assumes a request to unpack,
i.e., <span class="samp">-P pck_upk</span>. 
<a name="index-_0040code_007b_002dU_007d-892"></a><a name="index-_0040code_007b_002d_002dupk_007d-893"></a><a name="index-_0040code_007b_002d_002dunpack_007d-894"></a>Finally, the <span class="command">ncpdq</span> <span class="samp">-U</span> switch (or its long option
equivalents, <span class="samp">--upk</span> and <span class="samp">--unpack</span>) requires no argument. 
It simply requests unpacking.

   <p>Given the menagerie of synonyms, equivalent options, and implied
options, a short list of some equivalent commands is appropriate. 
The following commands are equivalent for packing:
<code>ncpdq -P all_new</code>, <code>ncpdq --pck_plc=all_new</code>, and
<code>ncpack</code>. 
The following commands are equivalent for unpacking:
<code>ncpdq -P upk</code>, <code>ncpdq -U</code>, <code>ncpdq --pck_plc=unpack</code>,
and <code>ncunpack</code>. 
Equivalent commands for other packing policies, e.g., <span class="samp">all_xst</span>,
follow by analogy. 
<a name="index-_0040command_007balias_007d-895"></a><a name="index-_0040command_007bln-_002ds_007d-896"></a><a name="index-symbolic-links-897"></a>Note that <span class="command">ncpdq</span> synonyms are subject to the same constraints
and recommendations discussed in the secion on <span class="command">ncbo</span> synonyms
(see <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a>). 
That is, symbolic links must exist from the synonym to <span class="command">ncpdq</span>,
or else the user must define an <span class="command">alias</span>.

   <p><a name="index-packing-map-898"></a><a name="index-_0040var_007bpck_005fmap_007d-899"></a><a name="index-_0040code_007b_002dM-_0040var_007bpck_005fmap_007d_007d-900"></a><a name="index-_0040code_007b_002d_002dpck_005fmap-_0040var_007bpck_005fmap_007d_007d-901"></a><a name="index-_0040code_007b_002d_002dmap-_0040var_007bpck_005fmap_007d_007d-902"></a>The <span class="command">ncpdq</span> packing algorithms must know to which type
particular types of input variables are to be packed. 
The correspondence between the input variable type and the output,
packed type, is called the <dfn>packing map</dfn>. 
The user specifies the desired packing map with the <span class="samp">-M</span> switch
(or its long option equivalents, <span class="samp">--pck_map</span> and
<span class="samp">--map</span>) and its <var>pck_map</var> argument. 
Five packing maps are currently implemented:<br>
<a name="index-_0040samp_007bhgh_005fsht_007d-903"></a><a name="index-_0040samp_007bhgh_005fbyt_007d-904"></a><a name="index-_0040samp_007bflt_005fsht_007d-905"></a><a name="index-_0040samp_007bflt_005fbyt_007d-906"></a><a name="index-_0040samp_007bnxt_005flsr_007d-907"></a><a name="index-_0040code_007bNC_005fDOUBLE_007d-908"></a><a name="index-_0040code_007bNC_005fFLOAT_007d-909"></a><a name="index-_0040code_007bNC_005fINT_007d-910"></a><a name="index-_0040code_007bNC_005fSHORT_007d-911"></a><a name="index-_0040code_007bNC_005fCHAR_007d-912"></a><a name="index-_0040code_007bNC_005fBYTE_007d-913"></a>
     <dl>
<dt><dfn>Pack Floating Precisions to </dfn><code>NC_SHORT</code><dfn> [</dfn><em>default</em><dfn>]</dfn><dd>Definition: Pack floating precision types to <code>NC_SHORT</code><br>
Map: Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>] to <code>NC_SHORT</code><br>
Types copied instead of packed: [<code>NC_INT</code>,<code>NC_SHORT</code>,<code>NC_CHAR</code>,<code>NC_BYTE</code>]<br>
<var>pck_map</var> key values: <span class="samp">flt_sht</span>, <span class="samp">pck_map_flt_sht</span><br>
<br><dt><dfn>Pack Floating Precisions to </dfn><code>NC_BYTE</code><dd>Definition: Pack floating precision types to <code>NC_BYTE</code><br>
Map: Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>] to <code>NC_BYTE</code><br>
Types copied instead of packed: [<code>NC_INT</code>,<code>NC_SHORT</code>,<code>NC_CHAR</code>,<code>NC_BYTE</code>]<br>
<var>pck_map</var> key values: <span class="samp">flt_byt</span>, <span class="samp">pck_map_flt_byt</span><br>
<br><dt><dfn>Pack Higher Precisions to </dfn><code>NC_SHORT</code><dd>Definition: Pack higher precision types to <code>NC_SHORT</code><br>
Map:
Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>,<code>NC_INT</code>] to <code>NC_SHORT</code><br>
Types copied instead of packed: [<code>NC_SHORT</code>,<code>NC_CHAR</code>,<code>NC_BYTE</code>]<br>
<var>pck_map</var> key values: <span class="samp">hgh_sht</span>, <span class="samp">pck_map_hgh_sht</span><br>
<br><dt><dfn>Pack Higher Precisions to </dfn><code>NC_BYTE</code><dd>Definition: Pack higher precision types to <code>NC_BYTE</code><br>
Map:
Pack [<code>NC_DOUBLE</code>,<code>NC_FLOAT</code>,<code>NC_INT</code>,<code>NC_SHORT</code>] to <code>NC_BYTE</code><br>
Types copied instead of packed: [<code>NC_CHAR</code>,<code>NC_BYTE</code>]<br>
<var>pck_map</var> key values: <span class="samp">hgh_byt</span>, <span class="samp">pck_map_hgh_byt</span><br>
<br><dt><dfn>Pack to Next Lesser Precision</dfn><dd>Definition: Pack each type to type of next lesser size<br>
Map: Pack <code>NC_DOUBLE</code> to <code>NC_INT</code>. 
Pack [<code>NC_FLOAT</code>,<code>NC_INT</code>] to <code>NC_SHORT</code>. 
Pack <code>NC_SHORT</code> to <code>NC_BYTE</code>.<br>
Types copied instead of packed: [<code>NC_CHAR</code>,<code>NC_BYTE</code>]<br>
<var>pck_map</var> key values: <span class="samp">nxt_lsr</span>, <span class="samp">pck_map_nxt_lsr</span><br>
</dl>
   The default <span class="samp">all_new</span> packing policy with the default
<span class="samp">flt_sht</span> packing map reduces the typical <code>NC_FLOAT</code>-dominated
file size by about&nbsp;50%.<!-- /@w -->
<span class="samp">flt_byt</span> packing reduces an <code>NC_DOUBLE</code>-dominated file by
about&nbsp;87%.<!-- /@w -->

   <p><a name="index-_0040var_007bmissing_005fvalue_007d-914"></a><a name="index-_0040code_007bmissing_005fvalue_007d-915"></a><a name="index-_0040code_007bNUL_007d-916"></a>The netCDF packing algorithm (see <a href="#Intrinsic-functions">Intrinsic functions</a>) is
lossy&mdash;once packed, the exact original data cannot be recovered without
a full backup. 
Hence users should be aware of some packing caveats:
First, the interaction of packing and data equal to the
<var>missing_value</var> is complex. 
Test the <code>missing_value</code> behavior by performing a pack/unpack cycle
to ensure data that are missing <em>stay</em> missing and data that are
not misssing do not join the Air National Guard and go missing. 
This may lead you to elect a new <var>missing_value</var>. 
Second, <code>ncpdq</code> actually allows packing into <code>NC_CHAR</code> (with,
e.g., <span class="samp">flt_chr</span>). 
However, the intrinsic conversion of <code>signed char</code> to higher
precision types is tricky so for values equal to zero, i.e.,
<code>NUL</code>. 
Hence packing to <code>NC_CHAR</code> is not documented or advertised. 
Pack into <code>NC_BYTE</code> (with, e.g., <span class="samp">flt_byt</span>) instead.

<h4 class="unnumberedsubsec">Dimension Permutation</h4>

<p><span class="command">ncpdq</span> re-shapes variables in <var>input-file</var> by re-ordering
and/or reversing dimensions specified in the dimension list. 
The dimension list is a whitespace-free, comma separated list of
dimension names, optionally prefixed by negative signs, that follows the
<span class="samp">-a</span> (or long options <span class="samp">--arrange</span>, <span class="samp">--permute</span>,
<span class="samp">--re-order</span>, or <span class="samp">--rdr</span>) switch. 
To re-order variables by a subset of their dimensions, specify
these dimensions in a comma-separated list following <span class="samp">-a</span>, e.g.,
<span class="samp">-a lon,lat</span>. 
To reverse a dimension, prefix its name with a negative sign in the
dimension list, e.g., <span class="samp">-a -lat</span>. 
Re-ordering and reversal may be performed simultaneously, e.g.,
<span class="samp">-a lon,-lat,time,-lev</span>.

   <p><a name="index-record-dimension-917"></a>Users may specify any permutation of dimensions, including
permutations which change the record dimension identity. 
The record dimension is re-ordered like any other dimension. 
<a name="index-concatenation-918"></a><a name="index-record-dimension-919"></a>This unique <span class="command">ncpdq</span> capability makes it possible to concatenate
files along any dimension. 
See <a href="#Concatenation">Concatenation</a> for a detailed example. 
<a name="index-record-variable-920"></a>The record dimension is always the most slowly varying dimension in a
record variable (see <a href="#Fortran-indexing">Fortran indexing</a>). 
The specified re-ordering fails if it requires creating more than
one record dimension amongst all the output variables
<a rel="footnote" href="#fn-37" name="fnd-37"><sup>37</sup></a>.

   <p>Two special cases of dimension re-ordering and reversal deserve special
mention. 
First, it may be desirable to completely reverse the storage order of a
variable. 
To do this, include all the variable's dimensions in the dimension
re-order list in their original order, and prefix each dimension name
with the negative sign. 
<a name="index-transpose-921"></a>Second, it may useful to transpose a variable's storage order, e.g.,
from&nbsp;C<!-- /@w --> to Fortran data storage order (see <a href="#Fortran-indexing">Fortran indexing</a>). 
To do this, include all the variable's dimensions in the dimension
re-order list in reversed order. 
Explicit examples of these two techniques appear below.

<!-- fxm: discuss netCDF-imposed constraints here -->
<p class="noindent">EXAMPLES

   <p>Pack and unpack all variables in file <span class="file">in.nc</span> and store the results
in <span class="file">out.nc</span>:
<pre class="example">     ncpdq in.nc out.nc # Same as ncpack in.nc out.nc
     ncpdq -P all_new -M flt_sht in.nc out.nc # Defaults
     ncpdq -P all_xst in.nc out.nc
     ncpdq -P upk in.nc out.nc # Same as ncunpack in.nc out.nc
     ncpdq -U in.nc out.nc # Same as ncunpack in.nc out.nc
</pre>
   <p>The first two commands pack any unpacked variable in the input file. 
They also unpack and then re-pack every packed variable. 
The third command only packs unpacked variables in the input file. 
If a variable is already packed, the third command copies it unchanged
to the output file. 
The fourth and fifth commands unpack any packed variables. 
If a variable is not packed, the third command copies it unchanged.

   <p>The previous examples all utilized the default packing map. 
Suppose you wish to archive all data that are currently unpacked
into a form which only preserves 256 distinct values. 
Then you could specify the packing map <var>pck_map</var> as <span class="samp">hgh_byt</span>
and the packing policy <var>pck_plc</var> as <span class="samp">all_xst</span>:
<pre class="example">     ncpdq -P all_xst -M hgh_byt in.nc out.nc
</pre>
   <p><a name="index-appending-variables-922"></a><a name="index-_0040samp_007b_002dA_007d-923"></a><a name="index-_0040samp_007b_002dv_007d-924"></a>Many different packing maps may be used to construct a given file
by performing the packing on subsets of variables (e.g., with <span class="samp">-v</span>)
and using the append feature with <span class="samp">-A</span> (see <a href="#Appending">Appending</a>).

   <p>Re-order file <span class="file">in.nc</span> so that the dimension <code>lon</code> always
precedes the dimension <code>lat</code> and store the results in
<span class="file">out.nc</span>:
<pre class="example">     ncpdq -a lon,lat in.nc out.nc
     ncpdq -v three_dmn_var -a lon,lat in.nc out.nc
</pre>
   <p>The first command re-orders every variable in the input file. 
The second command extracts and re-orders only the variable
<code>three_dmn_var</code>.

   <p><a name="index-reverse-dimensions-925"></a>Suppose the dimension <code>lat</code> represents latitude and monotonically
increases increases from south to north. 
Reversing the <code>lat</code> dimension means re-ordering the data so that
latitude values decrease monotonically from north to south. 
Accomplish this with
<pre class="example">     % ncpdq -a -lat in.nc out.nc
     % ncks -C -v lat in.nc
     lat[0]=-90
     lat[1]=90
     % ncks -C -v lat out.nc
     lat[0]=90
     lat[1]=-90
</pre>
   <p>This operation reversed the latitude dimension of all variables. 
Whitespace immediately preceding the negative sign that specifies
dimension reversal may be dangerous. 
<a name="index-long-options-926"></a><a name="index-quotes-927"></a>Quotes and long options can help protect negative signs that should
indicate dimension reversal from being interpreted by the shell as
dashes that indicate new command line switches.
<pre class="example">     ncpdq -a -lat in.nc out.nc # Dangerous? Whitespace before "-lat"
     ncpdq -a "-lat" in.nc out.nc # OK. Quotes protect "-" in "-lat"
     ncpdq -a lon,-lat in.nc out.nc # OK. No whitespace before "-"
     ncpdq --rdr=-lat in.nc out.nc # Preferred. Uses "=" not whitespace
</pre>
   <p><a name="index-reverse-dimensions-928"></a>To create the mathematical transpose of a variable, place all its
dimensions in the dimension re-order list in reversed order. 
This example creates the transpose of <code>three_dmn_var</code>:
<pre class="example">     % ncpdq -a lon,lev,lat -v three_dmn_var in.nc out.nc
     % ncks -C -v three_dmn_var in.nc
     lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
     lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
     lat[0]=-90 lev[0]=100 lon[2]=180 three_dmn_var[2]=2
     ...
     lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
     lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
     lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
     % ncks -C -v three_dmn_var out.nc
     lon[0]=0 lev[0]=100 lat[0]=-90 three_dmn_var[0]=0
     lon[0]=0 lev[0]=100 lat[1]=90 three_dmn_var[1]=12
     lon[0]=0 lev[1]=500 lat[0]=-90 three_dmn_var[2]=4
     ...
     lon[3]=270 lev[1]=500 lat[1]=90 three_dmn_var[21]=19
     lon[3]=270 lev[2]=1000 lat[0]=-90 three_dmn_var[22]=11
     lon[3]=270 lev[2]=1000 lat[1]=90 three_dmn_var[23]=23
</pre>
   <p><a name="index-reverse-data-929"></a>To completely reverse the storage order of a variable, include
all its dimensions in the re-order list, each prefixed by a negative
sign. 
This example reverses the storage order of <code>three_dmn_var</code>:
<pre class="example">     % ncpdq -a -lat,-lev,-lon -v three_dmn_var in.nc out.nc
     % ncks -C -v three_dmn_var in.nc
     lat[0]=-90 lev[0]=100 lon[0]=0 three_dmn_var[0]=0
     lat[0]=-90 lev[0]=100 lon[1]=90 three_dmn_var[1]=1
     lat[0]=-90 lev[0]=100 lon[2]=180 three_dmn_var[2]=2
     ...
     lat[1]=90 lev[2]=1000 lon[1]=90 three_dmn_var[21]=21
     lat[1]=90 lev[2]=1000 lon[2]=180 three_dmn_var[22]=22
     lat[1]=90 lev[2]=1000 lon[3]=270 three_dmn_var[23]=23
     % ncks -C -v three_dmn_var out.nc
     lat[0]=90 lev[0]=1000 lon[0]=270 three_dmn_var[0]=23
     lat[0]=90 lev[0]=1000 lon[1]=180 three_dmn_var[1]=22
     lat[0]=90 lev[0]=1000 lon[2]=90 three_dmn_var[2]=21
     ...
     lat[1]=-90 lev[2]=100 lon[1]=180 three_dmn_var[21]=2
     lat[1]=-90 lev[2]=100 lon[2]=90 three_dmn_var[22]=1
     lat[1]=-90 lev[2]=100 lon[3]=0 three_dmn_var[23]=0
</pre>
   <p><a name="dmn_rcd_mk"></a> <!-- http://nco.sf.net/nco.html#dmn_rcd_mk --><a name="index-record-dimension-930"></a>Consider a file with all dimensions, including <code>time</code>, fixed
(non-record). 
Suppose the user wishes to convert <code>time</code> from a fixed dimension to
a record dimension. 
This may be useful, for example, when the user wishes to append
additional time slices to the data. 
The procedure is to use <span class="command">ncecat</span> followed by <span class="command">ncpdq</span>
and then <span class="command">ncwa</span>:
<a name="index-degenerate-dimension-931"></a>
<pre class="example">     ncecat -O in.nc out.nc # Add degenerate record dimension named "record"
     ncpdq -O -a time,record out.nc out.nc # Switch "record" and "time"
     ncwa -O -a record out.nc out.nc # Average out degenerate "record"
</pre>
   <p class="noindent">The first step creates a degenerate (size equals one) record dimension. 
The second step swaps the ordering of the dimensions named <code>time</code>
and <code>record</code>. 
Since <code>time</code> now occupies the position of the first (least rapidly
varying) dimension, it becomes the record dimension. 
The dimension named <code>record</code> is no longer a record dimension. 
The third step averages over the degenerate <code>record</code> dimension. 
Averaging over a degenerate dimension does not alter the data. 
The ordering of other dimensions in the file (<code>lat</code>, <code>lon</code>,
etc.) is immaterial to this procedure. 
See <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a> for other methods of
changing variable dimensionality, including the record dimension.

   <p><a name="ncra"></a> <!-- http://nco.sf.net/nco.html#ncra --><div class="node">
<p><hr>
<a name="ncra-netCDF-Record-Averager"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.9 <span class="command">ncra</span> netCDF Record Averager</h3>

<p><a name="index-averaging-data-932"></a><a name="index-record-average-933"></a><a name="index-record-dimension-934"></a><a name="index-running-average-935"></a><a name="index-ncra-936"></a>
SYNTAX
<pre class="example">     ncra [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]][,[<var>stride</var>]]] [-F] [-h] [-l <var>path</var>]
     [-n <var>loop</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
     [-t <var>thr_nbr</var>] [-v <var>var</var>[,...]] [-x] [-y <var>op_typ</var>] [-Z]
     [<var>input-files</var>] [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncra</span> averages record variables across an arbitrary number of
<var>input-files</var>. 
<a name="index-degenerate-dimension-937"></a><a name="index-record-dimension-938"></a>The record dimension is retained as a degenerate (size&nbsp;1)<!-- /@w --> dimension in
the output variables. 
See <a href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>, for a description of the
distinctions between the various averagers and concatenators. 
<a name="index-multi_002dfile-operators-939"></a><a name="index-standard-input-940"></a><a name="index-_0040code_007bstdin_007d-941"></a>As a multi-file operator, <span class="command">ncra</span> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-numbers-of-input-files">Large numbers of input files</a>).

   <p>Input files may vary in size, but each must have a record dimension. 
The record coordinate, if any, should be monotonic for (or else
non-fatal warnings may be generated). 
<a name="index-hyperslab-942"></a>Hyperslabs of the record dimension which include more than one file are
handled correctly. 
<a name="index-stride-943"></a><span class="command">ncra</span> supports the <var>stride</var> argument to the <span class="samp">-d</span>
hyperslab option for the record dimension only, <var>stride</var> is not
supported for non-record dimensions.

   <p><span class="command">ncra</span> weights each record (e.g., time slice) in the
<var>input-files</var> equally. 
<span class="command">ncra</span> does not attempt to see if, say, the <code>time</code>
coordinate is irregularly spaced and thus would require a weighted
average in order to be a true time average.

<p class="noindent">EXAMPLES

   <p>Average files <span class="file">85.nc</span>, <span class="file">86.nc</span>, <small class="dots">...</small>&nbsp;<span class="file">89.nc</span><!-- /@w -->
along the record dimension, and store the results in <span class="file">8589.nc</span>:
<a name="index-globbing-944"></a><a name="index-_0040code_007bNINTAP_007d-945"></a><a name="index-Processor-946"></a><a name="index-_0040acronym_007bCCM_007d-Processor-947"></a>
<pre class="example">     ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
     ncra 8[56789].nc 8589.nc
     ncra -n 5,2,1 85.nc 8589.nc
</pre>
   <p>These three methods produce identical answers. 
See <a href="#Specifying-input-files">Specifying input files</a>, for an explanation of the distinctions
between these methods.

   <p><a name="index-Fortran-948"></a>Assume the files <span class="file">85.nc</span>, <span class="file">86.nc</span>, <small class="dots">...</small>&nbsp;<span class="file">89.nc</span><!-- /@w -->
each contain a record coordinate <var>time</var> of length 12 defined such
that the third record in <span class="file">86.nc</span> contains data from March 1986,
etc. 
<acronym>NCO</acronym> knows how to hyperslab the record dimension across files. 
Thus, to average data from December, 1985 through February, 1986:
<pre class="example">     ncra -d time,11,13 85.nc 86.nc 87.nc 8512_8602.nc
     ncra -F -d time,12,14 85.nc 86.nc 87.nc 8512_8602.nc
</pre>
   <p class="noindent">The file <span class="file">87.nc</span> is superfluous, but does not cause an error. 
The <span class="samp">-F</span> turns on the Fortran (1-based) indexing convention. 
<a name="index-stride-949"></a>The following uses the <var>stride</var> option to average all the March
temperature data from multiple input files into a single output file
<pre class="example">     ncra -F -d time,3,,12 -v temperature 85.nc 86.nc 87.nc 858687_03.nc
</pre>
   <p>See <a href="#Stride">Stride</a>, for a description of the <var>stride</var> argument.

   <p>Assume the <var>time</var> coordinate is incrementally numbered such that
January, 1985&nbsp;=&nbsp;1<!-- /@w --> and December, 1989&nbsp;=&nbsp;60<!-- /@w -->. 
Assuming <span class="samp">??</span> only expands to the five desired files, the following
averages June, 1985&ndash;June, 1989:
<pre class="example">     ncra -d time,6.,54. ??.nc 8506_8906.nc
</pre>
   <p><a name="ncrcat"></a> <!-- http://nco.sf.net/nco.html#ncrcat --><div class="node">
<p><hr>
<a name="ncrcat-netCDF-Record-Concatenator"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.10 <span class="command">ncrcat</span> netCDF Record Concatenator</h3>

<p><a name="index-concatenation-950"></a><a name="index-record-concatenation-951"></a><a name="index-ncrcat-952"></a>
SYNTAX
<pre class="example">     ncrcat [-A] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]][,[<var>stride</var>]]] [-F] [-h] [-l <var>path</var>]
     [-n <var>loop</var>] [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
     [-v <var>var</var>[,...]] [-x] [-Z] [<var>input-files</var>] [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncrcat</span> concatenates record variables across an arbitrary
number of <var>input-files</var>. 
<a name="index-record-dimension-953"></a>The final record dimension is by default the sum of the lengths of the
record dimensions in the input files. 
See <a href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>, for a description of the
distinctions between the various averagers and concatenators. 
<a name="index-multi_002dfile-operators-954"></a><a name="index-standard-input-955"></a><a name="index-_0040code_007bstdin_007d-956"></a>As a multi-file operator, <span class="command">ncrcat</span> will read the list of
<var>input-files</var> from <code>stdin</code> if they are not specified
as positional arguments on the command line
(see <a href="#Large-numbers-of-input-files">Large numbers of input files</a>).

   <p>Input files may vary in size, but each must have a record dimension. 
The record coordinate, if any, should be monotonic (or else non-fatal
warnings may be generated). 
<a name="index-hyperslab-957"></a>Hyperslabs of the record dimension which include more than one file are
handled correctly. 
<a name="index-stride-958"></a><span class="command">ncra</span> supports the <var>stride</var> argument to the <span class="samp">-d</span>
hyperslab option for the record dimension only, <var>stride</var> is not
supported for non-record dimensions.

   <p><a name="index-ARM-conventions-959"></a><span class="command">ncrcat</span> applies special rules to <acronym>ARM</acronym> convention time
fields (e.g., <code>time_offset</code>). 
See <a href="#ARM-Conventions">ARM Conventions</a> for a complete description.

<p class="noindent">EXAMPLES

   <p>Concatenate files <span class="file">85.nc</span>, <span class="file">86.nc</span>, <small class="dots">...</small>&nbsp;<span class="file">89.nc</span><!-- /@w -->
along the record dimension, and store the results in <span class="file">8589.nc</span>:
<a name="index-globbing-960"></a><a name="index-_0040code_007bNINTAP_007d-961"></a><a name="index-Processor-962"></a><a name="index-_0040acronym_007bCCM_007d-Processor-963"></a>
<pre class="example">     ncrcat 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
     ncrcat 8[56789].nc 8589.nc
     ncrcat -n 5,2,1 85.nc 8589.nc
</pre>
   <p class="noindent">These three methods produce identical answers. 
See <a href="#Specifying-input-files">Specifying input files</a>, for an explanation of the distinctions
between these methods.

   <p><a name="index-Fortran-964"></a>Assume the files <span class="file">85.nc</span>, <span class="file">86.nc</span>, <small class="dots">...</small>&nbsp;<span class="file">89.nc</span><!-- /@w -->
each contain a record coordinate <var>time</var> of length&nbsp;12<!-- /@w --> defined
such that the third record in <span class="file">86.nc</span> contains data from March
1986, etc. 
<acronym>NCO</acronym> knows how to hyperslab the record dimension across files. 
Thus, to concatenate data from December, 1985&ndash;February, 1986:
<pre class="example">     ncrcat -d time,11,13 85.nc 86.nc 87.nc 8512_8602.nc
     ncrcat -F -d time,12,14 85.nc 86.nc 87.nc 8512_8602.nc
</pre>
   <p class="noindent">The file <span class="file">87.nc</span> is superfluous, but does not cause an error. 
When <span class="command">ncra</span> and <span class="command">ncrcat</span> encounter a file which does
contain any records that meet the specified hyperslab criteria, they
disregard the file and proceed to the next file without failing. 
The <span class="samp">-F</span> turns on the Fortran (1-based) indexing convention. 
<a name="index-stride-965"></a>
The following uses the <var>stride</var> option to concatenate all the March
temperature data from multiple input files into a single output file
<pre class="example">     ncrcat -F -d time,3,,12 -v temperature 85.nc 86.nc 87.nc 858687_03.nc
</pre>
   <p>See <a href="#Stride">Stride</a>, for a description of the <var>stride</var> argument.

   <p>Assume the <var>time</var> coordinate is incrementally numbered such that
January, 1985&nbsp;=&nbsp;1<!-- /@w --> and December, 1989&nbsp;=&nbsp;60.<!-- /@w -->
Assuming <code>??</code> only expands to the five desired files, the following
concatenates June, 1985&ndash;June, 1989:
<pre class="example">     ncrcat -d time,6.,54. ??.nc 8506_8906.nc
</pre>
   <p><a name="ncrename"></a> <!-- http://nco.sf.net/nco.html#ncrename --><div class="node">
<p><hr>
<a name="ncrename-netCDF-Renamer"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.11 <span class="command">ncrename</span> netCDF Renamer</h3>

<p><a name="index-renaming-variables-966"></a><a name="index-renaming-dimensions-967"></a><a name="index-renaming-attributes-968"></a><a name="index-variable-names-969"></a><a name="index-dimension-names-970"></a><a name="index-attribute-names-971"></a><a name="index-ncrename-972"></a>
SYNTAX
<pre class="example">     ncrename [-a <var>old_name</var>,<var>new_name</var>] [-a ...] [-D <var>dbg</var>]
     [-d <var>old_name</var>,<var>new_name</var>] [-d ...] [-h] [-l <var>path</var>]
     [-O] [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r]
     [-v <var>old_name</var>,<var>new_name</var>] [-v ...] [-Z]
     <var>input-file</var> [[<var>output-file</var>]]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncrename</span> renames dimensions, variables, and attributes in a
netCDF file. 
Each object that has a name in the list of old names is renamed using
the corresponding name in the list of new names. 
All the new names must be unique. 
Every old name must exist in the input file, unless the old name is
preceded by the character <span class="samp">.</span>. 
The validity of <var>old_name</var> is not checked prior to the renaming. 
Thus, if <var>old_name</var> is specified without the the <span class="samp">.</span> prefix and
is not present in <var>input-file</var>, <span class="command">ncrename</span> will abort. 
The <var>new_name</var> should never be prefixed by a <span class="samp">.</span> (the period
will be included as part of the new name). 
The OPTIONS and EXAMPLES show how to select specific variables
whose attributes are to be renamed.

   <p><a name="index-data-safety-973"></a><a name="index-safeguards-974"></a><a name="index-temporary-output-files-975"></a><span class="command">ncrename</span> is the exception to the normal rules that the user will
be interactively prompted before an existing file is changed, and that a
temporary copy of an output file is constructed during the operation. 
If only <var>input-file</var> is specified, then <span class="command">ncrename</span> will change
the names of the <var>input-file</var> in place without prompting and without
creating a temporary copy of <code>input-file</code>. 
This is because the renaming operation is considered reversible if the
user makes a mistake. 
The <var>new_name</var> can easily be changed back to <var>old_name</var> by using
<span class="command">ncrename</span> one more time.

   <p>Note that renaming a dimension to the name of a dependent variable can
be used to invert the relationship between an independent coordinate
variable and a dependent variable. 
In this case, the named dependent variable must be one-dimensional and
should have no missing values. 
Such a variable will become a coordinate variable.

   <p><a name="index-performance-976"></a><a name="index-operator-speed-977"></a><a name="index-speed-978"></a><a name="index-execution-time-979"></a>According to the <cite>netCDF User's Guide</cite>, renaming properties in
netCDF files does not incur the penalty of recopying the entire file
when the <var>new_name</var> is shorter than the <var>old_name</var>.

<p class="noindent">OPTIONS

     <dl>
<dt><span class="samp">-a </span><var>old_name</var><span class="samp">,</span><var>new_name</var><dd>Attribute renaming. 
The old and new names of the attribute are specified with <span class="samp">-a</span>
(or <span class="samp">--attribute</span>) by the associated <var>old_name</var> and
<var>new_name</var> values. 
<a name="index-global-attributes-980"></a><a name="index-attributes_002c-global-981"></a>Global attributes are treated no differently than variable attributes. 
This option may be specified more than once. 
As mentioned above, all occurrences of the attribute of a given name
will be renamed unless the <span class="samp">.</span> form is used, with one exception. 
To change the attribute name for a particular variable, specify
the <var>old_name</var> in the format <var>old_var_name@old_att_name</var>. 
The <span class="samp">@</span> symbol delimits the variable and attribute names. 
If the attribute is uniquely named (no other variables contain the
attribute) then the <var>old_var_name@old_att_name</var> syntax is
redundant. 
The <var>var_name@att_name</var> syntax is accepted, but not required,
for the <var>new_name</var>.

     <br><dt><span class="samp">-d </span><var>old_name</var><span class="samp">,</span><var>new_name</var><dd>Dimension renaming. 
The old and new names of the dimension are specified with <span class="samp">-d</span>
(or <span class="samp">--dmn</span>, <span class="samp">--dimension</span>) by the associated <var>old_name</var>
and <var>new_name</var> values. 
This option may be specified more than once.

     <br><dt><span class="samp">-v </span><var>old_name</var><span class="samp">,</span><var>new_name</var><dd>Variable renaming. 
The old and new names of the variable are specified with <span class="samp">-v</span>
(or <span class="samp">--variable</span>) by the associated <var>old_name</var> and
<var>new_name</var> values. 
This option may be specified more than once. 
</dl>

<p class="noindent">EXAMPLES

   <p>Rename the variable <code>p</code> to <code>pressure</code> and <code>t</code> to
<code>temperature</code> in netCDF <span class="file">in.nc</span>. 
In this case <code>p</code> must exist in the input file (or
<span class="command">ncrename</span> will abort), but the presence of <code>t</code> is optional:
<pre class="example">     ncrename -v p,pressure -v .t,temperature in.nc
</pre>
   <p>Rename the attribute <code>long_name</code> to <code>largo_nombre</code> in the
variable <code>u</code>, and no other variables in netCDF <span class="file">in.nc</span>.
<pre class="example">     ncrename -a u:long_name,largo_nombre in.nc
</pre>
   <p><a name="index-coordinate-variables-982"></a><span class="command">ncrename</span> does not automatically attach dimensions to variables of
the same name. 
If you want to rename a coordinate variable so that it remains a
coordinate variable, you must separately rename both the dimension and
the variable:
<pre class="example">     ncrename -d lon,longitude -v lon,longitude in.nc
</pre>
   <p><a name="index-global-attributes-983"></a><a name="index-attributes_002c-global-984"></a><a name="index-_0040code_007b_005fFillValue_007d-985"></a><a name="index-_0040code_007bmissing_005fvalue_007d-986"></a>Create netCDF <span class="file">out.nc</span> identical to <span class="file">in.nc</span> except the
attribute <code>_FillValue</code> is changed to <code>missing_value</code>,
the attribute <code>units</code> is changed to <code>CGS_units</code> (but only in
those variables which possess it), the attribute <code>hieght</code> is
changed to <code>height</code> in the variable <code>tpt</code>, and in the
variable <code>prs_sfc</code>, if it exists.
<pre class="example">     ncrename -a _FillValue,missing_value -a .units,CGS_units \
     -a tpt@hieght,height -a prs_sfc@.hieght,height in.nc out.nc
</pre>
   <p>The presence and absence of the <span class="samp">.</span> and <span class="samp">@</span> features
cause this command to execute successfully only if a number of
conditions are met. 
All variables <em>must</em> have a <code>_FillValue</code> attribute <em>and</em>
<code>_FillValue</code> must also be a global attribute. 
The <code>units</code> attribute, on the other hand, will be renamed to
<code>CGS_units</code> wherever it is found but need not be present in
the file at all (either as a global or a variable attribute). 
The variable <code>tpt</code> must contain the <code>hieght</code> attribute. 
The variable <code>prs_sfc</code> need not exist, and need not contain the
<code>hieght</code> attribute.

   <p><a name="ncwa"></a> <!-- http://nco.sf.net/nco.html#ncwa --><div class="node">
<p><hr>
<a name="ncwa-netCDF-Weighted-Averager"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Operator-Reference-Manual">Operator Reference Manual</a>
<br>
</div>

<h3 class="section">4.12 <span class="command">ncwa</span> netCDF Weighted Averager</h3>

<p><a name="index-averaging-data-987"></a><a name="index-weighted-average-988"></a><a name="index-masked-average-989"></a><a name="index-broadcasting-variables-990"></a><a name="index-ncwa-991"></a>
SYNTAX
<pre class="example">     ncwa [-A] [-a <var>dim</var>[,...]] [-C] [-c] [-D <var>dbg</var>]
     [-d <var>dim</var>,[<var>min</var>][,[<var>max</var>]]] [-F] [-h] [-I] [-l <var>path</var>]
     [-M <var>mask_val</var>] [-m <var>mask_var</var>] [-N] [-n] [-O]
     [-o <var>output-file</var>] [-p <var>path</var>] [-R] [-r] [-T <var>condition</var>]
     [-t <var>thr_nbr</var>] [-v <var>var</var>[,...]] [-W] [-w <var>weight</var>] [-x] [-y <var>op_typ</var>] [-Z]
     <var>input-file</var> [<var>output-file</var>]
</pre>
   <p class="noindent">DESCRIPTION

   <p><span class="command">ncwa</span> averages variables in a single file over arbitrary
dimensions, with options to specify weights, masks, and normalization. 
See <a href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a>, for a description of the
distinctions between the various averagers and concatenators. 
The default behavior of <span class="command">ncwa</span> is to arithmetically average
every numerical variable over all dimensions and produce a scalar
result. 
To average variables over only a subset of their dimensions, specify
these dimensions in a comma-separated list following <span class="samp">-a</span>, e.g.,
<span class="samp">-a time,lat,lon</span>. 
<a name="index-arithmetic-operators-992"></a><a name="index-hyperslab-993"></a><a name="index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-994"></a>As with all arithmetic operators, the operation may be restricted to
an arbitrary hypserslab by employing the <span class="samp">-d</span> option
(see <a href="#Hyperslabs">Hyperslabs</a>). 
<span class="command">ncwa</span> also handles values matching the variable's
<code>missing_value</code> attribute correctly. 
Moreover, <span class="command">ncwa</span> understands how to manipulate user-specified
weights, masks, and normalization options. 
With these options, <span class="command">ncwa</span> can compute sophisticated averages
(and integrals) from the command line.

   <p><a name="index-_0040code_007b_002dw-_0040var_007bweight_007d_007d-995"></a><a name="index-_0040code_007b_002d_002dweight-_0040var_007bweight_007d_007d-996"></a><a name="index-_0040code_007b_002d_002dwgt_005fvar-_0040var_007bweight_007d_007d-997"></a><a name="index-_0040code_007b_002dm-_0040var_007bmask_005fvar_007d_007d-998"></a><a name="index-_0040code_007b_002d_002dmask_002dvariable-_0040var_007bmask_005fvar_007d_007d-999"></a><a name="index-_0040code_007b_002d_002dmask_005fvariable-_0040var_007bmask_005fvar_007d_007d-1000"></a><a name="index-_0040code_007b_002d_002dmsk_005fnm-_0040var_007bmask_005fvar_007d_007d-1001"></a><a name="index-_0040code_007b_002d_002dmsk_005fvar-_0040var_007bmask_005fvar_007d_007d-1002"></a><var>mask_var</var> and <var>weight</var>, if specified, are broadcast to conform
to the variables being averaged. 
<a name="index-rank-1003"></a>The rank of variables is reduced by the number of dimensions which they
are averaged over. 
Thus arrays which are one dimensional in the <var>input-file</var> and are
averaged by <span class="command">ncwa</span> appear in the <var>output-file</var> as scalars. 
This allows the user to infer which dimensions may have been averaged. 
Note that that it is impossible for <span class="command">ncwa</span> to make make a
<var>weight</var> or <var>mask_var</var> of rank <var>W</var> conform to a <var>var</var> of
rank <var>V</var> if <var>W &gt; V</var>. 
This situation often arises when coordinate variables (which, by
definition, are one dimensional) are weighted and averaged. 
<span class="command">ncwa</span> assumes you know this is impossible and so <span class="command">ncwa</span>
does not attempt to broadcast <var>weight</var> or <var>mask_var</var> to conform
to <var>var</var> in this case, nor does <span class="command">ncwa</span> print a warning
message telling you this, because it is so common. 
Specifying <var>dbg &gt; 2</var> does cause <span class="command">ncwa</span> to emit warnings in
these situations, however.

   <p>Non-coordinate variables are always masked and weighted if specified. 
Coordinate variables, however, may be treated specially. 
By default, an averaged coordinate variable, e.g., <code>latitude</code>,
appears in <var>output-file</var> averaged the same way as any other variable
containing an averaged dimension. 
In other words, by default <span class="command">ncwa</span> weights and masks
coordinate variables like all other variables. 
This design decision was intended to be helpful but for some
applications it may be preferable not to weight or mask coordinate
variables just like all other variables. 
Consider the following arguments to <span class="command">ncwa</span>:
<code>-a latitude -w lat_wgt -d latitude,0.,90.</code> where <code>lat_wgt</code> is
a weight in the <code>latitude</code> dimension. 
Since, by default <span class="command">ncwa</span> weights coordinate variables, the
value of <code>latitude</code> in the <var>output-file</var> depends on the weights
in <var>lat_wgt</var> and is not likely to be&nbsp;45.0<!-- /@w -->, the midpoint latitude
of the hyperslab. 
<a name="index-coordinate-variable-1004"></a><a name="index-_0040code_007b_002dI_007d-1005"></a>Option <span class="samp">-I</span> overrides this default behavior and causes
<span class="command">ncwa</span> not to weight or mask coordinate variables
<a rel="footnote" href="#fn-38" name="fnd-38"><sup>38</sup></a>. 
In the above case, this causes the value of <code>latitude</code> in the
<var>output-file</var> to be&nbsp;45.0<!-- /@w -->, an appealing result. 
Thus, <span class="samp">-I</span> specifies simple arithmetic averages for the coordinate
variables. 
In the case of latitude, <span class="samp">-I</span> specifies that you prefer to archive
the central latitude of the hyperslab over which variables were averaged
rather than the area weighted centroid of the hyperslab
<a rel="footnote" href="#fn-39" name="fnd-39"><sup>39</sup></a>. 
The mathematical definition of operations involving rank reduction
is given above (see <a href="#Operation-Types">Operation Types</a>).

<ul class="menu">
<li><a accesskey="1" href="#Mask-condition">Mask condition</a>
<li><a accesskey="2" href="#Normalization">Normalization</a>
</ul>

   <p><a name="msk"></a> <!-- http://nco.sf.net/nco.html#msk --><div class="node">
<p><hr>
<a name="Mask-condition"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Normalization">Normalization</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>
<br>
</div>

<h4 class="subsection">4.12.1 Mask condition</h4>

<p><a name="index-mask-condition-1006"></a><a name="index-truth-condition-1007"></a>
<a name="index-_0040code_007b_002d_002dop_005frlt-_0040var_007bcondition_007d_007d-1008"></a><a name="index-_0040code_007b_002d_002dtruth_005fcondition-_0040var_007bcondition_007d_007d-1009"></a><a name="index-_0040code_007b_002d_002dmsk_005fcmp_005ftyp-_0040var_007bcondition_007d_007d-1010"></a>The mask condition has the syntax <var>mask_var</var>
<var>condition</var> <var>mask_val</var>. 
Here <var>mask_var</var> is the name of the masking variable (specified with
<span class="samp">-m</span>, <span class="samp">--mask-variable</span>, <span class="samp">--mask_variable</span>,
<span class="samp">--msk_nm</span>, or <span class="samp">--msk_var</span>). 
The truth <var>condition</var> argument (specified with <span class="samp">-T</span>,
<span class="samp">--truth_condition</span>, <span class="samp">--msk_cmp_typ</span>, or <span class="samp">--op_rlt</span> may
be any one of the six arithmetic comparatives: <kbd>eq</kbd>, <kbd>ne</kbd>,
<kbd>gt</kbd>, <kbd>lt</kbd>, <kbd>ge</kbd>, <kbd>le</kbd>.

   <p>These are the Fortran-style character abbreviations for the logical
operations ==, !=, &gt;, &lt;, &gt;=,
&lt;=.

   <p>The mask condition defaults to <kbd>eq</kbd> (equality). 
<a name="index-_0040code_007b_002d_002dmask_002dvalue-_0040var_007bmask_005fval_007d_007d-1011"></a><a name="index-_0040code_007b_002d_002dmask_005fvalue-_0040var_007bmask_005fval_007d_007d-1012"></a><a name="index-_0040code_007b_002d_002dmsk_005fval-_0040var_007bmask_005fval_007d_007d-1013"></a>The <var>mask_val</var> argument to <span class="samp">-M</span> (or <span class="samp">--mask-value</span>, or
<span class="samp">--msk_val</span>) is the right hand side of the
<dfn>mask condition</dfn>. 
Thus for the <var>i</var>'th element of the hyperslab to be averaged,
the mask condition is

   <p>mask(i) <var>condition</var> <var>mask_val</var>.

   <p><a name="nrm"></a> <!-- http://nco.sf.net/nco.html#nrm --><div class="node">
<p><hr>
<a name="Normalization"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Mask-condition">Mask condition</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a>
<br>
</div>

<h4 class="subsection">4.12.2 Normalization</h4>

<p><a name="index-normalization-1014"></a><a name="index-_0040code_007b_002dN_007d-1015"></a><a name="index-_0040code_007bnumerator_007d-1016"></a><span class="command">ncwa</span> has one switch which controls the normalization of the
averages appearing in the <var>output-file</var>. 
Short option <span class="samp">-N</span> (or long options <span class="samp">--nmr</span> or
<span class="samp">--numerator</span>) prevents <span class="command">ncwa</span> from dividing the weighted
sum of the variable (the numerator in the averaging expression) by the
weighted sum of the weights (the denominator in the averaging
expression). 
Thus <span class="samp">-N</span> tells <span class="command">ncwa</span> to return just the numerator of the
arithmetic expression defining the operation (see <a href="#Operation-Types">Operation Types</a>).

<p class="noindent">EXAMPLES

   <p>Given file <span class="file">85_0112.nc</span>:
<pre class="example">     netcdf 85_0112 {
     dimensions:
             lat = 64 ;
             lev = 18 ;
             lon = 128 ;
             time = UNLIMITED ; // (12 currently)
     variables:
             float lat(lat) ;
             float lev(lev) ;
             float lon(lon) ;
             float time(time) ;
             float scalar_var ;
             float three_dmn_var(lat, lev, lon) ;
             float two_dmn_var(lat, lev) ;
             float mask(lat, lon) ;
             float gw(lat) ;
     }
</pre>
   <p>Average all variables in <span class="file">in.nc</span> over all dimensions and store
results in <span class="file">out.nc</span>:
<pre class="example">     ncwa in.nc out.nc
</pre>
   <p class="noindent">Every variable in <span class="file">in.nc</span> is reduced to a scalar in <span class="file">out.nc</span>
because, by default, averaging is performed over all dimensions.

   <p>Store the zonal (longitudinal) mean of <span class="file">in.nc</span> in <span class="file">out.nc</span>:
<pre class="example">     ncwa -a lon in.nc out.nc
</pre>
   <p class="noindent">Here the tally is simply the size of <code>lon</code>, or 128.

   <p><a name="index-_0040code_007bgw_007d-1017"></a><a name="index-Gaussian-weights-1018"></a><a name="index-climate-model-1019"></a>Compute the meridional (latitudinal) mean, with values weighted by
the corresponding element of <var>gw</var>
<a rel="footnote" href="#fn-40" name="fnd-40"><sup>40</sup></a>:
<pre class="example">     ncwa -w gw -a lat in.nc out.nc
</pre>
   <p class="noindent">Here the tally is simply the size of <code>lat</code>, or&nbsp;64.<!-- /@w -->
The sum of the Gaussian weights is&nbsp;2.0.<!-- /@w -->

   <p>Compute the area mean over the tropical Pacific:
<pre class="example">     ncwa -w gw -a lat,lon -d lat,-20.,20. -d lon,120.,270.
     in.nc out.nc
</pre>
   <p class="noindent">Here the tally is

   <p>64 times 128 = 8192.

   <p><a name="index-_0040code_007bORO_007d-1020"></a><a name="index-climate-model-1021"></a>Compute the area mean over the globe, but include only points for
which

   <p><var>ORO</var> &lt; 0.5

   <p><a rel="footnote" href="#fn-41" name="fnd-41"><sup>41</sup></a>:
<pre class="example">     ncwa -m ORO -M 0.5 -T lt -w gw -a lat,lon in.nc out.nc
</pre>
   <p class="noindent">Assuming 70% of the gridpoints are maritime, then here the tally is

   <p>0.70 times 8192 = 5734.

   <p>Compute the global annual mean over the maritime tropical Pacific:
<pre class="example">     ncwa -m ORO -M 0.5 -T lt -w gw -a lat,lon,time
     -d lat,-20.0,20.0 -d lon,120.0,270.0 in.nc out.nc
</pre>
   <p>Determine the total area of the maritime tropical Pacific, assuming
the variable <var>area</var> contains the area of each gridcell
<pre class="example">     ncwa -N -v area -m ORO -M 0.5 -T lt -a lat,lon
     -d lat,-20.0,20.0 -d lon,120.0,270.0 in.nc out.nc
</pre>
   <p>Weighting <var>area</var> (e.g., by <var>gw</var>) is not appropriate because
<var>area</var> is <em>already</em> area-weighted by definition. 
Thus the <span class="samp">-N</span> switch, or, equivalently, the <span class="samp">-y ttl</span> switch,
correctly integrate the cell areas into a total regional area.

   <p><a name="index-mask-condition-1022"></a><a name="index-truth-condition-1023"></a>Mask a file to contain <var>missing_value</var> everywhere except where
<var>thr_min</var> &lt;= <var>msk_var</var> &lt;= <var>thr_max</var>:
<pre class="example">     # Set masking variable and its scalar thresholds
     export msk_var='three_dmn_var_dbl' # Masking variable
     export thr_max='20' # Maximum allowed value
     export thr_min='10' # Minimum allowed value
     ncecat -O in.nc out.nc # Wrap out.nc in degenerate "record" dimension
     ncwa -O -a record -m ${msk_var} -T le -M ${thr_max} out.nc out.nc
     ncecat -O out.nc out.nc # Wrap out.nc in degenerate "record" dimension
     ncwa -O -a record -m ${msk_var} -T ge -M ${thr_min} out.nc out.nc
</pre>
   <p>After the first use of <span class="command">ncwa</span>, <span class="file">out.nc</span> contains
<var>missing_value</var> where <code>${msk_var} &gt;= ${thr_max}</code>. 
The process is then repeated on the remaining data to filter out
points where <code>${msk_var} &lt;= ${thr_min}</code>. 
The resulting <span class="file">out.nc</span> contains valid data only
where <var>thr_min</var> &lt;= <var>msk_var</var> &lt;= <var>thr_max</var>.

   <p><a name="ctr"></a> <!-- http://nco.sf.net/nco.html#ctr --><div class="node">
<p><hr>
<a name="Contributing"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#General-Index">General Index</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Operator-Reference-Manual">Operator Reference Manual</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="chapter">5 Contributing</h2>

<p><a name="index-contributing-1024"></a>We welcome contributions from anyone. 
The <acronym>NCO</acronym> project homepage at
<a href="https://sf.net/projects/nco">https://sf.net/projects/nco</a>
contains more information on how to contribute.

   <p><a name="index-PayPal-1025"></a>Financial contributions to <acronym>NCO</acronym> development may be made through
<a href="https://www.paypal.com/xclick/business=zender%40uci.edu&amp;item_name=NCO+development&amp;item_number=nco_dnt_dvl&amp;no_note=1&amp;tax=0&amp;currency_code=USD">PayPal</a>. 
<acronym>NCO</acronym> has been shared for almost 10&nbsp;years<!-- /@w --> yet no one has
ever contributed any money to the developers
<a rel="footnote" href="#fn-42" name="fnd-42"><sup>42</sup></a>. 
So you could be the first!

   <p><a name="dvl"></a> <!-- http://nco.sf.net/nco.html#dvl -->

<ul class="menu">
<li><a accesskey="1" href="#Contributors">Contributors</a>
<li><a accesskey="2" href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a>
</ul>

<div class="node">
<p><hr>
<a name="Contributors"></a>Next:&nbsp;<a rel="next" accesskey="n" href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="#Contributing">Contributing</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Contributing">Contributing</a>
<br>
</div>

<h3 class="section">5.1 Contributors</h3>

<p><a name="index-contributors-1026"></a>The primary contributors to <acronym>NCO</acronym> development are:
     
<a name="index-Charlie-Zender-1027"></a>
<dl><dt>Charlie Zender<dd>Concept, design and implementation of <acronym>NCO</acronym> from 1995-2000. 
Since then mainly autotools, bug-squashing, documentation, packing,
<acronym>NCO</acronym> library redesign, <span class="command">ncap</span> features, <span class="command">ncbo</span>,
project coordination, and releases. 
<a name="index-Henry-Butowsky-1028"></a><br><dt>Henry Butowsky<dd>Non-linear operations and <code>min()</code>, <code>max()</code>, <code>total()</code>
support in <span class="command">ncra</span> and <span class="command">ncwa</span>. 
Type conversion for arithmetic. 
Migration to netCDF3 API. 
<a name="index-I_002fO-1029"></a><span class="command">ncap</span> parser, lexer, and&nbsp;I/O<!-- /@w -->. 
Multislabbing algorithm. 
Variable wildcarding. 
Various hacks. 
<a name="index-Rorik-Peterson-1030"></a><br><dt>Rorik Peterson<dd>Autotool build support. 
Long command-line options. 
UDUnits support. 
Debianization. 
Numerous bug-fixes. 
<a name="index-Harry-Mangalam-1031"></a><br><dt>Harry Mangalam<dd>Benchmarking. 
OPeNDAP configuration. 
<a name="index-Brian-Mays-1032"></a><br><dt>Brian Mays<dd>Packaging for Debian GNU/Linux, <span class="command">nroff</span> man pages. 
<a name="index-George-Shapovalov-1033"></a><br><dt>George Shapovalov<dd>Packaging for Gentoo GNU/Linux. 
<a name="index-Bill-Kocik-1034"></a><br><dt>Bill Kocik<dd>Memory management. 
<a name="index-Len-Makin-1035"></a><br><dt>Len Makin<dd>NEC SX architecture support. 
<a name="index-Jim-Edwards-1036"></a><br><dt>Jim Edwards<dd>AIX architecture support. 
<a name="index-Juliana-Rew-1037"></a><br><dt>Juliana Rew<dd>Compatibility with large PIDs. 
<a name="index-Keith-Lindsay-1038"></a><a name="index-Martin-Dix-1039"></a><a name="index-Mike-Page-1040"></a><br><dt>Martin Dix, Keith Lindsay, Mike Page<dd>Excellent bug reports. 
</dl>

   <p><a name="prp"></a> <!-- http://nco.sf.net/nco.html#prp -->
<a name="prp_sei"></a> <!-- http://nco.sf.net/nco.html#prp_sei -->
<a name="fnd"></a> <!-- http://nco.sf.net/nco.html#fnd -->

<ul class="menu">
<li><a accesskey="1" href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a>
</ul>

<div class="node">
<p><hr>
<a name="Proposals-for-Institutional-Funding"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Contributors">Contributors</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Contributing">Contributing</a>
<br>
</div>

<h3 class="section">5.2 Proposals for Institutional Funding</h3>

<p><a name="index-funding-1041"></a><a name="index-proposals-1042"></a><a name="index-_0040acronym_007bNSF_007d-1043"></a><a name="index-server_002dside-processing-1044"></a><a name="index-Distributed-Data-Reduction-_0026-Analysis-1045"></a><a name="index-Scientific-Data-Operators-1046"></a><a name="index-_0040acronym_007bDDRA_007d-1047"></a><a name="index-Server_002dSide-Distributed-Data-Reduction-_0026-Analysis-1048"></a><a name="index-_0040acronym_007bSSDDRA_007d-1049"></a><a name="index-_0040acronym_007bCCSM_007d-1050"></a><a name="index-_0040acronym_007bIPCC_007d-1051"></a><a name="index-_0040acronym_007bNSF_007d-1052"></a><a name="index-_0040acronym_007bSDO_007d-1053"></a><a name="index-_0040acronym_007bSEIII_007d-1054"></a><a name="index-OptIPuter-1055"></a><acronym>NSF</acronym> has funded a
<a href="http://nco.sf.net#prp_sei">project</a>
to improve Distributed Data Reduction &amp; Analysis (<acronym>DDRA</acronym>) by
evolving <acronym>NCO</acronym> into a suite of Scientific Data Operators called
<acronym>SDO</acronym>. 
<a name="index-parallelism-1056"></a>The two main components of this project are <acronym>NCO</acronym> parallelism
(OpenMP, <acronym>MPI</acronym>) and Server-Side <acronym>DDRA</acronym>
(<acronym>SSDDRA</acronym>) implemented through extensions to <acronym>OPeNDAP</acronym>
and netCDF4. 
This project will dramatically reduce bandwidth usage for <acronym>NCO</acronym>
<acronym>DDRA</acronym>.

   <p><a name="index-_0040acronym_007bNASA_007d-1057"></a><a name="index-_0040acronym_007bNRA_007d-1058"></a><a name="index-_0040acronym_007bHDF_007d-1059"></a>With this first <acronym>NCO</acronym> proposal funded, the content of the
next <acronym>NCO</acronym> proposal is clear. 
We are interested in obtaining <acronym>NASA</acronym> support for
<acronym>HDF</acronym>-specific enhancements to <acronym>NCO</acronym>. 
We plan to submit a proposal to the next suitable <acronym>NASA</acronym>
<acronym>NRA</acronym> or <acronym>NSF</acronym> opportunity.

   <p>We are considering a lot of interesting ideas for still more proposals. 
Please contact us if you wish to be involved with any future
<acronym>NCO</acronym>-related proposals. 
Comments on the proposals and letters of support are also very welcome.

<!-- @ignore -->
<!-- @node CCSM Example, General Index, Operators, Top -->
<!-- @chapter Example: Analyzing a @acronym{CCSM} run -->
<!-- This chapter presents an in depth example of using @acronym{NCO} to -->
<!-- analyze the results of a @acronym{CCSM} run. -->
<!-- @end ignore -->
<!-- @node Name Index, General Index, Operators, Top -->
<!-- @unnumbered Function and Variable Index -->
<!-- @printindex fn -->
<p><a name="index"></a> <!-- http://nco.sf.net/nco.html#index -->
<a name="idx"></a> <!-- http://nco.sf.net/nco.html#idx --><div class="node">
<p><hr>
<a name="General-Index"></a>Previous:&nbsp;<a rel="previous" accesskey="p" href="#Contributing">Contributing</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="#Top">Top</a>
<br>
</div>

<h2 class="unnumbered">General Index</h2>

<ul class="index-cp" compact>
<li><a href="#index-_0040code_007b_0022_007d-_0028double-quote_0029-723"><code>&quot;</code> (double quote)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_0023include_007d-573"><code>#include</code></a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040code_007b_0024_007d-_0028wildcard-character_0029-377"><code>$</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_0025_007d-_0028modulus_0029-604"><code>%</code> (modulus)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_0027_007d-_0028end-quote_0029-722"><code>'</code> (end quote)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_002a_007d-757"><code>*</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002a_007d-_0028filename-expansion_0029-380"><code>*</code> (filename expansion)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002a_007d-_0028multiplication_0029-601"><code>*</code> (multiplication)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002a_007d-_0028wildcard-character_0029-382"><code>*</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002b_007d-755"><code>+</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002b_007d-_0028addition_0029-599"><code>+</code> (addition)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002b_007d-_0028wildcard-character_0029-383"><code>+</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002d_007d-756"><code>-</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002d_007d-_0028subtraction_0029-600"><code>-</code> (subtraction)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002d_002d64_002dbit_002doffset_007d-264"><code>--64-bit-offset</code></a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-_0040code_007b_002d_002dabc_007d-830"><code>--abc</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dalphabetize_007d-831"><code>--alphabetize</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dapn_007d-505"><code>--apn</code></a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-_0040code_007b_002d_002dapn_007d-147"><code>--apn</code></a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007b_002d_002dappend_007d-506"><code>--append</code></a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-_0040code_007b_002d_002dappend_007d-148"><code>--append</code></a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007b_002d_002dbinary_007d-835"><code>--binary</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dbnr_007d-834"><code>--bnr</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dcoords_007d-394"><code>--coords</code></a>: <a href="#Coordinate-variables">Coordinate variables</a></li>
<li><a href="#index-_0040code_007b_002d_002dcrd_007d-395"><code>--crd</code></a>: <a href="#Coordinate-variables">Coordinate variables</a></li>
<li><a href="#index-_0040code_007b_002d_002ddbg_005flvl-_0040var_007bdebug_002dlevel_007d_007d-281"><code>--dbg_lvl </code><var>debug-level</var></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040code_007b_002d_002ddbg_005flvl-_0040var_007bdebug_002dlevel_007d_007d-207"><code>--dbg_lvl </code><var>debug-level</var></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040code_007b_002d_002ddbg_005flvl-_0040var_007bdebug_002dlevel_007d_007d-116"><code>--dbg_lvl </code><var>debug-level</var></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002d_002ddebug_002dlevel-_0040var_007bdebug_002dlevel_007d_007d-206"><code>--debug-level </code><var>debug-level</var></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040code_007b_002d_002ddebug_002dlevel-_0040var_007bdebug_002dlevel_007d_007d-115"><code>--debug-level </code><var>debug-level</var></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_002c_005b_0040var_007bmax_007d_005d_002c_0040var_007bstride_007d_007d-445"><code>--dimension </code><var>dim</var><code>,[</code><var>min</var><code>],[</code><var>max</var><code>],</code><var>stride</var></a>: <a href="#Stride">Stride</a></li>
<li><a href="#index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-441"><code>--dimension </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Wrapped-coordinates">Wrapped coordinates</a></li>
<li><a href="#index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-424"><code>--dimension </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-416"><code>--dimension </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Multislabs">Multislabs</a></li>
<li><a href="#index-_0040code_007b_002d_002ddimension-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-409"><code>--dimension </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_002c_005b_0040var_007bmax_007d_005d_002c_0040var_007bstride_007d_007d-446"><code>--dmn </code><var>dim</var><code>,[</code><var>min</var><code>],[</code><var>max</var><code>],</code><var>stride</var></a>: <a href="#Stride">Stride</a></li>
<li><a href="#index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-442"><code>--dmn </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Wrapped-coordinates">Wrapped coordinates</a></li>
<li><a href="#index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-425"><code>--dmn </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-417"><code>--dmn </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Multislabs">Multislabs</a></li>
<li><a href="#index-_0040code_007b_002d_002ddmn-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-410"><code>--dmn </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-_0040code_007b_002d_002dexclude_007d-365"><code>--exclude</code></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002d_002dfile_005flist_007d-522"><code>--file_list</code></a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-_0040code_007b_002d_002dfl_005fbnr_007d-837"><code>--fl_bnr</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dfl_005flst_005fin_007d-521"><code>--fl_lst_in</code></a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-_0040code_007b_002d_002dfl_005fout-_0040var_007bfl_005fout_007d_007d-306"><code>--fl_out </code><var>fl_out</var></a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-_0040code_007b_002d_002dfl_005fspt_007d-551"><code>--fl_spt</code></a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-_0040code_007b_002d_002dfmt_007d-859"><code>--fmt</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dfnc_005ftbl_007d-673"><code>--fnc_tbl</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002d_002dformat_007d-860"><code>--format</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dfortran_007d-400"><code>--fortran</code></a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-_0040code_007b_002d_002dhieronymus_007d-840"><code>--hieronymus</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dhistory_007d-513"><code>--history</code></a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-_0040code_007b_002d_002dhst_007d-512"><code>--hst</code></a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-_0040code_007b_002d_002dlcl-_0040var_007boutput_002dpath_007d_007d-325"><code>--lcl </code><var>output-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002d_002dlocal-_0040var_007boutput_002dpath_007d_007d-326"><code>--local </code><var>output-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002d_002dmap-_0040var_007bpck_005fmap_007d_007d-902"><code>--map </code><var>pck_map</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002d_002dmask_002dvalue-_0040var_007bmask_005fval_007d_007d-1011"><code>--mask-value </code><var>mask_val</var></a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007b_002d_002dmask_002dvariable-_0040var_007bmask_005fvar_007d_007d-999"><code>--mask-variable </code><var>mask_var</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002d_002dmask_005fvalue-_0040var_007bmask_005fval_007d_007d-1012"><code>--mask_value </code><var>mask_val</var></a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007b_002d_002dmask_005fvariable-_0040var_007bmask_005fvar_007d_007d-1000"><code>--mask_variable </code><var>mask_var</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002d_002dmetadata_007d-848"><code>--metadata</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dMetadata_007d-843"><code>--Metadata</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dmsk_005fcmp_005ftyp-_0040var_007bcondition_007d_007d-1010"><code>--msk_cmp_typ </code><var>condition</var></a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007b_002d_002dmsk_005fnm-_0040var_007bmask_005fvar_007d_007d-1001"><code>--msk_nm </code><var>mask_var</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002d_002dmsk_005fval-_0040var_007bmask_005fval_007d_007d-1013"><code>--msk_val </code><var>mask_val</var></a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007b_002d_002dmsk_005fvar-_0040var_007bmask_005fvar_007d_007d-1002"><code>--msk_var </code><var>mask_var</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002d_002dmtd_007d-847"><code>--mtd</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dMtd_007d-842"><code>--Mtd</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dnintap-_0040var_007bloop_007d_007d-290"><code>--nintap </code><var>loop</var></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007b_002d_002dno_002dcoords_007d-392"><code>--no-coords</code></a>: <a href="#Coordinate-variables">Coordinate variables</a></li>
<li><a href="#index-_0040code_007b_002d_002dno_002dcrd_007d-393"><code>--no-crd</code></a>: <a href="#Coordinate-variables">Coordinate variables</a></li>
<li><a href="#index-_0040code_007b_002d_002domp_005fnum_005fthreads-_0040var_007bthr_005fnbr_007d_007d-250"><code>--omp_num_threads </code><var>thr_nbr</var></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040code_007b_002d_002dop_005frlt-_0040var_007bcondition_007d_007d-1008"><code>--op_rlt </code><var>condition</var></a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007b_002d_002dop_005ftyp-_0040var_007bop_005ftyp_007d_007d-761"><code>--op_typ </code><var>op_typ</var></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002d_002dop_005ftyp-_0040var_007bop_005ftyp_007d_007d-486"><code>--op_typ </code><var>op_typ</var></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040code_007b_002d_002doperation-_0040var_007bop_005ftyp_007d_007d-760"><code>--operation </code><var>op_typ</var></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002d_002doperation-_0040var_007bop_005ftyp_007d_007d-485"><code>--operation </code><var>op_typ</var></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040code_007b_002d_002doutput-_0040var_007bfl_005fout_007d_007d-305"><code>--output </code><var>fl_out</var></a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-_0040code_007b_002d_002doverwrite_007d-503"><code>--overwrite</code></a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-_0040code_007b_002d_002doverwrite_007d-150"><code>--overwrite</code></a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007b_002d_002dovr_007d-504"><code>--ovr</code></a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-_0040code_007b_002d_002dovr_007d-149"><code>--ovr</code></a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007b_002d_002dpack_005fpolicy-_0040var_007bpck_005fplc_007d_007d-891"><code>--pack_policy </code><var>pck_plc</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002d_002dpath-_0040var_007binput_002dpath_007d_007d-324"><code>--path </code><var>input-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002d_002dpath-_0040var_007binput_002dpath_007d_007d-293"><code>--path </code><var>input-path</var></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007b_002d_002dpck_005fmap-_0040var_007bpck_005fmap_007d_007d-901"><code>--pck_map </code><var>pck_map</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002d_002dpck_005fplc-_0040var_007bpck_005fplc_007d_007d-890"><code>--pck_plc </code><var>pck_plc</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002d_002dprint_007d-851"><code>--print</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dprn_007d-852"><code>--prn</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dprn_005ffnc_005ftbl_007d-672"><code>--prn_fnc_tbl</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002d_002dpth-_0040var_007binput_002dpath_007d_007d-323"><code>--pth </code><var>input-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002d_002dpth-_0040var_007binput_002dpath_007d_007d-292"><code>--pth </code><var>input-path</var></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007b_002d_002dquiet_007d-855"><code>--quiet</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dretain_007d-355"><code>--retain</code></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040code_007b_002d_002drevision_007d-541"><code>--revision</code></a>: <a href="#Operator-version">Operator version</a></li>
<li><a href="#index-_0040code_007b_002d_002drevision_007d-111"><code>--revision</code></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002d_002drtn_007d-354"><code>--rtn</code></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040code_007b_002d_002dscript_007d-552"><code>--script</code></a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-_0040code_007b_002d_002dscript_002dfile_007d-550"><code>--script-file</code></a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-_0040code_007b_002d_002dspt_007d-553"><code>--spt</code></a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-_0040code_007b_002d_002dstring_007d-858"><code>--string</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dthr_005fnbr-_0040var_007bthr_005fnbr_007d_007d-248"><code>--thr_nbr </code><var>thr_nbr</var></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040code_007b_002d_002dthreads-_0040var_007bthr_005fnbr_007d_007d-249"><code>--threads </code><var>thr_nbr</var></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040code_007b_002d_002dtruth_005fcondition-_0040var_007bcondition_007d_007d-1009"><code>--truth_condition </code><var>condition</var></a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007b_002d_002dunits_007d-864"><code>--units</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002d_002dunpack_007d-894"><code>--unpack</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002d_002dupk_007d-893"><code>--upk</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002d_002dvariable-_0040var_007bvar_007d_007d-363"><code>--variable </code><var>var</var></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002d_002dversion_007d-542"><code>--version</code></a>: <a href="#Operator-version">Operator version</a></li>
<li><a href="#index-_0040code_007b_002d_002dversion_007d-112"><code>--version</code></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002d_002dvrs_007d-543"><code>--vrs</code></a>: <a href="#Operator-version">Operator version</a></li>
<li><a href="#index-_0040code_007b_002d_002dvrs_007d-113"><code>--vrs</code></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002d_002dweight-_0040var_007bweight_007d_007d-996"><code>--weight </code><var>weight</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002d_002dweight-_0040var_007bwgt1_007d_005b_002c_0040var_007bwgt2_007d_005d_007d-807"><code>--weight </code><var>wgt1</var><code>[,</code><var>wgt2</var><code>]</code></a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040code_007b_002d_002dwgt_005fvar-_0040var_007bweight_007d_007d-997"><code>--wgt_var </code><var>weight</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002d_002dwgt_005fvar-_0040var_007bwgt1_007d_005b_002c_0040var_007bwgt2_007d_005d_007d-808"><code>--wgt_var </code><var>wgt1</var><code>[,</code><var>wgt2</var><code>]</code></a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040code_007b_002d_002dxcl_007d-366"><code>--xcl</code></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040samp_007b_002dA_007d-923"><span class="samp">-A</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002da_007d-829"><code>-a</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dA_007d-502"><code>-A</code></a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-_0040code_007b_002dA_007d-145"><code>-A</code></a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007b_002db_007d-836"><code>-b</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dB_007d-833"><code>-B</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dC_007d-688"><code>-C</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002dc_007d-391"><code>-c</code></a>: <a href="#Coordinate-variables">Coordinate variables</a></li>
<li><a href="#index-_0040code_007b_002dC_007d-390"><code>-C</code></a>: <a href="#Coordinate-variables">Coordinate variables</a></li>
<li><a href="#index-_0040code_007b_002dD_007d-109"><code>-D</code></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002dD-_0040var_007bdebug_002dlevel_007d_007d-280"><code>-D </code><var>debug-level</var></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040code_007b_002dD-_0040var_007bdebug_002dlevel_007d_007d-205"><code>-D </code><var>debug-level</var></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040code_007b_002dD-_0040var_007bdebug_002dlevel_007d_007d-114"><code>-D </code><var>debug-level</var></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_002c_005b_0040var_007bmax_007d_005d_002c_0040var_007bstride_007d_007d-444"><code>-d </code><var>dim</var><code>,[</code><var>min</var><code>],[</code><var>max</var><code>],</code><var>stride</var></a>: <a href="#Stride">Stride</a></li>
<li><a href="#index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-994"><code>-d </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-440"><code>-d </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Wrapped-coordinates">Wrapped coordinates</a></li>
<li><a href="#index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-423"><code>-d </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-415"><code>-d </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Multislabs">Multislabs</a></li>
<li><a href="#index-_0040code_007b_002dd-_0040var_007bdim_007d_002c_005b_0040var_007bmin_007d_005d_005b_002c_005b_0040var_007bmax_007d_005d_005d_007d-408"><code>-d </code><var>dim</var><code>,[</code><var>min</var><code>][,[</code><var>max</var><code>]]</code></a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-_0040code_007b_002df_007d-671"><code>-f</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002dF_007d-399"><code>-F</code></a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-_0040code_007b_002dH_007d-839"><code>-H</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dh_007d-694"><code>-h</code></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_002dH_007d-520"><code>-H</code></a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-_0040code_007b_002dh_007d-511"><code>-h</code></a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-_0040code_007b_002dI_007d-1005"><code>-I</code></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002dl-_0040var_007boutput_002dpath_007d_007d-327"><code>-l </code><var>output-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002dm_007d-846"><code>-m</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dM_007d-841"><code>-M</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dm-_0040var_007bmask_005fvar_007d_007d-998"><code>-m </code><var>mask_var</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002dM-_0040var_007bpck_005fmap_007d_007d-900"><code>-M </code><var>pck_map</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002dN_007d-1015"><code>-N</code></a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-_0040code_007b_002dn-_0040var_007bloop_007d_007d-289"><code>-n </code><var>loop</var></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007b_002dn-_0040var_007bloop_007d_007d-170"><code>-n </code><var>loop</var></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040code_007b_002dO_007d-501"><code>-O</code></a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-_0040code_007b_002dO_007d-146"><code>-O</code></a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007b_002do-_0040var_007bfl_005fout_007d_007d-304"><code>-o </code><var>fl_out</var></a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-_0040code_007b_002do-_0040var_007bfl_005fout_007d_007d-188"><code>-o </code><var>fl_out</var></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040code_007b_002dP_007d-850"><code>-P</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dp-_0040var_007binput_002dpath_007d_007d-331"><code>-p </code><var>input-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002dp-_0040var_007binput_002dpath_007d_007d-291"><code>-p </code><var>input-path</var></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007b_002dP-_0040var_007bpck_005fplc_007d_007d-889"><code>-P </code><var>pck_plc</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002dq_007d-854"><code>-q</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dQ_007d-853"><code>-Q</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dr_007d-540"><code>-r</code></a>: <a href="#Operator-version">Operator version</a></li>
<li><a href="#index-_0040code_007b_002dR_007d-353"><code>-R</code></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040code_007b_002dr_007d-108"><code>-r</code></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007b_002ds_007d-857"><code>-s</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_002dt-_0040var_007bthr_005fnbr_007d_007d-251"><code>-t </code><var>thr_nbr</var></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040code_007b_002dU_007d-892"><code>-U</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002du_007d-863"><code>-u</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040samp_007b_002dv_007d-924"><span class="samp">-v</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007b_002dv-_0040var_007bvar_007d_007d-362"><code>-v </code><var>var</var></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002dw-_0040var_007bweight_007d_007d-995"><code>-w </code><var>weight</var></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-_0040code_007b_002dw-_0040var_007bwgt1_007d_005b_002c_0040var_007bwgt2_007d_005d_007d-806"><code>-w </code><var>wgt1</var><code>[,</code><var>wgt2</var><code>]</code></a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040code_007b_002dx_007d-364"><code>-x</code></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_002dy-_0040var_007bop_005ftyp_007d_007d-759"><code>-y </code><var>op_typ</var></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002dy-_0040var_007bop_005ftyp_007d_007d-484"><code>-y </code><var>op_typ</var></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040code_007b_002dZ_007d-263"><code>-Z</code></a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-_0040code_007b_002e_007d-_0028wildcard-character_0029-376"><code>.</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040file_007b_002erhosts_007d-314"><span class="file">.rhosts</span></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007b_002f_007d-758"><code>/</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007b_002f_007d-_0028division_0029-602"><code>/</code> (division)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_002f_002a_002e_002e_002e_002a_002f_007d-_0028comment_0029-569"><code>/*...*/</code> (comment)</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040code_007b_002f_002f_007d-_0028comment_0029-570"><code>//</code> (comment)</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040code_007b0_007d-_0028NUL_0029-732"><code>0</code> (NUL)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-32_002dbit-offset-file-format-268">32-bit offset file format</a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-64_002dbit-offset-file-format-269">64-bit offset file format</a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-_0040code_007b_003b_007d-_0028end-of-statement_0029-567"><code>;</code> (end of statement)</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040file_007b_003carpa_002fnameser_002eh_003e_007d-77"><span class="file">&lt;arpa/nameser.h&gt;</span></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040file_007b_003cresolv_002eh_003e_007d-78"><span class="file">&lt;resolv.h&gt;</span></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040code_007b_003f_007d-_0028filename-expansion_0029-379"><code>?</code> (filename expansion)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_003f_007d-_0028question-mark_0029-724"><code>?</code> (question mark)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_003f_007d-_0028wildcard-character_0029-381"><code>?</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_0040_0040_007d-_0028attribute_0029-575"><code>@</code> (attribute)</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040code_007b_005b_005d_007d-_0028array-delimiters_0029-562"><code>[]</code> (array delimiters)</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040code_007b_005c_007d-_0028backslash_0029-725"><code>\</code> (backslash)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005c_0022_007d-_0028protected-double-quote_0029-719"><code>\&quot;</code> (protected double quote)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005c_0027_007d-_0028protected-end-quote_0029-718"><code>\'</code> (protected end quote)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005c_003f_007d-_0028protected-question-mark_0029-720"><code>\?</code> (protected question mark)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005c_005c_007d-_0028_0040acronym_007bASCII_007d-_005c_002c-backslash_0029-717"><code>\\</code> (<acronym>ASCII</acronym> \, backslash)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005c_005c_007d-_0028protected-backslash_0029-721"><code>\\</code> (protected backslash)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005ca_007d-_0028_0040acronym_007bASCII_007d-BEL_002c-bell_0029-712"><code>\a</code> (<acronym>ASCII</acronym> BEL, bell)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005cb_007d-_0028_0040acronym_007bASCII_007d-BS_002c-backspace_0029-713"><code>\b</code> (<acronym>ASCII</acronym> BS, backspace)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005cf_007d-_0028_0040acronym_007bASCII_007d-FF_002c-formfeed_0029-714"><code>\f</code> (<acronym>ASCII</acronym> FF, formfeed)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005cn_007d-_0028_0040acronym_007bASCII_007d-LF_002c-linefeed_0029-709"><code>\n</code> (<acronym>ASCII</acronym> LF, linefeed)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005cn_007d-_0028linefeed_0029-870"><code>\n</code> (linefeed)</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_005cr_007d-_0028_0040acronym_007bASCII_007d-CR_002c-carriage-return_0029-715"><code>\r</code> (<acronym>ASCII</acronym> CR, carriage return)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005ct_007d-_0028_0040acronym_007bASCII_007d-HT_002c-horizontal-tab_0029-711"><code>\t</code> (<acronym>ASCII</acronym> HT, horizontal tab)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005ct_007d-_0028horizontal-tab_0029-871"><code>\t</code> (horizontal tab)</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007b_005cv_007d-_0028_0040acronym_007bASCII_007d-VT_002c-vertical-tab_0029-716"><code>\v</code> (<acronym>ASCII</acronym> VT, vertical tab)</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007b_005e_007d-_0028power_0029-603"><code>^</code> (power)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007b_005e_007d-_0028wildcard-character_0029-378"><code>^</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040code_007b_005fFillValue_007d-985"><code>_FillValue</code></a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-_0040cite_007bNCO-User_0027s-Guide_007d-16"><cite>NCO User's Guide</cite></a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040cite_007bUser_0027s-Guide_007d-15"><cite>User's Guide</cite></a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040var_007babs_007d-605"><var>abs</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-absolute-value-638">absolute value</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007bacos_007d-607"><var>acos</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007bacosh_007d-606"><var>acosh</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007badd_007d-751"><code>add</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007badd_005foffset_007d-884"><code>add_offset</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007badd_005foffset_007d-578"><code>add_offset</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-_0040var_007badd_005foffset_007d-236"><var>add_offset</var></a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-adding-data-802">adding data</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-adding-data-747">adding data</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-addition-804">addition</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-addition-744">addition</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-addition-592">addition</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040command_007balias_007d-895"><span class="command">alias</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040command_007balias_007d-768"><span class="command">alias</span></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-alphabetization-827">alphabetization</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-alphabetize-output-866">alphabetize output</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-alternate-invocations-762">alternate invocations</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-anomalies-772">anomalies</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040acronym_007bANSI_007d-53"><acronym>ANSI</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040code_007bANSI-C_007d-663"><code>ANSI C</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-appending-data-823">appending data</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-appending-data-682">appending data</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-appending-to-files-498">appending to files</a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-appending-to-files-152">appending to files</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-appending-variables-922">appending variables</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-appending-variables-154">appending variables</a>: <a href="#Appending">Appending</a></li>
<li><a href="#index-arccosine-function-639">arccosine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-arcsine-function-640">arcsine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-arctangent-function-641">arctangent function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-arithmetic-operators-992">arithmetic operators</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-arithmetic-operators-453">arithmetic operators</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-arithmetic-processor-547">arithmetic processor</a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-ARM-conventions-959">ARM conventions</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-_0040acronym_007bARM_007d-conventions-531"><acronym>ARM</acronym> conventions</a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-array-indexing-563">array indexing</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-array-storage-564">array storage</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-array-syntax-561">array syntax</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-arrival-value-809">arrival value</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040acronym_007bASCII_007d-707"><acronym>ASCII</acronym></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040var_007basin_007d-609"><var>asin</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007basinh_007d-608"><var>asinh</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-assignment-statement-565">assignment statement</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-asynchronous-file-access-322">asynchronous file access</a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040var_007batan_007d-611"><var>atan</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007batanh_007d-610"><var>atanh</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-attribute-names-971">attribute names</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-attribute-names-690">attribute names</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attribute-syntax-574">attribute syntax</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-attribute_002c-_0040code_007bunits_007d-422">attribute, <code>units</code></a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-attributes-689">attributes</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-appending-700">attributes, appending</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-creating-701">attributes, creating</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-deleting-702">attributes, deleting</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-editing-704">attributes, editing</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-global-981">attributes, global</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-attributes_002c-global-822">attributes, global</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-attributes_002c-global-699">attributes, global</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-global-537">attributes, global</a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-attributes_002c-global-519">attributes, global</a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-attributes_002c-global-510">attributes, global</a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-attributes_002c-modifying-703">attributes, modifying</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-attributes_002c-overwriting-705">attributes, overwriting</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040command_007bautoconf_007d-120"><span class="command">autoconf</span></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-automagic-171">automagic</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-automagic-62">automagic</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-automatic-type-conversion-662">automatic type conversion</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-automatic-type-conversion-491">automatic type conversion</a>: <a href="#Type-conversion">Type conversion</a></li>
<li><a href="#index-average-476">average</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-averaging-data-987">averaging data</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-averaging-data-932">averaging data</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-averaging-data-783">averaging data</a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-averaging-data-451">averaging data</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040code_007bavg_007d-467"><code>avg</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040code_007bavgsqr_007d-469"><code>avgsqr</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040code_007bbase_005ftime_007d-533"><code>base_time</code></a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-_0040command_007bbash_007d-387"><span class="command">bash</span></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-Bash-Shell-780">Bash Shell</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-Bash-shell-764">Bash shell</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-benchmarks-260">benchmarks</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-Bill-Kocik-1034">Bill Kocik</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-binary-format-832">binary format</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-binary-operations-743">binary operations</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-binary-operations-221">binary operations</a>: <a href="#Memory-Usage-of-ncap">Memory Usage of ncap</a></li>
<li><a href="#index-Bourne-Shell-781">Bourne Shell</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-Bourne-Shell-447">Bourne Shell</a>: <a href="#Stride">Stride</a></li>
<li><a href="#index-Brian-Mays-1032">Brian Mays</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-broadcasting-variables-990">broadcasting variables</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-broadcasting-variables-814">broadcasting variables</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-broadcasting-variables-771">broadcasting variables</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007bBSD_007d-276"><code>BSD</code></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-buffering-226">buffering</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-bugs_002c-reporting-103">bugs, reporting</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007bbyte_0028x_0029_007d-586"><code>byte(x)</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-C-index-convention-398">C index convention</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-C-language-1068">C language</a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-C-language-862">C language</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-C-language-731">C language</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-C-language-560">C language</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-C-language-493">C language</a>: <a href="#Automatic-type-conversion">Automatic type conversion</a></li>
<li><a href="#index-C-language-454">C language</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-C-language-57">C language</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-C-Shell-782">C Shell</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-C-Shell-448">C Shell</a>: <a href="#Stride">Stride</a></li>
<li><a href="#index-C_002b_002b-49">C++</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040command_007bc_002b_002b_007d-41"><span class="command">c++</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-C89-54">C89</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-C99-56">C99</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040var_007bC_005fformat_007d-232"><var>C_format</var></a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-_0040command_007bcc_007d-42"><span class="command">cc</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040command_007bCC_007d-40"><span class="command">CC</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040acronym_007bCCM_007d-Processor-963"><acronym>CCM</acronym> Processor</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-_0040acronym_007bCCM_007d-Processor-947"><acronym>CCM</acronym> Processor</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-_0040acronym_007bCCM_007d-Processor-288"><acronym>CCM</acronym> Processor</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040acronym_007bCCSM_007d-1050"><acronym>CCSM</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bCCSM_007d-conventions-779"><acronym>CCSM</acronym> conventions</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040acronym_007bCCSM_007d-conventions-524"><acronym>CCSM</acronym> conventions</a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-_0040var_007bceil_007d-612"><var>ceil</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-ceiling-function-642">ceiling function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-CF-convention-435">CF convention</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-_0040code_007bchar_0028x_0029_007d-587"><code>char(x)</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-characters_002c-special-710">characters, special</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-Charlie-Zender-1027">Charlie Zender</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-Charlie-Zender-2">Charlie Zender</a>: <a href="#Foreword">Foreword</a></li>
<li><a href="#index-chocolate-1069">chocolate</a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-classic-files-format-267">classic files format</a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-client_002dserver-345">client-server</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-Climate-and-Forecast-Metadata-Convention-434">Climate and Forecast Metadata Convention</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-climate-model-1019">climate model</a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-climate-model-798">climate model</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-climate-model-299">climate model</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-climate-model-163">climate model</a>: <a href="#Concatenation">Concatenation</a></li>
<li><a href="#index-climate-model-134">climate model</a>: <a href="#Climate-model-paradigm">Climate model paradigm</a></li>
<li><a href="#index-climate-model-128">climate model</a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-Comeau-29">Comeau</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-command-line-options-270">command line options</a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-command-line-switches-544">command line switches</a>: <a href="#Operator-Reference-Manual">Operator Reference Manual</a></li>
<li><a href="#index-command-line-switches-303">command line switches</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-command-line-switches-238">command line switches</a>: <a href="#Common-features">Common features</a></li>
<li><a href="#index-command-line-switches-133">command line switches</a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-comments-568">comments</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040command_007bcomo_007d-43"><span class="command">como</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-Compaq-30">Compaq</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-compatability-34">compatability</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-compilers-310">compilers</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-complementary-error-function-643">complementary error function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-concatenation-950">concatenation</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-concatenation-918">concatenation</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-concatenation-791">concatenation</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-concatenation-153">concatenation</a>: <a href="#Appending">Appending</a></li>
<li><a href="#index-_0040file_007bconfig_002eguess_007d-124"><span class="file">config.guess</span></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040file_007bconfigure_002eeg_007d-125"><span class="file">configure.eg</span></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-constraint-expressions-1066">constraint expressions</a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-contributing-1024">contributing</a>: <a href="#Contributing">Contributing</a></li>
<li><a href="#index-contributors-1026">contributors</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-coordinate-limits-407">coordinate limits</a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-coordinate-variable-1004">coordinate variable</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-coordinate-variable-775">coordinate variable</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-coordinate-variable-428">coordinate variable</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-coordinate-variables-982">coordinate variables</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-_0040code_007bcore-dump_007d-872"><code>core dump</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007bcore-dump_007d-203"><code>core dump</code></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-core-dump-104">core dump</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040var_007bcos_007d-614"><var>cos</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007bcosh_007d-613"><var>cosh</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-cosine-function-644">cosine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-covariance-680">covariance</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-Cray-199">Cray</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-Cray-25">Cray</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040command_007bcsh_007d-388"><span class="command">csh</span></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040command_007bcxx_007d-44"><span class="command">cxx</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-Cygwin-68">Cygwin</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-data-access-protocol-341">data access protocol</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-data-safety-973">data safety</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-data-safety-137">data safety</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-data_002c-missing-696">data, missing</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-data_002c-missing-450">data, missing</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040code_007bdate_007d-528"><code>date</code></a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-_0040code_007bdatesec_007d-529"><code>datesec</code></a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-_0040var_007bdbg_005flvl_007d-259"><var>dbg_lvl</var></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040var_007bdbg_005flvl_007d-209"><var>dbg_lvl</var></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040var_007bdbg_005flvl_007d-118"><var>dbg_lvl</var></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040acronym_007bDDRA_007d-1047"><acronym>DDRA</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040var_007bdebug_002dlevel_007d-208"><var>debug-level</var></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040var_007bdebug_002dlevel_007d-117"><var>debug-level</var></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-debugging-258">debugging</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-debugging-210">debugging</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-debugging-107">debugging</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040acronym_007bDEC_007d-24"><acronym>DEC</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-degenerate-dimension-937">degenerate dimension</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-degenerate-dimension-931">degenerate dimension</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-degenerate-dimension-810">degenerate dimension</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-degenerate-dimension-800">degenerate dimension</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-degenerate-dimension-774">degenerate dimension</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-degenerate-dimension-679">degenerate dimension</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-degenerate-dimension-487">degenerate dimension</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-demotion-585">demotion</a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-demotion-490">demotion</a>: <a href="#Type-conversion">Type conversion</a></li>
<li><a href="#index-derived-fields-554">derived fields</a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-Digital-26">Digital</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-dimension-limits-406">dimension limits</a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-dimension-names-970">dimension names</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-disjoint-files-158">disjoint files</a>: <a href="#Appending">Appending</a></li>
<li><a href="#index-Distributed-Data-Reduction-_0026-Analysis-1045">Distributed Data Reduction &amp; Analysis</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-Distributed-Oceanographic-Data-System-339">Distributed Oceanographic Data System</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-_0040code_007bdivide_007d-754"><code>divide</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-dividing-data-750">dividing data</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-division-595">division</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-documentation-9">documentation</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040acronym_007bDODS_007d-360"><acronym>DODS</acronym></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040acronym_007bDODS_007d-336"><acronym>DODS</acronym></a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-_0040env_007bDODS_005fROOT_007d-338"><span class="env">DODS_ROOT</span></a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-double-precision-668">double precision</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bdouble_0028x_0029_007d-588"><code>double(x)</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-dynamic-linking-86">dynamic linking</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-eddy-covariance-681">eddy covariance</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-editing-attributes-691">editing attributes</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040command_007begrep_007d-372"><span class="command">egrep</span></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-ensemble-786">ensemble</a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-ensemble-162">ensemble</a>: <a href="#Concatenation">Concatenation</a></li>
<li><a href="#index-ensemble-average-784">ensemble average</a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-ensemble-concatenation-792">ensemble concatenation</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-_0040var_007berf_007d-616"><var>erf</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007berfc_007d-615"><var>erfc</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-error-function-645">error function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-error-tolerance-138">error tolerance</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-execution-time-979">execution time</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-execution-time-459">execution time</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-execution-time-230">execution time</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-execution-time-144">execution time</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-execution-time-91">execution time</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-_0040var_007bexp_007d-617"><var>exp</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-exponentiation-596">exponentiation</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-exponentiation-function-646">exponentiation function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-extended-regular-expressions-368">extended regular expressions</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-extended-regular-expressions-180">extended regular expressions</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040code_007bf90_007d-73"><code>f90</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-features_002c-requesting-106">features, requesting</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-file-deletion-350">file deletion</a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-file-removal-351">file removal</a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-file-retention-352">file retention</a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-files_002c-multiple-297">files, multiple</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-files_002c-numerous-input-169">files, numerous input</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-flags-675">flags</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bfloat_007d-664"><code>float</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bfloat_0028x_0029_007d-589"><code>float(x)</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-_0040var_007bfloor_007d-618"><var>floor</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bfloor_007d-495"><code>floor</code></a>: <a href="#Automatic-type-conversion">Automatic type conversion</a></li>
<li><a href="#index-floor-function-647">floor function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040samp_007bflt_005fbyt_007d-906"><span class="samp">flt_byt</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040samp_007bflt_005fsht_007d-905"><span class="samp">flt_sht</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-force-append-500">force append</a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-force-overwrite-499">force overwrite</a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-foreword-1">foreword</a>: <a href="#Foreword">Foreword</a></li>
<li><a href="#index-Fortran-964">Fortran</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-Fortran-948">Fortran</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-Fortran-494">Fortran</a>: <a href="#Automatic-type-conversion">Automatic type conversion</a></li>
<li><a href="#index-Fortran-index-convention-397">Fortran index convention</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-_0040var_007bFORTRAN_005fformat_007d-233"><var>FORTRAN_format</var></a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-_0040acronym_007bFTP_007d-356"><acronym>FTP</acronym></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040code_007bftp_007d-319"><code>ftp</code></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007bftp_007d-79"><code>ftp</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-funding-1041">funding</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040code_007bg_002b_002b_007d-1061"><code>g++</code></a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-_0040code_007bg77_007d-1062"><code>g77</code></a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-_0040var_007bgamma_007d-619"><var>gamma</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007bgamma_007d-61"><var>gamma</var></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-gamma-function-648">gamma function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-Gaussian-weights-1018">Gaussian weights</a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-_0040code_007bgcc_007d-1060"><code>gcc</code></a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-_0040command_007bgcc_007d-45"><span class="command">gcc</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040acronym_007bGCM_007d-136"><acronym>GCM</acronym></a>: <a href="#Climate-model-paradigm">Climate model paradigm</a></li>
<li><a href="#index-George-Shapovalov-1033">George Shapovalov</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-_0040code_007bgethostname_007d-76"><code>gethostname</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040code_007bgetopt_007d-277"><code>getopt</code></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040file_007bgetopt_002eh_007d-279"><span class="file">getopt.h</span></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040code_007bgetopt_005flong_007d-278"><code>getopt_long</code></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040code_007bgetuid_007d-75"><code>getuid</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-global-attributes-980">global attributes</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-global-attributes-821">global attributes</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-global-attributes-698">global attributes</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-global-attributes-536">global attributes</a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-global-attributes-518">global attributes</a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-global-attributes-509">global attributes</a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-global-attributes-177">global attributes</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-globbing-960">globbing</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-globbing-944">globbing</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-globbing-765">globbing</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-globbing-385">globbing</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-globbing-283">globbing</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-globbing-178">globbing</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040acronym_007bGNU_007d-373"><acronym>GNU</acronym></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040acronym_007bGNU_007d-273"><acronym>GNU</acronym></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040code_007bgnu_002dwin32_007d-69"><code>gnu-win32</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040acronym_007bGNU_007d_002fLinux-201"><acronym>GNU</acronym>/Linux</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040file_007bGNUmakefile_007d-71"><span class="file">GNUmakefile</span></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-God-437">God</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-_0040code_007bgw_007d-1017"><code>gw</code></a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-_0040code_007bgw_007d-526"><code>gw</code></a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-Harry-Mangalam-1031">Harry Mangalam</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-_0040acronym_007bHDF_007d-1059"><acronym>HDF</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bHDF_007d-95"><acronym>HDF</acronym></a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-help-105">help</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-Henry-Butowsky-1028">Henry Butowsky</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-_0040samp_007bhgh_005fbyt_007d-904"><span class="samp">hgh_byt</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040samp_007bhgh_005fsht_007d-903"><span class="samp">hgh_sht</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-Hierarchical-Data-Format-96">Hierarchical Data Format</a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-_0040code_007bhistory_007d-865"><code>history</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007bhistory_007d-693"><code>history</code></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007bhistory_007d-535"><code>history</code></a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-_0040code_007bhistory_007d-507"><code>history</code></a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-_0040code_007bhistory_007d-192"><code>history</code></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040acronym_007bHP_007d-23"><acronym>HP</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040acronym_007bHTML_007d-12"><acronym>HTML</acronym></a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040acronym_007bHTTP_007d-protocol-337"><acronym>HTTP</acronym> protocol</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-hybrid-coordinate-system-555">hybrid coordinate system</a>: <a href="#Left-hand-casting">Left hand casting</a></li>
<li><a href="#index-hyperbolic-arccosine-function-649">hyperbolic arccosine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-hyperbolic-arcsine-function-650">hyperbolic arcsine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-hyperbolic-arctangent-function-651">hyperbolic arctangent function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-hyperbolic-cosine-function-652">hyperbolic cosine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-hyperbolic-sine-function-653">hyperbolic sine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-hyperbolic-tangent-654">hyperbolic tangent</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-hyperslab-993">hyperslab</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-hyperslab-957">hyperslab</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-hyperslab-942">hyperslab</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-hyperslab-405">hyperslab</a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-I_002fO-1029">I/O</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-I_002fO-418">I/O</a>: <a href="#Multislabs">Multislabs</a></li>
<li><a href="#index-I_002fO-401">I/O</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-I_002fO-349">I/O</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-I18N-240">I18N</a>: <a href="#Internationalization">Internationalization</a></li>
<li><a href="#index-_0040acronym_007bIBM_007d-20"><acronym>IBM</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040command_007bicc_007d-46"><span class="command">icc</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040acronym_007bIDL_007d-130"><acronym>IDL</acronym></a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-_0040code_007bilimit_007d-200"><code>ilimit</code></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-including-files-571">including files</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-index-conventions-396">index conventions</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-inexact-conversion-660">inexact conversion</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-Info-14">Info</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-input-files-301">input files</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-input-files-282">input files</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-input-files-187">input files</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040var_007binput_002dpath_007d-332"><var>input-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040var_007binput_002dpath_007d-294"><var>input-path</var></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-installation-119">installation</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-installation-36">installation</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040code_007bint_0028x_0029_007d-590"><code>int(x)</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-Intel-28">Intel</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-Internationalization-239">Internationalization</a>: <a href="#Internationalization">Internationalization</a></li>
<li><a href="#index-interpolation-801">interpolation</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-introduction-6">introduction</a>: <a href="#Introduction">Introduction</a></li>
<li><a href="#index-_0040acronym_007bIPCC_007d-1051"><acronym>IPCC</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bISO_007d-50"><acronym>ISO</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-Jim-Edwards-1036">Jim Edwards</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-Juliana-Rew-1037">Juliana Rew</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-Keith-Lindsay-1038">Keith Lindsay</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-kitchen-sink-816">kitchen sink</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-L10N-241">L10N</a>: <a href="#Internationalization">Internationalization</a></li>
<li><a href="#index-large-datasets-257">large datasets</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-large-datasets-193">large datasets</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-Large-File-Support-262">Large File Support</a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-Large-File-Support-195">Large File Support</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040code_007bLD_005fLIBRARY_005fPATH_007d-85"><code>LD_LIBRARY_PATH</code></a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-left-hand-casting-556">left hand casting</a>: <a href="#Left-hand-casting">Left hand casting</a></li>
<li><a href="#index-left-hand-casting-224">left hand casting</a>: <a href="#Memory-Usage-of-ncap">Memory Usage of ncap</a></li>
<li><a href="#index-Len-Makin-1035">Len Makin</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-lexer-546">lexer</a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-LFS-261">LFS</a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-LFS-194">LFS</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-_0040acronym_007bLHS_007d-557"><acronym>LHS</acronym></a>: <a href="#Left-hand-casting">Left hand casting</a></li>
<li><a href="#index-_0040command_007blibnco_007d-51"><span class="command">libnco</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-libraries-84">libraries</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-linkers-311">linkers</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-Linux-674">Linux</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007bln_007d-620"><var>ln</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040command_007bln-_002ds_007d-896"><span class="command">ln -s</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040command_007bln-_002ds_007d-769"><span class="command">ln -s</span></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040var_007blog_007d-622"><var>log</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007blog10_007d-621"><var>log10</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-logarithm_002c-base-10-655">logarithm, base 10</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-logarithm_002c-natural-656">logarithm, natural</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007blong-double_007d-669"><code>long double</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-long-options-926">long options</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-long-options-275">long options</a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-longitude-439">longitude</a>: <a href="#Wrapped-coordinates">Wrapped coordinates</a></li>
<li><a href="#index-Macintosh-31">Macintosh</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040file_007bMakefile_007d-346"><span class="file">Makefile</span></a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-_0040file_007bMakefile_007d-99"><span class="file">Makefile</span></a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-_0040file_007bMakefile_007d-72"><span class="file">Makefile</span></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040file_007bMakefile_007d-52"><span class="file">Makefile</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-malloc_0028_0029-225"><code>malloc()</code></a>: <a href="#Memory-Usage-of-ncap">Memory Usage of ncap</a></li>
<li><a href="#index-manual-type-conversion-492">manual type conversion</a>: <a href="#Type-conversion">Type conversion</a></li>
<li><a href="#index-Martin-Dix-1039">Martin Dix</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-mask-condition-1022">mask condition</a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-mask-condition-1006">mask condition</a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-masked-average-989">masked average</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-masked-average-676">masked average</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-Mass-Store-System-317">Mass Store System</a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-mathematical-functions-633">mathematical functions</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bmax_007d-471"><code>max</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-maximum-480">maximum</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-mean-477">mean</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-memory-available-212">memory available</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-memory-leaks-223">memory leaks</a>: <a href="#Memory-Usage-of-ncap">Memory Usage of ncap</a></li>
<li><a href="#index-memory-requirements-367">memory requirements</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-memory-requirements-211">memory requirements</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-merging-files-824">merging files</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-merging-files-155">merging files</a>: <a href="#Appending">Appending</a></li>
<li><a href="#index-metadata-849">metadata</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-metadata_002c-global-844">metadata, global</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-Microsoft-64">Microsoft</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-Microsoft-32">Microsoft</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-Mike-Folk-97">Mike Folk</a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-Mike-Page-1040">Mike Page</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-_0040code_007bmin_007d-470"><code>min</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-minimum-479">minimum</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-missing-values-811">missing values</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-missing-values-695">missing values</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-missing-values-449">missing values</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040code_007bmissing_005fvalue_007d-986"><code>missing_value</code></a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-_0040code_007bmissing_005fvalue_007d-915"><code>missing_value</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040var_007bmissing_005fvalue_007d-914"><var>missing_value</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bmissing_005fvalue_007d-812"><code>missing_value</code></a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040code_007bmissing_005fvalue_007d-697"><code>missing_value</code></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007bmissing_005fvalue_007d-580"><code>missing_value</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-_0040code_007bmissing_005fvalue_007d-452"><code>missing_value</code></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-MKS-units-426">MKS units</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-modulus-598">modulus</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-monotonic-coordinates-231">monotonic coordinates</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-_0040acronym_007bmsrcp_007d-358"><acronym>msrcp</acronym></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040command_007bmsrcp_007d-328"><span class="command">msrcp</span></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040command_007bmsread_007d-329"><span class="command">msread</span></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040acronym_007bMSS_007d-316"><acronym>MSS</acronym></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-multi_002dfile-operators-954">multi-file operators</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-multi_002dfile-operators-939">multi-file operators</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-multi_002dfile-operators-795">multi-file operators</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-multi_002dfile-operators-788">multi-file operators</a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-multi_002dfile-operators-307">multi-file operators</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-multi_002dfile-operators-296">multi-file operators</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-multi_002dfile-operators-219">multi-file operators</a>: <a href="#Memory-Usage-of-Single-and-Multi_002dfile-Operators">Memory Usage of Single and Multi-file Operators</a></li>
<li><a href="#index-multiplication-746">multiplication</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-multiplication-594">multiplication</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bmultiply_007d-753"><code>multiply</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-multiplying-data-803">multiplying data</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-multiplying-data-749">multiplying data</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-multislab-414">multislab</a>: <a href="#Multislabs">Multislabs</a></li>
<li><a href="#index-naked-characters-763">naked characters</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040acronym_007bNASA_007d-1057"><acronym>NASA</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bNASA-EOSDIS_007d-172"><acronym>NASA EOSDIS</acronym></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-National-Virtual-Ocean-Data-System-1064">National Virtual Ocean Data System</a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-_0040code_007bNC_005fBYTE_007d-913"><code>NC_BYTE</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bNC_005fBYTE_007d-776"><code>NC_BYTE</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007bNC_005fBYTE_007d-411"><code>NC_BYTE</code></a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-_0040code_007bNC_005fCHAR_007d-912"><code>NC_CHAR</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bNC_005fCHAR_007d-777"><code>NC_CHAR</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007bNC_005fCHAR_007d-412"><code>NC_CHAR</code></a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-_0040code_007bNC_005fDOUBLE_007d-908"><code>NC_DOUBLE</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bNC_005fDOUBLE_007d-670"><code>NC_DOUBLE</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bNC_005fFLOAT_007d-909"><code>NC_FLOAT</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bNC_005fINT_007d-910"><code>NC_INT</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bNC_005fSHORT_007d-911"><code>NC_SHORT</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-ncadd-737"><code>ncadd</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040command_007bncap_007d-886"><span class="command">ncap</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-ncap-548"><code>ncap</code></a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-_0040command_007bncap_007d-496"><span class="command">ncap</span></a>: <a href="#Manual-type-conversion">Manual type conversion</a></li>
<li><a href="#index-_0040command_007bncap_007d-220"><span class="command">ncap</span></a>: <a href="#Memory-Usage-of-ncap">Memory Usage of ncap</a></li>
<li><a href="#index-_0040acronym_007bNCAR_007d-135"><acronym>NCAR</acronym></a>: <a href="#Climate-model-paradigm">Climate model paradigm</a></li>
<li><a href="#index-_0040acronym_007bNCAR-CCSM_007d-conventions-778"><acronym>NCAR CCSM</acronym> conventions</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040acronym_007bNCAR-CCSM_007d-conventions-523"><acronym>NCAR CCSM</acronym> conventions</a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-_0040acronym_007bNCAR-MSS_007d-315"><acronym>NCAR MSS</acronym></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-ncatted-692"><code>ncatted</code></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040command_007bncatted_007d-514"><span class="command">ncatted</span></a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-_0040command_007bncatted_007d-455"><span class="command">ncatted</span></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-ncbo-735"><code>ncbo</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040command_007bncbo_007d-464"><span class="command">ncbo</span></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-ncdiff-736"><code>ncdiff</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-ncdivide-742"><code>ncdivide</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040command_007bncdump_007d-845"><span class="command">ncdump</span></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-ncea-785"><code>ncea</code></a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-_0040command_007bncea_007d-461"><span class="command">ncea</span></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040command_007bncea_007d-165"><span class="command">ncea</span></a>: <a href="#Averaging">Averaging</a></li>
<li><a href="#index-ncecat-793"><code>ncecat</code></a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-ncecat-677"><code>ncecat</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040command_007bncecat_007d-160"><span class="command">ncecat</span></a>: <a href="#Concatenation">Concatenation</a></li>
<li><a href="#index-_0040command_007bncextr_007d-820"><span class="command">ncextr</span></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-ncflint-805"><code>ncflint</code></a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040command_007bncflint_007d-465"><span class="command">ncflint</span></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040command_007bncflint_007d-168"><span class="command">ncflint</span></a>: <a href="#Interpolating">Interpolating</a></li>
<li><a href="#index-ncks-819"><code>ncks</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-ncks-684"><code>ncks</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040acronym_007bNCL_007d-129"><acronym>NCL</acronym></a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-ncmult-740"><code>ncmult</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-ncmultiply-741"><code>ncmultiply</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040acronym_007bNCO_007d-availability-7"><acronym>NCO</acronym> availability</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040acronym_007bNCO_007d-homepage-17"><acronym>NCO</acronym> homepage</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040file_007bnco_002econfig_002elog_002e_0024_0040_007bGNU_005fTRP_0040_007d_002efoo_007d-122"><span class="file">nco.config.log.${GNU_TRP}.foo</span></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040file_007bnco_002econfigure_002e_0024_0040_007bGNU_005fTRP_0040_007d_002efoo_007d-121"><span class="file">nco.configure.${GNU_TRP}.foo</span></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040file_007bnco_002emake_002e_0024_0040_007bGNU_005fTRP_0040_007d_002efoo_007d-123"><span class="file">nco.make.${GNU_TRP}.foo</span></a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-_0040code_007bnco_005finput_005ffile_005flist_007d-515"><code>nco_input_file_list</code></a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-_0040code_007bnco_005finput_005ffile_005flist_007d-176"><code>nco_input_file_list</code></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040code_007bnco_005finput_005ffile_005fnumber_007d-516"><code>nco_input_file_number</code></a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-_0040code_007bnco_005finput_005ffile_005fnumber_007d-175"><code>nco_input_file_number</code></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040code_007bnco_005fopenmp_005fthread_005fnumber_007d-247"><code>nco_openmp_thread_number</code></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-ncpack-875"><code>ncpack</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-ncpdq-874"><code>ncpdq</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040command_007bncpdq_007d-256"><span class="command">ncpdq</span></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040command_007bncpdq_007d-164"><span class="command">ncpdq</span></a>: <a href="#Concatenation">Concatenation</a></li>
<li><a href="#index-ncra-936"><code>ncra</code></a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-ncra-686"><code>ncra</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040command_007bncra_007d-462"><span class="command">ncra</span></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040command_007bncra_007d-166"><span class="command">ncra</span></a>: <a href="#Averaging">Averaging</a></li>
<li><a href="#index-ncrcat-952"><code>ncrcat</code></a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-_0040command_007bncrcat_007d-254"><span class="command">ncrcat</span></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040command_007bncrcat_007d-161"><span class="command">ncrcat</span></a>: <a href="#Concatenation">Concatenation</a></li>
<li><a href="#index-ncrename-972"><code>ncrename</code></a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-_0040acronym_007bNCSA_007d-101"><acronym>NCSA</acronym></a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-ncsub-738"><code>ncsub</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-ncsubtract-739"><code>ncsubtract</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-ncunpack-876"><code>ncunpack</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-ncwa-991"><code>ncwa</code></a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-ncwa-678"><code>ncwa</code></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040command_007bncwa_007d-463"><span class="command">ncwa</span></a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-_0040command_007bncwa_007d-255"><span class="command">ncwa</span></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-_0040command_007bncwa_007d-167"><span class="command">ncwa</span></a>: <a href="#Averaging">Averaging</a></li>
<li><a href="#index-_0040var_007bnearbyint_007d-623"><var>nearbyint</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-nearest-integer-function-_0028exact_0029-635">nearest integer function (exact)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-nearest-integer-function-_0028inexact_0029-634">nearest integer function (inexact)</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040acronym_007bNEC_007d-21"><acronym>NEC</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-nesting-572">nesting</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-netCDF-18">netCDF</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-netCDF-2_002ex-92">netCDF 2.x</a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-netCDF-3_002ex-93">netCDF 3.x</a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-_0040code_007bNETCDF2_005fONLY_007d-98"><code>NETCDF2_ONLY</code></a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-_0040code_007bNINTAP_007d-961"><code>NINTAP</code></a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-_0040code_007bNINTAP_007d-945"><code>NINTAP</code></a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-_0040code_007bNINTAP_007d-286"><code>NINTAP</code></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007bNO_005fNETCDF_005f2_007d-94"><code>NO_NETCDF_2</code></a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-normalization-1014">normalization</a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-_0040acronym_007bNRA_007d-1058"><acronym>NRA</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040command_007bnrnet_007d-330"><span class="command">nrnet</span></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040acronym_007bNSF_007d-1043"><acronym>NSF</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-NT-_0028Microsoft-operating-system_0029-66">NT (Microsoft operating system)</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040code_007bNUL_007d-916"><code>NUL</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-NUL-730">NUL</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-NUL_002dtermination-729">NUL-termination</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-null-operation-813">null operation</a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040code_007bnumerator_007d-1016"><code>numerator</code></a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-_0040acronym_007bNVODS_007d-1063"><acronym>NVODS</acronym></a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-_0040samp_007bnxt_005flsr_007d-907"><span class="samp">nxt_lsr</span></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-oceanography-340">oceanography</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-octal-dump-266">octal dump</a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-_0040command_007bod_007d-265"><span class="command">od</span></a>: <a href="#Large-File-Support">Large File Support</a></li>
<li><a href="#index-_0040code_007bOMP_005fNUM_005fTHREADS_007d-253"><code>OMP_NUM_THREADS</code></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-on_002dline-documentation-11">on-line documentation</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-open-source-1065">open source</a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-open-source-3">open source</a>: <a href="#Foreword">Foreword</a></li>
<li><a href="#index-Open_002dsource-Project-for-a-Network-Data-Access-Protocol-342">Open-source Project for a Network Data Access Protocol</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-_0040acronym_007bOPeNDAP_007d_002e-343"><acronym>OPeNDAP</acronym>.</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-OpenMP-242">OpenMP</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-OpenMP-217">OpenMP</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-operation-types-466">operation types</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-operator-speed-977">operator speed</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-operator-speed-457">operator speed</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-operator-speed-228">operator speed</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-operator-speed-142">operator speed</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-operator-speed-89">operator speed</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-operators-4">operators</a>: <a href="#Summary">Summary</a></li>
<li><a href="#index-OptIPuter-1055">OptIPuter</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040code_007bORO_007d-1020"><code>ORO</code></a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-_0040code_007bORO_007d-527"><code>ORO</code></a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-_0040acronym_007bOS_007d-19"><acronym>OS</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-output-file-300">output file</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-output-file-186">output file</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040var_007boutput_002dpath_007d-334"><var>output-path</var></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-overwriting-files-497">overwriting files</a>: <a href="#Suppressing-interactive-prompts">Suppressing interactive prompts</a></li>
<li><a href="#index-overwriting-files-151">overwriting files</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040command_007bpack_0028x_0029_007d-581"><span class="command">pack(x)</span></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-packing-882">packing</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-packing-576">packing</a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-packing-347">packing</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-packing-map-898">packing map</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-packing-policy-887">packing policy</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-parallelism-1056">parallelism</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-parallelism-246">parallelism</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-parser-545">parser</a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-pasting-variables-156">pasting variables</a>: <a href="#Appending">Appending</a></li>
<li><a href="#index-pattern-matching-370">pattern matching</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-pattern-matching-182">pattern matching</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-PayPal-1025">PayPal</a>: <a href="#Contributing">Contributing</a></li>
<li><a href="#index-_0040var_007bpck_005fmap_007d-899"><var>pck_map</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040var_007bpck_005fplc_007d-888"><var>pck_plc</var></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-peak-memory-usage-215">peak memory usage</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-performance-976">performance</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-performance-456">performance</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-performance-227">performance</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-performance-141">performance</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-performance-88">performance</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-Perl-706">Perl</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-Perl-190">Perl</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-Perl-131">Perl</a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-permute-dimensions-878">permute dimensions</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-philosophy-127">philosophy</a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-pipes-185">pipes</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-portability-35">portability</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-positional-arguments-302">positional arguments</a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-_0040acronym_007bPOSIX_007d-374"><acronym>POSIX</acronym></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-_0040acronym_007bPOSIX_007d-271"><acronym>POSIX</acronym></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040var_007bpow_007d-624"><var>pow</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-power-597">power</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-power-function-657">power function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-precision-665">precision</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-preprocessor-tokens-67">preprocessor tokens</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040code_007bprintf_007d-55"><code>printf</code></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040code_007bprintf_0028_0029_007d-861"><code>printf()</code></a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-_0040code_007bprintf_0028_0029_007d-708"><code>printf()</code></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-printing-files-contents-817">printing files contents</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-printing-variables-818">printing variables</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-Processor-962">Processor</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-Processor-946">Processor</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-Processor_002c-_0040acronym_007bCCM_007d-287">Processor, <acronym>CCM</acronym></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-promotion-661">promotion</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-promotion-584">promotion</a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-promotion-489">promotion</a>: <a href="#Type-conversion">Type conversion</a></li>
<li><a href="#index-proposals-1042">proposals</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-quadruple-precision-666">quadruple precision</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-quiet-856">quiet</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-quotes-927">quotes</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-quotes-767">quotes</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-quotes-389">quotes</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-RAM-213">RAM</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-rank-1003">rank</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-rank-773">rank</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-_0040code_007brcp_007d-312"><code>rcp</code></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007brcp_007d-80"><code>rcp</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040acronym_007bRCS_007d-539"><acronym>RCS</acronym></a>: <a href="#Operator-version">Operator version</a></li>
<li><a href="#index-re_002ddimension-881">re-dimension</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-re_002dorder-dimensions-880">re-order dimensions</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-record-average-933">record average</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-record-concatenation-951">record concatenation</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-record-dimension-953">record dimension</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-record-dimension-934">record dimension</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-record-dimension-917">record dimension</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-record-dimension-794">record dimension</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-record-dimension-787">record dimension</a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-record-dimension-404">record dimension</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-record-variable-920">record variable</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-record-variable-403">record variable</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-_0040code_007bregex_007d-375"><code>regex</code></a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-regressions-archive-126">regressions archive</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-regular-expressions-369">regular expressions</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-regular-expressions-284">regular expressions</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-regular-expressions-181">regular expressions</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-remote-files-320">remote files</a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-remote-files-83">remote files</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-renaming-attributes-968">renaming attributes</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-renaming-dimensions-967">renaming dimensions</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-renaming-variables-966">renaming variables</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-reporting-bugs-102">reporting bugs</a>: <a href="#Help-and-Bug-reports">Help and Bug reports</a></li>
<li><a href="#index-reshape-variables-877">reshape variables</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007brestrict_007d-60"><code>restrict</code></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-reverse-data-929">reverse data</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-reverse-dimensions-879">reverse dimensions</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040var_007brint_007d-625"><var>rint</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007brms_007d-473"><code>rms</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040code_007brmssdn_007d-472"><code>rmssdn</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-root_002dmean_002dsquare-481">root-mean-square</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-Rorik-Peterson-1030">Rorik Peterson</a>: <a href="#Contributors">Contributors</a></li>
<li><a href="#index-_0040var_007bround_007d-626"><var>round</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-rounding-functions-636">rounding functions</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-running-average-935">running average</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-safeguards-974">safeguards</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-safeguards-139">safeguards</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040code_007bscale_005ffactor_007d-885"><code>scale_factor</code></a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-_0040code_007bscale_005ffactor_007d-579"><code>scale_factor</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-_0040var_007bscale_005fformat_007d-235"><var>scale_format</var></a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-Scientific-Data-Operators-1046">Scientific Data Operators</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040code_007bscp_007d-313"><code>scp</code></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007bscp_007d-81"><code>scp</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-script-file-549">script file</a>: <a href="#ncap-netCDF-Arithmetic-Processor">ncap netCDF Arithmetic Processor</a></li>
<li><a href="#index-_0040acronym_007bSDO_007d-1053"><acronym>SDO</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bSEIII_007d-1054"><acronym>SEIII</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-semi_002dcolon-566">semi-colon</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-server-359">server</a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-server-344">server</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-server-197">server</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-Server_002dSide-Distributed-Data-Reduction-_0026-Analysis-1048">Server-Side Distributed Data Reduction &amp; Analysis</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-server_002dside-processing-1067">server-side processing</a>: <a href="#Footnotes">Footnotes</a></li>
<li><a href="#index-server_002dside-processing-1044">server-side processing</a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bSGI_007d-22"><acronym>SGI</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-shared-memory-machines-218">shared memory machines</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-shared-memory-parallelism-245">shared memory parallelism</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-shell-766">shell</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-shell-433">shell</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-shell-386">shell</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-shell-179">shell</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040code_007bshort_0028x_0029_007d-591"><code>short(x)</code></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-_0040var_007bsignedness_007d-234"><var>signedness</var></a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-_0040var_007bsin_007d-628"><var>sin</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-sine-function-658">sine function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-single-precision-667">single precision</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007bsinh_007d-627"><var>sinh</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040acronym_007bSMP_007d-244"><acronym>SMP</acronym></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-sort-alphabetically-828">sort alphabetically</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-source-code-8">source code</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-special-characters-726">special characters</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-speed-978">speed</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-speed-458">speed</a>: <a href="#Missing-values">Missing values</a></li>
<li><a href="#index-speed-229">speed</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-speed-204">speed</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-speed-143">speed</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-speed-90">speed</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-_0040code_007bsqravg_007d-468"><code>sqravg</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-_0040var_007bsqrt_007d-629"><var>sqrt</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007bsqrt_007d-475"><code>sqrt</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-square-root-function-659">square root function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040acronym_007bSSDDRA_007d-1049"><acronym>SSDDRA</acronym></a>: <a href="#Proposals-for-Institutional-Funding">Proposals for Institutional Funding</a></li>
<li><a href="#index-_0040acronym_007bSSH_007d-357"><acronym>SSH</acronym></a>: <a href="#File-retention">File retention</a></li>
<li><a href="#index-_0040acronym_007bSSH_007d-82"><acronym>SSH</acronym></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-standard-deviation-482">standard deviation</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-standard-input-955">standard input</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-standard-input-940">standard input</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-standard-input-796">standard input</a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-standard-input-789">standard input</a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-standard-input-173">standard input</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-statement-558">statement</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-static-linking-87">static linking</a>: <a href="#Libraries">Libraries</a></li>
<li><a href="#index-_0040code_007bstdin_007d-956"><code>stdin</code></a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-_0040code_007bstdin_007d-941"><code>stdin</code></a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-_0040code_007bstdin_007d-797"><code>stdin</code></a>: <a href="#ncecat-netCDF-Ensemble-Concatenator">ncecat netCDF Ensemble Concatenator</a></li>
<li><a href="#index-_0040code_007bstdin_007d-790"><code>stdin</code></a>: <a href="#ncea-netCDF-Ensemble-Averager">ncea netCDF Ensemble Averager</a></li>
<li><a href="#index-_0040code_007bstdin_007d-517"><code>stdin</code></a>: <a href="#Input-file-list-attributes">Input file list attributes</a></li>
<li><a href="#index-_0040code_007bstdin_007d-174"><code>stdin</code></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-stride-958">stride</a>: <a href="#ncrcat-netCDF-Record-Concatenator">ncrcat netCDF Record Concatenator</a></li>
<li><a href="#index-stride-943">stride</a>: <a href="#ncra-netCDF-Record-Averager">ncra netCDF Record Averager</a></li>
<li><a href="#index-stride-838">stride</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-stride-443">stride</a>: <a href="#Stride">Stride</a></li>
<li><a href="#index-stride-431">stride</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-strings-728">strings</a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-stub-335">stub</a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-_0040code_007bsubtract_007d-752"><code>subtract</code></a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-subtracting-data-748">subtracting data</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-subtraction-745">subtraction</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-subtraction-593">subtraction</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-summary-5">summary</a>: <a href="#Summary">Summary</a></li>
<li><a href="#index-Sun-27">Sun</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-swap-space-214">swap space</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-swap-space-196">swap space</a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-switches-274">switches</a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-symbolic-links-897">symbolic links</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-symbolic-links-770">symbolic links</a>: <a href="#ncbo-netCDF-Binary-Operator">ncbo netCDF Binary Operator</a></li>
<li><a href="#index-symbolic-links-189">symbolic links</a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-symbolic-links-159">symbolic links</a>: <a href="#Averaging-vs_002e-Concatenating">Averaging vs. Concatenating</a></li>
<li><a href="#index-synchronous-file-access-321">synchronous file access</a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-syntax-559">syntax</a>: <a href="#Syntax-of-ncap-statements">Syntax of ncap statements</a></li>
<li><a href="#index-_0040var_007btan_007d-631"><var>tan</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040var_007btanh_007d-630"><var>tanh</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-temporary-output-files-975">temporary output files</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-temporary-output-files-140">temporary output files</a>: <a href="#Output-files">Output files</a></li>
<li><a href="#index-_0040TeX_007b_007dinfo-13">TeXinfo</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040var_007bthr_005fnbr_007d-252"><var>thr_nbr</var></a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-threads-243">threads</a>: <a href="#OpenMP-threading">OpenMP threading</a></li>
<li><a href="#index-threads-216">threads</a>: <a href="#Memory-usage">Memory usage</a></li>
<li><a href="#index-_0040code_007btime_007d-534"><code>time</code></a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-_0040code_007btime_007d-530"><code>time</code></a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-_0040code_007btime_007d-430"><code>time</code></a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-time_002daveraging-683">time-averaging</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-_0040code_007btime_005foffset_007d-532"><code>time_offset</code></a>: <a href="#ARM-Conventions">ARM Conventions</a></li>
<li><a href="#index-timestamp-508">timestamp</a>: <a href="#History-attribute">History attribute</a></li>
<li><a href="#index-total-478">total</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-transpose-921">transpose</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-transpose-402">transpose</a>: <a href="#Fortran-indexing">Fortran indexing</a></li>
<li><a href="#index-_0040var_007btrunc_007d-632"><var>trunc</var></a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-truncation-function-637">truncation function</a>: <a href="#Intrinsic-mathematical-functions">Intrinsic mathematical functions</a></li>
<li><a href="#index-truth-condition-1023">truth condition</a>: <a href="#Normalization">Normalization</a></li>
<li><a href="#index-truth-condition-1007">truth condition</a>: <a href="#Mask-condition">Mask condition</a></li>
<li><a href="#index-_0040code_007bttl_007d-474"><code>ttl</code></a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-type-conversion-583">type conversion</a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-type-conversion-488">type conversion</a>: <a href="#Type-conversion">Type conversion</a></li>
<li><a href="#index-UDUnits-525">UDUnits</a>: <a href="#NCAR-CCSM-Conventions">NCAR CCSM Conventions</a></li>
<li><a href="#index-UDUnits-419">UDUnits</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-UDUnits-39">UDUnits</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040code_007bulimit_007d-202"><code>ulimit</code></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-unary-operations-222">unary operations</a>: <a href="#Memory-Usage-of-ncap">Memory Usage of ncap</a></li>
<li><a href="#index-_0040acronym_007bUNICOS_007d-198"><acronym>UNICOS</acronym></a>: <a href="#Large-Datasets-and-Memory">Large Datasets and Memory</a></li>
<li><a href="#index-Unidata-420">Unidata</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-Unidata-100">Unidata</a>: <a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">netCDF 2.x vs. 3.x and HDF Support</a></li>
<li><a href="#index-Unidata-38">Unidata</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-union-of-two-files-157">union of two files</a>: <a href="#Appending">Appending</a></li>
<li><a href="#index-_0040code_007bunits_007d-815"><code>units</code></a>: <a href="#ncflint-netCDF-File-Interpolator">ncflint netCDF File Interpolator</a></li>
<li><a href="#index-_0040code_007bunits_007d-734"><code>units</code></a>: <a href="#ncatted-netCDF-Attribute-Editor">ncatted netCDF Attribute Editor</a></li>
<li><a href="#index-_0040code_007bunits_007d-421"><code>units</code></a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-_0040acronym_007bUNIX_007d-295"><acronym>UNIX</acronym></a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040acronym_007bUNIX_007d-272"><acronym>UNIX</acronym></a>: <a href="#Command-line-options">Command line options</a></li>
<li><a href="#index-_0040acronym_007bUNIX_007d-184"><acronym>UNIX</acronym></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040acronym_007bUNIX_007d-74"><acronym>UNIX</acronym></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-_0040acronym_007bUNIX_007d-37"><acronym>UNIX</acronym></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040command_007bunpack_0028x_0029_007d-582"><span class="command">unpack(x)</span></a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-unpacking-883">unpacking</a>: <a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">ncpdq netCDF Permute Dimensions Quickly</a></li>
<li><a href="#index-unpacking-577">unpacking</a>: <a href="#Intrinsic-functions">Intrinsic functions</a></li>
<li><a href="#index-unpacking-348">unpacking</a>: <a href="#OPeNDAP">OPeNDAP</a></li>
<li><a href="#index-_0040acronym_007bURL_007d-318"><acronym>URL</acronym></a>: <a href="#Remote-storage">Remote storage</a></li>
<li><a href="#index-variable-names-969">variable names</a>: <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a></li>
<li><a href="#index-variance-483">variance</a>: <a href="#Operation-Types">Operation Types</a></li>
<li><a href="#index-version-538">version</a>: <a href="#Operator-version">Operator version</a></li>
<li><a href="#index-weighted-average-988">weighted average</a>: <a href="#ncwa-netCDF-Weighted-Averager">ncwa netCDF Weighted Averager</a></li>
<li><a href="#index-whitespace-432">whitespace</a>: <a href="#UDUnits-Support">UDUnits Support</a></li>
<li><a href="#index-wildcards-371">wildcards</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
<li><a href="#index-wildcards-285">wildcards</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-_0040code_007bWIN32_007d-70"><code>WIN32</code></a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-Windows-63">Windows</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-Windows-33">Windows</a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-wrapped-coordinates-873">wrapped coordinates</a>: <a href="#ncks-netCDF-Kitchen-Sink">ncks netCDF Kitchen Sink</a></li>
<li><a href="#index-wrapped-coordinates-438">wrapped coordinates</a>: <a href="#Wrapped-coordinates">Wrapped coordinates</a></li>
<li><a href="#index-wrapped-coordinates-413">wrapped coordinates</a>: <a href="#Hyperslabs">Hyperslabs</a></li>
<li><a href="#index-wrapped-filenames-298">wrapped filenames</a>: <a href="#Specifying-input-files">Specifying input files</a></li>
<li><a href="#index-WWW-documentation-10">WWW documentation</a>: <a href="#Availability">Availability</a></li>
<li><a href="#index-_0040command_007bxargs_007d-308"><span class="command">xargs</span></a>: <a href="#Specifying-output-files">Specifying output files</a></li>
<li><a href="#index-_0040command_007bxargs_007d-183"><span class="command">xargs</span></a>: <a href="#Large-numbers-of-input-files">Large numbers of input files</a></li>
<li><a href="#index-_0040command_007bxlc_007d-48"><span class="command">xlc</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-_0040command_007bxlC_007d-47"><span class="command">xlC</span></a>: <a href="#Compatability">Compatability</a></li>
<li><a href="#index-XP-_0028Microsoft-operating-system_0029-65">XP (Microsoft operating system)</a>: <a href="#Windows-Operating-System">Windows Operating System</a></li>
<li><a href="#index-Yorick-237">Yorick</a>: <a href="#Operator-limitations">Operator limitations</a></li>
<li><a href="#index-Yorick-132">Yorick</a>: <a href="#Philosophy">Philosophy</a></li>
<li><a href="#index-_0040code_007b_007c_007d-_0028wildcard-character_0029-384"><code>|</code> (wildcard character)</a>: <a href="#Variable-subsetting">Variable subsetting</a></li>
   </ul><!-- Print table of contents -->

<div class="contents">
<h2>Table of Contents</h2>
<ul>
<li><a name="toc_Top" href="#Top">NCO User's Guide</a>
<li><a name="toc_Foreword" href="#Foreword">Foreword</a>
<li><a name="toc_Summary" href="#Summary">Summary</a>
<li><a name="toc_Introduction" href="#Introduction">1 Introduction</a>
<ul>
<li><a href="#Availability">1.1 Availability</a>
<li><a href="#Compatability">1.2 Operating systems compatible with <acronym>NCO</acronym></a>
<ul>
<li><a href="#Windows-Operating-System">1.2.1 Compiling <acronym>NCO</acronym> for Microsoft Windows <acronym>OS</acronym></a>
</li></ul>
<li><a href="#Libraries">1.3 Libraries</a>
<li><a href="#netCDF-2_002ex-vs_002e-3_002ex-and-HDF-Support">1.4 netCDF 2.x vs. 3.x and HDF Support</a>
<li><a href="#Help-and-Bug-reports">1.5 Help and Bug reports</a>
</li></ul>
<li><a name="toc_Strategies" href="#Strategies">2 Operator Strategies</a>
<ul>
<li><a href="#Philosophy">2.1 <acronym>NCO</acronym> operator philosophy</a>
<li><a href="#Climate-model-paradigm">2.2 Climate model paradigm</a>
<li><a href="#Output-files">2.3 Temporary output files</a>
<li><a href="#Appending">2.4 Appending variables to a file</a>
<li><a href="#Addition-Subtraction-Division-Multiplication-and-Interpolation">2.5 Addition Subtraction Division Multiplication and Interpolation</a>
<li><a href="#Averaging-vs_002e-Concatenating">2.6 Averagers vs. Concatenators</a>
<ul>
<li><a href="#Concatenation">2.6.1 Concatenators <span class="command">ncrcat</span> and <span class="command">ncecat</span></a>
<li><a href="#Averaging">2.6.2 Averagers <span class="command">ncea</span>, <span class="command">ncra</span>, and <span class="command">ncwa</span></a>
<li><a href="#Interpolating">2.6.3 Interpolator <span class="command">ncflint</span></a>
</li></ul>
<li><a href="#Large-numbers-of-input-files">2.7 Working with large numbers of input files</a>
<li><a href="#Large-Datasets-and-Memory">2.8 Working with large datasets</a>
<li><a href="#Memory-usage">2.9 Approximate <acronym>NCO</acronym> memory requirements</a>
<ul>
<li><a href="#Memory-Usage-of-Single-and-Multi_002dfile-Operators">2.9.1 Memory Usage of Single and Multi-file Operators</a>
<li><a href="#Memory-Usage-of-ncap">2.9.2 Memory Usage of <span class="command">ncap</span></a>
</li></ul>
<li><a href="#Operator-limitations">2.10 Performance limitations of the operators</a>
</li></ul>
<li><a name="toc_Common-features" href="#Common-features">3 Features common to most operators</a>
<ul>
<li><a href="#Internationalization">3.1 Internationalization</a>
<li><a href="#OpenMP-threading">3.2 OpenMP threading</a>
<li><a href="#Large-File-Support">3.3 Large File Support</a>
<li><a href="#Command-line-options">3.4 Command line options</a>
<li><a href="#Specifying-input-files">3.5 Specifying input files</a>
<li><a href="#Specifying-output-files">3.6 Specifying output files</a>
<li><a href="#Remote-storage">3.7 Accessing files stored remotely</a>
<ul>
<li><a href="#OPeNDAP">3.7.1 <acronym>OPeNDAP</acronym></a>
</li></ul>
<li><a href="#File-retention">3.8 Retention of remotely retrieved files</a>
<li><a href="#Variable-subsetting">3.9 Including/Excluding specific variables</a>
<li><a href="#Coordinate-variables">3.10 Including/Excluding coordinate variables</a>
<li><a href="#Fortran-indexing">3.11 C &amp; Fortran index conventions</a>
<li><a href="#Hyperslabs">3.12 Hyperslabs</a>
<li><a href="#Multislabs">3.13 Multislabs</a>
<li><a href="#UDUnits-Support">3.14 UDUnits Support</a>
<li><a href="#Wrapped-coordinates">3.15 Wrapped coordinates</a>
<li><a href="#Stride">3.16 Stride</a>
<li><a href="#Missing-values">3.17 Missing values</a>
<li><a href="#Operation-Types">3.18 Operation Types</a>
<li><a href="#Type-conversion">3.19 Type conversion</a>
<ul>
<li><a href="#Automatic-type-conversion">3.19.1 Automatic type conversion</a>
<li><a href="#Manual-type-conversion">3.19.2 Manual type conversion</a>
</li></ul>
<li><a href="#Suppressing-interactive-prompts">3.20 Suppressing interactive prompts</a>
<li><a href="#History-attribute">3.21 History attribute</a>
<li><a href="#Input-file-list-attributes">3.22 Input file list attributes</a>
<li><a href="#NCAR-CCSM-Conventions">3.23 <acronym>NCAR CCSM</acronym> Conventions</a>
<li><a href="#ARM-Conventions">3.24 <acronym>ARM</acronym> Conventions</a>
<li><a href="#Operator-version">3.25 Operator version</a>
</li></ul>
<li><a name="toc_Operator-Reference-Manual" href="#Operator-Reference-Manual">4 Reference manual for all operators</a>
<ul>
<li><a href="#ncap-netCDF-Arithmetic-Processor">4.1 <span class="command">ncap</span> netCDF Arithmetic Processor</a>
<ul>
<li><a href="#Left-hand-casting">4.1.1 Left hand casting</a>
<li><a href="#Syntax-of-ncap-statements">4.1.2 Syntax of <span class="command">ncap</span> statements</a>
<li><a href="#Intrinsic-functions">4.1.3 Intrinsic functions</a>
<li><a href="#Intrinsic-functions">Packing and Unpacking Algorithms</a>
<li><a href="#Intrinsic-functions">Type Conversion Functions</a>
<li><a href="#Intrinsic-mathematical-functions">4.1.4 Intrinsic mathematical functions</a>
</li></ul>
<li><a href="#ncatted-netCDF-Attribute-Editor">4.2 <span class="command">ncatted</span> netCDF Attribute Editor</a>
<li><a href="#ncbo-netCDF-Binary-Operator">4.3 <span class="command">ncbo</span> netCDF Binary Operator</a>
<li><a href="#ncea-netCDF-Ensemble-Averager">4.4 <span class="command">ncea</span> netCDF Ensemble Averager</a>
<li><a href="#ncecat-netCDF-Ensemble-Concatenator">4.5 <span class="command">ncecat</span> netCDF Ensemble Concatenator</a>
<li><a href="#ncflint-netCDF-File-Interpolator">4.6 <span class="command">ncflint</span> netCDF File Interpolator</a>
<li><a href="#ncks-netCDF-Kitchen-Sink">4.7 <span class="command">ncks</span> netCDF Kitchen Sink</a>
<ul>
<li><a href="#ncks-netCDF-Kitchen-Sink">Options specific to <span class="command">ncks</span></a>
</li></ul>
<li><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">4.8 <span class="command">ncpdq</span> netCDF Permute Dimensions Quickly</a>
<ul>
<li><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">Packing and Unpacking Functions</a>
<li><a href="#ncpdq-netCDF-Permute-Dimensions-Quickly">Dimension Permutation</a>
</li></ul>
<li><a href="#ncra-netCDF-Record-Averager">4.9 <span class="command">ncra</span> netCDF Record Averager</a>
<li><a href="#ncrcat-netCDF-Record-Concatenator">4.10 <span class="command">ncrcat</span> netCDF Record Concatenator</a>
<li><a href="#ncrename-netCDF-Renamer">4.11 <span class="command">ncrename</span> netCDF Renamer</a>
<li><a href="#ncwa-netCDF-Weighted-Averager">4.12 <span class="command">ncwa</span> netCDF Weighted Averager</a>
<ul>
<li><a href="#Mask-condition">4.12.1 Mask condition</a>
<li><a href="#Normalization">4.12.2 Normalization</a>
</li></ul>
</li></ul>
<li><a name="toc_Contributing" href="#Contributing">5 Contributing</a>
<ul>
<li><a href="#Contributors">5.1 Contributors</a>
<li><a href="#Proposals-for-Institutional-Funding">5.2 Proposals for Institutional Funding</a>
</li></ul>
<li><a name="toc_General-Index" href="#General-Index">General Index</a>
</li></ul>
</div>

<!-- TTFN (Ta ta for now) -->
<div class="footnote">
<hr>
<a name="texinfo-footnotes-in-document"></a><h4>Footnotes</h4><p class="footnote"><small>[<a name="fn-1" href="#fnd-1">1</a>]</small> 
To produce these formats, <span class="file">nco.texi</span> was simply run through the
freely available programs <code>texi2dvi</code>, <code>dvips</code>,
<code>texi2html</code>, and <code>makeinfo</code>. 
Due to a bug in TeX, the resulting Postscript file, <span class="file">nco.ps</span>,
contains the Table of Contents as the final pages. 
Thus if you print <span class="file">nco.ps</span>, remember to insert the Table of
Contents after the cover sheet before you staple the manual. 
</p>

   <p class="footnote"><small>[<a name="fn-2" href="#fnd-2">2</a>]</small> 
The <span class="samp">_BSD_SOURCE</span> token is required on some Linux platforms where
<span class="command">gcc</span> dislikes the network header files like
<span class="file">netinet/in.h</span>).</p>

   <p class="footnote"><small>[<a name="fn-3" href="#fnd-3">3</a>]</small> <acronym>NCO</acronym> may still build with an
<acronym>ANSI</acronym> or <acronym>ISO</acronym> C89 or C94/95-compliant compiler if the
C&nbsp;pre-processor<!-- /@w --> undefines the <code>restrict</code> type qualifier, e.g.,
by invoking the compiler with <span class="samp">-Drestrict=''</span>.</p>

   <p class="footnote"><small>[<a name="fn-4" href="#fnd-4">4</a>]</small> The Cygwin package is available from<br>
<code>http://sourceware.redhat.com/cygwin</code><br>
<a name="index-_0040code_007bgcc_007d-1060"></a><a name="index-_0040code_007bg_002b_002b_007d-1061"></a><a name="index-_0040code_007bg77_007d-1062"></a>Currently, Cygwin&nbsp;20.x<!-- /@w --> comes with the <acronym>GNU</acronym> C/C++/Fortran
compilers (<span class="command">gcc</span>, <span class="command">g++</span>, <span class="command">g77</span>). 
These <acronym>GNU</acronym> compilers may be used to build the netCDF
distribution itself.</p>

   <p class="footnote"><small>[<a name="fn-5" href="#fnd-5">5</a>]</small> The <span class="command">ldd</span> command, if it is available on your system,
will tell you where the executable is looking for each dynamically
loaded library. Use, e.g., <code>ldd `which ncea`</code>.</p>

   <p class="footnote"><small>[<a name="fn-6" href="#fnd-6">6</a>]</small> The Hierarchical Data Format, or <acronym>HDF</acronym>, is another
self-describing data format similar to, but more elaborate than,
netCDF.</p>

   <p class="footnote"><small>[<a name="fn-7" href="#fnd-7">7</a>]</small> One must link the <acronym>NCO</acronym> code to the <acronym>HDF4</acronym>
<acronym>MFHDF</acronym> library instead of the usual netCDF library. 
Does <span class="samp">MF</span> stands for Mike Folk? 
Perhaps. 
In any case, the <acronym>MFHDF</acronym> library only supports netCDF&nbsp;2.x<!-- /@w -->
calls. 
Thus I will try to keep this capability in <acronym>NCO</acronym> as long as it
is not too much trouble.</p>

   <p class="footnote"><small>[<a name="fn-8" href="#fnd-8">8</a>]</small> The <span class="command">ncrename</span> operator is an exception to this rule. 
See <a href="#ncrename-netCDF-Renamer">ncrename netCDF Renamer</a>.</p>

   <p class="footnote"><small>[<a name="fn-9" href="#fnd-9">9</a>]</small> The terminology <dfn>merging</dfn> is
reserved for an (unwritten) operator which replaces hyperslabs of a
variable in one file with hyperslabs of the same variable from another
file</p>

   <p class="footnote"><small>[<a name="fn-10" href="#fnd-10">10</a>]</small> Yes, the terminology is confusing. 
By all means mail me if you think of a better nomenclature. 
Should <acronym>NCO</acronym> use <dfn>paste</dfn> instead of <dfn>append</dfn>? 
</p>

   <p class="footnote"><small>[<a name="fn-11" href="#fnd-11">11</a>]</small> Currently
<span class="command">ncea</span> and <span class="command">ncrcat</span> are symbolically linked to the
<span class="command">ncra</span> executable, which behaves slightly differently based on
its invocation name (i.e., <span class="samp">argv[0]</span>). 
These three operators share the same source code, but merely have
different inner loops.</p>

   <p class="footnote"><small>[<a name="fn-12" href="#fnd-12">12</a>]</small> The third averaging operator, <span class="command">ncwa</span>, is the most
sophisticated averager in <acronym>NCO</acronym>. 
However, <span class="command">ncwa</span> is in a different class than <span class="command">ncra</span> and
<span class="command">ncea</span> because it can only operate on a single file per
invocation (as opposed to multiple files). 
On that single file, however, <span class="command">ncwa</span> provides a richer set of
averaging options&mdash;including weighting, masking, and broadcasting.</p>

   <p class="footnote"><small>[<a name="fn-13" href="#fnd-13">13</a>]</small> The exact length which exceeds the operating system internal
limit for command line lengths varies from <acronym>OS</acronym> to <acronym>OS</acronym>
and from shell to shell. 
<acronym>GNU</acronym> <code>bash</code> may not have any arbitrary fixed limits to the
size of command line arguments. 
Many <acronym>OS</acronym>s cannot handle command line arguments (including
results of file globbing) exceeding 4096 characters.</p>

   <p class="footnote"><small>[<a name="fn-14" href="#fnd-14">14</a>]</small> 
Linux and <acronym>AIX</acronym> are know to support <acronym>LFS</acronym>.</p>

   <p class="footnote"><small>[<a name="fn-15" href="#fnd-15">15</a>]</small> 
If a <span class="command">getopt_long</span> function cannot be found on the system,
<acronym>NCO</acronym> will use the <span class="command">getopt_long</span> from the
<span class="command">my_getopt</span> package by Benjamin Sittler
<a href="mailto:bsittler@iname.com">bsittler@iname.com</a>. 
This is <acronym>BSD</acronym>-licensed software available from
<a href="http://www.geocities.com/ResearchTriangle/Node/9405/#my_getopt">http://www.geocities.com/ResearchTriangle/Node/9405/#my_getopt</a>.</p>

   <p class="footnote"><small>[<a name="fn-16" href="#fnd-16">16</a>]</small> The <span class="samp">-n</span> option is a backward compatible superset of the
<code>NINTAP</code> option from the <acronym>NCAR</acronym> <acronym>CCM</acronym> Processor.</p>

   <p class="footnote"><small>[<a name="fn-17" href="#fnd-17">17</a>]</small> The <span class="command">msrcp</span> command must be in the user's path and
located in one of the following directories: <code>/usr/local/bin</code>,
<code>/usr/bin</code>, <code>/opt/local/bin</code>, or <code>/usr/local/dcs/bin</code>. 
</p>

   <p class="footnote"><small>[<a name="fn-18" href="#fnd-18">18</a>]</small> 
<a name="index-_0040acronym_007bNVODS_007d-1063"></a><a name="index-National-Virtual-Ocean-Data-System-1064"></a><a name="index-open-source-1065"></a><acronym>DODS</acronym> is being deprecated because it is ambiguous, referring
both to a protocol and to a collection of (oceanography) data. 
It is superceded by two terms. 
<acronym>DAP</acronym> is the discipline-neutral Data Access Protocol at the
heart of <acronym>DODS</acronym>. 
The National Virtual Ocean Data System (<acronym>NVODS</acronym>) refers to the
collection of oceanography data and oceanographic extensions to
<acronym>DAP</acronym>. 
In other words, <acronym>NVODS</acronym> is implemented with <acronym>OPeNDAP</acronym>. 
<acronym>OPeNDAP</acronym> is <em>also</em> the open source project which
maintains, develops, and promulgates the <acronym>DAP</acronym> standard. 
<acronym>OPeNDAP</acronym> and <acronym>DAP</acronym> really are interchangeable. 
Got it yet?</p>

   <p class="footnote"><small>[<a name="fn-19" href="#fnd-19">19</a>]</small> 
Automagic support for <acronym>OPeNDAP</acronym> version 3.2.x was deprecated in
December, 2003 with <acronym>NCO</acronym> 2.8.4. 
<acronym>NCO</acronym> now supports <acronym>OPeNDAP</acronym> version 3.4.x.</p>

   <p class="footnote"><small>[<a name="fn-20" href="#fnd-20">20</a>]</small> 
The minimal set of libraries required to build <acronym>NCO</acronym> as
<acronym>OPeNDAP</acronym> clients are
<span class="file">DODS-dap-3.4.x</span>, <span class="file">DODS-nc3-dods-3.4.5</span>, and
<span class="file">DODS-packages-3.4.x</span>.</p>

   <p class="footnote"><small>[<a name="fn-21" href="#fnd-21">21</a>]</small> 
We are most familiar with the <acronym>OPeNDAP</acronym> ability to enable
network-transparent data access. 
<a name="index-constraint-expressions-1066"></a><a name="index-server_002dside-processing-1067"></a><acronym>OPeNDAP</acronym> has many other features, including sophisticated
hyperslabbing and server-side processing via <dfn>constraint expressions</dfn>. 
If you know more about this, please consider writing a section
on "<acronym>OPeNDAP</acronym> Capabilities of Interest to <acronym>NCO</acronym> Users"
for incorporation in the <cite>NCO User's Guide</cite>.</p>

   <p class="footnote"><small>[<a name="fn-22" href="#fnd-22">22</a>]</small> For example, the <acronym>DOE</acronym> <acronym>ARM</acronym> program often
uses <var>att_type</var> = <code>NC_CHAR</code> and <var>missing_value</var> =
<span class="samp">-99999.</span>. 
</p>

   <p class="footnote"><small>[<a name="fn-23" href="#fnd-23">23</a>]</small>

   <p>32767 = 2^15-1

   <p></p>

   <p class="footnote"><small>[<a name="fn-24" href="#fnd-24">24</a>]</small> Operators began performing type conversions before arithmetic
in <acronym>NCO</acronym> version&nbsp;1.2<!-- /@w -->, August, 2000. 
Previous versions never performed unnecessary type conversion for
arithmetic.</p>

   <p class="footnote"><small>[<a name="fn-25" href="#fnd-25">25</a>]</small> 
<a name="index-C-language-1068"></a>The actual type conversions are handled by intrinsic C-language type
conversion, so the <code>floor()</code> function is not explicitly called,
though the results would be the same if it were.</p>

   <p class="footnote"><small>[<a name="fn-26" href="#fnd-26">26</a>]</small> 
The exception is appending/altering the attributes <code>x_op</code>,
<code>y_op</code>, <code>z_op</code>, and <code>t_op</code> for variables which have been
averaged across space and time dimensions. 
This feature is scheduled for future inclusion in <acronym>NCO</acronym>. 
</p>

   <p class="footnote"><small>[<a name="fn-27" href="#fnd-27">27</a>]</small> 
The <acronym>CCSM</acronym> convention recommends <code>time</code> be stored in the format
<var>time</var> since <var>base_time</var>, e.g., the <code>units</code> attribute of
<code>time</code> might be <span class="samp">days since 1992-10-8 15:15:42.5 -6:00</span>. 
A&nbsp;problem<!-- /@w --> with this format occurs when using <span class="command">ncrcat</span> to
concatenate multiple files together, each with a different
<var>base_time</var>. 
That is, any <code>time</code> values from files following the first file to
be concatenated should be corrected to the <var>base_time</var> offset
specified in the <code>units</code> attribute of <code>time</code> from the first
file. 
The analogous problem has been fixed in <acronym>ARM</acronym> files
(see <a href="#ARM-Conventions">ARM Conventions</a>) and could be fixed for <acronym>CCSM</acronym> files if
there is sufficient lobbying. 
</p>

   <p class="footnote"><small>[<a name="fn-28" href="#fnd-28">28</a>]</small> Although not a part of the standard, <acronym>NCO</acronym> enforces
the policy that the <code>missing_value</code> attribute, if any, of a packed
variable is also stored at the original precision.</p>

   <p class="footnote"><small>[<a name="fn-29" href="#fnd-29">29</a>]</small> 
ANSI&nbsp;C<!-- /@w --> compilers are guaranteed to support double precision versions
of these functions. 
These functions normally operate on netCDF variables of type <code>NC_DOUBLE</code>
without having to perform intrinsic conversions. 
For example, <acronym>ANSI</acronym> compilers provide <code>sin</code> for the sine of C-type
<code>double</code> variables. 
The <acronym>ANSI</acronym> standard does not require, but many compilers provide,
an extended set of mathematical functions that apply to single
(<code>float</code>) and quadruple (<code>long double</code>) precision variables. 
Using these functions (e.g., <code>sinf</code> for <code>float</code>,
<code>sinl</code> for <code>long double</code>), when available, is more efficient
than casting variables to type <code>double</code>, performing the operation,
and then recasting. 
<acronym>NCO</acronym> uses the faster intrinsic functions when they are
available, and uses the casting method when they are not. 
</p>

   <p class="footnote"><small>[<a name="fn-30" href="#fnd-30">30</a>]</small> Linux supports more of these intrinsic functions than
other OSs.</p>

   <p class="footnote"><small>[<a name="fn-31" href="#fnd-31">31</a>]</small> A&nbsp;naked<!-- /@w --> (i.e., unprotected or unquoted) <span class="samp">*</span> is a
wildcard character. 
A&nbsp;naked<!-- /@w --> <span class="samp">-</span> may confuse the command line parser. 
A&nbsp;naked<!-- /@w --> <span class="samp">+</span> and <span class="samp">/</span> are relatively harmless.</p>

   <p class="footnote"><small>[<a name="fn-32" href="#fnd-32">32</a>]</small> The widely used shell Bash correctly interprets all these
special characters even when they are not quoted. 
That is, Bash does not prevent <acronym>NCO</acronym> from correctly interpreting
the intended arithmetic operation when the following arguments are given
(without quotes) to <span class="command">ncbo</span>:
<span class="samp">--op_typ=+</span>, <span class="samp">--op_typ=-</span>, <span class="samp">--op_typ=*</span>,
and <span class="samp">--op_typ=/</span></p>

   <p class="footnote"><small>[<a name="fn-33" href="#fnd-33">33</a>]</small> The command to do this is <span class="samp">ln -s -f ncbo ncadd</span></p>

   <p class="footnote"><small>[<a name="fn-34" href="#fnd-34">34</a>]</small> The command to do this is <span class="samp">alias ncadd='ncbo --op_typ=add'</span></p>

   <p class="footnote"><small>[<a name="fn-35" href="#fnd-35">35</a>]</small> This is because <span class="command">ncra</span> collapses the record dimension
to a size of&nbsp;1<!-- /@w --> (making it a <dfn>degenerate</dfn> dimension), but does
not remove it, while <span class="command">ncwa</span> removes all dimensions it averages
over. 
In other words, <span class="command">ncra</span> changes the size but not the rank of
variables, while <span class="command">ncwa</span> changes both the size and the rank of
variables.</p>

   <p class="footnote"><small>[<a name="fn-36" href="#fnd-36">36</a>]</small> 
Those familiar with netCDF mechanics might wish to know what is
happening here: <span class="command">ncks</span> does not attempt to redefine the variable
in <var>output-file</var> to match its definition in <var>input-file</var>,
<span class="command">ncks</span> merely copies the values of the variable and its
coordinate dimensions, if any, from <var>input-file</var> to
<var>output-file</var>. 
</p>

   <p class="footnote"><small>[<a name="fn-37" href="#fnd-37">37</a>]</small> This limitation, imposed by the netCDF storage layer,
may be relaxed in the future with netCDF4.</p>

   <p class="footnote"><small>[<a name="fn-38" href="#fnd-38">38</a>]</small> The default behavior of (<span class="samp">-I</span>) changed on
1998/12/01&mdash;before this date the default was not to weight or mask
coordinate variables.</p>

   <p class="footnote"><small>[<a name="fn-39" href="#fnd-39">39</a>]</small> If <code>lat_wgt</code> contains Gaussian weights then the value of
<code>latitude</code> in the <var>output-file</var> will be the area-weighted
centroid of the hyperslab. 
For the example given, this is about 30&nbsp;degrees.<!-- /@w --></p>

   <p class="footnote"><small>[<a name="fn-40" href="#fnd-40">40</a>]</small> <code>gw</code> stands for <dfn>Gaussian weight</dfn> in the
<acronym>NCAR</acronym> climate model.</p>

   <p class="footnote"><small>[<a name="fn-41" href="#fnd-41">41</a>]</small> <code>ORO</code> stands for <dfn>Orography</dfn> in the <acronym>NCAR</acronym>
climate model. 
<var>ORO</var> &lt; 0.5 selects the gridpoints which are covered by
ocean.</p>

   <p class="footnote"><small>[<a name="fn-42" href="#fnd-42">42</a>]</small> 
<a name="index-chocolate-1069"></a>Happy users have sent me a few gifts, though. 
This includes a box of imported chocolate. 
Mmm. 
Appreciation and gifts are definitely better than money. 
Naturally, I'm too lazy to split and send gifts to the other developers. 
However, unlike some <acronym>NCO</acronym> developers, I have a high-paying "real job". 
My intention is to split monetary donations among the active developers
and to send them their shares via PayPal.</p>

   <p><hr></div>

</body></html>