Changeset 1357
- Timestamp:
- 12/06/17 08:34:31 (7 years ago)
- Location:
- XIOS
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/calendar.cpp
r561 r1357 9 9 CCalendar::CCalendar(void) 10 10 : CObject() 11 , step(0) 11 12 , initDate(*this) 12 13 , timeOrigin(*this) … … 16 17 CCalendar::CCalendar(const StdString& id) 17 18 : CObject(id) 19 , step(0) 18 20 , initDate(*this) 19 21 , timeOrigin(*this) … … 25 27 int hr /*= 0*/, int min /*= 0*/, int sec /*= 0*/) 26 28 : CObject(id) 29 , step(0) 27 30 , initDate(*this) 28 31 , timeOrigin(*this) … … 34 37 CCalendar::CCalendar(const StdString& id, const CDate& startDate) 35 38 : CObject(id) 39 , step(0) 36 40 , initDate(startDate) 37 41 , timeOrigin(startDate) … … 44 48 CCalendar::CCalendar(const StdString& id, const CDate& startDate, const CDate& timeOrigin) 45 49 : CObject(id) 50 , step(0) 46 51 , initDate(startDate) 47 52 , timeOrigin(timeOrigin) … … 115 120 } 116 121 122 int CCalendar::getStep(void) const 123 { 124 return step; 125 } 126 117 127 const CDate& CCalendar::update(int step) 118 128 { 119 129 info(20) << "update step : " << step << " timestep " << this->timestep << std::endl; 130 this->step = step; 120 131 return (this->currentDate = this->getInitDate() + step * this->timestep); 121 132 } -
XIOS/dev/XIOS_DEV_CMIP6/src/calendar.hpp
r591 r1357 70 70 virtual StdString getType(void) const; 71 71 72 int getStep(void) const; 73 72 74 virtual int getMonthLength(const CDate& date) const; 73 75 … … 112 114 113 115 private : 116 int step; 114 117 115 118 /// Propriétés privées /// -
XIOS/dev/XIOS_DEV_CMIP6/src/node/context.cpp
r1349 r1357 1833 1833 void CContext::updateCalendar(int step) 1834 1834 { 1835 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 1836 calendar->update(step); 1837 info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 1838 #ifdef XIOS_MEMTRACK_LIGHT 1839 info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 1840 #endif 1841 //if (hasClient) 1842 if (hasClient && !hasServer) // For now we only use server level 1 to read data 1835 int prevStep = calendar->getStep(); 1836 1837 if (prevStep < step) 1843 1838 { 1844 doPostTimestepOperationsForEnabledReadModeFiles(); 1845 garbageCollector.invalidate(calendar->getCurrentDate()); 1839 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 1840 calendar->update(step); 1841 info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 1842 #ifdef XIOS_MEMTRACK_LIGHT 1843 info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 1844 #endif 1845 1846 if (hasClient && !hasServer) // For now we only use server level 1 to read data 1847 { 1848 doPostTimestepOperationsForEnabledReadModeFiles(); 1849 garbageCollector.invalidate(calendar->getCurrentDate()); 1850 } 1846 1851 } 1852 else if (prevStep == step) 1853 info(50) << "updateCalendar: already at step " << step << ", no operation done." << endl; 1854 else // if (prevStep > step) 1855 ERROR("void CContext::updateCalendar(int step)", 1856 << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!") 1847 1857 } 1848 1858 -
XIOS/trunk/src/calendar.cpp
r561 r1357 9 9 CCalendar::CCalendar(void) 10 10 : CObject() 11 , step(0) 11 12 , initDate(*this) 12 13 , timeOrigin(*this) … … 16 17 CCalendar::CCalendar(const StdString& id) 17 18 : CObject(id) 19 , step(0) 18 20 , initDate(*this) 19 21 , timeOrigin(*this) … … 25 27 int hr /*= 0*/, int min /*= 0*/, int sec /*= 0*/) 26 28 : CObject(id) 29 , step(0) 27 30 , initDate(*this) 28 31 , timeOrigin(*this) … … 34 37 CCalendar::CCalendar(const StdString& id, const CDate& startDate) 35 38 : CObject(id) 39 , step(0) 36 40 , initDate(startDate) 37 41 , timeOrigin(startDate) … … 44 48 CCalendar::CCalendar(const StdString& id, const CDate& startDate, const CDate& timeOrigin) 45 49 : CObject(id) 50 , step(0) 46 51 , initDate(startDate) 47 52 , timeOrigin(timeOrigin) … … 115 120 } 116 121 122 int CCalendar::getStep(void) const 123 { 124 return step; 125 } 126 117 127 const CDate& CCalendar::update(int step) 118 128 { 119 129 info(20) << "update step : " << step << " timestep " << this->timestep << std::endl; 130 this->step = step; 120 131 return (this->currentDate = this->getInitDate() + step * this->timestep); 121 132 } -
XIOS/trunk/src/calendar.hpp
r591 r1357 70 70 virtual StdString getType(void) const; 71 71 72 int getStep(void) const; 73 72 74 virtual int getMonthLength(const CDate& date) const; 73 75 … … 112 114 113 115 private : 116 int step; 114 117 115 118 /// Propriétés privées /// -
XIOS/trunk/src/node/context.cpp
r1318 r1357 1202 1202 void CContext::updateCalendar(int step) 1203 1203 { 1204 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 1205 calendar->update(step); 1206 info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 1207 #ifdef XIOS_MEMTRACK_LIGHT 1208 info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 1209 #endif 1210 if (hasClient) 1204 int prevStep = calendar->getStep(); 1205 1206 if (prevStep < step) 1211 1207 { 1212 doPostTimestepOperationsForEnabledReadModeFiles(); 1213 garbageCollector.invalidate(calendar->getCurrentDate()); 1208 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 1209 calendar->update(step); 1210 info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 1211 #ifdef XIOS_MEMTRACK_LIGHT 1212 info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 1213 #endif 1214 1215 if (hasClient) 1216 { 1217 doPostTimestepOperationsForEnabledReadModeFiles(); 1218 garbageCollector.invalidate(calendar->getCurrentDate()); 1219 } 1214 1220 } 1221 else if (prevStep == step) 1222 info(50) << "updateCalendar: already at step " << step << ", no operation done." << endl; 1223 else // if (prevStep > step) 1224 ERROR("void CContext::updateCalendar(int step)", 1225 << "Illegal calendar update: previous step was " << prevStep << ", new step " << step << "is in the past!") 1215 1226 } 1216 1227
Note: See TracChangeset
for help on using the changeset viewer.