32 #include <BESInternalError.h> 38 #include "FONcUtils.h" 39 #include "FONcAttributes.h" 52 Int32 *i32 = dynamic_cast<Int32 *>(b) ;
53 UInt32 *u32 = dynamic_cast<UInt32 *>(b) ;
56 string s = (string)
"File out netcdf, FONcInt was passed a " 57 +
"variable that is not a DAP Int32 or UInt32" ;
90 _varname, _orig_varname ) ;
106 BESDEBUG(
"fonc",
"FONcInt::write for var " << _varname << endl ) ;
107 size_t var_index[] = {0} ;
108 int *data =
new int ;
109 _bt->buf2val( (
void**)&data ) ;
110 int stax = nc_put_var1_int( ncid, _varid, var_index, data ) ;
111 if( stax != NC_NOERR )
113 string err = (string)
"fileout.netcdf - " 114 +
"Failed to write int data for " 119 BESDEBUG(
"fonc",
"FONcInt::done write for var " << _varname << endl ) ;
151 strm << BESIndent::LMarg <<
"FONcInt::dump - (" 152 << (
void *)
this <<
")" << endl ;
153 BESIndent::Indent() ;
154 strm << BESIndent::LMarg <<
"name = " << _bt->name() << endl ;
155 BESIndent::UnIndent() ;
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors
virtual void define(int ncid)
define the DAP Int32 or UInt32 in the netcdf file
exception thrown if inernal error encountered
FONcInt(BaseType *b)
Constructor for FOncInt that takes a DAP Int32 or UInt32.
static void add_variable_attributes(int ncid, int varid, BaseType *b)
Add the attributes for an OPeNDAP variable to the netcdf file.
virtual void define(int ncid)
Define the variable in the netcdf file.
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.
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual string name()
returns the name of the DAP Int32 or UInt32
A DAP BaseType with file out netcdf information included.
virtual void write(int ncid)
Write the int out to the netcdf file.
virtual ~FONcInt()
Destructor that cleans up the instance.
virtual nc_type type()
returns the netcdf type of the DAP object