34 #include "FONcBaseType.h"
35 #include "FONcUtils.h"
37 void FONcBaseType::convert(vector<string> embed)
57 BESDEBUG(
"fonc",
"FONcBaseType::define - defining '" << _varname <<
"'" << endl);
58 int stax = nc_def_var(ncid, _varname.c_str(),
type(), 0, NULL, &_varid);
59 if (stax != NC_NOERR) {
60 string err = (string)
"fileout.netcdf - " +
"Failed to define variable " + _varname;
64 BESDEBUG(
"fonc",
"FONcBaseType::define - done defining " << _varname << endl);
92 BESDEBUG(
"fonc",
"FONcBaseType::setVersion() - version: '" << _ncVersion <<
"'" << endl);
99 return FONcBaseType::_ncVersion == RETURNAS_NETCDF4;
virtual void setVersion(std::string version)
Identifies variable with use of NetCDF4 features.
virtual void define(int ncid)
Define the variable in the netcdf file.
virtual bool isNetCDF4()
Returns true if NetCDF4 features will be required.
virtual nc_type type()
Returns the type of data of this variable.
virtual void clear_embedded()
Clears the list of embedded variable names.
static void handle_error(int stax, const string &err, const string &file, int line)
handle any netcdf errors
static string gen_name(const vector< string > &embed, const string &name, string &original)
generate a new name for the embedded variable