32 #include <BESInternalError.h>
36 #include "FONcDouble.h"
37 #include "FONcUtils.h"
38 #include "FONcAttributes.h"
51 _f =
dynamic_cast<Float64 *
>(b) ;
54 string s = (string)
"File out netcdf, FONcDouble was passed a "
55 +
"variable that is not a DAP Float64" ;
87 _varname, _orig_varname ) ;
103 BESDEBUG(
"fonc",
"FONcDouble::write for var " << _varname << endl ) ;
104 size_t var_index[] = {0} ;
105 double *data =
new double ;
106 _f->buf2val( (
void**)&data ) ;
107 int stax = nc_put_var1_double( ncid, _varid, var_index, data ) ;
108 if( stax != NC_NOERR )
110 string err = (string)
"fileout.netcdf - "
111 +
"Failed to write double data for "
116 BESDEBUG(
"fonc",
"FONcDouble::done write for var " << _varname << endl ) ;
148 strm << BESIndent::LMarg <<
"FONcDouble::dump - ("
149 << (
void *)
this <<
")" << endl ;
150 BESIndent::Indent() ;
151 strm << BESIndent::LMarg <<
"name = " << _f->name() << endl ;
152 BESIndent::UnIndent() ;
exception thrown if internal error encountered
static void add_original_name(int ncid, int varid, const string &var_name, const string &orig)
Adds an attribute for the variable if the variable name had to be modified in any way.
static void add_variable_attributes(int ncid, int varid, BaseType *b, bool is_netCDF_enhanced, bool is_dap4)
Add the attributes for an OPeNDAP variable to the netcdf file.
A DAP BaseType with file out netcdf information included.
virtual void define(int ncid)
Define the variable in the netcdf file.
virtual string name()
returns the name of the DAP Float64
virtual nc_type type()
returns the netcdf type of the DAP Float64
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual ~FONcDouble()
Destructor that cleans up the instance.
virtual void write(int ncid)
Write the float64 out to the netcdf file.
virtual void define(int ncid)
define the DAP Float64 in the netcdf file
FONcDouble(BaseType *b)
Constructor for FOncDouble that takes a DAP Float64.
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors