Changeset 1630 for XIOS/dev/dev_trunk_omp/src
- Timestamp:
- 12/21/18 09:19:12 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp/src
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/src/calendar.cpp
r1629 r1630 119 119 this->timestep = timestep; 120 120 } 121 /* 121 122 122 int CCalendar::getStep(void) const 123 123 { 124 124 return step; 125 125 } 126 */ 126 127 127 const CDate& CCalendar::update(int step) 128 128 { … … 153 153 //----------------------------------------------------------------- 154 154 155 //const CDuration& CCalendar::getTimeStep(void) const { return this->timestep; }156 //const CDate& CCalendar::getInitDate(void) const { return this->initDate; }157 //const CDate& CCalendar::getTimeOrigin(void) const { return this->timeOrigin; }158 //const CDate& CCalendar::getCurrentDate(void) const { return this->currentDate; }155 const CDuration& CCalendar::getTimeStep(void) const { return this->timestep; } 156 const CDate& CCalendar::getInitDate(void) const { return this->initDate; } 157 const CDate& CCalendar::getTimeOrigin(void) const { return this->timeOrigin; } 158 const CDate& CCalendar::getCurrentDate(void) const { return this->currentDate; } 159 159 160 160 //----------------------------------------------------------------- … … 169 169 StdString CCalendar::getType(void) const { return StdString(this->getId()); } 170 170 171 //int CCalendar::getYearTotalLength(const CDate& date) const { return (365 * 86400); }171 int CCalendar::getYearTotalLength(const CDate& date) const { return (365 * 86400); } 172 172 173 173 //int CCalendar::getYearLength (void) const { return 12; } … … 177 177 //int CCalendar::getDayLengthInSeconds(void) const { return getDayLength() * getHourLength() * getMinuteLength(); } 178 178 179 //bool CCalendar::hasLeapYear() const { return false; }180 181 /*StdString CCalendar::getMonthName(int monthId) const179 bool CCalendar::hasLeapYear() const { return false; } 180 181 StdString CCalendar::getMonthName(int monthId) const 182 182 { 183 183 static const StdString MonthNames[] = … … 185 185 "july", "august", "september", "october", "november", "december" }; 186 186 return MonthNames[monthId - 1]; 187 } */187 } 188 188 189 189 const StdString CCalendar::getMonthShortName(int monthId) const -
XIOS/dev/dev_trunk_omp/src/calendar.hpp
r1629 r1630 52 52 53 53 /// Mutateur /// 54 void setTimeStep(const CDuration& timestep) 54 void setTimeStep(const CDuration& timestep); 55 55 void setInitDate(const CDate& initDate); 56 56 void setTimeOrigin(const CDate& timeOrigin); … … 60 60 61 61 /// Accesseurs /// 62 const CDuration& getTimeStep(void) const { return this->timestep; };63 const CDate& getInitDate(void) const { return this->initDate; };64 const CDate& getTimeOrigin(void) const { return this->timeOrigin; };65 const CDate& getCurrentDate(void) const { return this->currentDate; };62 const CDuration& getTimeStep(void) const; 63 const CDate& getInitDate(void) const; 64 const CDate& getTimeOrigin(void) const; 65 const CDate& getCurrentDate(void) const; 66 66 67 67 public : … … 70 70 virtual StdString getType(void) const; 71 71 72 int getStep(void) const {return step;};72 int getStep(void) const; 73 73 74 74 inline int getMonthLength(const CDate& date) const … … 78 78 }; 79 79 80 //virtual int getYearTotalLength(const CDate& date) const; // Retourne la durée d'une année en seconde. 81 inline virtual int getYearTotalLength(const CDate& date) const { return (365 * 86400); } ; // Retourne la durée d'une année en seconde. 80 virtual int getYearTotalLength(const CDate& date) const; // Retourne la durée d'une année en seconde. 82 81 83 82 //virtual int getYearLength (void) const; // Retourne la durée d'une année en mois. 84 inline virtualint getYearLength (void) const { return 12; } ;85 inline virtualint getDayLength (void) const { return 24; } ; // Retourne la durée d'un jour en heures.86 inline virtualint getHourLength (void) const { return 60; } ; // Retourne la durée d'une heure en minute.87 inline virtualint getMinuteLength(void) const {return 60; } ; // Retourne la durée d'une minute en secondes.83 inline int getYearLength (void) const { return 12; } ; 84 inline int getDayLength (void) const { return 24; } ; // Retourne la durée d'un jour en heures. 85 inline int getHourLength (void) const { return 60; } ; // Retourne la durée d'une heure en minute. 86 inline int getMinuteLength(void) const {return 60; } ; // Retourne la durée d'une minute en secondes. 88 87 /*! Returns the day length expressed in seconds. */ 89 inline virtualint getDayLengthInSeconds(void) const { return 86400; } ;88 inline int getDayLengthInSeconds(void) const { return 86400; } ; 90 89 91 inline virtual StdString getMonthName(int monthId) const 92 { 93 static const StdString MonthNames[] = 94 { "january", "february", "march", "april" , "may", "june", 95 "july", "august", "september", "october", "november", "december" }; 96 return MonthNames[monthId - 1]; 97 }; 90 virtual StdString getMonthName(int monthId) const; 98 91 virtual const StdString getMonthShortName(int monthId) const; 99 92 100 93 /*! Test if the calendar can have leap year. */ 101 inline virtual bool hasLeapYear() const {return false;};94 virtual bool hasLeapYear() const; 102 95 103 96 void initializeDate(int yr, int mth, int d, int hr = 0, int min = 0, int sec = 0); -
XIOS/dev/dev_trunk_omp/src/calendar_util.cpp
r1629 r1630 1 1 #include "calendar_util.hpp" 2 #include "calendar.hpp" 2 3 3 4 namespace xios -
XIOS/dev/dev_trunk_omp/src/config/domain_attribute.conf
r1619 r1630 58 58 59 59 DECLARE_ARRAY(double, 2, area) 60 DECLARE_ATTRIBUTE(double, radius)61 60 62 61 DECLARE_ENUM4(type,rectilinear,curvilinear,unstructured, gaussian) -
XIOS/dev/dev_trunk_omp/src/config/interpolate_domain_attribute.conf
r1619 r1630 10 10 DECLARE_ATTRIBUTE(bool, write_weight) 11 11 DECLARE_ENUM2(read_write_convention, c, fortran) 12 DECLARE_ATTRIBUTE(bool, use_area) -
XIOS/dev/dev_trunk_omp/src/context_client.cpp
r1619 r1630 96 96 { 97 97 list<int> ranks = event.getRanks(); 98 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<endl ; 98 99 99 if (CXios::checkEventSync) 100 100 { … … 124 124 { 125 125 event.send(timeLine, sizes, buffList); 126 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<" sent"<<endl ;127 126 128 127 checkBuffers(ranks); … … 143 142 info(100)<<"DEBUG : temporaly event created : timeline "<<timeLine<<endl ; 144 143 event.send(timeLine, tmpBufferedEvent.sizes, tmpBufferedEvent.buffers); 145 info(100)<<"Event "<<timeLine<<" of context "<<context->getId()<<" sent"<<endl ;146 144 } 147 145 } -
XIOS/dev/dev_trunk_omp/src/date/allleap.cpp
r1629 r1630 32 32 33 33 ///-------------------------------------------------------------- 34 /* 34 35 35 int CAllLeapCalendar::getYearTotalLength(const CDate & date) const 36 36 { return (366 * 86400); } 37 */ 37 38 38 int CAllLeapCalendar::getMonthLength(const CDate & date) const 39 39 { … … 41 41 return (CCalendar::getMonthLength(date)); 42 42 } 43 /* 43 44 44 StdString CAllLeapCalendar::getType(void) const 45 45 { return (StdString("all_leap")); } 46 */ 46 47 47 ///-------------------------------------------------------------- 48 48 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/date/allleap.hpp
r1629 r1630 26 26 27 27 /// Accesseurs /// 28 inline virtual int getYearTotalLength(const CDate & date) const { return (366 * 86400); };28 virtual int getYearTotalLength(const CDate & date) const; 29 29 virtual int getMonthLength(const CDate & date) const; 30 virtual StdString getType(void) const { return (StdString("all_leap")); };30 virtual StdString getType(void) const; 31 31 32 32 /// Destructeur /// 33 virtual ~CAllLeapCalendar(void) 33 virtual ~CAllLeapCalendar(void); 34 34 35 35 }; // class CAllLeapCalendar -
XIOS/dev/dev_trunk_omp/src/date/d360.cpp
r1629 r1630 33 33 ///-------------------------------------------------------------- 34 34 35 //int CD360Calendar::getYearTotalLength(const CDate & date) const36 //{ return (360 * 86400); }35 int CD360Calendar::getYearTotalLength(const CDate & date) const 36 { return (360 * 86400); } 37 37 38 //int CD360Calendar::getMonthLength(const CDate & date) const39 //{ return (30); }38 int CD360Calendar::getMonthLength(const CDate & date) const 39 { return (30); } 40 40 41 //StdString CD360Calendar::getType(void) const42 //{ return (StdString("360_day")); }41 StdString CD360Calendar::getType(void) const 42 { return (StdString("360_day")); } 43 43 44 44 ///-------------------------------------------------------------- -
XIOS/dev/dev_trunk_omp/src/date/d360.hpp
r1629 r1630 26 26 27 27 /// Accesseurs /// 28 inline virtual int getYearTotalLength(const CDate & date) const { return (360 * 86400); };29 inline virtual int getMonthLength(const CDate & date) const { return 30; };30 inline virtual StdString getType(void) const { return (StdString("360_day")); };28 virtual int getYearTotalLength(const CDate & date) const; 29 virtual int getMonthLength(const CDate & date) const; 30 virtual StdString getType(void) const; 31 31 32 32 /// Destructeur /// -
XIOS/dev/dev_trunk_omp/src/date/gregorian.cpp
r1629 r1630 55 55 } 56 56 57 //StdString CGregorianCalendar::getType(void) const58 //{ return (StdString("gregorian")); }57 StdString CGregorianCalendar::getType(void) const 58 { return (StdString("gregorian")); } 59 59 60 //bool CGregorianCalendar::hasLeapYear() const { return true; }60 bool CGregorianCalendar::hasLeapYear() const { return true; } 61 61 62 62 ///-------------------------------------------------------------- -
XIOS/dev/dev_trunk_omp/src/date/gregorian.hpp
r1629 r1630 28 28 virtual int getYearTotalLength(const CDate & date) const; 29 29 virtual int getMonthLength(const CDate & date) const; 30 inline virtual StdString getType(void) const { return (StdString("gregorian")); }; 31 inline virtual int getYearLength (void) const { return 12; } ; 30 virtual StdString getType(void) const; 32 31 33 inline virtual bool hasLeapYear() const { return true; };32 virtual bool hasLeapYear() const; 34 33 35 34 /// Destructeur /// -
XIOS/dev/dev_trunk_omp/src/io/onetcdf4_impl.hpp
r1619 r1630 73 73 } 74 74 char *PtrArrayStr ; 75 PtrArrayStr=new char[stringArrayLen*data.numElements()] ; 76 memset (PtrArrayStr,' ',stringArrayLen*data.numElements()); 77 size_t offset=0 ; 75 PtrArrayStr=new char[stringArrayLen] ; 78 76 Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 79 for(it=itb;it!=ite;++it, offset+=stringArrayLen) 77 int lineNb = 0; 78 for(it=itb;it!=ite;++it) 80 79 { 81 it->copy(PtrArrayStr+offset,it->size()) ; 82 PtrArrayStr[offset+it->size()]='\0' ; 80 it->copy(PtrArrayStr,it->size()) ; 81 PtrArrayStr[it->size()]='\0' ; 82 sstart[0] = lineNb; 83 sstart[dimArrayLen] = 0; 84 scount[0] = 1; 85 scount[dimArrayLen] = it->size() + 1; 86 CTimer::get("CONetCDF4::writeData writeData_").resume(); 87 this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 88 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 89 ++lineNb; 83 90 } 84 85 CTimer::get("CONetCDF4::writeData writeData_").resume();86 this->writeData_(grpid, varid, sstart, scount, PtrArrayStr);87 CTimer::get("CONetCDF4::writeData writeData_").suspend();88 89 91 delete [] PtrArrayStr; 90 92 } -
XIOS/dev/dev_trunk_omp/src/node/interpolate_domain.cpp
r1619 r1630 65 65 if (this->read_write_convention.isEmpty()) this->read_write_convention.setValue(read_write_convention_attr::fortran); 66 66 67 68 67 } 69 68 -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp
r1619 r1630 305 305 CArray<double,2> boundsLonSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 306 306 CArray<double,2> boundsLatSrcUnmasked(nVertexSrc,nSrcLocalUnmasked); 307 CArray<double,1> areaSrcUnmasked(nSrcLocalUnmasked);308 309 307 long int * globalSrcUnmasked = new long int [nSrcLocalUnmasked]; 310 308 311 309 nSrcLocalUnmasked=0 ; 312 bool hasSrcArea=domainSrc_->hasArea && !domainSrc_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ;313 double srcAreaFactor ;314 if (hasSrcArea) srcAreaFactor=1./(domainSrc_->radius*domainSrc_->radius) ;315 316 310 for (int idx=0 ; idx < nSrcLocal; idx++) 317 311 { … … 323 317 boundsLatSrcUnmasked(n,nSrcLocalUnmasked) = boundsLatSrc(n,idx) ; 324 318 } 325 if (hasSrcArea) areaSrcUnmasked(nSrcLocalUnmasked) = domainSrc_->areavalue(idx)*srcAreaFactor ;326 319 globalSrcUnmasked[nSrcLocalUnmasked]=globalSrc[idx] ; 327 320 ++nSrcLocalUnmasked ; 328 321 } 329 322 } 330 323 331 324 332 325 int nDstLocalUnmasked = 0 ; … … 335 328 CArray<double,2> boundsLonDestUnmasked(nVertexDest,nDstLocalUnmasked); 336 329 CArray<double,2> boundsLatDestUnmasked(nVertexDest,nDstLocalUnmasked); 337 CArray<double,1> areaDstUnmasked(nDstLocalUnmasked);338 339 330 long int * globalDstUnmasked = new long int [nDstLocalUnmasked]; 340 331 341 332 nDstLocalUnmasked=0 ; 342 bool hasDstArea=domainDest_->hasArea && !domainDest_->radius.isEmpty() && !interpDomain_->use_area.isEmpty() && interpDomain_->use_area==true ;343 double dstAreaFactor ;344 if (hasDstArea) dstAreaFactor=1./(domainDest_->radius*domainDest_->radius) ;345 333 for (int idx=0 ; idx < nDstLocal; idx++) 346 334 { … … 352 340 boundsLatDestUnmasked(n,nDstLocalUnmasked) = boundsLatDest(n,idx) ; 353 341 } 354 if (hasDstArea) areaDstUnmasked(nDstLocalUnmasked) = domainDest_->areavalue(idx)*dstAreaFactor ;355 342 globalDstUnmasked[nDstLocalUnmasked]=globalDst[idx] ; 356 343 ++nDstLocalUnmasked ; … … 358 345 } 359 346 360 double* ptAreaSrcUnmasked = NULL ; 361 if (hasSrcArea) ptAreaSrcUnmasked=areaSrcUnmasked.dataFirst() ; 362 363 double* ptAreaDstUnmasked = NULL ; 364 if (hasDstArea) ptAreaDstUnmasked=areaDstUnmasked.dataFirst() ; 365 366 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), ptAreaSrcUnmasked, nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 367 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), ptAreaDstUnmasked, nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 347 mapper.setSourceMesh(boundsLonSrcUnmasked.dataFirst(), boundsLatSrcUnmasked.dataFirst(), nVertexSrc, nSrcLocalUnmasked, &srcPole[0], globalSrcUnmasked); 348 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 368 349 369 350 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_zoom.cpp
r1611 r1630 93 93 domainDest_->ni.setValue(niDest); 94 94 domainDest_->nj.setValue(njDest); 95 if ( (niDest==0) || (njDest==0)) 96 { 97 domainDest_->ibegin.setValue(0); 98 domainDest_->jbegin.setValue(0); 99 } 100 else 101 { 102 domainDest_->ibegin.setValue(ibeginDest); 103 domainDest_->jbegin.setValue(jbeginDest); 104 } 95 domainDest_->ibegin.setValue(ibeginDest); 96 domainDest_->jbegin.setValue(jbeginDest); 105 97 domainDest_->i_index.resize(niDest*njDest); 106 98 domainDest_->j_index.resize(niDest*njDest);
Note: See TracChangeset
for help on using the changeset viewer.