Changeset 436
- Timestamp:
- 06/06/13 17:31:28 (12 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/duration.cpp
r424 r436 34 34 if(duration.hour != 0.0) { testValue = false; sout << duration.hour << "h " ; } 35 35 if(duration.minute != 0.0) { testValue = false; sout << duration.minute << "mi "; } 36 if(duration.second != 0.0 || testValue) {sout << duration.second << "s " ; }36 if(duration.second != 0.0) { testValue = false; sout << duration.second << "s " ; } 37 37 if(duration.timestep != 0.0 || testValue) { sout << duration.timestep << "ts " ; } 38 38 … … 106 106 107 107 //----------------------------------------------------------------- 108 108 CDuration & CDuration::solveTimeStep(const CCalendar & c) 109 { 110 CDuration timeStep=c.getTimeStep() ; 111 second +=timeStep.second ; 112 minute +=timeStep.minute ; 113 hour +=timeStep.hour ; 114 day +=timeStep.day ; 115 month +=timeStep.month ; 116 year +=timeStep.year ; 117 timestep = 0 ; 118 return (*this); 119 } 120 121 109 122 CDuration & CDuration::resolve(const CCalendar & c) 110 123 { -
XIOS/trunk/src/duration.hpp
r424 r436 28 28 /// Traitement /// 29 29 struct _duration & resolve(const CCalendar & calendar); 30 30 struct _duration & solveTimeStep(const CCalendar & c) ; 31 31 /// Autres /// 32 32 StdString toString(void) const; -
XIOS/trunk/src/node/field.cpp
r421 r436 362 362 StdString id = this->getBaseFieldReference()->getId(); 363 363 CContext* context = CContext::getCurrent(); 364 365 if (operation.isEmpty() || freq_op.isEmpty() || this->file->output_freq.isEmpty()) 364 365 if (freq_op.isEmpty()) freq_op=string("1ts") ; 366 367 if (operation.isEmpty() || this->file->output_freq.isEmpty()) 366 368 { 367 369 ERROR("CField::solveOperation(void)", … … 411 413 const CDuration toffset = this->freq_operation - freq_offset_ - context->getCalendar()->getTimeStep(); 412 414 *this->last_operation = *this->last_operation - toffset; 413 415 416 if (operation.get()=="once") isOnceOperation=true ; 417 else isOnceOperation=false; 418 isFirstOperation=true; 419 420 cout<<"Operation : "<<operation<<" isOnce "<<isOnceOperation<<endl; 414 421 #define DECLARE_FUNCTOR(MType, mtype) \ 415 422 if (operation.getValue().compare(#mtype) == 0) \ … … 427 434 << "The operation is not defined !"); 428 435 } 436 437 429 438 } 430 439 -
XIOS/trunk/src/node/field.hpp
r369 r436 149 149 CArray<double, 1> data; 150 150 map<int, CArray<double,1>* > data_srv ; 151 bool isOnceOperation ; 152 bool isFirstOperation ; 151 153 152 154 }; // class CField -
XIOS/trunk/src/node/field_impl.hpp
r369 r436 28 28 const CDate & currDate = context->getCalendar()->getCurrentDate(); 29 29 const CDate opeDate = *last_operation + freq_operation; 30 const CDate writeDate = *last_Write + freq_write; 30 const CDate writeDate = *last_Write + freq_write; 31 bool doOperation, doWrite; 32 31 33 32 34 33 35 info(50) << "CField::updateData " << currDate << " : send data to " << this->getBaseFieldId() << std::endl; 34 36 info(50) << "Next operation " << opeDate<<std::endl; 35 36 if (opeDate <= currDate) 37 38 doOperation = (opeDate <= currDate) ; 39 if (isOnceOperation) 40 if (isFirstOperation) doOperation=true ; 41 else doOperation=false ; 42 43 if (doOperation) 37 44 { 38 45 if (this->data.numElements() != this->grid->storeIndex_client.numElements()) … … 49 56 } 50 57 51 if (writeDate < (currDate + freq_operation)) 58 59 doWrite = (writeDate < (currDate + freq_operation)) ; 60 if (isOnceOperation) 61 { 62 if(isFirstOperation) 63 { 64 doWrite=true ; 65 isFirstOperation=false ; 66 } 67 else doWrite=false ; 68 } 69 70 if (doWrite) 52 71 { 53 72 this->foperation->final();
Note: See TracChangeset
for help on using the changeset viewer.