63 _grid =
dynamic_cast<Grid *
>(b) ;
66 string s = (string)
"File out netcdf, FONcGrid was passed a "
67 +
"variable that is not a DAP Grid" ;
89 vector<FONcMap *>::iterator i = _maps.begin();
90 vector<FONcMap *>::iterator e = _maps.end();
105 vector<FONcMap *>::iterator i = _maps.begin() ;
106 while( i != _maps.end() )
138 BESDEBUG(
"fonc",
"FONcGrid::convert - converting grid "
143 Grid::Map_iter mi = _grid->map_begin() ;
144 Grid::Map_iter me = _grid->map_end() ;
145 for( ; mi != me; mi++ )
147 Array *map =
dynamic_cast<Array *
>( (*mi) ) ;
150 string err = (string)
"file out netcdf, grid "
151 +
_varname +
" map is not an array" ;
155 vector<string> map_embed ;
167 map_found =
new FONcMap( fa,
true );
179 _maps.push_back( map_found ) ;
181 _arr =
new FONcArray( _grid->get_array() ) ;
184 BESDEBUG(
"fonc",
"FONcGrid::convert - done converting grid "
207 BESDEBUG(
"fonc",
"FOncGrid::define - defining grid "
210 vector<FONcMap *>::iterator i = _maps.begin() ;
211 vector<FONcMap *>::iterator e = _maps.end() ;
214 (*i)->define( ncid ) ;
220 BESDEBUG(
"fonc",
"FOncGrid::define - done defining grid "
237 BESDEBUG(
"fonc",
"FOncGrid::define - writing grid "
240 vector<FONcMap *>::iterator i = _maps.begin() ;
241 vector<FONcMap *>::iterator e = _maps.end() ;
244 (*i)->write( ncid ) ;
246 _arr->
write( ncid ) ;
250 BESDEBUG(
"fonc",
"FOncGrid::define - done writing grid "
261 return _grid->name() ;
276 << (
void *)
this <<
")" << endl ;
285 vector<FONcMap *>::const_iterator i = _maps.begin() ;
286 vector<FONcMap *>::const_iterator e = _maps.end() ;
296 strm <<
" empty" << endl ;
299 strm << BESIndent::LMarg <<
"}" << endl ;
300 strm << BESIndent::LMarg <<
"array:" ;
310 strm <<
" not set" << endl ;
322 for( ; vi != ve && !found; vi++ )
329 found = map_found->
compare( array ) ;
virtual void add_grid(const string &name)
Add the name of the grid as a grid that uses this map.
A map of a DAP Grid with file out netcdf information included.
exception thrown if inernal error encountered
A DAP Array with file out netcdf information included.
FONcGrid(BaseType *b)
Constructor for FONcGrid that takes a DAP Grid.
virtual bool compare(Array *arr)
a method to compare two grid maps, or possible grid maps.
virtual void write(int ncid)
Write the array out to the netcdf file.
virtual ~FONcGrid()
Destructor that cleans up the grid.
static bool InGrid
tells whether we are converting or defining a grid.
virtual void define(int ncid)
define the DAP Grid in the netcdf file
virtual void decref()
decrements the reference count for this map
virtual void convert(vector< string > embed)
convert the DAP Grid to a set of embedded variables
static FONcMap * InMaps(Array *array)
virtual void write(int ncid)
Write the maps and array for the grid.
static ostream & LMarg(ostream &strm)
virtual void define(int ncid)
define the DAP Array in the netcdf file
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual void convert(vector< string > embed)
Converts the DAP Array to a FONcArray.
A DAP BaseType with file out netcdf information included.
virtual void clear_embedded()
clear the embedded names for the FONcArray kept by this instance
static string gen_name(const vector< string > &embed, const string &name, string &original)
generate a new name for the embedded variable
#define BESDEBUG(x, y)
macro used to send debug information to the debug stream
virtual string name()
returns the name of the DAP Grid
virtual void convert(vector< string > embed)
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
virtual void dump(ostream &strm) const
dumps information about this object for debugging purposes
static vector< FONcMap * > Maps
global list of maps that could be shared amongst the different grids