33 #include <BESInternalError.h>
37 #include "FONcInt64.h"
38 #include "FONcUtils.h"
39 #include "FONcAttributes.h"
52 Int64 *u64 =
dynamic_cast<Int64 *
>(b) ;
55 string s = (string)
"File out netcdf, FONcUInt was passed a "
56 +
"variable that is not a DAP Int64" ;
89 _varname, _orig_varname ) ;
105 BESDEBUG(
"fonc",
"FONcInt64::write for var " << _varname << endl ) ;
106 size_t var_index[] = {0} ;
108 long long *data =
new long long ;
109 _bt->buf2val( (
void**)&data ) ;
111 int stax = nc_put_var1_longlong( ncid, _varid, var_index, data ) ;
112 if( stax != NC_NOERR )
114 string err = (string)
"fileout.netcdf - "
115 +
"Failed to write unsigned int data for "
120 BESDEBUG(
"fonc",
"FONcInt64::done write for var " << _varname << endl ) ;
152 strm << BESIndent::LMarg <<
"FONcInt64::dump - ("
153 << (
void *)
this <<
")" << endl ;
154 BESIndent::Indent() ;
155 strm << BESIndent::LMarg <<
"name = " << _bt->name() << endl ;
156 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.
FONcInt64(BaseType *b)
Constructor for FOncInt64 that takes a DAP Int64.
virtual string name()
returns the name of the DAP Int64
virtual void define(int ncid)
define the DAP Int64 in the netcdf file
virtual ~FONcInt64()
Destructor that cleans up the instance.
virtual nc_type type()
returns the netcdf type of the DAP object
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual void write(int ncid)
Write the unsigned int out to the netcdf file.
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors