Cast the proper pair and enfore NetCDF4 file format if possible (even for NetCDF3 C++ interface)

This commit is contained in:
Guilhem Lavaux 2012-11-24 17:45:19 -05:00
parent 4c9b2ef96b
commit 126ec18317
2 changed files with 3 additions and 3 deletions

View File

@ -77,7 +77,7 @@ namespace CosmoTool
if (i == attributes.end()) if (i == attributes.end())
return 0; return 0;
return reinterpret_cast<T *>(i->first); return reinterpret_cast<T *>(i->second.first);
} }
void new_attribute(const std::string& n, void *p, FreeFunction free_func) void new_attribute(const std::string& n, void *p, FreeFunction free_func)

View File

@ -151,7 +151,7 @@ namespace CosmoTool {
ProgressiveOutput<T>::saveArrayProgressive(const std::string& fname, uint32_t *dimList, ProgressiveOutput<T>::saveArrayProgressive(const std::string& fname, uint32_t *dimList,
uint32_t rank) uint32_t rank)
{ {
NcFile *f = new NcFile(fname.c_str(), NcFile::Replace); NcFile *f = new NcFile(fname.c_str(), NcFile::Replace, 0, 0, NcFile::Netcdf4);
assert(f->is_valid()); assert(f->is_valid());
@ -202,7 +202,7 @@ namespace CosmoTool {
void saveArray(const std::string& fname, void saveArray(const std::string& fname,
T *array, uint32_t *dimList, uint32_t rank) T *array, uint32_t *dimList, uint32_t rank)
{ {
NcFile f(fname.c_str(), NcFile::Replace); NcFile f(fname.c_str(), NcFile::Replace, 0, 0, NcFile::Netcdf4);
assert(f.is_valid()); assert(f.is_valid());