gradutilncgen.html 2.08 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<html>
<body>

<h2><a name="ncgen">ncgen</a></h2>
<code>ncgen [-b] [-c] [-f] [-n] [-o <i>output_file</i>]
<i>input_file</i></code><p>
Where:
<ul>
<code>-b</code>
<ul>
Create a (binary) netCDF file.  If the <code>-o</code> option is
absent, a default file name will be constructed from the netCDF name
(specified after the netcdf keyword in the input) by appending the
<code>.nc</code> extension.  If a file already exists with the
specified name, it will be overwritten.
</ul>

<p>
<code>-c</code>
<ul>
Generate C source code that will create a netCDF file matching the
netCDF specification.  The C source code is written to standard
output.
</ul>

<p> 
<code>-f</code> 
<ul>
Generate Fortran source code that will
create a netCDF file matching the netCDF specification.  The Fortran
source code is written to standard output.  
</ul>

<p> 
<code>-o <i>outputfile</i></code>
<ul>
Name for the netCDF file created.  If this option is specified, it
implies the <code>-b</code> option.  (This option is necessary because
netCDF files cannot be written directly to standard output, since
standard output is not seekable.)
</ul>

<p>
<code>-n</code>
<ul>
Like <code>-b</code> option, except creates netCDF file with the
obsolete <code>.cdf</code> extension instead of the <code>.nc</code>
extension, in the absence of an output filename specified by the
<code>-O</code> option.  This option is only supported for backward
compatibility.
</ul>
</ul>

<p>
<b>Examples</b>
<ol>
<li>Check the syntax of the CDL file <code>foo.cdl</code>:<p>
<dd><code>ncgen foo.cdl</code><p>
<li>
From the CDL file <code>foo.cdl</code>, generate an  equivalent  binary
     netCDF file named <code>x.nc</code>:<p>
<dd><code>ncgen -o x.nc foo.cdl</code><p>
<li>
From the CDL file <code>foo.cdl</code>, generate a C program containing
     the  netCDF  function  invocations  necessary  to  create an
     equivalent binary netCDF file named <code>x.nc</code>:<p>
<dd><code>ncgen -c -o x.nc foo.cdl</code></ol>


</body>
</html>