Changeset 528 for XIOS/trunk/src/node/file.cpp
- Timestamp:
- 12/03/14 17:54:33 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/file.cpp
r526 r528 322 322 } 323 323 324 bool append = !this->append.isEmpty() && this->append.getValue(); 325 324 326 bool useClassicFormat = !format.isEmpty() && format == format_attr::netcdf4_classic; 325 327 … … 362 364 if (isOpen) data_out->closeFile(); 363 365 364 data_out=shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), false, useClassicFormat, 365 fileComm, multifile, isCollective)); 366 isOpen=true ; 367 368 data_out->writeFile(CFile::get(this)); 369 std::vector<CField*>::iterator it, end = this->enabledFields.end(); 370 for (it = this->enabledFields.begin() ;it != end; it++) 371 { 366 data_out = shared_ptr<CDataOutput>(new CNc4DataOutput(oss.str(), append, useClassicFormat, 367 fileComm, multifile, isCollective)); 368 isOpen = true; 369 370 data_out->writeFile(CFile::get(this)); 371 372 // Do not recreate the file structure if opening an existing file 373 if (!data_out->IsInAppendMode()) 374 { 375 std::vector<CField*>::iterator it, end = this->enabledFields.end(); 376 for (it = this->enabledFields.begin(); it != end; it++) 377 { 372 378 CField* field = *it; 373 379 this->data_out->writeFieldGrid(field); 374 }375 this->data_out->writeTimeDimension();376 377 for (it = this->enabledFields.begin() ;it != end; it++)378 {380 } 381 this->data_out->writeTimeDimension(); 382 383 for (it = this->enabledFields.begin(); it != end; it++) 384 { 379 385 CField* field = *it; 380 386 this->data_out->writeField(field); 381 } 382 383 vector<CVariable*> listVars = getAllVariables() ; 384 for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) this-> data_out-> writeAttribute(*it) ; 385 386 this->data_out->definition_end(); 387 } 388 389 vector<CVariable*> listVars = getAllVariables() ; 390 for (vector<CVariable*>::iterator it = listVars.begin(); it != listVars.end(); it++) 391 this->data_out->writeAttribute(*it); 392 393 this->data_out->definition_end(); 394 } 387 395 } 388 396 }
Note: See TracChangeset
for help on using the changeset viewer.