Updated for version 1.4.0

The handler now supports several new configuration parameters:
# FONc.UseCompression: Use compression when making netCDF4 files
# FONc.ChunkSize: The default chunk size when making netCDF4 files, in KBytes
# FONc.ClassicModel: When making a netCDF4 file, use only the 'classic' netCDF 

A bug with string data has been fixed:
Now the handler returns a valid netCDF3 or 4 classic model file where
an array of strings is a two-dimensional array of NC_CHAR (or a rank M
array of strings is a rank M+1 array of NC_CHAR).

Updated for version 1.2.4

See the INSTALL file for build and installation instructions.

fileout_netcdf is a module to be loaded by the BES that will allow users to
return a 'get dods' request as a netcdf file. A file is generated and then
streamed back in the response.

An example is provided in the BES command line input file infile, which
generates the file outfile. This is how one would use this input file:

bescmdln -h localhost -p 10002 -i infile -f outfile.test

And then you can compare the results of outfile with outfile.test. You
should be able to run ncdump against this output file and it should be
somewhat similar to the fnoc1.nc file in share/hyrax/data/nc.

How does it work?

The get dods command in the input file tells the BES to generate a DataDDS
response object. Typically, this DataDDS response object is "transmitted"
back to the caller using a function that is registered with a basic
transmitter that knows how to transmit a dods response.

If the caller adds to the command 'return as "netcdf"' then the BES will try
to find a transmitter called netcdf and call the function registered with it
that knows how to transmit a dods response. So, if you look at FONcModule
you will see the FONcTransmitter is registered with the ReturnManager with
the name "netcdf".  The constructor of this new transmitter adds a function
that knows how to transmit a dods response, see FONcTransmitter.cc. So, when
it comes time to transmit the response it sees that the caller has specified
a specific transmitter ("netcdf"), the BES looks up that transmitter, then
looks up a function to handle the response ("dods"), calls that function and
the function transmits the response using the output stream from the
BESDataHandlerInterface (getOutputStream).

The FONcTransmitter first takes the response object passed, grabs the
DataDDS object, and calls the read method on it to make sure that all of the
data is read into the response object. Remember, this is lazy evaluation, so
when the DataDDS response object is created, data structures are added to
it, but no data is actually read into it. At least, this is the case for
most of the handlers. Some read the data in directly, so the read call just
returns.

After calling read, the FONcTransmitter hands over everything to the
FONcGridTransform class to write the data structure and data out to the
netcdf file, and then that file is streamed (transmitted) back to the client.

Any questions, please contact Patrick West at pwest@opendap.org.

