Ignore:
Timestamp:
09/06/11 11:57:45 (13 years ago)
Author:
hozdoba
Message:

Corrections après tests sur titane

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XMLIO_V2/dev/dev_rv/src/xmlio/data_treatment.hpp

    r229 r265  
    8181            boost::shared_ptr<CFile> file = *it; 
    8282            StdString filename = (!file->name.isEmpty()) 
    83                                ? file->name.getValue() : file->getId(); 
     83                               ?   file->name.getValue() : file->getId(); 
    8484            StdOStringStream oss; 
    85             oss << "wk/data/" << filename << "_node" << comm::CMPIManager::GetCommRank() << ".nc"; 
     85            if (!CObjectFactory::GetObject<CContext> 
     86                (CObjectFactory::GetCurrentContextId())->output_dir.isEmpty()) 
     87                oss << CObjectFactory::GetObject<CContext>(CObjectFactory::GetCurrentContextId())->output_dir.getValue(); 
     88            oss << filename; 
     89            if (!file->name_suffix.isEmpty()) 
     90                oss << file->name_suffix.getValue(); 
     91            if (comm::CMPIManager::GetCommSize() > 1) 
     92                oss << "_node" << comm::CMPIManager::GetCommRank(); 
     93            oss << ".nc"; 
    8694            boost::shared_ptr<io::CDataOutput> dout(new T(oss.str(), false)); 
    8795            file->initializeDataOutput(dout); 
     
    93101            (const StdString & fieldId, const ARRAY(float, N) & data) 
    94102      { 
    95                 typedef typename boost::multi_array<double, N>::size_type sizetp; 
     103        typedef typename boost::multi_array<double, N>::size_type sizetp; 
    96104         std::vector<sizetp> shape; 
    97105         const sizetp * shapearr = data->shape(); 
    98106 
    99107         shape.assign(shapearr, shapearr + N); 
    100          ARRAY_CREATE(datad, double, N, [shape]); 
    101          datad->assign(data->begin(), data->end()); 
     108         ARRAY(double, N) datad(new CArray<double, N>(shape)); 
     109         for (StdSize i = 0; i < datad->num_elements(); i++) 
     110          datad->data()[i] = data->data()[i]; 
    102111 
    103112         this->write_data(fieldId, datad); 
     
    110119         const date::CDate & currDate = 
    111120                this->currentContext->getCalendar()->getCurrentDate(); 
     121         const date::CDuration & timestep =  
     122               this->currentContext->getCalendar()->getTimeStep(); 
    112123         const std::vector<boost::shared_ptr<CField> > & refField= 
    113124               CObjectFactory::GetObject<CField>(fieldId)->getAllReference(); 
    114125         std::vector<boost::shared_ptr<CField> >::const_iterator 
    115126               it = refField.begin(), end = refField.end(); 
    116  
     127//       std::cout << "nb :" << refField.size() << std::endl; 
    117128         for (; it != end; it++) 
    118129         { 
    119130            boost::shared_ptr<CField> field = *it; 
    120131            boost::shared_ptr<CFile>  file  = field->getRelFile(); 
    121             if (field->updateData(currDate, data)) 
     132//            std::cout << ">> " << fieldId << ", " << file->getId() << std::endl; 
     133            if (field->updateData(currDate, timestep, data)) 
    122134            { 
    123135               if (CXIOSManager::GetStatus() == CXIOSManager::LOC_CLIENT) 
     
    131143               } 
    132144            } 
    133             return; 
    134145         } 
    135146 
Note: See TracChangeset for help on using the changeset viewer.