Ignore:
Timestamp:
06/06/17 19:06:45 (7 years ago)
Author:
yushan
Message:

fix bad commit. Back to R1155 branch not merged

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/io/onetcdf4.cpp

    r1157 r1160  
    66#include "netCdfInterface.hpp" 
    77#include "netCdfException.hpp" 
    8 #include "timer.hpp" 
    98// mpi_std.hpp 
    109 
     
    5554         if (!append || !std::ifstream(filename.c_str())) 
    5655         { 
    57             CTimer::get("Files : create").resume(); 
    5856            if (wmpi) 
    5957               CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL_STD, this->ncidp); 
    6058            else 
    6159               CNetCdfInterface::create(filename, mode, this->ncidp); 
    62             CTimer::get("Files : create").suspend(); 
    63   
     60 
    6461            this->appendMode = false; 
    6562         } 
     
    6764         { 
    6865            mode |= NC_WRITE; 
    69             CTimer::get("Files : open").resume(); 
    7066            if (wmpi) 
    7167               //CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(comm->mpi_comm), MPI_INFO_NULL_STD, this->ncidp); 
     
    7369            else 
    7470               CNetCdfInterface::open(filename, mode, this->ncidp); 
    75             CTimer::get("Files : open").suspend(); 
     71 
    7672            this->appendMode = true; 
    7773         } 
     
    8783      void CONetCDF4::close() 
    8884      { 
    89         CTimer::get("Files : close").resume(); 
    9085        CNetCdfInterface::close(this->ncidp); 
    91         CTimer::get("Files : close").suspend(); 
    9286      } 
    9387 
     
    564558 
    565559         this->getWriteDataInfos(name, 0, array_size,  sstart, scount, NULL, NULL); 
    566  
    567560         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    568  
    569561      } 
    570562 
     
    592584 
    593585         this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL); 
     586         if (using_netcdf_internal) 
     587         { 
     588           if (!isRoot) 
     589           { 
     590             sstart[0] = sstart[0] + 1; 
     591             scount[0] = 0; 
     592           } 
     593         } 
    594594         this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    595595       } 
    596596 
    597       void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name, 
    598                                         bool collective, StdSize record, bool isRoot) 
    599       { 
    600          int grpid = this->getCurrentGroup(); 
    601          int varid = this->getVariable(name); 
    602  
    603          map<int,size_t>::iterator it=timeAxis.find(varid); 
    604          if (it == timeAxis.end()) timeAxis[varid] = record; 
    605          else 
    606          { 
    607            if (it->second >= record) return; 
    608            else it->second =record; 
    609          } 
    610  
    611          StdSize array_size = 1; 
    612          std::vector<StdSize> sstart, scount; 
    613  
    614          if (this->wmpi && collective) 
    615             CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 
    616          if (this->wmpi && !collective) 
    617             CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 
    618  
    619          this->getWriteDataInfos(name, record, array_size,  sstart, scount, NULL, NULL); 
    620          this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 
    621        } 
    622  
    623  
    624597      //--------------------------------------------------------------- 
    625598 
Note: See TracChangeset for help on using the changeset viewer.