Changeset 857


Ignore:
Timestamp:
06/03/16 17:47:02 (8 years ago)
Author:
ymipsl
Message:

Bug fix four output scalir variable without time records.

YM+MHN

Location:
XIOS/trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/io/onetcdf4.cpp

    r802 r857  
    283283         std::vector<int> dimids; 
    284284         std::vector<StdSize> dimsizes; 
     285         int dimSize = dim.size(); 
    285286         StdSize size; 
    286287         StdSize totalSize; 
     
    314315            } 
    315316 
    316             CNetCdfInterface::defVarChunking(grpid, varid, NC_CHUNKED, &dimsizes[0]); 
     317            int storageType = (0 == dimSize) ? NC_CONTIGUOUS : NC_CHUNKED; 
     318            CNetCdfInterface::defVarChunking(grpid, varid, storageType, &dimsizes[0]); 
    317319            CNetCdfInterface::defVarFill(grpid, varid, true, NULL); 
    318320         } 
     
    441443      { 
    442444         std::vector<std::size_t> sizes  = this->getDimensions(name); 
    443          std::vector<std::string> iddims = this->getDimensionsIdList (&name); 
    444          std::vector<std::size_t>::const_iterator 
    445             it  = sizes.begin(), end = sizes.end(); 
    446          int i = 0; 
    447  
    448          if (iddims.begin()->compare(timeCounterName) == 0) 
    449          { 
    450             sstart.push_back(record); 
     445         if (sizes.size()==0)  
     446         { 
     447            array_size=1 ; 
     448            sstart.push_back(0); 
    451449            scount.push_back(1); 
    452             if ((start == NULL) && 
    453                 (count == NULL)) i++; 
    454             it++; 
    455          } 
    456  
    457          for (;it != end; it++) 
    458          { 
    459             if ((start != NULL) && (count != NULL)) 
    460             { 
    461                sstart.push_back((*start)[i]); 
    462                scount.push_back((*count)[i]); 
    463                array_size *= (*count)[i]; 
    464                i++; 
    465             } 
    466             else 
    467             { 
    468                sstart.push_back(0); 
    469                scount.push_back(sizes[i]); 
    470                array_size *= sizes[i]; 
    471                i++; 
    472             } 
    473          } 
    474  
    475       } 
     450         } 
     451         else 
     452         { 
     453           std::vector<std::string> iddims = this->getDimensionsIdList (&name); 
     454           std::vector<std::size_t>::const_iterator 
     455           it  = sizes.begin(), end = sizes.end(); 
     456           int i = 0; 
     457 
     458           if (iddims.begin()->compare(timeCounterName) == 0) 
     459           { 
     460             sstart.push_back(record); 
     461             scount.push_back(1); 
     462              if ((start == NULL) && 
     463                  (count == NULL)) i++; 
     464              it++; 
     465           } 
     466 
     467           for (;it != end; it++) 
     468           { 
     469              if ((start != NULL) && (count != NULL)) 
     470              { 
     471                 sstart.push_back((*start)[i]); 
     472                 scount.push_back((*count)[i]); 
     473                 array_size *= (*count)[i]; 
     474                 i++; 
     475              } 
     476              else 
     477              { 
     478                 sstart.push_back(0); 
     479                 scount.push_back(sizes[i]); 
     480                 array_size *= sizes[i]; 
     481                 i++; 
     482              } 
     483           } 
     484 
     485         } 
     486      } 
     487 
    476488 
    477489      template <> 
  • XIOS/trunk/src/node/grid.cpp

    r835 r857  
    693693 
    694694    storeIndex_client.resize(1); 
    695     storeIndex_client[0] = 0; 
     695    storeIndex_client(0) = 0; 
    696696    if (0 == client->clientRank) 
    697697    { 
Note: See TracChangeset for help on using the changeset viewer.