34 #include "FONcBaseType.h"
35 #include "FONcUtils.h"
37 void FONcBaseType::convert(vector<string> embed,
bool dap4_group)
41 is_dap4_group = dap4_group;
58 BESDEBUG(
"fonc",
"FONcBaseType::define - defining '" << _varname <<
"'" << endl);
59 int stax = nc_def_var(ncid, _varname.c_str(),
type(), 0, NULL, &_varid);
60 if (stax != NC_NOERR) {
61 string err = (string)
"fileout.netcdf - " +
"Failed to define variable " + _varname;
65 BESDEBUG(
"fonc",
"FONcBaseType::define - done defining " << _varname << endl);
93 BESDEBUG(
"fonc",
"FONcBaseType::setVersion() - version: '" << _ncVersion <<
"'" << endl);
100 _nc4_datamodel= nc4_datamodel;
102 BESDEBUG(
"fonc",
"FONcBaseType::setNC4DataModel() - data model: '" << _nc4_datamodel <<
"'" << endl);
108 return FONcBaseType::_ncVersion == RETURNAS_NETCDF4;
110 bool FONcBaseType::isNetCDF4_ENHANCED()
112 return FONcBaseType::_nc4_datamodel == NC4_ENHANCED;
virtual void setVersion(std::string version)
Identifies variable with use of NetCDF4 features.
virtual void setNC4DataModel(std::string nc4_datamodel)
Identifies the netCDF4 data model (CLASSIC or ENHANCED)
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