Changeset 1158 for XIOS/dev/dev_olga/src
- Timestamp:
- 06/06/17 17:58:16 (7 years ago)
- Location:
- XIOS/dev/dev_olga/src
- Files:
-
- 194 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/array_new.hpp
r731 r1158 302 302 } 303 303 304 bool operator== (const CArray<T_numtype,N_rank>& array) 305 { 306 size_t nbThis = this->numElements(); 307 size_t nbArr = array.numElements(); 308 if (nbThis != nbArr) return false; 309 typename Array<T_numtype,N_rank>::const_iterator itx=array.begin(), itxe=array.end(), ity=this->begin() ; 310 for(;itx!=itxe;++itx,++ity) if (*itx!=*ity) return false ; 311 return true; 312 } 313 314 bool operator== (const Array<T_numtype,N_rank>& array) 315 { 316 return ((*this) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(array))); 317 } 318 304 319 void resize(int extent) 305 320 { … … 552 567 }; 553 568 569 570 #define macro(NRANK)\ 571 \ 572 template <>\ 573 inline size_t CArray<StdString,NRANK>::size(void) const\ 574 {\ 575 size_t size=(1 + NRANK) * sizeof(int) ;\ 576 Array<StdString,NRANK>::const_iterator it, itb=this->begin(), ite=this->end() ;\ 577 \ 578 for(it=itb;it!=ite;++it)\ 579 {\ 580 size+= sizeof(size_t) ;\ 581 size+= (*it).size();\ 582 } \ 583 return size ;\ 584 }\ 585 \ 586 /* for array string this function is an evaluation of maximum size of the array, considering stringArrayLen is the maximum size of the strings*/ \ 587 template <>\ 588 inline size_t CArray<StdString,NRANK>::size(sizeType numElements)\ 589 {\ 590 return (NRANK + 1) * sizeof(int) + numElements * stringArrayLen;\ 591 }\ 592 \ 593 template <>\ 594 inline bool CArray<StdString,NRANK>::toBuffer(CBufferOut& buffer) const\ 595 {\ 596 bool ret;\ 597 ret = buffer.put(this->dimensions());\ 598 ret &= buffer.put(this->shape().data(), this->dimensions());\ 599 \ 600 Array<StdString,NRANK>::const_iterator it, itb=this->begin(), ite=this->end() ;\ 601 \ 602 for(it=itb;it!=ite;++it)\ 603 {\ 604 ret &= buffer.put((*it).size()) ;\ 605 ret &= buffer.put((*it).data(),(*it).size());\ 606 } \ 607 return ret;\ 608 }\ 609 \ 610 template <>\ 611 inline bool CArray<StdString,NRANK>::fromBuffer(CBufferIn& buffer)\ 612 {\ 613 bool ret;\ 614 int numDim;\ 615 TinyVector<int,NRANK> vect;\ 616 size_t ne;\ 617 \ 618 ret = buffer.get(numDim);\ 619 ret &= buffer.get(vect.data(), NRANK);\ 620 this->resize(vect);\ 621 \ 622 Array<StdString,NRANK>::iterator it, itb=this->begin(), ite=this->end() ;\ 623 for(it=itb;it!=ite;++it)\ 624 {\ 625 ret &= buffer.get(ne) ;\ 626 char* str = new char[ne] ;\ 627 ret &= buffer.get(str, ne);\ 628 *it = string(str,ne) ;\ 629 delete [] str ;\ 630 }\ 631 initialized = true;\ 632 return ret;\ 633 } 634 macro(1) 635 macro(2) 636 macro(3) 637 macro(4) 638 macro(5) 639 macro(6) 640 macro(7) 641 642 #undef macro 643 554 644 template <typename T_numtype,int N_rank> inline CBufferOut& operator<<(CBufferOut& buffer, const CArray<T_numtype,N_rank>& array) 555 645 { -
XIOS/dev/dev_olga/src/attribute.cpp
r680 r1158 6 6 namespace xios 7 7 { 8 9 const StdString CAttribute::resetInheritanceStr("_reset_") ; 10 8 11 /// ////////////////////// Définitions ////////////////////// /// 9 12 CAttribute::CAttribute(const StdString & id) 10 : CObject(id), CBaseType() 13 : CObject(id), CBaseType(), _canInherite(true) 11 14 // , value() 12 15 { /* Ne rien faire de plus */ } 13 16 /* 14 CAttribute::CAttribute(const CAttribute & attribut)15 : CObject(attribut.getId()),CBaseType()16 {17 // this->value = attribut.getAnyValue();18 }19 17 */ 20 18 CAttribute::~CAttribute(void) … … 22 20 23 21 ///-------------------------------------------------------------- 24 /*25 const boost::any & CAttribute::getAnyValue(void) const26 {27 return (this->value);28 }29 22 30 31 void CAttribute::setAnyValue(const boost::any & value)32 {33 this->value = value;34 }35 36 void CAttribute::clear(void)37 {38 this->value = boost::any();39 }40 41 //---------------------------------------------------------------42 43 bool CAttribute::isEmpty(void) const44 {45 return (this->value.empty());46 }47 */48 23 const StdString & CAttribute::getName(void) const 49 24 { … … 79 54 ///-------------------------------------------------------------- 80 55 81 82 56 CMessage& operator<<(CMessage& msg,CAttribute& type) 83 57 { -
XIOS/dev/dev_olga/src/attribute.hpp
r1025 r1158 16 16 { 17 17 /// ////////////////////// Déclarations ////////////////////// /// 18 /*! 19 \class CAttribute 20 The fundamental class which describes the attributes of other different class in XIOS. 21 This class only plays a role of interface, its class child will have specific implelemtation corresponding to type of attribute 22 */ 18 23 class CAttribute : public CObject, public virtual CBaseType 19 24 { … … 24 29 /// Constructeurs /// 25 30 explicit CAttribute(const StdString & id); 26 // CAttribute(const CAttribute & attribut);27 // CAttribute(const CAttribute * const attribut); // Not implemented.28 31 29 32 /// Accesseurs /// 30 33 const StdString & getName(void) const; 31 // const boost::any & getAnyValue(void) const;32 // template <typename T> inline T getValue(void) const;33 // template <typename T> inline T* getRef(void);34 34 35 // /// Mutateurs ///36 // template <typename T> inline void setValue(const T & value);37 // void setAnyValue(const boost::any & value);38 // void clear(void);39 40 /// Test ///41 // bool isEmpty(void) const;42 // template <typename T> inline bool isType(void) const;43 35 virtual void set(const CAttribute& ) =0 ; 44 36 virtual void reset(void ) =0 ; … … 49 41 virtual StdString toString(void) const = 0; 50 42 virtual void fromString(const StdString & str) = 0; 51 52 // virtual void toBinary (StdOStream & os) const = 0; 53 // virtual void fromBinary(StdIStream & is) = 0; 43 virtual bool isEqual(const CAttribute& ) = 0; 54 44 55 45 //! Returns true if and only if the attribute should be publicly exposed in the API … … 59 49 virtual bool doSend() const { return true; } 60 50 51 /* 52 Groupd of functions to generate C and Fortran interface 53 */ 61 54 virtual void generateCInterface(ostream& oss, const string& className) = 0 ; 62 55 virtual void generateCInterfaceIsDefined(ostream& oss, const string& className) ; … … 75 68 virtual void setInheritedValue(const CAttribute& ) = 0 ; 76 69 virtual bool hasInheritedValue(void) const = 0; 77 78 protected :79 70 80 /// Constructeurs /// 81 // CAttribute(void); // Not implemented. 82 83 /// Propriété /// 84 // boost::any value; 71 bool canInherite(void) {return _canInherite ;} 72 protected : 73 bool _canInherite ; 74 static const StdString resetInheritanceStr ; 85 75 86 76 }; // class CAttribute 87 77 88 /// ////////////////////// Définitions ////////////////////// ///89 /*90 template <typename T>91 T CAttribute::getValue(void) const92 {93 return (boost::any_cast<T>(this->value));94 }95 96 template <typename T>97 T* CAttribute::getRef(void)98 {99 return (boost::any_cast<T>(&value));100 }101 102 template <typename T>103 void CAttribute::setValue(const T & value)104 {105 this->value = value;106 }107 108 template<typename T>109 bool CAttribute::isType(void) const110 {111 return (this->value.type() == typeid(T));112 }113 */114 115 78 CMessage& operator<<(CMessage& msg,CAttribute& type) ; 116 79 CMessage& operator<<(CMessage& msg, const CAttribute& type) ; -
XIOS/dev/dev_olga/src/attribute_array.hpp
r780 r1158 13 13 { 14 14 /// ////////////////////// Déclarations ////////////////////// /// 15 /*! 16 \class CAttributeArray 17 This class implements the attribute representing array of value 18 */ 15 19 template <typename T_numtype, int N_rank> 16 20 class CAttributeArray : public CAttribute, public CArray<T_numtype, N_rank> … … 19 23 20 24 using CArray<T_numtype,N_rank>::operator = ; 21 // using Array<T_numtype,N_rank>::operator = ;22 25 23 26 /// Constructeurs /// … … 40 43 CArray<T_numtype, N_rank> getInheritedValue(void) const ; 41 44 bool hasInheritedValue(void) const; 45 46 bool isEqual(const CAttributeArray& attr); 47 bool isEqual(const CAttribute& attr); 42 48 43 49 /// Destructeur /// … … 47 53 /// Autre /// 48 54 virtual string toString(void) const { return _toString();} 49 virtual void fromString(const StdString & str) { _fromString(str);}55 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 50 56 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} 51 57 virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } … … 60 66 virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 61 67 62 63 protected :64 65 /// Constructeurs ///66 67 68 private : 68 69 CArray<T_numtype, N_rank> inheritedValue ; -
XIOS/dev/dev_olga/src/attribute_array_decl.cpp
r932 r1158 17 17 template class CAttributeArray<bool,6> ; 18 18 template class CAttributeArray<bool,7> ; 19 template class CAttributeArray<StdString,1> ; 20 template class CAttributeArray<StdString,2> ; 19 21 } -
XIOS/dev/dev_olga/src/attribute_array_impl.hpp
r778 r1158 83 83 void CAttributeArray<T_numtype,N_rank>::setInheritedValue(const CAttributeArray& attr) 84 84 { 85 if (this->isEmpty() && attr.hasInheritedValue())85 if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) 86 86 { 87 87 inheritedValue.resize(attr.shape()) ; … … 103 103 } 104 104 105 template <typename T_numtype, int N_rank> 106 bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttributeArray& attr) 107 { 108 return ((dynamic_cast<CArray<T_numtype,N_rank>& >(*this)) == (dynamic_cast<const CArray<T_numtype,N_rank>& >(attr))); 109 } 110 111 template <typename T_numtype, int N_rank> 112 bool CAttributeArray<T_numtype,N_rank>::isEqual(const CAttribute& attr) 113 { 114 return ((*this) == (dynamic_cast<const CAttributeArray<T_numtype,N_rank>& >(attr))); 115 } 105 116 106 117 template <typename T_numtype, int N_rank> -
XIOS/dev/dev_olga/src/attribute_enum.hpp
r591 r1158 15 15 { 16 16 /// ////////////////////// Déclarations ////////////////////// /// 17 /*! 18 \class CAttributeEnum 19 This class implements the attribute representing enumeration 20 */ 17 21 template <class T> 18 22 class CAttributeEnum : public CAttribute, public CEnum<T> … … 47 51 bool hasInheritedValue(void) const; 48 52 53 bool isEqual(const CAttributeEnum& attr ); 54 bool isEqual(const CAttribute& attr ); 55 49 56 /// Destructeur /// 50 57 virtual ~CAttributeEnum(void) { } … … 55 62 /// Autre /// 56 63 virtual StdString toString(void) const { return _toString();} 57 virtual void fromString(const StdString & str) { _fromString(str);}64 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 58 65 59 66 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} … … 69 76 virtual void generateFortranInterfaceGetDeclaration(ostream& oss,const string& className) ; 70 77 71 72 protected :73 74 /// Constructeurs ///75 // CAttributeTemplate(void); // Not implemented.76 78 private : 77 79 StdString _toString(void) const; -
XIOS/dev/dev_olga/src/attribute_enum_impl.hpp
r580 r1158 88 88 void CAttributeEnum<T>::setInheritedValue(const CAttributeEnum& attr) 89 89 { 90 if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue());90 if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()); 91 91 } 92 92 … … 109 109 { 110 110 return !this->isEmpty() || !inheritedValue.isEmpty(); 111 } 112 113 template <class T> 114 bool CAttributeEnum<T>::isEqual(const CAttribute& attr) 115 { 116 return (this->isEqual(dynamic_cast<const CAttributeEnum<T>& >(attr))); 117 } 118 119 template <class T> 120 bool CAttributeEnum<T>::isEqual(const CAttributeEnum& attr) 121 { 122 return ((dynamic_cast<const CEnum<T>& >(*this)) == (dynamic_cast<const CEnum<T>& >(attr))); 111 123 } 112 124 -
XIOS/dev/dev_olga/src/attribute_map.cpp
r1009 r1158 16 16 ///-------------------------------------------------------------- 17 17 18 /*! 19 Clear all attributes of an object and reset them to empty state 20 */ 18 21 void CAttributeMap::clearAllAttributes(void) 19 22 { … … 29 32 //--------------------------------------------------------------- 30 33 34 /* 35 Clear an attribute and reset its value 36 \param[in] key id of attribute 37 */ 31 38 void CAttributeMap::clearAttribute(const StdString& key) 32 39 { … … 36 43 //--------------------------------------------------------------- 37 44 45 /*! 46 Set an attribute of certain id with a value 47 \param[in] key id of the attribute 48 \param[in] attr value of attribute 49 */ 38 50 void CAttributeMap::setAttribute(const StdString& key, CAttribute* const attr) 39 51 { … … 50 62 //--------------------------------------------------------------- 51 63 64 /*! 65 Subscript operator. Return attribute with a specific id 66 */ 52 67 CAttribute* CAttributeMap::operator[](const StdString& key) 53 68 { … … 103 118 } 104 119 } 120 121 /*! 122 Compare two attribute maps 123 \param [in] another attribute map to compare 124 \param [in] excludedAttrs attribute to be excluded from comparasion 125 \return true if these two maps have same attributes whose value are identical 126 */ 127 bool CAttributeMap::isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs) 128 { 129 SuperClassMap::const_iterator itb = another.begin(), ite = another.end(), it; 130 for (it = itb; it !=ite; ++it) 131 { 132 bool excluded = false; 133 for (int idx = 0; idx < excludedAttrs.size(); ++idx) 134 { 135 if (0 == (*it).first.compare(excludedAttrs[idx])) 136 { 137 excluded = true; 138 break; 139 } 140 } 141 142 if (!excluded) 143 { 144 if ((*it).first.compare(StdString("id")) != 0 && (*it).first.compare(StdString("src")) != 0) 145 { 146 if (this->hasAttribute(it->first)) 147 { 148 if (!((*it).second->isEqual(*(*this)[it->first]))) 149 { 150 return false; 151 } 152 } 153 else 154 return false; 155 } 156 } 157 } 158 159 return true; 160 } 161 105 162 106 163 //--------------------------------------------------------------- … … 129 186 if (apply) 130 187 { 131 if (currentAtt->isEmpty() && !el.second->isEmpty())188 if (currentAtt->isEmpty() && currentAtt->canInherite() && !el.second->isEmpty()) 132 189 { 133 190 this->setAttribute(el.first, el.second); … … 139 196 } 140 197 198 /*! 199 Duplicate attribute map with a specific attribute map. 200 Copy all non-empty attribute of the current attribute map 201 \param [in] srcAttr attribute map which is copied from. 202 */ 141 203 void CAttributeMap::duplicateAttributes(const CAttributeMap* const srcAttr) 142 204 { … … 216 278 } 217 279 */ 280 218 281 void CAttributeMap::generateCInterface(ostream& oss, const string& className) 219 282 { -
XIOS/dev/dev_olga/src/attribute_map.hpp
r1009 r1158 12 12 { 13 13 /// ////////////////////// Déclarations ////////////////////// /// 14 /*! 15 \class CAttributeMap 16 This class represents the set of attributes which an object can have. 17 Each attribute in the set is represented by an unique id. 18 */ 19 14 20 class CAttributeMap 15 21 : public xios_map<StdString, CAttribute*> … … 34 40 35 41 void clearAttribute(const StdString& key); 42 bool isEqual(const CAttributeMap& another, const vector<StdString>& excludedAttrs); 36 43 37 44 /// Destructeur /// … … 74 81 inline bool CAttributeMap::hasAttribute(const StdString& key) const 75 82 { 76 return (this->find(key) != this->end());83 return (this->find(key) != this->end()); 77 84 } 78 85 -
XIOS/dev/dev_olga/src/attribute_template.hpp
r780 r1158 16 16 { 17 17 /// ////////////////////// Déclarations ////////////////////// /// 18 /*! 19 \class CAttributeTemplate 20 The class implements attribute of some basic types 21 */ 18 22 template <class T> 19 23 class CAttributeTemplate : public CAttribute, public CType<T> … … 54 58 bool hasInheritedValue(void) const; 55 59 60 bool isEqual_(const CAttributeTemplate& attr ); 61 bool isEqual(const CAttribute& attr ); 62 56 63 /// Destructeur /// 57 64 virtual ~CAttributeTemplate(void) { } … … 62 69 /// Autre /// 63 70 virtual StdString toString(void) const { return _toString();} 64 virtual void fromString(const StdString & str) { _fromString(str);}71 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 65 72 // virtual CAttributeTemplate* clone() const {} 66 73 // virtual void toBinary (StdOStream & os) const; -
XIOS/dev/dev_olga/src/attribute_template_impl.hpp
r778 r1158 71 71 T CAttributeTemplate<T>::getValue(void) const 72 72 { 73 74 /* 75 76 77 78 79 80 81 73 return CType<T>::get() ; 74 /* 75 if (SuperClass::isEmpty()) 76 { 77 ERROR("T CAttributeTemplate<T>::getValue(void) const", 78 << "[ id = " << this->getId() << "]" 79 << " L'attribut est requis mais n'est pas défini !"); 80 } 81 return (SuperClass::getValue<T>()); 82 82 */ 83 83 } … … 125 125 void CAttributeTemplate<T>::setInheritedValue(const CAttributeTemplate& attr) 126 126 { 127 if (this->isEmpty() && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ;127 if (this->isEmpty() && _canInherite && attr.hasInheritedValue()) inheritedValue.set(attr.getInheritedValue()) ; 128 128 } 129 129 … … 139 139 { 140 140 return !this->isEmpty() || !inheritedValue.isEmpty() ; 141 } 142 143 template <class T> 144 bool CAttributeTemplate<T>::isEqual(const CAttribute& attr) 145 { 146 const CAttributeTemplate<T>& tmp = dynamic_cast<const CAttributeTemplate<T>& >(attr); 147 return this->isEqual_(tmp); 148 } 149 150 template <class T> 151 bool CAttributeTemplate<T>::isEqual_(const CAttributeTemplate& attr) 152 { 153 if ((!this->hasInheritedValue() && !attr.hasInheritedValue())) 154 return true; 155 if (this->hasInheritedValue() && attr.hasInheritedValue()) 156 return (this->getInheritedValue() == attr.getInheritedValue()); 157 else 158 return false; 141 159 } 142 160 -
XIOS/dev/dev_olga/src/client.cpp
r1152 r1158 18 18 MPI_Comm CClient::interComm ; 19 19 std::list<MPI_Comm> CClient::contextInterComms; 20 int CClient::serverLeader ;20 int CClient::serverLeader ; 21 21 bool CClient::is_MPI_Initialized ; 22 22 int CClient::rank_ = INVALID_RANK; … … 54 54 } 55 55 CTimer::get("XIOS").resume() ; 56 CTimer::get("XIOS init ").resume() ;56 CTimer::get("XIOS init/finalize").resume() ; 57 57 boost::hash<string> hashString ; 58 58 59 unsigned long hashClient = hashString(codeId) ; 60 unsigned long hashServer = hashString(CXios::xiosCodeId); 61 // unsigned long hashServer = hashString(CXios::xiosCodeIdPrm); 59 unsigned long hashClient=hashString(codeId) ; 60 unsigned long hashServer=hashString(CXios::xiosCodeId) ; 62 61 unsigned long* hashAll ; 63 62 int size ; … … 71 70 hashAll=new unsigned long[size] ; 72 71 73 MPI_Allgather(&hashClient, 1, MPI_LONG, hashAll, 1, MPI_LONG,CXios::globalComm) ;72 MPI_Allgather(&hashClient,1,MPI_LONG,hashAll,1,MPI_LONG,CXios::globalComm) ; 74 73 75 74 map<unsigned long, int> colors ; … … 90 89 for (i=0; i < size; ++i) 91 90 { 92 if (hash All[i] == hashString(CXios::xiosCodeId))91 if (hashServer == hashAll[i]) 93 92 { 94 93 CXios::setUsingServer(); … … 148 147 149 148 CTimer::get("XIOS").resume() ; 150 CTimer::get("XIOS init ").resume() ;149 CTimer::get("XIOS init/finalize").resume() ; 151 150 152 151 if (CXios::usingServer) … … 216 215 217 216 int messageSize=msg.size() ; 218 void* buff = new char[messageSize] ;219 CBufferOut buffer( buff,messageSize) ;217 char * buff = new char[messageSize] ; 218 CBufferOut buffer((void*)buff,messageSize) ; 220 219 buffer<<msg ; 221 220 222 MPI_Send(buff, buffer.count(), MPI_CHAR, serverLeader, 1, CXios::globalComm) ; 223 MPI_Intercomm_create(contextComm, 0, CXios::globalComm, serverLeader, 10+globalRank, &contextInterComm) ; 221 MPI_Send((void*)buff,buffer.count(),MPI_CHAR,serverLeader,1,CXios::globalComm) ; 222 223 MPI_Intercomm_create(contextComm,0,CXios::globalComm,serverLeader,10+globalRank,&contextInterComm) ; 224 224 info(10)<<"Register new Context : "<<id<<endl ; 225 225 MPI_Comm inter ; … … 257 257 MPI_Comm_free(&intraComm); 258 258 259 CTimer::get("XIOS finalize").suspend() ;259 CTimer::get("XIOS init/finalize").suspend() ; 260 260 CTimer::get("XIOS").suspend() ; 261 261 … … 267 267 268 268 info(20) << "Client side context is finalized"<<endl ; 269 report(0) <<" Performance report : Whole time from XIOS init and finalize: "<< CTimer::get("XIOS init/finalize").getCumulatedTime()<<" s"<<endl ; 269 270 report(0) <<" Performance report : total time spent for XIOS : "<< CTimer::get("XIOS").getCumulatedTime()<<" s"<<endl ; 270 271 report(0)<< " Performance report : time spent for waiting free buffer : "<< CTimer::get("Blocking time").getCumulatedTime()<<" s"<<endl ; 271 report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS ").getCumulatedTime()*100.<<" %"<<endl ;272 report(0)<< " Performance report : Ratio : "<< CTimer::get("Blocking time").getCumulatedTime()/CTimer::get("XIOS init/finalize").getCumulatedTime()*100.<<" %"<<endl ; 272 273 report(0)<< " Performance report : This ratio must be close to zero. Otherwise it may be usefull to increase buffer size or numbers of server"<<endl ; 273 274 // report(0)<< " Memory report : Current buffer_size : "<<CXios::bufferSize<<endl ; 274 275 report(0)<< " Memory report : Minimum buffer size required : " << CClientBuffer::maxRequestSize << " bytes" << endl ; 275 276 report(0)<< " Memory report : increasing it by a factor will increase performance, depending of the volume of data wrote in file at each time step of the file"<<endl ; 276 277 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 277 278 } 278 279 -
XIOS/dev/dev_olga/src/client.hpp
r1148 r1158 11 11 public: 12 12 static void initialize(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm); 13 14 13 static void finalize(void); 15 14 static void registerContext(const string& id, MPI_Comm contextComm); -
XIOS/dev/dev_olga/src/client_client_dht_template_impl.hpp
r1030 r1158 307 307 308 308 indexToInfoMappingLevel_.swap(indexToInfoMapping); 309 310 309 if (0 != recvNbIndexCount) delete [] recvIndexBuff; 311 310 for (boost::unordered_map<int,size_t*>::const_iterator it = client2ClientIndex.begin(); -
XIOS/dev/dev_olga/src/client_server_mapping.hpp
r1030 r1158 26 26 public: 27 27 typedef boost::unordered_map<int, std::vector<size_t> > GlobalIndexMap; 28 // typedef boost::map<int, std::vector<size_t> > GlobalIndexMap;29 28 public: 30 29 /** Default constructor */ -
XIOS/dev/dev_olga/src/config/axis_attribute.conf
r1025 r1158 6 6 7 7 DECLARE_ATTRIBUTE(int, n_glo) 8 DECLARE_ENUM2(positive, up, down) 8 DECLARE_ENUM2(positive, up, down) 9 9 10 10 /* GLOBAL */ … … 29 29 DECLARE_ARRAY(bool, 1 , mask) 30 30 DECLARE_ARRAY(double, 2 , bounds) 31 DECLARE_ATTRIBUTE(int, prec) 32 DECLARE_ARRAY(StdString ,1 , label) -
XIOS/dev/dev_olga/src/config/domain_attribute.conf
r1025 r1158 53 53 DECLARE_ENUM4(type,rectilinear,curvilinear,unstructured, gaussian) 54 54 DECLARE_ATTRIBUTE(StdString, domain_ref) 55 DECLARE_ATTRIBUTE(int, prec) -
XIOS/dev/dev_olga/src/config/domain_attribute_private.conf
r1099 r1158 14 14 DECLARE_ARRAY_PRIVATE(double, 1, latvalue_rectilinear_read_from_file) 15 15 16 // Array contain whole value (non distributed) of longitude and latitude of curvilinear read from a file 17 DECLARE_ARRAY_PRIVATE(double, 2, lonvalue_curvilinear_read_from_file) 18 DECLARE_ARRAY_PRIVATE(double, 2, latvalue_curvilinear_read_from_file) 19 DECLARE_ARRAY_PRIVATE(double, 3, bounds_lonvalue_curvilinear_read_from_file) 20 DECLARE_ARRAY_PRIVATE(double, 3, bounds_latvalue_curvilinear_read_from_file) 21 22 // Array contain whole value (non distributed) of longitude and latitude of unstructured read from a file 23 DECLARE_ARRAY_PRIVATE(double, 1, lonvalue_unstructured_read_from_file) 24 DECLARE_ARRAY_PRIVATE(double, 1, latvalue_unstructured_read_from_file) 25 DECLARE_ARRAY_PRIVATE(double, 2, bounds_lonvalue_unstructured_read_from_file) 26 DECLARE_ARRAY_PRIVATE(double, 2, bounds_latvalue_unstructured_read_from_file) 27 16 28 DECLARE_ATTRIBUTE_PRIVATE(int, global_zoom_ibegin) 17 29 DECLARE_ATTRIBUTE_PRIVATE(int, global_zoom_ni) -
XIOS/dev/dev_olga/src/config/expand_domain_attribute.conf
r941 r1158 2 2 3 3 DECLARE_ENUM2(type,node,edge) 4 5 // Flag to determine if domain expension should be periodic (and in which direction) 6 DECLARE_ATTRIBUTE(bool, i_periodic) 7 DECLARE_ATTRIBUTE(bool, j_periodic) -
XIOS/dev/dev_olga/src/config/file_attribute.conf
r983 r1158 14 14 DECLARE_ENUM2(format, netcdf4, netcdf4_classic) 15 15 DECLARE_ENUM2(convention, CF, UGRID) 16 DECLARE_ATTRIBUTE(StdString, convention_str) 16 17 DECLARE_ENUM2(par_access, collective, independent) 17 18 DECLARE_ATTRIBUTE(bool, append) 18 19 DECLARE_ENUM2(mode, read, write) 19 DECLARE_ENUM 4(time_counter, centered, instant, record, none)20 DECLARE_ENUM7(time_counter, centered, instant, record, exclusive, centered_exclusive, instant_exclusive, none) 20 21 DECLARE_ATTRIBUTE(StdString, time_counter_name) 22 DECLARE_ENUM2(time_units, seconds, days) 21 23 DECLARE_ATTRIBUTE(int, record_offset) 22 24 DECLARE_ATTRIBUTE(bool, cyclic) 23 25 24 26 DECLARE_ATTRIBUTE(int, compression_level) 25 DECLARE_ATTRIBUTE(bool, coupler)26 27 27 28 DECLARE_ENUM4(timeseries, none, only, both, exclusive) 28 29 DECLARE_ATTRIBUTE(StdString, ts_prefix) 29 30 DECLARE_ATTRIBUTE(StdString, time_stamp_name) 31 DECLARE_ATTRIBUTE(StdString, time_stamp_format) 32 DECLARE_ATTRIBUTE(StdString, uuid_name) 33 DECLARE_ATTRIBUTE(StdString, uuid_format) -
XIOS/dev/dev_olga/src/config/interpolate_domain_attribute.conf
r1021 r1158 1 1 /* GLOBAL */ 2 DECLARE_ATTRIBUTE(StdString, file)3 2 DECLARE_ATTRIBUTE(int, order) 4 3 DECLARE_ATTRIBUTE(bool, renormalize) 4 DECLARE_ATTRIBUTE(bool, quantity) 5 5 6 6 /* Write interpolation weights into file */ -
XIOS/dev/dev_olga/src/config/scalar_attribute.conf
r887 r1158 9 9 10 10 DECLARE_ATTRIBUTE(StdString, scalar_ref) 11 DECLARE_ATTRIBUTE(int, prec) -
XIOS/dev/dev_olga/src/config/var_attribute.conf
r527 r1158 1 1 DECLARE_TYPE(type) 2 2 DECLARE_ATTRIBUTE(StdString, name) 3 DECLARE_ENUM4(ts_target, file, field, both, none) -
XIOS/dev/dev_olga/src/context_client.cpp
r1139 r1158 52 52 ranksServerLeader.push_back(rankStart + i); 53 53 54 ranksServerNotLeader.resize(0); } 54 ranksServerNotLeader.resize(0); 55 } 55 56 else 56 57 { … … 125 126 * Send the temporarily buffered event (if any). 126 127 * 127 * \return true if a temporarily buffered event could be sent, false otherwise 128 * \return true if a temporarily buffered event could be sent, false otherwise 128 129 */ 129 130 bool CContextClient::sendTemporarilyBufferedEvent() … … 171 172 } 172 173 } 173 174 174 175 175 /*! … … 323 323 } 324 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 325 /*! 326 Get leading server in the group of connected server 327 \return ranks of leading servers 328 */ 329 const std::list<int>& CContextClient::getRanksServerNotLeader(void) const 330 { 331 return ranksServerNotLeader; 332 } 333 334 /*! 335 Check if client connects to leading server 336 \return connected(true), not connected (false) 337 */ 338 bool CContextClient::isServerNotLeader(void) const 339 { 340 return !ranksServerNotLeader.empty(); 341 } 342 342 343 343 /*! -
XIOS/dev/dev_olga/src/context_client.hpp
r1148 r1158 72 72 MPI_Comm intraComm; //!< Communicator of client group 73 73 74 map<int,CClientBuffer*> buffers; 74 map<int,CClientBuffer*> buffers; //!< Buffers for connection to servers 75 75 76 76 private: -
XIOS/dev/dev_olga/src/context_server.cpp
r1139 r1158 23 23 { 24 24 25 CContextServer::CContextServer(CContext* parent, 25 CContextServer::CContextServer(CContext* parent,MPI_Comm intraComm_,MPI_Comm interComm_) 26 26 { 27 27 context=parent; … … 50 50 pendingEvent=true; 51 51 } 52 53 52 54 53 bool CContextServer::hasPendingEvent(void) … … 207 206 { 208 207 map<int,CServerBuffer*>::iterator it; 209 for(it=buffers.begin();it!=buffers.end();++it) 210 delete it->second; 208 for(it=buffers.begin();it!=buffers.end();++it) delete it->second; 211 209 } 212 210 … … 263 261 } 264 262 } 265 266 263 } -
XIOS/dev/dev_olga/src/context_server.hpp
r1130 r1158 14 14 public: 15 15 16 CContextServer(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm) ; 17 16 CContextServer(CContext* parent,MPI_Comm intraComm,MPI_Comm interComm) ; 18 17 bool eventLoop(bool enableEventsProcessing = true); 19 18 void listen(void) ; 20 19 void checkPendingRequest(void) ; 20 void processRequest(int rank, char* buff,int count) ; 21 21 void processEvents(void) ; 22 22 bool hasFinished(void); … … 24 24 void setPendingEvent(void) ; 25 25 bool hasPendingEvent(void) ; 26 27 void processRequest(int rank, char* buff,int count) ;28 26 29 27 MPI_Comm intraComm ; … … 50 48 51 49 private: 52 std::map<int, StdSize> mapBufferSize_; 53 50 std::map<int, StdSize> mapBufferSize_; 54 51 } ; 55 52 -
XIOS/dev/dev_olga/src/cxios.cpp
r1130 r1158 16 16 string CXios::rootFile="./iodef.xml" ; 17 17 string CXios::xiosCodeId="xios.x" ; 18 // string CXios::xiosCodeIdPrm="xios.x.1" ;19 // string CXios::xiosCodeIdSnd="xios.x.2" ;20 18 string CXios::clientFile="./xios_client"; 21 19 string CXios::serverFile="./xios_server"; … … 36 34 bool CXios::isOptPerformance = true; 37 35 CRegistry* CXios::globalRegistry = 0; 36 double CXios::recvFieldTimeout = 10.0; 38 37 39 38 //! Parse configuration file and create some objects from it … … 71 70 bufferSizeFactor = getin<double>("buffer_size_factor", defaultBufferSizeFactor); 72 71 minBufferSize = getin<int>("min_buffer_size", 1024 * sizeof(double)); 72 recvFieldTimeout = getin<double>("recv_field_timeout", 10.0); 73 if (recvFieldTimeout < 0.0) 74 ERROR("CXios::parseXiosConfig()", "recv_field_timeout cannot be negative."); 73 75 74 76 globalComm=MPI_COMM_WORLD ; … … 115 117 delete globalRegistry ; 116 118 } 117 CClient::closeInfoStream();118 119 119 120 120 #ifdef XIOS_MEMTRACK 121 122 #ifdef XIOS_MEMTRACK_LIGHT 123 report(10) << " Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 124 report(10) << " Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 125 #endif 126 127 #ifdef XIOS_MEMTRACK_FULL 121 128 MemTrack::TrackListMemoryUsage() ; 122 129 MemTrack::TrackDumpBlocks(); 130 #endif 131 132 CClient::closeInfoStream(); 133 123 134 #endif 124 135 } … … 138 149 { 139 150 initServer(); 151 isClient = false; 152 isServer = true; 140 153 141 154 // Initialize all aspects MPI 142 155 CServer::initialize(); 143 isServer = true;144 isClient = false;145 146 156 if (CServer::getRank()==0) globalRegistry = new CRegistry(CServer::intraComm) ; 147 157 … … 181 191 } 182 192 CServer::finalize(); 193 194 #ifdef XIOS_MEMTRACK 195 196 #ifdef XIOS_MEMTRACK_LIGHT 197 report(10) << " Memory report : current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 198 report(10) << " Memory report : maximum memory used by XIOS : "<< MemTrack::getMaxMemorySize()*1.0/(1024*1024)<<" Mbyte" << endl ; 199 #endif 200 201 #ifdef XIOS_MEMTRACK_FULL 202 MemTrack::TrackListMemoryUsage() ; 203 MemTrack::TrackDumpBlocks(); 204 #endif 205 #endif 183 206 CServer::closeInfoStream(); 184 207 } -
XIOS/dev/dev_olga/src/cxios.hpp
r1077 r1158 37 37 static bool isServer ; //!< Check if xios is server 38 38 39 // static int serverLevel ;40 41 39 static MPI_Comm globalComm ; //!< Global communicator 42 40 … … 51 49 static bool isOptPerformance; //!< Check if buffer size is for performance (as large as possible) 52 50 static CRegistry* globalRegistry ; //!< global registry which is wrote by the root process of the servers 51 static double recvFieldTimeout; //!< Time to wait for data before issuing an error when receiving a field 53 52 54 53 public: -
XIOS/dev/dev_olga/src/data_output.cpp
r887 r1158 84 84 //---------------------------------------------------------------- 85 85 86 void CDataOutput::writeField (CField* field)86 void CDataOutput::writeFieldTimeAxis(CField* field) 87 87 { 88 88 CContext* context = CContext::getCurrent() ; 89 89 boost::shared_ptr<CCalendar> calendar = context->getCalendar(); 90 90 91 this->writeTimeAxis_(field, calendar); 92 } 93 94 void CDataOutput::writeField(CField* field) 95 { 91 96 this->writeField_(field); 92 this->writeTimeAxis_(field, calendar);93 97 } 94 98 -
XIOS/dev/dev_olga/src/data_output.hpp
r887 r1158 25 25 void closeFile (void); 26 26 void writeField (CField* field); 27 void writeFieldTimeAxis(CField* field) ; 27 28 void writeFieldGrid(CField* field); 28 29 void writeTimeDimension(void); -
XIOS/dev/dev_olga/src/date.cpp
r647 r1158 62 62 hour = date.hour; minute = date.minute; second = date.second; 63 63 return (*this); 64 } 65 66 bool CDate::operator==(const CDate& date) 67 { 68 return (&(*relCalendar) == &(*date.relCalendar) && 69 year == date.year && month == date.month && day == date.day && 70 hour == date.hour && minute == date.minute && second == date.second); 71 64 72 } 65 73 -
XIOS/dev/dev_olga/src/date.hpp
r591 r1158 32 32 /// Opérateurs /// 33 33 CDate& operator=(const CDate& date); 34 bool operator==(const CDate& date); 34 35 friend StdOStream& operator<<(StdOStream& out, const CDate& date); 35 36 friend StdIStream& operator>>(StdIStream& in, CDate& date); -
XIOS/dev/dev_olga/src/declare_ref_func.hpp
r1099 r1158 107 107 if (refer_ptr->hasAutoGeneratedId() && \ 108 108 refer_ptr->hasDirect##type##Reference()) \ 109 nameRef = refer_ptr->name_##_ref;\109 nameRef = refer_ptr->name_##_ref; \ 110 110 else { \ 111 112 113 114 111 nameRef = refer_ptr->getId(); break; \ 112 } \ 113 if (tmpRefObjects.end() != tmpRefObjects.find(refer_ptr)) \ 114 { \ 115 115 ERROR("const StdString& C" #type "::get" #type "OutputName(void) const ", \ 116 117 118 }\116 << "Circular dependency stopped for " #name_ " object " \ 117 << "with id = \"" << refer_ptr->getId() << "\"."); \ 118 } \ 119 119 } \ 120 120 return nameRef; \ -
XIOS/dev/dev_olga/src/dht_auto_indexing.cpp
r924 r1158 79 79 for (itIdx = itbIdx; itIdx != iteIdx; ++itIdx) 80 80 { 81 (itIdx->second)[0] = beginIndexOnProc_ + idx; 81 // (itIdx->second)[0] = beginIndexOnProc_ + idx; 82 (itIdx->second)[1] = beginIndexOnProc_ + idx; 82 83 globalIndex_[idx] = beginIndexOnProc_ + idx; 83 84 ++idx ; -
XIOS/dev/dev_olga/src/distribution_client.cpp
r1144 r1158 152 152 infoIndex_.resize(this->dims_); 153 153 154 // A trick to determine position of each domain in domainList 155 int domIndex = 0, axisIndex = 0, scalarIndex = 0; 156 idx = 0; 157 154 158 elementLocalIndex_.resize(numElement_); 155 159 elementGlobalIndex_.resize(numElement_); … … 158 162 elementNLocal_.resize(numElement_); 159 163 elementNGlobal_.resize(numElement_); 160 161 164 elementNLocal_[0] = 1; 162 165 elementNGlobal_[0] = 1; 166 size_t localSize = 1, globalSize = 1; 167 163 168 isDataDistributed_ = false; 164 165 size_t localSize = 1, globalSize = 1;166 167 // A trick to determine position of each domain in domainList168 int domIndex = 0, axisIndex = 0, scalarIndex = 0;169 idx = 0;170 171 172 169 // Update all the vectors above 173 170 for (idx = 0; idx < numElement_; ++idx) -
XIOS/dev/dev_olga/src/distribution_server.hpp
r1144 r1158 43 43 virtual void createGlobalIndex(); 44 44 45 void createGlobalIndexFromIndex(const std::vector<CArray<int,1> >& globalIndexOnEachDimension,46 const std::vector<int>& nbGlobal);47 48 45 protected: 49 46 GlobalLocalMap globalLocalIndexMap_; -
XIOS/dev/dev_olga/src/duration.cpp
r612 r1158 26 26 } 27 27 28 /*! 29 This operation may not serve much, it's here because of the need of operator== from generic class CType<T> 30 */ 31 bool CDuration::operator==(const CDuration& duration) 32 { 33 return (year == duration.year && month == duration.month && day == duration.day && 34 hour == duration.hour && minute == duration.minute && second == duration.second && timestep == duration.timestep); 35 } 36 28 37 StdOStream& operator<<(StdOStream& out, const CDuration& duration) 29 38 { … … 38 47 char c = '/'; 39 48 bool invalidUnit = false; 49 CDuration sentinel = NoneDu; 50 51 #define setDuration(unit, value) \ 52 { \ 53 if (sentinel.unit) \ 54 ERROR("StdIStream& operator>>(StdIStream& in , CDuration& duration)", \ 55 << "Bad duration format: " #unit " has already been set."); \ 56 \ 57 duration.unit = value; \ 58 sentinel.unit = 1.0; \ 59 } 40 60 41 61 do … … 48 68 switch (c) 49 69 { 50 case 'y': duration.year = v;break;51 case 'd': duration.day = v;break;52 case 'h': duration.hour = v;break;53 case 's': duration.second = v;break;70 case 'y': setDuration(year, v) break; 71 case 'd': setDuration(day, v) break; 72 case 'h': setDuration(hour, v) break; 73 case 's': setDuration(second, v) break; 54 74 case 'm': 55 75 { 56 76 in >> c; 57 if (c == 'i') duration.minute = v;58 else if (c == 'o') duration.month = v;77 if (c == 'i') setDuration(minute, v) 78 else if (c == 'o') setDuration(month, v) 59 79 else invalidUnit = true; 60 80 break; … … 63 83 { 64 84 in >> c; 65 if (c == 's') duration.timestep = v;85 if (c == 's') setDuration(timestep, v) 66 86 else invalidUnit = true; 67 87 break; … … 76 96 << "Bad duration format: invalid unit, unexpected '" << c << "' character."); 77 97 } while (in.peek() != EOF); // check whether there is a next character to read 98 99 #undef setDuration 78 100 79 101 return in; -
XIOS/dev/dev_olga/src/duration.hpp
r612 r1158 22 22 /// Opérateurs /// 23 23 CDuration& operator=(const CDuration& duration); 24 bool operator==(const CDuration& duration); 24 25 25 26 friend StdOStream& operator<<(StdOStream& out, const CDuration& duration); -
XIOS/dev/dev_olga/src/event_scheduler.cpp
r992 r1158 150 150 size_t hashId=recvRequest->buffer[1] ; 151 151 size_t lev=recvRequest->buffer[2] ; 152 //delete recvRequest ;152 delete recvRequest ; 153 153 pendingRecvParentRequest.pop() ; 154 154 155 155 if (lev==level) eventStack.push(pair<size_t,size_t>(timeLine,hashId)) ; 156 156 else bcastEvent(timeLine, hashId, lev) ; 157 delete recvRequest ;158 157 } 159 158 } -
XIOS/dev/dev_olga/src/filter/file_server_writer_filter.cpp
r1026 r1158 18 18 field->writeUpdateData(data[0]->data); 19 19 } 20 21 bool CFileServerWriterFilter::isDataExpected(const CDate& date) const 22 { 23 return true; 24 } 20 25 } // namespace xios -
XIOS/dev/dev_olga/src/filter/file_server_writer_filter.hpp
r1026 r1158 23 23 CFileServerWriterFilter(CGarbageCollector& gc, CField* field); 24 24 25 bool virtual isDataExpected(const CDate& date) const; 25 26 protected: 26 27 /*! -
XIOS/dev/dev_olga/src/filter/file_writer_filter.cpp
r639 r1158 2 2 #include "exception.hpp" 3 3 #include "field.hpp" 4 #include "utils.hpp" 4 5 5 6 namespace xios … … 16 17 void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 17 18 { 19 bool ignoreMissingValue = (!field->detect_missing_value.isEmpty() && 20 !field->default_value.isEmpty() && 21 field->detect_missing_value == true); 22 if (ignoreMissingValue) 23 { 24 double missingValue = field->default_value; 25 size_t nbData = data[0]->data.numElements(); 26 for (size_t idx = 0; idx < nbData; ++idx) 27 { 28 if (NumTraits<double>::isnan(data[0]->data(idx))) 29 data[0]->data(idx) = missingValue; 30 } 31 } 32 18 33 field->sendUpdateData(data[0]->data); 19 34 } 35 36 bool CFileWriterFilter::isDataExpected(const CDate& date) const 37 { 38 return true; 39 } 20 40 } // namespace xios -
XIOS/dev/dev_olga/src/filter/file_writer_filter.hpp
r639 r1158 23 23 CFileWriterFilter(CGarbageCollector& gc, CField* field); 24 24 25 /*! 26 * Tests whether data is expected for the specified date. 27 * 28 * \param date the date associated to the data 29 */ 30 bool virtual isDataExpected(const CDate& date) const; 31 25 32 protected: 26 33 /*! -
XIOS/dev/dev_olga/src/filter/filter.cpp
r1021 r1158 40 40 return (CInputPin::canBeTriggered() || COutputPin::canBeTriggered()); 41 41 } 42 43 bool CFilter::isDataExpected(const CDate& date) const 44 { 45 return COutputPin::isDataExpected(date); 46 } 42 47 } // namespace xios -
XIOS/dev/dev_olga/src/filter/filter.hpp
r1021 r1158 48 48 bool virtual canBeTriggered() const; 49 49 50 /*! 51 * Tests whether data is expected for the specified date. 52 * 53 * \param date the date associated to the data 54 */ 55 bool virtual isDataExpected(const CDate& date) const; 56 50 57 protected: 51 58 IFilterEngine* engine; //!< The filter engine, might be the filter itself -
XIOS/dev/dev_olga/src/filter/input_pin.hpp
r1021 r1158 60 60 61 61 /*! 62 * Tests whether data is expected for the specified date. 63 * 64 * \param date the date associated to the data 65 */ 66 bool virtual isDataExpected(const CDate& date) const = 0; 67 68 /*! 62 69 * Removes all pending packets which are older than the specified timestamp. 63 70 * -
XIOS/dev/dev_olga/src/filter/output_pin.cpp
r1021 r1158 73 73 } 74 74 75 bool COutputPin::isDataExpected(const CDate& date) const 76 { 77 std::vector<std::pair<boost::shared_ptr<CInputPin>, size_t> >::const_iterator it, itEnd; 78 for (it = outputs.begin(), itEnd = outputs.end(); it != itEnd; ++it) 79 { 80 if (it->first->isDataExpected(date)) 81 return true; 82 } 83 84 return false; 85 } 86 75 87 void COutputPin::invalidate(Time timestamp) 76 88 { -
XIOS/dev/dev_olga/src/filter/output_pin.hpp
r1021 r1158 46 46 47 47 /*! 48 * Tests whether data is expected for the specified date. 49 * 50 * \param date the date associated to the data 51 */ 52 bool virtual isDataExpected(const CDate& date) const; 53 54 /*! 48 55 * Removes all pending packets which are older than the specified timestamp. 49 56 * -
XIOS/dev/dev_olga/src/filter/source_filter.cpp
r1021 r1158 3 3 #include "exception.hpp" 4 4 #include "calendar_util.hpp" 5 #include <limits> 5 6 6 7 namespace xios 7 8 { 8 9 CSourceFilter::CSourceFilter(CGarbageCollector& gc, CGrid* grid, 9 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/) 10 const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 11 bool hasMissingValue /*= false*/, 12 double defaultValue /*= 0.0*/) 10 13 : COutputPin(gc, manualTrigger) 11 14 , grid(grid) 12 15 , offset(offset) 16 , hasMissingValue(hasMissingValue), defaultValue(defaultValue) 13 17 { 14 18 if (!grid) … … 29 33 packet->data.resize(grid->storeIndex_client.numElements()); 30 34 grid->inputField(data, packet->data); 35 36 // Convert missing values to NaN 37 if (hasMissingValue) 38 { 39 double nanValue = std::numeric_limits<double>::quiet_NaN(); 40 size_t nbData = packet->data.numElements(); 41 for (size_t idx = 0; idx < nbData; ++idx) 42 { 43 if (defaultValue == packet->data(idx)) 44 packet->data(idx) = nanValue; 45 } 46 } 31 47 32 48 onOutputReady(packet); -
XIOS/dev/dev_olga/src/filter/source_filter.hpp
r1021 r1158 23 23 * \param offset the offset applied to the timestamp of all packets 24 24 * \param manualTrigger whether the output should be triggered manually 25 * \param hasMissingValue whether data has missing value 26 * \param defaultValue missing value to detect 25 27 */ 26 28 CSourceFilter(CGarbageCollector& gc, CGrid* grid, 27 const CDuration offset = NoneDu, bool manualTrigger = false); 29 const CDuration offset = NoneDu, bool manualTrigger = false, 30 bool hasMissingValue = false, 31 double defaultValue = 0.0); 28 32 29 33 /*! … … 58 62 CGrid* grid; //!< The grid attached to the data the filter can accept 59 63 const CDuration offset; //!< The offset applied to the timestamp of all packets 64 bool hasMissingValue; 65 double defaultValue; 60 66 }; // class CSourceFilter 61 67 } // namespace xios -
XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp
r1021 r1158 11 11 12 12 std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 13 CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue)13 CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue) 14 14 { 15 15 if (!srcGrid || !destGrid) … … 26 26 const std::vector<StdString>& auxInputs = gridTransformation->getAuxInputs(); 27 27 size_t inputCount = 1 + (auxInputs.empty() ? 0 : auxInputs.size()); 28 double defaultValue = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0; 28 29 boost::shared_ptr<CSpatialTransformFilter> filter(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 29 30 … … 103 104 } 104 105 packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 105 packet->data = defaultValue; 106 if (0 != packet->data.numElements()) 107 (packet->data)(0) = defaultValue; 106 108 apply(data[0]->data, packet->data); 107 109 } … … 115 117 116 118 // Get default value for output data 117 double defaultValue = 0.0; 118 if (0 != dataDest.numElements()) defaultValue = dataDest(0); 119 bool ignoreMissingValue = false; 120 double defaultValue = std::numeric_limits<double>::quiet_NaN(); 121 if (0 != dataDest.numElements()) ignoreMissingValue = NumTraits<double>::isnan(dataDest(0)); 119 122 120 123 const std::list<CGridTransformation::SendingIndexGridSourceMap>& listLocalIndexSend = gridTransformation->getLocalIndexToSendFromGridSource(); … … 191 194 else dataCurrentDest(i) = defaultValue; 192 195 193 std::vector<bool> localInitFlag(dataCurrentDest. size(), true);196 std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true); 194 197 currentBuff = 0; 195 198 for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) … … 201 204 dataCurrentDest, 202 205 localInitFlag, 203 defaultValue);206 ignoreMissingValue); 204 207 205 208 currentBuff += countSize; -
XIOS/dev/dev_olga/src/filter/spatial_transform_filter.hpp
r873 r1158 32 32 * \param srcGrid the source grid 33 33 * \param destGrid the destination grid 34 * \param hasMissingValue whether field source has missing value 35 * \param defaultValue default value 34 36 * \return the first and the last filters of the filter graph 35 37 */ 36 38 static std::pair<boost::shared_ptr<CSpatialTransformFilter>, boost::shared_ptr<CSpatialTransformFilter> > 37 buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, double defaultValue);39 buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue); 38 40 39 41 protected: -
XIOS/dev/dev_olga/src/filter/store_filter.cpp
r1021 r1158 24 24 CTimer timer("CStoreFilter::getPacket"); 25 25 CConstDataPacketPtr packet; 26 const double timeout = 10 ; // 10 seconds timeout26 const double timeout = CXios::recvFieldTimeout; 27 27 28 28 do … … 81 81 } 82 82 83 bool CStoreFilter::isDataExpected(const CDate& date) const 84 { 85 return true; 86 } 87 83 88 void CStoreFilter::invalidate(Time timestamp) 84 89 { -
XIOS/dev/dev_olga/src/filter/store_filter.hpp
r1021 r1158 50 50 51 51 /*! 52 * Tests whether data is expected for the specified date. 53 * 54 * \param date the date associated to the data 55 */ 56 bool virtual isDataExpected(const CDate& date) const; 57 58 /*! 52 59 * Removes all pending packets which are older than the specified timestamp. 53 60 * -
XIOS/dev/dev_olga/src/filter/temporal_filter.cpp
r854 r1158 5 5 namespace xios 6 6 { 7 static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData); 8 7 9 CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 8 10 const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 9 11 bool ignoreMissingValue /*= false*/, double missingValue /*= 0.0*/) 10 12 : CFilter(gc, 1, this) 11 , samplingFreq(samplingFreq) 13 , functor(createFunctor(opId, ignoreMissingValue, missingValue, tmpData)) 14 , isOnceOperation(functor->timeType() == func::CFunctor::once) 15 , isInstantOperation(functor->timeType() == func::CFunctor::instant) 16 // If we can optimize the sampling when dealing with an instant functor we do it 17 , samplingFreq((isInstantOperation && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq : samplingFreq) 18 , samplingOffset((isInstantOperation && samplingFreq == TimeStep && samplingOffset == NoneDu) ? opFreq - initDate.getRelCalendar().getTimeStep() : samplingOffset) 12 19 , opFreq(opFreq) 13 , nextSamplingDate(initDate + samplingOffset + initDate.getRelCalendar().getTimeStep())14 , nextOperationDate(initDate + opFreq)20 , nextSamplingDate(initDate + this->samplingOffset + initDate.getRelCalendar().getTimeStep()) 21 , nextOperationDate(initDate + this->samplingOffset + opFreq) 15 22 , isFirstOperation(true) 16 23 { 17 #define DECLARE_FUNCTOR(MType, mtype) \18 if (opId.compare(#mtype) == 0) \19 { \20 if (ignoreMissingValue) \21 { \22 functor.reset(new func::C##MType(tmpData, missingValue)); \23 } \24 else \25 { \26 functor.reset(new func::C##MType(tmpData)); \27 } \28 }29 30 #include "functor_type.conf"31 32 if (!functor)33 ERROR("CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, ...)",34 << "\"" << opId << "\" is not a valid operation.");35 36 isOnceOperation = (functor->timeType() == func::CFunctor::once);37 24 } 38 25 … … 43 30 if (data[0]->status != CDataPacket::END_OF_STREAM) 44 31 { 45 const bool usePacket = isOnceOperation ? isFirstOperation : (data[0]->date >= nextSamplingDate); 32 bool usePacket, outputResult, copyLess; 33 if (isOnceOperation) 34 usePacket = outputResult = copyLess = isFirstOperation; 35 else 36 { 37 usePacket = (data[0]->date >= nextSamplingDate); 38 outputResult = (data[0]->date + samplingFreq > nextOperationDate); 39 copyLess = (isInstantOperation && usePacket && outputResult); 40 } 41 46 42 if (usePacket) 47 43 { 48 if (!tmpData.numElements()) 49 tmpData.resize(data[0]->data.numElements()); 44 if (!copyLess) 45 { 46 if (!tmpData.numElements()) 47 tmpData.resize(data[0]->data.numElements()); 50 48 51 (*functor)(data[0]->data); 49 (*functor)(data[0]->data); 50 } 52 51 53 52 nextSamplingDate = nextSamplingDate + samplingFreq; 54 53 } 55 54 56 const bool outputResult = isOnceOperation ? isFirstOperation : (data[0]->date + samplingFreq > nextOperationDate);57 55 if (outputResult) 58 56 { 59 functor->final(); 57 if (!copyLess) 58 { 59 functor->final(); 60 60 61 packet = CDataPacketPtr(new CDataPacket); 62 packet->date = data[0]->date; 63 packet->timestamp = data[0]->timestamp; 64 packet->status = data[0]->status; 65 packet->data.resize(tmpData.numElements()); 66 packet->data = tmpData; 61 packet = CDataPacketPtr(new CDataPacket); 62 packet->date = data[0]->date; 63 packet->timestamp = data[0]->timestamp; 64 packet->status = data[0]->status; 65 packet->data.resize(tmpData.numElements()); 66 packet->data = tmpData; 67 } 68 else 69 packet = data[0]; 67 70 68 71 isFirstOperation = false; … … 73 76 return packet; 74 77 } 78 79 bool CTemporalFilter::isDataExpected(const CDate& date) const 80 { 81 return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate); 82 } 83 84 static func::CFunctor* createFunctor(const std::string& opId, bool ignoreMissingValue, double missingValue, CArray<double, 1>& tmpData) 85 { 86 func::CFunctor* functor = NULL; 87 88 double defaultValue = ignoreMissingValue ? std::numeric_limits<double>::quiet_NaN() : missingValue; 89 90 #define DECLARE_FUNCTOR(MType, mtype) \ 91 if (opId.compare(#mtype) == 0) \ 92 { \ 93 if (ignoreMissingValue) \ 94 { \ 95 functor = new func::C##MType(tmpData, defaultValue); \ 96 } \ 97 else \ 98 { \ 99 functor = new func::C##MType(tmpData); \ 100 } \ 101 } 102 103 #include "functor_type.conf" 104 105 if (!functor) 106 ERROR("createFunctor(const std::string& opId, ...)", 107 << "\"" << opId << "\" is not a valid operation."); 108 109 return functor; 110 } 75 111 } // namespace xios -
XIOS/dev/dev_olga/src/filter/temporal_filter.hpp
r643 r1158 40 40 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 41 41 42 /*! 43 * Tests whether data is expected for the specified date. 44 * 45 * \param date the date associated to the data 46 */ 47 bool virtual isDataExpected(const CDate& date) const; 48 42 49 private: 43 boost::scoped_ptr<func::CFunctor> functor; //!< The functor corresponding to the temporal operation50 const boost::scoped_ptr<func::CFunctor> functor; //!< The functor corresponding to the temporal operation 44 51 CArray<double, 1> tmpData; //!< The array of data used for temporary storage 45 52 const CDuration samplingFreq; //!< The sampling frequency, i.e. the frequency at which the input data will be used 53 const CDuration samplingOffset; //!< The sampling offset, i.e. the offset after which the input data will be used 46 54 const CDuration opFreq; //!< The operation frequency, i.e. the frequency at which the output data will be computed 47 55 CDate nextSamplingDate; //!< The date of the next sampling 48 56 CDate nextOperationDate; //!< The date of the next operation 49 57 bool isFirstOperation; //!< True before the first operation was been computed 50 bool isOnceOperation; //!< True if the operation should be computed just once 58 const bool isOnceOperation; //!< True if the operation should be computed just once 59 const bool isInstantOperation; //!< True if the operation is instant 51 60 }; // class CTemporalFilter 52 61 } // namespace xios -
XIOS/dev/dev_olga/src/functor/accumulate.cpp
r591 r1158 1 1 #include "accumulate.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp" 3 4 4 5 namespace xios … … 33 34 double* out=_doutput.dataFirst(); 34 35 for (i=0; i<n; ++i,++in,++out) 35 if ( *in!=missingValue)36 if (!NumTraits<double>::isnan(*in)) 36 37 { 37 if( *out!=missingValue) *out += *in;38 if(!NumTraits<double>::isnan(*out)) *out += *in; 38 39 else *out=*in ; 39 40 } -
XIOS/dev/dev_olga/src/functor/average.cpp
r591 r1158 1 1 #include "average.hpp" 2 2 #include "array_new.hpp" 3 #include "utils.hpp" 3 4 4 5 namespace xios … … 42 43 int* nc=nbcalls.dataFirst() ; 43 44 for (i=0; i<n; ++i,++nc,++in) 44 if ( *in!=missingValue) (*nc) ++;45 if (!NumTraits<double>::isnan(*in)) (*nc) ++; 45 46 } 46 47 } … … 54 55 int* nc=nbcalls.dataFirst() ; 55 56 for (i=0; i<n; ++i,++in,++out,++nc) 56 if ( *in!=missingValue)57 if (!NumTraits<double>::isnan(*in)) 57 58 { 58 59 if (*nc != 0) (*out) += *in; -
XIOS/dev/dev_olga/src/functor/maximum.cpp
r591 r1158 1 1 #include "maximum.hpp" 2 2 #include "array_new.hpp" 3 4 3 #include "utils.hpp" 5 4 6 5 namespace xios … … 35 34 { 36 35 for (; it1 != end1; it1++, it++) 37 if ( *it1 != missingValue)36 if (!NumTraits<double>::isnan(*it1)) 38 37 { 39 if ( *it != missingValue) *it = std::max(*it1, *it);38 if (!NumTraits<double>::isnan(*it)) *it = std::max(*it1, *it); 40 39 else *it=*it1 ; 41 40 } -
XIOS/dev/dev_olga/src/functor/minimum.cpp
r591 r1158 2 2 #include "array_new.hpp" 3 3 #include <algorithm> 4 #include "utils.hpp" 4 5 5 6 namespace xios … … 26 27 { 27 28 const double * it1 = _dinput.dataFirst(), 28 * 29 *end1 = _dinput.dataFirst() + _dinput.numElements(); 29 30 double * it = _doutput.dataFirst(); 30 31 … … 35 36 { 36 37 for (; it1 != end1; it1++, it++) 37 if ( *it1!=missingValue)38 if (!NumTraits<double>::isnan(*it1)) 38 39 { 39 if ( *it != missingValue) *it = std::min(*it1, *it);40 if (!NumTraits<double>::isnan(*it)) *it = std::min(*it1, *it); 40 41 else *it=*it1 ; 41 42 } -
XIOS/dev/dev_olga/src/generate_interface_impl.hpp
r966 r1158 547 547 #undef macro 548 548 549 #define macro(N,EXTENT)\ 550 template <>\ 551 void CInterface::AttributeCInterface<CArray<StdString,N> >(ostream& oss, const string& className, const string& name)\ 552 { \ 553 oss << "void cxios_set_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << "char* " << name <<", int str_len, int* str_size, int* extent)" << iendl; \ 554 oss << "{" << iendl; \ 555 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 556 oss << " "<<className<<"_hdl->"<<name<<".resize(shape("<<EXTENT<<"));"<<iendl;\ 557 oss << " Array<StdString,"<<#N<<">::iterator it, itb="<<className<<"_hdl->"<<name<<".begin(), ite="<<className<<"_hdl->"<<name<<".end() ;"<<iendl ;\ 558 oss << " int i, n ;"<< iendl; \ 559 oss << " for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&"<<name<<"[n],str_size[i]) ;"<<iendl ;\ 560 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 561 oss << "}" << std::endl; \ 562 oss << iendl; \ 563 oss << "void cxios_get_" << className << "_" << name << "(" << className << "_Ptr " << className << "_hdl, " << "char* " << name << ", int str_size, int* extent)" << iendl; \ 564 oss << "{" << iendl; \ 565 oss << " CTimer::get(\"XIOS\").resume();" << iendl; \ 566 oss << " Array<StdString,"<<#N<<">::const_iterator it, itb="<<className<<"_hdl->"<<name<<".getInheritedValue().begin(), ite="<<className<<"_hdl->"<<name<<".getInheritedValue().end() ;" << iendl; \ 567 oss << " int n ;"<< iendl; \ 568 oss << " for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&"<<name<<"[n],it->size()) ; "<< iendl; \ 569 oss << " CTimer::get(\"XIOS\").suspend();" << iendl; \ 570 oss << "}" << std::endl; \ 571 } 572 573 macro(1,"extent[0]") 574 macro(2,"extent[0],extent[1]") 575 macro(3,"extent[0],extent[1],extent[2]") 576 macro(4,"extent[0],extent[1],extent[2],extent[3]") 577 macro(5,"extent[0],extent[1],extent[2],extent[3],extent[4]") 578 macro(6,"extent[0],extent[1],extent[2],extent[3],extent[4],extent[5]") 579 macro(7,"extent[0],extent[1],extent[2],extent[3],extent[4],extent[5],extent[6]") 580 #undef macro 549 581 // ///////////////////////////////////////////////// 550 582 // // Fortran 2003 Interface // … … 705 737 #undef macro 706 738 739 #define macro(T)\ 740 template <>\ 741 void CInterface::AttributeFortran2003Interface<CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 742 {\ 743 oss << "SUBROUTINE cxios_set_" << className << "_" << name << "(" << className << "_hdl, " << name << ", str_len, str_size, extent) BIND(C)" << iendl; \ 744 oss << " USE ISO_C_BINDING" << iendl; \ 745 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 746 oss << " CHARACTER (KIND=C_CHAR), DIMENSION(*) :: " << name << iendl; \ 747 oss << " INTEGER (kind = C_INT), VALUE :: str_len" << iendl; \ 748 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: str_size" << iendl; \ 749 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 750 oss << "END SUBROUTINE cxios_set_" << className << "_" << name << std::endl; \ 751 oss << iendl; \ 752 oss << "SUBROUTINE cxios_get_" << className << "_" << name << "(" << className << "_hdl, " << name << ", str_size, extent) BIND(C)" << iendl; \ 753 oss << " USE ISO_C_BINDING" << iendl; \ 754 oss << " INTEGER (kind = C_INTPTR_T), VALUE :: " << className << "_hdl" << iendl; \ 755 oss << " CHARACTER (KIND=C_CHAR), DIMENSION(*) :: " << name << iendl; \ 756 oss << " INTEGER (kind = C_INT), VALUE :: str_size" << iendl; \ 757 oss << " INTEGER (kind = C_INT), DIMENSION(*) :: extent" << iendl; \ 758 oss << "END SUBROUTINE cxios_get_" << className << "_" << name << std::endl; \ 759 } 760 macro(1) 761 macro(2) 762 macro(3) 763 macro(4) 764 macro(5) 765 macro(6) 766 macro(7) 767 768 #undef macro 769 707 770 #define macro(T) \ 708 771 template <> \ … … 808 871 809 872 #undef macro 873 874 #define macro(T,EXTENT)\ 875 template <> \ 876 void CInterface::AttributeFortranInterfaceDeclaration<CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 877 {\ 878 oss << "CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: " << name << "("<<EXTENT<<")"; \ 879 }\ 880 \ 881 template <>\ 882 void CInterface::AttributeFortranInterfaceGetDeclaration<CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 883 {\ 884 oss << "CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: " << name << "("<<EXTENT<<")"; \ 885 } 886 macro(1,":") 887 macro(2,":,:") 888 macro(3,":,:,:") 889 macro(4,":,:,:,:") 890 macro(5,":,:,:,:,:") 891 macro(6,":,:,:,:,:,:") 892 macro(7,":,:,:,:,:,:,:") 893 894 #undef macro 895 896 897 898 899 810 900 811 901 #define macro(T) \ … … 947 1037 #undef macro 948 1038 1039 #define macro(T)\ 1040 template <>\ 1041 void CInterface::AttributeFortranInterfaceBody< CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 1042 {\ 1043 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 1044 oss << " CALL cxios_set_" << className << "_" << name << " &" << iendl; \ 1045 oss << "(" << className << "_hdl%daddr, " << name <<"_, LEN("<<name<<"_), LEN_TRIM("<<name<< "_), SHAPE(" << name << "_))" << iendl; \ 1046 oss << "ENDIF"; \ 1047 } 1048 1049 macro(1) 1050 macro(2) 1051 #undef macro 1052 949 1053 #define macro(T) \ 950 1054 template <> \ … … 1084 1188 1085 1189 #undef macro 1190 1191 #define macro(T)\ 1192 template <> \ 1193 void CInterface::AttributeFortranInterfaceGetBody< CArray<StdString,T> >(ostream& oss, const string& className, const string& name)\ 1194 {\ 1195 oss << "IF (PRESENT(" << name << "_)) THEN" << iendl; \ 1196 oss << " CALL cxios_get_" << className << "_" << name << " &" << iendl; \ 1197 oss << "(" << className << "_hdl%daddr, " << name << "_, LEN("<<name<<"_), SHAPE(" << name << "_))" << iendl; \ 1198 oss << "ENDIF"; \ 1199 } 1200 macro(1) 1201 macro(2) 1202 macro(3) 1203 macro(4) 1204 macro(5) 1205 macro(6) 1206 macro(7) 1207 1208 #undef macro 1209 1086 1210 } 1087 1211 #endif -
XIOS/dev/dev_olga/src/group_template_impl.hpp
r1030 r1158 8 8 #include "context.hpp" 9 9 #include "event_client.hpp" 10 #include "context_client.hpp" 10 11 #include "message.hpp" 11 12 #include "type.hpp" … … 398 399 } 399 400 } 400 401 // if (! context->hasServer )402 // {403 // CContextClient* client=context->client ;404 405 // CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD) ;406 // if (client->isServerLeader())407 // {408 // CMessage msg ;409 // msg<<this->getId() ;410 // msg<<id ;411 // const std::list<int>& ranks = client->getRanksServerLeader();412 // for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)413 // event.push(*itRank,1,msg) ;414 // client->sendEvent(event) ;415 // }416 // else client->sendEvent(event) ;417 // }418 401 419 402 } … … 464 447 } 465 448 } 466 467 // if (! context->hasServer )468 // {469 // CContextClient* client=context->client ;470 471 // CEventClient event(this->getType(),EVENT_ID_CREATE_CHILD_GROUP) ;472 // if (client->isServerLeader())473 // {474 // CMessage msg ;475 // msg<<this->getId() ;476 // msg<<id ;477 // const std::list<int>& ranks = client->getRanksServerLeader();478 // for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)479 // event.push(*itRank,1,msg) ;480 // client->sendEvent(event) ;481 // }482 // else client->sendEvent(event) ;483 // }484 485 449 } 486 450 … … 488 452 void CGroupTemplate<U, V, W>::recvCreateChild(CEventServer& event) 489 453 { 490 491 454 CBufferIn* buffer=event.subEvents.begin()->buffer; 492 455 string id; -
XIOS/dev/dev_olga/src/interface/c/icfield.cpp
r943 r1158 76 76 // ----------------------------------------------------------------------------------------------------- 77 77 78 void cxios_field_is_active (XFieldPtr field_hdl, bool * ret)78 void cxios_field_is_active (XFieldPtr field_hdl, bool at_current_timestep, bool* ret) 79 79 { 80 80 CTimer::get("XIOS").resume() ; 81 *ret = field_hdl->isActive( );81 *ret = field_hdl->isActive(at_current_timestep); 82 82 CTimer::get("XIOS").suspend() ; 83 83 } -
XIOS/dev/dev_olga/src/interface/c_attr/icaxis_attr.cpp
r817 r1158 188 188 189 189 190 void cxios_set_axis_label(axis_Ptr axis_hdl, char* label, int str_len, int* str_size, int* extent) 191 { 192 CTimer::get("XIOS").resume(); 193 axis_hdl->label.resize(shape(extent[0])); 194 Array<StdString,1>::iterator it, itb=axis_hdl->label.begin(), ite=axis_hdl->label.end() ; 195 int i, n ; 196 for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&label[n],str_size[i]) ; 197 CTimer::get("XIOS").suspend(); 198 } 199 200 void cxios_get_axis_label(axis_Ptr axis_hdl, char* label, int str_size, int* extent) 201 { 202 CTimer::get("XIOS").resume(); 203 Array<StdString,1>::const_iterator it, itb=axis_hdl->label.getInheritedValue().begin(), ite=axis_hdl->label.getInheritedValue().end() ; 204 int n ; 205 for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&label[n],it->size()) ; 206 CTimer::get("XIOS").suspend(); 207 } 208 209 bool cxios_is_defined_axis_label(axis_Ptr axis_hdl) 210 { 211 CTimer::get("XIOS").resume(); 212 bool isDefined = axis_hdl->label.hasInheritedValue(); 213 CTimer::get("XIOS").suspend(); 214 return isDefined; 215 } 216 217 190 218 void cxios_set_axis_long_name(axis_Ptr axis_hdl, const char * long_name, int long_name_size) 191 219 { … … 360 388 361 389 390 void cxios_set_axis_prec(axis_Ptr axis_hdl, int prec) 391 { 392 CTimer::get("XIOS").resume(); 393 axis_hdl->prec.setValue(prec); 394 CTimer::get("XIOS").suspend(); 395 } 396 397 void cxios_get_axis_prec(axis_Ptr axis_hdl, int* prec) 398 { 399 CTimer::get("XIOS").resume(); 400 *prec = axis_hdl->prec.getInheritedValue(); 401 CTimer::get("XIOS").suspend(); 402 } 403 404 bool cxios_is_defined_axis_prec(axis_Ptr axis_hdl) 405 { 406 CTimer::get("XIOS").resume(); 407 bool isDefined = axis_hdl->prec.hasInheritedValue(); 408 CTimer::get("XIOS").suspend(); 409 return isDefined; 410 } 411 412 362 413 void cxios_set_axis_standard_name(axis_Ptr axis_hdl, const char * standard_name, int standard_name_size) 363 414 { -
XIOS/dev/dev_olga/src/interface/c_attr/icaxisgroup_attr.cpp
r817 r1158 214 214 215 215 216 void cxios_set_axisgroup_label(axisgroup_Ptr axisgroup_hdl, char* label, int str_len, int* str_size, int* extent) 217 { 218 CTimer::get("XIOS").resume(); 219 axisgroup_hdl->label.resize(shape(extent[0])); 220 Array<StdString,1>::iterator it, itb=axisgroup_hdl->label.begin(), ite=axisgroup_hdl->label.end() ; 221 int i, n ; 222 for(it=itb, i=0, n=0 ; it!=ite ; ++it,n+=str_len,++i) *it=StdString(&label[n],str_size[i]) ; 223 CTimer::get("XIOS").suspend(); 224 } 225 226 void cxios_get_axisgroup_label(axisgroup_Ptr axisgroup_hdl, char* label, int str_size, int* extent) 227 { 228 CTimer::get("XIOS").resume(); 229 Array<StdString,1>::const_iterator it, itb=axisgroup_hdl->label.getInheritedValue().begin(), ite=axisgroup_hdl->label.getInheritedValue().end() ; 230 int n ; 231 for(it=itb, n=0 ; it!=ite ; ++it, n+=str_size) it->copy(&label[n],it->size()) ; 232 CTimer::get("XIOS").suspend(); 233 } 234 235 bool cxios_is_defined_axisgroup_label(axisgroup_Ptr axisgroup_hdl) 236 { 237 CTimer::get("XIOS").resume(); 238 bool isDefined = axisgroup_hdl->label.hasInheritedValue(); 239 CTimer::get("XIOS").suspend(); 240 return isDefined; 241 } 242 243 216 244 void cxios_set_axisgroup_long_name(axisgroup_Ptr axisgroup_hdl, const char * long_name, int long_name_size) 217 245 { … … 386 414 387 415 416 void cxios_set_axisgroup_prec(axisgroup_Ptr axisgroup_hdl, int prec) 417 { 418 CTimer::get("XIOS").resume(); 419 axisgroup_hdl->prec.setValue(prec); 420 CTimer::get("XIOS").suspend(); 421 } 422 423 void cxios_get_axisgroup_prec(axisgroup_Ptr axisgroup_hdl, int* prec) 424 { 425 CTimer::get("XIOS").resume(); 426 *prec = axisgroup_hdl->prec.getInheritedValue(); 427 CTimer::get("XIOS").suspend(); 428 } 429 430 bool cxios_is_defined_axisgroup_prec(axisgroup_Ptr axisgroup_hdl) 431 { 432 CTimer::get("XIOS").resume(); 433 bool isDefined = axisgroup_hdl->prec.hasInheritedValue(); 434 CTimer::get("XIOS").suspend(); 435 return isDefined; 436 } 437 438 388 439 void cxios_set_axisgroup_standard_name(axisgroup_Ptr axisgroup_hdl, const char * standard_name, int standard_name_size) 389 440 { -
XIOS/dev/dev_olga/src/interface/c_attr/icdomain_attr.cpp
r789 r1158 747 747 748 748 749 void cxios_set_domain_prec(domain_Ptr domain_hdl, int prec) 750 { 751 CTimer::get("XIOS").resume(); 752 domain_hdl->prec.setValue(prec); 753 CTimer::get("XIOS").suspend(); 754 } 755 756 void cxios_get_domain_prec(domain_Ptr domain_hdl, int* prec) 757 { 758 CTimer::get("XIOS").resume(); 759 *prec = domain_hdl->prec.getInheritedValue(); 760 CTimer::get("XIOS").suspend(); 761 } 762 763 bool cxios_is_defined_domain_prec(domain_Ptr domain_hdl) 764 { 765 CTimer::get("XIOS").resume(); 766 bool isDefined = domain_hdl->prec.hasInheritedValue(); 767 CTimer::get("XIOS").suspend(); 768 return isDefined; 769 } 770 771 749 772 void cxios_set_domain_standard_name(domain_Ptr domain_hdl, const char * standard_name, int standard_name_size) 750 773 { -
XIOS/dev/dev_olga/src/interface/c_attr/icdomaingroup_attr.cpp
r789 r1158 773 773 774 774 775 void cxios_set_domaingroup_prec(domaingroup_Ptr domaingroup_hdl, int prec) 776 { 777 CTimer::get("XIOS").resume(); 778 domaingroup_hdl->prec.setValue(prec); 779 CTimer::get("XIOS").suspend(); 780 } 781 782 void cxios_get_domaingroup_prec(domaingroup_Ptr domaingroup_hdl, int* prec) 783 { 784 CTimer::get("XIOS").resume(); 785 *prec = domaingroup_hdl->prec.getInheritedValue(); 786 CTimer::get("XIOS").suspend(); 787 } 788 789 bool cxios_is_defined_domaingroup_prec(domaingroup_Ptr domaingroup_hdl) 790 { 791 CTimer::get("XIOS").resume(); 792 bool isDefined = domaingroup_hdl->prec.hasInheritedValue(); 793 CTimer::get("XIOS").suspend(); 794 return isDefined; 795 } 796 797 775 798 void cxios_set_domaingroup_standard_name(domaingroup_Ptr domaingroup_hdl, const char * standard_name, int standard_name_size) 776 799 { -
XIOS/dev/dev_olga/src/interface/c_attr/icexpand_domain_attr.cpp
r981 r1158 17 17 { 18 18 typedef xios::CExpandDomain* expand_domain_Ptr; 19 20 void cxios_set_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl, bool i_periodic) 21 { 22 CTimer::get("XIOS").resume(); 23 expand_domain_hdl->i_periodic.setValue(i_periodic); 24 CTimer::get("XIOS").suspend(); 25 } 26 27 void cxios_get_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl, bool* i_periodic) 28 { 29 CTimer::get("XIOS").resume(); 30 *i_periodic = expand_domain_hdl->i_periodic.getInheritedValue(); 31 CTimer::get("XIOS").suspend(); 32 } 33 34 bool cxios_is_defined_expand_domain_i_periodic(expand_domain_Ptr expand_domain_hdl) 35 { 36 CTimer::get("XIOS").resume(); 37 bool isDefined = expand_domain_hdl->i_periodic.hasInheritedValue(); 38 CTimer::get("XIOS").suspend(); 39 return isDefined; 40 } 41 42 43 void cxios_set_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl, bool j_periodic) 44 { 45 CTimer::get("XIOS").resume(); 46 expand_domain_hdl->j_periodic.setValue(j_periodic); 47 CTimer::get("XIOS").suspend(); 48 } 49 50 void cxios_get_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl, bool* j_periodic) 51 { 52 CTimer::get("XIOS").resume(); 53 *j_periodic = expand_domain_hdl->j_periodic.getInheritedValue(); 54 CTimer::get("XIOS").suspend(); 55 } 56 57 bool cxios_is_defined_expand_domain_j_periodic(expand_domain_Ptr expand_domain_hdl) 58 { 59 CTimer::get("XIOS").resume(); 60 bool isDefined = expand_domain_hdl->j_periodic.hasInheritedValue(); 61 CTimer::get("XIOS").suspend(); 62 return isDefined; 63 } 64 19 65 20 66 void cxios_set_expand_domain_order(expand_domain_Ptr expand_domain_hdl, int order) -
XIOS/dev/dev_olga/src/interface/c_attr/icfile_attr.cpp
r932 r1158 553 553 554 554 555 void cxios_set_file_time_stamp_format(file_Ptr file_hdl, const char * time_stamp_format, int time_stamp_format_size) 556 { 557 std::string time_stamp_format_str; 558 if (!cstr2string(time_stamp_format, time_stamp_format_size, time_stamp_format_str)) return; 559 CTimer::get("XIOS").resume(); 560 file_hdl->time_stamp_format.setValue(time_stamp_format_str); 561 CTimer::get("XIOS").suspend(); 562 } 563 564 void cxios_get_file_time_stamp_format(file_Ptr file_hdl, char * time_stamp_format, int time_stamp_format_size) 565 { 566 CTimer::get("XIOS").resume(); 567 if (!string_copy(file_hdl->time_stamp_format.getInheritedValue(), time_stamp_format, time_stamp_format_size)) 568 ERROR("void cxios_get_file_time_stamp_format(file_Ptr file_hdl, char * time_stamp_format, int time_stamp_format_size)", << "Input string is too short"); 569 CTimer::get("XIOS").suspend(); 570 } 571 572 bool cxios_is_defined_file_time_stamp_format(file_Ptr file_hdl) 573 { 574 CTimer::get("XIOS").resume(); 575 bool isDefined = file_hdl->time_stamp_format.hasInheritedValue(); 576 CTimer::get("XIOS").suspend(); 577 return isDefined; 578 } 579 580 581 void cxios_set_file_time_stamp_name(file_Ptr file_hdl, const char * time_stamp_name, int time_stamp_name_size) 582 { 583 std::string time_stamp_name_str; 584 if (!cstr2string(time_stamp_name, time_stamp_name_size, time_stamp_name_str)) return; 585 CTimer::get("XIOS").resume(); 586 file_hdl->time_stamp_name.setValue(time_stamp_name_str); 587 CTimer::get("XIOS").suspend(); 588 } 589 590 void cxios_get_file_time_stamp_name(file_Ptr file_hdl, char * time_stamp_name, int time_stamp_name_size) 591 { 592 CTimer::get("XIOS").resume(); 593 if (!string_copy(file_hdl->time_stamp_name.getInheritedValue(), time_stamp_name, time_stamp_name_size)) 594 ERROR("void cxios_get_file_time_stamp_name(file_Ptr file_hdl, char * time_stamp_name, int time_stamp_name_size)", << "Input string is too short"); 595 CTimer::get("XIOS").suspend(); 596 } 597 598 bool cxios_is_defined_file_time_stamp_name(file_Ptr file_hdl) 599 { 600 CTimer::get("XIOS").resume(); 601 bool isDefined = file_hdl->time_stamp_name.hasInheritedValue(); 602 CTimer::get("XIOS").suspend(); 603 return isDefined; 604 } 605 606 607 void cxios_set_file_time_units(file_Ptr file_hdl, const char * time_units, int time_units_size) 608 { 609 std::string time_units_str; 610 if (!cstr2string(time_units, time_units_size, time_units_str)) return; 611 CTimer::get("XIOS").resume(); 612 file_hdl->time_units.fromString(time_units_str); 613 CTimer::get("XIOS").suspend(); 614 } 615 616 void cxios_get_file_time_units(file_Ptr file_hdl, char * time_units, int time_units_size) 617 { 618 CTimer::get("XIOS").resume(); 619 if (!string_copy(file_hdl->time_units.getInheritedStringValue(), time_units, time_units_size)) 620 ERROR("void cxios_get_file_time_units(file_Ptr file_hdl, char * time_units, int time_units_size)", << "Input string is too short"); 621 CTimer::get("XIOS").suspend(); 622 } 623 624 bool cxios_is_defined_file_time_units(file_Ptr file_hdl) 625 { 626 CTimer::get("XIOS").resume(); 627 bool isDefined = file_hdl->time_units.hasInheritedValue(); 628 CTimer::get("XIOS").suspend(); 629 return isDefined; 630 } 631 632 555 633 void cxios_set_file_timeseries(file_Ptr file_hdl, const char * timeseries, int timeseries_size) 556 634 { … … 629 707 return isDefined; 630 708 } 709 710 711 void cxios_set_file_uuid_format(file_Ptr file_hdl, const char * uuid_format, int uuid_format_size) 712 { 713 std::string uuid_format_str; 714 if (!cstr2string(uuid_format, uuid_format_size, uuid_format_str)) return; 715 CTimer::get("XIOS").resume(); 716 file_hdl->uuid_format.setValue(uuid_format_str); 717 CTimer::get("XIOS").suspend(); 718 } 719 720 void cxios_get_file_uuid_format(file_Ptr file_hdl, char * uuid_format, int uuid_format_size) 721 { 722 CTimer::get("XIOS").resume(); 723 if (!string_copy(file_hdl->uuid_format.getInheritedValue(), uuid_format, uuid_format_size)) 724 ERROR("void cxios_get_file_uuid_format(file_Ptr file_hdl, char * uuid_format, int uuid_format_size)", << "Input string is too short"); 725 CTimer::get("XIOS").suspend(); 726 } 727 728 bool cxios_is_defined_file_uuid_format(file_Ptr file_hdl) 729 { 730 CTimer::get("XIOS").resume(); 731 bool isDefined = file_hdl->uuid_format.hasInheritedValue(); 732 CTimer::get("XIOS").suspend(); 733 return isDefined; 734 } 735 736 737 void cxios_set_file_uuid_name(file_Ptr file_hdl, const char * uuid_name, int uuid_name_size) 738 { 739 std::string uuid_name_str; 740 if (!cstr2string(uuid_name, uuid_name_size, uuid_name_str)) return; 741 CTimer::get("XIOS").resume(); 742 file_hdl->uuid_name.setValue(uuid_name_str); 743 CTimer::get("XIOS").suspend(); 744 } 745 746 void cxios_get_file_uuid_name(file_Ptr file_hdl, char * uuid_name, int uuid_name_size) 747 { 748 CTimer::get("XIOS").resume(); 749 if (!string_copy(file_hdl->uuid_name.getInheritedValue(), uuid_name, uuid_name_size)) 750 ERROR("void cxios_get_file_uuid_name(file_Ptr file_hdl, char * uuid_name, int uuid_name_size)", << "Input string is too short"); 751 CTimer::get("XIOS").suspend(); 752 } 753 754 bool cxios_is_defined_file_uuid_name(file_Ptr file_hdl) 755 { 756 CTimer::get("XIOS").resume(); 757 bool isDefined = file_hdl->uuid_name.hasInheritedValue(); 758 CTimer::get("XIOS").suspend(); 759 return isDefined; 760 } 631 761 } -
XIOS/dev/dev_olga/src/interface/c_attr/icfilegroup_attr.cpp
r932 r1158 579 579 580 580 581 void cxios_set_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl, const char * time_stamp_format, int time_stamp_format_size) 582 { 583 std::string time_stamp_format_str; 584 if (!cstr2string(time_stamp_format, time_stamp_format_size, time_stamp_format_str)) return; 585 CTimer::get("XIOS").resume(); 586 filegroup_hdl->time_stamp_format.setValue(time_stamp_format_str); 587 CTimer::get("XIOS").suspend(); 588 } 589 590 void cxios_get_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl, char * time_stamp_format, int time_stamp_format_size) 591 { 592 CTimer::get("XIOS").resume(); 593 if (!string_copy(filegroup_hdl->time_stamp_format.getInheritedValue(), time_stamp_format, time_stamp_format_size)) 594 ERROR("void cxios_get_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl, char * time_stamp_format, int time_stamp_format_size)", << "Input string is too short"); 595 CTimer::get("XIOS").suspend(); 596 } 597 598 bool cxios_is_defined_filegroup_time_stamp_format(filegroup_Ptr filegroup_hdl) 599 { 600 CTimer::get("XIOS").resume(); 601 bool isDefined = filegroup_hdl->time_stamp_format.hasInheritedValue(); 602 CTimer::get("XIOS").suspend(); 603 return isDefined; 604 } 605 606 607 void cxios_set_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl, const char * time_stamp_name, int time_stamp_name_size) 608 { 609 std::string time_stamp_name_str; 610 if (!cstr2string(time_stamp_name, time_stamp_name_size, time_stamp_name_str)) return; 611 CTimer::get("XIOS").resume(); 612 filegroup_hdl->time_stamp_name.setValue(time_stamp_name_str); 613 CTimer::get("XIOS").suspend(); 614 } 615 616 void cxios_get_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl, char * time_stamp_name, int time_stamp_name_size) 617 { 618 CTimer::get("XIOS").resume(); 619 if (!string_copy(filegroup_hdl->time_stamp_name.getInheritedValue(), time_stamp_name, time_stamp_name_size)) 620 ERROR("void cxios_get_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl, char * time_stamp_name, int time_stamp_name_size)", << "Input string is too short"); 621 CTimer::get("XIOS").suspend(); 622 } 623 624 bool cxios_is_defined_filegroup_time_stamp_name(filegroup_Ptr filegroup_hdl) 625 { 626 CTimer::get("XIOS").resume(); 627 bool isDefined = filegroup_hdl->time_stamp_name.hasInheritedValue(); 628 CTimer::get("XIOS").suspend(); 629 return isDefined; 630 } 631 632 633 void cxios_set_filegroup_time_units(filegroup_Ptr filegroup_hdl, const char * time_units, int time_units_size) 634 { 635 std::string time_units_str; 636 if (!cstr2string(time_units, time_units_size, time_units_str)) return; 637 CTimer::get("XIOS").resume(); 638 filegroup_hdl->time_units.fromString(time_units_str); 639 CTimer::get("XIOS").suspend(); 640 } 641 642 void cxios_get_filegroup_time_units(filegroup_Ptr filegroup_hdl, char * time_units, int time_units_size) 643 { 644 CTimer::get("XIOS").resume(); 645 if (!string_copy(filegroup_hdl->time_units.getInheritedStringValue(), time_units, time_units_size)) 646 ERROR("void cxios_get_filegroup_time_units(filegroup_Ptr filegroup_hdl, char * time_units, int time_units_size)", << "Input string is too short"); 647 CTimer::get("XIOS").suspend(); 648 } 649 650 bool cxios_is_defined_filegroup_time_units(filegroup_Ptr filegroup_hdl) 651 { 652 CTimer::get("XIOS").resume(); 653 bool isDefined = filegroup_hdl->time_units.hasInheritedValue(); 654 CTimer::get("XIOS").suspend(); 655 return isDefined; 656 } 657 658 581 659 void cxios_set_filegroup_timeseries(filegroup_Ptr filegroup_hdl, const char * timeseries, int timeseries_size) 582 660 { … … 655 733 return isDefined; 656 734 } 735 736 737 void cxios_set_filegroup_uuid_format(filegroup_Ptr filegroup_hdl, const char * uuid_format, int uuid_format_size) 738 { 739 std::string uuid_format_str; 740 if (!cstr2string(uuid_format, uuid_format_size, uuid_format_str)) return; 741 CTimer::get("XIOS").resume(); 742 filegroup_hdl->uuid_format.setValue(uuid_format_str); 743 CTimer::get("XIOS").suspend(); 744 } 745 746 void cxios_get_filegroup_uuid_format(filegroup_Ptr filegroup_hdl, char * uuid_format, int uuid_format_size) 747 { 748 CTimer::get("XIOS").resume(); 749 if (!string_copy(filegroup_hdl->uuid_format.getInheritedValue(), uuid_format, uuid_format_size)) 750 ERROR("void cxios_get_filegroup_uuid_format(filegroup_Ptr filegroup_hdl, char * uuid_format, int uuid_format_size)", << "Input string is too short"); 751 CTimer::get("XIOS").suspend(); 752 } 753 754 bool cxios_is_defined_filegroup_uuid_format(filegroup_Ptr filegroup_hdl) 755 { 756 CTimer::get("XIOS").resume(); 757 bool isDefined = filegroup_hdl->uuid_format.hasInheritedValue(); 758 CTimer::get("XIOS").suspend(); 759 return isDefined; 760 } 761 762 763 void cxios_set_filegroup_uuid_name(filegroup_Ptr filegroup_hdl, const char * uuid_name, int uuid_name_size) 764 { 765 std::string uuid_name_str; 766 if (!cstr2string(uuid_name, uuid_name_size, uuid_name_str)) return; 767 CTimer::get("XIOS").resume(); 768 filegroup_hdl->uuid_name.setValue(uuid_name_str); 769 CTimer::get("XIOS").suspend(); 770 } 771 772 void cxios_get_filegroup_uuid_name(filegroup_Ptr filegroup_hdl, char * uuid_name, int uuid_name_size) 773 { 774 CTimer::get("XIOS").resume(); 775 if (!string_copy(filegroup_hdl->uuid_name.getInheritedValue(), uuid_name, uuid_name_size)) 776 ERROR("void cxios_get_filegroup_uuid_name(filegroup_Ptr filegroup_hdl, char * uuid_name, int uuid_name_size)", << "Input string is too short"); 777 CTimer::get("XIOS").suspend(); 778 } 779 780 bool cxios_is_defined_filegroup_uuid_name(filegroup_Ptr filegroup_hdl) 781 { 782 CTimer::get("XIOS").resume(); 783 bool isDefined = filegroup_hdl->uuid_name.hasInheritedValue(); 784 CTimer::get("XIOS").suspend(); 785 return isDefined; 786 } 657 787 } -
XIOS/dev/dev_olga/src/interface/c_attr/icinterpolate_domain_attr.cpp
r1021 r1158 17 17 { 18 18 typedef xios::CInterpolateDomain* interpolate_domain_Ptr; 19 20 void cxios_set_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, const char * file, int file_size)21 {22 std::string file_str;23 if (!cstr2string(file, file_size, file_str)) return;24 CTimer::get("XIOS").resume();25 interpolate_domain_hdl->file.setValue(file_str);26 CTimer::get("XIOS").suspend();27 }28 29 void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)30 {31 CTimer::get("XIOS").resume();32 if (!string_copy(interpolate_domain_hdl->file.getInheritedValue(), file, file_size))33 ERROR("void cxios_get_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl, char * file, int file_size)", << "Input string is too short");34 CTimer::get("XIOS").suspend();35 }36 37 bool cxios_is_defined_interpolate_domain_file(interpolate_domain_Ptr interpolate_domain_hdl)38 {39 CTimer::get("XIOS").resume();40 bool isDefined = interpolate_domain_hdl->file.hasInheritedValue();41 CTimer::get("XIOS").suspend();42 return isDefined;43 }44 45 19 46 20 void cxios_set_interpolate_domain_mode(interpolate_domain_Ptr interpolate_domain_hdl, const char * mode, int mode_size) -
XIOS/dev/dev_olga/src/interface/c_attr/icscalar_attr.cpp
r891 r1158 65 65 CTimer::get("XIOS").resume(); 66 66 bool isDefined = scalar_hdl->name.hasInheritedValue(); 67 CTimer::get("XIOS").suspend(); 68 return isDefined; 69 } 70 71 72 void cxios_set_scalar_prec(scalar_Ptr scalar_hdl, int prec) 73 { 74 CTimer::get("XIOS").resume(); 75 scalar_hdl->prec.setValue(prec); 76 CTimer::get("XIOS").suspend(); 77 } 78 79 void cxios_get_scalar_prec(scalar_Ptr scalar_hdl, int* prec) 80 { 81 CTimer::get("XIOS").resume(); 82 *prec = scalar_hdl->prec.getInheritedValue(); 83 CTimer::get("XIOS").suspend(); 84 } 85 86 bool cxios_is_defined_scalar_prec(scalar_Ptr scalar_hdl) 87 { 88 CTimer::get("XIOS").resume(); 89 bool isDefined = scalar_hdl->prec.hasInheritedValue(); 67 90 CTimer::get("XIOS").suspend(); 68 91 return isDefined; -
XIOS/dev/dev_olga/src/interface/c_attr/icscalargroup_attr.cpp
r891 r1158 96 96 97 97 98 void cxios_set_scalargroup_prec(scalargroup_Ptr scalargroup_hdl, int prec) 99 { 100 CTimer::get("XIOS").resume(); 101 scalargroup_hdl->prec.setValue(prec); 102 CTimer::get("XIOS").suspend(); 103 } 104 105 void cxios_get_scalargroup_prec(scalargroup_Ptr scalargroup_hdl, int* prec) 106 { 107 CTimer::get("XIOS").resume(); 108 *prec = scalargroup_hdl->prec.getInheritedValue(); 109 CTimer::get("XIOS").suspend(); 110 } 111 112 bool cxios_is_defined_scalargroup_prec(scalargroup_Ptr scalargroup_hdl) 113 { 114 CTimer::get("XIOS").resume(); 115 bool isDefined = scalargroup_hdl->prec.hasInheritedValue(); 116 CTimer::get("XIOS").suspend(); 117 return isDefined; 118 } 119 120 98 121 void cxios_set_scalargroup_scalar_ref(scalargroup_Ptr scalargroup_hdl, const char * scalar_ref, int scalar_ref_size) 99 122 { -
XIOS/dev/dev_olga/src/interface/c_attr/icvariable_attr.cpp
r591 r1158 44 44 45 45 46 void cxios_set_variable_ts_target(variable_Ptr variable_hdl, const char * ts_target, int ts_target_size) 47 { 48 std::string ts_target_str; 49 if (!cstr2string(ts_target, ts_target_size, ts_target_str)) return; 50 CTimer::get("XIOS").resume(); 51 variable_hdl->ts_target.fromString(ts_target_str); 52 CTimer::get("XIOS").suspend(); 53 } 54 55 void cxios_get_variable_ts_target(variable_Ptr variable_hdl, char * ts_target, int ts_target_size) 56 { 57 CTimer::get("XIOS").resume(); 58 if (!string_copy(variable_hdl->ts_target.getInheritedStringValue(), ts_target, ts_target_size)) 59 ERROR("void cxios_get_variable_ts_target(variable_Ptr variable_hdl, char * ts_target, int ts_target_size)", << "Input string is too short"); 60 CTimer::get("XIOS").suspend(); 61 } 62 63 bool cxios_is_defined_variable_ts_target(variable_Ptr variable_hdl) 64 { 65 CTimer::get("XIOS").resume(); 66 bool isDefined = variable_hdl->ts_target.hasInheritedValue(); 67 CTimer::get("XIOS").suspend(); 68 return isDefined; 69 } 70 71 46 72 void cxios_set_variable_type(variable_Ptr variable_hdl, const char * type, int type_size) 47 73 { -
XIOS/dev/dev_olga/src/interface/c_attr/icvariablegroup_attr.cpp
r591 r1158 70 70 71 71 72 void cxios_set_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, const char * ts_target, int ts_target_size) 73 { 74 std::string ts_target_str; 75 if (!cstr2string(ts_target, ts_target_size, ts_target_str)) return; 76 CTimer::get("XIOS").resume(); 77 variablegroup_hdl->ts_target.fromString(ts_target_str); 78 CTimer::get("XIOS").suspend(); 79 } 80 81 void cxios_get_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, char * ts_target, int ts_target_size) 82 { 83 CTimer::get("XIOS").resume(); 84 if (!string_copy(variablegroup_hdl->ts_target.getInheritedStringValue(), ts_target, ts_target_size)) 85 ERROR("void cxios_get_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl, char * ts_target, int ts_target_size)", << "Input string is too short"); 86 CTimer::get("XIOS").suspend(); 87 } 88 89 bool cxios_is_defined_variablegroup_ts_target(variablegroup_Ptr variablegroup_hdl) 90 { 91 CTimer::get("XIOS").resume(); 92 bool isDefined = variablegroup_hdl->ts_target.hasInheritedValue(); 93 CTimer::get("XIOS").suspend(); 94 return isDefined; 95 } 96 97 72 98 void cxios_set_variablegroup_type(variablegroup_Ptr variablegroup_hdl, const char * type, int type_size) 73 99 { -
XIOS/dev/dev_olga/src/interface/fortran/field_interface.f90
r943 r1158 18 18 END SUBROUTINE cxios_field_valid_id 19 19 20 SUBROUTINE cxios_field_is_active(field_hdl, ret) BIND(C)20 SUBROUTINE cxios_field_is_active(field_hdl, at_current_timestep, ret) BIND(C) 21 21 USE ISO_C_BINDING 22 22 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 23 LOGICAL (kind = C_BOOL), VALUE :: at_current_timestep 23 24 LOGICAL (kind = C_BOOL) :: ret 24 25 END SUBROUTINE cxios_field_is_active -
XIOS/dev/dev_olga/src/interface/fortran/idata.F90
r1054 r1158 8 8 9 9 SUBROUTINE cxios_init_server() BIND(C) 10 USE ISO_C_BINDING11 10 END SUBROUTINE cxios_init_server 12 11 … … 454 453 SUBROUTINE xios(init_server)() 455 454 IMPLICIT NONE 456 455 CALL cxios_init_server() 457 456 END SUBROUTINE xios(init_server) 458 457 -
XIOS/dev/dev_olga/src/interface/fortran/ifield.F90
r943 r1158 142 142 END FUNCTION xios(is_valid_fieldgroup) 143 143 144 LOGICAL FUNCTION xios(field_is_active_id (field_id))144 LOGICAL FUNCTION xios(field_is_active_id)(field_id, at_current_timestep_arg) 145 145 IMPLICIT NONE 146 CHARACTER(len = *) 147 LOGICAL (kind = 1) :: val148 TYPE(txios(field)) 149 146 CHARACTER(len = *) , INTENT(IN) :: field_id 147 LOGICAL, OPTIONAL , INTENT(IN) :: at_current_timestep_arg 148 TYPE(txios(field)) :: field_hdl 149 150 150 CALL xios(get_field_handle)(field_id,field_hdl) 151 xios(field_is_active_id) =xios(field_is_active_hdl(field_hdl))151 xios(field_is_active_id) = xios(field_is_active_hdl)(field_hdl, at_current_timestep_arg) 152 152 153 END FUNCTION xios(field_is_active_id) 154 155 156 LOGICAL FUNCTION xios(field_is_active_hdl(field_hdl)) 153 END FUNCTION xios(field_is_active_id) 154 155 LOGICAL FUNCTION xios(field_is_active_hdl)(field_hdl, at_current_timestep_arg) 157 156 IMPLICIT NONE 158 TYPE(txios(field)),INTENT(IN) :: field_hdl 159 LOGICAL (kind = 1) :: ret 160 161 CALL cxios_field_is_active(field_hdl%daddr, ret); 157 TYPE(txios(field)) , INTENT(IN) :: field_hdl 158 LOGICAL, OPTIONAL , INTENT(IN) :: at_current_timestep_arg 159 LOGICAL(kind = C_BOOL) :: at_current_timestep 160 LOGICAL(kind = C_BOOL) :: ret 161 162 IF (PRESENT(at_current_timestep_arg)) THEN 163 at_current_timestep = at_current_timestep_arg 164 ELSE 165 at_current_timestep = .FALSE. 166 ENDIF 167 168 CALL cxios_field_is_active(field_hdl%daddr, at_current_timestep, ret); 162 169 xios(field_is_active_hdl) = ret 163 170 164 END FUNCTION xios(field_is_active_hdl)171 END FUNCTION xios(field_is_active_hdl) 165 172 166 167 173 END MODULE IFIELD -
XIOS/dev/dev_olga/src/interface/fortran_attr/axis_interface_attr.F90
r817 r1158 151 151 152 152 153 SUBROUTINE cxios_set_axis_label(axis_hdl, label, str_len, str_size, extent) BIND(C) 154 USE ISO_C_BINDING 155 INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 156 CHARACTER (KIND=C_CHAR), DIMENSION(*) :: label 157 INTEGER (kind = C_INT), VALUE :: str_len 158 INTEGER (kind = C_INT), DIMENSION(*) :: str_size 159 INTEGER (kind = C_INT), DIMENSION(*) :: extent 160 END SUBROUTINE cxios_set_axis_label 161 162 SUBROUTINE cxios_get_axis_label(axis_hdl, label, str_size, extent) BIND(C) 163 USE ISO_C_BINDING 164 INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 165 CHARACTER (KIND=C_CHAR), DIMENSION(*) :: label 166 INTEGER (kind = C_INT), VALUE :: str_size 167 INTEGER (kind = C_INT), DIMENSION(*) :: extent 168 END SUBROUTINE cxios_get_axis_label 169 170 FUNCTION cxios_is_defined_axis_label(axis_hdl) BIND(C) 171 USE ISO_C_BINDING 172 LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_label 173 INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 174 END FUNCTION cxios_is_defined_axis_label 175 176 153 177 SUBROUTINE cxios_set_axis_long_name(axis_hdl, long_name, long_name_size) BIND(C) 154 178 USE ISO_C_BINDING … … 292 316 293 317 318 SUBROUTINE cxios_set_axis_prec(axis_hdl, prec) BIND(C) 319 USE ISO_C_BINDING 320 INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 321 INTEGER (KIND=C_INT) , VALUE :: prec 322 END SUBROUTINE cxios_set_axis_prec 323 324 SUBROUTINE cxios_get_axis_prec(axis_hdl, prec) BIND(C) 325 USE ISO_C_BINDING 326 INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 327 INTEGER (KIND=C_INT) :: prec 328 END SUBROUTINE cxios_get_axis_prec 329 330 FUNCTION cxios_is_defined_axis_prec(axis_hdl) BIND(C) 331 USE ISO_C_BINDING 332 LOGICAL(kind=C_BOOL) :: cxios_is_defined_axis_prec 333 INTEGER (kind = C_INTPTR_T), VALUE :: axis_hdl 334 END FUNCTION cxios_is_defined_axis_prec 335 336 294 337 SUBROUTINE cxios_set_axis_standard_name(axis_hdl, standard_name, standard_name_size) BIND(C) 295 338 USE ISO_C_BINDING -
XIOS/dev/dev_olga/src/interface/fortran_attr/axisgroup_interface_attr.F90
r817 r1158 172 172 173 173 174 SUBROUTINE cxios_set_axisgroup_label(axisgroup_hdl, label, str_len, str_size, extent) BIND(C) 175 USE ISO_C_BINDING 176 INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 177 CHARACTER (KIND=C_CHAR), DIMENSION(*) :: label 178 INTEGER (kind = C_INT), VALUE :: str_len 179 INTEGER (kind = C_INT), DIMENSION(*) :: str_size 180 INTEGER (kind = C_INT), DIMENSION(*) :: extent 181 END SUBROUTINE cxios_set_axisgroup_label 182 183 SUBROUTINE cxios_get_axisgroup_label(axisgroup_hdl, label, str_size, extent) BIND(C) 184 USE ISO_C_BINDING 185 INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 186 CHARACTER (KIND=C_CHAR), DIMENSION(*) :: label 187 INTEGER (kind = C_INT), VALUE :: str_size 188 INTEGER (kind = C_INT), DIMENSION(*) :: extent 189 END SUBROUTINE cxios_get_axisgroup_label 190 191 FUNCTION cxios_is_defined_axisgroup_label(axisgroup_hdl) BIND(C) 192 USE ISO_C_BINDING 193 LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_label 194 INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 195 END FUNCTION cxios_is_defined_axisgroup_label 196 197 174 198 SUBROUTINE cxios_set_axisgroup_long_name(axisgroup_hdl, long_name, long_name_size) BIND(C) 175 199 USE ISO_C_BINDING … … 313 337 314 338 339 SUBROUTINE cxios_set_axisgroup_prec(axisgroup_hdl, prec) BIND(C) 340 USE ISO_C_BINDING 341 INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 342 INTEGER (KIND=C_INT) , VALUE :: prec 343 END SUBROUTINE cxios_set_axisgroup_prec 344 345 SUBROUTINE cxios_get_axisgroup_prec(axisgroup_hdl, prec) BIND(C) 346 USE ISO_C_BINDING 347 INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 348 INTEGER (KIND=C_INT) :: prec 349 END SUBROUTINE cxios_get_axisgroup_prec 350 351 FUNCTION cxios_is_defined_axisgroup_prec(axisgroup_hdl) BIND(C) 352 USE ISO_C_BINDING 353 LOGICAL(kind=C_BOOL) :: cxios_is_defined_axisgroup_prec 354 INTEGER (kind = C_INTPTR_T), VALUE :: axisgroup_hdl 355 END FUNCTION cxios_is_defined_axisgroup_prec 356 357 315 358 SUBROUTINE cxios_set_axisgroup_standard_name(axisgroup_hdl, standard_name, standard_name_size) BIND(C) 316 359 USE ISO_C_BINDING -
XIOS/dev/dev_olga/src/interface/fortran_attr/domain_interface_attr.F90
r789 r1158 616 616 617 617 618 SUBROUTINE cxios_set_domain_prec(domain_hdl, prec) BIND(C) 619 USE ISO_C_BINDING 620 INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl 621 INTEGER (KIND=C_INT) , VALUE :: prec 622 END SUBROUTINE cxios_set_domain_prec 623 624 SUBROUTINE cxios_get_domain_prec(domain_hdl, prec) BIND(C) 625 USE ISO_C_BINDING 626 INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl 627 INTEGER (KIND=C_INT) :: prec 628 END SUBROUTINE cxios_get_domain_prec 629 630 FUNCTION cxios_is_defined_domain_prec(domain_hdl) BIND(C) 631 USE ISO_C_BINDING 632 LOGICAL(kind=C_BOOL) :: cxios_is_defined_domain_prec 633 INTEGER (kind = C_INTPTR_T), VALUE :: domain_hdl 634 END FUNCTION cxios_is_defined_domain_prec 635 636 618 637 SUBROUTINE cxios_set_domain_standard_name(domain_hdl, standard_name, standard_name_size) BIND(C) 619 638 USE ISO_C_BINDING -
XIOS/dev/dev_olga/src/interface/fortran_attr/domaingroup_interface_attr.F90
r789 r1158 637 637 638 638 639 SUBROUTINE cxios_set_domaingroup_prec(domaingroup_hdl, prec) BIND(C) 640 USE ISO_C_BINDING 641 INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl 642 INTEGER (KIND=C_INT) , VALUE :: prec 643 END SUBROUTINE cxios_set_domaingroup_prec 644 645 SUBROUTINE cxios_get_domaingroup_prec(domaingroup_hdl, prec) BIND(C) 646 USE ISO_C_BINDING 647 INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl 648 INTEGER (KIND=C_INT) :: prec 649 END SUBROUTINE cxios_get_domaingroup_prec 650 651 FUNCTION cxios_is_defined_domaingroup_prec(domaingroup_hdl) BIND(C) 652 USE ISO_C_BINDING 653 LOGICAL(kind=C_BOOL) :: cxios_is_defined_domaingroup_prec 654 INTEGER (kind = C_INTPTR_T), VALUE :: domaingroup_hdl 655 END FUNCTION cxios_is_defined_domaingroup_prec 656 657 639 658 SUBROUTINE cxios_set_domaingroup_standard_name(domaingroup_hdl, standard_name, standard_name_size) BIND(C) 640 659 USE ISO_C_BINDING -
XIOS/dev/dev_olga/src/interface/fortran_attr/expand_domain_interface_attr.F90
r981 r1158 9 9 INTERFACE 10 10 ! Do not call directly / interface FORTRAN 2003 <-> C99 11 12 SUBROUTINE cxios_set_expand_domain_i_periodic(expand_domain_hdl, i_periodic) BIND(C) 13 USE ISO_C_BINDING 14 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 15 LOGICAL (KIND=C_BOOL) , VALUE :: i_periodic 16 END SUBROUTINE cxios_set_expand_domain_i_periodic 17 18 SUBROUTINE cxios_get_expand_domain_i_periodic(expand_domain_hdl, i_periodic) BIND(C) 19 USE ISO_C_BINDING 20 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 21 LOGICAL (KIND=C_BOOL) :: i_periodic 22 END SUBROUTINE cxios_get_expand_domain_i_periodic 23 24 FUNCTION cxios_is_defined_expand_domain_i_periodic(expand_domain_hdl) BIND(C) 25 USE ISO_C_BINDING 26 LOGICAL(kind=C_BOOL) :: cxios_is_defined_expand_domain_i_periodic 27 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 28 END FUNCTION cxios_is_defined_expand_domain_i_periodic 29 30 31 SUBROUTINE cxios_set_expand_domain_j_periodic(expand_domain_hdl, j_periodic) BIND(C) 32 USE ISO_C_BINDING 33 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 34 LOGICAL (KIND=C_BOOL) , VALUE :: j_periodic 35 END SUBROUTINE cxios_set_expand_domain_j_periodic 36 37 SUBROUTINE cxios_get_expand_domain_j_periodic(expand_domain_hdl, j_periodic) BIND(C) 38 USE ISO_C_BINDING 39 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 40 LOGICAL (KIND=C_BOOL) :: j_periodic 41 END SUBROUTINE cxios_get_expand_domain_j_periodic 42 43 FUNCTION cxios_is_defined_expand_domain_j_periodic(expand_domain_hdl) BIND(C) 44 USE ISO_C_BINDING 45 LOGICAL(kind=C_BOOL) :: cxios_is_defined_expand_domain_j_periodic 46 INTEGER (kind = C_INTPTR_T), VALUE :: expand_domain_hdl 47 END FUNCTION cxios_is_defined_expand_domain_j_periodic 48 11 49 12 50 SUBROUTINE cxios_set_expand_domain_order(expand_domain_hdl, order) BIND(C) -
XIOS/dev/dev_olga/src/interface/fortran_attr/file_interface_attr.F90
r932 r1158 416 416 417 417 418 SUBROUTINE cxios_set_file_time_stamp_format(file_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 419 USE ISO_C_BINDING 420 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 421 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_format 422 INTEGER (kind = C_INT) , VALUE :: time_stamp_format_size 423 END SUBROUTINE cxios_set_file_time_stamp_format 424 425 SUBROUTINE cxios_get_file_time_stamp_format(file_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 426 USE ISO_C_BINDING 427 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 428 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_format 429 INTEGER (kind = C_INT) , VALUE :: time_stamp_format_size 430 END SUBROUTINE cxios_get_file_time_stamp_format 431 432 FUNCTION cxios_is_defined_file_time_stamp_format(file_hdl) BIND(C) 433 USE ISO_C_BINDING 434 LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_stamp_format 435 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 436 END FUNCTION cxios_is_defined_file_time_stamp_format 437 438 439 SUBROUTINE cxios_set_file_time_stamp_name(file_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 440 USE ISO_C_BINDING 441 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 442 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_name 443 INTEGER (kind = C_INT) , VALUE :: time_stamp_name_size 444 END SUBROUTINE cxios_set_file_time_stamp_name 445 446 SUBROUTINE cxios_get_file_time_stamp_name(file_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 447 USE ISO_C_BINDING 448 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 449 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_name 450 INTEGER (kind = C_INT) , VALUE :: time_stamp_name_size 451 END SUBROUTINE cxios_get_file_time_stamp_name 452 453 FUNCTION cxios_is_defined_file_time_stamp_name(file_hdl) BIND(C) 454 USE ISO_C_BINDING 455 LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_stamp_name 456 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 457 END FUNCTION cxios_is_defined_file_time_stamp_name 458 459 460 SUBROUTINE cxios_set_file_time_units(file_hdl, time_units, time_units_size) BIND(C) 461 USE ISO_C_BINDING 462 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 463 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_units 464 INTEGER (kind = C_INT) , VALUE :: time_units_size 465 END SUBROUTINE cxios_set_file_time_units 466 467 SUBROUTINE cxios_get_file_time_units(file_hdl, time_units, time_units_size) BIND(C) 468 USE ISO_C_BINDING 469 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 470 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_units 471 INTEGER (kind = C_INT) , VALUE :: time_units_size 472 END SUBROUTINE cxios_get_file_time_units 473 474 FUNCTION cxios_is_defined_file_time_units(file_hdl) BIND(C) 475 USE ISO_C_BINDING 476 LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_time_units 477 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 478 END FUNCTION cxios_is_defined_file_time_units 479 480 418 481 SUBROUTINE cxios_set_file_timeseries(file_hdl, timeseries, timeseries_size) BIND(C) 419 482 USE ISO_C_BINDING … … 478 541 END FUNCTION cxios_is_defined_file_type 479 542 543 544 SUBROUTINE cxios_set_file_uuid_format(file_hdl, uuid_format, uuid_format_size) BIND(C) 545 USE ISO_C_BINDING 546 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 547 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_format 548 INTEGER (kind = C_INT) , VALUE :: uuid_format_size 549 END SUBROUTINE cxios_set_file_uuid_format 550 551 SUBROUTINE cxios_get_file_uuid_format(file_hdl, uuid_format, uuid_format_size) BIND(C) 552 USE ISO_C_BINDING 553 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 554 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_format 555 INTEGER (kind = C_INT) , VALUE :: uuid_format_size 556 END SUBROUTINE cxios_get_file_uuid_format 557 558 FUNCTION cxios_is_defined_file_uuid_format(file_hdl) BIND(C) 559 USE ISO_C_BINDING 560 LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_uuid_format 561 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 562 END FUNCTION cxios_is_defined_file_uuid_format 563 564 565 SUBROUTINE cxios_set_file_uuid_name(file_hdl, uuid_name, uuid_name_size) BIND(C) 566 USE ISO_C_BINDING 567 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 568 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_name 569 INTEGER (kind = C_INT) , VALUE :: uuid_name_size 570 END SUBROUTINE cxios_set_file_uuid_name 571 572 SUBROUTINE cxios_get_file_uuid_name(file_hdl, uuid_name, uuid_name_size) BIND(C) 573 USE ISO_C_BINDING 574 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 575 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_name 576 INTEGER (kind = C_INT) , VALUE :: uuid_name_size 577 END SUBROUTINE cxios_get_file_uuid_name 578 579 FUNCTION cxios_is_defined_file_uuid_name(file_hdl) BIND(C) 580 USE ISO_C_BINDING 581 LOGICAL(kind=C_BOOL) :: cxios_is_defined_file_uuid_name 582 INTEGER (kind = C_INTPTR_T), VALUE :: file_hdl 583 END FUNCTION cxios_is_defined_file_uuid_name 584 480 585 END INTERFACE 481 586 -
XIOS/dev/dev_olga/src/interface/fortran_attr/filegroup_interface_attr.F90
r932 r1158 437 437 438 438 439 SUBROUTINE cxios_set_filegroup_time_stamp_format(filegroup_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 440 USE ISO_C_BINDING 441 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 442 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_format 443 INTEGER (kind = C_INT) , VALUE :: time_stamp_format_size 444 END SUBROUTINE cxios_set_filegroup_time_stamp_format 445 446 SUBROUTINE cxios_get_filegroup_time_stamp_format(filegroup_hdl, time_stamp_format, time_stamp_format_size) BIND(C) 447 USE ISO_C_BINDING 448 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 449 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_format 450 INTEGER (kind = C_INT) , VALUE :: time_stamp_format_size 451 END SUBROUTINE cxios_get_filegroup_time_stamp_format 452 453 FUNCTION cxios_is_defined_filegroup_time_stamp_format(filegroup_hdl) BIND(C) 454 USE ISO_C_BINDING 455 LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_stamp_format 456 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 457 END FUNCTION cxios_is_defined_filegroup_time_stamp_format 458 459 460 SUBROUTINE cxios_set_filegroup_time_stamp_name(filegroup_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 461 USE ISO_C_BINDING 462 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 463 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_name 464 INTEGER (kind = C_INT) , VALUE :: time_stamp_name_size 465 END SUBROUTINE cxios_set_filegroup_time_stamp_name 466 467 SUBROUTINE cxios_get_filegroup_time_stamp_name(filegroup_hdl, time_stamp_name, time_stamp_name_size) BIND(C) 468 USE ISO_C_BINDING 469 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 470 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_stamp_name 471 INTEGER (kind = C_INT) , VALUE :: time_stamp_name_size 472 END SUBROUTINE cxios_get_filegroup_time_stamp_name 473 474 FUNCTION cxios_is_defined_filegroup_time_stamp_name(filegroup_hdl) BIND(C) 475 USE ISO_C_BINDING 476 LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_stamp_name 477 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 478 END FUNCTION cxios_is_defined_filegroup_time_stamp_name 479 480 481 SUBROUTINE cxios_set_filegroup_time_units(filegroup_hdl, time_units, time_units_size) BIND(C) 482 USE ISO_C_BINDING 483 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 484 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_units 485 INTEGER (kind = C_INT) , VALUE :: time_units_size 486 END SUBROUTINE cxios_set_filegroup_time_units 487 488 SUBROUTINE cxios_get_filegroup_time_units(filegroup_hdl, time_units, time_units_size) BIND(C) 489 USE ISO_C_BINDING 490 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 491 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: time_units 492 INTEGER (kind = C_INT) , VALUE :: time_units_size 493 END SUBROUTINE cxios_get_filegroup_time_units 494 495 FUNCTION cxios_is_defined_filegroup_time_units(filegroup_hdl) BIND(C) 496 USE ISO_C_BINDING 497 LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_time_units 498 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 499 END FUNCTION cxios_is_defined_filegroup_time_units 500 501 439 502 SUBROUTINE cxios_set_filegroup_timeseries(filegroup_hdl, timeseries, timeseries_size) BIND(C) 440 503 USE ISO_C_BINDING … … 499 562 END FUNCTION cxios_is_defined_filegroup_type 500 563 564 565 SUBROUTINE cxios_set_filegroup_uuid_format(filegroup_hdl, uuid_format, uuid_format_size) BIND(C) 566 USE ISO_C_BINDING 567 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 568 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_format 569 INTEGER (kind = C_INT) , VALUE :: uuid_format_size 570 END SUBROUTINE cxios_set_filegroup_uuid_format 571 572 SUBROUTINE cxios_get_filegroup_uuid_format(filegroup_hdl, uuid_format, uuid_format_size) BIND(C) 573 USE ISO_C_BINDING 574 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 575 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_format 576 INTEGER (kind = C_INT) , VALUE :: uuid_format_size 577 END SUBROUTINE cxios_get_filegroup_uuid_format 578 579 FUNCTION cxios_is_defined_filegroup_uuid_format(filegroup_hdl) BIND(C) 580 USE ISO_C_BINDING 581 LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_uuid_format 582 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 583 END FUNCTION cxios_is_defined_filegroup_uuid_format 584 585 586 SUBROUTINE cxios_set_filegroup_uuid_name(filegroup_hdl, uuid_name, uuid_name_size) BIND(C) 587 USE ISO_C_BINDING 588 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 589 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_name 590 INTEGER (kind = C_INT) , VALUE :: uuid_name_size 591 END SUBROUTINE cxios_set_filegroup_uuid_name 592 593 SUBROUTINE cxios_get_filegroup_uuid_name(filegroup_hdl, uuid_name, uuid_name_size) BIND(C) 594 USE ISO_C_BINDING 595 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 596 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: uuid_name 597 INTEGER (kind = C_INT) , VALUE :: uuid_name_size 598 END SUBROUTINE cxios_get_filegroup_uuid_name 599 600 FUNCTION cxios_is_defined_filegroup_uuid_name(filegroup_hdl) BIND(C) 601 USE ISO_C_BINDING 602 LOGICAL(kind=C_BOOL) :: cxios_is_defined_filegroup_uuid_name 603 INTEGER (kind = C_INTPTR_T), VALUE :: filegroup_hdl 604 END FUNCTION cxios_is_defined_filegroup_uuid_name 605 501 606 END INTERFACE 502 607 -
XIOS/dev/dev_olga/src/interface/fortran_attr/iaxis_attr.F90
r966 r1158 12 12 13 13 SUBROUTINE xios(set_axis_attr) & 14 ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n & 15 , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 14 ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 15 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 16 ) 16 17 17 18 IMPLICIT NONE … … 25 26 INTEGER , OPTIONAL, INTENT(IN) :: data_n 26 27 INTEGER , OPTIONAL, INTENT(IN) :: index(:) 28 CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 27 29 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 28 30 LOGICAL , OPTIONAL, INTENT(IN) :: mask(:) … … 33 35 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 34 36 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 37 INTEGER , OPTIONAL, INTENT(IN) :: prec 35 38 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 36 39 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit … … 40 43 (axis_id,axis_hdl) 41 44 CALL xios(set_axis_attr_hdl_) & 42 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 43 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 45 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 46 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 47 ) 44 48 45 49 END SUBROUTINE xios(set_axis_attr) 46 50 47 51 SUBROUTINE xios(set_axis_attr_hdl) & 48 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 49 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 52 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 53 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 54 ) 50 55 51 56 IMPLICIT NONE … … 58 63 INTEGER , OPTIONAL, INTENT(IN) :: data_n 59 64 INTEGER , OPTIONAL, INTENT(IN) :: index(:) 65 CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 60 66 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 61 67 LOGICAL , OPTIONAL, INTENT(IN) :: mask(:) … … 66 72 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 67 73 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 74 INTEGER , OPTIONAL, INTENT(IN) :: prec 68 75 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 69 76 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit … … 71 78 72 79 CALL xios(set_axis_attr_hdl_) & 73 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 74 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 80 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 81 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 82 ) 75 83 76 84 END SUBROUTINE xios(set_axis_attr_hdl) 77 85 78 86 SUBROUTINE xios(set_axis_attr_hdl_) & 79 ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, l ong_name_ &80 , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_ &81 )87 ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_ & 88 , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_ & 89 , value_ ) 82 90 83 91 IMPLICIT NONE … … 90 98 INTEGER , OPTIONAL, INTENT(IN) :: data_n_ 91 99 INTEGER , OPTIONAL, INTENT(IN) :: index_(:) 100 CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label_(:) 92 101 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 93 102 LOGICAL , OPTIONAL, INTENT(IN) :: mask_(:) … … 98 107 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 99 108 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_ 109 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 100 110 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 101 111 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_ … … 135 145 CALL cxios_set_axis_index & 136 146 (axis_hdl%daddr, index_, SHAPE(index_)) 147 ENDIF 148 149 IF (PRESENT(label_)) THEN 150 CALL cxios_set_axis_label & 151 (axis_hdl%daddr, label_, LEN(label_), LEN_TRIM(label_), SHAPE(label_)) 137 152 ENDIF 138 153 … … 174 189 ENDIF 175 190 191 IF (PRESENT(prec_)) THEN 192 CALL cxios_set_axis_prec & 193 (axis_hdl%daddr, prec_) 194 ENDIF 195 176 196 IF (PRESENT(standard_name_)) THEN 177 197 CALL cxios_set_axis_standard_name & … … 192 212 193 213 SUBROUTINE xios(get_axis_attr) & 194 ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n & 195 , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 214 ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 215 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 216 ) 196 217 197 218 IMPLICIT NONE … … 205 226 INTEGER , OPTIONAL, INTENT(OUT) :: data_n 206 227 INTEGER , OPTIONAL, INTENT(OUT) :: index(:) 228 CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 207 229 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 208 230 LOGICAL , OPTIONAL, INTENT(OUT) :: mask(:) … … 213 235 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 214 236 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 237 INTEGER , OPTIONAL, INTENT(OUT) :: prec 215 238 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 216 239 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit … … 220 243 (axis_id,axis_hdl) 221 244 CALL xios(get_axis_attr_hdl_) & 222 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 223 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 245 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 246 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 247 ) 224 248 225 249 END SUBROUTINE xios(get_axis_attr) 226 250 227 251 SUBROUTINE xios(get_axis_attr_hdl) & 228 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 229 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 252 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 253 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 254 ) 230 255 231 256 IMPLICIT NONE … … 238 263 INTEGER , OPTIONAL, INTENT(OUT) :: data_n 239 264 INTEGER , OPTIONAL, INTENT(OUT) :: index(:) 265 CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 240 266 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 241 267 LOGICAL , OPTIONAL, INTENT(OUT) :: mask(:) … … 246 272 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 247 273 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 274 INTEGER , OPTIONAL, INTENT(OUT) :: prec 248 275 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 249 276 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit … … 251 278 252 279 CALL xios(get_axis_attr_hdl_) & 253 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 254 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 280 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 281 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 282 ) 255 283 256 284 END SUBROUTINE xios(get_axis_attr_hdl) 257 285 258 286 SUBROUTINE xios(get_axis_attr_hdl_) & 259 ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, l ong_name_ &260 , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_ &261 )287 ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_ & 288 , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_ & 289 , value_ ) 262 290 263 291 IMPLICIT NONE … … 270 298 INTEGER , OPTIONAL, INTENT(OUT) :: data_n_ 271 299 INTEGER , OPTIONAL, INTENT(OUT) :: index_(:) 300 CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label_(:) 272 301 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 273 302 LOGICAL , OPTIONAL, INTENT(OUT) :: mask_(:) … … 278 307 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 279 308 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_ 309 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 280 310 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 281 311 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_ … … 315 345 CALL cxios_get_axis_index & 316 346 (axis_hdl%daddr, index_, SHAPE(index_)) 347 ENDIF 348 349 IF (PRESENT(label_)) THEN 350 CALL cxios_get_axis_label & 351 (axis_hdl%daddr, label_, LEN(label_), SHAPE(label_)) 317 352 ENDIF 318 353 … … 354 389 ENDIF 355 390 391 IF (PRESENT(prec_)) THEN 392 CALL cxios_get_axis_prec & 393 (axis_hdl%daddr, prec_) 394 ENDIF 395 356 396 IF (PRESENT(standard_name_)) THEN 357 397 CALL cxios_get_axis_standard_name & … … 372 412 373 413 SUBROUTINE xios(is_defined_axis_attr) & 374 ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask, n & 375 , n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 414 ( axis_id, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 415 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 416 ) 376 417 377 418 IMPLICIT NONE … … 392 433 LOGICAL, OPTIONAL, INTENT(OUT) :: index 393 434 LOGICAL(KIND=C_BOOL) :: index_tmp 435 LOGICAL, OPTIONAL, INTENT(OUT) :: label 436 LOGICAL(KIND=C_BOOL) :: label_tmp 394 437 LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 395 438 LOGICAL(KIND=C_BOOL) :: long_name_tmp … … 406 449 LOGICAL, OPTIONAL, INTENT(OUT) :: positive 407 450 LOGICAL(KIND=C_BOOL) :: positive_tmp 451 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 452 LOGICAL(KIND=C_BOOL) :: prec_tmp 408 453 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 409 454 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 416 461 (axis_id,axis_hdl) 417 462 CALL xios(is_defined_axis_attr_hdl_) & 418 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 419 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 463 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 464 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 465 ) 420 466 421 467 END SUBROUTINE xios(is_defined_axis_attr) 422 468 423 469 SUBROUTINE xios(is_defined_axis_attr_hdl) & 424 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 425 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 470 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 471 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 472 ) 426 473 427 474 IMPLICIT NONE … … 441 488 LOGICAL, OPTIONAL, INTENT(OUT) :: index 442 489 LOGICAL(KIND=C_BOOL) :: index_tmp 490 LOGICAL, OPTIONAL, INTENT(OUT) :: label 491 LOGICAL(KIND=C_BOOL) :: label_tmp 443 492 LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 444 493 LOGICAL(KIND=C_BOOL) :: long_name_tmp … … 455 504 LOGICAL, OPTIONAL, INTENT(OUT) :: positive 456 505 LOGICAL(KIND=C_BOOL) :: positive_tmp 506 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 507 LOGICAL(KIND=C_BOOL) :: prec_tmp 457 508 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 458 509 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 463 514 464 515 CALL xios(is_defined_axis_attr_hdl_) & 465 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, long_name, mask & 466 , n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 516 ( axis_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, index, label, long_name & 517 , mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit, value & 518 ) 467 519 468 520 END SUBROUTINE xios(is_defined_axis_attr_hdl) 469 521 470 522 SUBROUTINE xios(is_defined_axis_attr_hdl_) & 471 ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, l ong_name_ &472 , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_, unit_, value_ &473 )523 ( axis_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, index_, label_, long_name_ & 524 , mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_, unit_ & 525 , value_ ) 474 526 475 527 IMPLICIT NONE … … 489 541 LOGICAL, OPTIONAL, INTENT(OUT) :: index_ 490 542 LOGICAL(KIND=C_BOOL) :: index__tmp 543 LOGICAL, OPTIONAL, INTENT(OUT) :: label_ 544 LOGICAL(KIND=C_BOOL) :: label__tmp 491 545 LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_ 492 546 LOGICAL(KIND=C_BOOL) :: long_name__tmp … … 503 557 LOGICAL, OPTIONAL, INTENT(OUT) :: positive_ 504 558 LOGICAL(KIND=C_BOOL) :: positive__tmp 559 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 560 LOGICAL(KIND=C_BOOL) :: prec__tmp 505 561 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 506 562 LOGICAL(KIND=C_BOOL) :: standard_name__tmp … … 552 608 ENDIF 553 609 610 IF (PRESENT(label_)) THEN 611 label__tmp = cxios_is_defined_axis_label & 612 (axis_hdl%daddr) 613 label_ = label__tmp 614 ENDIF 615 554 616 IF (PRESENT(long_name_)) THEN 555 617 long_name__tmp = cxios_is_defined_axis_long_name & … … 594 656 ENDIF 595 657 658 IF (PRESENT(prec_)) THEN 659 prec__tmp = cxios_is_defined_axis_prec & 660 (axis_hdl%daddr) 661 prec_ = prec__tmp 662 ENDIF 663 596 664 IF (PRESENT(standard_name_)) THEN 597 665 standard_name__tmp = cxios_is_defined_axis_standard_name & -
XIOS/dev/dev_olga/src/interface/fortran_attr/iaxisgroup_attr.F90
r966 r1158 12 12 13 13 SUBROUTINE xios(set_axisgroup_attr) & 14 ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 15 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 14 ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 15 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 16 , value ) 16 17 17 18 IMPLICIT NONE … … 26 27 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 27 28 INTEGER , OPTIONAL, INTENT(IN) :: index(:) 29 CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 28 30 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 29 31 LOGICAL , OPTIONAL, INTENT(IN) :: mask(:) … … 34 36 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 35 37 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 38 INTEGER , OPTIONAL, INTENT(IN) :: prec 36 39 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 37 40 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit … … 41 44 (axisgroup_id,axisgroup_hdl) 42 45 CALL xios(set_axisgroup_attr_hdl_) & 43 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 44 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 46 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 47 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 48 , value ) 45 49 46 50 END SUBROUTINE xios(set_axisgroup_attr) 47 51 48 52 SUBROUTINE xios(set_axisgroup_attr_hdl) & 49 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 50 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 53 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 54 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 55 , value ) 51 56 52 57 IMPLICIT NONE … … 60 65 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 61 66 INTEGER , OPTIONAL, INTENT(IN) :: index(:) 67 CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label(:) 62 68 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 63 69 LOGICAL , OPTIONAL, INTENT(IN) :: mask(:) … … 68 74 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 69 75 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive 76 INTEGER , OPTIONAL, INTENT(IN) :: prec 70 77 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 71 78 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit … … 73 80 74 81 CALL xios(set_axisgroup_attr_hdl_) & 75 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 76 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 82 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 83 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 84 , value ) 77 85 78 86 END SUBROUTINE xios(set_axisgroup_attr_hdl) … … 80 88 SUBROUTINE xios(set_axisgroup_attr_hdl_) & 81 89 ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_ & 82 , l ong_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_ &90 , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_ & 83 91 , unit_, value_ ) 84 92 … … 93 101 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_ 94 102 INTEGER , OPTIONAL, INTENT(IN) :: index_(:) 103 CHARACTER(len=*) , OPTIONAL, INTENT(IN) :: label_(:) 95 104 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 96 105 LOGICAL , OPTIONAL, INTENT(IN) :: mask_(:) … … 101 110 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 102 111 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: positive_ 112 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 103 113 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 104 114 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: unit_ … … 143 153 CALL cxios_set_axisgroup_index & 144 154 (axisgroup_hdl%daddr, index_, SHAPE(index_)) 155 ENDIF 156 157 IF (PRESENT(label_)) THEN 158 CALL cxios_set_axisgroup_label & 159 (axisgroup_hdl%daddr, label_, LEN(label_), LEN_TRIM(label_), SHAPE(label_)) 145 160 ENDIF 146 161 … … 182 197 ENDIF 183 198 199 IF (PRESENT(prec_)) THEN 200 CALL cxios_set_axisgroup_prec & 201 (axisgroup_hdl%daddr, prec_) 202 ENDIF 203 184 204 IF (PRESENT(standard_name_)) THEN 185 205 CALL cxios_set_axisgroup_standard_name & … … 200 220 201 221 SUBROUTINE xios(get_axisgroup_attr) & 202 ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 203 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 222 ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 223 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 224 , value ) 204 225 205 226 IMPLICIT NONE … … 214 235 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 215 236 INTEGER , OPTIONAL, INTENT(OUT) :: index(:) 237 CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 216 238 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 217 239 LOGICAL , OPTIONAL, INTENT(OUT) :: mask(:) … … 222 244 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 223 245 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 246 INTEGER , OPTIONAL, INTENT(OUT) :: prec 224 247 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 225 248 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit … … 229 252 (axisgroup_id,axisgroup_hdl) 230 253 CALL xios(get_axisgroup_attr_hdl_) & 231 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 232 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 254 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 255 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 256 , value ) 233 257 234 258 END SUBROUTINE xios(get_axisgroup_attr) 235 259 236 260 SUBROUTINE xios(get_axisgroup_attr_hdl) & 237 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 238 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 261 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 262 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 263 , value ) 239 264 240 265 IMPLICIT NONE … … 248 273 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 249 274 INTEGER , OPTIONAL, INTENT(OUT) :: index(:) 275 CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label(:) 250 276 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 251 277 LOGICAL , OPTIONAL, INTENT(OUT) :: mask(:) … … 256 282 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 257 283 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive 284 INTEGER , OPTIONAL, INTENT(OUT) :: prec 258 285 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 259 286 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit … … 261 288 262 289 CALL xios(get_axisgroup_attr_hdl_) & 263 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 264 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 290 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 291 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 292 , value ) 265 293 266 294 END SUBROUTINE xios(get_axisgroup_attr_hdl) … … 268 296 SUBROUTINE xios(get_axisgroup_attr_hdl_) & 269 297 ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_ & 270 , l ong_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_ &298 , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_ & 271 299 , unit_, value_ ) 272 300 … … 281 309 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_ 282 310 INTEGER , OPTIONAL, INTENT(OUT) :: index_(:) 311 CHARACTER(len=*) , OPTIONAL, INTENT(OUT) :: label_(:) 283 312 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 284 313 LOGICAL , OPTIONAL, INTENT(OUT) :: mask_(:) … … 289 318 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 290 319 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: positive_ 320 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 291 321 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 292 322 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: unit_ … … 331 361 CALL cxios_get_axisgroup_index & 332 362 (axisgroup_hdl%daddr, index_, SHAPE(index_)) 363 ENDIF 364 365 IF (PRESENT(label_)) THEN 366 CALL cxios_get_axisgroup_label & 367 (axisgroup_hdl%daddr, label_, LEN(label_), SHAPE(label_)) 333 368 ENDIF 334 369 … … 370 405 ENDIF 371 406 407 IF (PRESENT(prec_)) THEN 408 CALL cxios_get_axisgroup_prec & 409 (axisgroup_hdl%daddr, prec_) 410 ENDIF 411 372 412 IF (PRESENT(standard_name_)) THEN 373 413 CALL cxios_get_axisgroup_standard_name & … … 388 428 389 429 SUBROUTINE xios(is_defined_axisgroup_attr) & 390 ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 391 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 430 ( axisgroup_id, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 431 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 432 , value ) 392 433 393 434 IMPLICIT NONE … … 410 451 LOGICAL, OPTIONAL, INTENT(OUT) :: index 411 452 LOGICAL(KIND=C_BOOL) :: index_tmp 453 LOGICAL, OPTIONAL, INTENT(OUT) :: label 454 LOGICAL(KIND=C_BOOL) :: label_tmp 412 455 LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 413 456 LOGICAL(KIND=C_BOOL) :: long_name_tmp … … 424 467 LOGICAL, OPTIONAL, INTENT(OUT) :: positive 425 468 LOGICAL(KIND=C_BOOL) :: positive_tmp 469 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 470 LOGICAL(KIND=C_BOOL) :: prec_tmp 426 471 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 427 472 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 434 479 (axisgroup_id,axisgroup_hdl) 435 480 CALL xios(is_defined_axisgroup_attr_hdl_) & 436 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 437 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 481 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 482 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 483 , value ) 438 484 439 485 END SUBROUTINE xios(is_defined_axisgroup_attr) 440 486 441 487 SUBROUTINE xios(is_defined_axisgroup_attr_hdl) & 442 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 443 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 488 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 489 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 490 , value ) 444 491 445 492 IMPLICIT NONE … … 461 508 LOGICAL, OPTIONAL, INTENT(OUT) :: index 462 509 LOGICAL(KIND=C_BOOL) :: index_tmp 510 LOGICAL, OPTIONAL, INTENT(OUT) :: label 511 LOGICAL(KIND=C_BOOL) :: label_tmp 463 512 LOGICAL, OPTIONAL, INTENT(OUT) :: long_name 464 513 LOGICAL(KIND=C_BOOL) :: long_name_tmp … … 475 524 LOGICAL, OPTIONAL, INTENT(OUT) :: positive 476 525 LOGICAL(KIND=C_BOOL) :: positive_tmp 526 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 527 LOGICAL(KIND=C_BOOL) :: prec_tmp 477 528 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 478 529 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 483 534 484 535 CALL xios(is_defined_axisgroup_attr_hdl_) & 485 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, long_name & 486 , mask, n, n_distributed_partition, n_glo, name, positive, standard_name, unit, value ) 536 ( axisgroup_hdl, axis_ref, begin, bounds, data_begin, data_index, data_n, group_ref, index, label & 537 , long_name, mask, n, n_distributed_partition, n_glo, name, positive, prec, standard_name, unit & 538 , value ) 487 539 488 540 END SUBROUTINE xios(is_defined_axisgroup_attr_hdl) … … 490 542 SUBROUTINE xios(is_defined_axisgroup_attr_hdl_) & 491 543 ( axisgroup_hdl, axis_ref_, begin_, bounds_, data_begin_, data_index_, data_n_, group_ref_, index_ & 492 , l ong_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, standard_name_ &544 , label_, long_name_, mask_, n_, n_distributed_partition_, n_glo_, name_, positive_, prec_, standard_name_ & 493 545 , unit_, value_ ) 494 546 … … 511 563 LOGICAL, OPTIONAL, INTENT(OUT) :: index_ 512 564 LOGICAL(KIND=C_BOOL) :: index__tmp 565 LOGICAL, OPTIONAL, INTENT(OUT) :: label_ 566 LOGICAL(KIND=C_BOOL) :: label__tmp 513 567 LOGICAL, OPTIONAL, INTENT(OUT) :: long_name_ 514 568 LOGICAL(KIND=C_BOOL) :: long_name__tmp … … 525 579 LOGICAL, OPTIONAL, INTENT(OUT) :: positive_ 526 580 LOGICAL(KIND=C_BOOL) :: positive__tmp 581 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 582 LOGICAL(KIND=C_BOOL) :: prec__tmp 527 583 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 528 584 LOGICAL(KIND=C_BOOL) :: standard_name__tmp … … 580 636 ENDIF 581 637 638 IF (PRESENT(label_)) THEN 639 label__tmp = cxios_is_defined_axisgroup_label & 640 (axisgroup_hdl%daddr) 641 label_ = label__tmp 642 ENDIF 643 582 644 IF (PRESENT(long_name_)) THEN 583 645 long_name__tmp = cxios_is_defined_axisgroup_long_name & … … 622 684 ENDIF 623 685 686 IF (PRESENT(prec_)) THEN 687 prec__tmp = cxios_is_defined_axisgroup_prec & 688 (axisgroup_hdl%daddr) 689 prec_ = prec__tmp 690 ENDIF 691 624 692 IF (PRESENT(standard_name_)) THEN 625 693 standard_name__tmp = cxios_is_defined_axisgroup_standard_name & -
XIOS/dev/dev_olga/src/interface/fortran_attr/idomain_attr.F90
r966 r1158 15 15 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 16 16 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 17 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )17 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 18 18 19 19 IMPLICIT NONE … … 52 52 INTEGER , OPTIONAL, INTENT(IN) :: nj_glo 53 53 INTEGER , OPTIONAL, INTENT(IN) :: nvertex 54 INTEGER , OPTIONAL, INTENT(IN) :: prec 54 55 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 55 56 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type … … 61 62 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 62 63 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 63 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )64 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 64 65 65 66 END SUBROUTINE xios(set_domain_attr) … … 69 70 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 70 71 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 71 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )72 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 72 73 73 74 IMPLICIT NONE … … 105 106 INTEGER , OPTIONAL, INTENT(IN) :: nj_glo 106 107 INTEGER , OPTIONAL, INTENT(IN) :: nvertex 108 INTEGER , OPTIONAL, INTENT(IN) :: prec 107 109 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 108 110 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type … … 112 114 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 113 115 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 114 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )116 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 115 117 116 118 END SUBROUTINE xios(set_domain_attr_hdl) … … 120 122 , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_ & 121 123 , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_ & 122 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_ &124 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_ & 123 125 , type_ ) 124 126 … … 157 159 INTEGER , OPTIONAL, INTENT(IN) :: nj_glo_ 158 160 INTEGER , OPTIONAL, INTENT(IN) :: nvertex_ 161 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 159 162 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 160 163 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ … … 314 317 ENDIF 315 318 319 IF (PRESENT(prec_)) THEN 320 CALL cxios_set_domain_prec & 321 (domain_hdl%daddr, prec_) 322 ENDIF 323 316 324 IF (PRESENT(standard_name_)) THEN 317 325 CALL cxios_set_domain_standard_name & … … 330 338 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 331 339 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 332 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )340 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 333 341 334 342 IMPLICIT NONE … … 367 375 INTEGER , OPTIONAL, INTENT(OUT) :: nj_glo 368 376 INTEGER , OPTIONAL, INTENT(OUT) :: nvertex 377 INTEGER , OPTIONAL, INTENT(OUT) :: prec 369 378 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 370 379 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type … … 376 385 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 377 386 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 378 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )387 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 379 388 380 389 END SUBROUTINE xios(get_domain_attr) … … 384 393 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 385 394 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 386 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )395 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 387 396 388 397 IMPLICIT NONE … … 420 429 INTEGER , OPTIONAL, INTENT(OUT) :: nj_glo 421 430 INTEGER , OPTIONAL, INTENT(OUT) :: nvertex 431 INTEGER , OPTIONAL, INTENT(OUT) :: prec 422 432 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 423 433 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type … … 427 437 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 428 438 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 429 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )439 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 430 440 431 441 END SUBROUTINE xios(get_domain_attr_hdl) … … 435 445 , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_ & 436 446 , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_ & 437 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_ &447 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_ & 438 448 , type_ ) 439 449 … … 472 482 INTEGER , OPTIONAL, INTENT(OUT) :: nj_glo_ 473 483 INTEGER , OPTIONAL, INTENT(OUT) :: nvertex_ 484 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 474 485 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 475 486 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ … … 629 640 ENDIF 630 641 642 IF (PRESENT(prec_)) THEN 643 CALL cxios_get_domain_prec & 644 (domain_hdl%daddr, prec_) 645 ENDIF 646 631 647 IF (PRESENT(standard_name_)) THEN 632 648 CALL cxios_get_domain_standard_name & … … 645 661 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 646 662 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 647 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )663 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 648 664 649 665 IMPLICIT NONE … … 710 726 LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 711 727 LOGICAL(KIND=C_BOOL) :: nvertex_tmp 728 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 729 LOGICAL(KIND=C_BOOL) :: prec_tmp 712 730 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 713 731 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 721 739 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 722 740 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 723 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )741 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 724 742 725 743 END SUBROUTINE xios(is_defined_domain_attr) … … 729 747 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 730 748 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 731 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )749 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 732 750 733 751 IMPLICIT NONE … … 793 811 LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 794 812 LOGICAL(KIND=C_BOOL) :: nvertex_tmp 813 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 814 LOGICAL(KIND=C_BOOL) :: prec_tmp 795 815 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 796 816 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 802 822 , data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, i_index, ibegin, j_index & 803 823 , jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d, mask_1d, mask_2d, name & 804 , ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )824 , ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 805 825 806 826 END SUBROUTINE xios(is_defined_domain_attr_hdl) … … 810 830 , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_ & 811 831 , i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_ & 812 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_ &832 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_ & 813 833 , type_ ) 814 834 … … 875 895 LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex_ 876 896 LOGICAL(KIND=C_BOOL) :: nvertex__tmp 897 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 898 LOGICAL(KIND=C_BOOL) :: prec__tmp 877 899 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 878 900 LOGICAL(KIND=C_BOOL) :: standard_name__tmp … … 1060 1082 ENDIF 1061 1083 1084 IF (PRESENT(prec_)) THEN 1085 prec__tmp = cxios_is_defined_domain_prec & 1086 (domain_hdl%daddr) 1087 prec_ = prec__tmp 1088 ENDIF 1089 1062 1090 IF (PRESENT(standard_name_)) THEN 1063 1091 standard_name__tmp = cxios_is_defined_domain_standard_name & -
XIOS/dev/dev_olga/src/interface/fortran_attr/idomaingroup_attr.F90
r966 r1158 15 15 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 16 16 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 17 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )17 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 18 18 19 19 IMPLICIT NONE … … 53 53 INTEGER , OPTIONAL, INTENT(IN) :: nj_glo 54 54 INTEGER , OPTIONAL, INTENT(IN) :: nvertex 55 INTEGER , OPTIONAL, INTENT(IN) :: prec 55 56 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 56 57 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type … … 62 63 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 63 64 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 64 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )65 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 65 66 66 67 END SUBROUTINE xios(set_domaingroup_attr) … … 70 71 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 71 72 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 72 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )73 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 73 74 74 75 IMPLICIT NONE … … 107 108 INTEGER , OPTIONAL, INTENT(IN) :: nj_glo 108 109 INTEGER , OPTIONAL, INTENT(IN) :: nvertex 110 INTEGER , OPTIONAL, INTENT(IN) :: prec 109 111 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name 110 112 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type … … 114 116 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 115 117 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 116 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )118 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 117 119 118 120 END SUBROUTINE xios(set_domaingroup_attr_hdl) … … 122 124 , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_ & 123 125 , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_ & 124 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_ &126 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_ & 125 127 , type_ ) 126 128 … … 160 162 INTEGER , OPTIONAL, INTENT(IN) :: nj_glo_ 161 163 INTEGER , OPTIONAL, INTENT(IN) :: nvertex_ 164 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 162 165 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ 163 166 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ … … 322 325 ENDIF 323 326 327 IF (PRESENT(prec_)) THEN 328 CALL cxios_set_domaingroup_prec & 329 (domaingroup_hdl%daddr, prec_) 330 ENDIF 331 324 332 IF (PRESENT(standard_name_)) THEN 325 333 CALL cxios_set_domaingroup_standard_name & … … 338 346 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 339 347 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 340 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )348 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 341 349 342 350 IMPLICIT NONE … … 376 384 INTEGER , OPTIONAL, INTENT(OUT) :: nj_glo 377 385 INTEGER , OPTIONAL, INTENT(OUT) :: nvertex 386 INTEGER , OPTIONAL, INTENT(OUT) :: prec 378 387 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 379 388 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type … … 385 394 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 386 395 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 387 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )396 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 388 397 389 398 END SUBROUTINE xios(get_domaingroup_attr) … … 393 402 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 394 403 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 395 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )404 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 396 405 397 406 IMPLICIT NONE … … 430 439 INTEGER , OPTIONAL, INTENT(OUT) :: nj_glo 431 440 INTEGER , OPTIONAL, INTENT(OUT) :: nvertex 441 INTEGER , OPTIONAL, INTENT(OUT) :: prec 432 442 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name 433 443 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type … … 437 447 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 438 448 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 439 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )449 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 440 450 441 451 END SUBROUTINE xios(get_domaingroup_attr_hdl) … … 445 455 , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_ & 446 456 , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_ & 447 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_ &457 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_ & 448 458 , type_ ) 449 459 … … 483 493 INTEGER , OPTIONAL, INTENT(OUT) :: nj_glo_ 484 494 INTEGER , OPTIONAL, INTENT(OUT) :: nvertex_ 495 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 485 496 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ 486 497 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ … … 645 656 ENDIF 646 657 658 IF (PRESENT(prec_)) THEN 659 CALL cxios_get_domaingroup_prec & 660 (domaingroup_hdl%daddr, prec_) 661 ENDIF 662 647 663 IF (PRESENT(standard_name_)) THEN 648 664 CALL cxios_get_domaingroup_standard_name & … … 661 677 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 662 678 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 663 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )679 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 664 680 665 681 IMPLICIT NONE … … 728 744 LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 729 745 LOGICAL(KIND=C_BOOL) :: nvertex_tmp 746 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 747 LOGICAL(KIND=C_BOOL) :: prec_tmp 730 748 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 731 749 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 739 757 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 740 758 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 741 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )759 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 742 760 743 761 END SUBROUTINE xios(is_defined_domaingroup_attr) … … 747 765 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 748 766 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 749 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )767 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 750 768 751 769 IMPLICIT NONE … … 813 831 LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex 814 832 LOGICAL(KIND=C_BOOL) :: nvertex_tmp 833 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 834 LOGICAL(KIND=C_BOOL) :: prec_tmp 815 835 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name 816 836 LOGICAL(KIND=C_BOOL) :: standard_name_tmp … … 822 842 , data_i_index, data_ibegin, data_j_index, data_jbegin, data_ni, data_nj, domain_ref, group_ref & 823 843 , i_index, ibegin, j_index, jbegin, latvalue_1d, latvalue_2d, long_name, lonvalue_1d, lonvalue_2d & 824 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, standard_name, type )844 , mask_1d, mask_2d, name, ni, ni_glo, nj, nj_glo, nvertex, prec, standard_name, type ) 825 845 826 846 END SUBROUTINE xios(is_defined_domaingroup_attr_hdl) … … 830 850 , data_i_index_, data_ibegin_, data_j_index_, data_jbegin_, data_ni_, data_nj_, domain_ref_ & 831 851 , group_ref_, i_index_, ibegin_, j_index_, jbegin_, latvalue_1d_, latvalue_2d_, long_name_, lonvalue_1d_ & 832 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, standard_name_ &852 , lonvalue_2d_, mask_1d_, mask_2d_, name_, ni_, ni_glo_, nj_, nj_glo_, nvertex_, prec_, standard_name_ & 833 853 , type_ ) 834 854 … … 897 917 LOGICAL, OPTIONAL, INTENT(OUT) :: nvertex_ 898 918 LOGICAL(KIND=C_BOOL) :: nvertex__tmp 919 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 920 LOGICAL(KIND=C_BOOL) :: prec__tmp 899 921 LOGICAL, OPTIONAL, INTENT(OUT) :: standard_name_ 900 922 LOGICAL(KIND=C_BOOL) :: standard_name__tmp … … 1088 1110 ENDIF 1089 1111 1112 IF (PRESENT(prec_)) THEN 1113 prec__tmp = cxios_is_defined_domaingroup_prec & 1114 (domaingroup_hdl%daddr) 1115 prec_ = prec__tmp 1116 ENDIF 1117 1090 1118 IF (PRESENT(standard_name_)) THEN 1091 1119 standard_name__tmp = cxios_is_defined_domaingroup_standard_name & -
XIOS/dev/dev_olga/src/interface/fortran_attr/iexpand_domain_attr.F90
r981 r1158 12 12 13 13 SUBROUTINE xios(set_expand_domain_attr) & 14 ( expand_domain_id, order, type )14 ( expand_domain_id, i_periodic, j_periodic, order, type ) 15 15 16 16 IMPLICIT NONE 17 17 TYPE(txios(expand_domain)) :: expand_domain_hdl 18 18 CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 19 LOGICAL , OPTIONAL, INTENT(IN) :: i_periodic 20 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 21 LOGICAL , OPTIONAL, INTENT(IN) :: j_periodic 22 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 19 23 INTEGER , OPTIONAL, INTENT(IN) :: order 20 24 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type … … 23 27 (expand_domain_id,expand_domain_hdl) 24 28 CALL xios(set_expand_domain_attr_hdl_) & 25 ( expand_domain_hdl, order, type )29 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 26 30 27 31 END SUBROUTINE xios(set_expand_domain_attr) 28 32 29 33 SUBROUTINE xios(set_expand_domain_attr_hdl) & 30 ( expand_domain_hdl, order, type ) 31 32 IMPLICIT NONE 33 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 34 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 35 36 IMPLICIT NONE 37 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 38 LOGICAL , OPTIONAL, INTENT(IN) :: i_periodic 39 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 40 LOGICAL , OPTIONAL, INTENT(IN) :: j_periodic 41 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 34 42 INTEGER , OPTIONAL, INTENT(IN) :: order 35 43 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 36 44 37 45 CALL xios(set_expand_domain_attr_hdl_) & 38 ( expand_domain_hdl, order, type )46 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 39 47 40 48 END SUBROUTINE xios(set_expand_domain_attr_hdl) 41 49 42 50 SUBROUTINE xios(set_expand_domain_attr_hdl_) & 43 ( expand_domain_hdl, order_, type_ ) 44 45 IMPLICIT NONE 46 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 51 ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 52 53 IMPLICIT NONE 54 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 55 LOGICAL , OPTIONAL, INTENT(IN) :: i_periodic_ 56 LOGICAL (KIND=C_BOOL) :: i_periodic__tmp 57 LOGICAL , OPTIONAL, INTENT(IN) :: j_periodic_ 58 LOGICAL (KIND=C_BOOL) :: j_periodic__tmp 47 59 INTEGER , OPTIONAL, INTENT(IN) :: order_ 48 60 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 61 62 IF (PRESENT(i_periodic_)) THEN 63 i_periodic__tmp = i_periodic_ 64 CALL cxios_set_expand_domain_i_periodic & 65 (expand_domain_hdl%daddr, i_periodic__tmp) 66 ENDIF 67 68 IF (PRESENT(j_periodic_)) THEN 69 j_periodic__tmp = j_periodic_ 70 CALL cxios_set_expand_domain_j_periodic & 71 (expand_domain_hdl%daddr, j_periodic__tmp) 72 ENDIF 49 73 50 74 IF (PRESENT(order_)) THEN … … 61 85 62 86 SUBROUTINE xios(get_expand_domain_attr) & 63 ( expand_domain_id, order, type )87 ( expand_domain_id, i_periodic, j_periodic, order, type ) 64 88 65 89 IMPLICIT NONE 66 90 TYPE(txios(expand_domain)) :: expand_domain_hdl 67 91 CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 92 LOGICAL , OPTIONAL, INTENT(OUT) :: i_periodic 93 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 94 LOGICAL , OPTIONAL, INTENT(OUT) :: j_periodic 95 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 68 96 INTEGER , OPTIONAL, INTENT(OUT) :: order 69 97 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type … … 72 100 (expand_domain_id,expand_domain_hdl) 73 101 CALL xios(get_expand_domain_attr_hdl_) & 74 ( expand_domain_hdl, order, type )102 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 75 103 76 104 END SUBROUTINE xios(get_expand_domain_attr) 77 105 78 106 SUBROUTINE xios(get_expand_domain_attr_hdl) & 79 ( expand_domain_hdl, order, type ) 80 81 IMPLICIT NONE 82 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 107 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 108 109 IMPLICIT NONE 110 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 111 LOGICAL , OPTIONAL, INTENT(OUT) :: i_periodic 112 LOGICAL (KIND=C_BOOL) :: i_periodic_tmp 113 LOGICAL , OPTIONAL, INTENT(OUT) :: j_periodic 114 LOGICAL (KIND=C_BOOL) :: j_periodic_tmp 83 115 INTEGER , OPTIONAL, INTENT(OUT) :: order 84 116 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 85 117 86 118 CALL xios(get_expand_domain_attr_hdl_) & 87 ( expand_domain_hdl, order, type )119 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 88 120 89 121 END SUBROUTINE xios(get_expand_domain_attr_hdl) 90 122 91 123 SUBROUTINE xios(get_expand_domain_attr_hdl_) & 92 ( expand_domain_hdl, order_, type_ ) 93 94 IMPLICIT NONE 95 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 124 ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 125 126 IMPLICIT NONE 127 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 128 LOGICAL , OPTIONAL, INTENT(OUT) :: i_periodic_ 129 LOGICAL (KIND=C_BOOL) :: i_periodic__tmp 130 LOGICAL , OPTIONAL, INTENT(OUT) :: j_periodic_ 131 LOGICAL (KIND=C_BOOL) :: j_periodic__tmp 96 132 INTEGER , OPTIONAL, INTENT(OUT) :: order_ 97 133 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 134 135 IF (PRESENT(i_periodic_)) THEN 136 CALL cxios_get_expand_domain_i_periodic & 137 (expand_domain_hdl%daddr, i_periodic__tmp) 138 i_periodic_ = i_periodic__tmp 139 ENDIF 140 141 IF (PRESENT(j_periodic_)) THEN 142 CALL cxios_get_expand_domain_j_periodic & 143 (expand_domain_hdl%daddr, j_periodic__tmp) 144 j_periodic_ = j_periodic__tmp 145 ENDIF 98 146 99 147 IF (PRESENT(order_)) THEN … … 110 158 111 159 SUBROUTINE xios(is_defined_expand_domain_attr) & 112 ( expand_domain_id, order, type )160 ( expand_domain_id, i_periodic, j_periodic, order, type ) 113 161 114 162 IMPLICIT NONE 115 163 TYPE(txios(expand_domain)) :: expand_domain_hdl 116 164 CHARACTER(LEN=*), INTENT(IN) ::expand_domain_id 165 LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic 166 LOGICAL(KIND=C_BOOL) :: i_periodic_tmp 167 LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic 168 LOGICAL(KIND=C_BOOL) :: j_periodic_tmp 117 169 LOGICAL, OPTIONAL, INTENT(OUT) :: order 118 170 LOGICAL(KIND=C_BOOL) :: order_tmp … … 123 175 (expand_domain_id,expand_domain_hdl) 124 176 CALL xios(is_defined_expand_domain_attr_hdl_) & 125 ( expand_domain_hdl, order, type )177 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 126 178 127 179 END SUBROUTINE xios(is_defined_expand_domain_attr) 128 180 129 181 SUBROUTINE xios(is_defined_expand_domain_attr_hdl) & 130 ( expand_domain_hdl, order, type ) 131 132 IMPLICIT NONE 133 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 182 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 183 184 IMPLICIT NONE 185 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 186 LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic 187 LOGICAL(KIND=C_BOOL) :: i_periodic_tmp 188 LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic 189 LOGICAL(KIND=C_BOOL) :: j_periodic_tmp 134 190 LOGICAL, OPTIONAL, INTENT(OUT) :: order 135 191 LOGICAL(KIND=C_BOOL) :: order_tmp … … 138 194 139 195 CALL xios(is_defined_expand_domain_attr_hdl_) & 140 ( expand_domain_hdl, order, type )196 ( expand_domain_hdl, i_periodic, j_periodic, order, type ) 141 197 142 198 END SUBROUTINE xios(is_defined_expand_domain_attr_hdl) 143 199 144 200 SUBROUTINE xios(is_defined_expand_domain_attr_hdl_) & 145 ( expand_domain_hdl, order_, type_ ) 146 147 IMPLICIT NONE 148 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 201 ( expand_domain_hdl, i_periodic_, j_periodic_, order_, type_ ) 202 203 IMPLICIT NONE 204 TYPE(txios(expand_domain)) , INTENT(IN) :: expand_domain_hdl 205 LOGICAL, OPTIONAL, INTENT(OUT) :: i_periodic_ 206 LOGICAL(KIND=C_BOOL) :: i_periodic__tmp 207 LOGICAL, OPTIONAL, INTENT(OUT) :: j_periodic_ 208 LOGICAL(KIND=C_BOOL) :: j_periodic__tmp 149 209 LOGICAL, OPTIONAL, INTENT(OUT) :: order_ 150 210 LOGICAL(KIND=C_BOOL) :: order__tmp … … 152 212 LOGICAL(KIND=C_BOOL) :: type__tmp 153 213 214 IF (PRESENT(i_periodic_)) THEN 215 i_periodic__tmp = cxios_is_defined_expand_domain_i_periodic & 216 (expand_domain_hdl%daddr) 217 i_periodic_ = i_periodic__tmp 218 ENDIF 219 220 IF (PRESENT(j_periodic_)) THEN 221 j_periodic__tmp = cxios_is_defined_expand_domain_j_periodic & 222 (expand_domain_hdl%daddr) 223 j_periodic_ = j_periodic__tmp 224 ENDIF 225 154 226 IF (PRESENT(order_)) THEN 155 227 order__tmp = cxios_is_defined_expand_domain_order & -
XIOS/dev/dev_olga/src/interface/fortran_attr/ifile_attr.F90
r966 r1158 14 14 ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 15 15 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 16 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &17 )16 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 17 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 18 18 19 19 IMPLICIT NONE … … 43 43 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 44 44 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 45 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 46 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 47 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 45 48 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 46 49 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 47 50 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 52 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 48 53 49 54 CALL xios(get_file_handle) & … … 52 57 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 53 58 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 54 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &55 )59 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 60 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 56 61 57 62 END SUBROUTINE xios(set_file_attr) … … 60 65 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 61 66 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 62 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &63 )67 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 68 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 64 69 65 70 IMPLICIT NONE … … 88 93 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 89 94 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 95 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 96 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 97 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 90 98 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 91 99 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 92 100 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 101 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 102 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 93 103 94 104 CALL xios(set_file_attr_hdl_) & 95 105 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 96 106 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 97 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &98 )107 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 108 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 99 109 100 110 END SUBROUTINE xios(set_file_attr_hdl) … … 103 113 ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_ & 104 114 , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_ & 105 , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time series_ &106 , t s_prefix_, type_ )115 , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_ & 116 , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 107 117 108 118 IMPLICIT NONE … … 131 141 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_ 132 142 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name_ 143 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format_ 144 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name_ 145 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units_ 133 146 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries_ 134 147 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix_ 135 148 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 149 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format_ 150 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name_ 136 151 137 152 IF (PRESENT(append_)) THEN … … 238 253 ENDIF 239 254 255 IF (PRESENT(time_stamp_format_)) THEN 256 CALL cxios_set_file_time_stamp_format & 257 (file_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 258 ENDIF 259 260 IF (PRESENT(time_stamp_name_)) THEN 261 CALL cxios_set_file_time_stamp_name & 262 (file_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 263 ENDIF 264 265 IF (PRESENT(time_units_)) THEN 266 CALL cxios_set_file_time_units & 267 (file_hdl%daddr, time_units_, len(time_units_)) 268 ENDIF 269 240 270 IF (PRESENT(timeseries_)) THEN 241 271 CALL cxios_set_file_timeseries & … … 253 283 ENDIF 254 284 285 IF (PRESENT(uuid_format_)) THEN 286 CALL cxios_set_file_uuid_format & 287 (file_hdl%daddr, uuid_format_, len(uuid_format_)) 288 ENDIF 289 290 IF (PRESENT(uuid_name_)) THEN 291 CALL cxios_set_file_uuid_name & 292 (file_hdl%daddr, uuid_name_, len(uuid_name_)) 293 ENDIF 294 255 295 END SUBROUTINE xios(set_file_attr_hdl_) 256 296 … … 258 298 ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 259 299 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 260 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &261 )300 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 301 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 262 302 263 303 IMPLICIT NONE … … 287 327 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 288 328 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 329 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 330 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 331 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 289 332 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 290 333 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 291 334 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 335 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 336 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 292 337 293 338 CALL xios(get_file_handle) & … … 296 341 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 297 342 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 298 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &299 )343 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 344 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 300 345 301 346 END SUBROUTINE xios(get_file_attr) … … 304 349 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 305 350 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 306 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &307 )351 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 352 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 308 353 309 354 IMPLICIT NONE … … 332 377 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 333 378 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 379 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 380 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 381 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 334 382 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 335 383 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 336 384 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 385 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 386 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 337 387 338 388 CALL xios(get_file_attr_hdl_) & 339 389 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 340 390 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 341 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &342 )391 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 392 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 343 393 344 394 END SUBROUTINE xios(get_file_attr_hdl) … … 347 397 ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_ & 348 398 , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_ & 349 , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time series_ &350 , t s_prefix_, type_ )399 , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_ & 400 , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 351 401 352 402 IMPLICIT NONE … … 375 425 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_ 376 426 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name_ 427 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format_ 428 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name_ 429 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units_ 377 430 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries_ 378 431 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix_ 379 432 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 433 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format_ 434 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name_ 380 435 381 436 IF (PRESENT(append_)) THEN … … 482 537 ENDIF 483 538 539 IF (PRESENT(time_stamp_format_)) THEN 540 CALL cxios_get_file_time_stamp_format & 541 (file_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 542 ENDIF 543 544 IF (PRESENT(time_stamp_name_)) THEN 545 CALL cxios_get_file_time_stamp_name & 546 (file_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 547 ENDIF 548 549 IF (PRESENT(time_units_)) THEN 550 CALL cxios_get_file_time_units & 551 (file_hdl%daddr, time_units_, len(time_units_)) 552 ENDIF 553 484 554 IF (PRESENT(timeseries_)) THEN 485 555 CALL cxios_get_file_timeseries & … … 497 567 ENDIF 498 568 569 IF (PRESENT(uuid_format_)) THEN 570 CALL cxios_get_file_uuid_format & 571 (file_hdl%daddr, uuid_format_, len(uuid_format_)) 572 ENDIF 573 574 IF (PRESENT(uuid_name_)) THEN 575 CALL cxios_get_file_uuid_name & 576 (file_hdl%daddr, uuid_name_, len(uuid_name_)) 577 ENDIF 578 499 579 END SUBROUTINE xios(get_file_attr_hdl_) 500 580 … … 502 582 ( file_id, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 503 583 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 504 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &505 )584 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 585 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 506 586 507 587 IMPLICIT NONE … … 548 628 LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 549 629 LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 630 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 631 LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 632 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 633 LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 634 LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 635 LOGICAL(KIND=C_BOOL) :: time_units_tmp 550 636 LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 551 637 LOGICAL(KIND=C_BOOL) :: timeseries_tmp … … 554 640 LOGICAL, OPTIONAL, INTENT(OUT) :: type 555 641 LOGICAL(KIND=C_BOOL) :: type_tmp 642 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 643 LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 644 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 645 LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 556 646 557 647 CALL xios(get_file_handle) & … … 560 650 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 561 651 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 562 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &563 )652 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 653 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 564 654 565 655 END SUBROUTINE xios(is_defined_file_attr) … … 568 658 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 569 659 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 570 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &571 )660 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 661 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 572 662 573 663 IMPLICIT NONE … … 613 703 LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 614 704 LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 705 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 706 LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 707 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 708 LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 709 LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 710 LOGICAL(KIND=C_BOOL) :: time_units_tmp 615 711 LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 616 712 LOGICAL(KIND=C_BOOL) :: timeseries_tmp … … 619 715 LOGICAL, OPTIONAL, INTENT(OUT) :: type 620 716 LOGICAL(KIND=C_BOOL) :: type_tmp 717 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 718 LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 719 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 720 LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 621 721 622 722 CALL xios(is_defined_file_attr_hdl_) & 623 723 ( file_hdl, append, compression_level, convention, cyclic, description, enabled, format, min_digits & 624 724 , mode, name, name_suffix, output_freq, output_level, par_access, record_offset, split_freq & 625 , split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix, type &626 )725 , split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format, time_stamp_name & 726 , time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 627 727 628 728 END SUBROUTINE xios(is_defined_file_attr_hdl) … … 631 731 ( file_hdl, append_, compression_level_, convention_, cyclic_, description_, enabled_, format_ & 632 732 , min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_, record_offset_ & 633 , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time series_ &634 , t s_prefix_, type_ )733 , split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_, time_stamp_format_ & 734 , time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_, uuid_name_ ) 635 735 636 736 IMPLICIT NONE … … 676 776 LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name_ 677 777 LOGICAL(KIND=C_BOOL) :: time_counter_name__tmp 778 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format_ 779 LOGICAL(KIND=C_BOOL) :: time_stamp_format__tmp 780 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name_ 781 LOGICAL(KIND=C_BOOL) :: time_stamp_name__tmp 782 LOGICAL, OPTIONAL, INTENT(OUT) :: time_units_ 783 LOGICAL(KIND=C_BOOL) :: time_units__tmp 678 784 LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries_ 679 785 LOGICAL(KIND=C_BOOL) :: timeseries__tmp … … 682 788 LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 683 789 LOGICAL(KIND=C_BOOL) :: type__tmp 790 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format_ 791 LOGICAL(KIND=C_BOOL) :: uuid_format__tmp 792 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name_ 793 LOGICAL(KIND=C_BOOL) :: uuid_name__tmp 684 794 685 795 IF (PRESENT(append_)) THEN … … 803 913 ENDIF 804 914 915 IF (PRESENT(time_stamp_format_)) THEN 916 time_stamp_format__tmp = cxios_is_defined_file_time_stamp_format & 917 (file_hdl%daddr) 918 time_stamp_format_ = time_stamp_format__tmp 919 ENDIF 920 921 IF (PRESENT(time_stamp_name_)) THEN 922 time_stamp_name__tmp = cxios_is_defined_file_time_stamp_name & 923 (file_hdl%daddr) 924 time_stamp_name_ = time_stamp_name__tmp 925 ENDIF 926 927 IF (PRESENT(time_units_)) THEN 928 time_units__tmp = cxios_is_defined_file_time_units & 929 (file_hdl%daddr) 930 time_units_ = time_units__tmp 931 ENDIF 932 805 933 IF (PRESENT(timeseries_)) THEN 806 934 timeseries__tmp = cxios_is_defined_file_timeseries & … … 821 949 ENDIF 822 950 951 IF (PRESENT(uuid_format_)) THEN 952 uuid_format__tmp = cxios_is_defined_file_uuid_format & 953 (file_hdl%daddr) 954 uuid_format_ = uuid_format__tmp 955 ENDIF 956 957 IF (PRESENT(uuid_name_)) THEN 958 uuid_name__tmp = cxios_is_defined_file_uuid_name & 959 (file_hdl%daddr) 960 uuid_name_ = uuid_name__tmp 961 ENDIF 962 823 963 END SUBROUTINE xios(is_defined_file_attr_hdl_) 824 964 -
XIOS/dev/dev_olga/src/interface/fortran_attr/ifilegroup_attr.F90
r966 r1158 14 14 ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format & 15 15 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 16 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&17 , t ype )16 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 17 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 18 18 19 19 IMPLICIT NONE … … 44 44 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 45 45 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 46 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 47 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 48 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 46 49 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 47 50 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 48 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 52 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 53 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 49 54 50 55 CALL xios(get_filegroup_handle) & … … 53 58 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 54 59 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 55 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&56 , t ype )60 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 61 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 57 62 58 63 END SUBROUTINE xios(set_filegroup_attr) … … 61 66 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 62 67 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 63 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&64 , t ype )68 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 69 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 65 70 66 71 IMPLICIT NONE … … 90 95 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter 91 96 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name 97 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format 98 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name 99 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units 92 100 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries 93 101 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix 94 102 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 103 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format 104 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name 95 105 96 106 CALL xios(set_filegroup_attr_hdl_) & 97 107 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 98 108 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 99 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&100 , t ype )109 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 110 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 101 111 102 112 END SUBROUTINE xios(set_filegroup_attr_hdl) … … 106 116 , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_ & 107 117 , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_ & 108 , timeseries_, ts_prefix_, type_ ) 118 , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_ & 119 , uuid_name_ ) 109 120 110 121 IMPLICIT NONE … … 134 145 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_ 135 146 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_counter_name_ 147 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_format_ 148 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_stamp_name_ 149 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: time_units_ 136 150 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: timeseries_ 137 151 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_prefix_ 138 152 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 153 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_format_ 154 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: uuid_name_ 139 155 140 156 IF (PRESENT(append_)) THEN … … 246 262 ENDIF 247 263 264 IF (PRESENT(time_stamp_format_)) THEN 265 CALL cxios_set_filegroup_time_stamp_format & 266 (filegroup_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 267 ENDIF 268 269 IF (PRESENT(time_stamp_name_)) THEN 270 CALL cxios_set_filegroup_time_stamp_name & 271 (filegroup_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 272 ENDIF 273 274 IF (PRESENT(time_units_)) THEN 275 CALL cxios_set_filegroup_time_units & 276 (filegroup_hdl%daddr, time_units_, len(time_units_)) 277 ENDIF 278 248 279 IF (PRESENT(timeseries_)) THEN 249 280 CALL cxios_set_filegroup_timeseries & … … 261 292 ENDIF 262 293 294 IF (PRESENT(uuid_format_)) THEN 295 CALL cxios_set_filegroup_uuid_format & 296 (filegroup_hdl%daddr, uuid_format_, len(uuid_format_)) 297 ENDIF 298 299 IF (PRESENT(uuid_name_)) THEN 300 CALL cxios_set_filegroup_uuid_name & 301 (filegroup_hdl%daddr, uuid_name_, len(uuid_name_)) 302 ENDIF 303 263 304 END SUBROUTINE xios(set_filegroup_attr_hdl_) 264 305 … … 266 307 ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format & 267 308 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 268 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&269 , t ype )309 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 310 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 270 311 271 312 IMPLICIT NONE … … 296 337 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 297 338 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 339 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 340 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 341 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 298 342 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 299 343 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 300 344 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 345 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 346 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 301 347 302 348 CALL xios(get_filegroup_handle) & … … 305 351 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 306 352 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 307 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&308 , t ype )353 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 354 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 309 355 310 356 END SUBROUTINE xios(get_filegroup_attr) … … 313 359 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 314 360 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 315 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&316 , t ype )361 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 362 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 317 363 318 364 IMPLICIT NONE … … 342 388 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter 343 389 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name 390 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format 391 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name 392 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units 344 393 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries 345 394 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix 346 395 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 396 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format 397 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name 347 398 348 399 CALL xios(get_filegroup_attr_hdl_) & 349 400 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 350 401 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 351 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&352 , t ype )402 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 403 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 353 404 354 405 END SUBROUTINE xios(get_filegroup_attr_hdl) … … 358 409 , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_ & 359 410 , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_ & 360 , timeseries_, ts_prefix_, type_ ) 411 , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_ & 412 , uuid_name_ ) 361 413 362 414 IMPLICIT NONE … … 386 438 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_ 387 439 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_counter_name_ 440 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_format_ 441 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_stamp_name_ 442 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: time_units_ 388 443 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: timeseries_ 389 444 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_prefix_ 390 445 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 446 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_format_ 447 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: uuid_name_ 391 448 392 449 IF (PRESENT(append_)) THEN … … 498 555 ENDIF 499 556 557 IF (PRESENT(time_stamp_format_)) THEN 558 CALL cxios_get_filegroup_time_stamp_format & 559 (filegroup_hdl%daddr, time_stamp_format_, len(time_stamp_format_)) 560 ENDIF 561 562 IF (PRESENT(time_stamp_name_)) THEN 563 CALL cxios_get_filegroup_time_stamp_name & 564 (filegroup_hdl%daddr, time_stamp_name_, len(time_stamp_name_)) 565 ENDIF 566 567 IF (PRESENT(time_units_)) THEN 568 CALL cxios_get_filegroup_time_units & 569 (filegroup_hdl%daddr, time_units_, len(time_units_)) 570 ENDIF 571 500 572 IF (PRESENT(timeseries_)) THEN 501 573 CALL cxios_get_filegroup_timeseries & … … 513 585 ENDIF 514 586 587 IF (PRESENT(uuid_format_)) THEN 588 CALL cxios_get_filegroup_uuid_format & 589 (filegroup_hdl%daddr, uuid_format_, len(uuid_format_)) 590 ENDIF 591 592 IF (PRESENT(uuid_name_)) THEN 593 CALL cxios_get_filegroup_uuid_name & 594 (filegroup_hdl%daddr, uuid_name_, len(uuid_name_)) 595 ENDIF 596 515 597 END SUBROUTINE xios(get_filegroup_attr_hdl_) 516 598 … … 518 600 ( filegroup_id, append, compression_level, convention, cyclic, description, enabled, format & 519 601 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 520 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&521 , t ype )602 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 603 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 522 604 523 605 IMPLICIT NONE … … 566 648 LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 567 649 LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 650 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 651 LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 652 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 653 LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 654 LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 655 LOGICAL(KIND=C_BOOL) :: time_units_tmp 568 656 LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 569 657 LOGICAL(KIND=C_BOOL) :: timeseries_tmp … … 572 660 LOGICAL, OPTIONAL, INTENT(OUT) :: type 573 661 LOGICAL(KIND=C_BOOL) :: type_tmp 662 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 663 LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 664 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 665 LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 574 666 575 667 CALL xios(get_filegroup_handle) & … … 578 670 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 579 671 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 580 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&581 , t ype )672 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 673 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 582 674 583 675 END SUBROUTINE xios(is_defined_filegroup_attr) … … 586 678 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 587 679 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 588 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&589 , t ype )680 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 681 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 590 682 591 683 IMPLICIT NONE … … 633 725 LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name 634 726 LOGICAL(KIND=C_BOOL) :: time_counter_name_tmp 727 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format 728 LOGICAL(KIND=C_BOOL) :: time_stamp_format_tmp 729 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name 730 LOGICAL(KIND=C_BOOL) :: time_stamp_name_tmp 731 LOGICAL, OPTIONAL, INTENT(OUT) :: time_units 732 LOGICAL(KIND=C_BOOL) :: time_units_tmp 635 733 LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries 636 734 LOGICAL(KIND=C_BOOL) :: timeseries_tmp … … 639 737 LOGICAL, OPTIONAL, INTENT(OUT) :: type 640 738 LOGICAL(KIND=C_BOOL) :: type_tmp 739 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format 740 LOGICAL(KIND=C_BOOL) :: uuid_format_tmp 741 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name 742 LOGICAL(KIND=C_BOOL) :: uuid_name_tmp 641 743 642 744 CALL xios(is_defined_filegroup_attr_hdl_) & 643 745 ( filegroup_hdl, append, compression_level, convention, cyclic, description, enabled, format & 644 746 , group_ref, min_digits, mode, name, name_suffix, output_freq, output_level, par_access, record_offset & 645 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time series, ts_prefix&646 , t ype )747 , split_freq, split_freq_format, sync_freq, time_counter, time_counter_name, time_stamp_format & 748 , time_stamp_name, time_units, timeseries, ts_prefix, type, uuid_format, uuid_name ) 647 749 648 750 END SUBROUTINE xios(is_defined_filegroup_attr_hdl) … … 652 754 , group_ref_, min_digits_, mode_, name_, name_suffix_, output_freq_, output_level_, par_access_ & 653 755 , record_offset_, split_freq_, split_freq_format_, sync_freq_, time_counter_, time_counter_name_ & 654 , timeseries_, ts_prefix_, type_ ) 756 , time_stamp_format_, time_stamp_name_, time_units_, timeseries_, ts_prefix_, type_, uuid_format_ & 757 , uuid_name_ ) 655 758 656 759 IMPLICIT NONE … … 698 801 LOGICAL, OPTIONAL, INTENT(OUT) :: time_counter_name_ 699 802 LOGICAL(KIND=C_BOOL) :: time_counter_name__tmp 803 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_format_ 804 LOGICAL(KIND=C_BOOL) :: time_stamp_format__tmp 805 LOGICAL, OPTIONAL, INTENT(OUT) :: time_stamp_name_ 806 LOGICAL(KIND=C_BOOL) :: time_stamp_name__tmp 807 LOGICAL, OPTIONAL, INTENT(OUT) :: time_units_ 808 LOGICAL(KIND=C_BOOL) :: time_units__tmp 700 809 LOGICAL, OPTIONAL, INTENT(OUT) :: timeseries_ 701 810 LOGICAL(KIND=C_BOOL) :: timeseries__tmp … … 704 813 LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 705 814 LOGICAL(KIND=C_BOOL) :: type__tmp 815 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_format_ 816 LOGICAL(KIND=C_BOOL) :: uuid_format__tmp 817 LOGICAL, OPTIONAL, INTENT(OUT) :: uuid_name_ 818 LOGICAL(KIND=C_BOOL) :: uuid_name__tmp 706 819 707 820 IF (PRESENT(append_)) THEN … … 831 944 ENDIF 832 945 946 IF (PRESENT(time_stamp_format_)) THEN 947 time_stamp_format__tmp = cxios_is_defined_filegroup_time_stamp_format & 948 (filegroup_hdl%daddr) 949 time_stamp_format_ = time_stamp_format__tmp 950 ENDIF 951 952 IF (PRESENT(time_stamp_name_)) THEN 953 time_stamp_name__tmp = cxios_is_defined_filegroup_time_stamp_name & 954 (filegroup_hdl%daddr) 955 time_stamp_name_ = time_stamp_name__tmp 956 ENDIF 957 958 IF (PRESENT(time_units_)) THEN 959 time_units__tmp = cxios_is_defined_filegroup_time_units & 960 (filegroup_hdl%daddr) 961 time_units_ = time_units__tmp 962 ENDIF 963 833 964 IF (PRESENT(timeseries_)) THEN 834 965 timeseries__tmp = cxios_is_defined_filegroup_timeseries & … … 849 980 ENDIF 850 981 982 IF (PRESENT(uuid_format_)) THEN 983 uuid_format__tmp = cxios_is_defined_filegroup_uuid_format & 984 (filegroup_hdl%daddr) 985 uuid_format_ = uuid_format__tmp 986 ENDIF 987 988 IF (PRESENT(uuid_name_)) THEN 989 uuid_name__tmp = cxios_is_defined_filegroup_uuid_name & 990 (filegroup_hdl%daddr) 991 uuid_name_ = uuid_name__tmp 992 ENDIF 993 851 994 END SUBROUTINE xios(is_defined_filegroup_attr_hdl_) 852 995 -
XIOS/dev/dev_olga/src/interface/fortran_attr/iinterpolate_domain_attr.F90
r1021 r1158 12 12 13 13 SUBROUTINE xios(set_interpolate_domain_attr) & 14 ( interpolate_domain_id, file,mode, order, renormalize, weight_filename, write_weight )14 ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 15 15 16 16 IMPLICIT NONE 17 17 TYPE(txios(interpolate_domain)) :: interpolate_domain_hdl 18 18 CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 19 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file20 19 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 21 20 INTEGER , OPTIONAL, INTENT(IN) :: order … … 29 28 (interpolate_domain_id,interpolate_domain_hdl) 30 29 CALL xios(set_interpolate_domain_attr_hdl_) & 31 ( interpolate_domain_hdl, file,mode, order, renormalize, weight_filename, write_weight )30 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 32 31 33 32 END SUBROUTINE xios(set_interpolate_domain_attr) 34 33 35 34 SUBROUTINE xios(set_interpolate_domain_attr_hdl) & 36 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 37 38 IMPLICIT NONE 39 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 40 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file 35 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 36 37 IMPLICIT NONE 38 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 41 39 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode 42 40 INTEGER , OPTIONAL, INTENT(IN) :: order … … 48 46 49 47 CALL xios(set_interpolate_domain_attr_hdl_) & 50 ( interpolate_domain_hdl, file,mode, order, renormalize, weight_filename, write_weight )48 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 51 49 52 50 END SUBROUTINE xios(set_interpolate_domain_attr_hdl) 53 51 54 52 SUBROUTINE xios(set_interpolate_domain_attr_hdl_) & 55 ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_ & 56 ) 57 58 IMPLICIT NONE 59 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 60 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: file_ 53 ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 54 55 IMPLICIT NONE 56 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 61 57 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: mode_ 62 58 INTEGER , OPTIONAL, INTENT(IN) :: order_ … … 67 63 LOGICAL (KIND=C_BOOL) :: write_weight__tmp 68 64 69 IF (PRESENT(file_)) THEN70 CALL cxios_set_interpolate_domain_file &71 (interpolate_domain_hdl%daddr, file_, len(file_))72 ENDIF73 74 65 IF (PRESENT(mode_)) THEN 75 66 CALL cxios_set_interpolate_domain_mode & … … 102 93 103 94 SUBROUTINE xios(get_interpolate_domain_attr) & 104 ( interpolate_domain_id, file,mode, order, renormalize, weight_filename, write_weight )95 ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 105 96 106 97 IMPLICIT NONE 107 98 TYPE(txios(interpolate_domain)) :: interpolate_domain_hdl 108 99 CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 109 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file110 100 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 111 101 INTEGER , OPTIONAL, INTENT(OUT) :: order … … 119 109 (interpolate_domain_id,interpolate_domain_hdl) 120 110 CALL xios(get_interpolate_domain_attr_hdl_) & 121 ( interpolate_domain_hdl, file,mode, order, renormalize, weight_filename, write_weight )111 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 122 112 123 113 END SUBROUTINE xios(get_interpolate_domain_attr) 124 114 125 115 SUBROUTINE xios(get_interpolate_domain_attr_hdl) & 126 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 127 128 IMPLICIT NONE 129 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 130 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file 116 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 117 118 IMPLICIT NONE 119 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 131 120 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode 132 121 INTEGER , OPTIONAL, INTENT(OUT) :: order … … 138 127 139 128 CALL xios(get_interpolate_domain_attr_hdl_) & 140 ( interpolate_domain_hdl, file,mode, order, renormalize, weight_filename, write_weight )129 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 141 130 142 131 END SUBROUTINE xios(get_interpolate_domain_attr_hdl) 143 132 144 133 SUBROUTINE xios(get_interpolate_domain_attr_hdl_) & 145 ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_ & 146 ) 147 148 IMPLICIT NONE 149 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 150 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: file_ 134 ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 135 136 IMPLICIT NONE 137 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 151 138 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: mode_ 152 139 INTEGER , OPTIONAL, INTENT(OUT) :: order_ … … 157 144 LOGICAL (KIND=C_BOOL) :: write_weight__tmp 158 145 159 IF (PRESENT(file_)) THEN160 CALL cxios_get_interpolate_domain_file &161 (interpolate_domain_hdl%daddr, file_, len(file_))162 ENDIF163 164 146 IF (PRESENT(mode_)) THEN 165 147 CALL cxios_get_interpolate_domain_mode & … … 192 174 193 175 SUBROUTINE xios(is_defined_interpolate_domain_attr) & 194 ( interpolate_domain_id, file,mode, order, renormalize, weight_filename, write_weight )176 ( interpolate_domain_id, mode, order, renormalize, weight_filename, write_weight ) 195 177 196 178 IMPLICIT NONE 197 179 TYPE(txios(interpolate_domain)) :: interpolate_domain_hdl 198 180 CHARACTER(LEN=*), INTENT(IN) ::interpolate_domain_id 199 LOGICAL, OPTIONAL, INTENT(OUT) :: file200 LOGICAL(KIND=C_BOOL) :: file_tmp201 181 LOGICAL, OPTIONAL, INTENT(OUT) :: mode 202 182 LOGICAL(KIND=C_BOOL) :: mode_tmp … … 213 193 (interpolate_domain_id,interpolate_domain_hdl) 214 194 CALL xios(is_defined_interpolate_domain_attr_hdl_) & 215 ( interpolate_domain_hdl, file,mode, order, renormalize, weight_filename, write_weight )195 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 216 196 217 197 END SUBROUTINE xios(is_defined_interpolate_domain_attr) 218 198 219 199 SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) & 220 ( interpolate_domain_hdl, file, mode, order, renormalize, weight_filename, write_weight ) 221 222 IMPLICIT NONE 223 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 224 LOGICAL, OPTIONAL, INTENT(OUT) :: file 225 LOGICAL(KIND=C_BOOL) :: file_tmp 200 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 201 202 IMPLICIT NONE 203 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 226 204 LOGICAL, OPTIONAL, INTENT(OUT) :: mode 227 205 LOGICAL(KIND=C_BOOL) :: mode_tmp … … 236 214 237 215 CALL xios(is_defined_interpolate_domain_attr_hdl_) & 238 ( interpolate_domain_hdl, file,mode, order, renormalize, weight_filename, write_weight )216 ( interpolate_domain_hdl, mode, order, renormalize, weight_filename, write_weight ) 239 217 240 218 END SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl) 241 219 242 220 SUBROUTINE xios(is_defined_interpolate_domain_attr_hdl_) & 243 ( interpolate_domain_hdl, file_, mode_, order_, renormalize_, weight_filename_, write_weight_ & 244 ) 245 246 IMPLICIT NONE 247 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 248 LOGICAL, OPTIONAL, INTENT(OUT) :: file_ 249 LOGICAL(KIND=C_BOOL) :: file__tmp 221 ( interpolate_domain_hdl, mode_, order_, renormalize_, weight_filename_, write_weight_ ) 222 223 IMPLICIT NONE 224 TYPE(txios(interpolate_domain)) , INTENT(IN) :: interpolate_domain_hdl 250 225 LOGICAL, OPTIONAL, INTENT(OUT) :: mode_ 251 226 LOGICAL(KIND=C_BOOL) :: mode__tmp … … 259 234 LOGICAL(KIND=C_BOOL) :: write_weight__tmp 260 235 261 IF (PRESENT(file_)) THEN262 file__tmp = cxios_is_defined_interpolate_domain_file &263 (interpolate_domain_hdl%daddr)264 file_ = file__tmp265 ENDIF266 267 236 IF (PRESENT(mode_)) THEN 268 237 mode__tmp = cxios_is_defined_interpolate_domain_mode & -
XIOS/dev/dev_olga/src/interface/fortran_attr/interpolate_domain_interface_attr.F90
r1021 r1158 9 9 INTERFACE 10 10 ! Do not call directly / interface FORTRAN 2003 <-> C99 11 12 SUBROUTINE cxios_set_interpolate_domain_file(interpolate_domain_hdl, file, file_size) BIND(C)13 USE ISO_C_BINDING14 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl15 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: file16 INTEGER (kind = C_INT) , VALUE :: file_size17 END SUBROUTINE cxios_set_interpolate_domain_file18 19 SUBROUTINE cxios_get_interpolate_domain_file(interpolate_domain_hdl, file, file_size) BIND(C)20 USE ISO_C_BINDING21 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl22 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: file23 INTEGER (kind = C_INT) , VALUE :: file_size24 END SUBROUTINE cxios_get_interpolate_domain_file25 26 FUNCTION cxios_is_defined_interpolate_domain_file(interpolate_domain_hdl) BIND(C)27 USE ISO_C_BINDING28 LOGICAL(kind=C_BOOL) :: cxios_is_defined_interpolate_domain_file29 INTEGER (kind = C_INTPTR_T), VALUE :: interpolate_domain_hdl30 END FUNCTION cxios_is_defined_interpolate_domain_file31 32 11 33 12 SUBROUTINE cxios_set_interpolate_domain_mode(interpolate_domain_hdl, mode, mode_size) BIND(C) -
XIOS/dev/dev_olga/src/interface/fortran_attr/iscalar_attr.F90
r966 r1158 12 12 13 13 SUBROUTINE xios(set_scalar_attr) & 14 ( scalar_id, long_name, name, scalar_ref, standard_name, unit, value )14 ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value ) 15 15 16 16 IMPLICIT NONE … … 19 19 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 20 20 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 21 INTEGER , OPTIONAL, INTENT(IN) :: prec 21 22 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 22 23 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 27 28 (scalar_id,scalar_hdl) 28 29 CALL xios(set_scalar_attr_hdl_) & 29 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )30 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 30 31 31 32 END SUBROUTINE xios(set_scalar_attr) 32 33 33 34 SUBROUTINE xios(set_scalar_attr_hdl) & 34 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )35 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 35 36 36 37 IMPLICIT NONE … … 38 39 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 39 40 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 41 INTEGER , OPTIONAL, INTENT(IN) :: prec 40 42 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 41 43 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 44 46 45 47 CALL xios(set_scalar_attr_hdl_) & 46 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )48 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 47 49 48 50 END SUBROUTINE xios(set_scalar_attr_hdl) 49 51 50 52 SUBROUTINE xios(set_scalar_attr_hdl_) & 51 ( scalar_hdl, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ )53 ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ ) 52 54 53 55 IMPLICIT NONE … … 55 57 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 56 58 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 59 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 57 60 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref_ 58 61 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ … … 70 73 ENDIF 71 74 75 IF (PRESENT(prec_)) THEN 76 CALL cxios_set_scalar_prec & 77 (scalar_hdl%daddr, prec_) 78 ENDIF 79 72 80 IF (PRESENT(scalar_ref_)) THEN 73 81 CALL cxios_set_scalar_scalar_ref & … … 93 101 94 102 SUBROUTINE xios(get_scalar_attr) & 95 ( scalar_id, long_name, name, scalar_ref, standard_name, unit, value )103 ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value ) 96 104 97 105 IMPLICIT NONE … … 100 108 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 101 109 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 110 INTEGER , OPTIONAL, INTENT(OUT) :: prec 102 111 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 103 112 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 108 117 (scalar_id,scalar_hdl) 109 118 CALL xios(get_scalar_attr_hdl_) & 110 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )119 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 111 120 112 121 END SUBROUTINE xios(get_scalar_attr) 113 122 114 123 SUBROUTINE xios(get_scalar_attr_hdl) & 115 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )124 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 116 125 117 126 IMPLICIT NONE … … 119 128 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 120 129 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 130 INTEGER , OPTIONAL, INTENT(OUT) :: prec 121 131 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 122 132 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 125 135 126 136 CALL xios(get_scalar_attr_hdl_) & 127 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )137 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 128 138 129 139 END SUBROUTINE xios(get_scalar_attr_hdl) 130 140 131 141 SUBROUTINE xios(get_scalar_attr_hdl_) & 132 ( scalar_hdl, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ )142 ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ ) 133 143 134 144 IMPLICIT NONE … … 136 146 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 137 147 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 148 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 138 149 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref_ 139 150 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ … … 151 162 ENDIF 152 163 164 IF (PRESENT(prec_)) THEN 165 CALL cxios_get_scalar_prec & 166 (scalar_hdl%daddr, prec_) 167 ENDIF 168 153 169 IF (PRESENT(scalar_ref_)) THEN 154 170 CALL cxios_get_scalar_scalar_ref & … … 174 190 175 191 SUBROUTINE xios(is_defined_scalar_attr) & 176 ( scalar_id, long_name, name, scalar_ref, standard_name, unit, value )192 ( scalar_id, long_name, name, prec, scalar_ref, standard_name, unit, value ) 177 193 178 194 IMPLICIT NONE … … 183 199 LOGICAL, OPTIONAL, INTENT(OUT) :: name 184 200 LOGICAL(KIND=C_BOOL) :: name_tmp 201 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 202 LOGICAL(KIND=C_BOOL) :: prec_tmp 185 203 LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 186 204 LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp … … 195 213 (scalar_id,scalar_hdl) 196 214 CALL xios(is_defined_scalar_attr_hdl_) & 197 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )215 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 198 216 199 217 END SUBROUTINE xios(is_defined_scalar_attr) 200 218 201 219 SUBROUTINE xios(is_defined_scalar_attr_hdl) & 202 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )220 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 203 221 204 222 IMPLICIT NONE … … 208 226 LOGICAL, OPTIONAL, INTENT(OUT) :: name 209 227 LOGICAL(KIND=C_BOOL) :: name_tmp 228 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 229 LOGICAL(KIND=C_BOOL) :: prec_tmp 210 230 LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 211 231 LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp … … 218 238 219 239 CALL xios(is_defined_scalar_attr_hdl_) & 220 ( scalar_hdl, long_name, name, scalar_ref, standard_name, unit, value )240 ( scalar_hdl, long_name, name, prec, scalar_ref, standard_name, unit, value ) 221 241 222 242 END SUBROUTINE xios(is_defined_scalar_attr_hdl) 223 243 224 244 SUBROUTINE xios(is_defined_scalar_attr_hdl_) & 225 ( scalar_hdl, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ )245 ( scalar_hdl, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_, value_ ) 226 246 227 247 IMPLICIT NONE … … 231 251 LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 232 252 LOGICAL(KIND=C_BOOL) :: name__tmp 253 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 254 LOGICAL(KIND=C_BOOL) :: prec__tmp 233 255 LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref_ 234 256 LOGICAL(KIND=C_BOOL) :: scalar_ref__tmp … … 252 274 ENDIF 253 275 276 IF (PRESENT(prec_)) THEN 277 prec__tmp = cxios_is_defined_scalar_prec & 278 (scalar_hdl%daddr) 279 prec_ = prec__tmp 280 ENDIF 281 254 282 IF (PRESENT(scalar_ref_)) THEN 255 283 scalar_ref__tmp = cxios_is_defined_scalar_scalar_ref & -
XIOS/dev/dev_olga/src/interface/fortran_attr/iscalargroup_attr.F90
r966 r1158 12 12 13 13 SUBROUTINE xios(set_scalargroup_attr) & 14 ( scalargroup_id, group_ref, long_name, name, scalar_ref, standard_name, unit, value )14 ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value ) 15 15 16 16 IMPLICIT NONE … … 20 20 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 21 21 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 22 INTEGER , OPTIONAL, INTENT(IN) :: prec 22 23 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 23 24 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 28 29 (scalargroup_id,scalargroup_hdl) 29 30 CALL xios(set_scalargroup_attr_hdl_) & 30 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 31 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 32 ) 31 33 32 34 END SUBROUTINE xios(set_scalargroup_attr) 33 35 34 36 SUBROUTINE xios(set_scalargroup_attr_hdl) & 35 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 37 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 38 ) 36 39 37 40 IMPLICIT NONE … … 40 43 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name 41 44 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 45 INTEGER , OPTIONAL, INTENT(IN) :: prec 42 46 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref 43 47 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name … … 46 50 47 51 CALL xios(set_scalargroup_attr_hdl_) & 48 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 52 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 53 ) 49 54 50 55 END SUBROUTINE xios(set_scalargroup_attr_hdl) 51 56 52 57 SUBROUTINE xios(set_scalargroup_attr_hdl_) & 53 ( scalargroup_hdl, group_ref_, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ &54 )58 ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_ & 59 , value_ ) 55 60 56 61 IMPLICIT NONE … … 59 64 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: long_name_ 60 65 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 66 INTEGER , OPTIONAL, INTENT(IN) :: prec_ 61 67 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: scalar_ref_ 62 68 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: standard_name_ … … 79 85 ENDIF 80 86 87 IF (PRESENT(prec_)) THEN 88 CALL cxios_set_scalargroup_prec & 89 (scalargroup_hdl%daddr, prec_) 90 ENDIF 91 81 92 IF (PRESENT(scalar_ref_)) THEN 82 93 CALL cxios_set_scalargroup_scalar_ref & … … 102 113 103 114 SUBROUTINE xios(get_scalargroup_attr) & 104 ( scalargroup_id, group_ref, long_name, name, scalar_ref, standard_name, unit, value )115 ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value ) 105 116 106 117 IMPLICIT NONE … … 110 121 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 111 122 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 123 INTEGER , OPTIONAL, INTENT(OUT) :: prec 112 124 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 113 125 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 118 130 (scalargroup_id,scalargroup_hdl) 119 131 CALL xios(get_scalargroup_attr_hdl_) & 120 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 132 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 133 ) 121 134 122 135 END SUBROUTINE xios(get_scalargroup_attr) 123 136 124 137 SUBROUTINE xios(get_scalargroup_attr_hdl) & 125 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 138 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 139 ) 126 140 127 141 IMPLICIT NONE … … 130 144 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name 131 145 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 146 INTEGER , OPTIONAL, INTENT(OUT) :: prec 132 147 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref 133 148 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name … … 136 151 137 152 CALL xios(get_scalargroup_attr_hdl_) & 138 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 153 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 154 ) 139 155 140 156 END SUBROUTINE xios(get_scalargroup_attr_hdl) 141 157 142 158 SUBROUTINE xios(get_scalargroup_attr_hdl_) & 143 ( scalargroup_hdl, group_ref_, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ &144 )159 ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_ & 160 , value_ ) 145 161 146 162 IMPLICIT NONE … … 149 165 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: long_name_ 150 166 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 167 INTEGER , OPTIONAL, INTENT(OUT) :: prec_ 151 168 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: scalar_ref_ 152 169 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: standard_name_ … … 169 186 ENDIF 170 187 188 IF (PRESENT(prec_)) THEN 189 CALL cxios_get_scalargroup_prec & 190 (scalargroup_hdl%daddr, prec_) 191 ENDIF 192 171 193 IF (PRESENT(scalar_ref_)) THEN 172 194 CALL cxios_get_scalargroup_scalar_ref & … … 192 214 193 215 SUBROUTINE xios(is_defined_scalargroup_attr) & 194 ( scalargroup_id, group_ref, long_name, name, scalar_ref, standard_name, unit, value )216 ( scalargroup_id, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value ) 195 217 196 218 IMPLICIT NONE … … 203 225 LOGICAL, OPTIONAL, INTENT(OUT) :: name 204 226 LOGICAL(KIND=C_BOOL) :: name_tmp 227 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 228 LOGICAL(KIND=C_BOOL) :: prec_tmp 205 229 LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 206 230 LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp … … 215 239 (scalargroup_id,scalargroup_hdl) 216 240 CALL xios(is_defined_scalargroup_attr_hdl_) & 217 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 241 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 242 ) 218 243 219 244 END SUBROUTINE xios(is_defined_scalargroup_attr) 220 245 221 246 SUBROUTINE xios(is_defined_scalargroup_attr_hdl) & 222 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 247 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 248 ) 223 249 224 250 IMPLICIT NONE … … 230 256 LOGICAL, OPTIONAL, INTENT(OUT) :: name 231 257 LOGICAL(KIND=C_BOOL) :: name_tmp 258 LOGICAL, OPTIONAL, INTENT(OUT) :: prec 259 LOGICAL(KIND=C_BOOL) :: prec_tmp 232 260 LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref 233 261 LOGICAL(KIND=C_BOOL) :: scalar_ref_tmp … … 240 268 241 269 CALL xios(is_defined_scalargroup_attr_hdl_) & 242 ( scalargroup_hdl, group_ref, long_name, name, scalar_ref, standard_name, unit, value ) 270 ( scalargroup_hdl, group_ref, long_name, name, prec, scalar_ref, standard_name, unit, value & 271 ) 243 272 244 273 END SUBROUTINE xios(is_defined_scalargroup_attr_hdl) 245 274 246 275 SUBROUTINE xios(is_defined_scalargroup_attr_hdl_) & 247 ( scalargroup_hdl, group_ref_, long_name_, name_, scalar_ref_, standard_name_, unit_, value_ &248 )276 ( scalargroup_hdl, group_ref_, long_name_, name_, prec_, scalar_ref_, standard_name_, unit_ & 277 , value_ ) 249 278 250 279 IMPLICIT NONE … … 256 285 LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 257 286 LOGICAL(KIND=C_BOOL) :: name__tmp 287 LOGICAL, OPTIONAL, INTENT(OUT) :: prec_ 288 LOGICAL(KIND=C_BOOL) :: prec__tmp 258 289 LOGICAL, OPTIONAL, INTENT(OUT) :: scalar_ref_ 259 290 LOGICAL(KIND=C_BOOL) :: scalar_ref__tmp … … 283 314 ENDIF 284 315 316 IF (PRESENT(prec_)) THEN 317 prec__tmp = cxios_is_defined_scalargroup_prec & 318 (scalargroup_hdl%daddr) 319 prec_ = prec__tmp 320 ENDIF 321 285 322 IF (PRESENT(scalar_ref_)) THEN 286 323 scalar_ref__tmp = cxios_is_defined_scalargroup_scalar_ref & -
XIOS/dev/dev_olga/src/interface/fortran_attr/ivariable_attr.F90
r966 r1158 12 12 13 13 SUBROUTINE xios(set_variable_attr) & 14 ( variable_id, name, t ype )14 ( variable_id, name, ts_target, type ) 15 15 16 16 IMPLICIT NONE … … 18 18 CHARACTER(LEN=*), INTENT(IN) ::variable_id 19 19 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 20 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 20 21 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 21 22 … … 23 24 (variable_id,variable_hdl) 24 25 CALL xios(set_variable_attr_hdl_) & 25 ( variable_hdl, name, t ype )26 ( variable_hdl, name, ts_target, type ) 26 27 27 28 END SUBROUTINE xios(set_variable_attr) 28 29 29 30 SUBROUTINE xios(set_variable_attr_hdl) & 30 ( variable_hdl, name, t ype )31 ( variable_hdl, name, ts_target, type ) 31 32 32 33 IMPLICIT NONE 33 34 TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 34 35 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 36 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 35 37 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 36 38 37 39 CALL xios(set_variable_attr_hdl_) & 38 ( variable_hdl, name, t ype )40 ( variable_hdl, name, ts_target, type ) 39 41 40 42 END SUBROUTINE xios(set_variable_attr_hdl) 41 43 42 44 SUBROUTINE xios(set_variable_attr_hdl_) & 43 ( variable_hdl, name_, t ype_ )45 ( variable_hdl, name_, ts_target_, type_ ) 44 46 45 47 IMPLICIT NONE 46 48 TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 47 49 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 50 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target_ 48 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 49 52 … … 51 54 CALL cxios_set_variable_name & 52 55 (variable_hdl%daddr, name_, len(name_)) 56 ENDIF 57 58 IF (PRESENT(ts_target_)) THEN 59 CALL cxios_set_variable_ts_target & 60 (variable_hdl%daddr, ts_target_, len(ts_target_)) 53 61 ENDIF 54 62 … … 61 69 62 70 SUBROUTINE xios(get_variable_attr) & 63 ( variable_id, name, t ype )71 ( variable_id, name, ts_target, type ) 64 72 65 73 IMPLICIT NONE … … 67 75 CHARACTER(LEN=*), INTENT(IN) ::variable_id 68 76 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 77 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 69 78 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 70 79 … … 72 81 (variable_id,variable_hdl) 73 82 CALL xios(get_variable_attr_hdl_) & 74 ( variable_hdl, name, t ype )83 ( variable_hdl, name, ts_target, type ) 75 84 76 85 END SUBROUTINE xios(get_variable_attr) 77 86 78 87 SUBROUTINE xios(get_variable_attr_hdl) & 79 ( variable_hdl, name, t ype )88 ( variable_hdl, name, ts_target, type ) 80 89 81 90 IMPLICIT NONE 82 91 TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 83 92 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 93 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 84 94 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 85 95 86 96 CALL xios(get_variable_attr_hdl_) & 87 ( variable_hdl, name, t ype )97 ( variable_hdl, name, ts_target, type ) 88 98 89 99 END SUBROUTINE xios(get_variable_attr_hdl) 90 100 91 101 SUBROUTINE xios(get_variable_attr_hdl_) & 92 ( variable_hdl, name_, t ype_ )102 ( variable_hdl, name_, ts_target_, type_ ) 93 103 94 104 IMPLICIT NONE 95 105 TYPE(txios(variable)) , INTENT(IN) :: variable_hdl 96 106 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 107 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target_ 97 108 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 98 109 … … 100 111 CALL cxios_get_variable_name & 101 112 (variable_hdl%daddr, name_, len(name_)) 113 ENDIF 114 115 IF (PRESENT(ts_target_)) THEN 116 CALL cxios_get_variable_ts_target & 117 (variable_hdl%daddr, ts_target_, len(ts_target_)) 102 118 ENDIF 103 119 … … 110 126 111 127 SUBROUTINE xios(is_defined_variable_attr) & 112 ( variable_id, name, t ype )128 ( variable_id, name, ts_target, type ) 113 129 114 130 IMPLICIT NONE … … 117 133 LOGICAL, OPTIONAL, INTENT(OUT) :: name 118 134 LOGICAL(KIND=C_BOOL) :: name_tmp 135 LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 136 LOGICAL(KIND=C_BOOL) :: ts_target_tmp 119 137 LOGICAL, OPTIONAL, INTENT(OUT) :: type 120 138 LOGICAL(KIND=C_BOOL) :: type_tmp … … 123 141 (variable_id,variable_hdl) 124 142 CALL xios(is_defined_variable_attr_hdl_) & 125 ( variable_hdl, name, t ype )143 ( variable_hdl, name, ts_target, type ) 126 144 127 145 END SUBROUTINE xios(is_defined_variable_attr) 128 146 129 147 SUBROUTINE xios(is_defined_variable_attr_hdl) & 130 ( variable_hdl, name, t ype )148 ( variable_hdl, name, ts_target, type ) 131 149 132 150 IMPLICIT NONE … … 134 152 LOGICAL, OPTIONAL, INTENT(OUT) :: name 135 153 LOGICAL(KIND=C_BOOL) :: name_tmp 154 LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 155 LOGICAL(KIND=C_BOOL) :: ts_target_tmp 136 156 LOGICAL, OPTIONAL, INTENT(OUT) :: type 137 157 LOGICAL(KIND=C_BOOL) :: type_tmp 138 158 139 159 CALL xios(is_defined_variable_attr_hdl_) & 140 ( variable_hdl, name, t ype )160 ( variable_hdl, name, ts_target, type ) 141 161 142 162 END SUBROUTINE xios(is_defined_variable_attr_hdl) 143 163 144 164 SUBROUTINE xios(is_defined_variable_attr_hdl_) & 145 ( variable_hdl, name_, t ype_ )165 ( variable_hdl, name_, ts_target_, type_ ) 146 166 147 167 IMPLICIT NONE … … 149 169 LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 150 170 LOGICAL(KIND=C_BOOL) :: name__tmp 171 LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target_ 172 LOGICAL(KIND=C_BOOL) :: ts_target__tmp 151 173 LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 152 174 LOGICAL(KIND=C_BOOL) :: type__tmp … … 156 178 (variable_hdl%daddr) 157 179 name_ = name__tmp 180 ENDIF 181 182 IF (PRESENT(ts_target_)) THEN 183 ts_target__tmp = cxios_is_defined_variable_ts_target & 184 (variable_hdl%daddr) 185 ts_target_ = ts_target__tmp 158 186 ENDIF 159 187 -
XIOS/dev/dev_olga/src/interface/fortran_attr/ivariablegroup_attr.F90
r966 r1158 12 12 13 13 SUBROUTINE xios(set_variablegroup_attr) & 14 ( variablegroup_id, group_ref, name, t ype )14 ( variablegroup_id, group_ref, name, ts_target, type ) 15 15 16 16 IMPLICIT NONE … … 19 19 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 20 20 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 21 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 21 22 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 22 23 … … 24 25 (variablegroup_id,variablegroup_hdl) 25 26 CALL xios(set_variablegroup_attr_hdl_) & 26 ( variablegroup_hdl, group_ref, name, t ype )27 ( variablegroup_hdl, group_ref, name, ts_target, type ) 27 28 28 29 END SUBROUTINE xios(set_variablegroup_attr) 29 30 30 31 SUBROUTINE xios(set_variablegroup_attr_hdl) & 31 ( variablegroup_hdl, group_ref, name, t ype )32 ( variablegroup_hdl, group_ref, name, ts_target, type ) 32 33 33 34 IMPLICIT NONE … … 35 36 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref 36 37 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name 38 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target 37 39 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type 38 40 39 41 CALL xios(set_variablegroup_attr_hdl_) & 40 ( variablegroup_hdl, group_ref, name, t ype )42 ( variablegroup_hdl, group_ref, name, ts_target, type ) 41 43 42 44 END SUBROUTINE xios(set_variablegroup_attr_hdl) 43 45 44 46 SUBROUTINE xios(set_variablegroup_attr_hdl_) & 45 ( variablegroup_hdl, group_ref_, name_, t ype_ )47 ( variablegroup_hdl, group_ref_, name_, ts_target_, type_ ) 46 48 47 49 IMPLICIT NONE … … 49 51 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: group_ref_ 50 52 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: name_ 53 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: ts_target_ 51 54 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: type_ 52 55 … … 61 64 ENDIF 62 65 66 IF (PRESENT(ts_target_)) THEN 67 CALL cxios_set_variablegroup_ts_target & 68 (variablegroup_hdl%daddr, ts_target_, len(ts_target_)) 69 ENDIF 70 63 71 IF (PRESENT(type_)) THEN 64 72 CALL cxios_set_variablegroup_type & … … 69 77 70 78 SUBROUTINE xios(get_variablegroup_attr) & 71 ( variablegroup_id, group_ref, name, t ype )79 ( variablegroup_id, group_ref, name, ts_target, type ) 72 80 73 81 IMPLICIT NONE … … 76 84 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 77 85 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 86 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 78 87 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 79 88 … … 81 90 (variablegroup_id,variablegroup_hdl) 82 91 CALL xios(get_variablegroup_attr_hdl_) & 83 ( variablegroup_hdl, group_ref, name, t ype )92 ( variablegroup_hdl, group_ref, name, ts_target, type ) 84 93 85 94 END SUBROUTINE xios(get_variablegroup_attr) 86 95 87 96 SUBROUTINE xios(get_variablegroup_attr_hdl) & 88 ( variablegroup_hdl, group_ref, name, t ype )97 ( variablegroup_hdl, group_ref, name, ts_target, type ) 89 98 90 99 IMPLICIT NONE … … 92 101 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref 93 102 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name 103 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target 94 104 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type 95 105 96 106 CALL xios(get_variablegroup_attr_hdl_) & 97 ( variablegroup_hdl, group_ref, name, t ype )107 ( variablegroup_hdl, group_ref, name, ts_target, type ) 98 108 99 109 END SUBROUTINE xios(get_variablegroup_attr_hdl) 100 110 101 111 SUBROUTINE xios(get_variablegroup_attr_hdl_) & 102 ( variablegroup_hdl, group_ref_, name_, t ype_ )112 ( variablegroup_hdl, group_ref_, name_, ts_target_, type_ ) 103 113 104 114 IMPLICIT NONE … … 106 116 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: group_ref_ 107 117 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: name_ 118 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: ts_target_ 108 119 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: type_ 109 120 … … 118 129 ENDIF 119 130 131 IF (PRESENT(ts_target_)) THEN 132 CALL cxios_get_variablegroup_ts_target & 133 (variablegroup_hdl%daddr, ts_target_, len(ts_target_)) 134 ENDIF 135 120 136 IF (PRESENT(type_)) THEN 121 137 CALL cxios_get_variablegroup_type & … … 126 142 127 143 SUBROUTINE xios(is_defined_variablegroup_attr) & 128 ( variablegroup_id, group_ref, name, t ype )144 ( variablegroup_id, group_ref, name, ts_target, type ) 129 145 130 146 IMPLICIT NONE … … 135 151 LOGICAL, OPTIONAL, INTENT(OUT) :: name 136 152 LOGICAL(KIND=C_BOOL) :: name_tmp 153 LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 154 LOGICAL(KIND=C_BOOL) :: ts_target_tmp 137 155 LOGICAL, OPTIONAL, INTENT(OUT) :: type 138 156 LOGICAL(KIND=C_BOOL) :: type_tmp … … 141 159 (variablegroup_id,variablegroup_hdl) 142 160 CALL xios(is_defined_variablegroup_attr_hdl_) & 143 ( variablegroup_hdl, group_ref, name, t ype )161 ( variablegroup_hdl, group_ref, name, ts_target, type ) 144 162 145 163 END SUBROUTINE xios(is_defined_variablegroup_attr) 146 164 147 165 SUBROUTINE xios(is_defined_variablegroup_attr_hdl) & 148 ( variablegroup_hdl, group_ref, name, t ype )166 ( variablegroup_hdl, group_ref, name, ts_target, type ) 149 167 150 168 IMPLICIT NONE … … 154 172 LOGICAL, OPTIONAL, INTENT(OUT) :: name 155 173 LOGICAL(KIND=C_BOOL) :: name_tmp 174 LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target 175 LOGICAL(KIND=C_BOOL) :: ts_target_tmp 156 176 LOGICAL, OPTIONAL, INTENT(OUT) :: type 157 177 LOGICAL(KIND=C_BOOL) :: type_tmp 158 178 159 179 CALL xios(is_defined_variablegroup_attr_hdl_) & 160 ( variablegroup_hdl, group_ref, name, t ype )180 ( variablegroup_hdl, group_ref, name, ts_target, type ) 161 181 162 182 END SUBROUTINE xios(is_defined_variablegroup_attr_hdl) 163 183 164 184 SUBROUTINE xios(is_defined_variablegroup_attr_hdl_) & 165 ( variablegroup_hdl, group_ref_, name_, t ype_ )185 ( variablegroup_hdl, group_ref_, name_, ts_target_, type_ ) 166 186 167 187 IMPLICIT NONE … … 171 191 LOGICAL, OPTIONAL, INTENT(OUT) :: name_ 172 192 LOGICAL(KIND=C_BOOL) :: name__tmp 193 LOGICAL, OPTIONAL, INTENT(OUT) :: ts_target_ 194 LOGICAL(KIND=C_BOOL) :: ts_target__tmp 173 195 LOGICAL, OPTIONAL, INTENT(OUT) :: type_ 174 196 LOGICAL(KIND=C_BOOL) :: type__tmp … … 186 208 ENDIF 187 209 210 IF (PRESENT(ts_target_)) THEN 211 ts_target__tmp = cxios_is_defined_variablegroup_ts_target & 212 (variablegroup_hdl%daddr) 213 ts_target_ = ts_target__tmp 214 ENDIF 215 188 216 IF (PRESENT(type_)) THEN 189 217 type__tmp = cxios_is_defined_variablegroup_type & -
XIOS/dev/dev_olga/src/interface/fortran_attr/scalar_interface_attr.F90
r891 r1158 50 50 INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 51 51 END FUNCTION cxios_is_defined_scalar_name 52 53 54 SUBROUTINE cxios_set_scalar_prec(scalar_hdl, prec) BIND(C) 55 USE ISO_C_BINDING 56 INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 57 INTEGER (KIND=C_INT) , VALUE :: prec 58 END SUBROUTINE cxios_set_scalar_prec 59 60 SUBROUTINE cxios_get_scalar_prec(scalar_hdl, prec) BIND(C) 61 USE ISO_C_BINDING 62 INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 63 INTEGER (KIND=C_INT) :: prec 64 END SUBROUTINE cxios_get_scalar_prec 65 66 FUNCTION cxios_is_defined_scalar_prec(scalar_hdl) BIND(C) 67 USE ISO_C_BINDING 68 LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalar_prec 69 INTEGER (kind = C_INTPTR_T), VALUE :: scalar_hdl 70 END FUNCTION cxios_is_defined_scalar_prec 52 71 53 72 -
XIOS/dev/dev_olga/src/interface/fortran_attr/scalargroup_interface_attr.F90
r891 r1158 71 71 INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 72 72 END FUNCTION cxios_is_defined_scalargroup_name 73 74 75 SUBROUTINE cxios_set_scalargroup_prec(scalargroup_hdl, prec) BIND(C) 76 USE ISO_C_BINDING 77 INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 78 INTEGER (KIND=C_INT) , VALUE :: prec 79 END SUBROUTINE cxios_set_scalargroup_prec 80 81 SUBROUTINE cxios_get_scalargroup_prec(scalargroup_hdl, prec) BIND(C) 82 USE ISO_C_BINDING 83 INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 84 INTEGER (KIND=C_INT) :: prec 85 END SUBROUTINE cxios_get_scalargroup_prec 86 87 FUNCTION cxios_is_defined_scalargroup_prec(scalargroup_hdl) BIND(C) 88 USE ISO_C_BINDING 89 LOGICAL(kind=C_BOOL) :: cxios_is_defined_scalargroup_prec 90 INTEGER (kind = C_INTPTR_T), VALUE :: scalargroup_hdl 91 END FUNCTION cxios_is_defined_scalargroup_prec 73 92 74 93 -
XIOS/dev/dev_olga/src/interface/fortran_attr/variable_interface_attr.F90
r581 r1158 31 31 32 32 33 SUBROUTINE cxios_set_variable_ts_target(variable_hdl, ts_target, ts_target_size) BIND(C) 34 USE ISO_C_BINDING 35 INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl 36 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: ts_target 37 INTEGER (kind = C_INT) , VALUE :: ts_target_size 38 END SUBROUTINE cxios_set_variable_ts_target 39 40 SUBROUTINE cxios_get_variable_ts_target(variable_hdl, ts_target, ts_target_size) BIND(C) 41 USE ISO_C_BINDING 42 INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl 43 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: ts_target 44 INTEGER (kind = C_INT) , VALUE :: ts_target_size 45 END SUBROUTINE cxios_get_variable_ts_target 46 47 FUNCTION cxios_is_defined_variable_ts_target(variable_hdl) BIND(C) 48 USE ISO_C_BINDING 49 LOGICAL(kind=C_BOOL) :: cxios_is_defined_variable_ts_target 50 INTEGER (kind = C_INTPTR_T), VALUE :: variable_hdl 51 END FUNCTION cxios_is_defined_variable_ts_target 52 53 33 54 SUBROUTINE cxios_set_variable_type(variable_hdl, type, type_size) BIND(C) 34 55 USE ISO_C_BINDING -
XIOS/dev/dev_olga/src/interface/fortran_attr/variablegroup_interface_attr.F90
r581 r1158 52 52 53 53 54 SUBROUTINE cxios_set_variablegroup_ts_target(variablegroup_hdl, ts_target, ts_target_size) BIND(C) 55 USE ISO_C_BINDING 56 INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl 57 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: ts_target 58 INTEGER (kind = C_INT) , VALUE :: ts_target_size 59 END SUBROUTINE cxios_set_variablegroup_ts_target 60 61 SUBROUTINE cxios_get_variablegroup_ts_target(variablegroup_hdl, ts_target, ts_target_size) BIND(C) 62 USE ISO_C_BINDING 63 INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl 64 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: ts_target 65 INTEGER (kind = C_INT) , VALUE :: ts_target_size 66 END SUBROUTINE cxios_get_variablegroup_ts_target 67 68 FUNCTION cxios_is_defined_variablegroup_ts_target(variablegroup_hdl) BIND(C) 69 USE ISO_C_BINDING 70 LOGICAL(kind=C_BOOL) :: cxios_is_defined_variablegroup_ts_target 71 INTEGER (kind = C_INTPTR_T), VALUE :: variablegroup_hdl 72 END FUNCTION cxios_is_defined_variablegroup_ts_target 73 74 54 75 SUBROUTINE cxios_set_variablegroup_type(variablegroup_hdl, type, type_size) BIND(C) 55 76 USE ISO_C_BINDING -
XIOS/dev/dev_olga/src/io/nc4_data_input.cpp
r967 r1158 262 262 itMapNj = itMapNi; ++itMapNj; 263 263 264 if ((CDomain::type_attr::rectilinear == domain->type)) // || this->isRectilinear(fieldId))264 if ((CDomain::type_attr::rectilinear == domain->type)) 265 265 { 266 266 // Ok, try to read some f.. attributes such as longitude and latitude … … 279 279 std::vector<StdSize> nBeginLon(1, 0), nSizeLon(1, itMapNi->second); 280 280 readFieldVariableValue(domain->lonvalue_rectilinear_read_from_file, itMapNi->first, nBeginLon, nSizeLon, true); 281 } 282 domain->fillInRectilinearLonLat(); 283 } 284 else if ((CDomain::type_attr::curvilinear == domain->type))// || (this->isCurvilinear(fieldId))) 281 } 282 } 283 else if ((CDomain::type_attr::curvilinear == domain->type)) 285 284 { 286 285 int ni = domain->ni; 287 286 int nj = domain->nj; 288 287 std::vector<StdSize> nBeginLatLon(2), nSizeLatLon(2); 289 nBeginLatLon[0] = domain->jbegin.getValue(); nBeginLatLon[1] = domain->ibegin.getValue();290 nSizeLatLon[0] = nj; nSizeLatLon[1] = ni;288 nBeginLatLon[0] = 0; nBeginLatLon[1] = 0; 289 nSizeLatLon[0] = domain->nj_glo.getValue(); nSizeLatLon[1] = domain->ni_glo.getValue(); 291 290 292 291 StdString latName = this->getLatCoordName(fieldId); 293 if (SuperClassWriter::hasVariable(latName)) //(0 != latName.compare(""))294 { 295 domain->latvalue_ 2d.resize(ni,nj);296 readFieldVariableValue(domain->latvalue_ 2d, latName, nBeginLatLon, nSizeLatLon);292 if (SuperClassWriter::hasVariable(latName)) 293 { 294 domain->latvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo); 295 readFieldVariableValue(domain->latvalue_curvilinear_read_from_file, latName, nBeginLatLon, nSizeLatLon); 297 296 } 298 297 StdString lonName = this->getLonCoordName(fieldId); 299 if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare(""))300 { 301 domain->lonvalue_ 2d.resize(ni,nj);302 readFieldVariableValue(domain->lonvalue_ 2d, lonName, nBeginLatLon, nSizeLatLon);298 if (SuperClassWriter::hasVariable(lonName)) 299 { 300 domain->lonvalue_curvilinear_read_from_file.resize(domain->ni_glo,domain->nj_glo); 301 readFieldVariableValue(domain->lonvalue_curvilinear_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 303 302 } 304 303 … … 307 306 308 307 int nbVertex = this->getNbVertex(fieldId); 309 if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName)) //if ((0 != boundsLatName.compare("")) || (0 != boundsLonName.compare(""))) 308 if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 309 { 310 ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 311 << "The domain " << domain->getDomainOutputName() 312 << " has nvertex read from file " << this->filename << " and nvertex provided from model" 313 << " are not coherent. They should be the same." << std::endl 314 << " nvertex read from file: "<< nbVertex 315 << " nvertex from model: "<< domain->nvertex << std::endl); 316 } 317 318 if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName)) 310 319 domain->nvertex.setValue(nbVertex); 311 320 std::vector<StdSize> nBeginBndsLatLon(3), nSizeBndsLatLon(3); 312 nBeginBndsLatLon[0] = domain->jbegin.getValue(); nSizeBndsLatLon[0] = nj;313 nBeginBndsLatLon[1] = domain->ibegin.getValue(); nSizeBndsLatLon[1] = ni;321 nBeginBndsLatLon[0] = 0; nSizeBndsLatLon[0] = domain->nj_glo.getValue(); 322 nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = domain->nj_glo.getValue(); 314 323 nBeginBndsLatLon[2] = 0; nSizeBndsLatLon[2] = nbVertex; 315 324 316 if (SuperClassWriter::hasVariable(boundsLatName)) //(0 != boundsLatName.compare(""))317 { 318 domain->bounds_lat _2d.resize(nbVertex,ni,nj);319 readFieldVariableValue(domain->bounds_lat _2d, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon);320 321 } 322 if (SuperClassWriter::hasVariable(boundsLonName)) //(0 != boundsLonName.compare(""))323 { 324 domain->bounds_lon _2d.resize(nbVertex,ni,nj);325 readFieldVariableValue(domain->bounds_lon _2d, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon);326 } 325 if (SuperClassWriter::hasVariable(boundsLatName)) 326 { 327 domain->bounds_latvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo); 328 readFieldVariableValue(domain->bounds_latvalue_curvilinear_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 329 330 } 331 if (SuperClassWriter::hasVariable(boundsLonName)) 332 { 333 domain->bounds_lonvalue_curvilinear_read_from_file.resize(nbVertex,domain->ni_glo,domain->nj_glo); 334 readFieldVariableValue(domain->bounds_lonvalue_curvilinear_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 335 } 327 336 } 328 337 else if ((CDomain::type_attr::unstructured == domain->type))// || (this->isUnstructured(fieldId))) 329 338 { 330 /*331 if (domain->i_index.isEmpty())332 ERROR("CNc4DataInput::readDomainAttributeValueFromFile(...)",333 << "Field '" << fieldId << std::endl334 << "Trying to read attributes from unstructured grid."335 << "i_index of domain" << domain->getId() << " is mandatory");336 337 int ni = domain->i_index.numElements();338 */339 340 int ni = domain->ni.isEmpty() ? 0 : domain->ni;341 int ibegin = domain->ibegin.isEmpty() ? 0 : domain->ibegin;342 343 if (domain->i_index.isEmpty() && (!domain->ni.isEmpty()) )344 {345 domain->i_index.resize(ni) ;346 for(int idx = 0; idx < ni; ++idx) domain->i_index(idx)=ibegin+idx ;347 }348 349 339 std::vector<StdSize> nBeginLatLon(1,0), nSizeLatLon(1,0); 350 340 nSizeLatLon[0] = domain->ni_glo.getValue(); … … 352 342 353 343 StdString latName = this->getLatCoordName(fieldId); 354 if (SuperClassWriter::hasVariable(latName)) //(0 != latName.compare("")) 355 { 356 readFieldVariableValue(globalLonLat, latName, nBeginLatLon, nSizeLatLon); 357 domain->latvalue_1d.resize(ni); 358 for (int idx = 0; idx < ni; ++idx) 359 domain->latvalue_1d(idx) = globalLonLat(domain->i_index(idx)); 344 if (SuperClassWriter::hasVariable(latName)) 345 { 346 domain->latvalue_unstructured_read_from_file.resize(domain->ni_glo); 347 readFieldVariableValue(domain->latvalue_unstructured_read_from_file, latName, nBeginLatLon, nSizeLatLon); 360 348 } 361 349 … … 363 351 if (SuperClassWriter::hasVariable(lonName)) //(0 != lonName.compare("")) 364 352 { 365 readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon); 366 domain->lonvalue_1d.resize(ni); 367 for (int idx = 0; idx < ni; ++idx) 368 domain->lonvalue_1d(idx) = globalLonLat(domain->i_index(idx)); 353 // readFieldVariableValue(globalLonLat, lonName, nBeginLatLon, nSizeLatLon); 354 domain->lonvalue_unstructured_read_from_file.resize(domain->ni_glo); 355 readFieldVariableValue(domain->lonvalue_unstructured_read_from_file, lonName, nBeginLatLon, nSizeLatLon); 369 356 } 370 357 … … 373 360 374 361 int nbVertex = this->getNbVertex(fieldId); 375 if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName)) // (0 != boundsLatName.compare("")) || (0 != boundsLonName.compare(""))) 362 if (!domain->nvertex.isEmpty() && (domain->nvertex != nbVertex)) 363 { 364 ERROR("void CNc4DataInput::readDomainAttributeValueFromFile(...)", 365 << "The domain " << domain->getDomainOutputName() 366 << " has nvertex read from file " << this->filename << " and nvertex provided from model" 367 << " are not coherent. They should be the same." << std::endl 368 << " nvertex read from file: "<< nbVertex 369 << " nvertex from model: "<< domain->nvertex << std::endl); 370 } 371 372 if (SuperClassWriter::hasVariable(boundsLatName) || SuperClassWriter::hasVariable(boundsLonName)) 376 373 domain->nvertex.setValue(nbVertex); 377 374 … … 380 377 nBeginBndsLatLon[1] = 0; nSizeBndsLatLon[1] = nbVertex; 381 378 382 if (SuperClassWriter::hasVariable(boundsLatName)) //(0 != boundsLatName.compare("")) 383 { 384 CArray<double,2> globalBndsLonLat(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 385 readFieldVariableValue(globalBndsLonLat, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 386 domain->bounds_lat_1d.resize(nbVertex,ni); 387 for (int idx = 0; idx < ni; ++idx) 388 for (int jdx = 0; jdx < nbVertex; ++jdx) 389 domain->bounds_lat_1d(jdx,idx) = globalBndsLonLat(jdx, domain->i_index(idx)); 390 } 391 392 if (SuperClassWriter::hasVariable(boundsLonName)) //(0 != boundsLonName.compare("")) 393 { 394 CArray<double,2> globalBndsLonLat(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 395 readFieldVariableValue(globalBndsLonLat, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 396 domain->bounds_lon_1d.resize(nbVertex,ni); 397 for (int idx = 0; idx < ni; ++idx) 398 for (int jdx = 0; jdx < nbVertex; ++jdx) 399 domain->bounds_lon_1d(jdx,idx) = globalBndsLonLat(jdx, domain->i_index(idx)); 400 } 401 } 379 if (SuperClassWriter::hasVariable(boundsLatName)) 380 { 381 domain->bounds_latvalue_unstructured_read_from_file.resize(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 382 readFieldVariableValue(domain->bounds_latvalue_unstructured_read_from_file, boundsLatName, nBeginBndsLatLon, nSizeBndsLatLon); 383 } 384 385 if (SuperClassWriter::hasVariable(boundsLonName)) 386 { 387 domain->bounds_lonvalue_unstructured_read_from_file.resize(nSizeBndsLatLon[1], nSizeBndsLatLon[0]); 388 readFieldVariableValue(domain->bounds_lonvalue_unstructured_read_from_file, boundsLonName, nBeginBndsLatLon, nSizeBndsLatLon); 389 } 390 } 391 domain->fillInLonLat(); 402 392 } 403 393 … … 421 411 if (this->isRectilinear(fieldId) || this->isCurvilinear(fieldId)) 422 412 { 413 if (!domain->nj_glo.isEmpty() && (domain->nj_glo != itMapNj->second)) 414 { 415 ERROR("void CNc4DataInput::readDomainAttributesFromFile(...)", 416 << "The domain " << domain->getDomainOutputName() 417 << " has nj_glo read from file " << this->filename << " and nj_glo provided from model" 418 << " are not coherent. They should be the same." << std::endl 419 << " nj_glo read from file: "<< itMapNj->second 420 << " nj_glo from model: "<< domain->nj_glo << std::endl); 421 } 423 422 domain->nj_glo.setValue(itMapNj->second); 423 424 if (!domain->ni_glo.isEmpty() && (domain->ni_glo != itMapNi->second)) 425 { 426 ERROR("void CNc4DataInput::readDomainAttributesFromFile(...)", 427 << "The domain " << domain->getDomainOutputName() 428 << " has ni_glo read from file " << this->filename << " and ni_glo provided from model" 429 << " are not coherent. They should be the same." << std::endl 430 << " ni_glo read from file: "<< itMapNi->second 431 << " ni_glo from model: "<< domain->ni_glo << std::endl); 432 } 424 433 domain->ni_glo.setValue(itMapNi->second); 425 434 } … … 427 436 { 428 437 domain->nj_glo.setValue(1); 438 439 if (!domain->ni_glo.isEmpty() && (domain->ni_glo != itMapNi->second)) 440 { 441 ERROR("void CNc4DataInput::readDomainAttributesFromFile(...)", 442 << "The domain " << domain->getDomainOutputName() 443 << " has ni_glo read from file " << this->filename << " and ni_glo provided from model" 444 << " are not coherent. They should be the same." << std::endl 445 << " ni_glo read from file: "<< itMapNi->second 446 << " ni_glo from model: "<< domain->ni_glo << std::endl); 447 } 429 448 domain->ni_glo.setValue(itMapNi->second); 430 449 } … … 444 463 iteMap = dimSizeMap.end(); 445 464 for (int i = 0; i < elementPosition; ++i, ++itMapN) {} 465 466 if (!axis->n_glo.isEmpty() && (axis->n_glo != itMapN->second)) 467 { 468 ERROR("void CNc4DataInput::readAxisAttributesFromFile(...)", 469 << "The axis " << axis->getAxisOutputName() 470 << " has n_glo read from file " << this->filename << " and n_glo provided from model" 471 << " are not coherent. They should be the same." << std::endl 472 << " n_glo read from file: "<< itMapN->second 473 << " n_glo from model: "<< axis->n_glo << std::endl); 474 } 446 475 axis->n_glo.setValue(itMapN->second); 447 476 } … … 483 512 int elementPosition, const StdString& fieldId) 484 513 { 485 // std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), 486 // iteMap = dimSizeMap.end(); 487 // for (int i = 0; i < elementPosition; ++i, ++itMapN) {} 488 // axis->n_glo.setValue(itMapN->second); 514 /*Nothing to do */ 489 515 } 490 516 … … 499 525 int elementPosition, const StdString& fieldId) 500 526 { 501 // std::list<std::pair<StdString, StdSize> >::const_iterator itMapN = dimSizeMap.begin(), 502 // iteMap = dimSizeMap.end(); 503 // for (int i = 0; i < elementPosition; ++i, ++itMapN) {} 504 // 505 // { // Read axis value 506 // std::vector<StdSize> nBegin(1, 0), nSize(1, itMapN->second); 507 // CArray<double,1> readAxisValue(itMapN->second); 508 // readFieldVariableValue(readAxisValue, itMapN->first, nBegin, nSize, true); 509 // int begin = 0, n = itMapN->second; 510 // if (!axis->begin.isEmpty()) begin = axis->begin.getValue(); 511 // if (!axis->n.isEmpty()) n = axis->n.getValue(); 512 // axis->value.resize(n); 513 // for (int i = 0; i < n; ++i) axis->value(i) = readAxisValue(begin + i); 514 // } 527 /*Nothing to do */ 515 528 } 516 529 -
XIOS/dev/dev_olga/src/io/nc4_data_output.cpp
r1144 r1158 11 11 #include "netCdfException.hpp" 12 12 #include "exception.hpp" 13 13 #include "timer.hpp" 14 #include "uuid.hpp" 14 15 namespace xios 15 16 { 16 17 /// ////////////////////// Dfinitions ////////////////////// /// 17 18 CNc4DataOutput::CNc4DataOutput 18 ( const StdString & filename, bool exist)19 (CFile* file, const StdString & filename, bool exist) 19 20 : SuperClass() 20 21 , SuperClassWriter(filename, exist) 21 22 , filename(filename) 22 { 23 SuperClass::type = MULTI_FILE; 23 , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none) 24 { 25 SuperClass::type = MULTI_FILE; 24 26 } 25 27 26 28 CNc4DataOutput::CNc4DataOutput 27 ( const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention,29 (CFile* file, const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention, 28 30 MPI_Comm comm_file, bool multifile, bool isCollective, const StdString& timeCounterName) 29 31 : SuperClass() … … 32 34 , filename(filename) 33 35 , isCollective(isCollective) 34 { 35 SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 36 , file(file),hasTimeInstant(false),hasTimeCentered(false), timeCounterType(none) 37 { 38 SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; 36 39 } 37 40 … … 60 63 } 61 64 62 63 65 CContext* context = CContext::getCurrent() ; 64 66 CContextServer* server=context->server ; … … 78 80 int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex; 79 81 80 StdString dimXid, dimYid ; 81 82 83 StdString dimXid, dimYid ; 84 85 nc_type typePrec ; 86 if (domain->prec.isEmpty()) typePrec = NC_FLOAT ; 87 else if (domain->prec==4) typePrec = NC_FLOAT ; 88 else if (domain->prec==8) typePrec = NC_DOUBLE ; 89 82 90 bool isRegularDomain = (domain->type == CDomain::type_attr::rectilinear); 83 91 switch (domain->type) … … 209 217 { 210 218 case CDomain::type_attr::curvilinear : 211 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);212 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);219 SuperClassWriter::addVariable(latid, typePrec, dim0); 220 SuperClassWriter::addVariable(lonid, typePrec, dim0); 213 221 break ; 214 222 case CDomain::type_attr::rectilinear : 215 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);216 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);223 SuperClassWriter::addVariable(latid, typePrec, dim0); 224 SuperClassWriter::addVariable(lonid, typePrec, dim1); 217 225 break ; 218 226 } … … 230 238 dim0.push_back(dimXid); 231 239 dim0.push_back(dimVertId); 232 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0);233 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0);240 SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 241 SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 234 242 } 235 243 } … … 256 264 if (domain->hasArea) 257 265 { 258 SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0);266 SuperClassWriter::addVariable(areaId, typePrec, dim0); 259 267 SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 260 268 SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); … … 311 319 lonid = StdString("nav_lon").append(appendDomid); 312 320 latid = StdString("nav_lat").append(appendDomid); 313 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);314 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);321 SuperClassWriter::addVariable(latid, typePrec, dim0); 322 SuperClassWriter::addVariable(lonid, typePrec, dim0); 315 323 break; 316 324 … … 320 328 lonid = StdString("lon").append(appendDomid); 321 329 latid = StdString("lat").append(appendDomid); 322 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);323 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim1);330 SuperClassWriter::addVariable(latid, typePrec, dim0); 331 SuperClassWriter::addVariable(lonid, typePrec, dim1); 324 332 break; 325 333 } … … 342 350 dim0.push_back(dimXid); 343 351 dim0.push_back(dimVertId); 344 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0);345 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0);352 SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 353 SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 346 354 } 347 355 } … … 351 359 dim0.clear(); 352 360 dim0.push_back(dimYid); dim0.push_back(dimXid); 353 SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0);361 SuperClassWriter::addVariable(areaId, typePrec, dim0); 354 362 SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 355 363 SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); … … 492 500 if (SuperClass::type==MULTI_FILE) return ; 493 501 502 nc_type typePrec ; 503 if (domain->prec.isEmpty()) typePrec = NC_FLOAT ; 504 else if (domain->prec==4) typePrec = NC_FLOAT ; 505 else if (domain->prec==8) typePrec = NC_DOUBLE ; 506 494 507 std::vector<StdString> dim0; 495 508 StdString domid = domain->getDomainOutputName(); … … 543 556 dim0.clear(); 544 557 dim0.push_back(dimNode); 545 SuperClassWriter::addVariable(node_x, NC_FLOAT, dim0);558 SuperClassWriter::addVariable(node_x, typePrec, dim0); 546 559 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x); 547 560 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x); 548 561 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x); 549 SuperClassWriter::addVariable(node_y, NC_FLOAT, dim0);562 SuperClassWriter::addVariable(node_y, typePrec, dim0); 550 563 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y); 551 564 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y); … … 562 575 dim0.clear(); 563 576 dim0.push_back(dimNode); 564 SuperClassWriter::addVariable(node_x, NC_FLOAT, dim0);577 SuperClassWriter::addVariable(node_x, typePrec, dim0); 565 578 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x); 566 579 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x); 567 580 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x); 568 SuperClassWriter::addVariable(node_y, NC_FLOAT, dim0);581 SuperClassWriter::addVariable(node_y, typePrec, dim0); 569 582 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y); 570 583 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y); … … 576 589 dim0.clear(); 577 590 dim0.push_back(dimEdge); 578 SuperClassWriter::addVariable(edge_x, NC_FLOAT, dim0);591 SuperClassWriter::addVariable(edge_x, typePrec, dim0); 579 592 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x); 580 593 SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x); 581 594 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x); 582 SuperClassWriter::addVariable(edge_y, NC_FLOAT, dim0);595 SuperClassWriter::addVariable(edge_y, typePrec, dim0); 583 596 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y); 584 597 SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y); … … 602 615 dim0.clear(); 603 616 dim0.push_back(dimNode); 604 SuperClassWriter::addVariable(node_x, NC_FLOAT, dim0);617 SuperClassWriter::addVariable(node_x, typePrec, dim0); 605 618 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &node_x); 606 619 SuperClassWriter::addAttribute("long_name", StdString("Longitude of mesh nodes."), &node_x); 607 620 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &node_x); 608 SuperClassWriter::addVariable(node_y, NC_FLOAT, dim0);621 SuperClassWriter::addVariable(node_y, typePrec, dim0); 609 622 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &node_y); 610 623 SuperClassWriter::addAttribute("long_name", StdString("Latitude of mesh nodes."), &node_y); … … 618 631 dim0.clear(); 619 632 dim0.push_back(dimEdge); 620 SuperClassWriter::addVariable(edge_x, NC_FLOAT, dim0);633 SuperClassWriter::addVariable(edge_x, typePrec, dim0); 621 634 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &edge_x); 622 635 SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh edges."), &edge_x); 623 636 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &edge_x); 624 SuperClassWriter::addVariable(edge_y, NC_FLOAT, dim0);637 SuperClassWriter::addVariable(edge_y, typePrec, dim0); 625 638 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &edge_y); 626 639 SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh edges."), &edge_y); … … 640 653 dim0.clear(); 641 654 dim0.push_back(dimFace); 642 SuperClassWriter::addVariable(face_x, NC_FLOAT, dim0);655 SuperClassWriter::addVariable(face_x, typePrec, dim0); 643 656 SuperClassWriter::addAttribute("standard_name", StdString("longitude"), &face_x); 644 657 SuperClassWriter::addAttribute("long_name", StdString("Characteristic longitude of mesh faces."), &face_x); 645 658 SuperClassWriter::addAttribute("units", StdString("degrees_east"), &face_x); 646 SuperClassWriter::addVariable(face_y, NC_FLOAT, dim0);659 SuperClassWriter::addVariable(face_y, typePrec, dim0); 647 660 SuperClassWriter::addAttribute("standard_name", StdString("latitude"), &face_y); 648 661 SuperClassWriter::addAttribute("long_name", StdString("Characteristic latitude of mesh faces."), &face_y); … … 906 919 string areaId = "area" + appendDomid; 907 920 921 nc_type typePrec ; 922 if (domain->prec.isEmpty()) typePrec = NC_FLOAT ; 923 else if (domain->prec==4) typePrec = NC_FLOAT ; 924 else if (domain->prec==8) typePrec = NC_DOUBLE ; 925 908 926 int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex; 909 927 … … 965 983 if (domain->hasLonLat) 966 984 { 967 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);968 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);985 SuperClassWriter::addVariable(latid, typePrec, dim0); 986 SuperClassWriter::addVariable(lonid, typePrec, dim0); 969 987 this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid); 970 988 if (domain->hasBounds) SuperClassWriter::addAttribute("bounds",bounds_lonid, &lonid); … … 978 996 dim0.push_back(dimXid); 979 997 dim0.push_back(dimVertId); 980 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0);981 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0);998 SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 999 SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 982 1000 } 983 1001 … … 986 1004 if (domain->hasArea) 987 1005 { 988 SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0);1006 SuperClassWriter::addVariable(areaId, typePrec, dim0); 989 1007 SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 990 1008 SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); … … 1021 1039 if (domain->hasLonLat) 1022 1040 { 1023 SuperClassWriter::addVariable(latid, NC_FLOAT, dim0);1024 SuperClassWriter::addVariable(lonid, NC_FLOAT, dim0);1041 SuperClassWriter::addVariable(latid, typePrec, dim0); 1042 SuperClassWriter::addVariable(lonid, typePrec, dim0); 1025 1043 1026 1044 this->writeAxisAttributes(lonid, "", "longitude", "Longitude", "degrees_east", domid); … … 1036 1054 dim0.push_back(dimXid); 1037 1055 dim0.push_back(dimVertId); 1038 SuperClassWriter::addVariable(bounds_lonid, NC_FLOAT, dim0);1039 SuperClassWriter::addVariable(bounds_latid, NC_FLOAT, dim0);1056 SuperClassWriter::addVariable(bounds_lonid, typePrec, dim0); 1057 SuperClassWriter::addVariable(bounds_latid, typePrec, dim0); 1040 1058 } 1041 1059 … … 1044 1062 dim0.clear(); 1045 1063 dim0.push_back(dimXid); 1046 SuperClassWriter::addVariable(areaId, NC_FLOAT, dim0);1064 SuperClassWriter::addVariable(areaId, typePrec, dim0); 1047 1065 SuperClassWriter::addAttribute("standard_name", StdString("cell_area"), &areaId); 1048 1066 SuperClassWriter::addAttribute("units", StdString("m2"), &areaId); … … 1111 1129 void CNc4DataOutput::writeAxis_(CAxis* axis) 1112 1130 { 1113 CContext* context = CContext::getCurrent();1114 1115 1131 if (axis->IsWritten(this->filename)) return; 1116 1132 axis->checkAttributes(); … … 1130 1146 else setWrittenAxis(axisid); 1131 1147 1148 nc_type typePrec ; 1149 if (axis->prec.isEmpty()) typePrec = NC_FLOAT ; 1150 else if (axis->prec==4) typePrec = NC_FLOAT ; 1151 else if (axis->prec==8) typePrec = NC_DOUBLE ; 1152 1153 if (!axis->label.isEmpty()) typePrec = NC_CHAR ; 1154 string strId="str_len" ; 1132 1155 try 1133 1156 { 1134 1157 SuperClassWriter::addDimension(axisid, zoom_size); 1158 if (!axis->label.isEmpty()) SuperClassWriter::addDimension(strId, stringArrayLen); 1135 1159 if (axis->hasValue) 1136 1160 { 1137 1161 dims.push_back(axisid); 1138 SuperClassWriter::addVariable(axisid, NC_FLOAT, dims); 1162 if (!axis->label.isEmpty()) dims.push_back(strId); 1163 SuperClassWriter::addVariable(axisid, typePrec, dims); 1139 1164 1140 1165 if (!axis->name.isEmpty()) … … 1162 1187 { 1163 1188 dims.push_back("axis_nbounds"); 1164 SuperClassWriter::addVariable(axisBoundsId, NC_FLOAT, dims);1189 SuperClassWriter::addVariable(axisBoundsId, typePrec, dims); 1165 1190 SuperClassWriter::addAttribute("bounds", axisBoundsId, &axisid); 1166 1191 } … … 1178 1203 case MULTI_FILE: 1179 1204 { 1180 // CArray<double,1> axis_value(axis->zoom_n);1181 // for (int i = 0; i < axis->zoom_n; i++) axis_value(i) = axis->value(i);1182 1205 SuperClassWriter::writeData(axis_value, axisid, isCollective, 0); 1183 1206 1184 if (!axis->bounds.isEmpty() )1207 if (!axis->bounds.isEmpty() && axis->label.isEmpty()) 1185 1208 SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0); 1186 1209 1210 // Need to check after 1211 if (! axis->label.isEmpty()) SuperClassWriter::writeData(axis->label_srv, axisid, isCollective, 0); 1212 1187 1213 SuperClassWriter::definition_start(); 1188 1189 1214 break; 1190 1215 } 1191 1216 case ONE_FILE: 1192 1217 { 1193 // CArray<double,1> axis_value(axis->zoom_n);1194 // axis_value = axis->value;1195 1218 std::vector<StdSize> start(1), startBounds(2) ; 1196 1219 std::vector<StdSize> count(1), countBounds(2) ; … … 1201 1224 SuperClassWriter::writeData(axis_value, axisid, isCollective, 0, &start, &count); 1202 1225 1203 if (!axis->bounds.isEmpty() )1226 if (!axis->bounds.isEmpty()&& axis->label.isEmpty()) 1204 1227 { 1205 1228 axis_bounds.resize(2, indexToWrite.numElements()); … … 1211 1234 SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds); 1212 1235 } 1236 1237 // Need to check after 1238 if (! axis->label.isEmpty()) SuperClassWriter::writeData(axis->label_srv, axisid, isCollective, 0); 1213 1239 1214 1240 SuperClassWriter::definition_start(); … … 1233 1259 ERROR("CNc4DataOutput::writeAxis_(CAxis* axis)", << msg); 1234 1260 } 1235 1236 axis->addRelFile(this->filename); 1261 axis->addRelFile(this->filename); 1237 1262 } 1238 1263 … … 1247 1272 else setWrittenAxis(scalaId); 1248 1273 1274 nc_type typePrec ; 1275 if (scalar->prec.isEmpty()) typePrec = NC_FLOAT ; 1276 else if (scalar->prec==4) typePrec = NC_FLOAT ; 1277 else if (scalar->prec==8) typePrec = NC_DOUBLE ; 1278 1279 1249 1280 try 1250 1281 { … … 1253 1284 // dims.push_back(scalaId); 1254 1285 std::vector<StdString> dims; 1255 SuperClassWriter::addVariable(scalaId, NC_FLOAT, dims);1286 SuperClassWriter::addVariable(scalaId, typePrec, dims); 1256 1287 1257 1288 if (!scalar->name.isEmpty()) … … 1550 1581 void CNc4DataOutput::writeField_(CField* field) 1551 1582 { 1552 1553 1554 1555 1556 1557 1583 CContext* context = CContext::getCurrent() ; 1584 CContextServer* server=context->server ; 1585 1586 std::vector<StdString> dims, coodinates; 1587 CGrid* grid = field->grid; 1588 if (!grid->doGridHaveDataToWrite()) 1558 1589 if (SuperClass::type==MULTI_FILE) return ; 1559 1590 1560 CArray<int,1> axisDomainOrder = grid->axis_domain_order; 1561 int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 1562 std::vector<StdString> domainList = grid->getDomainList(); 1563 std::vector<StdString> axisList = grid->getAxisList(); 1564 std::vector<StdString> scalarList = grid->getScalarList(); 1565 1566 StdString timeid = getTimeCounterName(); 1567 StdString dimXid,dimYid; 1568 std::deque<StdString> dimIdList, dimCoordList; 1569 bool hasArea = false; 1570 StdString cellMeasures = "area:"; 1571 bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 1572 1573 for (int i = 0; i < numElement; ++i) 1574 { 1575 if (2 == axisDomainOrder(i)) 1576 { 1577 CDomain* domain = CDomain::get(domainList[idxDomain]); 1578 StdString domId = domain->getDomainOutputName(); 1579 StdString appendDomId = singleDomain ? "" : "_" + domId ; 1580 1581 if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 1582 { 1583 dimIdList.push_back(domId + "_points"); 1584 field->setUseCompressedOutput(); 1585 } 1586 1587 switch (domain->type) 1588 { 1589 case CDomain::type_attr::curvilinear: 1590 if (!compressedOutput || !domain->isCompressible()) 1591 { 1592 dimXid = StdString("x").append(appendDomId); 1593 dimIdList.push_back(dimXid); 1594 dimYid = StdString("y").append(appendDomId); 1595 dimIdList.push_back(dimYid); 1596 } 1597 dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 1598 dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 1599 break ; 1600 case CDomain::type_attr::rectilinear: 1601 if (!compressedOutput || !domain->isCompressible()) 1602 { 1603 dimXid = StdString("lon").append(appendDomId); 1604 dimIdList.push_back(dimXid); 1605 dimYid = StdString("lat").append(appendDomId); 1606 dimIdList.push_back(dimYid); 1607 } 1608 break ; 1609 case CDomain::type_attr::unstructured: 1610 { 1611 if (SuperClassWriter::useCFConvention) 1612 { 1613 dimXid = StdString("cell").append(appendDomId); 1614 dimIdList.push_back(dimXid); 1615 dimCoordList.push_back(StdString("lon").append(appendDomId)); 1616 dimCoordList.push_back(StdString("lat").append(appendDomId)); 1591 CArray<int,1> axisDomainOrder = grid->axis_domain_order; 1592 int numElement = axisDomainOrder.numElements(), idxDomain = 0, idxAxis = 0, idxScalar = 0; 1593 std::vector<StdString> domainList = grid->getDomainList(); 1594 std::vector<StdString> axisList = grid->getAxisList(); 1595 std::vector<StdString> scalarList = grid->getScalarList(); 1596 1597 StdString timeid = getTimeCounterName(); 1598 StdString dimXid,dimYid; 1599 std::deque<StdString> dimIdList, dimCoordList; 1600 bool hasArea = false; 1601 StdString cellMeasures = "area:"; 1602 bool compressedOutput = !field->indexed_output.isEmpty() && field->indexed_output; 1603 1604 for (int i = 0; i < numElement; ++i) 1605 { 1606 if (2 == axisDomainOrder(i)) 1607 { 1608 CDomain* domain = CDomain::get(domainList[idxDomain]); 1609 StdString domId = domain->getDomainOutputName(); 1610 StdString appendDomId = singleDomain ? "" : "_" + domId ; 1611 1612 if (compressedOutput && domain->isCompressible() && domain->type != CDomain::type_attr::unstructured) 1613 { 1614 dimIdList.push_back(domId + "_points"); 1615 field->setUseCompressedOutput(); 1616 } 1617 1618 switch (domain->type) 1619 { 1620 case CDomain::type_attr::curvilinear: 1621 if (!compressedOutput || !domain->isCompressible()) 1622 { 1623 dimXid = StdString("x").append(appendDomId); 1624 dimIdList.push_back(dimXid); 1625 dimYid = StdString("y").append(appendDomId); 1626 dimIdList.push_back(dimYid); 1627 } 1628 dimCoordList.push_back(StdString("nav_lon").append(appendDomId)); 1629 dimCoordList.push_back(StdString("nav_lat").append(appendDomId)); 1630 break ; 1631 case CDomain::type_attr::rectilinear: 1632 if (!compressedOutput || !domain->isCompressible()) 1633 { 1634 dimXid = StdString("lon").append(appendDomId); 1635 dimIdList.push_back(dimXid); 1636 dimYid = StdString("lat").append(appendDomId); 1637 dimIdList.push_back(dimYid); 1638 } 1639 break ; 1640 case CDomain::type_attr::unstructured: 1641 { 1642 if (SuperClassWriter::useCFConvention) 1643 { 1644 dimXid = StdString("cell").append(appendDomId); 1645 dimIdList.push_back(dimXid); 1646 dimCoordList.push_back(StdString("lon").append(appendDomId)); 1647 dimCoordList.push_back(StdString("lat").append(appendDomId)); 1648 } 1649 else 1650 { 1651 StdString domainName = domain->name; 1652 if (domain->nvertex == 1) 1653 { 1654 dimXid = "n" + domainName + "_node"; 1655 dimIdList.push_back(dimXid); 1656 dimCoordList.push_back(StdString(domainName + "_node_x")); 1657 dimCoordList.push_back(StdString(domainName + "_node_y")); 1658 } 1659 else if (domain->nvertex == 2) 1660 { 1661 dimXid = "n" + domainName + "_edge"; 1662 dimIdList.push_back(dimXid); 1663 dimCoordList.push_back(StdString(domainName + "_edge_x")); 1664 dimCoordList.push_back(StdString(domainName + "_edge_y")); 1665 } 1666 else 1667 { 1668 dimXid = "n" + domainName + "_face"; 1669 dimIdList.push_back(dimXid); 1670 dimCoordList.push_back(StdString(domainName + "_face_x")); 1671 dimCoordList.push_back(StdString(domainName + "_face_y")); 1672 } 1673 } // ugrid convention 1674 } // case unstructured domain 1675 } 1676 1677 if (domain->hasArea) 1678 { 1679 hasArea = true; 1680 cellMeasures += " area" + appendDomId; 1681 } 1682 ++idxDomain; 1617 1683 } 1618 else 1619 { 1620 StdString domainName = domain->name; 1621 if (domain->nvertex == 1) 1684 else if (1 == axisDomainOrder(i)) 1685 { 1686 CAxis* axis = CAxis::get(axisList[idxAxis]); 1687 StdString axisId = axis->getAxisOutputName(); 1688 1689 if (compressedOutput && axis->isCompressible()) 1622 1690 { 1623 dimXid = "n" + domainName + "_node"; 1624 dimIdList.push_back(dimXid); 1625 dimCoordList.push_back(StdString(domainName + "_node_x")); 1626 dimCoordList.push_back(StdString(domainName + "_node_y")); 1627 } 1628 else if (domain->nvertex == 2) 1629 { 1630 dimXid = "n" + domainName + "_edge"; 1631 dimIdList.push_back(dimXid); 1632 dimCoordList.push_back(StdString(domainName + "_edge_x")); 1633 dimCoordList.push_back(StdString(domainName + "_edge_y")); 1691 dimIdList.push_back(axisId + "_points"); 1692 field->setUseCompressedOutput(); 1634 1693 } 1635 1694 else 1636 { 1637 dimXid = "n" + domainName + "_face"; 1638 dimIdList.push_back(dimXid); 1639 dimCoordList.push_back(StdString(domainName + "_face_x")); 1640 dimCoordList.push_back(StdString(domainName + "_face_y")); 1641 } 1642 } // ugrid convention 1643 } // case unstructured domain 1644 } 1645 1646 if (domain->hasArea) 1647 { 1648 hasArea = true; 1649 cellMeasures += " area" + appendDomId; 1650 } 1651 ++idxDomain; 1652 } 1653 else if (1 == axisDomainOrder(i)) 1654 { 1655 CAxis* axis = CAxis::get(axisList[idxAxis]); 1656 StdString axisId = axis->getAxisOutputName(); 1657 1658 if (compressedOutput && axis->isCompressible()) 1659 { 1660 dimIdList.push_back(axisId + "_points"); 1661 field->setUseCompressedOutput(); 1662 } 1663 else 1664 dimIdList.push_back(axisId); 1665 1666 dimCoordList.push_back(axisId); 1667 ++idxAxis; 1668 } 1669 else // scalar 1670 { 1695 dimIdList.push_back(axisId); 1696 1697 dimCoordList.push_back(axisId); 1698 ++idxAxis; 1699 } 1700 else // scalar 1701 { 1671 1702 /* Do nothing here */ 1672 } 1673 } 1674 1675 /* 1676 StdString lonid_loc = (server->intraCommSize > 1) 1677 ? StdString("lon").append(appendDomid).append("_local") 1678 : lonid; 1679 StdString latid_loc = (server->intraCommSize > 1) 1680 ? StdString("lat").append(appendDomid).append("_local") 1681 : latid; 1682 */ 1683 StdString fieldid = field->getFieldOutputName(); 1684 1685 nc_type type ; 1686 if (field->prec.isEmpty()) type = NC_FLOAT ; 1687 else 1688 { 1689 if (field->prec==2) type = NC_SHORT ; 1690 else if (field->prec==4) type = NC_FLOAT ; 1691 else if (field->prec==8) type = NC_DOUBLE ; 1692 } 1693 1694 bool wtime = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 1695 1696 if (wtime) 1697 { 1698 1699 //StdOStringStream oss; 1700 // oss << "time_" << field->operation.getValue() 1701 // << "_" << field->getRelFile()->output_freq.getValue(); 1702 //oss 1703 if (field->getOperationTimeType() == func::CFunctor::instant) coodinates.push_back(string("time_instant")); 1704 else if (field->getOperationTimeType() == func::CFunctor::centered) coodinates.push_back(string("time_centered")); 1705 dims.push_back(timeid); 1706 } 1707 1708 if (compressedOutput && grid->isCompressible()) 1709 { 1710 dims.push_back(grid->getId() + "_points"); 1711 field->setUseCompressedOutput(); 1712 } 1713 else 1714 { 1715 while (!dimIdList.empty()) 1716 { 1717 dims.push_back(dimIdList.back()); 1718 dimIdList.pop_back(); 1719 } 1720 } 1721 1722 while (!dimCoordList.empty()) 1723 { 1724 coodinates.push_back(dimCoordList.back()); 1725 dimCoordList.pop_back(); 1726 } 1727 1728 try 1729 { 1703 } 1704 } 1705 1706 StdString fieldid = field->getFieldOutputName(); 1707 1708 nc_type type ; 1709 if (field->prec.isEmpty()) type = NC_FLOAT ; 1710 else 1711 { 1712 if (field->prec==2) type = NC_SHORT ; 1713 else if (field->prec==4) type = NC_FLOAT ; 1714 else if (field->prec==8) type = NC_DOUBLE ; 1715 } 1716 1717 bool wtime = !(!field->operation.isEmpty() && field->getOperationTimeType() == func::CFunctor::once); 1718 1719 if (wtime) 1720 { 1721 if (field->hasTimeInstant && hasTimeInstant) coodinates.push_back(string("time_instant")); 1722 else if (field->hasTimeCentered && hasTimeCentered) coodinates.push_back(string("time_centered")); 1723 dims.push_back(timeid); 1724 } 1725 1726 if (compressedOutput && grid->isCompressible()) 1727 { 1728 dims.push_back(grid->getId() + "_points"); 1729 field->setUseCompressedOutput(); 1730 } 1731 else 1732 { 1733 while (!dimIdList.empty()) 1734 { 1735 dims.push_back(dimIdList.back()); 1736 dimIdList.pop_back(); 1737 } 1738 } 1739 1740 while (!dimCoordList.empty()) 1741 { 1742 coodinates.push_back(dimCoordList.back()); 1743 dimCoordList.pop_back(); 1744 } 1745 1746 try 1747 { 1730 1748 SuperClassWriter::addVariable(fieldid, type, dims); 1731 1749 … … 1742 1760 ("units", field->unit.getValue(), &fieldid); 1743 1761 1744 if (!field->valid_min.isEmpty()) 1762 // Ugrid field attributes "mesh" and "location" 1763 if (!SuperClassWriter::useCFConvention) 1764 { 1765 if (!domainList.empty()) 1766 { 1767 CDomain* domain = CDomain::get(domainList[0]); // Suppose that we have only domain 1768 StdString mesh = domain->name; 1769 SuperClassWriter::addAttribute("mesh", mesh, &fieldid); 1770 StdString location; 1771 if (domain->nvertex == 1) 1772 location = "node"; 1773 else if (domain->nvertex == 2) 1774 location = "edge"; 1775 else if (domain->nvertex > 2) 1776 location = "face"; 1777 SuperClassWriter::addAttribute("location", location, &fieldid); 1778 } 1779 1780 } 1781 1782 if (!field->valid_min.isEmpty()) 1745 1783 SuperClassWriter::addAttribute 1746 1784 ("valid_min", field->valid_min.getValue(), &fieldid); … … 1771 1809 if (!field->cell_methods.isEmpty()) 1772 1810 { 1773 StdString cellMethodString = field->cell_methods;1774 if (field->cell_methods_mode.isEmpty() ||1811 StdString cellMethodString = field->cell_methods; 1812 if (field->cell_methods_mode.isEmpty() || 1775 1813 (CField::cell_methods_mode_attr::overwrite == field->cell_methods_mode)) 1776 {1777 SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid);1778 alreadyAddCellMethod = true;1779 }1780 else1781 {1782 switch (field->cell_methods_mode)1783 {1784 case (CField::cell_methods_mode_attr::prefix):1785 cellMethodsPrefix = cellMethodString;1786 cellMethodsPrefix += " ";1787 break;1788 case (CField::cell_methods_mode_attr::suffix):1789 cellMethodsSuffix = " ";1790 cellMethodsSuffix += cellMethodString;1791 break;1792 case (CField::cell_methods_mode_attr::none):1793 break;1794 default:1795 break;1796 }1797 }1814 { 1815 SuperClassWriter::addAttribute("cell_methods", cellMethodString, &fieldid); 1816 alreadyAddCellMethod = true; 1817 } 1818 else 1819 { 1820 switch (field->cell_methods_mode) 1821 { 1822 case (CField::cell_methods_mode_attr::prefix): 1823 cellMethodsPrefix = cellMethodString; 1824 cellMethodsPrefix += " "; 1825 break; 1826 case (CField::cell_methods_mode_attr::suffix): 1827 cellMethodsSuffix = " "; 1828 cellMethodsSuffix += cellMethodString; 1829 break; 1830 case (CField::cell_methods_mode_attr::none): 1831 break; 1832 default: 1833 break; 1834 } 1835 } 1798 1836 } 1799 1837 … … 1881 1919 singleDomain = (file->nbDomains == 1); 1882 1920 1921 StdString conv_str ; 1922 if (file->convention_str.isEmpty()) 1923 { 1924 if (SuperClassWriter::useCFConvention) conv_str="CF-1.6" ; 1925 else conv_str="UGRID" ; 1926 } 1927 else conv_str=file->convention_str ; 1928 1883 1929 try 1884 1930 { 1885 if (SuperClassWriter::useCFConvention) 1886 this->writeFileAttributes(filename, description, 1887 StdString("CF-1.5"), 1888 StdString("An IPSL model"), 1889 this->getTimeStamp()); 1890 else 1891 this->writeFileAttributes(filename, description, 1892 StdString("UGRID"), 1893 StdString("An IPSL model"), 1894 this->getTimeStamp()); 1895 1931 this->writeFileAttributes(filename, description, 1932 conv_str, 1933 StdString("An IPSL model"), 1934 this->getTimeStamp()); 1896 1935 1897 1936 if (!appendMode) … … 2017 2056 struct tm * timeinfo = NULL; 2018 2057 char buffer [buffer_size]; 2019 2058 StdString formatStr; 2059 if (file->time_stamp_format.isEmpty()) formatStr="%Y-%b-%d %H:%M:%S %Z" ; 2060 else formatStr=file->time_stamp_format; 2061 2062 // time ( &rawtime ); 2063 // timeinfo = localtime ( &rawtime ); 2020 2064 time ( &rawtime ); 2021 timeinfo = localtime ( &rawtime );2022 strftime (buffer, buffer_size, "%Y-%b-%d %H:%M:%S %Z", timeinfo);2065 timeinfo = gmtime ( &rawtime ); 2066 strftime (buffer, buffer_size, formatStr.c_str(), timeinfo); 2023 2067 2024 2068 return (StdString(buffer)); … … 2033 2077 CGrid* grid = field->grid; 2034 2078 2035 if (field->getNStep()<1) return ; 2079 if (field->getNStep()<1) 2080 { 2081 return; 2082 } 2036 2083 2037 2084 if (!grid->doGridHaveDataToWrite()) 2038 if (SuperClass::type == MULTI_FILE || !isCollective) return; 2085 if (SuperClass::type == MULTI_FILE || !isCollective) 2086 { 2087 return; 2088 } 2039 2089 2040 2090 StdString fieldid = field->getFieldOutputName(); … … 2042 2092 StdOStringStream oss; 2043 2093 string timeAxisId; 2044 if (field-> getOperationTimeType() == func::CFunctor::instant) timeAxisId = "time_instant";2045 else if (field-> getOperationTimeType() == func::CFunctor::centered) timeAxisId = "time_centered";2094 if (field->hasTimeInstant) timeAxisId = "time_instant"; 2095 else if (field->hasTimeCentered) timeAxisId = "time_centered"; 2046 2096 2047 2097 StdString timeBoundId = getTimeCounterName() + "_bounds"; 2048 2098 2049 2099 StdString timeAxisBoundId; 2050 if (field-> getOperationTimeType() == func::CFunctor::instant) timeAxisBoundId = "time_instant_bounds";2051 else if (field-> getOperationTimeType() == func::CFunctor::centered) timeAxisBoundId = "time_centered_bounds";2100 if (field->hasTimeInstant) timeAxisBoundId = "time_instant_bounds"; 2101 else if (field->hasTimeCentered) timeAxisBoundId = "time_centered_bounds"; 2052 2102 2053 2103 if (!field->wasWritten()) 2054 2104 { 2055 if (appendMode && field->file->record_offset.isEmpty() && 2056 2105 if (appendMode && field->file->record_offset.isEmpty() && 2106 field->getOperationTimeType() != func::CFunctor::once) 2057 2107 { 2058 field->resetNStep(getRecordFromTime(field->last_Write_srv) + 1); 2108 double factorUnit; 2109 if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) 2110 factorUnit=context->getCalendar()->getDayLengthInSeconds() ; 2111 else factorUnit=1 ; 2112 field->resetNStep(getRecordFromTime(field->last_Write_srv,factorUnit) + 1); 2059 2113 } 2060 2114 … … 2069 2123 2070 2124 bool wtime = (field->getOperationTimeType() != func::CFunctor::once); 2125 bool wtimeCounter =false ; 2126 bool wtimeData =false ; 2127 2071 2128 2072 2129 if (wtime) … … 2075 2132 Time lastLastWrite = field->lastlast_Write_srv; 2076 2133 2077 if (field->getOperationTimeType() == func::CFunctor::instant) 2078 time_data(0) = lastWrite; 2079 else if (field->getOperationTimeType() == func::CFunctor::centered) 2134 2135 if (field->hasTimeInstant) 2136 { 2137 time_data(0) = time_data_bound(1) = lastWrite; 2138 time_data_bound(0) = time_data_bound(1) = lastWrite; 2139 if (timeCounterType==instant) 2140 { 2141 time_counter(0) = time_data(0); 2142 time_counter_bound(0) = time_data_bound(0); 2143 time_counter_bound(1) = time_data_bound(1); 2144 wtimeCounter=true ; 2145 } 2146 if (hasTimeInstant) wtimeData=true ; 2147 } 2148 else if (field->hasTimeCentered) 2149 { 2080 2150 time_data(0) = (lastWrite + lastLastWrite) / 2; 2081 2082 if (field->getOperationTimeType() == func::CFunctor::instant)2083 time_data_bound(0) = time_data_bound(1) = lastWrite;2084 else if (field->getOperationTimeType() == func::CFunctor::centered)2085 {2086 2151 time_data_bound(0) = lastLastWrite; 2087 2152 time_data_bound(1) = lastWrite; 2153 if (timeCounterType==centered) 2154 { 2155 time_counter(0) = time_data(0) ; 2156 time_counter_bound(0) = time_data_bound(0) ; 2157 time_counter_bound(1) = time_data_bound(1) ; 2158 wtimeCounter=true ; 2159 } 2160 if (hasTimeCentered) wtimeData=true ; 2088 2161 } 2089 2162 2090 if (field->file->time_counter == CFile::time_counter_attr::instant) 2091 time_counter(0) = lastWrite; 2092 else if (field->file->time_counter == CFile::time_counter_attr::centered) 2093 time_counter(0) = (lastWrite + lastLastWrite) / 2; 2094 else if (field->file->time_counter == CFile::time_counter_attr::record) 2163 if (timeCounterType==record) 2164 { 2095 2165 time_counter(0) = field->getNStep() - 1; 2096 2097 2098 if (field->file->time_counter == CFile::time_counter_attr::instant)2099 time_counter_bound(0) = time_counter_bound(1) = lastWrite; 2100 else if (field->file->time_counter == CFile::time_counter_attr::centered)2166 time_counter_bound(0) = time_counter_bound(1) = field->getNStep() - 1; 2167 wtimeCounter=true ; 2168 } 2169 2170 if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) 2101 2171 { 2102 time_counter_bound(0) = lastLastWrite; 2103 time_counter_bound(1) = lastWrite; 2172 double secByDay=context->getCalendar()->getDayLengthInSeconds() ; 2173 time_data/=secByDay; 2174 time_data_bound/=secByDay; 2175 time_counter/=secByDay; 2176 time_counter_bound/=secByDay; 2104 2177 } 2105 else if (field->file->time_counter == CFile::time_counter_attr::record)2106 time_counter_bound(0) = time_counter_bound(1) = field->getNStep() - 1;2107 2178 } 2108 2179 … … 2140 2211 case (MULTI_FILE) : 2141 2212 { 2213 CTimer::get("Files : writing data").resume(); 2142 2214 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1); 2215 CTimer::get("Files : writing data").suspend(); 2143 2216 if (wtime) 2144 2217 { 2145 SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2146 SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2147 if (field->file->time_counter != CFile::time_counter_attr::none) 2218 CTimer::get("Files : writing time axis").resume(); 2219 if ( wtimeData) 2148 2220 { 2149 SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2150 if (field->file->time_counter != CFile::time_counter_attr::record) 2151 SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2221 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2222 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2223 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2224 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2225 } 2226 if (wtimeCounter) 2227 { 2228 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2229 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2230 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2231 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2152 2232 } 2233 CTimer::get("Files : writing time axis").suspend(); 2153 2234 } 2154 2235 break; … … 2227 2308 } 2228 2309 } 2229 } 2310 } 2230 2311 } 2231 2312 else … … 2278 2359 } 2279 2360 2361 2362 CTimer::get("Files : writing data").resume(); 2280 2363 SuperClassWriter::writeData(fieldData, fieldid, isCollective, field->getNStep() - 1, &start, &count); 2281 if (wtime) 2282 { 2283 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2284 SuperClassWriter::writeTimeAxisData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2285 if (field->file->time_counter != CFile::time_counter_attr::none) 2364 CTimer::get("Files : writing data").suspend(); 2365 2366 if (wtime) 2367 { 2368 CTimer::get("Files : writing time axis").resume(); 2369 if ( wtimeData) 2286 2370 { 2287 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1, isRoot); 2288 if (field->file->time_counter != CFile::time_counter_attr::record) 2289 SuperClassWriter::writeTimeAxisData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2371 // SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 2372 // SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 2373 SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 2374 SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 2290 2375 } 2291 } 2376 if (wtimeCounter) 2377 { 2378 // SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 2379 // if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 2380 SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 2381 if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 2382 2383 } 2384 CTimer::get("Files : writing time axis").suspend(); 2385 } 2292 2386 2293 2387 break; … … 2313 2407 { 2314 2408 StdOStringStream oss; 2315 2409 bool createInstantAxis=false ; 2410 bool createCenteredAxis=false ; 2411 bool createTimeCounterAxis=false ; 2412 2316 2413 if (field->getOperationTimeType() == func::CFunctor::once) return ; 2317 2414 2318 // oss << "time_" << field->operation.getValue() 2319 // << "_" << field->getRelFile()->output_freq.getValue(); 2320 2321 // StdString axisid = oss.str(); 2322 // if (field->getOperationTimeType() == func::CFunctor::centered) axisid="time_centered" ; 2323 // else if (field->getOperationTimeType() == func::CFunctor::instant) axisid="time_instant" ; 2324 2325 StdString axisid("time_centered") ; 2326 StdString axisBoundId("time_centered_bounds"); 2415 2416 StdString axisId ; 2417 StdString axisBoundId; 2327 2418 StdString timeid(getTimeCounterName()); 2328 2419 StdString timeBoundId("axis_nbounds"); 2329 2420 2330 if (field->getOperationTimeType() == func::CFunctor::instant) 2331 { 2332 axisid = "time_instant"; 2333 axisBoundId = "time_instant_bounds"; 2334 } 2335 2421 StdString strTimeUnits ; 2422 if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) strTimeUnits="days since " ; 2423 else strTimeUnits="seconds since " ; 2424 2425 if (field->getOperationTimeType() == func::CFunctor::instant) field->hasTimeInstant = true; 2426 if (field->getOperationTimeType() == func::CFunctor::centered) field->hasTimeCentered = true; 2427 2428 2429 if (field->file->time_counter.isEmpty()) 2430 { 2431 if (timeCounterType==none) createTimeCounterAxis=true ; 2432 if (field->hasTimeCentered) 2433 { 2434 timeCounterType=centered ; 2435 if (!hasTimeCentered) createCenteredAxis=true ; 2436 } 2437 if (field->hasTimeInstant) 2438 { 2439 if (timeCounterType==none) timeCounterType=instant ; 2440 if (!hasTimeInstant) createInstantAxis=true ; 2441 } 2442 } 2443 else if (field->file->time_counter==CFile::time_counter_attr::instant) 2444 { 2445 if (field->hasTimeCentered) 2446 { 2447 if (!hasTimeCentered) createCenteredAxis=true ; 2448 } 2449 if (field->hasTimeInstant) 2450 { 2451 if (timeCounterType==none) createTimeCounterAxis=true ; 2452 timeCounterType=instant ; 2453 if (!hasTimeInstant) createInstantAxis=true ; 2454 } 2455 } 2456 else if (field->file->time_counter==CFile::time_counter_attr::centered) 2457 { 2458 if (field->hasTimeCentered) 2459 { 2460 if (timeCounterType==none) createTimeCounterAxis=true ; 2461 timeCounterType=centered ; 2462 if (!hasTimeCentered) createCenteredAxis=true ; 2463 } 2464 if (field->hasTimeInstant) 2465 { 2466 if (!hasTimeInstant) createInstantAxis=true ; 2467 } 2468 } 2469 else if (field->file->time_counter==CFile::time_counter_attr::instant_exclusive) 2470 { 2471 if (field->hasTimeCentered) 2472 { 2473 if (!hasTimeCentered) createCenteredAxis=true ; 2474 } 2475 if (field->hasTimeInstant) 2476 { 2477 if (timeCounterType==none) createTimeCounterAxis=true ; 2478 timeCounterType=instant ; 2479 } 2480 } 2481 else if (field->file->time_counter==CFile::time_counter_attr::centered_exclusive) 2482 { 2483 if (field->hasTimeCentered) 2484 { 2485 if (timeCounterType==none) createTimeCounterAxis=true ; 2486 timeCounterType=centered ; 2487 } 2488 if (field->hasTimeInstant) 2489 { 2490 if (!hasTimeInstant) createInstantAxis=true ; 2491 } 2492 } 2493 else if (field->file->time_counter==CFile::time_counter_attr::exclusive) 2494 { 2495 if (field->hasTimeCentered) 2496 { 2497 if (timeCounterType==none) createTimeCounterAxis=true ; 2498 if (timeCounterType==instant) createInstantAxis=true ; 2499 timeCounterType=centered ; 2500 } 2501 if (field->hasTimeInstant) 2502 { 2503 if (timeCounterType==none) 2504 { 2505 createTimeCounterAxis=true ; 2506 timeCounterType=instant ; 2507 } 2508 if (timeCounterType==centered) 2509 { 2510 if (!hasTimeInstant) createInstantAxis=true ; 2511 } 2512 } 2513 } 2514 else if (field->file->time_counter==CFile::time_counter_attr::none) 2515 { 2516 if (field->hasTimeCentered) 2517 { 2518 if (!hasTimeCentered) createCenteredAxis=true ; 2519 } 2520 if (field->hasTimeInstant) 2521 { 2522 if (!hasTimeInstant) createInstantAxis=true ; 2523 } 2524 } 2525 else if (field->file->time_counter==CFile::time_counter_attr::record) 2526 { 2527 if (timeCounterType==none) createTimeCounterAxis=true ; 2528 timeCounterType=record ; 2529 if (field->hasTimeCentered) 2530 { 2531 if (!hasTimeCentered) createCenteredAxis=true ; 2532 } 2533 if (field->hasTimeInstant) 2534 { 2535 if (!hasTimeInstant) createInstantAxis=true ; 2536 } 2537 } 2538 2539 if (createInstantAxis) 2540 { 2541 axisId="time_instant" ; 2542 axisBoundId="time_instant_bounds"; 2543 hasTimeInstant=true ; 2544 } 2545 2546 if (createCenteredAxis) 2547 { 2548 axisId="time_centered" ; 2549 axisBoundId="time_centered_bounds"; 2550 hasTimeCentered=true ; 2551 } 2552 2553 2336 2554 try 2337 2555 { 2338 // Adding time_instant or time_centered 2339 std::vector<StdString> dims; 2340 dims.push_back(timeid); 2341 if (!SuperClassWriter::varExist(axisid)) 2342 { 2343 SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims); 2344 2345 CDate timeOrigin=cal->getTimeOrigin() ; 2346 StdOStringStream oss2; 2347 // oss2<<initDate.getYear()<<"-"<<initDate.getMonth()<<"-"<<initDate.getDay()<<" " 2348 // <<initDate.getHour()<<"-"<<initDate.getMinute()<<"-"<<initDate.getSecond() ; 2349 StdString strInitdate=oss2.str() ; 2350 StdString strTimeOrigin=timeOrigin.toString() ; 2351 this->writeTimeAxisAttributes 2352 (axisid, cal->getType(), 2353 StdString("seconds since ").append(strTimeOrigin), 2354 strTimeOrigin, axisBoundId); 2355 } 2356 2357 // Adding time_instant_bounds or time_centered_bounds variables 2358 if (!SuperClassWriter::varExist(axisBoundId)) 2359 { 2360 dims.clear() ; 2556 std::vector<StdString> dims; 2557 2558 if (createInstantAxis || createCenteredAxis) 2559 { 2560 // Adding time_instant or time_centered 2361 2561 dims.push_back(timeid); 2362 dims.push_back(timeBoundId); 2363 SuperClassWriter::addVariable(axisBoundId, NC_DOUBLE, dims); 2364 } 2365 2366 if (field->file->time_counter != CFile::time_counter_attr::none) 2562 if (!SuperClassWriter::varExist(axisId)) 2563 { 2564 SuperClassWriter::addVariable(axisId, NC_DOUBLE, dims); 2565 2566 CDate timeOrigin=cal->getTimeOrigin() ; 2567 StdOStringStream oss2; 2568 StdString strInitdate=oss2.str() ; 2569 StdString strTimeOrigin=timeOrigin.toString() ; 2570 this->writeTimeAxisAttributes(axisId, cal->getType(),strTimeUnits+strTimeOrigin, 2571 strTimeOrigin, axisBoundId); 2572 } 2573 2574 // Adding time_instant_bounds or time_centered_bounds variables 2575 if (!SuperClassWriter::varExist(axisBoundId)) 2576 { 2577 dims.clear() ; 2578 dims.push_back(timeid); 2579 dims.push_back(timeBoundId); 2580 SuperClassWriter::addVariable(axisBoundId, NC_DOUBLE, dims); 2581 } 2582 } 2583 2584 if (createTimeCounterAxis) 2367 2585 { 2368 2586 // Adding time_counter 2369 axis id = getTimeCounterName();2587 axisId = getTimeCounterName(); 2370 2588 axisBoundId = getTimeCounterName() + "_bounds"; 2371 2589 dims.clear(); 2372 2590 dims.push_back(timeid); 2373 if (!SuperClassWriter::varExist(axis id))2591 if (!SuperClassWriter::varExist(axisId)) 2374 2592 { 2375 SuperClassWriter::addVariable(axisid, NC_DOUBLE, dims); 2376 SuperClassWriter::addAttribute("axis", string("T"), &axisid); 2377 2378 if (field->file->time_counter != CFile::time_counter_attr::record) 2593 SuperClassWriter::addVariable(axisId, NC_DOUBLE, dims); 2594 SuperClassWriter::addAttribute("axis", string("T"), &axisId); 2595 2596 if (field->file->time_counter.isEmpty() || 2597 (field->file->time_counter != CFile::time_counter_attr::record)) 2379 2598 { 2380 2599 CDate timeOrigin = cal->getTimeOrigin(); 2381 2600 StdString strTimeOrigin = timeOrigin.toString(); 2382 2601 2383 this->writeTimeAxisAttributes(axis id, cal->getType(),2384 StdString("seconds since ").append(strTimeOrigin),2602 this->writeTimeAxisAttributes(axisId, cal->getType(), 2603 strTimeUnits+strTimeOrigin, 2385 2604 strTimeOrigin, axisBoundId); 2386 2605 } … … 2388 2607 2389 2608 // Adding time_counter_bound dimension 2390 if (field->file->time_counter != CFile::time_counter_attr::record)2609 if (field->file->time_counter.isEmpty() || (field->file->time_counter != CFile::time_counter_attr::record)) 2391 2610 { 2392 2611 if (!SuperClassWriter::varExist(axisBoundId)) … … 2563 2782 SuperClassWriter::addAttribute("title" , description); 2564 2783 SuperClassWriter::addAttribute("Conventions", conventions); 2565 SuperClassWriter::addAttribute("production" , production); 2566 SuperClassWriter::addAttribute("timeStamp" , timeStamp); 2784 // SuperClassWriter::addAttribute("production" , production); 2785 2786 StdString timeStampStr ; 2787 if (file->time_stamp_name.isEmpty()) timeStampStr="timeStamp" ; 2788 else timeStampStr=file->time_stamp_name ; 2789 SuperClassWriter::addAttribute(timeStampStr, timeStamp); 2790 2791 StdString uuidName ; 2792 if (file->uuid_name.isEmpty()) uuidName="uuid" ; 2793 else uuidName=file->uuid_name ; 2794 2795 if (file->uuid_format.isEmpty()) SuperClassWriter::addAttribute(uuidName, getUuidStr()); 2796 else SuperClassWriter::addAttribute(uuidName, getUuidStr(file->uuid_format)); 2797 2567 2798 } 2568 2799 catch (CNetCdfException& e) … … 2616 2847 ///-------------------------------------------------------------- 2617 2848 2618 StdSize CNc4DataOutput::getRecordFromTime(Time time )2849 StdSize CNc4DataOutput::getRecordFromTime(Time time, double factorUnit) 2619 2850 { 2620 2851 std::map<Time, StdSize>::const_iterator it = timeToRecordCache.find(time); … … 2622 2853 { 2623 2854 StdString timeAxisBoundsId(getTimeCounterName() + "_bounds"); 2624 if (!SuperClassWriter::varExist(timeAxisBoundsId)) 2625 2855 if (!SuperClassWriter::varExist(timeAxisBoundsId)) timeAxisBoundsId = "time_centered_bounds"; 2856 if (!SuperClassWriter::varExist(timeAxisBoundsId)) timeAxisBoundsId = "time_instant_bounds"; 2626 2857 2627 2858 CArray<double,2> timeAxisBounds; 2628 SuperClassWriter::getTimeAxisBounds(timeAxisBounds, timeAxisBoundsId, isCollective);2629 2859 std::vector<StdSize> dimSize(SuperClassWriter::getDimensions(timeAxisBoundsId)) ; 2860 2630 2861 StdSize record = 0; 2631 2862 double dtime(time); 2632 for (int n = timeAxisBounds.extent(1)- 1; n >= 0; n--)2863 for (int n = dimSize[0] - 1; n >= 0; n--) 2633 2864 { 2634 if (timeAxisBounds(1, n) < dtime) 2865 SuperClassWriter::getTimeAxisBounds(timeAxisBounds, timeAxisBoundsId, isCollective, n); 2866 timeAxisBounds*=factorUnit ; 2867 if (timeAxisBounds(1, 0) < dtime) 2635 2868 { 2636 2869 record = n + 1; -
XIOS/dev/dev_olga/src/io/nc4_data_output.hpp
r887 r1158 23 23 /// Constructeurs /// 24 24 CNc4DataOutput 25 ( const StdString & filename, bool exist);25 (CFile* file, const StdString & filename, bool exist); 26 26 CNc4DataOutput 27 ( const StdString & filename, bool exist, bool useClassicFormat,27 (CFile* file, const StdString & filename, bool exist, bool useClassicFormat, 28 28 bool useCFConvention, 29 29 MPI_Comm comm_file, bool multifile, bool isCollective = true, … … 96 96 const StdString & nav_model); 97 97 98 StdSize getRecordFromTime(Time time );98 StdSize getRecordFromTime(Time time, double factorUnit); 99 99 100 100 private : … … 123 123 std::set<std::string> writtenAxis, writtenCompressedAxis; 124 124 std::set<std::string> writtenScalar; 125 126 enum { none, centered, instant, record} timeCounterType ; 127 bool hasTimeInstant ; 128 bool hasTimeCentered ; 125 129 }; // class CNc4DataOutput 126 130 -
XIOS/dev/dev_olga/src/io/netCdfInterface.cpp
r972 r1158 967 967 } 968 968 969 template<> 970 int CNetCdfInterface::ncGetVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, char* data) 971 { 972 return nc_get_vara_text(ncid, varid, start, count, data); 973 } 974 969 975 // Some specializations of putVariableType 970 976 template<> … … 984 990 { 985 991 return nc_put_vara_int(ncid, varid, start, count, data); 992 } 993 994 template<> 995 int CNetCdfInterface::ncPutVaraType(int ncid, int varid, const StdSize* start, const StdSize* count, const char* data) 996 { 997 return nc_put_vara_text(ncid, varid, start, count, data); 986 998 } 987 999 -
XIOS/dev/dev_olga/src/io/netCdfInterface_decl.cpp
r686 r1158 33 33 macroPutVar(float) 34 34 macroPutVar(int) 35 35 macroPutVar(char) 36 36 37 #define macroType(type, ncType) \ 37 38 template<> nc_type CNetCdfInterface::getNcType<type>() { return ncType; } -
XIOS/dev/dev_olga/src/io/netCdfInterface_impl.hpp
r1030 r1158 121 121 inqVarName(ncid, varId, varName); 122 122 sstr << "Unable to write data given the location id: " << ncid << " and the variable whose id: " << varId << " and name: " << varName << std::endl; 123 // if (status == NC_ENOTVAR )124 // sstr << "Variable not found. "<< std::endl;125 // else if (status == NC_EINVALCOORDS)126 // sstr << "Index exceeds dimension bound. "<< std::endl;127 // else if (status == NC_EEDGE)128 // sstr << " Start+count exceeds dimension bound. "<< std::endl;129 // else if (status == NC_ERANGE)130 // sstr << " One or more of the values are out of range. "<< std::endl;131 // else if (status == NC_EINDEFINE)132 // sstr << " Operation not allowed in define mode. "<< std::endl;133 // else if (status == NC_EBADID)134 // sstr << "Bad ncid. "<< std::endl;135 123 throw CNetCdfException(sstr.str()); 136 124 } -
XIOS/dev/dev_olga/src/io/onetcdf4.cpp
r878 r1158 7 7 #include "netCdfInterface.hpp" 8 8 #include "netCdfException.hpp" 9 #include "timer.hpp" 9 10 10 11 namespace xios … … 55 56 if (!append || !std::ifstream(filename.c_str())) 56 57 { 58 CTimer::get("Files : create").resume(); 57 59 if (wmpi) 58 60 CNetCdfInterface::createPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 59 61 else 60 62 CNetCdfInterface::create(filename, mode, this->ncidp); 61 63 CTimer::get("Files : create").suspend(); 64 62 65 this->appendMode = false; 63 66 } … … 65 68 { 66 69 mode |= NC_WRITE; 70 CTimer::get("Files : open").resume(); 67 71 if (wmpi) 68 72 CNetCdfInterface::openPar(filename, mode, *comm, MPI_INFO_NULL, this->ncidp); 69 73 else 70 74 CNetCdfInterface::open(filename, mode, this->ncidp); 71 75 CTimer::get("Files : open").suspend(); 72 76 this->appendMode = true; 73 77 } … … 83 87 void CONetCDF4::close() 84 88 { 89 CTimer::get("Files : close").resume(); 85 90 CNetCdfInterface::close(this->ncidp); 91 CTimer::get("Files : close").suspend(); 86 92 } 87 93 … … 247 253 } 248 254 249 //--------------------------------------------------------------- 255 void CONetCDF4::getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective, size_t record) 256 { 257 int grpid = this->getCurrentGroup(); 258 int varid = this->getVariable(name); 259 260 std::vector<StdSize> start(2), count(2); 261 start[0] = record; 262 count[0] = 1 ; 263 start[1] = 0; 264 count[1] = 2; 265 266 timeAxisBounds.resize(2, 1); 267 268 if (this->wmpi && collective) 269 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 270 if (this->wmpi && !collective) 271 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 272 273 CNetCdfInterface::getVaraType(grpid, varid, &start[0], &count[0], timeAxisBounds.dataFirst()); 274 } 275 276 250 277 251 278 const CONetCDF4::CONetCDF4Path& CONetCDF4::getCurrentPath(void) const … … 503 530 void CONetCDF4::writeData_(int grpid, int varid, 504 531 const std::vector<StdSize>& sstart, 532 const std::vector<StdSize>& scount, char* data) 533 { 534 CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data); 535 } 536 537 template <> 538 void CONetCDF4::writeData_(int grpid, int varid, 539 const std::vector<StdSize>& sstart, 505 540 const std::vector<StdSize>& scount, const int* data) 506 541 { 507 542 CNetCdfInterface::putVaraType(grpid, varid, &sstart[0], &scount[0], data); 508 543 } 509 510 544 //--------------------------------------------------------------- 511 545 … … 528 562 529 563 this->getWriteDataInfos(name, 0, array_size, sstart, scount, NULL, NULL); 564 530 565 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 566 531 567 } 532 568 … … 554 590 555 591 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 556 if (using_netcdf_internal)557 {558 if (!isRoot)559 {560 sstart[0] = sstart[0] + 1;561 scount[0] = 0;562 }563 }564 592 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 565 593 } 566 594 595 void CONetCDF4::writeTimeAxisDataBounds(const CArray<double, 1>& data, const StdString& name, 596 bool collective, StdSize record, bool isRoot) 597 { 598 int grpid = this->getCurrentGroup(); 599 int varid = this->getVariable(name); 600 601 map<int,size_t>::iterator it=timeAxis.find(varid); 602 if (it == timeAxis.end()) timeAxis[varid] = record; 603 else 604 { 605 if (it->second >= record) return; 606 else it->second =record; 607 } 608 609 StdSize array_size = 1; 610 std::vector<StdSize> sstart, scount; 611 612 if (this->wmpi && collective) 613 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 614 if (this->wmpi && !collective) 615 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 616 617 this->getWriteDataInfos(name, record, array_size, sstart, scount, NULL, NULL); 618 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 619 } 620 621 567 622 //--------------------------------------------------------------- 568 623 -
XIOS/dev/dev_olga/src/io/onetcdf4.hpp
r878 r1158 71 71 void writeTimeAxisData(const CArray<double,1>& data, const StdString& name, 72 72 bool collective, StdSize record, bool Isroot); 73 void writeTimeAxisDataBounds(const CArray<double,1>& data, const StdString& name, 74 bool collective, StdSize record, bool Isroot); 73 75 /// Accesseur /// 74 76 const CONetCDF4Path& getCurrentPath(void) const; … … 97 99 const StdString& getTimeCounterName(void) const { return timeCounterName; }; 98 100 99 void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective); 101 void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective ); 102 void getTimeAxisBounds(CArray<double,2>& timeAxisBounds, const StdString& name, bool collective, size_t record); 100 103 101 104 bool varExist(const StdString& varname); -
XIOS/dev/dev_olga/src/io/onetcdf4_decl.cpp
r924 r1158 14 14 macro(double, 2) 15 15 macro(double, 3) 16 macro(StdString, 1) 16 17 17 18 template void CONetCDF4::setDefaultValue<double>(const StdString & varname, const double* value) ; -
XIOS/dev/dev_olga/src/io/onetcdf4_impl.hpp
r685 r1158 4 4 #include "onetcdf4.hpp" 5 5 #include "netCdfInterface.hpp" 6 #include "timer.hpp" 6 7 7 8 namespace xios … … 23 24 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 24 25 26 CTimer::get("Files : get data infos").resume(); 25 27 this->getWriteDataInfos 26 28 (name, record, array_size, sstart, scount, start, count); 29 CTimer::get("Files : get data infos").suspend(); 30 27 31 if (data.numElements() != array_size) 28 32 { … … 34 38 35 39 this->writeData_(grpid, varid, sstart, scount, data.dataFirst()); 40 } 41 42 template <> 43 void CONetCDF4::writeData(const CArray<StdString, 1>& data, const StdString & name, 44 bool collective, StdSize record, 45 const std::vector<StdSize> * start, 46 const std::vector<StdSize> * count) 47 { 48 int grpid = this->getCurrentGroup(); 49 int varid = this->getVariable(name); 50 StdSize array_size = 1; 51 std::vector<StdSize> sstart, scount; 52 53 if (this->wmpi && collective) 54 CNetCdfInterface::varParAccess(grpid, varid, NC_COLLECTIVE); 55 if (this->wmpi && !collective) 56 CNetCdfInterface::varParAccess(grpid, varid, NC_INDEPENDENT); 57 58 CTimer::get("CONetCDF4::writeData getWriteDataInfos").resume(); 59 this->getWriteDataInfos(name, record, array_size, sstart, scount, start, count); 60 CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 61 62 if (data.numElements()*stringArrayLen != array_size) 63 { 64 ERROR("CONetCDF4::writeData(...)", 65 << "[ input array size = " << data.numElements() 66 << ", intern array size = " << array_size 67 << " ] Invalid input data !" ); 68 } 69 char* ArrayStr ; 70 char *PtrArrayStr ; 71 PtrArrayStr=ArrayStr=new char[data.numElements()*stringArrayLen] ; 72 Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 73 for(it=itb;it!=ite;++it,PtrArrayStr+=stringArrayLen) 74 { 75 it->copy(PtrArrayStr,it->size()) ; 76 PtrArrayStr[it->size()]='\0' ; 77 } 78 CTimer::get("CONetCDF4::writeData writeData_").resume(); 79 this->writeData_(grpid, varid, sstart, scount, ArrayStr); 80 CTimer::get("CONetCDF4::writeData writeData_").suspend(); 81 delete [] ArrayStr ; 36 82 } 37 83 -
XIOS/dev/dev_olga/src/memtrack.cpp
r501 r1158 52 52 { 53 53 void addr2line(const char *file_name, char** addr, int naddr) ; 54 #ifdef XIOS_MEMTRACK_LIGHT 55 void addr2line(const char *file_name, char** addr, int naddr) {} 56 #endif 54 57 } 55 58 /* ------------------------------------------------------------ */ … … 59 62 namespace MemTrack 60 63 { 64 size_t currentMemorySize=0 ; 65 size_t maxMemorySize=0 ; 66 67 size_t getCurrentMemorySize(void) {return currentMemorySize; } 68 size_t getMaxMemorySize(void) {return maxMemorySize ; } 61 69 62 70 /* ------------------------------------------------------------ */ … … 375 383 // Get the offset to the user chunk and return it. 376 384 UserChunk *pUser = GetUserAddress(pProlog); 385 386 currentMemorySize += size ; 387 if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ; 377 388 378 389 return pUser; … … 400 411 // Unlink the block header from the list and destroy it. 401 412 BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 413 currentMemorySize-=pBlockHeader->GetRequestedSize(); 402 414 BlockHeader::RemoveNode(pBlockHeader); 403 415 pBlockHeader->~BlockHeader(); -
XIOS/dev/dev_olga/src/memtrack.hpp
r501 r1158 61 61 void TrackDumpBlocks(); 62 62 void TrackListMemoryUsage(); 63 63 size_t getCurrentMemorySize(void) ; 64 size_t getMaxMemorySize(void) ; 64 65 /* ---------------------------------------- operator * (MemStamp, ptr) */ 65 66 -
XIOS/dev/dev_olga/src/node/axis.cpp
r1144 r1158 27 27 , hasBounds_(false), isCompressible_(false) 28 28 , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 29 , transformationMap_(), hasValue(false), doZoomByIndex_(false) 29 , transformationMap_(), hasValue(false), doZoomByIndex_(false), hasLabel(false) 30 30 , computedWrittenIndex_(false) 31 31 { … … 38 38 , hasBounds_(false), isCompressible_(false) 39 39 , numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 40 , transformationMap_(), hasValue(false), doZoomByIndex_(false) 40 , transformationMap_(), hasValue(false), doZoomByIndex_(false), hasLabel(false) 41 41 , computedWrittenIndex_(false) 42 42 { … … 58 58 59 59 ///--------------------------------------------------------------- 60 61 const std::set<StdString> & CAxis::getRelFiles(void) const 62 { 63 return (this->relFiles); 64 } 65 60 66 bool CAxis::IsWritten(const StdString & filename) const 61 67 { … … 70 76 bool CAxis::isDistributed(void) const 71 77 { 72 return (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 73 (!this->n.isEmpty() && (this->n != this->n_glo));; 78 bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 79 (!this->n.isEmpty() && (this->n != this->n_glo)); 80 // A same stupid condition to make sure that if there is only one client, axis 81 // should be considered to be distributed. This should be a temporary solution 82 distributed |= (1 == CContext::getCurrent()->client->clientSize); 83 return distributed; 74 84 } 75 85 … … 132 142 std::map<int, StdSize> CAxis::getAttributesBufferSize() 133 143 { 134 // CContextClient* client = CContext::getCurrent()->client;135 144 // For now the assumption is that secondary server pools consist of the same number of procs. 136 145 // CHANGE the line below if the assumption changes. … … 172 181 if (hasBounds_) 173 182 sizeValEvent += CArray<double,2>::size(2 * it->second.size()); 183 184 if (hasLabel) 185 sizeValEvent += CArray<StdString,1>::size(it->second.size()); 174 186 175 187 size_t size = CEventClient::headerSize + getId().size() + sizeof(size_t) + std::max(sizeIndexEvent, sizeValEvent); … … 255 267 this->checkZoom(); 256 268 this->checkMask(); 257 this->checkBounds(); 269 this->checkBounds(); 270 this->checkLabel(); 258 271 } 259 272 … … 339 352 } 340 353 341 void CAxis::checkEligibilityForCompressedOutput() 342 { 343 // We don't check if the mask is valid here, just if a mask has been defined at this point. 344 isCompressible_ = !mask.isEmpty(); 345 } 354 void CAxis::checkLabel() 355 { 356 if (!label.isEmpty()) 357 { 358 if (label.extent(0) != n) 359 ERROR("CAxis::checkLabel(void)", 360 << "The label array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension of axis size." << std::endl 361 << "Axis size is " << n.getValue() << "." << std::endl 362 << "label size is "<< label.extent(0)<< " ."); 363 hasLabel = true; 364 } 365 else hasLabel = false; 366 } 367 void CAxis::checkEligibilityForCompressedOutput() 368 { 369 // We don't check if the mask is valid here, just if a mask has been defined at this point. 370 isCompressible_ = !mask.isEmpty(); 371 } 346 372 347 373 bool CAxis::dispatchEvent(CEventServer& event) … … 437 463 CContext* context = CContext::getCurrent(); 438 464 439 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;440 465 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 441 466 for (int p = 0; p < nbSrvPools; ++p) … … 729 754 CContext* context = CContext::getCurrent(); 730 755 731 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;732 756 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; 733 757 for (int p = 0; p < nbSrvPools; ++p) … … 1071 1095 } 1072 1096 } 1097 1098 if (hasLabel) 1099 { 1100 //label_srv(ind_srv) = labelVal( ind); 1101 } 1073 1102 } 1074 1103 … … 1114 1143 } 1115 1144 1145 /*! 1146 Compare two axis objects. 1147 They are equal if only if they have identical attributes as well as their values. 1148 Moreover, they must have the same transformations. 1149 \param [in] axis Compared axis 1150 \return result of the comparison 1151 */ 1152 bool CAxis::isEqual(CAxis* obj) 1153 { 1154 vector<StdString> excludedAttr; 1155 excludedAttr.push_back("axis_ref"); 1156 1157 bool objEqual = SuperClass::isEqual(obj, excludedAttr); 1158 if (!objEqual) return objEqual; 1159 1160 TransMapTypes thisTrans = this->getAllTransformations(); 1161 TransMapTypes objTrans = obj->getAllTransformations(); 1162 1163 TransMapTypes::const_iterator it, itb, ite; 1164 std::vector<ETranformationType> thisTransType, objTransType; 1165 for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 1166 thisTransType.push_back(it->first); 1167 for (it = objTrans.begin(); it != objTrans.end(); ++it) 1168 objTransType.push_back(it->first); 1169 1170 if (thisTransType.size() != objTransType.size()) return false; 1171 for (int idx = 0; idx < thisTransType.size(); ++idx) 1172 objEqual &= (thisTransType[idx] == objTransType[idx]); 1173 1174 return objEqual; 1175 } 1116 1176 1117 1177 CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) -
XIOS/dev/dev_olga/src/node/axis.hpp
r1144 r1158 68 68 69 69 static CAxis* createAxis(); 70 70 71 /// Accesseurs /// 72 const std::set<StdString> & getRelFiles(void) const; 73 71 74 int getNumberWrittenIndexes() const; 72 75 int getTotalNumberWrittenIndexes() const; … … 115 118 void duplicateTransformation(CAxis*); 116 119 CTransformation<CAxis>* addTransformation(ETranformationType transType, const StdString& id=""); 120 bool isEqual(CAxis* axis); 117 121 118 122 public: … … 121 125 CArray<double,1> value_srv; 122 126 CArray<double,2> bound_srv; 127 CArray<StdString,1> label_srv; 123 128 bool hasValue; 124 129 CArray<int,1> globalDimGrid; … … 131 136 void checkMask(); 132 137 void checkZoom(); 133 void checkBounds(); 138 void checkBounds(); 139 void checkLabel(); 134 140 void sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 135 141 CServerDistributionDescription::ServerDistributionType distType); … … 166 172 std::map<int, CArray<int,1> > indiSrv_; 167 173 bool hasBounds_; 168 174 bool hasLabel; 169 175 bool doZoomByIndex_; 170 176 bool computedWrittenIndex_; -
XIOS/dev/dev_olga/src/node/calendar_wrapper.cpp
r983 r1158 83 83 { 84 84 // Create the calendar if possible 85 if ( 0 !=calendar)85 if (calendar) 86 86 { 87 87 ERROR("CCalendarWrapper::createCalendar(void)", -
XIOS/dev/dev_olga/src/node/context.cpp
r1144 r1158 14 14 #include "type.hpp" 15 15 #include "xios_spl.hpp" 16 #include "timer.hpp" 17 #include "memtrack.hpp" 16 18 17 19 #include "server.hpp" … … 372 374 comms.push_back(interCommClient); 373 375 } 374 client = new CContextClient(this,intraCommClient,interCommClient, cxtClient);376 client = new CContextClient(this,intraCommClient,interCommClient, cxtClient); 375 377 } 376 378 … … 615 617 void CContext::closeDefinition(void) 616 618 { 619 CTimer::get("Context : close definition").resume() ; 617 620 postProcessingGlobalAttributes(); 618 621 … … 640 643 if (!hasServer) startPrefetchingOfEnabledReadModeFiles(); 641 644 } 645 CTimer::get("Context : close definition").suspend() ; 642 646 } 643 647 … … 690 694 this->enabledFiles[i]->generateNewTransformationGridDest(); 691 695 } 692 693 696 } 694 697 … … 783 786 { 784 787 const std::vector<CFile*> allFiles = CFile::getAll(); 788 const CDate& initDate = calendar->getInitDate(); 785 789 786 790 for (unsigned int i = 0; i < allFiles.size(); i++) … … 788 792 { 789 793 if (allFiles[i]->enabled.getValue()) // Si l'attribut 'enabled' est fixé à vrai. 794 { 795 if ((initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 796 { 797 error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 798 << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 799 <<"\" is less than the time step. File will not be written."<<endl; 800 } 801 else 790 802 enabledFiles.push_back(allFiles[i]); 803 } 791 804 } 792 else enabledFiles.push_back(allFiles[i]); // otherwise true by default 793 805 else 806 { 807 if ( (initDate + allFiles[i]->output_freq.getValue()) < (initDate + this->getCalendar()->getTimeStep())) 808 { 809 error(0)<<"WARNING: void CContext::findEnabledFiles()"<<endl 810 << "Output frequency in file \""<<allFiles[i]->getFileOutputName() 811 <<"\" is less than the time step. File will not be written."<<endl; 812 } 813 else 814 enabledFiles.push_back(allFiles[i]); // otherwise true by default 815 } 794 816 795 817 if (enabledFiles.size() == 0) … … 1267 1289 StdString fileDefRoot("file_definition"); 1268 1290 CFileGroup* cfgrpPtr = CFileGroup::get(fileDefRoot); 1291 1269 1292 for (int i = 0; i < size; ++i) 1270 1293 { … … 1313 1336 CFile* file = allFiles[i]; 1314 1337 1338 std::vector<CVariable*> fileVars, fieldVars, vars = file->getAllVariables(); 1339 for (size_t k = 0; k < vars.size(); k++) 1340 { 1341 CVariable* var = vars[k]; 1342 1343 if (var->ts_target.isEmpty() 1344 || var->ts_target == CVariable::ts_target_attr::file || var->ts_target == CVariable::ts_target_attr::both) 1345 fileVars.push_back(var); 1346 1347 if (!var->ts_target.isEmpty() 1348 && (var->ts_target == CVariable::ts_target_attr::field || var->ts_target == CVariable::ts_target_attr::both)) 1349 fieldVars.push_back(var); 1350 } 1351 1315 1352 if (!file->timeseries.isEmpty() && file->timeseries != CFile::timeseries_attr::none) 1316 1353 { 1317 StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : file->getFileOutputName(); 1318 1354 StdString fileNameStr("%file_name%") ; 1355 StdString tsPrefix = !file->ts_prefix.isEmpty() ? file->ts_prefix : fileNameStr ; 1356 1357 StdString fileName=file->getFileOutputName(); 1358 size_t pos=tsPrefix.find(fileNameStr) ; 1359 while (pos!=std::string::npos) 1360 { 1361 tsPrefix=tsPrefix.replace(pos,fileNameStr.size(),fileName) ; 1362 pos=tsPrefix.find(fileNameStr) ; 1363 } 1364 1319 1365 const std::vector<CField*> allFields = file->getAllFields(); 1320 1366 for (size_t j = 0; j < allFields.size(); j++) … … 1326 1372 CFile* tsFile = CFile::create(); 1327 1373 tsFile->duplicateAttributes(file); 1328 tsFile->setVirtualVariableGroup(file->getVirtualVariableGroup()); 1329 1374 1375 // Add variables originating from file and targeted to timeserie file 1376 for (size_t k = 0; k < fileVars.size(); k++) 1377 tsFile->getVirtualVariableGroup()->addChild(fileVars[k]); 1378 1379 1330 1380 tsFile->name = tsPrefix + "_"; 1331 1381 if (!field->name.isEmpty()) … … 1341 1391 CField* tsField = tsFile->addField(); 1342 1392 tsField->field_ref = field->getId(); 1343 tsField->setVirtualVariableGroup(field->getVirtualVariableGroup()); 1393 1394 // Add variables originating from file and targeted to timeserie field 1395 for (size_t k = 0; k < fieldVars.size(); k++) 1396 tsField->getVirtualVariableGroup()->addChild(fieldVars[k]); 1397 1398 vars = field->getAllVariables(); 1399 for (size_t k = 0; k < vars.size(); k++) 1400 { 1401 CVariable* var = vars[k]; 1402 1403 // Add variables originating from field and targeted to timeserie field 1404 if (var->ts_target.isEmpty() 1405 || var->ts_target == CVariable::ts_target_attr::field || var->ts_target == CVariable::ts_target_attr::both) 1406 tsField->getVirtualVariableGroup()->addChild(var); 1407 1408 // Add variables originating from field and targeted to timeserie file 1409 if (!var->ts_target.isEmpty() 1410 && (var->ts_target == CVariable::ts_target_attr::file || var->ts_target == CVariable::ts_target_attr::both)) 1411 tsFile->getVirtualVariableGroup()->addChild(var); 1412 } 1344 1413 1345 1414 tsFile->solveFieldRefInheritance(true); … … 1456 1525 void CContext::updateCalendar(int step) 1457 1526 { 1458 info(50) << "Context "<< this->getId() <<"updateCalendar : before : " << calendar->getCurrentDate() << endl;1527 info(50) << "updateCalendar : before : " << calendar->getCurrentDate() << endl; 1459 1528 calendar->update(step); 1460 info(50) <<"Context "<< this->getId() << " updateCalendar : after : " << calendar->getCurrentDate() << endl; 1461 1529 info(50) << "updateCalendar : after : " << calendar->getCurrentDate() << endl; 1530 #ifdef XIOS_MEMTRACK_LIGHT 1531 info(50) << " Current memory used by XIOS : "<< MemTrack::getCurrentMemorySize()*1.0/(1024*1024)<<" Mbyte, at timestep "<<step<<" of context "<<this->getId()<<endl ; 1532 #endif 1462 1533 if (hasClient) 1463 1534 { … … 1537 1608 1538 1609 void CContext::sendRegistry(void) 1539 { 1610 { 1540 1611 registryOut->hierarchicalGatherRegistry() ; 1541 1612 -
XIOS/dev/dev_olga/src/node/domain.cpp
r1144 r1158 26 26 namespace xios { 27 27 28 /// ////////////////////// D finitions ////////////////////// ///28 /// ////////////////////// Définitions ////////////////////// /// 29 29 30 30 CDomain::CDomain(void) … … 79 79 } 80 80 81 const std::set<StdString> & CDomain::getRelFiles(void) const 82 { 83 return (this->relFiles); 84 } 85 86 81 87 /*! 82 88 Returns the number of indexes written by each server. … … 170 176 { 171 177 return ((this->zoom_i_index.isEmpty()) || (0 == this->zoom_i_index.numElements())); 172 // return ((this->zoom_ni_srv == 0) || 173 // (this->zoom_nj_srv == 0)); 178 174 179 } 175 180 … … 190 195 bool CDomain::isDistributed(void) const 191 196 { 192 return!((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) ||197 bool distributed = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || 193 198 (!i_index.isEmpty() && i_index.numElements() == ni_glo*nj_glo)); 199 distributed |= (1 == CContext::getCurrent()->client->clientSize); 200 201 return distributed; 194 202 } 195 203 … … 221 229 222 230 //---------------------------------------------------------------- 231 232 /*! 233 Verify if all distribution information of a domain are available 234 This checking verifies the definition of distribution attributes (ni, nj, ibegin, jbegin) 235 */ 236 bool CDomain::distributionAttributesHaveValue() const 237 { 238 bool hasValues = true; 239 240 if (ni.isEmpty() && ibegin.isEmpty() && i_index.isEmpty()) 241 { 242 hasValues = false; 243 return hasValues; 244 } 245 246 return hasValues; 247 } 223 248 224 249 /*! … … 331 356 ni.setValue(ni_glo - ibeginVec[iIdx]); 332 357 } 333 } 334 335 // Now fill other attributes 336 if (type_attr::rectilinear == type) fillInRectilinearLonLat(); 358 } 337 359 } 338 360 else // unstructured domain … … 380 402 nj.setValue(1); 381 403 } 404 405 i_index.resize(ni); 406 for(int idx = 0; idx < ni; ++idx) i_index(idx)=ibegin+idx; 382 407 } 383 408 else … … 391 416 392 417 checkDomain(); 418 } 419 420 /*! 421 Fill in longitude and latitude whose values are read from file 422 */ 423 void CDomain::fillInLonLat() 424 { 425 switch (type) 426 { 427 case type_attr::rectilinear: 428 fillInRectilinearLonLat(); 429 break; 430 case type_attr::curvilinear: 431 fillInCurvilinearLonLat(); 432 break; 433 case type_attr::unstructured: 434 fillInUnstructuredLonLat(); 435 break; 436 437 default: 438 break; 439 } 440 393 441 } 394 442 … … 468 516 } 469 517 470 471 518 /* 519 Fill in longitude and latitude of curvilinear domain read from a file 520 If there are already longitude and latitude defined by model. We just igonore reading value. 521 */ 522 void CDomain::fillInCurvilinearLonLat() 523 { 524 if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty()) 525 { 526 lonvalue_2d.resize(ni,nj); 527 for (int jdx = 0; jdx < nj; ++jdx) 528 for (int idx = 0; idx < ni; ++idx) 529 lonvalue_2d(idx,jdx) = lonvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 530 531 lonvalue_curvilinear_read_from_file.free(); 532 } 533 534 if (!latvalue_curvilinear_read_from_file.isEmpty() && latvalue_2d.isEmpty()) 535 { 536 latvalue_2d.resize(ni,nj); 537 for (int jdx = 0; jdx < nj; ++jdx) 538 for (int idx = 0; idx < ni; ++idx) 539 latvalue_2d(idx,jdx) = latvalue_curvilinear_read_from_file(idx+ibegin, jdx+jbegin); 540 541 latvalue_curvilinear_read_from_file.free(); 542 } 543 544 if (!bounds_lonvalue_curvilinear_read_from_file.isEmpty() && bounds_lon_2d.isEmpty()) 545 { 546 bounds_lon_2d.resize(nvertex,ni,nj); 547 for (int jdx = 0; jdx < nj; ++jdx) 548 for (int idx = 0; idx < ni; ++idx) 549 for (int ndx = 0; ndx < nvertex; ++ndx) 550 bounds_lon_2d(ndx,idx,jdx) = bounds_lonvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 551 552 bounds_lonvalue_curvilinear_read_from_file.free(); 553 } 554 555 if (!bounds_latvalue_curvilinear_read_from_file.isEmpty() && bounds_lat_2d.isEmpty()) 556 { 557 bounds_lat_2d.resize(nvertex,ni,nj); 558 for (int jdx = 0; jdx < nj; ++jdx) 559 for (int idx = 0; idx < ni; ++idx) 560 for (int ndx = 0; ndx < nvertex; ++ndx) 561 bounds_lat_2d(ndx,idx,jdx) = bounds_latvalue_curvilinear_read_from_file(ndx,idx+ibegin, jdx+jbegin); 562 563 bounds_latvalue_curvilinear_read_from_file.free(); 564 } 565 566 } 567 568 /* 569 Fill in longitude and latitude of unstructured domain read from a file 570 If there are already longitude and latitude defined by model. We just igonore reading value. 571 */ 572 void CDomain::fillInUnstructuredLonLat() 573 { 574 if (i_index.isEmpty()) 575 { 576 i_index.resize(ni); 577 for(int idx = 0; idx < ni; ++idx) i_index(idx)=ibegin+idx; 578 } 579 580 if (!lonvalue_unstructured_read_from_file.isEmpty() && lonvalue_1d.isEmpty()) 581 { 582 lonvalue_1d.resize(ni); 583 for (int idx = 0; idx < ni; ++idx) 584 lonvalue_1d(idx) = lonvalue_unstructured_read_from_file(i_index(idx)); 585 586 // We dont need these values anymore, so just delete them 587 lonvalue_unstructured_read_from_file.free(); 588 } 589 590 if (!latvalue_unstructured_read_from_file.isEmpty() && latvalue_1d.isEmpty()) 591 { 592 latvalue_1d.resize(ni); 593 for (int idx = 0; idx < ni; ++idx) 594 latvalue_1d(idx) = latvalue_unstructured_read_from_file(i_index(idx)); 595 596 // We dont need these values anymore, so just delete them 597 latvalue_unstructured_read_from_file.free(); 598 } 599 600 if (!bounds_lonvalue_unstructured_read_from_file.isEmpty() && bounds_lon_1d.isEmpty()) 601 { 602 int nbVertex = nvertex; 603 bounds_lon_1d.resize(nbVertex,ni); 604 for (int idx = 0; idx < ni; ++idx) 605 for (int jdx = 0; jdx < nbVertex; ++jdx) 606 bounds_lon_1d(jdx,idx) = bounds_lonvalue_unstructured_read_from_file(jdx, i_index(idx)); 607 608 // We dont need these values anymore, so just delete them 609 lonvalue_unstructured_read_from_file.free(); 610 } 611 612 if (!bounds_latvalue_unstructured_read_from_file.isEmpty() && bounds_lat_1d.isEmpty()) 613 { 614 int nbVertex = nvertex; 615 bounds_lat_1d.resize(nbVertex,ni); 616 for (int idx = 0; idx < ni; ++idx) 617 for (int jdx = 0; jdx < nbVertex; ++jdx) 618 bounds_lat_1d(jdx,idx) = bounds_latvalue_unstructured_read_from_file(jdx, i_index(idx)); 619 620 // We dont need these values anymore, so just delete them 621 lonvalue_unstructured_read_from_file.free(); 622 } 623 } 624 625 /* 626 Get global longitude and latitude of rectilinear domain. 627 */ 472 628 void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 473 629 { … … 590 746 else 591 747 { 592 if (bounds_lat_start.isEmpty()) bounds_l on_start=-90. ;748 if (bounds_lat_start.isEmpty()) bounds_lat_start=-90. ; 593 749 if (bounds_lat_end.isEmpty()) bounds_lat_end=90 ; 594 750 } … … 695 851 for (int j = 0; j < nj; ++j) 696 852 for (int i = 0; i < ni; ++i) j_index(i+j*ni) = j+jbegin; 697 } 853 } 854 698 855 checkZoom(); 699 856 } … … 1431 1588 if (context->hasClient) 1432 1589 { 1433 // this->checkMask();1434 1590 this->computeConnectedClients(); 1435 // if (hasLonLat || hasArea || isCompressible_) this->computeConnectedClients();1436 1591 if (hasLonLat) 1437 1592 if (!context->hasServer) … … 1482 1637 if (context->hasClient) 1483 1638 { 1484 // this->completeLonLatClient();1485 1639 sendAttributes(); 1486 1640 } … … 2694 2848 } 2695 2849 2696 2697 2850 /*! 2698 2851 Receive area information from client(s) … … 2742 2895 2743 2896 } 2897 } 2898 2899 /*! 2900 Compare two domain objects. 2901 They are equal if only if they have identical attributes as well as their values. 2902 Moreover, they must have the same transformations. 2903 \param [in] domain Compared domain 2904 \return result of the comparison 2905 */ 2906 bool CDomain::isEqual(CDomain* obj) 2907 { 2908 vector<StdString> excludedAttr; 2909 excludedAttr.push_back("domain_ref"); 2910 bool objEqual = SuperClass::isEqual(obj, excludedAttr); 2911 if (!objEqual) return objEqual; 2912 2913 TransMapTypes thisTrans = this->getAllTransformations(); 2914 TransMapTypes objTrans = obj->getAllTransformations(); 2915 2916 TransMapTypes::const_iterator it, itb, ite; 2917 std::vector<ETranformationType> thisTransType, objTransType; 2918 for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 2919 thisTransType.push_back(it->first); 2920 for (it = objTrans.begin(); it != objTrans.end(); ++it) 2921 objTransType.push_back(it->first); 2922 2923 if (thisTransType.size() != objTransType.size()) return false; 2924 for (int idx = 0; idx < thisTransType.size(); ++idx) 2925 objEqual &= (thisTransType[idx] == objTransType[idx]); 2926 2927 return objEqual; 2744 2928 } 2745 2929 -
XIOS/dev/dev_olga/src/node/domain.hpp
r1144 r1158 42 42 , public CDomainAttributes 43 43 { 44 /// typedef /// 45 typedef CObjectTemplate<CDomain> SuperClass; 46 typedef CDomainAttributes SuperClassAttribute; 47 48 public : 44 /// typedef /// 45 typedef CObjectTemplate<CDomain> SuperClass; 46 typedef CDomainAttributes SuperClassAttribute; 47 public: 49 48 enum EEventId 50 49 { … … 91 90 CTransformation<CDomain>* addTransformation(ETranformationType transType, const StdString& id=""); 92 91 93 public: 92 public: 93 const std::set<StdString> & getRelFiles(void) const; 94 94 bool IsWritten(const StdString & filename) const; 95 95 bool isWrittenCompressed(const StdString& filename) const; … … 116 116 vector< vector<int> > i_indSrv ; // for each server, i global index to send 117 117 vector< vector<int> > j_indSrv ; // for each server, j global index to send 118 118 std::vector<int> getNbGlob(); 119 bool isEqual(CDomain* domain); 119 120 public: 120 121 /// Mutateur /// … … 130 131 void fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 131 132 CArray<double,2>& boundsLon, CArray<double,2>& boundsLat); 132 void fillInRectilinearLonLat(); 133 134 void fillInLonLat(); 135 bool distributionAttributesHaveValue() const; 133 136 134 137 static bool dispatchEvent(CEventServer& event); … … 157 160 static StdString GetName(void); 158 161 static StdString GetDefName(void); 159 static ENodeType GetType(void); 160 162 163 static ENodeType GetType(void); 164 const std::map<int, vector<size_t> >& getIndexServer() const; 161 165 CArray<bool, 1> localMask; 162 166 bool isCurvilinear ; … … 182 186 183 187 void setTransformations(const TransMapTypes&); 184 188 void computeNGlobDomain(); 185 189 void sendAttributes(); 186 190 void sendIndex(); … … 192 196 void sendDataIndex(); 193 197 void convertLonLatValue(); 194 198 void fillInRectilinearLonLat(); 199 void fillInCurvilinearLonLat(); 200 void fillInUnstructuredLonLat(); 195 201 private: 196 202 bool doZoomByIndex_; -
XIOS/dev/dev_olga/src/node/expand_domain.cpp
r941 r1158 38 38 void CExpandDomain::checkValid(CDomain* domainDst) 39 39 { 40 if (CDomain::type_attr::unstructured != domainDst->type)41 {42 ERROR("CExpandDomain::checkValid(CDomain* domainDst)",43 << "Domain extension is only supported for unstructured" << std::endl44 << "Check type of domain destination, id = " << domainDst->getId());45 }40 // if (CDomain::type_attr::unstructured != domainDst->type) 41 // { 42 // ERROR("CExpandDomain::checkValid(CDomain* domainDst)", 43 // << "Domain extension is only supported for unstructured" << std::endl 44 // << "Check type of domain destination, id = " << domainDst->getId()); 45 // } 46 46 47 47 if (this->type.isEmpty()) this->type.setValue(CExpandDomain::type_attr::edge); -
XIOS/dev/dev_olga/src/node/field.cpp
r1144 r1158 38 38 , areAllReferenceSolved(false), isReferenceSolved(false), isReferenceSolvedAndTransformed(false) 39 39 , useCompressedOutput(false) 40 , hasTimeInstant(false) 41 , hasTimeCentered(false) 40 42 , wasDataAlreadyReceivedFromServer(false) 43 , isEOF(false) 41 44 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 42 45 … … 50 53 , areAllReferenceSolved(false), isReferenceSolved(false), isReferenceSolvedAndTransformed(false) 51 54 , useCompressedOutput(false) 55 , hasTimeInstant(false) 56 , hasTimeCentered(false) 52 57 , wasDataAlreadyReceivedFromServer(false) 58 , isEOF(false) 53 59 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 54 60 … … 122 128 void CField::sendUpdateData(const CArray<double,1>& data) 123 129 { 124 CTimer::get(" XIOS Send Data").resume();130 CTimer::get("Field : send data").resume(); 125 131 126 132 CContext* context = CContext::getCurrent(); … … 174 180 } 175 181 176 CTimer::get(" XIOS Send Data").suspend();182 CTimer::get("Field : send data").suspend(); 177 183 } 178 184 … … 183 189 list<CEventServer::SSubEvent>::iterator it; 184 190 string fieldId; 185 191 CTimer::get("Field : recv data").resume(); 186 192 for (it = event.subEvents.begin(); it != event.subEvents.end(); ++it) 187 193 { … … 192 198 } 193 199 get(fieldId)->recvUpdateData(rankBuffers); 200 CTimer::get("Field : recv data").suspend(); 194 201 } 195 202 … … 252 259 } 253 260 } 254 255 // void CField::recvUpdateData(vector<int>& ranks, vector<CBufferIn*>& buffers)256 // {257 // CContext* context = CContext::getCurrent();258 259 // if (data_srv.empty())260 // {261 // for (map<int, CArray<size_t, 1> >::iterator it = grid->outIndexFromClient.begin(); it != grid->outIndexFromClient.end(); ++it)262 // {263 // int rank = it->first;264 // data_srv.insert(std::make_pair(rank, CArray<double,1>(it->second.numElements())));265 // foperation_srv.insert(pair<int,boost::shared_ptr<func::CFunctor> >(rank,boost::shared_ptr<func::CFunctor>(new func::CInstant(data_srv[rank]))));266 // }267 // }268 269 // const CDate& currDate = context->getCalendar()->getCurrentDate();270 // const CDate opeDate = last_operation_srv +freq_op + freq_operation_srv - freq_op;271 // const CDate writeDate = last_Write_srv + freq_write_srv;272 273 // if (opeDate <= currDate)274 // {275 // for (int n = 0; n < ranks.size(); n++)276 // {277 // CArray<double,1> data_tmp;278 // *buffers[n] >> data_tmp;279 // (*foperation_srv[ranks[n]])(data_tmp);280 // }281 // last_operation_srv = currDate;282 // }283 284 // if (writeDate < (currDate + freq_operation_srv))285 // {286 // for (int n = 0; n < ranks.size(); n++)287 // {288 // this->foperation_srv[ranks[n]]->final();289 // }290 291 // last_Write_srv = writeDate;292 // }293 294 // if (context->hasClient && context->hasServer)295 // {296 // size_t writtenSize;297 // // if (field->getUseCompressedOutput())298 // // writtenSize = grid->getNumberWrittenIndexes();299 // // else300 // writtenSize = grid->getWrittenDataSize();301 302 // CArray<double,1> fieldData(writtenSize);303 // // if (!field->default_value.isEmpty()) fieldData = field->default_value;304 305 // // if (field->getUseCompressedOutput())306 // // field->outputCompressedField(fieldData);307 // // else308 // this->outputField(fieldData);309 // sendUpdateData(fieldData);310 // }311 // if (!context->hasClient && context->hasServer)312 // {313 // writeField();314 // }315 316 // lastlast_Write_srv = last_Write_srv;317 318 // }319 261 320 262 void CField::writeField(void) … … 331 273 } 332 274 333 voidCField::sendReadDataRequest(const CDate& tsDataRequested)275 bool CField::sendReadDataRequest(const CDate& tsDataRequested) 334 276 { 335 277 CContext* context = CContext::getCurrent(); … … 339 281 lastDataRequestedFromServer = tsDataRequested; 340 282 341 CEventClient event(getType(), EVENT_ID_READ_DATA); 342 if (client->isServerLeader()) 283 if (!isEOF) // No need to send the request if we already know we are at EOF 343 284 { 344 CMessage msg; 345 msg << getId(); 346 const std::list<int>& ranks = client->getRanksServerLeader(); 347 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 348 event.push(*itRank, 1, msg); 349 client->sendEvent(event); 350 } 351 else client->sendEvent(event); 285 CEventClient event(getType(), EVENT_ID_READ_DATA); 286 if (client->isServerLeader()) 287 { 288 CMessage msg; 289 msg << getId(); 290 const std::list<int>& ranks = client->getRanksServerLeader(); 291 for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank) 292 event.push(*itRank, 1, msg); 293 client->sendEvent(event); 294 } 295 else client->sendEvent(event); 296 } 297 else 298 serverSourceFilter->signalEndOfStream(tsDataRequested); 299 300 return !isEOF; 352 301 } 353 302 … … 361 310 362 311 bool dataRequested = false; 312 363 313 while (currentDate >= lastDataRequestedFromServer) 364 314 { … … 368 318 info(20) << "lastDataRequestedFromServer + file->output_freq.getValue() : " << lastDataRequestedFromServer + file->output_freq << endl ; 369 319 370 sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 371 372 dataRequested = true; 373 } 320 dataRequested |= sendReadDataRequest(lastDataRequestedFromServer + file->output_freq); 321 } 322 374 323 return dataRequested; 375 324 } … … 386 335 { 387 336 CContext* context = CContext::getCurrent(); 388 CContextClient* client = context->client; 337 CContextClient* client = context->client; 389 338 390 339 CEventClient event(getType(), EVENT_ID_READ_DATA_READY); … … 393 342 bool hasData = readField(); 394 343 395 344 map<int, CArray<double,1> >::iterator it; 396 345 if (!grid->doGridHaveDataDistributed()) 397 346 { … … 413 362 } 414 363 } 415 416 364 client->sendEvent(event); 417 365 } … … 500 448 std::map<int, CArray<double,1> > data; 501 449 502 bool isEOF = false;503 504 450 for (int i = 0; i < ranks.size(); i++) 505 451 { … … 585 531 //---------------------------------------------------------------- 586 532 587 bool CField::isActive(void) const 588 { 589 return (instantDataFilter != NULL); 533 bool CField::isActive(bool atCurrentTimestep /*= false*/) const 534 { 535 if (clientSourceFilter) 536 return atCurrentTimestep ? clientSourceFilter->isDataExpected(CContext::getCurrent()->getCalendar()->getCurrentDate()) : true; 537 else if (storeFilter) 538 return true; 539 else if (instantDataFilter) 540 ERROR("bool CField::isActive(bool atCurrentTimestep)", 541 << "Impossible to check if field [ id = " << getId() << " ] is active as it cannot be used to receive nor send data."); 542 543 return false; 590 544 } 591 545 … … 815 769 if (hasDirectFieldReference()) getDirectFieldReference()->solveAllReferenceEnabledField(false); 816 770 } 817 else if (context->hasServer)771 else if (context->hasServer) 818 772 solveServerOperation(); 819 773 … … 940 894 { 941 895 // Check if we have an expression to parse 942 if (hasExpression())896 if (hasExpression()) 943 897 { 944 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 945 boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 946 947 // Check if a spatial transformation is needed 948 if (!field_ref.isEmpty()) 949 { 950 CGrid* gridRef = CField::get(field_ref)->grid; 951 952 if (grid && grid != gridRef && grid->hasTransform()) 898 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 899 boost::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 900 901 // Check if a spatial transformation is needed 902 if (!field_ref.isEmpty()) 953 903 { 954 double defaultValue = !default_value.isEmpty() ? default_value : 0.0; 955 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, defaultValue); 956 957 filter->connectOutput(filters.first, 0); 958 filter = filters.second; 904 CGrid* gridRef = CField::get(field_ref)->grid; 905 906 if (grid && grid != gridRef && grid->hasTransform()) 907 { 908 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 909 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 910 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, hasMissingValue, defaultValue); 911 912 filter->connectOutput(filters.first, 0); 913 filter = filters.second; 914 } 959 915 } 960 } 961 962 instantDataFilter = filter; 916 917 instantDataFilter = filter; 963 918 } 964 919 // Check if we have a reference on another field … … 967 922 // Check if the data is to be read from a file 968 923 else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 969 instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid,970 freq_offset.isEmpty() ? NoneDu : freq_offset,971 true));924 instantDataFilter = serverSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, 925 freq_offset.isEmpty() ? NoneDu : freq_offset, 926 true)); 972 927 else // The data might be passed from the model 973 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid));974 }975 976 // If the field data is to be read by the client or/and written to a file977 if (enableOutput && !storeFilter && !fileWriterFilter)978 {979 if (!read_access.isEmpty() && read_access)980 928 { 981 storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 982 instantDataFilter->connectOutput(storeFilter, 0); 929 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 930 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 931 instantDataFilter = clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 932 ignoreMissingValue, defaultValue)); 983 933 } 984 985 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 986 { 987 fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 988 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 989 } 990 } 991 } 992 } 993 934 } 935 } 936 937 // If the field data is to be read by the client or/and written to a file 938 if (enableOutput && !storeFilter && !fileWriterFilter) 939 { 940 if (!read_access.isEmpty() && read_access) 941 { 942 storeFilter = boost::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid)); 943 instantDataFilter->connectOutput(storeFilter, 0); 944 } 945 946 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write)) 947 { 948 fileWriterFilter = boost::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 949 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 950 } 951 } 952 } 994 953 995 954 /*! … … 1000 959 * \return the output pin corresponding to the field reference 1001 960 */ 1002 boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 1003 { 1004 if (instantDataFilter || field_ref.isEmpty()) 1005 ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 1006 "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref."); 1007 1008 CField* fieldRef = CField::get(field_ref); 1009 fieldRef->buildFilterGraph(gc, false); 1010 1011 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters; 1012 // Check if a spatial transformation is needed 1013 if (grid && grid != fieldRef->grid && grid->hasTransform()) 1014 { 1015 double defaultValue = !default_value.isEmpty() ? default_value : 0.0; 1016 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, defaultValue); 1017 } 1018 else 1019 filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 1020 1021 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1022 1023 return filters.second; 1024 } 961 boost::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 962 { 963 if (instantDataFilter || field_ref.isEmpty()) 964 ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 965 "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref."); 966 967 CField* fieldRef = CField::get(field_ref); 968 fieldRef->buildFilterGraph(gc, false); 969 970 std::pair<boost::shared_ptr<CFilter>, boost::shared_ptr<CFilter> > filters; 971 // Check if a spatial transformation is needed 972 if (grid && grid != fieldRef->grid && grid->hasTransform()) 973 { 974 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 975 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 976 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue); 977 } 978 else 979 filters.first = filters.second = boost::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 980 981 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 982 983 return filters.second; 984 } 1025 985 1026 986 /*! … … 1058 1018 { 1059 1019 if (!clientSourceFilter) 1060 clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid)); 1020 { 1021 bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1022 double defaultValue = ignoreMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1023 clientSourceFilter = boost::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, NoneDu, false, 1024 ignoreMissingValue, defaultValue)); 1025 } 1061 1026 1062 1027 selfReferenceFilter = clientSourceFilter; … … 1104 1069 return it->second; 1105 1070 } 1071 1072 /*! 1073 * Returns the temporal filter corresponding to the field's temporal operation 1074 * for the specified operation frequency. 1075 * 1076 * \param gc the garbage collector to use 1077 * \param outFreq the operation frequency, i.e. the frequency at which the output data will be computed 1078 * \return the output pin corresponding to the requested temporal filter 1079 */ 1080 1081 boost::shared_ptr<COutputPin> CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq) 1082 { 1083 if (instantDataFilter || !hasExpression()) 1084 ERROR("COutputPin* CField::getSelfTemporalDataFilter(CGarbageCollector& gc)", 1085 "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); 1086 1087 if (!selfReferenceFilter) getSelfReference(gc) ; 1088 1089 if (serverSourceFilter || clientSourceFilter) 1090 { 1091 if (operation.isEmpty()) 1092 ERROR("void CField::getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq)", 1093 << "An operation must be defined for field \"" << getId() << "\"."); 1094 1095 if (freq_op.isEmpty()) freq_op.setValue(TimeStep); 1096 if (freq_offset.isEmpty()) freq_offset.setValue(NoneDu); 1097 1098 const bool ignoreMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1099 1100 boost::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1101 CContext::getCurrent()->getCalendar()->getInitDate(), 1102 freq_op, freq_offset, outFreq, 1103 ignoreMissingValue, ignoreMissingValue ? default_value : 0.0)); 1104 selfReferenceFilter->connectOutput(temporalFilter, 0); 1105 return temporalFilter ; 1106 } 1107 else if (!field_ref.isEmpty()) 1108 { 1109 CField* fieldRef = CField::get(field_ref); 1110 fieldRef->buildFilterGraph(gc, false); 1111 return fieldRef->getTemporalDataFilter(gc, outFreq) ; 1112 } 1113 } 1106 1114 1107 1115 //---------------------------------------------------------------- -
XIOS/dev/dev_olga/src/node/field.hpp
r1144 r1158 99 99 100 100 public: 101 bool isActive( void) const;101 bool isActive(bool atCurrentTimestep = false) const; 102 102 bool hasOutputFile; 103 103 … … 150 150 void recvUpdateData(std::map<int,CBufferIn*>& rankBuffers); 151 151 void writeField(void); 152 voidsendReadDataRequest(const CDate& tsDataRequested);152 bool sendReadDataRequest(const CDate& tsDataRequested); 153 153 bool sendReadDataRequestIfNeeded(void); 154 154 static void recvReadDataRequest(CEventServer& event); … … 157 157 static void recvReadDataReady(CEventServer& event); 158 158 void recvReadDataReady(vector<int> ranks, vector<CBufferIn*> buffers); 159 void outputField(CArray<double,3>& fieldOut); 160 void outputField(CArray<double,2>& fieldOut); 159 161 void outputField(CArray<double,1>& fieldOut); 162 void inputField(CArray<double,3>& fieldOut); 163 void inputField(CArray<double,2>& fieldOut); 160 164 void inputField(CArray<double,1>& fieldOut); 161 165 void outputCompressedField(CArray<double, 1>& fieldOut); … … 240 244 //! The terminal filter which stores the instant data 241 245 boost::shared_ptr<CStoreFilter> storeFilter; 242 //! The terminal filter which sends the data to file246 //! The terminal filter which writes the data to file 243 247 boost::shared_ptr<CFileWriterFilter> fileWriterFilter; 244 248 //! The terminal filter which writes data to file -
XIOS/dev/dev_olga/src/node/file.cpp
r1144 r1158 14 14 #include "type.hpp" 15 15 #include "xios_spl.hpp" 16 #include "context_client.hpp" 16 17 #include "mpi.hpp" 18 #include "timer.hpp" 17 19 18 20 namespace xios { … … 49 51 //---------------------------------------------------------------- 50 52 51 const StdString &CFile::getFileOutputName(void) const52 { 53 return name.isEmpty() ? getId() : name;53 const StdString CFile::getFileOutputName(void) const 54 { 55 return (name.isEmpty() ? getId() : name) + (name_suffix.isEmpty() ? StdString("") : name_suffix.getValue()); 54 56 } 55 57 … … 215 217 if (!split_freq.isEmpty()) 216 218 { 217 if (context->registryIn->foundKey("splitStart") && context->registryIn->foundKey("splitEnd")) 219 StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ; 220 if (context->registryIn->foundKey(keySuffix+"splitStart") && context->registryIn->foundKey(keySuffix+"splitEnd")) 218 221 { 219 222 CDate savedSplitStart(*context->getCalendar()), savedSplitEnd(*context->getCalendar()); 220 context->registryIn->getKey( "splitStart", savedSplitStart);221 context->registryIn->getKey( "splitEnd", savedSplitEnd);223 context->registryIn->getKey(keySuffix+"splitStart", savedSplitStart); 224 context->registryIn->getKey(keySuffix+"splitEnd", savedSplitEnd); 222 225 223 226 if (savedSplitStart <= lastSplit && lastSplit <= savedSplitEnd) … … 234 237 const int recordOffset = record_offset.isEmpty() ? 0 : record_offset; 235 238 236 // set<CAxis*> setAxis;237 // set<CDomain*> setDomains;238 239 set<StdString> setAxis; 239 240 set<StdString> setDomains; … … 263 264 if (allDomainEmpty) MPI_Comm_free(&fileComm); 264 265 265 if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered);266 // if (time_counter.isEmpty()) time_counter.setValue(time_counter_attr::centered); 266 267 if (time_counter_name.isEmpty()) time_counter_name = "time_counter"; 267 268 } … … 281 282 if (mode.isEmpty() || mode.getValue() == mode_attr::write) 282 283 { 284 CTimer::get("Files : create headers").resume(); 283 285 if (!isOpen) createHeader(); 286 CTimer::get("Files : create headers").suspend(); 284 287 checkSync(); 285 288 } … … 303 306 if (!mode.isEmpty() && mode.getValue() == mode_attr::read) 304 307 { 308 CTimer::get("Files : open headers").resume(); 305 309 if (!isOpen) openInReadMode(&(context->server->intraComm)); 310 CTimer::get("Files : open headers").suspend(); 306 311 } 307 312 //checkSplit(); // Really need for reading? … … 374 379 { 375 380 StdString filename = getFileOutputName(); 376 if (!name_suffix.isEmpty()) filename+=name_suffix.getValue();377 381 378 382 // determine splitting format in the file name : firstPart%start_date%middlePart%end_date%lastPart … … 441 445 oss << lastPart ; 442 446 443 context->registryOut->setKey("splitStart", lastSplit); 444 context->registryOut->setKey("splitEnd", splitEnd); 447 StdString keySuffix("CContext_"+CContext::getCurrent()->getId()+"::CFile_"+getFileOutputName()+"::") ; 448 context->registryOut->setKey(keySuffix+"splitStart", lastSplit); 449 context->registryOut->setKey(keySuffix+"splitEnd", splitEnd); 445 450 } 446 451 else oss<<firstPart<<lastPart ; … … 489 494 if (isOpen) data_out->closeFile(); 490 495 491 data_out = shared_ptr<CDataOutput>(new CNc4DataOutput( oss.str(), append, useClassicFormat, useCFConvention,496 data_out = shared_ptr<CDataOutput>(new CNc4DataOutput(this, oss.str(), append, useClassicFormat, useCFConvention, 492 497 fileComm, multifile, isCollective, time_counter_name)); 493 498 isOpen = true; … … 509 514 { 510 515 CField* field = *it; 516 this->data_out->writeFieldTimeAxis(field); 517 } 518 519 for (it = this->enabledFields.begin(); it != end; it++) 520 { 521 CField* field = *it; 511 522 this->data_out->writeField(field); 512 523 } … … 517 528 518 529 this->data_out->definition_end(); 530 } 531 else 532 { 533 // check time axis even in append mode 534 std::vector<CField*>::iterator it, end = this->enabledFields.end(); 535 for (it = this->enabledFields.begin(); it != end; it++) 536 { 537 CField* field = *it; 538 this->data_out->writeFieldTimeAxis(field); 539 } 519 540 } 520 541 } … … 535 556 StdOStringStream oss; 536 557 oss << filename; 537 if (!name_suffix.isEmpty()) oss << name_suffix.getValue();538 558 539 559 if (!split_freq.isEmpty()) … … 872 892 } 873 893 874 875 894 /*! 876 895 \brief Send a message to create a field on server side -
XIOS/dev/dev_olga/src/node/file.hpp
r1144 r1158 70 70 public: 71 71 /// Accesseurs /// 72 const StdString &getFileOutputName(void) const;72 const StdString getFileOutputName(void) const; 73 73 boost::shared_ptr<CDataOutput> getDataOutput(void) const; 74 74 boost::shared_ptr<CDataInput> getDataInput(void) const; -
XIOS/dev/dev_olga/src/node/grid.cpp
r1144 r1158 31 31 , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 32 32 , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 33 , globalDim_(),connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)33 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 34 34 , transformations_(0), isTransformed_(false) 35 , axisPositionInGrid_(), positionDimensionDistributed_(1),hasDomainAxisBaseRef_(false)35 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 36 36 , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 37 37 , computedWrittenIndex_(false) … … 50 50 , clientDistribution_(0), isIndexSent(false) , serverDistribution_(0), clientServerMap_(0) 51 51 , writtenDataSize_(0), numberWrittenIndexes_(0), totalNumberWrittenIndexes_(0), offsetWrittenIndexes_(0) 52 , globalDim_(),connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false)52 , connectedDataSize_(), connectedServerRank_(), isDataDistributed_(true), isCompressible_(false) 53 53 , transformations_(0), isTransformed_(false) 54 , axisPositionInGrid_(), positionDimensionDistributed_(1),hasDomainAxisBaseRef_(false)54 , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 55 55 , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 56 56 , computedWrittenIndex_(false) … … 76 76 77 77 78 StdSize CGrid::getDimension(void) const79 { 80 return g lobalDim_.size();78 StdSize CGrid::getDimension(void) 79 { 80 return getGlobalDimension().size(); 81 81 } 82 82 … … 196 196 for (int i = 0; i < axisListP.size(); ++i) 197 197 { 198 axisListP[i]->checkAttributesOnClientAfterTransformation(g lobalDim_,axisPositionInGrid_[i]);198 axisListP[i]->checkAttributesOnClientAfterTransformation(getGlobalDimension(),axisPositionInGrid_[i]); 199 199 } 200 200 } … … 243 243 this->solveScalarRef(areAttributesChecked); 244 244 this->solveAxisRef(areAttributesChecked); 245 this->solveDomainRef(areAttributesChecked); 246 computeGridGlobalDimension(getDomains(), getAxis(), getScalars(), axis_domain_order); 245 this->solveDomainRef(areAttributesChecked); 247 246 this->isDomainAxisChecked = areAttributesChecked; 248 247 } … … 311 310 {sendIndex(); this->isIndexSent = true;} 312 311 } 312 313 // Not sure about this 314 //if (!(this->hasTransform() && !this->isTransformed())) 315 // this->isChecked = true; 316 //return; 313 317 } 314 318 … … 409 413 using namespace std; 410 414 std::vector<CDomain*> domainP = this->getDomains(); 411 std::vector<CAxis*> axisP = this->getAxis(); 415 std::vector<CAxis*> axisP = this->getAxis(); 412 416 int dim = domainP.size() * 2 + axisP.size(); 413 417 … … 512 516 { 513 517 if (sendAtt) 514 axisListP[i]->sendCheckedAttributes(g lobalDim_,axisPositionInGrid_[i]);518 axisListP[i]->sendCheckedAttributes(getGlobalDimension(),axisPositionInGrid_[i]); 515 519 else 516 520 axisListP[i]->checkAttributesOnClient(); … … 534 538 } 535 539 } 540 } 541 std::vector<int> CGrid::getAxisPositionInGrid() const 542 { 543 return axisPositionInGrid_; 536 544 } 537 545 … … 652 660 } 653 661 } 654 655 656 662 } 657 663 } … … 695 701 // Compute mapping between client and server 696 702 std::vector<boost::unordered_map<size_t,std::vector<int> > > indexServerOnElement; 697 CServerDistributionDescription serverDistributionDescription(g lobalDim_, client->serverSize);703 CServerDistributionDescription serverDistributionDescription(getGlobalDimension(), client->serverSize); 698 704 serverDistributionDescription.computeServerGlobalByElement(indexServerOnElement, 699 705 client->clientRank, … … 933 939 } 934 940 } 935 941 } 936 942 } 937 943 //---------------------------------------------------------------- … … 1122 1128 } 1123 1129 1130 /* 1131 void CGrid::outputField(int rank, const CArray<double, 1>& stored, double* field) 1132 { 1133 const CArray<size_t,1>& out_i = outIndexFromClient[rank]; 1134 StdSize numElements = stored.numElements(); 1135 for (StdSize n = 0; n < numElements; ++n) 1136 { 1137 field[out_i(n)] = stored(n); 1138 } 1139 } 1140 1141 void CGrid::inputField(int rank, const double* const field, CArray<double,1>& stored) 1142 { 1143 const CArray<size_t,1>& out_i = outIndexFromClient[rank]; 1144 StdSize numElements = stored.numElements(); 1145 for (StdSize n = 0; n < numElements; ++n) 1146 { 1147 stored(n) = field[out_i(n)]; 1148 } 1149 } 1150 1151 void CGrid::outputCompressedField(int rank, const CArray<double,1>& stored, double* field) 1152 { 1153 const CArray<size_t,1>& out_i = compressedOutIndexFromClient[rank]; 1154 StdSize numElements = stored.numElements(); 1155 for (StdSize n = 0; n < numElements; ++n) 1156 { 1157 field[out_i(n)] = stored(n); 1158 } 1159 } 1160 */ 1161 //---------------------------------------------------------------- 1162 1124 1163 void CGrid::storeField_arr(const double* const data, CArray<double, 1>& stored) const 1125 1164 { … … 1170 1209 { 1171 1210 CContext* context = CContext::getCurrent(); 1172 // int nbSrvPools = (context->hasServer) ? context->clientPrimServer.size() : 1;1173 1211 int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 0) : 1; 1174 1212 for (int p = 0; p < nbSrvPools; ++p) … … 1538 1576 } 1539 1577 1540 void CGrid::computeGridGlobalDimension(const std::vector<CDomain*>& domains, 1541 const std::vector<CAxis*>& axis, 1542 const std::vector<CScalar*>& scalars, 1543 const CArray<int,1>& axisDomainOrder) 1544 { 1545 globalDim_.resize(domains.size()*2+axis.size()+scalars.size()); 1578 /* 1579 Compute on the fly the global dimension of a grid with its elements 1580 \param[in/out] globalDim global dimension of grid 1581 \param[in] domains list of its domains 1582 \param[in] axiss list of its axis 1583 \param[in] scalars list of its scalars 1584 \param[in] axisDomainOrder the order of element in a grid (e.g: scalar then axis) 1585 \return The dimension of which we do distribution (often for server) 1586 */ 1587 int CGrid::computeGridGlobalDimension(std::vector<int>& globalDim, 1588 const std::vector<CDomain*> domains, 1589 const std::vector<CAxis*> axis, 1590 const std::vector<CScalar*> scalars, 1591 const CArray<int,1>& axisDomainOrder) 1592 { 1593 globalDim.resize(domains.size()*2+axis.size()+scalars.size()); 1594 int positionDimensionDistributed = 1; 1546 1595 int idx = 0, idxDomain = 0, idxAxis = 0, idxScalar = 0; 1547 1596 for (int i = 0; i < axisDomainOrder.numElements(); ++i) … … 1551 1600 if (!(domains[idxDomain]->type.isEmpty()) && (domains[idxDomain]->type==CDomain::type_attr::unstructured)) 1552 1601 { 1553 positionDimensionDistributed _= idx;1602 positionDimensionDistributed = idx; 1554 1603 } 1555 1604 else 1556 1605 { 1557 positionDimensionDistributed _= idx +1;1558 } 1559 1560 globalDim _[idx] = domains[idxDomain]->ni_glo.getValue();1561 globalDim _[idx+1] = domains[idxDomain]->nj_glo.getValue();1606 positionDimensionDistributed = idx +1; 1607 } 1608 1609 globalDim[idx] = domains[idxDomain]->ni_glo.getValue(); 1610 globalDim[idx+1] = domains[idxDomain]->nj_glo.getValue(); 1562 1611 1563 1612 ++idxDomain; … … 1566 1615 else if (1 == axisDomainOrder(i)) 1567 1616 { 1568 globalDim _[idx] = axis[idxAxis]->n_glo.getValue();1617 globalDim[idx] = axis[idxAxis]->n_glo.getValue(); 1569 1618 ++idxAxis; 1570 1619 ++idx; … … 1572 1621 else 1573 1622 { 1574 globalDim _[idx] = 1;1623 globalDim[idx] = 1; 1575 1624 ++idxScalar; 1576 1625 ++idx; 1577 1626 } 1578 1627 } 1579 } 1580 1628 1629 return positionDimensionDistributed; 1630 } 1631 1632 // Retrieve the global dimension of grid 1581 1633 std::vector<int> CGrid::getGlobalDimension() 1582 1634 { 1583 return globalDim_; 1635 std::vector<int> globalDim; 1636 computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1637 1638 return globalDim; 1639 } 1640 1641 // Retrieve dimension on which we do distribution (Very often, it should be 2nd dimension) 1642 int CGrid::getDistributedDimension() 1643 { 1644 std::vector<int> globalDim; 1645 return computeGridGlobalDimension(globalDim, getDomains(), getAxis(), getScalars(), axis_domain_order); 1584 1646 } 1585 1647 -
XIOS/dev/dev_olga/src/node/grid.hpp
r1144 r1158 87 87 88 88 /// Accesseurs /// 89 StdSize getDimension(void) const;89 StdSize getDimension(void); 90 90 91 91 StdSize getDataSize(void) const; … … 176 176 std::vector<int> getGlobalDimension(); 177 177 bool isScalarGrid() const; 178 std::vector<int> getAxisPositionInGrid() const; 178 179 179 180 bool doGridHaveDataToWrite(); … … 268 269 void computeIndexByElement(const std::vector<boost::unordered_map<size_t,std::vector<int> > >& indexServerOnElement, 269 270 CClientServerMapping::GlobalIndexMap& globalIndexOnServer); 271 int computeGridGlobalDimension(std::vector<int>& globalDim, 272 const std::vector<CDomain*> domains, 273 const std::vector<CAxis*> axis, 274 const std::vector<CScalar*> scalars, 275 const CArray<int,1>& axisDomainOrder); 276 int getDistributedDimension(); 270 277 271 278 void computeClientIndex(); … … 296 303 std::vector<int> axisPositionInGrid_; 297 304 CGridTransformation* transformations_; 298 bool hasDomainAxisBaseRef_; 299 std::vector<int> globalDim_; 305 bool hasDomainAxisBaseRef_; 300 306 std::map<CGrid*, std::pair<bool,StdString> > gridSrc_; 301 307 bool hasTransform_; -
XIOS/dev/dev_olga/src/node/interpolate_domain.cpp
r1021 r1158 55 55 { 56 56 case mode_attr::read: 57 if (this-> file.isEmpty())57 if (this->weight_filename.isEmpty()) 58 58 { 59 59 if (!this->write_weight) … … 64 64 else 65 65 { 66 weightFile = this-> file;66 weightFile = this->weight_filename; 67 67 ifstream f(weightFile.c_str()); 68 68 if (!f.good()) … … 75 75 break; 76 76 case mode_attr::read_or_compute: 77 if (!this-> file.isEmpty() && !this->write_weight)77 if (!this->weight_filename.isEmpty() && !this->write_weight) 78 78 { 79 weightFile = this-> file;79 weightFile = this->weight_filename; 80 80 ifstream f(weightFile.c_str()); 81 81 if (!f.good()) -
XIOS/dev/dev_olga/src/node/mesh.cpp
r946 r1158 11 11 /// ////////////////////// Définitions ////////////////////// /// 12 12 13 CMesh::CMesh(void) : nbNodesGlo {0}, nbEdgesGlo{0}14 , node_start {0}, node_count{0}15 , edge_start {0}, edge_count{0}16 , nbFaces_ {0}, nbNodes_{0}, nbEdges_{0}17 , nodesAreWritten {false}, edgesAreWritten{false}, facesAreWritten{false}13 CMesh::CMesh(void) : nbNodesGlo(0), nbEdgesGlo(0) 14 , node_start(0), node_count(0) 15 , edge_start(0), edge_count(0) 16 , nbFaces_(0), nbNodes_(0), nbEdges_(0) 17 , nodesAreWritten(false), edgesAreWritten(false), facesAreWritten(false) 18 18 , node_lon(), node_lat() 19 19 , edge_lon(), edge_lat(), edge_nodes() 20 20 , face_lon(), face_lat() 21 21 , face_nodes() 22 , pNodeGlobalIndex {NULL}, pEdgeGlobalIndex{NULL}22 , pNodeGlobalIndex(NULL), pEdgeGlobalIndex(NULL) 23 23 { 24 24 } … … 91 91 seed ^= sizetHash(first) + 0x9e3779b9 + (seed << 6) + (seed >> 2); 92 92 } 93 return seed ;94 }95 96 ///----------------------------------------------------------------97 /*!98 * \fn size_t generateEdgeIndex(size_t first, size_t second, int rank)99 * Generates an edge index.100 * If the same edge is generated by two processes, each process will have its own edge index.101 * \param [in] first Edge node.102 * \param [in] second Edge node.103 * \param [in] rank MPI process rank.104 */105 size_t generateEdgeIndex(size_t first, size_t second, int rank)106 {107 size_t seed = rank ;108 if (first < second)109 {110 seed = hashPair(seed, first);111 seed = hashPair(seed, second);112 }113 else114 {115 seed = hashPair(seed, second);116 seed = hashPair(seed, first);117 }118 119 93 return seed ; 120 94 } … … 141 115 return seed ; 142 116 } 117 118 ///---------------------------------------------------------------- 119 /*! 120 * \fn size_t generateNodeIndex(vector<size_t>& valList) 121 * Generates a node index unique for all processes. 122 * \param [in] valList Vector storing four node hashes. 123 */ 124 size_t generateNodeIndex(vector<size_t>& valList) 125 { 126 // Sort is needed to avoid problems for nodes with lon = 0 generated by faces in east and west semisphere 127 vector<size_t> vec = valList; 128 sort (vec.begin(), vec.end()); 129 size_t seed = vec[0] ; 130 int it = 1; 131 for(; it != vec.size(); ++it) 132 { 133 seed = hashPair(seed, vec[it]); 134 } 135 return seed ; 136 } 137 143 138 144 139 ///---------------------------------------------------------------- … … 600 595 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2Idx; 601 596 CArray<size_t,1> nodeHashList(nbEdges_*nvertex*4); 597 int nbHash = 0; 602 598 for (int ne = 0; ne < nbEdges_; ++ne) 603 599 { … … 609 605 if (nodeHash2Idx[hashValues[nh]].size() == 0) 610 606 { 611 nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues , mpiRank));607 nodeHash2Idx[hashValues[nh]].push_back(generateNodeIndex(hashValues)); 612 608 nodeHash2Idx[hashValues[nh]].push_back(mpiRank); 609 nodeHashList(nbHash) = hashValues[nh]; 610 ++nbHash; 613 611 } 614 nodeHashList((ne*nvertex + nv)*4 + nh) = hashValues[nh];615 616 617 }612 } 613 } 614 } 615 nodeHashList.resizeAndPreserve(nbHash); 618 616 619 617 // (2.2) Generating global node indexes 620 // The ownership criterion: priority of the process holding thesmaller index618 // The ownership criterion: priority of the process of smaller index 621 619 // Maps generated in this step are: 622 // nodeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 623 // nodeIdx2IdxMin = <idx, idxMin> 624 // nodeIdx2IdxGlo = <idxMin, idxMin> 625 626 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 627 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 628 CArray<size_t,1> nodeIdxMinList(nbEdges_*nvertex); 629 630 CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 631 dhtNodeHash.computeIndexInfoMapping(nodeHashList); 632 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 633 size_t iIdxMin = 0; 634 635 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 636 { 637 size_t idx = (it->second)[0]; 638 size_t idxMin = (it->second)[0]; 639 for (int i = 2; i < (it->second).size();) 640 { 641 if (mpiRank == (it->second)[i+1]) 642 { 643 idx = (it->second)[i]; 644 } 645 if ((it->second)[i] < idxMin) 646 { 647 idxMin = (it->second)[i]; 648 (it->second)[i] = (it->second)[i-2]; 649 } 650 i += 2; 651 } 652 (it->second)[0] = idxMin; 653 if (nodeIdx2IdxMin.count(idx) == 0) 654 { 655 nodeIdx2IdxMin[idx].push_back(idxMin); 656 if (idx == idxMin) 657 nodeIdx2IdxGlo[idxMin].push_back(idxMin); 658 nodeIdxMinList(iIdxMin) = idxMin; 659 ++iIdxMin; 660 } 661 } 662 nodeIdxMinList.resizeAndPreserve(iIdxMin); 663 CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 664 CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 665 dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 666 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 667 // nodeIdx2IdxGlo holds global indexes only for nodes owned by a process 668 // nodeIdxMin2IdxGlo holds global indexes for all nodes generated by a process 620 // Maps generated in this step are: 621 // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 622 // nodeIdx2Idx = <idx, <rankOwner, idx>> 623 624 CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); 625 dhtNodeHash.computeIndexInfoMapping(nodeHashList); 626 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 627 628 629 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 630 CArray<size_t,1> nodeIdxList(nbEdges_*nvertex*4); 631 size_t nIdx = 0; 632 633 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 634 { 635 size_t rankMin = (it->second)[1]; 636 size_t idx = (it->second)[0]; 637 for (int i = 2; i < (it->second).size();) 638 { 639 if ( (it->second)[i+1] < rankMin) 640 { 641 idx = (it->second)[i]; 642 rankMin = (it->second)[i+1]; 643 (it->second)[i+1] = (it->second)[i-1]; 644 } 645 i += 2; 646 } 647 if (nodeIdx2Idx.count(idx) == 0) 648 { 649 if (mpiRank == rankMin) 650 { 651 nodeIdx2Idx[idx].push_back(rankMin); 652 nodeIdx2Idx[idx].push_back(idx); 653 } 654 nodeIdxList(nIdx) = idx; 655 ++nIdx; 656 } 657 } 658 nodeIdxList.resizeAndPreserve(nIdx); 659 660 // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 661 // Solution: global node indexing by hand. 662 // Maps modified in this step: 663 // nodeIdx2Idx = <idx, idxGlo> 664 int nodeCount = nodeIdx2Idx.size(); 665 int nodeStart, nbNodes; 666 MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 667 int nNodes = nodeStart; 668 MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 669 nbNodesGlo = nNodes; 670 671 nodeStart -= nodeCount; 672 node_start = nodeStart; 673 node_count = nodeCount; 674 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 675 size_t count = 0; 676 677 for (int ne = 0; ne < nbEdges_; ++ne) 678 { 679 for (int nv = 0; nv < nvertex; ++nv) 680 { 681 vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 682 size_t nodeIdx = generateNodeIndex(hashValues); 683 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 684 if (it != nodeIdx2Idx.end()) 685 { 686 if (dummyMap.count(nodeIdx) == 0) 687 { 688 dummyMap[nodeIdx].push_back(nodeIdx); 689 (it->second)[1] = node_start + count; 690 ++count; 691 } 692 } 693 } 694 } 695 696 CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 697 dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 698 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 669 699 670 700 // (2.3) Saving variables: node_lon, node_lat, edge_nodes 671 701 // Creating map nodeHash2IdxGlo <hash, idxGlo> 672 702 // Creating map edgeHash2IdxGlo <hash, idxGlo> 673 nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();674 node_count = dhtNodeIdxGlo.getIndexCount();675 node_start = dhtNodeIdxGlo.getIndexStart();703 // nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 704 // node_count = dhtNodeIdxGlo.getIndexCount(); 705 // node_start = dhtNodeIdxGlo.getIndexStart(); 676 706 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeHash2IdxGlo; 677 707 node_lon.resize(node_count); … … 685 715 { 686 716 hashValues = CMesh::createHashes(bounds_lon(nv, ne), bounds_lat(nv, ne)); 687 size_t myIdx = generateNodeIndex(hashValues, mpiRank); 688 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxMin.find(myIdx); 689 size_t ownerIdx = (itIdx->second)[0]; 690 691 if (myIdx == ownerIdx) 692 { 693 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdx2IdxGlo.find(myIdx); 694 idxGlo = (itIdxGlo->second)[0]; 717 size_t myIdx = generateNodeIndex(hashValues); 718 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = nodeIdx2IdxGlo.find(myIdx); 719 idxGlo = (itIdx->second)[1]; 720 721 if (mpiRank == (itIdx->second)[0]) 722 { 695 723 // node_lon(idxGlo - node_start) = (bounds_lon(nv, ne) == 360.) ? (0.) : (bounds_lon(nv, ne)); 696 724 node_lon(idxGlo - node_start) = bounds_lon(nv, ne); 697 725 node_lat(idxGlo - node_start) = bounds_lat(nv, ne); 698 726 } 699 else700 {701 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = nodeIdxMin2IdxGlo.find(ownerIdx);702 idxGlo = (itIdxGlo->second)[0];703 }704 705 727 edge_nodes(nv,ne) = idxGlo; 706 728 for (int nh = 0; nh < 4; ++nh) … … 793 815 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHash2Rank; 794 816 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 795 CArray<size_t,1> edgeIdx GloList(nbFaces_*nvertex);817 CArray<size_t,1> edgeIdxList(nbFaces_*nvertex); 796 818 size_t iIdx = 0; 797 819 … … 824 846 if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) 825 847 { 826 edgeIdx GloList(iIdx) = edgeIdxGlo;848 edgeIdxList(iIdx) = edgeIdxGlo; 827 849 ++iIdx; 828 850 } 829 851 edgeIdxGlo2Face[edgeIdxGlo].push_back(faceIdxGlo); 830 edgeHash2Rank[edgeHash].push_back(itEdgeHash->first);831 852 edgeHash2Rank[edgeHash].push_back(mpiRank); 853 edgeHash2Rank[edgeHash].push_back(itEdgeHash->second[0]); 832 854 } 833 855 else … … 837 859 } 838 860 } 839 edgeIdx GloList.resizeAndPreserve(iIdx);861 edgeIdxList.resizeAndPreserve(iIdx); 840 862 841 863 // (1.3) Saving remaining variables edge_faces and face_faces … … 846 868 dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 847 869 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 848 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeHashMin2IdxGlo; 849 850 // edgeHash2Info = <edgeHash, <idxGlo, rank1, idxGlo, rank2>> 851 // edgeHashMin2IdxGlo = <edgeHashMin, idxGlo> 870 871 // edgeHash2Info = <edgeHash, < rank1, idxGlo, rank2, idxGlo>> 872 int edgeCount = 0; 852 873 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 853 874 { 854 875 vector <size_t> edgeInfo = it->second; 855 if (edgeInfo.size() == 4) // two processes generate the same edge 856 if (edgeInfo[1] > edgeInfo[3]) 857 edgeInfo[1] = edgeInfo[3]; 858 if (edgeInfo[1] == mpiRank) 859 edgeHashMin2IdxGlo[it->first].push_back(edgeInfo[0]); 860 } 861 862 CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeHashMin2IdxGlo, comm); 863 edge_count = dhtEdgeIdxGlo.getIndexCount(); 864 edge_start = dhtEdgeIdxGlo.getIndexStart(); 876 if (edgeInfo[0] == mpiRank) 877 { 878 ++edgeCount; 879 } 880 } 881 882 int edgeStart, nbEdges; 883 MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 884 int nEdges = edgeStart; 885 MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 886 nbEdgesGlo = nEdges; 887 888 // edges to be splitted equally between procs 889 if ( (nbEdgesGlo % mpiSize) == 0) 890 { 891 edge_count = nbEdgesGlo/mpiSize; 892 edge_start = mpiRank*edge_count; 893 } 894 else 895 { 896 if (mpiRank == (mpiSize - 1) ) 897 { 898 edge_count = nbEdgesGlo/mpiSize; 899 edge_start = mpiRank*(nbEdgesGlo/mpiSize + 1); 900 } 901 else 902 { 903 edge_count = nbEdgesGlo/mpiSize + 1; 904 edge_start = mpiRank*edge_count; 905 } 906 } 907 CArray<size_t,1> edgeIdxGloList(edge_count); 908 for (int i = 0; i < edge_count; ++i) 909 { 910 edgeIdxGloList(i) = i + edge_start; 911 } 912 913 CClientClientDHTSizet dhtEdgeIdxGlo2Face (edgeIdxGlo2Face, comm); 914 CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm); 915 dhtEdgeIdxGlo2Face.computeIndexInfoMapping(edgeIdxGloList); 916 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdgeIdxGlo2Face.getInfoIndexMap(); 917 dhtEdge2Face.computeIndexInfoMapping(edgeIdxList); 918 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 919 865 920 866 921 edge_faces.resize(2, edge_count); 922 for (int i = 0; i < edge_count; ++i) 923 { 924 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdxGlo2FaceIdx.find(i + edge_start); 925 int indexGlo = it->first; 926 vector<size_t> faces = it->second; 927 int face1 = faces[0]; 928 edge_faces(0, indexGlo - edge_start) = face1; 929 if (faces.size() == 2) 930 { 931 int face2 = faces[1]; 932 edge_faces(1, indexGlo - edge_start) = face2; 933 } 934 else 935 { 936 edge_faces(1, indexGlo - edge_start) = -999; 937 } 938 } 939 940 size_t tmp; 941 vector<size_t> tmpVec; 942 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2FaceIdx.begin(); it != edgeIdx2FaceIdx.end(); it++) 943 { 944 tmp = it->first; 945 tmpVec = it->second; 946 tmp++; 947 } 948 949 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2, itIndex; 867 950 face_faces.resize(nvertex, nbFaces_); 868 869 CClientClientDHTSizet dhtEdge2Face (edgeIdxGlo2Face, comm);870 dhtEdge2Face.computeIndexInfoMapping(edgeIdxGloList);871 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap();872 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itFace1, itFace2;873 874 951 for (int nf = 0; nf < nbFaces_; ++nf) 875 952 { … … 896 973 size_t faceIdxGlo = nbFacesAccum + nf; 897 974 size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 898 itEdgeHash = edgeHash2IdxGlo.find(edgeHash); 899 if (itEdgeHash != edgeHashMin2IdxGlo.end()) 975 itEdgeHash = edgeHash2Info.find(edgeHash); 976 int edgeIdxGlo = (itEdgeHash->second)[1]; 977 978 if ( (itEdgeHash->second)[0] == mpiRank) 900 979 { 901 int edgeIdxGlo = itEdgeHash->second[0]; 902 itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 980 itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 903 981 int face1 = itFace1->second[0]; 904 982 if (itFace1->second.size() == 1) 905 983 { 906 edge_faces(0, edgeIdxGlo - edge_start) = face1;907 edge_faces(1, edgeIdxGlo - edge_start) = -999;908 984 face_faces(nv1, nf) = 999999; 909 985 } … … 911 987 { 912 988 int face2 = itFace1->second[1]; 913 edge_faces(0, edgeIdxGlo - edge_start) = face1;914 edge_faces(1, edgeIdxGlo - edge_start) = face2;915 989 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 916 990 } … … 918 992 else 919 993 { 920 itEdgeHash = edgeHashMin2IdxGlo.find(edgeHash); 921 size_t edgeIdxGlo = itEdgeHash->second[0]; 922 itFace1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 994 itFace1 = edgeIdx2FaceIdx.find(edgeIdxGlo); 923 995 int face1 = itFace1->second[0]; 924 996 int face2 = itFace1->second[1]; … … 957 1029 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it1, it2; 958 1030 CArray<size_t,1> edgeHashList(nbFaces_*nvertex); 1031 int nEdgeHash = 0; 959 1032 for (int nf = 0; nf < nbFaces_; ++nf) 960 1033 { … … 978 1051 face_nodes(nv1,nf) = it1->second[0]; 979 1052 size_t edgeHash = hashPairOrdered(it1->second[0], it2->second[0]); 980 edgeHash2Idx[edgeHash].push_back(generateEdgeIndex(it1->second[0], it2->second[0], mpiRank)); 981 edgeHash2Idx[edgeHash].push_back(mpiRank); 982 edgeHashList(nf*nvertex + nv1) = edgeHash; 983 } 984 } 985 986 // (2.2) Generating global edge indexes 987 // The ownership criterion: priority of the process holding the smaller index 1053 if (edgeHash2Idx.count(edgeHash) == 0) 1054 { 1055 edgeHash2Idx[edgeHash].push_back(edgeHash); 1056 edgeHash2Idx[edgeHash].push_back(mpiRank); 1057 edgeHashList(nEdgeHash) = edgeHash; 1058 ++nEdgeHash; 1059 } 1060 } 1061 } 1062 edgeHashList.resizeAndPreserve(nEdgeHash); 1063 1064 // (2.3) Generating global edge indexes 1065 // The ownership criterion: priority of the process with smaller rank 988 1066 // Maps generated in this step are: 989 // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 990 // edgeIdx2IdxMin = = <idx, idxMin> 991 // edgeIdx2IdxGlo = <idxMin, idxGlo> 1067 // edgeIdx2Idx = = <idx, <rankOwner, idx>> 1068 // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 992 1069 993 1070 CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); 994 1071 dhtEdgeHash.computeIndexInfoMapping(edgeHashList); 995 1072 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeHash2Info = dhtEdgeHash.getInfoIndexMap(); 996 997 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 998 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 999 CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 1000 size_t iIdxMin = 0; 1073 // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 1074 1075 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 1001 1076 1002 1077 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 1003 1078 { 1004 size_t idxMin = (it->second)[0];1079 size_t rankMin = (it->second)[1]; 1005 1080 size_t idx = (it->second)[0]; 1081 1006 1082 for (int i = 2; i < (it->second).size();) 1007 1083 { 1008 if (mpiRank == (it->second)[i+1]) 1009 { 1084 if ((it->second)[i+1] < rankMin) 1085 { 1086 rankMin = (it->second)[i+1]; 1010 1087 idx = (it->second)[i]; 1011 } 1012 if ((it->second)[i] < idxMin) 1013 { 1014 idxMin = (it->second)[i]; 1015 (it->second)[i] = (it->second)[i-2]; 1088 (it->second)[i+1] = (it->second)[i-1]; 1016 1089 } 1017 1090 i += 2; 1018 1091 } 1019 (it->second)[0] = idxMin; 1020 if (edgeIdx2IdxMin.count(idx) == 0) 1021 { 1022 edgeIdx2IdxMin[idx].push_back(idxMin); 1023 if (idx == idxMin) 1024 edgeIdx2IdxGlo[idxMin].push_back(idxMin); 1025 edgeIdxMinList(iIdxMin) = idxMin; 1026 ++iIdxMin; 1027 } 1028 } 1029 edgeIdxMinList.resizeAndPreserve(iIdxMin); 1030 CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 1031 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 1032 dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 1033 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1034 // edgeIdx2IdxGlo holds global indexes only for edges owned by a process 1035 // edgeIdxMin2IdxGlo holds global indexes for all edges generated by a process 1036 1037 // (2.3) Saving variables: edge_lon, edge_lat, face_edges 1038 nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 1039 edge_count = dhtEdgeIdxGlo.getIndexCount(); 1040 edge_start = dhtEdgeIdxGlo.getIndexStart(); 1041 edge_lon.resize(edge_count); 1042 edge_lat.resize(edge_count); 1043 edge_nodes.resize(2, edge_count); 1044 face_edges.resize(nvertex, nbFaces_); 1045 1046 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 1047 CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 1048 size_t iIdx = 0; 1092 if (edgeIdx2Idx.count(idx) == 0) 1093 { 1094 if (mpiRank == rankMin) 1095 { 1096 edgeIdx2Idx[idx].push_back(rankMin); 1097 edgeIdx2Idx[idx].push_back(idx); 1098 } 1099 } 1100 } 1101 1102 int edgeCount = edgeIdx2Idx.size(); 1103 int edgeStart, nbEdges; 1104 MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 1105 int nEdges = edgeStart; 1106 MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 1107 nbEdgesGlo = nEdges; 1108 1109 edgeStart -= edgeCount; 1110 edge_start = edgeStart; 1111 edge_count = edgeCount; 1112 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 1113 int count = 0; 1049 1114 1050 1115 for (int nf = 0; nf < nbFaces_; ++nf) … … 1068 1133 it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 1069 1134 } 1135 size_t nodeIdxGlo1 = it1->second[0]; 1136 size_t nodeIdxGlo2 = it2->second[0]; 1137 1138 if (nodeIdxGlo1 != nodeIdxGlo2) 1139 { 1140 size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1141 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 1142 if (it != edgeIdx2Idx.end()) 1143 { 1144 if (dummyEdgeMap.count(edgeIdx) == 0) 1145 { 1146 dummyEdgeMap[edgeIdx].push_back(edgeIdx); 1147 (it->second)[1] = edge_start + count; 1148 ++count; 1149 } 1150 } 1151 } 1152 } 1153 } 1154 1155 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 1156 dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 1157 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1158 1159 // (2.4) Saving variables: edge_lon, edge_lat, face_edges 1160 edge_lon.resize(edge_count); 1161 edge_lat.resize(edge_count); 1162 edge_nodes.resize(2, edge_count); 1163 face_edges.resize(nvertex, nbFaces_); 1164 1165 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdxGlo2Face; 1166 CArray<size_t,1> edgeIdxGloList(nbFaces_*nvertex); 1167 size_t iIdx = 0; 1168 1169 for (int nf = 0; nf < nbFaces_; ++nf) 1170 { 1171 for (int nv1 = 0; nv1 < nvertex; ++nv1) 1172 { 1173 // Getting global indexes of edge's nodes 1174 int nh1 = 0; 1175 int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 1176 it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1)); 1177 while (it1 == nodeHash2IdxGlo.end()) 1178 { 1179 ++nh1; 1180 it1 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh1)); 1181 } 1182 int nh2 = 0; 1183 it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv2)*4 + nh2)); 1184 while (it2 == nodeHash2IdxGlo.end()) 1185 { 1186 ++nh2; 1187 it2 = nodeHash2IdxGlo.find(nodeHashList((nf*nvertex + nv1)*4 + nh2)); 1188 } 1070 1189 // Getting edge global index 1071 1190 size_t nodeIdxGlo1 = it1->second[0]; 1072 1191 size_t nodeIdxGlo2 = it2->second[0]; 1073 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank);1192 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1074 1193 if (nodeIdxGlo1 != nodeIdxGlo2) 1075 1194 { 1076 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1077 size_t ownerIdx = (itIdx->second)[0]; 1078 int edgeIdxGlo = 0; 1195 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 1196 int edgeIdxGlo = (itIdx->second)[1]; 1079 1197 size_t faceIdxGlo = nbFacesAccum + nf; 1080 1198 1081 if (m yIdx == ownerIdx)1199 if (mpiRank == (itIdx->second)[0]) 1082 1200 { 1083 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);1084 edgeIdxGlo = (itIdxGlo->second)[0];1085 1201 double edgeLon; 1086 1202 double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); … … 1096 1212 edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 1097 1213 } 1098 else1099 {1100 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);1101 edgeIdxGlo = (itIdxGlo->second)[0];1102 }1103 1214 face_edges(nv1,nf) = edgeIdxGlo; 1104 1215 if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) … … 1117 1228 edgeIdxGloList.resizeAndPreserve(iIdx); 1118 1229 1119 // (2. 4) Saving remaining variables edge_faces and face_faces1230 // (2.5) Saving remaining variables edge_faces and face_faces 1120 1231 edge_faces.resize(2, edge_count); 1121 1232 face_faces.resize(nvertex, nbFaces_); … … 1125 1236 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxGlo2FaceIdx = dhtEdge2Face.getInfoIndexMap(); 1126 1237 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdxGlo1, itNodeIdxGlo2; 1238 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx; 1127 1239 1128 1240 for (int nf = 0; nf < nbFaces_; ++nf) … … 1149 1261 size_t nodeIdxGlo2 = it2->second[0]; 1150 1262 1151 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1152 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1153 size_t ownerIdx = (itIdx->second)[0]; 1263 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1264 itIdx = edgeIdx2IdxGlo.find(myIdx); 1154 1265 size_t faceIdxGlo = nbFacesAccum + nf; 1155 1156 if (myIdx == ownerIdx) 1157 { 1158 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx); 1159 int edgeIdxGlo = (itIdxGlo->second)[0]; 1266 int edgeIdxGlo = (itIdx->second)[1]; 1267 1268 if (mpiRank == (itIdx->second)[0]) 1269 { 1160 1270 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1161 1271 int face1 = it1->second[0]; … … 1176 1286 else 1177 1287 { 1178 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);1179 size_t edgeIdxGlo = (itIdxGlo->second)[0];1180 1288 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1181 1289 int face1 = it1->second[0]; … … 1200 1308 { 1201 1309 hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 1202 size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 1310 // size_t nodeIndex = generateNodeIndex(hashValues, mpiRank); 1311 size_t nodeIndex = generateNodeIndex(hashValues); 1203 1312 for (int nh = 0; nh < 4; ++nh) 1204 1313 { … … 1216 1325 1217 1326 // (3.2) Generating global node indexes 1218 // The ownership criterion: priority of the process holding the smaller index 1327 // The ownership criterion: priority of the process with smaller rank. 1328 // With any other criterion it is not possible to have consistent node indexing for different number of procs. 1219 1329 // Maps generated in this step are: 1220 // nodeHash2Info = <hash, [[idxMin, rankMin], [idx1, rank1], [idx3, rank3]..]> 1221 // nodeIdx2IdxMin = = <idx, idxMin> 1222 // nodeIdx2IdxGlo = <idxMin, idxGlo> 1330 // nodeHash2Info = <hash, [[idx, rankMin], [idx, rank1], [idx, rank3]..]> 1331 // nodeIdx2Idx = <idx, <rankOwner, idx>> 1223 1332 1224 1333 CClientClientDHTSizet dhtNodeHash(nodeHash2Idx, comm); … … 1226 1335 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeHash2Info = dhtNodeHash.getInfoIndexMap(); 1227 1336 1228 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxMin; 1229 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2IdxGlo; 1230 CArray<size_t,1> nodeIdxMinList(nbFaces_*nvertex*4); 1231 size_t iIdxMin = 0; 1337 CClientClientDHTSizet::Index2VectorInfoTypeMap nodeIdx2Idx; 1338 CArray<size_t,1> nodeIdxList(nbFaces_*nvertex*4); 1339 size_t nIdx = 0; 1232 1340 1233 1341 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeHash2Info.begin(); it != nodeHash2Info.end(); ++it) 1234 1342 { 1235 size_t idxMin = (it->second)[0];1343 size_t rankMin = (it->second)[1]; 1236 1344 size_t idx = (it->second)[0]; 1237 1345 for (int i = 2; i < (it->second).size();) 1238 1346 { 1239 if ( mpiRank == (it->second)[i+1])1347 if ( (it->second)[i+1] < rankMin) 1240 1348 { 1241 1349 idx = (it->second)[i]; 1242 } 1243 if ((it->second)[i] < idxMin) 1244 { 1245 idxMin = (it->second)[i]; 1246 (it->second)[i] = (it->second)[i-2]; 1350 rankMin = (it->second)[i+1]; 1351 (it->second)[i+1] = (it->second)[i-1]; 1247 1352 } 1248 1353 i += 2; 1249 1354 } 1250 (it->second)[0] = idxMin; 1251 if (nodeIdx2IdxMin.count(idx) == 0) 1252 { 1253 nodeIdx2IdxMin[idx].push_back(idxMin); 1254 if (idx == idxMin) 1255 nodeIdx2IdxGlo[idxMin].push_back(idxMin); 1256 nodeIdxMinList(iIdxMin) = idxMin; 1257 ++iIdxMin; 1258 } 1259 } 1260 1261 nodeIdxMinList.resizeAndPreserve(iIdxMin); 1262 CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2IdxGlo, comm); 1263 CClientClientDHTSizet dhtNodeIdx(nodeIdx2IdxGlo, comm); 1264 dhtNodeIdx.computeIndexInfoMapping(nodeIdxMinList); 1265 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdxMin2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 1355 if (nodeIdx2Idx.count(idx) == 0) 1356 { 1357 if (mpiRank == rankMin) 1358 { 1359 nodeIdx2Idx[idx].push_back(rankMin); 1360 nodeIdx2Idx[idx].push_back(idx); 1361 } 1362 nodeIdxList(nIdx) = idx; 1363 ++nIdx; 1364 } 1365 } 1366 1367 // CDHTAutoIndexing dhtNodeIdxGlo = CDHTAutoIndexing(nodeIdx2Idx, comm); 1368 // CDHTAutoIndexing will not give consistent node numbering for varying number of procs. => 1369 // Solution: global node indexing by hand. 1370 // Maps modified in this step: 1371 // nodeIdx2Idx = <idx, idxGlo> 1372 int nodeCount = nodeIdx2Idx.size(); 1373 int nodeStart, nbNodes; 1374 MPI_Scan(&nodeCount, &nodeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 1375 int nNodes = nodeStart; 1376 MPI_Bcast(&nNodes, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 1377 nbNodesGlo = nNodes; 1378 1379 nodeStart -= nodeCount; 1380 node_start = nodeStart; 1381 node_count = nodeCount; 1382 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyMap; // just a dummy map used to ensure that each node is numbered only once 1383 size_t count = 0; 1384 1385 for (int nf = 0; nf < nbFaces_; ++nf) 1386 { 1387 for (int nv = 0; nv < nvertex; ++nv) 1388 { 1389 vector<size_t> hashValues = CMesh::createHashes(bounds_lon(nv, nf), bounds_lat(nv, nf)); 1390 size_t nodeIdx = generateNodeIndex(hashValues); 1391 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = nodeIdx2Idx.find(nodeIdx); 1392 if (it != nodeIdx2Idx.end()) 1393 { 1394 if (dummyMap.count(nodeIdx) == 0) 1395 { 1396 dummyMap[nodeIdx].push_back(nodeIdx); 1397 (it->second)[1] = node_start + count; 1398 ++count; 1399 } 1400 } 1401 } 1402 } 1403 nodeIdxList.resizeAndPreserve(nIdx); 1404 CClientClientDHTSizet dhtNodeIdx(nodeIdx2Idx, comm); 1405 dhtNodeIdx.computeIndexInfoMapping(nodeIdxList); 1406 CClientClientDHTSizet::Index2VectorInfoTypeMap& nodeIdx2IdxGlo = dhtNodeIdx.getInfoIndexMap(); 1266 1407 1267 1408 // (3.3) Saving node data: node_lon, node_lat, and face_nodes 1268 1409 // Generating edgeHash2Info = <hash, <idx, rank>> and edgeHashList 1269 nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal();1270 node_count = dhtNodeIdxGlo.getIndexCount();1271 node_start = dhtNodeIdxGlo.getIndexStart();1410 // nbNodesGlo = dhtNodeIdxGlo.getNbIndexesGlobal(); 1411 // node_count = dhtNodeIdxGlo.getIndexCount(); 1412 // node_start = dhtNodeIdxGlo.getIndexStart(); 1272 1413 node_lon.resize(node_count); 1273 1414 node_lat.resize(node_count); … … 1286 1427 vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 1287 1428 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1288 size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank);1289 size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank);1290 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2Idx Min.find(myNodeIdx1);1291 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2Idx Min.find(myNodeIdx2);1292 size_t owner NodeIdx= (itNodeIdx1->second)[0];1293 1294 if (myNodeIdx1 == ownerNodeIdx)1295 { 1296 itNodeIdxGlo1 = nodeIdx2IdxGlo.find(myNodeIdx1);1297 nodeIdxGlo1 = (itNodeIdxGlo1->second)[0];1429 size_t nodeIdx1 = generateNodeIndex(hashValues1); 1430 size_t nodeIdx2 = generateNodeIndex(hashValues2); 1431 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 1432 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 1433 size_t ownerRank = (itNodeIdx1->second)[0]; 1434 nodeIdxGlo1 = (itNodeIdx1->second)[1]; 1435 nodeIdxGlo2 = (itNodeIdx2->second)[1]; 1436 1437 if (mpiRank == ownerRank) 1438 { 1298 1439 node_lon(nodeIdxGlo1 - node_start) = bounds_lon(nv1, nf); 1299 1440 node_lat(nodeIdxGlo1 - node_start) = bounds_lat(nv1, nf); 1300 1441 } 1301 else1302 {1303 itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find(ownerNodeIdx);1304 nodeIdxGlo1 = (itNodeIdxGlo1->second)[0];1305 }1306 itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((itNodeIdx2->second)[0]);1307 nodeIdxGlo2 = (itNodeIdxGlo2->second)[0];1308 1442 if (nodeIdxGlo1 != nodeIdxGlo2) 1309 1443 { 1310 1444 size_t edgeHash = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1311 edgeHash2Idx[edgeHash].push_back( generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank));1445 edgeHash2Idx[edgeHash].push_back(edgeHash); 1312 1446 edgeHash2Idx[edgeHash].push_back(mpiRank); 1313 1447 edgeHashList(nEdgeHash) = edgeHash; … … 1321 1455 // (3.4) Generating global edge indexes 1322 1456 // Maps generated in this step are: 1323 // edgeIdx2Idx Min = = <idx, idxMin>1324 // edgeIdx2IdxGlo = <idxMin, idxGlo>1457 // edgeIdx2Idx = = <idx, <rankOwner, idx>> 1458 // edgeIdx2IdxGlo = <idxMin, <rankOwner, idxGlo>> 1325 1459 1326 1460 CClientClientDHTSizet dhtEdgeHash(edgeHash2Idx, comm); … … 1329 1463 // edgeHash2Info = <hash, [[idx1, rank1], [idx2, rank2], [idx3, rank3]..]> 1330 1464 1331 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxMin; 1332 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2IdxGlo; 1333 CArray<size_t,1> edgeIdxMinList(nbFaces_*nvertex); 1334 iIdxMin = 0; 1465 CClientClientDHTSizet::Index2VectorInfoTypeMap edgeIdx2Idx; 1335 1466 1336 1467 for (CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeHash2Info.begin(); it != edgeHash2Info.end(); ++it) 1337 1468 { 1338 size_t idxMin = (it->second)[0];1469 size_t rankMin = (it->second)[1]; 1339 1470 size_t idx = (it->second)[0]; 1340 1471 1341 1472 for (int i = 2; i < (it->second).size();) 1342 1473 { 1343 if (mpiRank == (it->second)[i+1]) 1344 { 1474 if ((it->second)[i+1] < rankMin) 1475 { 1476 rankMin = (it->second)[i+1]; 1345 1477 idx = (it->second)[i]; 1346 } 1347 if ((it->second)[i] < idxMin) 1348 { 1349 idxMin = (it->second)[i]; 1350 (it->second)[i] = (it->second)[i-2]; 1478 (it->second)[i+1] = (it->second)[i-1]; 1351 1479 } 1352 1480 i += 2; 1353 1481 } 1354 (it->second)[0] = idxMin; 1355 if (edgeIdx2IdxMin.count(idx) == 0) 1356 { 1357 edgeIdx2IdxMin[idx].push_back(idxMin); 1358 if (idx == idxMin) 1359 edgeIdx2IdxGlo[idxMin].push_back(idxMin); 1360 edgeIdxMinList(iIdxMin) = idxMin; 1361 ++iIdxMin; 1362 } 1363 } 1364 edgeIdxMinList.resizeAndPreserve(iIdxMin); 1365 CDHTAutoIndexing dhtEdgeIdxGlo = CDHTAutoIndexing(edgeIdx2IdxGlo, comm); 1366 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2IdxGlo, comm); 1367 dhtEdgeIdx.computeIndexInfoMapping(edgeIdxMinList); 1368 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdxMin2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1482 if (edgeIdx2Idx.count(idx) == 0) 1483 { 1484 if (mpiRank == rankMin) 1485 { 1486 edgeIdx2Idx[idx].push_back(rankMin); 1487 edgeIdx2Idx[idx].push_back(idx); 1488 } 1489 } 1490 } 1491 1492 int edgeCount = edgeIdx2Idx.size(); 1493 int edgeStart, nbEdges; 1494 MPI_Scan(&edgeCount, &edgeStart, 1, MPI_UNSIGNED_LONG, MPI_SUM, comm); 1495 int nEdges = edgeStart; 1496 MPI_Bcast(&nEdges, 1, MPI_UNSIGNED_LONG, mpiSize-1, comm); 1497 nbEdgesGlo = nEdges; 1498 1499 edgeStart -= edgeCount; 1500 edge_start = edgeStart; 1501 edge_count = edgeCount; 1502 CClientClientDHTSizet::Index2VectorInfoTypeMap dummyEdgeMap; 1503 count = 0; 1504 1505 for (int nf = 0; nf < nbFaces_; ++nf) 1506 { 1507 for (int nv1 = 0; nv1 < nvertex; ++nv1) 1508 { 1509 int nv2 = (nv1 < nvertex -1 ) ? (nv1 + 1) : (nv1 + 1 - nvertex); // cyclic rotation 1510 vector<size_t> hashValues1 = CMesh::createHashes(bounds_lon(nv1, nf), bounds_lat(nv1, nf)); 1511 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1512 size_t nodeIdx1 = generateNodeIndex(hashValues1); 1513 size_t nodeIdx2 = generateNodeIndex(hashValues2); 1514 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx1 = nodeIdx2IdxGlo.find(nodeIdx1); 1515 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itNodeIdx2 = nodeIdx2IdxGlo.find(nodeIdx2); 1516 nodeIdxGlo1 = (itNodeIdx1->second)[1]; 1517 nodeIdxGlo2 = (itNodeIdx2->second)[1]; 1518 1519 if (nodeIdxGlo1 != nodeIdxGlo2) 1520 { 1521 size_t edgeIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1522 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator it = edgeIdx2Idx.find(edgeIdx); 1523 if (it != edgeIdx2Idx.end()) 1524 { 1525 if (dummyEdgeMap.count(edgeIdx) == 0) 1526 { 1527 dummyEdgeMap[edgeIdx].push_back(edgeIdx); 1528 (it->second)[1] = edge_start + count; 1529 ++count; 1530 } 1531 } 1532 } 1533 } 1534 } 1535 CClientClientDHTSizet dhtEdgeIdx(edgeIdx2Idx, comm); 1536 dhtEdgeIdx.computeIndexInfoMapping(edgeHashList); 1537 CClientClientDHTSizet::Index2VectorInfoTypeMap& edgeIdx2IdxGlo = dhtEdgeIdx.getInfoIndexMap(); 1369 1538 1370 1539 // (3.5) Saving variables: edge_lon, edge_lat, face_edges 1371 1540 // Creating map edgeIdxGlo2Face <idxGlo, face> 1372 1373 nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal();1374 edge_count = dhtEdgeIdxGlo.getIndexCount();1375 edge_start = dhtEdgeIdxGlo.getIndexStart(); 1541 // nbEdgesGlo = dhtEdgeIdxGlo.getNbIndexesGlobal(); 1542 // edge_count = dhtEdgeIdxGlo.getIndexCount(); 1543 // edge_start = dhtEdgeIdxGlo.getIndexStart(); 1544 1376 1545 edge_lon.resize(edge_count); 1377 1546 edge_lat.resize(edge_count); … … 1393 1562 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1394 1563 1395 size_t myNodeIdx1 = generateNodeIndex(hashValues1, mpiRank); 1396 size_t myNodeIdx2 = generateNodeIndex(hashValues2, mpiRank); 1397 it1 = nodeIdx2IdxMin.find(myNodeIdx1); 1398 it2 = nodeIdx2IdxMin.find(myNodeIdx2); 1399 itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 1400 itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 1401 size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 1402 size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 1564 size_t nodeIdx1 = generateNodeIndex(hashValues1); 1565 size_t nodeIdx2 = generateNodeIndex(hashValues2); 1566 it1 = nodeIdx2IdxGlo.find(nodeIdx1); 1567 it2 = nodeIdx2IdxGlo.find(nodeIdx2); 1568 size_t nodeIdxGlo1 = (it1->second)[1]; 1569 size_t nodeIdxGlo2 = (it2->second)[1]; 1403 1570 1404 1571 if (nodeIdxGlo1 != nodeIdxGlo2) 1405 1572 { 1406 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1407 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1408 size_t ownerIdx = (itIdx->second)[0]; 1409 int edgeIdxGlo; 1573 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1574 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 1575 int edgeIdxGlo = (itIdx->second)[1]; 1410 1576 size_t faceIdxGlo = nbFacesAccum + nf; 1411 1577 1412 if (m yIdx == ownerIdx)1578 if (mpiRank == (itIdx->second)[0]) 1413 1579 { 1414 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);1415 edgeIdxGlo = (itIdxGlo->second)[0];1416 1580 double edgeLon; 1417 1581 double diffLon = abs(bounds_lon(nv1, nf) - bounds_lon(nv2, nf)); … … 1427 1591 edge_nodes(1, edgeIdxGlo - edge_start) = nodeIdxGlo2; 1428 1592 } 1429 else1430 {1431 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);1432 edgeIdxGlo = (itIdxGlo->second)[0];1433 }1434 1593 face_edges(nv1,nf) = edgeIdxGlo; 1435 1594 if (edgeIdxGlo2Face.count(edgeIdxGlo) == 0) … … 1465 1624 vector<size_t> hashValues2 = CMesh::createHashes(bounds_lon(nv2, nf), bounds_lat(nv2, nf)); 1466 1625 1467 size_t myNodeIdx1 = generateNodeIndex(hashValues1 , mpiRank);1468 size_t myNodeIdx2 = generateNodeIndex(hashValues2 , mpiRank);1626 size_t myNodeIdx1 = generateNodeIndex(hashValues1); 1627 size_t myNodeIdx2 = generateNodeIndex(hashValues2); 1469 1628 if (myNodeIdx1 != myNodeIdx2) 1470 1629 { 1471 it1 = nodeIdx2IdxMin.find(myNodeIdx1); 1472 it2 = nodeIdx2IdxMin.find(myNodeIdx2); 1473 itNodeIdxGlo1 = nodeIdxMin2IdxGlo.find((it1->second)[0]); 1474 itNodeIdxGlo2 = nodeIdxMin2IdxGlo.find((it2->second)[0]); 1475 size_t nodeIdxGlo1 = (itNodeIdxGlo1->second)[0]; 1476 size_t nodeIdxGlo2 = (itNodeIdxGlo2->second)[0]; 1477 1478 size_t myIdx = generateEdgeIndex(nodeIdxGlo1, nodeIdxGlo2, mpiRank); 1479 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxMin.find(myIdx); 1480 size_t ownerIdx = (itIdx->second)[0]; 1630 it1 = nodeIdx2IdxGlo.find(myNodeIdx1); 1631 it2 = nodeIdx2IdxGlo.find(myNodeIdx2); 1632 size_t nodeIdxGlo1 = (it1->second)[1]; 1633 size_t nodeIdxGlo2 = (it2->second)[1]; 1634 size_t myIdx = hashPairOrdered(nodeIdxGlo1, nodeIdxGlo2); 1635 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdx = edgeIdx2IdxGlo.find(myIdx); 1636 int edgeIdxGlo = (itIdx->second)[1]; 1637 1481 1638 size_t faceIdxGlo = nbFacesAccum + nf; 1482 1639 1483 if (m yIdx == ownerIdx)1640 if (mpiRank == (itIdx->second)[0]) 1484 1641 { 1485 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdx2IdxGlo.find(myIdx);1486 int edgeIdxGlo = (itIdxGlo->second)[0];1487 1642 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1488 1643 int face1 = it1->second[0]; … … 1500 1655 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 1501 1656 } 1502 } // myIdx == ownerIdx1657 } 1503 1658 else 1504 1659 { 1505 CClientClientDHTSizet::Index2VectorInfoTypeMap::iterator itIdxGlo = edgeIdxMin2IdxGlo.find(ownerIdx);1506 size_t edgeIdxGlo = (itIdxGlo->second)[0];1507 1660 it1 = edgeIdxGlo2FaceIdx.find(edgeIdxGlo); 1508 1661 int face1 = it1->second[0]; 1509 1662 int face2 = it1->second[1]; 1510 1663 face_faces(nv1, nf) = (faceIdxGlo == face1 ? face2 : face1); 1511 } // myIdx != ownerIdx1664 } 1512 1665 } // myNodeIdx1 != myNodeIdx2 1513 1666 else … … 1515 1668 } 1516 1669 } 1670 1517 1671 } 1518 1672 facesAreWritten = true; -
XIOS/dev/dev_olga/src/node/scalar.cpp
r1144 r1158 63 63 { 64 64 65 } 66 67 /*! 68 Compare two scalar objects. 69 They are equal if only if they have identical attributes as well as their values. 70 Moreover, they must have the same transformations. 71 \param [in] scalar Compared scalar 72 \return result of the comparison 73 */ 74 bool CScalar::isEqual(CScalar* obj) 75 { 76 vector<StdString> excludedAttr; 77 excludedAttr.push_back("scalar_ref"); 78 bool objEqual = SuperClass::isEqual(obj, excludedAttr); 79 if (!objEqual) return objEqual; 80 81 TransMapTypes thisTrans = this->getAllTransformations(); 82 TransMapTypes objTrans = obj->getAllTransformations(); 83 84 TransMapTypes::const_iterator it, itb, ite; 85 std::vector<ETranformationType> thisTransType, objTransType; 86 for (it = thisTrans.begin(); it != thisTrans.end(); ++it) 87 thisTransType.push_back(it->first); 88 for (it = objTrans.begin(); it != objTrans.end(); ++it) 89 objTransType.push_back(it->first); 90 91 if (thisTransType.size() != objTransType.size()) return false; 92 for (int idx = 0; idx < thisTransType.size(); ++idx) 93 objEqual &= (thisTransType[idx] == objTransType[idx]); 94 95 return objEqual; 65 96 } 66 97 -
XIOS/dev/dev_olga/src/node/scalar.hpp
r1144 r1158 76 76 void duplicateTransformation(CScalar*); 77 77 CTransformation<CScalar>* addTransformation(ETranformationType transType, const StdString& id=""); 78 bool isEqual(CScalar* scalar); 78 79 79 80 private: 80 81 std::set<StdString> relFiles; 82 TransMapTypes transformationMap_; 81 83 82 private:83 TransMapTypes transformationMap_;84 84 void setTransformations(const TransMapTypes&); 85 85 -
XIOS/dev/dev_olga/src/node/variable.cpp
r1071 r1158 40 40 if (!node.getContent(this->content)) 41 41 { 42 xml::THashAttributes attributes = node.getAttributes(); 43 StdString variableName = attributes["name"]; 44 45 node.goToParentElement(); 46 StdString parentName = node.getElementName(); 47 attributes = node.getAttributes(); 48 error << "The variable id = " << id << " and name = " << variableName << " does not have any content. Please define it!" << std::endl 49 << "This variable is inside another element whose attributes are :" << std::endl; 50 51 for (xml::THashAttributes::iterator it = attributes.begin(); it != attributes.end(); ++it) 52 { 53 error << it->first << "=\"" << it->second.c_str() << "\" "; 54 } 55 error << std::endl; 56 42 57 ERROR("CVariable::parse(xml::CXMLNode & node)", 43 58 << "[ variable id = " << id 44 << " ] variable is not defined ! ");59 << " ] variable is not defined !. It does not have any content. See error log for more details."); 45 60 } 46 61 content = boost::trim_copy(content) ; … … 108 123 } 109 124 } 110 111 // if (!context->hasServer)112 // {113 // CContextClient* client=context->client ;114 115 // CEventClient event(this->getType(),EVENT_ID_VARIABLE_VALUE) ;116 // if (client->isServerLeader())117 // {118 // CMessage msg ;119 // msg<<this->getId() ;120 // msg<<content ;121 // const std::list<int>& ranks = client->getRanksServerLeader();122 // for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)123 // event.push(*itRank,1,msg);124 // client->sendEvent(event) ;125 // }126 // else client->sendEvent(event) ;127 // }128 125 } 129 126 -
XIOS/dev/dev_olga/src/node/variable.hpp
r1071 r1158 9 9 #include "attribute_enum.hpp" 10 10 #include "attribute_enum_impl.hpp" 11 #include "declare_attribute.hpp" 11 12 12 13 namespace xios -
XIOS/dev/dev_olga/src/object_template.hpp
r1021 r1158 67 67 static bool dispatchEvent(CEventServer& event) ; 68 68 69 bool isEqual(const string& id, const vector<StdString>& excludedAttrs); 70 bool isEqual(T* obj, const vector<StdString>& excludedAttrs); 71 69 72 /// Accesseur statique /// 70 73 static std::vector<boost::shared_ptr<DerivedType> > & -
XIOS/dev/dev_olga/src/object_template_impl.hpp
r1054 r1158 136 136 } 137 137 138 /*! 139 Compare two object of same type 140 */ 141 template <class T> 142 bool CObjectTemplate<T>::isEqual(const string& id, const vector<StdString>& excludedAttrs) 143 { 144 T* obj = CObjectTemplate<T>::get(id); 145 return this->isEqual(obj, excludedAttrs); 146 } 147 148 template <class T> 149 bool CObjectTemplate<T>::isEqual(T* obj, const vector<StdString>& excludedAttrs) 150 { 151 152 CAttributeMap& attrMapThis = *this; 153 CAttributeMap& attrMapObj = *obj; 154 return (attrMapThis.isEqual(attrMapObj, excludedAttrs)); 155 } 156 138 157 //--------------------------------------------------------------- 139 158 … … 199 218 } 200 219 } 201 202 // if (client->isServerLeader())203 // {204 // size_t minimumSize = 0;205 // CAttributeMap& attrMap = *this;206 // CAttributeMap::const_iterator it = attrMap.begin(), itE = attrMap.end();207 // for (; it != itE; ++it)208 // {209 // if (!it->second->isEmpty())210 // {211 // size_t size = it->second->getName().size() + sizeof(size_t) + it->second->size();212 // if (size > minimumSize)213 // minimumSize = size;214 // }215 // }216 217 // if (minimumSize)218 // {219 // // Account for extra header info220 // minimumSize += CEventClient::headerSize + getIdServer().size() + sizeof(size_t);221 222 // const std::list<int>& ranks = client->getRanksServerLeader();223 // for (std::list<int>::const_iterator itRank = ranks.begin(), itRankEnd = ranks.end(); itRank != itRankEnd; ++itRank)224 // minimumSizes.insert(std::make_pair(*itRank, minimumSize));225 // }226 // }227 228 220 return minimumSizes; 229 221 } … … 257 249 CAttributeMap & attrMap = *this; 258 250 CAttribute* attr=attrMap[id]; 259 if (attr->doSend()) 260 sendAttributToServer(*attr); 251 sendAttributToServer(*attr); 261 252 } 262 253 … … 369 360 } 370 361 371 372 362 template <class T> 373 363 void CObjectTemplate<T>::recvAttributFromClient(CEventServer& event) -
XIOS/dev/dev_olga/src/parse_expr/filter_expr_node.cpp
r643 r1158 2 2 #include "unary_arithmetic_filter.hpp" 3 3 #include "binary_arithmetic_filter.hpp" 4 #include "ternary_arithmetic_filter.hpp" 4 5 #include "field.hpp" 5 6 … … 40 41 boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 41 42 { 42 if (!CField::has(fieldId)) 43 boost::shared_ptr<COutputPin> outputPin; 44 45 if (fieldId == "this") 46 outputPin = thisField.getSelfTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 47 else if (CField::has(fieldId)) 48 { 49 CField* field = CField::get(fieldId); 50 if (field == &thisField) 51 ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 52 << "The field " << fieldId << " has an invalid reference to itself. " 53 << "Use the keyword \"this\" if you want to reference the input data sent to this field."); 54 55 field->buildFilterGraph(gc, false); 56 outputPin = field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 57 } 58 else 43 59 ERROR("boost::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 44 60 << "The field " << fieldId << " does not exist."); 45 61 46 CField* field = CField::get(fieldId); 47 if (field == &thisField) 48 ERROR("boost::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField) const", 49 << "The field " << fieldId << " has an invalid reference to itself."); 50 51 field->buildFilterGraph(gc, false); 52 return field->getTemporalDataFilter(gc, thisField.freq_op.isEmpty() ? TimeStep : thisField.freq_op); 62 return outputPin; 53 63 } 54 64 … … 120 130 return filter; 121 131 } 132 133 134 135 136 CFilterScalarScalarFieldOpExprNode::CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3) 137 : child1(child1) 138 , opId(opId) 139 , child2(child2) 140 , child3(child3) 141 { 142 if (!child1 || !child2 || !child3) 143 ERROR(" CFilterScalarScalarFieldOpExprNode::CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3)", 144 "Impossible to create the new expression node, an invalid child node was provided."); 145 } 146 147 boost::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 148 { 149 boost::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 150 child3->reduce(gc, thisField)->connectOutput(filter, 0); 151 return filter; 152 } 153 154 155 CFilterScalarFieldScalarOpExprNode::CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3) 156 : child1(child1) 157 , opId(opId) 158 , child2(child2) 159 , child3(child3) 160 { 161 if (!child1 || !child2 || !child3) 162 ERROR(" CFilterScalarFieldScalarOpExprNode::CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3)", 163 "Impossible to create the new expression node, an invalid child node was provided."); 164 } 165 166 boost::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 167 { 168 boost::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 169 child2->reduce(gc, thisField)->connectOutput(filter, 0); 170 return filter; 171 } 172 173 174 CFilterScalarFieldFieldOpExprNode::CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3) 175 : child1(child1) 176 , opId(opId) 177 , child2(child2) 178 , child3(child3) 179 { 180 if (!child1 || !child2 || !child3) 181 ERROR(" CFilterScalarFieldFieldOpExprNode::CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3)", 182 "Impossible to create the new expression node, an invalid child node was provided."); 183 } 184 185 boost::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 186 { 187 boost::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); 188 child2->reduce(gc, thisField)->connectOutput(filter, 0); 189 child3->reduce(gc, thisField)->connectOutput(filter, 1); 190 return filter; 191 } 192 193 194 195 CFilterFieldScalarScalarOpExprNode::CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3) 196 : child1(child1) 197 , opId(opId) 198 , child2(child2) 199 , child3(child3) 200 { 201 if (!child1 || !child2 || !child3) 202 ERROR(" CFilterFieldScalarScalarOpExprNode::CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3)", 203 "Impossible to create the new expression node, an invalid child node was provided."); 204 } 205 206 boost::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 207 { 208 boost::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 209 child1->reduce(gc, thisField)->connectOutput(filter, 0); 210 return filter; 211 } 212 213 214 215 CFilterFieldScalarFieldOpExprNode::CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3) 216 : child1(child1) 217 , opId(opId) 218 , child2(child2) 219 , child3(child3) 220 { 221 if (!child1 || !child2 || !child3) 222 ERROR(" CFilterFieldScalarFieldOpExprNode::CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3)", 223 "Impossible to create the new expression node, an invalid child node was provided."); 224 } 225 226 boost::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 227 { 228 boost::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); 229 child1->reduce(gc, thisField)->connectOutput(filter, 0); 230 child3->reduce(gc, thisField)->connectOutput(filter, 1); 231 return filter; 232 } 233 234 235 236 CFilterFieldFieldScalarOpExprNode::CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3) 237 : child1(child1) 238 , opId(opId) 239 , child2(child2) 240 , child3(child3) 241 { 242 if (!child1 || !child2 || !child3) 243 ERROR(" CFilterFieldFieldScalarOpExprNode::CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3)", 244 "Impossible to create the new expression node, an invalid child node was provided."); 245 } 246 247 boost::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 248 { 249 boost::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); 250 child1->reduce(gc, thisField)->connectOutput(filter, 0); 251 child2->reduce(gc, thisField)->connectOutput(filter, 1); 252 return filter; 253 } 254 255 256 CFilterFieldFieldFieldOpExprNode::CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3) 257 : child1(child1) 258 , opId(opId) 259 , child2(child2) 260 , child3(child3) 261 { 262 if (!child1 || !child2 || !child3) 263 ERROR(" CFilterFieldFieldFieldOpExprNode::CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3)", 264 "Impossible to create the new expression node, an invalid child node was provided."); 265 } 266 267 boost::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 268 { 269 boost::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); 270 child1->reduce(gc, thisField)->connectOutput(filter, 0); 271 child2->reduce(gc, thisField)->connectOutput(filter, 1); 272 child3->reduce(gc, thisField)->connectOutput(filter, 2); 273 return filter; 274 } 275 122 276 } -
XIOS/dev/dev_olga/src/parse_expr/filter_expr_node.hpp
r643 r1158 169 169 boost::scoped_ptr<IFilterExprNode> child1, child2; //!< The field child nodes to which the operator is applied 170 170 }; 171 172 173 174 /*! 175 * Expression node corresponding to a ternary operation on a scalar-scalar-field. 176 */ 177 class CFilterScalarScalarFieldOpExprNode : public IFilterExprNode 178 { 179 public: 180 /*! 181 * Constructs an expression node corresponding to the specified ternary operation 182 * applied to the provided fields and scalars child nodes. 183 * Note that the child nodes will be destroyed automatically when the parent node 184 * is destroyed. 185 * 186 * \param child1 the scalar child node to which the operator is applied 187 * \param opId the identifier of the operator 188 * \param child2 the scalar child node to which the operator is applied 189 * \param child3 the field child node to which the operator is applied 190 */ 191 CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 192 193 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 194 195 private: 196 std::string opId; //!< The identifier of the field 197 boost::scoped_ptr<IScalarExprNode> child1; //!< The scalar child node to which the operator is applied 198 boost::scoped_ptr<IScalarExprNode> child2; //!< The scalar child node to which the operator is applied 199 boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 200 }; 201 202 203 /*! 204 * Expression node corresponding to a ternary operation on a scalar-field-scalar. 205 */ 206 class CFilterScalarFieldScalarOpExprNode : public IFilterExprNode 207 { 208 public: 209 /*! 210 * Constructs an expression node corresponding to the specified ternary operation 211 * applied to the provided fields and scalars child nodes. 212 * Note that the child nodes will be destroyed automatically when the parent node 213 * is destroyed. 214 * 215 * \param child1 the scalar child node to which the operator is applied 216 * \param opId the identifier of the operator 217 * \param child2 the field child node to which the operator is applied 218 * \param child3 the scalar child node to which the operator is applied 219 */ 220 CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 221 222 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 223 224 private: 225 std::string opId; //!< The identifier of the field 226 boost::scoped_ptr<IScalarExprNode> child1; //!< The scalar child node to which the operator is applied 227 boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 228 boost::scoped_ptr<IScalarExprNode> child3; //!< The scalar child node to which the operator is applied 229 }; 230 231 232 /*! 233 * Expression node corresponding to a ternary operation on a scalar-field-field. 234 */ 235 class CFilterScalarFieldFieldOpExprNode : public IFilterExprNode 236 { 237 public: 238 /*! 239 * Constructs an expression node corresponding to the specified ternary operation 240 * applied to the provided fields and scalars child nodes. 241 * Note that the child nodes will be destroyed automatically when the parent node 242 * is destroyed. 243 * 244 * \param child1 the scalar child node to which the operator is applied 245 * \param opId the identifier of the operator 246 * \param child2 the field child node to which the operator is applied 247 * \param child3 the field child node to which the operator is applied 248 */ 249 CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 250 251 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 252 253 private: 254 std::string opId; //!< The identifier of the field 255 boost::scoped_ptr<IScalarExprNode> child1; //!< The scalar child node to which the operator is applied 256 boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 257 boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 258 }; 259 260 261 262 /*! 263 * Expression node corresponding to a ternary operation on a field-scalar-scalar. 264 */ 265 class CFilterFieldScalarScalarOpExprNode : public IFilterExprNode 266 { 267 public: 268 /*! 269 * Constructs an expression node corresponding to the specified ternary operation 270 * applied to the provided fields and scalars child nodes. 271 * Note that the child nodes will be destroyed automatically when the parent node 272 * is destroyed. 273 * 274 * \param child1 the field child node to which the operator is applied 275 * \param opId the identifier of the operator 276 * \param child2 the scalar child node to which the operator is applied 277 * \param child3 the scalar child node to which the operator is applied 278 */ 279 CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3); 280 281 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 282 283 private: 284 std::string opId; //!< The identifier of the field 285 boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 286 boost::scoped_ptr<IScalarExprNode> child2; //!< The scalar child node to which the operator is applied 287 boost::scoped_ptr<IScalarExprNode> child3; //!< The scalar child node to which the operator is applied 288 }; 289 290 291 /*! 292 * Expression node corresponding to a ternary operation on a field-scalar-field. 293 */ 294 class CFilterFieldScalarFieldOpExprNode : public IFilterExprNode 295 { 296 public: 297 /*! 298 * Constructs an expression node corresponding to the specified ternary operation 299 * applied to the provided fields and scalars child nodes. 300 * Note that the child nodes will be destroyed automatically when the parent node 301 * is destroyed. 302 * 303 * \param child1 the field child node to which the operator is applied 304 * \param opId the identifier of the operator 305 * \param child2 the scalar child node to which the operator is applied 306 * \param child3 the field child node to which the operator is applied 307 */ 308 CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 309 310 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 311 312 private: 313 std::string opId; //!< The identifier of the field 314 boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 315 boost::scoped_ptr<IScalarExprNode> child2; //!< The scalar child node to which the operator is applied 316 boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 317 }; 318 319 /*! 320 * Expression node corresponding to a ternary operation on a field-field-scalar. 321 */ 322 class CFilterFieldFieldScalarOpExprNode : public IFilterExprNode 323 { 324 public: 325 /*! 326 * Constructs an expression node corresponding to the specified ternary operation 327 * applied to the provided fields and scalars child nodes. 328 * Note that the child nodes will be destroyed automatically when the parent node 329 * is destroyed. 330 * 331 * \param child1 the field child node to which the operator is applied 332 * \param opId the identifier of the operator 333 * \param child2 the field child node to which the operator is applied 334 * \param child3 the scalar child node to which the operator is applied 335 */ 336 CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 337 338 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 339 340 private: 341 std::string opId; //!< The identifier of the field 342 boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 343 boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 344 boost::scoped_ptr<IScalarExprNode> child3; //!< The scalar child node to which the operator is applied 345 }; 346 347 348 /*! 349 * Expression node corresponding to a ternary operation on a field-field-field. 350 */ 351 class CFilterFieldFieldFieldOpExprNode : public IFilterExprNode 352 { 353 public: 354 /*! 355 * Constructs an expression node corresponding to the specified ternary operation 356 * applied to the provided fields and scalars child nodes. 357 * Note that the child nodes will be destroyed automatically when the parent node 358 * is destroyed. 359 * 360 * \param child1 the field child node to which the operator is applied 361 * \param opId the identifier of the operator 362 * \param child2 the field child node to which the operator is applied 363 * \param child3 the field child node to which the operator is applied 364 */ 365 CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 366 367 virtual boost::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField) const; 368 369 private: 370 std::string opId; //!< The identifier of the field 371 boost::scoped_ptr<IFilterExprNode> child1; //!< The field child node to which the operator is applied 372 boost::scoped_ptr<IFilterExprNode> child2; //!< The field child node to which the operator is applied 373 boost::scoped_ptr<IFilterExprNode> child3; //!< The field child node to which the operator is applied 374 }; 375 376 377 171 378 } 172 379 -
XIOS/dev/dev_olga/src/parse_expr/generate_lex_yacc.sh
r501 r1158 1 bison - d yacc_parser.yacc -o yacc_parser.cpp1 bison --verbose -d yacc_parser.yacc -o yacc_parser.cpp 2 2 flex -o lex_parser.cpp -f lex_parser.lex -
XIOS/dev/dev_olga/src/parse_expr/lex_parser.cpp
r728 r1158 10 10 #define YY_FLEX_MAJOR_VERSION 2 11 11 #define YY_FLEX_MINOR_VERSION 5 12 #define YY_FLEX_SUBMINOR_VERSION 3 912 #define YY_FLEX_SUBMINOR_VERSION 37 13 13 #if YY_FLEX_SUBMINOR_VERSION > 0 14 14 #define FLEX_BETA … … 143 143 /* Size of default input buffer. */ 144 144 #ifndef YY_BUF_SIZE 145 #ifdef __ia64__146 /* On IA-64, the buffer size is 16k, not 8k.147 * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.148 * Ditto for the __ia64__ case accordingly.149 */150 #define YY_BUF_SIZE 32768151 #else152 145 #define YY_BUF_SIZE 16384 153 #endif /* __ia64__ */154 146 #endif 155 147 … … 177 169 178 170 #define YY_LESS_LINENO(n) 179 #define YY_LINENO_REWIND_TO(ptr)180 171 181 172 /* Return all but the first "n" matched characters back to the input stream. */ … … 356 347 extern char *yytext; 357 348 #define yytext_ptr yytext 358 359 349 static yyconst flex_int16_t yy_nxt[][128] = 360 350 { … … 382 372 4, 4, 5, 4, 4, 4, 6, 4, 4, 4, 383 373 7, 8, 9, 10, 4, 11, 4, 12, 13, 13, 384 13, 13, 13, 13, 13, 13, 13, 13, 385 1 4, 15, 16, 4, 17, 18, 18, 18, 18, 18,386 387 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,388 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,389 18, 4, 4, 4, 19, 4, 4, 18, 18, 18,390 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,391 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,392 18, 18, 18, 4, 4, 4, 4, 4374 13, 13, 13, 13, 13, 13, 13, 13, 14, 4, 375 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 376 377 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 378 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 379 20, 4, 4, 4, 21, 4, 4, 20, 20, 20, 380 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 381 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 382 20, 20, 20, 4, 4, 4, 4, 4 393 383 }, 394 384 … … 400 390 401 391 7, 8, 9, 10, 4, 11, 4, 12, 13, 13, 402 13, 13, 13, 13, 13, 13, 13, 13, 403 1 4, 15, 16, 4, 17, 18, 18, 18, 18, 18,404 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,405 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,406 18, 4, 4, 4, 19, 4, 4, 18, 18, 18,407 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,408 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,409 18, 18, 18, 4, 4, 4, 4, 4392 13, 13, 13, 13, 13, 13, 13, 13, 14, 4, 393 15, 16, 17, 18, 19, 20, 20, 20, 20, 20, 394 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 395 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 396 20, 4, 4, 4, 21, 4, 4, 20, 20, 20, 397 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 398 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 399 20, 20, 20, 4, 4, 4, 4, 4 410 400 }, 411 401 … … 446 436 447 437 { 448 3, -5, -5, -5, -5, -5, -5, -5, -5, 2 1,438 3, -5, -5, -5, -5, -5, -5, -5, -5, 23, 449 439 -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 450 440 -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 451 -5, -5, 2 1, -5, -5, -5, -5, -5, -5, -5,441 -5, -5, 23, -5, -5, -5, -5, -5, -5, -5, 452 442 -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 453 443 … … 470 460 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, 471 461 -6, -6, -6, -6, -6, -6, -6, -6, -6, -6, 472 -6, -6, -6, -6, -6, 2 2, 22, 22, 22, 22,473 2 2, 22, 22, 22, 22, 22, 22, 22, 22, 22,474 2 2, 22, 22, 22, 22, 22, 22, 22, 22, 22,475 2 2, -6, -6, -6, -6, -6, -6, 22, 22, 22,476 2 2, 22, 22, 22, 22, 22, 22, 22, 22, 22,477 2 2, 22, 22, 22, 22, 22, 22, 22, 22, 22,478 479 2 2, 22, 22, -6, -6, -6, -6, -6462 -6, -6, -6, -6, -6, 24, 24, 24, 24, 24, 463 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 464 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 465 24, -6, -6, -6, -6, -6, -6, 24, 24, 24, 466 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 467 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 468 469 24, 24, 24, -6, -6, -6, -6, -6 480 470 }, 481 471 … … 574 564 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 575 565 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 576 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12,566 -12, 25, -12, -12, -12, -12, -12, -12, -12, -12, 577 567 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, 578 568 -12, -12, -12, -12, -12, -12, -12, -12, -12, -12, … … 589 579 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 590 580 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 591 -13, -13, -13, -13, -13, -13, 2 3, -13, 24, 24,592 2 4, 24, 24, 24, 24, 24, 24, 24, -13, -13,593 -13, -13, -13, -13, -13, -13, -13, -13, -13, 2 5,581 -13, -13, -13, -13, -13, -13, 26, -13, 27, 27, 582 27, 27, 27, 27, 27, 27, 27, 27, -13, -13, 583 -13, -13, -13, -13, -13, -13, -13, -13, -13, 28, 594 584 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 595 585 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 596 586 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, 597 -13, 2 5, -13, -13, -13, -13, -13, -13, -13, -13,587 -13, 28, -13, -13, -13, -13, -13, -13, -13, -13, 598 588 599 589 -13, -13, -13, -13, -13, -13, -13, -13, -13, -13, … … 608 598 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 609 599 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 610 -14, 26, -14, -14, -14, -14, -14, -14, -14, -14,600 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 611 601 -14, -14, -14, -14, -14, -14, -14, -14, -14, -14, 612 602 … … 626 616 627 617 -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, 628 -15, 2 7, -15, -15, -15, -15, -15, -15, -15, -15,618 -15, 29, -15, -15, -15, -15, -15, -15, -15, -15, 629 619 -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, 630 620 -15, -15, -15, -15, -15, -15, -15, -15, -15, -15, … … 643 633 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 644 634 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 645 -16, 28, -16, -16, -16, -16, -16, -16, -16, -16,635 -16, 30, -16, -16, -16, -16, -16, -16, -16, -16, 646 636 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, 647 637 -16, -16, -16, -16, -16, -16, -16, -16, -16, -16, … … 660 650 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 661 651 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 662 -17, -17, -17, -17, -17, 29, 29, 29, 29, 29,663 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,664 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,665 666 29, -17, -17, -17, -17, -17, -17, 29, 29, 29,667 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,668 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,669 29, 29, 29, -17, -17, -17, -17, -17652 -17, 31, -17, -17, -17, -17, -17, -17, -17, -17, 653 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 654 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 655 656 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 657 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 658 -17, -17, -17, -17, -17, -17, -17, -17, -17, -17, 659 -17, -17, -17, -17, -17, -17, -17, -17 670 660 }, 671 661 … … 675 665 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 676 666 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 677 -18, -18, -18, -18, -18, -18, -18, -18, 30, 30,678 30, 30, 30, 30, 30, 30, 30, 30, -18, -18,679 680 -18, -18, -18, -18, -18, 30, 30, 30, 30, 30,681 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,682 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,683 30, -18, -18, -18, -18, 30, -18, 30, 30, 30,684 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,685 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,686 30, 30, 30, -18, -18, -18, -18, -18667 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 668 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 669 670 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 671 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 672 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 673 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 674 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 675 -18, -18, -18, -18, -18, -18, -18, -18, -18, -18, 676 -18, -18, -18, -18, -18, -18, -18, -18 687 677 }, 688 678 … … 695 685 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, 696 686 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19, 697 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,698 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,699 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,700 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,701 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,702 -19, -19, -19, -19, -19, -19, -19, -19, -19, -19,703 -19, -19, -19, -19, -19, -19, -19, -19687 -19, -19, -19, -19, -19, 32, 32, 32, 32, 32, 688 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 689 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 690 32, -19, -19, -19, -19, -19, -19, 32, 32, 32, 691 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 692 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 693 32, 32, 32, -19, -19, -19, -19, -19 704 694 705 695 }, … … 710 700 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, 711 701 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20, 712 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,713 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,714 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,715 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,716 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,717 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,718 719 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,720 -20, -20, -20, -20, -20, -20, -20, -20, -20, -20,721 -20, -20, -20, -20, -20, -20, -20, -20722 }, 723 724 { 725 3, -21, -21, -21, -21, -21, -21, -21, -21, 702 -20, -20, -20, -20, -20, -20, -20, -20, 33, 33, 703 33, 33, 33, 33, 33, 33, 33, 33, -20, -20, 704 -20, -20, -20, -20, -20, 33, 33, 33, 33, 33, 705 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 706 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 707 33, -20, -20, -20, -20, 33, -20, 33, 33, 33, 708 709 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 710 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 711 33, 33, 33, -20, -20, -20, -20, -20 712 }, 713 714 { 715 3, -21, -21, -21, -21, -21, -21, -21, -21, -21, 726 716 -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, 727 717 -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, 728 -21, -21, 718 -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, 729 719 -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, 730 720 -21, -21, -21, -21, -21, -21, -21, -21, -21, -21, … … 745 735 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 746 736 747 -22, -22, -22, -22, -22, -22, -22, -22, 31, 31,748 31, 31, 31, 31, 31, 31, 31, 31, -22, -22,749 -22, -22, -22, -22, -22, 31, 31, 31, 31, 31,750 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,751 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,752 31, -22, -22, -22, -22, 31, -22, 31, 31, 31,753 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,754 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,755 31, 31, 31, -22, -22, -22, -22, -22756 }, 757 758 { 759 3, -23, -23, -23, -23, -23, -23, -23, -23, -23,737 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 738 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 739 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 740 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 741 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 742 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 743 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 744 -22, -22, -22, -22, -22, -22, -22, -22, -22, -22, 745 -22, -22, -22, -22, -22, -22, -22, -22 746 }, 747 748 { 749 3, -23, -23, -23, -23, -23, -23, -23, -23, 23, 760 750 761 751 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 762 752 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 763 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 764 -23, -23, -23, -23, -23, -23, -23, -23, 32, 32, 765 32, 32, 32, 32, 32, 32, 32, 32, -23, -23, 753 -23, -23, 23, -23, -23, -23, -23, -23, -23, -23, 766 754 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 767 755 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, … … 769 757 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 770 758 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 759 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 760 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, 771 761 772 762 -23, -23, -23, -23, -23, -23, -23, -23, -23, -23, … … 779 769 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 780 770 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24, 781 -24, -24, -24, -24, -24, -24, 23, -24, 24, 24,782 24, 24, 24, 24, 24, 24, 24, 24, -24, -24,783 -24, -24, -24, -24, -24, -24, -24, -24, -24, 25,784 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,785 786 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,787 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,788 -24, 25, -24, -24, -24, -24, -24, -24, -24, -24,789 -24, -24, -24, -24, -24, -24, -24, -24, -24, -24,790 -24, -24, -24, -24, -24, -24, -24, -24771 -24, -24, -24, -24, -24, -24, -24, -24, 34, 34, 772 34, 34, 34, 34, 34, 34, 34, 34, -24, -24, 773 -24, -24, -24, -24, -24, 34, 34, 34, 34, 34, 774 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 775 776 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 777 34, -24, -24, -24, -24, 34, -24, 34, 34, 34, 778 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 779 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 780 34, 34, 34, -24, -24, -24, -24, -24 791 781 }, 792 782 … … 796 786 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 797 787 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 798 -25, -25, -25, 33, -25, 33, -25, -25, 34, 34,799 800 34, 34, 34, 34, 34, 34, 34, 34, -25, -25,788 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 789 790 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 801 791 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, 802 792 -25, -25, -25, -25, -25, -25, -25, -25, -25, -25, … … 814 804 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 815 805 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 806 -26, -26, -26, -26, -26, -26, -26, -26, 35, 35, 807 35, 35, 35, 35, 35, 35, 35, 35, -26, -26, 816 808 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 817 809 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, … … 820 812 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 821 813 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, 822 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,823 -26, -26, -26, -26, -26, -26, -26, -26, -26, -26,824 814 825 815 -26, -26, -26, -26, -26, -26, -26, -26 … … 831 821 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 832 822 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 823 -27, -27, -27, -27, -27, -27, 26, -27, 27, 27, 824 27, 27, 27, 27, 27, 27, 27, 27, -27, -27, 825 -27, -27, -27, -27, -27, -27, -27, -27, -27, 28, 833 826 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 834 827 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 828 835 829 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 836 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 837 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 838 839 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 840 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 830 -27, 28, -27, -27, -27, -27, -27, -27, -27, -27, 841 831 -27, -27, -27, -27, -27, -27, -27, -27, -27, -27, 842 832 -27, -27, -27, -27, -27, -27, -27, -27 … … 848 838 -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, 849 839 -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, 850 -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,851 -28, -28, -28, -28, -28, -28, -28, -28, -28, -28,840 -28, -28, -28, 36, -28, 36, -28, -28, 37, 37, 841 37, 37, 37, 37, 37, 37, 37, 37, -28, -28, 852 842 853 843 -28, -28, -28, -28, -28, -28, -28, -28, -28, -28, … … 866 856 867 857 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 868 -29, -29, -29, -29, -29, -29, -29, -29, 35, 35,869 35, 35, 35, 35, 35, 35, 35, 35, -29, -29,870 -29, -29, -29, -29, -29, 35, 35, 35, 35, 35,871 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,872 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,873 35, -29, -29, -29, -29, 35, -29, 35, 35, 35,874 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,875 35, 35, 35, 35, 35, 35, 35, 35, 35, 35,876 35, 35, 35, -29, -29, -29, -29, -29858 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 859 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 860 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 861 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 862 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 863 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 864 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 865 -29, -29, -29, -29, -29, -29, -29, -29, -29, -29, 866 -29, -29, -29, -29, -29, -29, -29, -29 877 867 878 868 }, … … 883 873 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 884 874 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 885 -30, -30, -30, -30, -30, -30, -30, -30, 30,30,886 30, 30, 30, 30, 30, 30, 30,30, -30, -30,887 -30, -30, -30, -30, -30, 30, 30, 30, 30,30,888 30, 30, 30, 30, 30, 30, 30, 30, 30,30,889 30, 30, 30, 30, 30, 30, 30, 30, 30,30,890 30, -30, -30, -30, -30, 30, -30, 30, 30,30,891 892 30, 30, 30, 30, 30, 30, 30, 30, 30,30,893 30, 30, 30, 30, 30, 30, 30, 30, 30,30,894 30, 30,30, -30, -30, -30, -30, -30875 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 876 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 877 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 878 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 879 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 880 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 881 882 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 883 -30, -30, -30, -30, -30, -30, -30, -30, -30, -30, 884 -30, -30, -30, -30, -30, -30, -30, -30 895 885 }, 896 886 … … 900 890 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 901 891 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 902 -31, -31, -31, -31, -31, -31, -31, -31, 31,31,903 31, 31, 31, 31, 31, 31, 31,31, -31, -31,904 -31, -31, -31, -31, -31, 31, 31, 31, 31,31,905 906 31, 31, 31, 31, 31, 31, 31, 31, 31,31,907 31, 31, 31, 31, 31, 31, 31, 31, 31,31,908 31, -31, -31, -31, -31, 31, -31, 31, 31,31,909 31, 31, 31, 31, 31, 31, 31, 31, 31,31,910 31, 31, 31, 31, 31, 31, 31, 31, 31,31,911 31, 31,31, -31, -31, -31, -31, -31892 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 893 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 894 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 895 896 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 897 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 898 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 899 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 900 -31, -31, -31, -31, -31, -31, -31, -31, -31, -31, 901 -31, -31, -31, -31, -31, -31, -31, -31 912 902 }, 913 903 … … 918 908 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32, 919 909 920 -32, -32, -32, -32, -32, -32, -32, -32, 3 2, 32,921 3 2, 32, 32, 32, 32, 32, 32, 32, -32, -32,922 -32, -32, -32, -32, -32, -32, -32, -32, -32, 25,923 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,924 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,925 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,926 -32, 25, -32, -32, -32, -32, -32, -32, -32, -32,927 -32, -32, -32, -32, -32, -32, -32, -32, -32, -32,928 -32, -32, -32, -32, -32, -32, -32, -32910 -32, -32, -32, -32, -32, -32, -32, -32, 38, 38, 911 38, 38, 38, 38, 38, 38, 38, 38, -32, -32, 912 -32, -32, -32, -32, -32, 38, 38, 38, 38, 38, 913 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 914 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 915 38, -32, -32, -32, -32, 38, -32, 38, 38, 38, 916 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 917 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 918 38, 38, 38, -32, -32, -32, -32, -32 929 919 }, 930 920 … … 935 925 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 936 926 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33, 937 -33, -33, -33, -33, -33, -33, -33, -33, 3 4, 34,938 3 4, 34, 34, 34, 34, 34, 34, 34, -33, -33,939 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,940 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,941 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,942 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,943 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,944 945 -33, -33, -33, -33, -33, -33, -33, -33, -33, -33,946 -33, -33, -33, -33, -33, -33, -33, -33927 -33, -33, -33, -33, -33, -33, -33, -33, 33, 33, 928 33, 33, 33, 33, 33, 33, 33, 33, -33, -33, 929 -33, -33, -33, -33, -33, 33, 33, 33, 33, 33, 930 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 931 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 932 33, -33, -33, -33, -33, 33, -33, 33, 33, 33, 933 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 934 935 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 936 33, 33, 33, -33, -33, -33, -33, -33 947 937 }, 948 938 … … 954 944 -34, -34, -34, -34, -34, -34, -34, -34, 34, 34, 955 945 34, 34, 34, 34, 34, 34, 34, 34, -34, -34, 956 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,957 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,958 959 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,960 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,961 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,962 -34, -34, -34, -34, -34, -34, -34, -34, -34, -34,963 -34, -34, -34, -34, -34, -34, -34, -34946 -34, -34, -34, -34, -34, 34, 34, 34, 34, 34, 947 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 948 949 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 950 34, -34, -34, -34, -34, 34, -34, 34, 34, 34, 951 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 952 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 953 34, 34, 34, -34, -34, -34, -34, -34 964 954 }, 965 955 … … 972 962 973 963 35, 35, 35, 35, 35, 35, 35, 35, -35, -35, 974 -35, -35, -35, -35, -35, 35, 35, 35, 35, 35, 975 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 976 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 977 35, -35, -35, -35, -35, 35, -35, 35, 35, 35, 978 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 979 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 980 35, 35, 35, -35, -35, -35, -35, -35 964 -35, -35, -35, -35, -35, -35, -35, -35, -35, 28, 965 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 966 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 967 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 968 -35, 28, -35, -35, -35, -35, -35, -35, -35, -35, 969 -35, -35, -35, -35, -35, -35, -35, -35, -35, -35, 970 -35, -35, -35, -35, -35, -35, -35, -35 971 }, 972 973 { 974 3, -36, -36, -36, -36, -36, -36, -36, -36, -36, 975 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 976 977 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 978 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 979 -36, -36, -36, -36, -36, -36, -36, -36, 37, 37, 980 37, 37, 37, 37, 37, 37, 37, 37, -36, -36, 981 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 982 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 983 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 984 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 985 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 986 -36, -36, -36, -36, -36, -36, -36, -36, -36, -36, 987 988 -36, -36, -36, -36, -36, -36, -36, -36 989 }, 990 991 { 992 3, -37, -37, -37, -37, -37, -37, -37, -37, -37, 993 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 994 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 995 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 996 -37, -37, -37, -37, -37, -37, -37, -37, 37, 37, 997 37, 37, 37, 37, 37, 37, 37, 37, -37, -37, 998 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 999 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 1000 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 1001 1002 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 1003 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 1004 -37, -37, -37, -37, -37, -37, -37, -37, -37, -37, 1005 -37, -37, -37, -37, -37, -37, -37, -37 1006 }, 1007 1008 { 1009 3, -38, -38, -38, -38, -38, -38, -38, -38, -38, 1010 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, 1011 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, 1012 -38, -38, -38, -38, -38, -38, -38, -38, -38, -38, 1013 -38, -38, -38, -38, -38, -38, -38, -38, 38, 38, 1014 38, 38, 38, 38, 38, 38, 38, 38, -38, -38, 1015 1016 -38, -38, -38, -38, -38, 38, 38, 38, 38, 38, 1017 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 1018 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 1019 38, -38, -38, -38, -38, 38, -38, 38, 38, 38, 1020 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 1021 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 1022 38, 38, 38, -38, -38, -38, -38, -38 981 1023 }, 982 1024 … … 998 1040 (yy_c_buf_p) = yy_cp; 999 1041 1000 #define YY_NUM_RULES 191001 #define YY_END_OF_BUFFER 2 01042 #define YY_NUM_RULES 22 1043 #define YY_END_OF_BUFFER 23 1002 1044 /* This struct is not used in this scanner, 1003 1045 but its presence is necessary. */ … … 1007 1049 flex_int32_t yy_nxt; 1008 1050 }; 1009 static yyconst flex_int16_t yy_accept[3 6] =1051 static yyconst flex_int16_t yy_accept[39] = 1010 1052 { 0, 1011 0, 0, 2 0, 19, 1, 19, 16, 17, 8, 6,1012 7, 9, 2, 1 2, 19, 13, 19, 5, 10, 18,1013 1, 4, 0, 2, 0, 14, 11, 15, 3, 5,1014 4, 2, 0, 2, 31053 0, 0, 23, 22, 1, 22, 19, 20, 8, 6, 1054 7, 9, 2, 18, 12, 22, 13, 17, 22, 5, 1055 10, 21, 1, 4, 16, 0, 2, 0, 14, 11, 1056 15, 3, 5, 4, 2, 0, 2, 3 1015 1057 } ; 1016 1058 … … 1018 1060 static char *yy_last_accepting_cpos; 1019 1061 1020 static yyconst yy_state_type yy_NUL_trans[3 6] =1062 static yyconst yy_state_type yy_NUL_trans[39] = 1021 1063 { 0, 1022 2 0, 20, 0, 0, 0, 0, 0, 0, 0, 0,1064 22, 22, 0, 0, 0, 0, 0, 0, 0, 0, 1023 1065 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1024 1066 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1025 0, 0, 0, 0, 0 1067 0, 0, 0, 0, 0, 0, 0, 0 1026 1068 } ; 1027 1069 … … 1053 1095 #include "yacc_parser.hpp" 1054 1096 1055 #line 10 56"lex_parser.cpp"1097 #line 1098 "lex_parser.cpp" 1056 1098 1057 1099 #define INITIAL 0 … … 1134 1176 /* Amount of stuff to slurp up with each read. */ 1135 1177 #ifndef YY_READ_BUF_SIZE 1136 #ifdef __ia64__1137 /* On IA-64, the buffer size is 16k, not 8k */1138 #define YY_READ_BUF_SIZE 163841139 #else1140 1178 #define YY_READ_BUF_SIZE 8192 1141 #endif /* __ia64__ */1142 1179 #endif 1143 1180 … … 1224 1261 register int yy_act; 1225 1262 1263 #line 29 "lex_parser.lex" 1264 1265 1266 #line 1267 "lex_parser.cpp" 1267 1226 1268 if ( !(yy_init) ) 1227 1269 { … … 1249 1291 yy_load_buffer_state( ); 1250 1292 } 1251 1252 {1253 #line 29 "lex_parser.lex"1254 1255 1256 #line 1257 "lex_parser.cpp"1257 1293 1258 1294 while ( 1 ) /* loops until end-of-file is reached */ … … 1388 1424 case 16: 1389 1425 YY_RULE_SETUP 1390 #line 6 8"lex_parser.lex"1391 return LEFT_PARENTHESIS;1426 #line 67 "lex_parser.lex" 1427 return NE; 1392 1428 YY_BREAK 1393 1429 case 17: 1394 1430 YY_RULE_SETUP 1395 #line 6 9"lex_parser.lex"1396 return RIGHT_PARENTHESIS;1431 #line 68 "lex_parser.lex" 1432 return QUESTION_MARK; 1397 1433 YY_BREAK 1398 1434 case 18: 1399 1435 YY_RULE_SETUP 1400 #line 71"lex_parser.lex"1401 return END;1436 #line 69 "lex_parser.lex" 1437 return COLON; 1402 1438 YY_BREAK 1403 1439 case 19: 1404 1440 YY_RULE_SETUP 1405 #line 72 "lex_parser.lex" 1441 #line 70 "lex_parser.lex" 1442 return LEFT_PARENTHESIS; 1443 YY_BREAK 1444 case 20: 1445 YY_RULE_SETUP 1446 #line 71 "lex_parser.lex" 1447 return RIGHT_PARENTHESIS; 1448 YY_BREAK 1449 case 21: 1450 YY_RULE_SETUP 1451 #line 73 "lex_parser.lex" 1452 return END; 1453 YY_BREAK 1454 case 22: 1455 YY_RULE_SETUP 1456 #line 74 "lex_parser.lex" 1406 1457 ECHO; 1407 1458 YY_BREAK 1408 #line 14 09"lex_parser.cpp"1459 #line 1460 "lex_parser.cpp" 1409 1460 case YY_STATE_EOF(INITIAL): 1410 1461 yyterminate(); … … 1537 1588 } /* end of action switch */ 1538 1589 } /* end of scanning one token */ 1539 } /* end of user's declarations */1540 1590 } /* end of yylex */ 1541 1591 … … 2166 2216 char *buf; 2167 2217 yy_size_t n; 2168 yy_size_t i;2218 int i; 2169 2219 2170 2220 /* Get memory for full buffer, including space for trailing EOB's. */ … … 2396 2446 #define YYTABLES_NAME "yytables" 2397 2447 2398 #line 7 1"lex_parser.lex"2448 #line 74 "lex_parser.lex" -
XIOS/dev/dev_olga/src/parse_expr/lex_parser.lex
r728 r1158 65 65 "<=" return LE; 66 66 ">=" return GE; 67 67 "/=" return NE; 68 "?" return QUESTION_MARK; 69 ":" return COLON; 68 70 "(" return LEFT_PARENTHESIS; 69 71 ")" return RIGHT_PARENTHESIS; -
XIOS/dev/dev_olga/src/parse_expr/operator_expr.hpp
r728 r1158 17 17 typedef double (*functionScalar)(double); 18 18 typedef double (*functionScalarScalar)(double, double); 19 typedef double (*functionScalarScalarScalar)(double, double,double); 19 20 typedef CArray<double,1> (*functionField)(const CArray<double,1>&); 20 21 typedef CArray<double,1> (*functionFieldField)(const CArray<double,1>&, const CArray<double,1>&); 21 22 typedef CArray<double,1> (*functionFieldScalar)(const CArray<double,1>&, double); 22 23 typedef CArray<double,1> (*functionScalarField)(double, const CArray<double,1>&); 23 24 typedef CArray<double,1> (*functionScalarScalarField)(double, double, const CArray<double,1>&); 25 typedef CArray<double,1> (*functionScalarFieldScalar)(double, const CArray<double,1>&, double); 26 typedef CArray<double,1> (*functionScalarFieldField)(double, const CArray<double,1>&, const CArray<double,1>&); 27 typedef CArray<double,1> (*functionFieldScalarScalar)(const CArray<double,1>&, double, double); 28 typedef CArray<double,1> (*functionFieldScalarField)(const CArray<double,1>&, double, const CArray<double,1>&); 29 typedef CArray<double,1> (*functionFieldFieldScalar)(const CArray<double,1>&, const CArray<double,1>&, double); 30 typedef CArray<double,1> (*functionFieldFieldField)(const CArray<double,1>&, const CArray<double,1>&, const CArray<double,1>&); 31 24 32 COperatorExpr(void) 25 33 { … … 43 51 opScalarScalar[string("le")] = le_ss; 44 52 opScalarScalar[string("ge")] = ge_ss; 45 53 opScalarScalar[string("ne")] = ne_ss; 54 opScalarScalarScalar[string("cond")] = cond_sss; 55 46 56 opField[string("neg")] = neg_f; 47 57 opField[string("cos")] = cos_f; … … 63 73 opFieldField[string("le")] = le_ff; 64 74 opFieldField[string("ge")] = ge_ff; 75 opFieldField[string("ne")] = ne_ff; 65 76 66 77 opFieldScalar[string("add")] = add_fs; … … 74 85 opFieldScalar[string("le")] = le_fs; 75 86 opFieldScalar[string("ge")] = ge_fs; 87 opFieldScalar[string("ne")] = ne_fs; 76 88 77 89 opScalarField[string("add")] = add_sf; … … 84 96 opScalarField[string("le")] = le_sf; 85 97 opScalarField[string("ge")] = ge_sf; 98 opScalarField[string("ne")] = ne_sf; 99 100 opScalarScalarField[string("cond")] = cond_ssf; 101 opScalarFieldScalar[string("cond")] = cond_sfs; 102 opScalarFieldField[string("cond")] = cond_sff; 103 opFieldScalarScalar[string("cond")] = cond_fss; 104 opFieldScalarField[string("cond")] = cond_fsf; 105 opFieldFieldScalar[string("cond")] = cond_ffs; 106 opFieldFieldField[string("cond")] = cond_fff; 107 108 86 109 } 87 110 … … 102 125 } 103 126 127 functionScalarScalarScalar getOpScalarScalarScalar(const string& id) 128 { 129 map<string,double (*)(double,double,double)>::iterator it; 130 it = opScalarScalarScalar.find(id); 131 if (it == opScalarScalarScalar.end()) ERROR("functionScalarScalarScalar getOpScalarScalarScalar(const string& id)", << "unknown operator : " << id) 132 return it->second; 133 } 134 104 135 functionField getOpField(const string& id) 105 136 { … … 134 165 } 135 166 167 functionScalarScalarField getOpScalarScalarField(const string& id) 168 { 169 map<string,functionScalarScalarField>::iterator it; 170 it = opScalarScalarField.find(id); 171 if (it == opScalarScalarField.end()) ERROR("functionScalarScalarField getOpScalarScalarField(const string& id)", << "unknown operator : " << id) 172 return it->second; 173 } 174 175 functionScalarFieldScalar getOpScalarFieldScalar(const string& id) 176 { 177 map<string,functionScalarFieldScalar>::iterator it; 178 it = opScalarFieldScalar.find(id); 179 if (it == opScalarFieldScalar.end()) ERROR("functionScalarFieldScalar getOpScalarScalarField(const string& id)", << "unknown operator : " << id) 180 return it->second; 181 } 182 183 functionScalarFieldField getOpScalarFieldField(const string& id) 184 { 185 map<string,functionScalarFieldField>::iterator it; 186 it = opScalarFieldField.find(id); 187 if (it == opScalarFieldField.end()) ERROR("functionScalarFieldField getOpScalarFieldField(const string& id)", << "unknown operator : " << id) 188 return it->second; 189 } 190 191 functionFieldScalarScalar getOpFieldScalarScalar(const string& id) 192 { 193 map<string,functionFieldScalarScalar>::iterator it; 194 it = opFieldScalarScalar.find(id); 195 if (it == opFieldScalarScalar.end()) ERROR("functionFieldScalarScalar getOpFieldScalarScalar(const string& id)", << "unknown operator : " << id) 196 return it->second; 197 } 198 199 functionFieldScalarField getOpFieldScalarField(const string& id) 200 { 201 map<string,functionFieldScalarField>::iterator it; 202 it = opFieldScalarField.find(id); 203 if (it == opFieldScalarField.end()) ERROR("functionFieldScalarField getOpFieldScalarField(const string& id)", << "unknown operator : " << id) 204 return it->second; 205 } 206 207 functionFieldFieldScalar getOpFieldFieldScalar(const string& id) 208 { 209 map<string,functionFieldFieldScalar>::iterator it; 210 it = opFieldFieldScalar.find(id); 211 if (it == opFieldFieldScalar.end()) ERROR("functionFieldFieldScalar getOpFieldFieldScalar(const string& id)", << "unknown operator : " << id) 212 return it->second; 213 } 214 215 functionFieldFieldField getOpFieldFieldField(const string& id) 216 { 217 map<string,functionFieldFieldField>::iterator it; 218 it = opFieldFieldField.find(id); 219 if (it == opFieldFieldField.end()) ERROR("functionFieldFieldField getOpFieldFieldField(const string& id)", << "unknown operator : " << id) 220 return it->second; 221 } 222 223 136 224 map<string,functionScalar> opScalar; 137 225 map<string,functionScalarScalar> opScalarScalar; 226 map<string,functionScalarScalarScalar> opScalarScalarScalar; 138 227 map<string,functionField> opField; 139 228 map<string,functionFieldField> opFieldField; 140 229 map<string,functionFieldScalar> opFieldScalar; 141 230 map<string,functionScalarField> opScalarField; 231 map<string,functionScalarScalarField> opScalarScalarField; 232 map<string,functionScalarFieldScalar> opScalarFieldScalar; 233 map<string,functionScalarFieldField> opScalarFieldField; 234 map<string,functionFieldScalarScalar> opFieldScalarScalar; 235 map<string,functionFieldScalarField> opFieldScalarField; 236 map<string,functionFieldFieldScalar> opFieldFieldScalar; 237 map<string,functionFieldFieldField> opFieldFieldField; 238 239 142 240 143 241 static inline double neg_s(double x) { return -x; } … … 160 258 static inline double le_ss(double x, double y) { return x <= y; } 161 259 static inline double ge_ss(double x, double y) { return x >= y; } 260 static inline double ne_ss(double x, double y) { return x != y; } 162 261 163 262 static inline CArray<double,1> neg_f(const CArray<double,1>& x) { return Array<double,1>(-x); } … … 180 279 static inline CArray<double,1> le_ff(const CArray<double,1>& x, const CArray<double,1>& y) { return Array<double,1>(x <= y); } 181 280 static inline CArray<double,1> ge_ff(const CArray<double,1>& x, const CArray<double,1>& y) { return Array<double,1>(x >= y); } 281 static inline CArray<double,1> ne_ff(const CArray<double,1>& x, const CArray<double,1>& y) { return Array<double,1>(x != y); } 182 282 183 283 static inline CArray<double,1> add_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x + y); } … … 191 291 static inline CArray<double,1> le_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x <= y); } 192 292 static inline CArray<double,1> ge_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x >= y); } 293 static inline CArray<double,1> ne_fs(const CArray<double,1>& x, double y) { return Array<double,1>(x != y); } 193 294 194 295 static inline CArray<double,1> add_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x + y); } … … 201 302 static inline CArray<double,1> le_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x <= y); } 202 303 static inline CArray<double,1> ge_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x >= y); } 304 static inline CArray<double,1> ne_sf(double x, const CArray<double,1>& y) { return Array<double,1>(x != y); } 305 306 307 static inline double cond_sss(double x, double y, double z) { return (x==0) ? z : y ; } 308 309 static inline CArray<double,1> cond_ssf(double x, double y, const CArray<double,1>& z) 310 { 311 CArray<double,1> ret(z.numElements()) ; 312 if (x==0) ret=z ; 313 else ret=y ; 314 return ret ; 315 } 316 317 static inline CArray<double,1> cond_sfs(double x, const CArray<double,1>& y, double z) 318 { 319 CArray<double,1> ret(y.numElements()) ; 320 if (x==0) ret=z ; 321 else ret=y ; 322 return ret ; 323 } 324 325 static inline CArray<double,1> cond_sff(double x, const CArray<double,1>& y, const CArray<double,1>& z) 326 { 327 CArray<double,1> ret(y.numElements()) ; 328 if (x==0) ret=z ; 329 else ret=y ; 330 return ret ; 331 } 332 333 static inline CArray<double,1> cond_fss(const CArray<double,1>& x, double y, double z) 334 { 335 CArray<double,1> ret(x.numElements()) ; 336 Array<double,1>::const_iterator itx=x.begin(),itxe=x.end(); 337 Array<double,1>::iterator itret=ret.begin() ; 338 339 for(;itx!=itxe;++itx,++itret) *itret=( (*itx==0)?z:y) ; 340 return ret ; 341 } 342 343 static inline CArray<double,1> cond_fsf(const CArray<double,1>& x, double y, const CArray<double,1>& z) 344 { 345 CArray<double,1> ret(x.numElements()) ; 346 Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), itz=z.begin(); 347 Array<double,1>::iterator itret=ret.begin() ; 348 for(;itx!=itxe;++itx,++itz,++itret) *itret=( (*itx==0)?*itz:y) ; 349 return ret ; 350 } 351 352 static inline CArray<double,1> cond_ffs(const CArray<double,1>& x, const CArray<double,1>& y, double z) 353 { 354 CArray<double,1> ret(x.numElements()) ; 355 Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), ity=y.begin() ; 356 Array<double,1>::iterator itret=ret.begin() ; 357 for(;itx!=itxe;++itx,++ity,++itret) *itret=( (*itx==0)?z:*ity) ; 358 return ret ; 359 } 360 361 static inline CArray<double,1> cond_fff(const CArray<double,1>& x, const CArray<double,1>& y, const CArray<double,1>& z) 362 { 363 CArray<double,1> ret(x.numElements()) ; 364 Array<double,1>::const_iterator itx=x.begin(), itxe=x.end(), ity=y.begin(), itz=z.begin() ; 365 Array<double,1>::iterator itret=ret.begin() ; 366 for(;itx!=itxe;++itx,++ity,++itz,++itret) *itret=( (*itx==0)?*itz:*ity) ; 367 return ret ; 368 } 369 203 370 }; 204 371 -
XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.cpp
r642 r1158 23 23 double CScalarVarExprNode::reduce() const 24 24 { 25 if (!CVariable::has(varId)) 26 ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 25 // $missing_value will be replaced with NaN 26 if (varId == "missing_value") 27 { 28 return std::numeric_limits<double>::quiet_NaN(); 29 } 30 else 31 { 32 if (!CVariable::has(varId)) 33 ERROR("double CScalarVarExprNode::reduce() const", << "The variable " << varId << " does not exist."); 27 34 28 return CVariable::get(varId)->getData<double>(); 35 return CVariable::get(varId)->getData<double>(); 36 } 29 37 } 30 38 … … 59 67 return op(child1->reduce(), child2->reduce()); 60 68 } 69 70 71 CScalarTernaryOpExprNode::CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3) 72 : child1(child1) 73 , opId(opId) 74 , child2(child2) 75 , child3(child3) 76 { 77 if (!child1 || !child2 || !child3) 78 ERROR("CScalarTernaryOpExprNode::CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3)", 79 "Impossible to create the new expression node, an invalid child node was provided."); 80 } 81 82 double CScalarTernaryOpExprNode::reduce() const 83 { 84 COperatorExpr::functionScalarScalarScalar op = operatorExpr.getOpScalarScalarScalar(opId); 85 return op(child1->reduce(), child2->reduce(), child3->reduce()); 86 } 61 87 } -
XIOS/dev/dev_olga/src/parse_expr/scalar_expr_node.hpp
r642 r1158 107 107 boost::scoped_ptr<IScalarExprNode> child1, child2; //!< The scalar child nodes to which the operator is applied 108 108 }; 109 110 class CScalarTernaryOpExprNode : public IScalarExprNode 111 { 112 public: 113 /*! 114 * Constructs an expression node corresponding to the specified ternary operation 115 * applied to the provided scalar child nodes. 116 * Note that the child nodes will be destroyed automatically when the parent node 117 * is destroyed. 118 * 119 * \param opId the identifier of the operator 120 * \param child1, child2 , child3 the scalar child nodes to which the operator is applied 121 */ 122 CScalarTernaryOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3); 123 124 double reduce() const; 125 126 private: 127 std::string opId; //!< The identifier of the field 128 boost::scoped_ptr<IScalarExprNode> child1, child2, child3; //!< The scalar child nodes to which the operator is applied 129 }; 109 130 } 110 131 -
XIOS/dev/dev_olga/src/parse_expr/yacc_parser.cpp
r728 r1158 145 145 LE = 270, 146 146 GE = 271, 147 LEFT_PARENTHESIS = 272, 148 RIGHT_PARENTHESIS = 273, 149 END = 274, 150 NEG = 275 147 NE = 272, 148 LEFT_PARENTHESIS = 273, 149 RIGHT_PARENTHESIS = 274, 150 QUESTION_MARK = 275, 151 COLON = 276, 152 END = 277, 153 NEG = 278 151 154 }; 152 155 #endif … … 163 166 xios::IFilterExprNode* filterNode; 164 167 165 #line 16 6"yacc_parser.cpp" /* yacc.c:355 */168 #line 169 "yacc_parser.cpp" /* yacc.c:355 */ 166 169 }; 167 170 # define YYSTYPE_IS_TRIVIAL 1 … … 178 181 /* Copy the second part of user declarations. */ 179 182 180 #line 18 1"yacc_parser.cpp" /* yacc.c:358 */183 #line 184 "yacc_parser.cpp" /* yacc.c:358 */ 181 184 182 185 #ifdef short … … 420 423 #define YYFINAL 16 421 424 /* YYLAST -- Last index in YYTABLE. */ 422 #define YYLAST 204425 #define YYLAST 371 423 426 424 427 /* YYNTOKENS -- Number of terminals. */ 425 #define YYNTOKENS 2 1428 #define YYNTOKENS 24 426 429 /* YYNNTS -- Number of nonterminals. */ 427 430 #define YYNNTS 4 428 431 /* YYNRULES -- Number of rules. */ 429 #define YYNRULES 52432 #define YYNRULES 64 430 433 /* YYNSTATES -- Number of states. */ 431 #define YYNSTATES 1 08434 #define YYNSTATES 138 432 435 433 436 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned 434 437 by yylex, with out-of-bounds checking. */ 435 438 #define YYUNDEFTOK 2 436 #define YYMAXUTOK 27 5439 #define YYMAXUTOK 278 437 440 438 441 #define YYTRANSLATE(YYX) \ … … 470 473 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 471 474 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 472 15, 16, 17, 18, 19, 20 475 15, 16, 17, 18, 19, 20, 21, 22, 23 473 476 }; 474 477 … … 477 480 static const yytype_uint8 yyrline[] = 478 481 { 479 0, 61, 61, 62, 66, 67, 68, 69, 70, 71, 480 72, 73, 74, 75, 76, 77, 78, 79, 80, 84, 481 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 482 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 483 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 484 115, 116, 117 482 0, 63, 63, 64, 68, 69, 70, 71, 72, 73, 483 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 484 84, 88, 89, 90, 91, 92, 93, 94, 95, 96, 485 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 486 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 487 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 488 127, 128, 129, 130, 131 485 489 }; 486 490 #endif … … 492 496 { 493 497 "$end", "error", "$undefined", "NUMBER", "VAR", "ID", "AVERAGE", "PLUS", 494 "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", 495 "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", " END", "NEG", "$accept", "Line",496 " Expression", "Field_expr", YY_NULLPTR498 "MINUS", "TIMES", "DIVIDE", "POWER", "EQ", "LT", "GT", "LE", "GE", "NE", 499 "LEFT_PARENTHESIS", "RIGHT_PARENTHESIS", "QUESTION_MARK", "COLON", "END", 500 "NEG", "$accept", "Line", "Expression", "Field_expr", YY_NULLPTR 497 501 }; 498 502 #endif … … 505 509 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 506 510 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 507 275 511 275, 276, 277, 278 508 512 }; 509 513 # endif 510 514 511 #define YYPACT_NINF -1 3515 #define YYPACT_NINF -14 512 516 513 517 #define yypact_value_is_default(Yystate) \ 514 (!!((Yystate) == (-1 3)))518 (!!((Yystate) == (-14))) 515 519 516 520 #define YYTABLE_NINF -1 517 521 518 522 #define yytable_value_is_error(Yytable_value) \ 519 0523 (!!((Yytable_value) == (-1))) 520 524 521 525 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing … … 523 527 static const yytype_int16 yypact[] = 524 528 { 525 90, -13, -13, -12, -13, 35, 35, -13, 44, 188, 526 103, 35, 24, 34, 116, 128, -13, 35, 35, 35, 527 35, 65, 35, 35, 35, 35, 35, 35, 35, 35, 528 35, 35, 35, 35, 35, 35, 35, -13, 140, 152, 529 -13, -13, -7, 23, -7, 23, 24, 34, 24, 34, 530 54, 65, 65, 24, 0, 67, 0, 67, 0, 67, 531 0, 67, 0, 67, -7, 23, -7, 23, 24, 34, 532 24, 34, 24, 34, 0, 67, 0, 67, 0, 67, 533 0, 67, 0, 67, -13, -13, 65, 24, 164, 65, 534 65, 65, 65, 65, 65, 65, 65, 65, 176, 95, 535 95, 24, 24, 92, 92, 92, 92, 92 529 73, -14, -14, -13, -14, 124, 124, -14, 39, 304, 530 104, 124, 34, 36, 220, 234, -14, 124, 124, 124, 531 124, 133, 124, 124, 124, 124, 124, 124, 124, 124, 532 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 533 124, -14, 248, 262, -14, -14, -7, 27, -7, 27, 534 34, 36, 34, 36, 30, 133, 133, 34, 0, 75, 535 0, 75, 0, 75, 0, 75, 0, 75, 0, 75, 536 145, 160, -7, 27, -7, 27, 34, 36, 34, 36, 537 34, 36, 0, 75, 0, 75, 0, 75, 0, 75, 538 0, 75, 0, 75, 175, 190, -14, -14, 133, 34, 539 276, 133, 133, 133, 133, 133, 133, 133, 133, 133, 540 133, 133, 124, 124, 124, 124, 290, 33, 33, 34, 541 34, 360, 360, 360, 360, 360, 360, 205, 318, 332, 542 318, 332, 318, 332, 318, 332, 133, 346 536 543 }; 537 544 … … 541 548 static const yytype_uint8 yydefact[] = 542 549 { 543 0, 4, 5, 19, 20, 0, 0, 2, 0, 0,544 0, 0, 10, 2 5, 0, 0, 1, 0, 0, 0,550 0, 4, 5, 21, 22, 0, 0, 2, 0, 0, 551 0, 0, 10, 27, 0, 0, 1, 0, 0, 0, 545 552 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 546 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 547 17, 32, 6, 34, 7, 36, 8, 38, 9, 40, 548 0, 0, 0, 11, 12, 43, 13, 45, 14, 47, 549 15, 49, 16, 51, 33, 21, 35, 22, 37, 23, 550 39, 24, 41, 26, 42, 27, 44, 28, 46, 29, 551 48, 30, 50, 31, 18, 52, 0, 10, 0, 0, 552 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 553 7, 8, 9, 12, 13, 14, 15, 16 553 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 554 0, 3, 0, 0, 19, 35, 6, 44, 7, 46, 555 8, 48, 9, 50, 0, 0, 0, 11, 12, 53, 556 13, 55, 14, 57, 15, 59, 16, 61, 17, 63, 557 0, 0, 43, 23, 45, 24, 47, 25, 49, 26, 558 51, 28, 52, 29, 54, 30, 56, 31, 58, 32, 559 60, 33, 62, 34, 0, 0, 20, 64, 0, 10, 560 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 561 0, 0, 0, 0, 0, 0, 0, 6, 7, 8, 562 9, 12, 13, 14, 15, 16, 17, 0, 18, 36, 563 37, 38, 39, 40, 41, 42, 0, 18 554 564 }; 555 565 … … 557 567 static const yytype_int8 yypgoto[] = 558 568 { 559 -1 3, -13, -5, 31569 -14, -14, -5, 35 560 570 }; 561 571 … … 569 579 positive, shift that token. If negative, reduce the rule whose 570 580 number is the opposite. If YYTABLE_NINF, syntax error. */ 571 static const yytype_uint8 yytable[] = 572 { 573 12, 14, 19, 20, 21, 11, 38, 17, 18, 19, 574 20, 21, 42, 44, 46, 48, 53, 54, 56, 58, 575 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 576 80, 82, 29, 30, 31, 21, 13, 15, 1, 2, 577 3, 4, 39, 5, 16, 31, 87, 88, 43, 45, 578 47, 49, 6, 55, 57, 59, 61, 63, 65, 67, 579 69, 71, 73, 75, 77, 79, 81, 83, 1, 2, 580 50, 86, 0, 51, 27, 28, 29, 30, 31, 0, 581 0, 98, 52, 0, 99, 100, 101, 102, 103, 104, 582 105, 106, 107, 1, 2, 3, 4, 0, 5, 89, 583 90, 91, 92, 21, 91, 92, 21, 6, 0, 7, 584 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 585 0, 0, 37, 17, 18, 19, 20, 21, 22, 23, 586 24, 25, 26, 0, 40, 27, 28, 29, 30, 31, 587 32, 33, 34, 35, 36, 0, 41, 17, 18, 19, 588 20, 21, 22, 23, 24, 25, 26, 0, 84, 27, 589 28, 29, 30, 31, 32, 33, 34, 35, 36, 0, 590 85, 89, 90, 91, 92, 21, 93, 94, 95, 96, 591 97, 0, 40, 89, 90, 91, 92, 21, 93, 94, 592 95, 96, 97, 0, 84, 17, 18, 19, 20, 21, 593 22, 23, 24, 25, 26 581 static const yytype_int16 yytable[] = 582 { 583 12, 14, 19, 20, 21, 11, 42, 17, 18, 19, 584 20, 21, 46, 48, 50, 52, 57, 58, 60, 62, 585 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 586 84, 86, 88, 90, 92, 94, 31, 32, 33, 16, 587 13, 15, 103, 104, 21, 21, 43, 33, 98, 0, 588 99, 100, 47, 49, 51, 53, 0, 59, 61, 63, 589 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 590 85, 87, 89, 91, 93, 95, 1, 2, 3, 4, 591 0, 5, 29, 30, 31, 32, 33, 0, 0, 0, 592 0, 6, 0, 116, 0, 7, 117, 118, 119, 120, 593 121, 122, 123, 124, 125, 126, 127, 128, 130, 132, 594 134, 29, 30, 31, 32, 33, 34, 35, 36, 37, 595 38, 39, 0, 0, 40, 0, 41, 1, 2, 3, 596 4, 137, 5, 0, 0, 0, 1, 2, 54, 0, 597 0, 55, 6, 0, 0, 0, 0, 129, 131, 133, 598 135, 56, 17, 18, 19, 20, 21, 22, 23, 24, 599 25, 26, 27, 0, 0, 28, 112, 29, 30, 31, 600 32, 33, 34, 35, 36, 37, 38, 39, 0, 0, 601 40, 113, 17, 18, 19, 20, 21, 22, 23, 24, 602 25, 26, 27, 0, 0, 28, 114, 29, 30, 31, 603 32, 33, 34, 35, 36, 37, 38, 39, 0, 0, 604 40, 115, 101, 102, 103, 104, 21, 105, 106, 107, 605 108, 109, 110, 0, 0, 111, 136, 17, 18, 19, 606 20, 21, 22, 23, 24, 25, 26, 27, 0, 44, 607 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 608 38, 39, 0, 45, 40, 17, 18, 19, 20, 21, 609 22, 23, 24, 25, 26, 27, 0, 96, 28, 29, 610 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 611 0, 97, 40, 101, 102, 103, 104, 21, 105, 106, 612 107, 108, 109, 110, 0, 44, 111, 101, 102, 103, 613 104, 21, 105, 106, 107, 108, 109, 110, 0, 96, 614 111, 17, 18, 19, 20, 21, 22, 23, 24, 25, 615 26, 27, 0, 0, 28, 17, 18, 19, 20, 21, 616 22, 23, 24, 25, 26, 27, 0, 0, -1, 29, 617 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 618 0, 0, -1, 101, 102, 103, 104, 21, 105, 106, 619 107, 108, 109, 110, 0, 0, -1, 101, 102, 103, 620 104, 21 594 621 }; 595 622 596 static const yytype_int 8yycheck[] =597 { 598 5, 6, 9, 10, 11, 1 7, 11, 7, 8, 9,623 static const yytype_int16 yycheck[] = 624 { 625 5, 6, 9, 10, 11, 18, 11, 7, 8, 9, 599 626 10, 11, 17, 18, 19, 20, 21, 22, 23, 24, 600 627 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 601 35, 36, 9, 10, 11, 11, 5, 6, 3, 4, 602 5, 6, 11, 8, 0, 11, 51, 52, 17, 18, 603 19, 20, 17, 22, 23, 24, 25, 26, 27, 28, 604 29, 30, 31, 32, 33, 34, 35, 36, 3, 4, 605 5, 17, -1, 8, 7, 8, 9, 10, 11, -1, 606 -1, 86, 17, -1, 89, 90, 91, 92, 93, 94, 607 95, 96, 97, 3, 4, 5, 6, -1, 8, 7, 608 8, 9, 10, 11, 9, 10, 11, 17, -1, 19, 609 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 610 -1, -1, 19, 7, 8, 9, 10, 11, 12, 13, 611 14, 15, 16, -1, 18, 7, 8, 9, 10, 11, 612 12, 13, 14, 15, 16, -1, 18, 7, 8, 9, 613 10, 11, 12, 13, 14, 15, 16, -1, 18, 7, 614 8, 9, 10, 11, 12, 13, 14, 15, 16, -1, 615 18, 7, 8, 9, 10, 11, 12, 13, 14, 15, 616 16, -1, 18, 7, 8, 9, 10, 11, 12, 13, 617 14, 15, 16, -1, 18, 7, 8, 9, 10, 11, 618 12, 13, 14, 15, 16 628 35, 36, 37, 38, 39, 40, 9, 10, 11, 0, 629 5, 6, 9, 10, 11, 11, 11, 11, 18, -1, 630 55, 56, 17, 18, 19, 20, -1, 22, 23, 24, 631 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 632 35, 36, 37, 38, 39, 40, 3, 4, 5, 6, 633 -1, 8, 7, 8, 9, 10, 11, -1, -1, -1, 634 -1, 18, -1, 98, -1, 22, 101, 102, 103, 104, 635 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 636 115, 7, 8, 9, 10, 11, 12, 13, 14, 15, 637 16, 17, -1, -1, 20, -1, 22, 3, 4, 5, 638 6, 136, 8, -1, -1, -1, 3, 4, 5, -1, 639 -1, 8, 18, -1, -1, -1, -1, 112, 113, 114, 640 115, 18, 7, 8, 9, 10, 11, 12, 13, 14, 641 15, 16, 17, -1, -1, 20, 21, 7, 8, 9, 642 10, 11, 12, 13, 14, 15, 16, 17, -1, -1, 643 20, 21, 7, 8, 9, 10, 11, 12, 13, 14, 644 15, 16, 17, -1, -1, 20, 21, 7, 8, 9, 645 10, 11, 12, 13, 14, 15, 16, 17, -1, -1, 646 20, 21, 7, 8, 9, 10, 11, 12, 13, 14, 647 15, 16, 17, -1, -1, 20, 21, 7, 8, 9, 648 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 649 20, 7, 8, 9, 10, 11, 12, 13, 14, 15, 650 16, 17, -1, 19, 20, 7, 8, 9, 10, 11, 651 12, 13, 14, 15, 16, 17, -1, 19, 20, 7, 652 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 653 -1, 19, 20, 7, 8, 9, 10, 11, 12, 13, 654 14, 15, 16, 17, -1, 19, 20, 7, 8, 9, 655 10, 11, 12, 13, 14, 15, 16, 17, -1, 19, 656 20, 7, 8, 9, 10, 11, 12, 13, 14, 15, 657 16, 17, -1, -1, 20, 7, 8, 9, 10, 11, 658 12, 13, 14, 15, 16, 17, -1, -1, 20, 7, 659 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 660 -1, -1, 20, 7, 8, 9, 10, 11, 12, 13, 661 14, 15, 16, 17, -1, -1, 20, 7, 8, 9, 662 10, 11 619 663 }; 620 664 … … 623 667 static const yytype_uint8 yystos[] = 624 668 { 625 0, 3, 4, 5, 6, 8, 17, 19, 22, 23, 626 24, 17, 23, 24, 23, 24, 0, 7, 8, 9, 627 10, 11, 12, 13, 14, 15, 16, 7, 8, 9, 628 10, 11, 12, 13, 14, 15, 16, 19, 23, 24, 629 18, 18, 23, 24, 23, 24, 23, 24, 23, 24, 630 5, 8, 17, 23, 23, 24, 23, 24, 23, 24, 631 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 632 23, 24, 23, 24, 23, 24, 23, 24, 23, 24, 633 23, 24, 23, 24, 18, 18, 17, 23, 23, 7, 634 8, 9, 10, 12, 13, 14, 15, 16, 23, 23, 635 23, 23, 23, 23, 23, 23, 23, 23 669 0, 3, 4, 5, 6, 8, 18, 22, 25, 26, 670 27, 18, 26, 27, 26, 27, 0, 7, 8, 9, 671 10, 11, 12, 13, 14, 15, 16, 17, 20, 7, 672 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 673 20, 22, 26, 27, 19, 19, 26, 27, 26, 27, 674 26, 27, 26, 27, 5, 8, 18, 26, 26, 27, 675 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 676 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 677 26, 27, 26, 27, 26, 27, 26, 27, 26, 27, 678 26, 27, 26, 27, 26, 27, 19, 19, 18, 26, 679 26, 7, 8, 9, 10, 12, 13, 14, 15, 16, 680 17, 20, 21, 21, 21, 21, 26, 26, 26, 26, 681 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 682 26, 27, 26, 27, 26, 27, 21, 26 636 683 }; 637 684 … … 639 686 static const yytype_uint8 yyr1[] = 640 687 { 641 0, 21, 22, 22, 23, 23, 23, 23, 23, 23, 642 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 643 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 644 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 645 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 646 24, 24, 24 688 0, 24, 25, 25, 26, 26, 26, 26, 26, 26, 689 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 690 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 691 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 692 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 693 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 694 27, 27, 27, 27, 27 647 695 }; 648 696 … … 651 699 { 652 700 0, 2, 1, 2, 1, 1, 3, 3, 3, 3, 653 2, 3, 3, 3, 3, 3, 3, 3, 4, 1, 654 1, 3, 3, 3, 3, 2, 3, 3, 3, 3, 701 2, 3, 3, 3, 3, 3, 3, 3, 5, 3, 702 4, 1, 1, 3, 3, 3, 3, 2, 3, 3, 703 3, 3, 3, 3, 3, 3, 5, 5, 5, 5, 704 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 655 705 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 656 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 657 3, 3, 4 706 3, 3, 3, 3, 4 658 707 }; 659 708 … … 1332 1381 { 1333 1382 case 2: 1334 #line 6 1"yacc_parser.yacc" /* yacc.c:1646 */1383 #line 63 "yacc_parser.yacc" /* yacc.c:1646 */ 1335 1384 { /* Nothing to do */ } 1336 #line 13 37"yacc_parser.cpp" /* yacc.c:1646 */1385 #line 1386 "yacc_parser.cpp" /* yacc.c:1646 */ 1337 1386 break; 1338 1387 1339 1388 case 3: 1340 #line 6 2"yacc_parser.yacc" /* yacc.c:1646 */1389 #line 64 "yacc_parser.yacc" /* yacc.c:1646 */ 1341 1390 { parsed = (yyvsp[-1].filterNode); } 1342 #line 13 43"yacc_parser.cpp" /* yacc.c:1646 */1391 #line 1392 "yacc_parser.cpp" /* yacc.c:1646 */ 1343 1392 break; 1344 1393 1345 1394 case 4: 1346 #line 6 6"yacc_parser.yacc" /* yacc.c:1646 */1395 #line 68 "yacc_parser.yacc" /* yacc.c:1646 */ 1347 1396 { (yyval.scalarNode) = new CScalarValExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1348 #line 13 49"yacc_parser.cpp" /* yacc.c:1646 */1397 #line 1398 "yacc_parser.cpp" /* yacc.c:1646 */ 1349 1398 break; 1350 1399 1351 1400 case 5: 1352 #line 6 7"yacc_parser.yacc" /* yacc.c:1646 */1401 #line 69 "yacc_parser.yacc" /* yacc.c:1646 */ 1353 1402 { (yyval.scalarNode) = new CScalarVarExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1354 #line 1 355"yacc_parser.cpp" /* yacc.c:1646 */1403 #line 1404 "yacc_parser.cpp" /* yacc.c:1646 */ 1355 1404 break; 1356 1405 1357 1406 case 6: 1358 #line 68"yacc_parser.yacc" /* yacc.c:1646 */1407 #line 70 "yacc_parser.yacc" /* yacc.c:1646 */ 1359 1408 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].scalarNode)); } 1360 #line 1 361"yacc_parser.cpp" /* yacc.c:1646 */1409 #line 1410 "yacc_parser.cpp" /* yacc.c:1646 */ 1361 1410 break; 1362 1411 1363 1412 case 7: 1364 #line 69"yacc_parser.yacc" /* yacc.c:1646 */1413 #line 71 "yacc_parser.yacc" /* yacc.c:1646 */ 1365 1414 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].scalarNode)); } 1366 #line 1 367"yacc_parser.cpp" /* yacc.c:1646 */1415 #line 1416 "yacc_parser.cpp" /* yacc.c:1646 */ 1367 1416 break; 1368 1417 1369 1418 case 8: 1370 #line 7 0"yacc_parser.yacc" /* yacc.c:1646 */1419 #line 72 "yacc_parser.yacc" /* yacc.c:1646 */ 1371 1420 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].scalarNode)); } 1372 #line 1 373"yacc_parser.cpp" /* yacc.c:1646 */1421 #line 1422 "yacc_parser.cpp" /* yacc.c:1646 */ 1373 1422 break; 1374 1423 1375 1424 case 9: 1376 #line 7 1"yacc_parser.yacc" /* yacc.c:1646 */1425 #line 73 "yacc_parser.yacc" /* yacc.c:1646 */ 1377 1426 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].scalarNode)); } 1378 #line 1 379"yacc_parser.cpp" /* yacc.c:1646 */1427 #line 1428 "yacc_parser.cpp" /* yacc.c:1646 */ 1379 1428 break; 1380 1429 1381 1430 case 10: 1382 #line 7 2"yacc_parser.yacc" /* yacc.c:1646 */1431 #line 74 "yacc_parser.yacc" /* yacc.c:1646 */ 1383 1432 { (yyval.scalarNode) = new CScalarUnaryOpExprNode("neg", (yyvsp[0].scalarNode)); } 1384 #line 1 385"yacc_parser.cpp" /* yacc.c:1646 */1433 #line 1434 "yacc_parser.cpp" /* yacc.c:1646 */ 1385 1434 break; 1386 1435 1387 1436 case 11: 1388 #line 7 3"yacc_parser.yacc" /* yacc.c:1646 */1437 #line 75 "yacc_parser.yacc" /* yacc.c:1646 */ 1389 1438 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "pow", (yyvsp[0].scalarNode)); } 1390 #line 1 391"yacc_parser.cpp" /* yacc.c:1646 */1439 #line 1440 "yacc_parser.cpp" /* yacc.c:1646 */ 1391 1440 break; 1392 1441 1393 1442 case 12: 1394 #line 7 4"yacc_parser.yacc" /* yacc.c:1646 */1443 #line 76 "yacc_parser.yacc" /* yacc.c:1646 */ 1395 1444 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].scalarNode)); } 1396 #line 1 397"yacc_parser.cpp" /* yacc.c:1646 */1445 #line 1446 "yacc_parser.cpp" /* yacc.c:1646 */ 1397 1446 break; 1398 1447 1399 1448 case 13: 1400 #line 7 5"yacc_parser.yacc" /* yacc.c:1646 */1449 #line 77 "yacc_parser.yacc" /* yacc.c:1646 */ 1401 1450 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].scalarNode)); } 1402 #line 14 03"yacc_parser.cpp" /* yacc.c:1646 */1451 #line 1452 "yacc_parser.cpp" /* yacc.c:1646 */ 1403 1452 break; 1404 1453 1405 1454 case 14: 1406 #line 7 6"yacc_parser.yacc" /* yacc.c:1646 */1455 #line 78 "yacc_parser.yacc" /* yacc.c:1646 */ 1407 1456 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].scalarNode)); } 1408 #line 14 09"yacc_parser.cpp" /* yacc.c:1646 */1457 #line 1458 "yacc_parser.cpp" /* yacc.c:1646 */ 1409 1458 break; 1410 1459 1411 1460 case 15: 1412 #line 7 7"yacc_parser.yacc" /* yacc.c:1646 */1461 #line 79 "yacc_parser.yacc" /* yacc.c:1646 */ 1413 1462 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].scalarNode)); } 1414 #line 14 15"yacc_parser.cpp" /* yacc.c:1646 */1463 #line 1464 "yacc_parser.cpp" /* yacc.c:1646 */ 1415 1464 break; 1416 1465 1417 1466 case 16: 1418 #line 78"yacc_parser.yacc" /* yacc.c:1646 */1467 #line 80 "yacc_parser.yacc" /* yacc.c:1646 */ 1419 1468 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].scalarNode)); } 1420 #line 14 21"yacc_parser.cpp" /* yacc.c:1646 */1469 #line 1470 "yacc_parser.cpp" /* yacc.c:1646 */ 1421 1470 break; 1422 1471 1423 1472 case 17: 1424 #line 79 "yacc_parser.yacc" /* yacc.c:1646 */ 1473 #line 81 "yacc_parser.yacc" /* yacc.c:1646 */ 1474 { (yyval.scalarNode) = new CScalarBinaryOpExprNode((yyvsp[-2].scalarNode), "ne", (yyvsp[0].scalarNode)); } 1475 #line 1476 "yacc_parser.cpp" /* yacc.c:1646 */ 1476 break; 1477 1478 case 18: 1479 #line 82 "yacc_parser.yacc" /* yacc.c:1646 */ 1480 {(yyval.scalarNode) = new CScalarTernaryOpExprNode((yyvsp[-4].scalarNode), "cond", (yyvsp[-2].scalarNode), (yyvsp[0].scalarNode));} 1481 #line 1482 "yacc_parser.cpp" /* yacc.c:1646 */ 1482 break; 1483 1484 case 19: 1485 #line 83 "yacc_parser.yacc" /* yacc.c:1646 */ 1425 1486 { (yyval.scalarNode) = (yyvsp[-1].scalarNode); } 1426 #line 14 27"yacc_parser.cpp" /* yacc.c:1646 */1427 break; 1428 1429 case 18:1430 #line 8 0"yacc_parser.yacc" /* yacc.c:1646 */1487 #line 1488 "yacc_parser.cpp" /* yacc.c:1646 */ 1488 break; 1489 1490 case 20: 1491 #line 84 "yacc_parser.yacc" /* yacc.c:1646 */ 1431 1492 { (yyval.scalarNode) = new CScalarUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].scalarNode)); delete (yyvsp[-3].str); } 1432 #line 14 33"yacc_parser.cpp" /* yacc.c:1646 */1433 break; 1434 1435 case 19:1436 #line 8 4"yacc_parser.yacc" /* yacc.c:1646 */1493 #line 1494 "yacc_parser.cpp" /* yacc.c:1646 */ 1494 break; 1495 1496 case 21: 1497 #line 88 "yacc_parser.yacc" /* yacc.c:1646 */ 1437 1498 { (yyval.filterNode) = new CFilterFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1438 #line 1 439"yacc_parser.cpp" /* yacc.c:1646 */1439 break; 1440 1441 case 2 0:1442 #line 8 5"yacc_parser.yacc" /* yacc.c:1646 */1499 #line 1500 "yacc_parser.cpp" /* yacc.c:1646 */ 1500 break; 1501 1502 case 22: 1503 #line 89 "yacc_parser.yacc" /* yacc.c:1646 */ 1443 1504 { (yyval.filterNode) = new CFilterTemporalFieldExprNode(*(yyvsp[0].str)); delete (yyvsp[0].str); } 1444 #line 1 445"yacc_parser.cpp" /* yacc.c:1646 */1445 break; 1446 1447 case 2 1:1448 #line 86"yacc_parser.yacc" /* yacc.c:1646 */1505 #line 1506 "yacc_parser.cpp" /* yacc.c:1646 */ 1506 break; 1507 1508 case 23: 1509 #line 90 "yacc_parser.yacc" /* yacc.c:1646 */ 1449 1510 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].filterNode)); } 1450 #line 1 451"yacc_parser.cpp" /* yacc.c:1646 */1451 break; 1452 1453 case 2 2:1454 #line 87"yacc_parser.yacc" /* yacc.c:1646 */1511 #line 1512 "yacc_parser.cpp" /* yacc.c:1646 */ 1512 break; 1513 1514 case 24: 1515 #line 91 "yacc_parser.yacc" /* yacc.c:1646 */ 1455 1516 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].filterNode)); } 1456 #line 1 457"yacc_parser.cpp" /* yacc.c:1646 */1457 break; 1458 1459 case 2 3:1460 #line 88"yacc_parser.yacc" /* yacc.c:1646 */1517 #line 1518 "yacc_parser.cpp" /* yacc.c:1646 */ 1518 break; 1519 1520 case 25: 1521 #line 92 "yacc_parser.yacc" /* yacc.c:1646 */ 1461 1522 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].filterNode)); } 1462 #line 1 463"yacc_parser.cpp" /* yacc.c:1646 */1463 break; 1464 1465 case 2 4:1466 #line 89"yacc_parser.yacc" /* yacc.c:1646 */1523 #line 1524 "yacc_parser.cpp" /* yacc.c:1646 */ 1524 break; 1525 1526 case 26: 1527 #line 93 "yacc_parser.yacc" /* yacc.c:1646 */ 1467 1528 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].filterNode)); } 1468 #line 1 469"yacc_parser.cpp" /* yacc.c:1646 */1469 break; 1470 1471 case 2 5:1472 #line 9 0"yacc_parser.yacc" /* yacc.c:1646 */1529 #line 1530 "yacc_parser.cpp" /* yacc.c:1646 */ 1530 break; 1531 1532 case 27: 1533 #line 94 "yacc_parser.yacc" /* yacc.c:1646 */ 1473 1534 { (yyval.filterNode) = new CFilterUnaryOpExprNode("neg", (yyvsp[0].filterNode)); } 1474 #line 1 475"yacc_parser.cpp" /* yacc.c:1646 */1475 break; 1476 1477 case 2 6:1478 #line 9 1"yacc_parser.yacc" /* yacc.c:1646 */1535 #line 1536 "yacc_parser.cpp" /* yacc.c:1646 */ 1536 break; 1537 1538 case 28: 1539 #line 95 "yacc_parser.yacc" /* yacc.c:1646 */ 1479 1540 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].filterNode)); } 1480 #line 1 481"yacc_parser.cpp" /* yacc.c:1646 */1481 break; 1482 1483 case 2 7:1484 #line 9 2"yacc_parser.yacc" /* yacc.c:1646 */1541 #line 1542 "yacc_parser.cpp" /* yacc.c:1646 */ 1542 break; 1543 1544 case 29: 1545 #line 96 "yacc_parser.yacc" /* yacc.c:1646 */ 1485 1546 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].filterNode)); } 1486 #line 1 487"yacc_parser.cpp" /* yacc.c:1646 */1487 break; 1488 1489 case 28:1490 #line 9 3"yacc_parser.yacc" /* yacc.c:1646 */1547 #line 1548 "yacc_parser.cpp" /* yacc.c:1646 */ 1548 break; 1549 1550 case 30: 1551 #line 97 "yacc_parser.yacc" /* yacc.c:1646 */ 1491 1552 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].filterNode)); } 1492 #line 1 493"yacc_parser.cpp" /* yacc.c:1646 */1493 break; 1494 1495 case 29:1496 #line 9 4"yacc_parser.yacc" /* yacc.c:1646 */1553 #line 1554 "yacc_parser.cpp" /* yacc.c:1646 */ 1554 break; 1555 1556 case 31: 1557 #line 98 "yacc_parser.yacc" /* yacc.c:1646 */ 1497 1558 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].filterNode)); } 1498 #line 1 499"yacc_parser.cpp" /* yacc.c:1646 */1499 break; 1500 1501 case 3 0:1502 #line 9 5"yacc_parser.yacc" /* yacc.c:1646 */1559 #line 1560 "yacc_parser.cpp" /* yacc.c:1646 */ 1560 break; 1561 1562 case 32: 1563 #line 99 "yacc_parser.yacc" /* yacc.c:1646 */ 1503 1564 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].filterNode)); } 1504 #line 15 05"yacc_parser.cpp" /* yacc.c:1646 */1505 break; 1506 1507 case 3 1:1508 #line 96"yacc_parser.yacc" /* yacc.c:1646 */1565 #line 1566 "yacc_parser.cpp" /* yacc.c:1646 */ 1566 break; 1567 1568 case 33: 1569 #line 100 "yacc_parser.yacc" /* yacc.c:1646 */ 1509 1570 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].filterNode)); } 1510 #line 1511 "yacc_parser.cpp" /* yacc.c:1646 */ 1511 break; 1512 1513 case 32: 1514 #line 97 "yacc_parser.yacc" /* yacc.c:1646 */ 1571 #line 1572 "yacc_parser.cpp" /* yacc.c:1646 */ 1572 break; 1573 1574 case 34: 1575 #line 101 "yacc_parser.yacc" /* yacc.c:1646 */ 1576 { (yyval.filterNode) = new CFilterFieldFieldOpExprNode((yyvsp[-2].filterNode), "ne", (yyvsp[0].filterNode)); } 1577 #line 1578 "yacc_parser.cpp" /* yacc.c:1646 */ 1578 break; 1579 1580 case 35: 1581 #line 102 "yacc_parser.yacc" /* yacc.c:1646 */ 1515 1582 { (yyval.filterNode) = (yyvsp[-1].filterNode); } 1516 #line 1517 "yacc_parser.cpp" /* yacc.c:1646 */ 1517 break; 1518 1519 case 33: 1520 #line 98 "yacc_parser.yacc" /* yacc.c:1646 */ 1583 #line 1584 "yacc_parser.cpp" /* yacc.c:1646 */ 1584 break; 1585 1586 case 36: 1587 #line 103 "yacc_parser.yacc" /* yacc.c:1646 */ 1588 {(yyval.filterNode) = new CFilterScalarScalarFieldOpExprNode((yyvsp[-4].scalarNode), "cond",(yyvsp[-2].scalarNode), (yyvsp[0].filterNode));} 1589 #line 1590 "yacc_parser.cpp" /* yacc.c:1646 */ 1590 break; 1591 1592 case 37: 1593 #line 104 "yacc_parser.yacc" /* yacc.c:1646 */ 1594 {(yyval.filterNode) = new CFilterScalarFieldScalarOpExprNode((yyvsp[-4].scalarNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].scalarNode));} 1595 #line 1596 "yacc_parser.cpp" /* yacc.c:1646 */ 1596 break; 1597 1598 case 38: 1599 #line 105 "yacc_parser.yacc" /* yacc.c:1646 */ 1600 {(yyval.filterNode) = new CFilterScalarFieldFieldOpExprNode((yyvsp[-4].scalarNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].filterNode));} 1601 #line 1602 "yacc_parser.cpp" /* yacc.c:1646 */ 1602 break; 1603 1604 case 39: 1605 #line 106 "yacc_parser.yacc" /* yacc.c:1646 */ 1606 {(yyval.filterNode) = new CFilterFieldScalarScalarOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].scalarNode), (yyvsp[0].scalarNode));} 1607 #line 1608 "yacc_parser.cpp" /* yacc.c:1646 */ 1608 break; 1609 1610 case 40: 1611 #line 107 "yacc_parser.yacc" /* yacc.c:1646 */ 1612 {(yyval.filterNode) = new CFilterFieldScalarFieldOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].scalarNode), (yyvsp[0].filterNode));} 1613 #line 1614 "yacc_parser.cpp" /* yacc.c:1646 */ 1614 break; 1615 1616 case 41: 1617 #line 108 "yacc_parser.yacc" /* yacc.c:1646 */ 1618 {(yyval.filterNode) = new CFilterFieldFieldScalarOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].scalarNode));} 1619 #line 1620 "yacc_parser.cpp" /* yacc.c:1646 */ 1620 break; 1621 1622 case 42: 1623 #line 109 "yacc_parser.yacc" /* yacc.c:1646 */ 1624 {(yyval.filterNode) = new CFilterFieldFieldFieldOpExprNode((yyvsp[-4].filterNode), "cond",(yyvsp[-2].filterNode), (yyvsp[0].filterNode));} 1625 #line 1626 "yacc_parser.cpp" /* yacc.c:1646 */ 1626 break; 1627 1628 case 43: 1629 #line 110 "yacc_parser.yacc" /* yacc.c:1646 */ 1521 1630 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "add", (yyvsp[0].scalarNode)); } 1522 #line 1 523"yacc_parser.cpp" /* yacc.c:1646 */1523 break; 1524 1525 case 34:1526 #line 99"yacc_parser.yacc" /* yacc.c:1646 */1631 #line 1632 "yacc_parser.cpp" /* yacc.c:1646 */ 1632 break; 1633 1634 case 44: 1635 #line 111 "yacc_parser.yacc" /* yacc.c:1646 */ 1527 1636 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "add", (yyvsp[0].filterNode)); } 1528 #line 1 529"yacc_parser.cpp" /* yacc.c:1646 */1529 break; 1530 1531 case 35:1532 #line 1 00"yacc_parser.yacc" /* yacc.c:1646 */1637 #line 1638 "yacc_parser.cpp" /* yacc.c:1646 */ 1638 break; 1639 1640 case 45: 1641 #line 112 "yacc_parser.yacc" /* yacc.c:1646 */ 1533 1642 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "minus", (yyvsp[0].scalarNode)); } 1534 #line 1 535"yacc_parser.cpp" /* yacc.c:1646 */1535 break; 1536 1537 case 36:1538 #line 1 01"yacc_parser.yacc" /* yacc.c:1646 */1643 #line 1644 "yacc_parser.cpp" /* yacc.c:1646 */ 1644 break; 1645 1646 case 46: 1647 #line 113 "yacc_parser.yacc" /* yacc.c:1646 */ 1539 1648 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "minus", (yyvsp[0].filterNode)); } 1540 #line 1 541"yacc_parser.cpp" /* yacc.c:1646 */1541 break; 1542 1543 case 37:1544 #line 1 02"yacc_parser.yacc" /* yacc.c:1646 */1649 #line 1650 "yacc_parser.cpp" /* yacc.c:1646 */ 1650 break; 1651 1652 case 47: 1653 #line 114 "yacc_parser.yacc" /* yacc.c:1646 */ 1545 1654 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "mult", (yyvsp[0].scalarNode)); } 1546 #line 1 547"yacc_parser.cpp" /* yacc.c:1646 */1547 break; 1548 1549 case 38:1550 #line 1 03"yacc_parser.yacc" /* yacc.c:1646 */1655 #line 1656 "yacc_parser.cpp" /* yacc.c:1646 */ 1656 break; 1657 1658 case 48: 1659 #line 115 "yacc_parser.yacc" /* yacc.c:1646 */ 1551 1660 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "mult", (yyvsp[0].filterNode)); } 1552 #line 1 553"yacc_parser.cpp" /* yacc.c:1646 */1553 break; 1554 1555 case 39:1556 #line 1 04"yacc_parser.yacc" /* yacc.c:1646 */1661 #line 1662 "yacc_parser.cpp" /* yacc.c:1646 */ 1662 break; 1663 1664 case 49: 1665 #line 116 "yacc_parser.yacc" /* yacc.c:1646 */ 1557 1666 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "div", (yyvsp[0].scalarNode)); } 1558 #line 1 559"yacc_parser.cpp" /* yacc.c:1646 */1559 break; 1560 1561 case 40:1562 #line 1 05"yacc_parser.yacc" /* yacc.c:1646 */1667 #line 1668 "yacc_parser.cpp" /* yacc.c:1646 */ 1668 break; 1669 1670 case 50: 1671 #line 117 "yacc_parser.yacc" /* yacc.c:1646 */ 1563 1672 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "div", (yyvsp[0].filterNode)); } 1564 #line 1 565"yacc_parser.cpp" /* yacc.c:1646 */1565 break; 1566 1567 case 41:1568 #line 1 06"yacc_parser.yacc" /* yacc.c:1646 */1673 #line 1674 "yacc_parser.cpp" /* yacc.c:1646 */ 1674 break; 1675 1676 case 51: 1677 #line 118 "yacc_parser.yacc" /* yacc.c:1646 */ 1569 1678 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "pow", (yyvsp[0].scalarNode)); } 1570 #line 1 571"yacc_parser.cpp" /* yacc.c:1646 */1571 break; 1572 1573 case 42:1574 #line 1 07"yacc_parser.yacc" /* yacc.c:1646 */1679 #line 1680 "yacc_parser.cpp" /* yacc.c:1646 */ 1680 break; 1681 1682 case 52: 1683 #line 119 "yacc_parser.yacc" /* yacc.c:1646 */ 1575 1684 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "eq", (yyvsp[0].scalarNode)); } 1576 #line 1 577"yacc_parser.cpp" /* yacc.c:1646 */1577 break; 1578 1579 case 43:1580 #line 1 08"yacc_parser.yacc" /* yacc.c:1646 */1685 #line 1686 "yacc_parser.cpp" /* yacc.c:1646 */ 1686 break; 1687 1688 case 53: 1689 #line 120 "yacc_parser.yacc" /* yacc.c:1646 */ 1581 1690 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "eq", (yyvsp[0].filterNode)); } 1582 #line 1 583"yacc_parser.cpp" /* yacc.c:1646 */1583 break; 1584 1585 case 44:1586 #line 1 09"yacc_parser.yacc" /* yacc.c:1646 */1691 #line 1692 "yacc_parser.cpp" /* yacc.c:1646 */ 1692 break; 1693 1694 case 54: 1695 #line 121 "yacc_parser.yacc" /* yacc.c:1646 */ 1587 1696 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "lt", (yyvsp[0].scalarNode)); } 1588 #line 1 589"yacc_parser.cpp" /* yacc.c:1646 */1589 break; 1590 1591 case 45:1592 #line 1 10"yacc_parser.yacc" /* yacc.c:1646 */1697 #line 1698 "yacc_parser.cpp" /* yacc.c:1646 */ 1698 break; 1699 1700 case 55: 1701 #line 122 "yacc_parser.yacc" /* yacc.c:1646 */ 1593 1702 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "lt", (yyvsp[0].filterNode)); } 1594 #line 1 595"yacc_parser.cpp" /* yacc.c:1646 */1595 break; 1596 1597 case 46:1598 #line 1 11"yacc_parser.yacc" /* yacc.c:1646 */1703 #line 1704 "yacc_parser.cpp" /* yacc.c:1646 */ 1704 break; 1705 1706 case 56: 1707 #line 123 "yacc_parser.yacc" /* yacc.c:1646 */ 1599 1708 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "gt", (yyvsp[0].scalarNode)); } 1600 #line 1 601"yacc_parser.cpp" /* yacc.c:1646 */1601 break; 1602 1603 case 47:1604 #line 1 12"yacc_parser.yacc" /* yacc.c:1646 */1709 #line 1710 "yacc_parser.cpp" /* yacc.c:1646 */ 1710 break; 1711 1712 case 57: 1713 #line 124 "yacc_parser.yacc" /* yacc.c:1646 */ 1605 1714 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "gt", (yyvsp[0].filterNode)); } 1606 #line 1 607"yacc_parser.cpp" /* yacc.c:1646 */1607 break; 1608 1609 case 48:1610 #line 1 13"yacc_parser.yacc" /* yacc.c:1646 */1715 #line 1716 "yacc_parser.cpp" /* yacc.c:1646 */ 1716 break; 1717 1718 case 58: 1719 #line 125 "yacc_parser.yacc" /* yacc.c:1646 */ 1611 1720 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "le", (yyvsp[0].scalarNode)); } 1612 #line 1 613"yacc_parser.cpp" /* yacc.c:1646 */1613 break; 1614 1615 case 49:1616 #line 1 14"yacc_parser.yacc" /* yacc.c:1646 */1721 #line 1722 "yacc_parser.cpp" /* yacc.c:1646 */ 1722 break; 1723 1724 case 59: 1725 #line 126 "yacc_parser.yacc" /* yacc.c:1646 */ 1617 1726 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "le", (yyvsp[0].filterNode)); } 1618 #line 1 619"yacc_parser.cpp" /* yacc.c:1646 */1619 break; 1620 1621 case 50:1622 #line 1 15"yacc_parser.yacc" /* yacc.c:1646 */1727 #line 1728 "yacc_parser.cpp" /* yacc.c:1646 */ 1728 break; 1729 1730 case 60: 1731 #line 127 "yacc_parser.yacc" /* yacc.c:1646 */ 1623 1732 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ge", (yyvsp[0].scalarNode)); } 1624 #line 1 625"yacc_parser.cpp" /* yacc.c:1646 */1625 break; 1626 1627 case 51:1628 #line 1 16"yacc_parser.yacc" /* yacc.c:1646 */1733 #line 1734 "yacc_parser.cpp" /* yacc.c:1646 */ 1734 break; 1735 1736 case 61: 1737 #line 128 "yacc_parser.yacc" /* yacc.c:1646 */ 1629 1738 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ge", (yyvsp[0].filterNode)); } 1630 #line 1631 "yacc_parser.cpp" /* yacc.c:1646 */ 1631 break; 1632 1633 case 52: 1634 #line 117 "yacc_parser.yacc" /* yacc.c:1646 */ 1739 #line 1740 "yacc_parser.cpp" /* yacc.c:1646 */ 1740 break; 1741 1742 case 62: 1743 #line 129 "yacc_parser.yacc" /* yacc.c:1646 */ 1744 { (yyval.filterNode) = new CFilterFieldScalarOpExprNode((yyvsp[-2].filterNode), "ne", (yyvsp[0].scalarNode)); } 1745 #line 1746 "yacc_parser.cpp" /* yacc.c:1646 */ 1746 break; 1747 1748 case 63: 1749 #line 130 "yacc_parser.yacc" /* yacc.c:1646 */ 1750 { (yyval.filterNode) = new CFilterScalarFieldOpExprNode((yyvsp[-2].scalarNode), "ne", (yyvsp[0].filterNode)); } 1751 #line 1752 "yacc_parser.cpp" /* yacc.c:1646 */ 1752 break; 1753 1754 case 64: 1755 #line 131 "yacc_parser.yacc" /* yacc.c:1646 */ 1635 1756 { (yyval.filterNode) = new CFilterUnaryOpExprNode(*(yyvsp[-3].str), (yyvsp[-1].filterNode)); delete (yyvsp[-3].str); } 1636 #line 1 637"yacc_parser.cpp" /* yacc.c:1646 */1637 break; 1638 1639 1640 #line 1 641"yacc_parser.cpp" /* yacc.c:1646 */1757 #line 1758 "yacc_parser.cpp" /* yacc.c:1646 */ 1758 break; 1759 1760 1761 #line 1762 "yacc_parser.cpp" /* yacc.c:1646 */ 1641 1762 default: break; 1642 1763 } … … 1866 1987 return yyresult; 1867 1988 } 1868 #line 1 19"yacc_parser.yacc" /* yacc.c:1906 */1989 #line 133 "yacc_parser.yacc" /* yacc.c:1906 */ 1869 1990 1870 1991 -
XIOS/dev/dev_olga/src/parse_expr/yacc_parser.hpp
r728 r1158 60 60 LE = 270, 61 61 GE = 271, 62 LEFT_PARENTHESIS = 272, 63 RIGHT_PARENTHESIS = 273, 64 END = 274, 65 NEG = 275 62 NE = 272, 63 LEFT_PARENTHESIS = 273, 64 RIGHT_PARENTHESIS = 274, 65 QUESTION_MARK = 275, 66 COLON = 276, 67 END = 277, 68 NEG = 278 66 69 }; 67 70 #endif … … 78 81 xios::IFilterExprNode* filterNode; 79 82 80 #line 8 1"yacc_parser.hpp" /* yacc.c:1909 */83 #line 84 "yacc_parser.hpp" /* yacc.c:1909 */ 81 84 }; 82 85 # define YYSTYPE_IS_TRIVIAL 1 -
XIOS/dev/dev_olga/src/parse_expr/yacc_parser.yacc
r728 r1158 42 42 %token <str> VAR ID AVERAGE 43 43 %token PLUS MINUS TIMES DIVIDE POWER 44 %token EQ LT GT LE GE 44 %token EQ LT GT LE GE NE 45 45 %token LEFT_PARENTHESIS RIGHT_PARENTHESIS 46 %token QUESTION_MARK COLON 46 47 %token <str> END 47 48 48 %left EQ LT GT LE GE 49 %nonassoc QUESTION_MARK COLON 50 %left EQ LT GT LE GE NE 49 51 %left PLUS MINUS 50 52 %left TIMES DIVIDE … … 77 79 | Expression LE Expression { $$ = new CScalarBinaryOpExprNode($1, "le", $3); } 78 80 | Expression GE Expression { $$ = new CScalarBinaryOpExprNode($1, "ge", $3); } 81 | Expression NE Expression { $$ = new CScalarBinaryOpExprNode($1, "ne", $3); } 82 | Expression QUESTION_MARK Expression COLON Expression {$$ = new CScalarTernaryOpExprNode($1, "cond", $3, $5);} 79 83 | LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = $2; } 80 84 | ID LEFT_PARENTHESIS Expression RIGHT_PARENTHESIS { $$ = new CScalarUnaryOpExprNode(*$1, $3); delete $1; } … … 95 99 | Field_expr LE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "le", $3); } 96 100 | Field_expr GE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ge", $3); } 101 | Field_expr NE Field_expr { $$ = new CFilterFieldFieldOpExprNode($1, "ne", $3); } 97 102 | LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = $2; } 103 | Expression QUESTION_MARK Expression COLON Field_expr {$$ = new CFilterScalarScalarFieldOpExprNode($1, "cond",$3, $5);} 104 | Expression QUESTION_MARK Field_expr COLON Expression {$$ = new CFilterScalarFieldScalarOpExprNode($1, "cond",$3, $5);} 105 | Expression QUESTION_MARK Field_expr COLON Field_expr {$$ = new CFilterScalarFieldFieldOpExprNode($1, "cond",$3, $5);} 106 | Field_expr QUESTION_MARK Expression COLON Expression {$$ = new CFilterFieldScalarScalarOpExprNode($1, "cond",$3, $5);} 107 | Field_expr QUESTION_MARK Expression COLON Field_expr {$$ = new CFilterFieldScalarFieldOpExprNode($1, "cond",$3, $5);} 108 | Field_expr QUESTION_MARK Field_expr COLON Expression {$$ = new CFilterFieldFieldScalarOpExprNode($1, "cond",$3, $5);} 109 | Field_expr QUESTION_MARK Field_expr COLON Field_expr {$$ = new CFilterFieldFieldFieldOpExprNode($1, "cond",$3, $5);} 98 110 | Field_expr PLUS Expression { $$ = new CFilterFieldScalarOpExprNode($1, "add", $3); } 99 111 | Expression PLUS Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "add", $3); } … … 115 127 | Field_expr GE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ge", $3); } 116 128 | Expression GE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ge", $3); } 129 | Field_expr NE Expression { $$ = new CFilterFieldScalarOpExprNode($1, "ne", $3); } 130 | Expression NE Field_expr { $$ = new CFilterScalarFieldOpExprNode($1, "ne", $3); } 117 131 | ID LEFT_PARENTHESIS Field_expr RIGHT_PARENTHESIS { $$ = new CFilterUnaryOpExprNode(*$1, $3); delete $1; } 118 132 ; -
XIOS/dev/dev_olga/src/server.cpp
r1152 r1158 298 298 void CServer::finalize(void) 299 299 { 300 301 300 CTimer::get("XIOS").suspend() ; 302 301 … … 328 327 report(0)<<"Performance report : Time spent in processing events : "<<CTimer::get("Process events").getCumulatedTime()<<endl ; 329 328 report(0)<<"Performance report : Ratio : "<<CTimer::get("Process events").getCumulatedTime()/CTimer::get("XIOS server").getCumulatedTime()*100.<<"%"<<endl ; 329 report(100)<<CTimer::getAllCumulatedTime()<<endl ; 330 330 } 331 331 … … 352 352 if (finished && contextList.empty()) stop=true ; 353 353 eventScheduler->checkEvent() ; 354 355 354 } 356 355 CTimer::get("XIOS server").suspend() ; … … 422 421 MPI_Status status ; 423 422 int flag ; 424 static void* buffer ;423 static char* buffer ; 425 424 static MPI_Request request ; 426 425 static bool recept=false ; … … 438 437 MPI_Get_count(&status,MPI_CHAR,&count) ; 439 438 buffer=new char[count] ; 440 MPI_Irecv( buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ;439 MPI_Irecv((void*)buffer,count,MPI_CHAR,rank,1,CXios::globalComm,&request) ; 441 440 recept=true ; 442 441 } … … 451 450 rank=status.MPI_SOURCE ; 452 451 MPI_Get_count(&status,MPI_CHAR,&count) ; 453 recvContextMessage( buffer,count) ;454 delete [] buffer ;452 recvContextMessage((void*)buffer,count) ; 453 delete [] buffer ; 455 454 recept=false ; 456 455 } … … 540 539 MPI_Get_count(&status,MPI_CHAR,&count) ; 541 540 buffer=new char[count] ; 542 MPI_Irecv( buffer,count,MPI_CHAR,root,2,intraComm,&request) ;541 MPI_Irecv((void*)buffer,count,MPI_CHAR,root,2,intraComm,&request) ; 543 542 recept=true ; 544 543 } … … 552 551 MPI_Get_count(&status,MPI_CHAR,&count) ; 553 552 eventScheduler->registerEvent(nbContexts,hashId); 554 // registerContext( buffer,count) ;553 // registerContext((void*)buffer,count) ; 555 554 // delete [] buffer ; 556 555 recept=false ; … … 685 684 id = getRank(); 686 685 687 // if (!CXios::usingServer2)688 // id = getRank();689 // else690 // {691 // if (serverLevel == 1)692 // id = rank_;693 // else694 // id = poolId;695 // }696 686 fileNameClient << fileName << "_" << std::setfill('0') << std::setw(numDigit) << id << ext; 697 687 fb->open(fileNameClient.str().c_str(), std::ios::out); -
XIOS/dev/dev_olga/src/test/test_regular.f90
r1009 r1158 18 18 INTEGER :: comm 19 19 INTEGER :: ierr 20 INTEGER :: size , rank21 22 INTEGER :: nlon = 5 !10023 INTEGER :: nlat = 5 !10020 INTEGER :: sizeComm, rank ! SIZE is a fortran function 21 22 INTEGER :: nlon = 100 23 INTEGER :: nlat = 100 24 24 INTEGER :: ncell 25 25 INTEGER :: ilat, ilon, ind -
XIOS/dev/dev_olga/src/timer.cpp
r652 r1158 3 3 #include <string> 4 4 #include <map> 5 #include <iostream> 6 #include <sstream> 5 7 #include "tracer.hpp" 6 8 … … 57 59 return it->second; 58 60 } 61 62 string CTimer::getAllCumulatedTime(void) 63 { 64 std::ostringstream strOut ; 65 for(std::map<std::string,CTimer>::iterator it=allTimer.begin();it!=allTimer.end();++it) 66 strOut<<"Timer : "<<it->first<<" --> cumulated time : "<<it->second.getCumulatedTime()<<std::endl ; 67 return strOut.str() ; 68 } 59 69 } -
XIOS/dev/dev_olga/src/timer.hpp
r688 r1158 23 23 static double getTime(void); 24 24 static CTimer& get(std::string name); 25 static std::string getAllCumulatedTime(void) ; 25 26 }; 26 27 } -
XIOS/dev/dev_olga/src/transformation/Functions/average_reduction.cpp
r979 r1158 3 3 \author Ha NGUYEN 4 4 \since 8 Sep 2016 5 \date 8 Sep 20165 \date 9 Jan 2017 6 6 7 7 \brief average reduction 8 8 */ 9 9 #include "average_reduction.hpp" 10 #include "utils.hpp" 10 11 11 12 namespace xios { … … 29 30 const double* dataInput, 30 31 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial) 32 std::vector<bool>& flagInitial, 33 bool ignoreMissingValue) 32 34 { 33 if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; } 35 if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; } 34 36 35 int nbLocalIndex = localIndex.size(); 36 int currentlocalIndex = 0; 37 double currentWeight = 0.0; 38 for (int idx = 0; idx < nbLocalIndex; ++idx) 37 if (ignoreMissingValue) 39 38 { 40 currentlocalIndex = localIndex[idx].first; 41 currentWeight = localIndex[idx].second; 39 int nbLocalIndex = localIndex.size(); 40 int currentlocalIndex = 0; 41 double currentWeight = 0.0; 42 42 43 if (flagInitial[currentlocalIndex]) 43 dataOut=std::numeric_limits<double>::quiet_NaN(); 44 45 for (int idx = 0; idx < nbLocalIndex; ++idx) 44 46 { 45 dataOut(currentlocalIndex) = *(dataInput + idx); 46 flagInitial[currentlocalIndex] = false; 47 currentlocalIndex = localIndex[idx].first; 48 currentWeight = localIndex[idx].second; 49 if (!NumTraits<double>::isnan(*(dataInput + idx))) 50 { 51 if (flagInitial[currentlocalIndex]) 52 { 53 dataOut(currentlocalIndex) = *(dataInput + idx); 54 flagInitial[currentlocalIndex] = false; 55 } 56 else 57 { 58 dataOut(currentlocalIndex) += *(dataInput + idx); 59 weights_(currentlocalIndex) += 1.0; 60 } 61 } 47 62 } 48 else 63 } 64 else 65 { 66 int nbLocalIndex = localIndex.size(); 67 int currentlocalIndex = 0; 68 double currentWeight = 0.0; 69 for (int idx = 0; idx < nbLocalIndex; ++idx) 49 70 { 50 dataOut(currentlocalIndex) += *(dataInput + idx); 51 weights_(currentlocalIndex) += 1.0; 71 currentlocalIndex = localIndex[idx].first; 72 currentWeight = localIndex[idx].second; 73 74 if (flagInitial[currentlocalIndex]) 75 { 76 dataOut(currentlocalIndex) = *(dataInput + idx); 77 flagInitial[currentlocalIndex] = false; 78 } 79 else 80 { 81 dataOut(currentlocalIndex) += *(dataInput + idx); 82 weights_(currentlocalIndex) += 1.0; 83 } 52 84 } 53 85 } -
XIOS/dev/dev_olga/src/transformation/Functions/average_reduction.hpp
r979 r1158 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial); 28 std::vector<bool>& flagInitial, 29 bool ignoreMissingValue); 29 30 30 31 virtual void updateData(CArray<double,1>& dataOut); -
XIOS/dev/dev_olga/src/transformation/Functions/extract.cpp
r895 r1158 29 29 const double* dataInput, 30 30 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial) 31 std::vector<bool>& flagInitial, 32 bool ignoreMissingValue) 32 33 { 33 34 int nbLocalIndex = localIndex.size(); -
XIOS/dev/dev_olga/src/transformation/Functions/extract.hpp
r895 r1158 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial); 28 std::vector<bool>& flagInitial, 29 bool ignoreMissingValue); 29 30 30 31 virtual ~CExtractReductionAlgorithm() {} -
XIOS/dev/dev_olga/src/transformation/Functions/max_reduction.cpp
r979 r1158 8 8 */ 9 9 #include "max_reduction.hpp" 10 #include "utils.hpp" 10 11 11 12 namespace xios { … … 29 30 const double* dataInput, 30 31 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial) 32 { 33 int nbLocalIndex = localIndex.size(); 34 int currentlocalIndex = 0; 35 double currentWeight = 0.0; 36 for (int idx = 0; idx < nbLocalIndex; ++idx) 32 std::vector<bool>& flagInitial, 33 bool ignoreMissingValue) 34 { 35 if (ignoreMissingValue) 37 36 { 38 currentlocalIndex = localIndex[idx].first; 39 currentWeight = localIndex[idx].second; 40 if (flagInitial[currentlocalIndex]) 37 int nbLocalIndex = localIndex.size(); 38 int currentlocalIndex = 0; 39 dataOut=std::numeric_limits<double>::quiet_NaN(); 40 for (int idx = 0; idx < nbLocalIndex; ++idx) 41 41 { 42 dataOut(currentlocalIndex) = *(dataInput + idx); 43 flagInitial[currentlocalIndex] = false; 42 currentlocalIndex = localIndex[idx].first; 43 if (!NumTraits<double>::isnan(*(dataInput + idx))) 44 { 45 if (flagInitial[currentlocalIndex]) 46 { 47 dataOut(currentlocalIndex) = *(dataInput + idx); 48 flagInitial[currentlocalIndex] = false; 49 } 50 else 51 { 52 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 53 } 54 } 44 55 } 45 else 56 } 57 else 58 { 59 int nbLocalIndex = localIndex.size(); 60 int currentlocalIndex = 0; 61 for (int idx = 0; idx < nbLocalIndex; ++idx) 46 62 { 47 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 63 currentlocalIndex = localIndex[idx].first; 64 if (flagInitial[currentlocalIndex]) 65 { 66 dataOut(currentlocalIndex) = *(dataInput + idx); 67 flagInitial[currentlocalIndex] = false; 68 } 69 else 70 { 71 dataOut(currentlocalIndex) = std::max(*(dataInput + idx), dataOut(currentlocalIndex)); 72 } 48 73 } 49 74 } -
XIOS/dev/dev_olga/src/transformation/Functions/max_reduction.hpp
r979 r1158 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial); 28 std::vector<bool>& flagInitial, 29 bool ignoreMissingValue); 29 30 30 31 virtual ~CMaxReductionAlgorithm() {} -
XIOS/dev/dev_olga/src/transformation/Functions/min_reduction.cpp
r979 r1158 3 3 \author Ha NGUYEN 4 4 \since 27 June 2016 5 \date 27 June 20165 \date 9 Jan 2017 6 6 7 7 \brief min reduction 8 8 */ 9 9 #include "min_reduction.hpp" 10 #include "utils.hpp" 10 11 11 12 namespace xios { … … 29 30 const double* dataInput, 30 31 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial) 32 std::vector<bool>& flagInitial, 33 bool ignoreMissingValue) 32 34 { 33 int nbLocalIndex = localIndex.size(); 34 int currentlocalIndex = 0; 35 for (int idx = 0; idx < nbLocalIndex; ++idx) 35 if (ignoreMissingValue) 36 36 { 37 currentlocalIndex = localIndex[idx].first; 38 if (flagInitial[currentlocalIndex]) 37 int nbLocalIndex = localIndex.size(); 38 int currentlocalIndex = 0; 39 dataOut=std::numeric_limits<double>::quiet_NaN(); 40 for (int idx = 0; idx < nbLocalIndex; ++idx) 39 41 { 40 dataOut(currentlocalIndex) = *(dataInput + idx); 41 flagInitial[currentlocalIndex] = false; 42 currentlocalIndex = localIndex[idx].first; 43 if (!NumTraits<double>::isnan(*(dataInput + idx))) 44 { 45 if (flagInitial[currentlocalIndex]) 46 { 47 dataOut(currentlocalIndex) = *(dataInput + idx); 48 flagInitial[currentlocalIndex] = false; 49 } 50 else 51 { 52 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 53 } 54 } 42 55 } 43 else 56 } 57 else 58 { 59 int nbLocalIndex = localIndex.size(); 60 int currentlocalIndex = 0; 61 for (int idx = 0; idx < nbLocalIndex; ++idx) 44 62 { 45 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 63 currentlocalIndex = localIndex[idx].first; 64 if (flagInitial[currentlocalIndex]) 65 { 66 dataOut(currentlocalIndex) = *(dataInput + idx); 67 flagInitial[currentlocalIndex] = false; 68 } 69 else 70 { 71 dataOut(currentlocalIndex) = std::min(*(dataInput + idx), dataOut(currentlocalIndex)); 72 } 46 73 } 47 74 } -
XIOS/dev/dev_olga/src/transformation/Functions/min_reduction.hpp
r979 r1158 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial); 28 std::vector<bool>& flagInitial, 29 bool ignoreMissingValue); 29 30 30 31 virtual ~CMinReductionAlgorithm() {} -
XIOS/dev/dev_olga/src/transformation/Functions/reduction.hpp
r979 r1158 45 45 const double* dataInput, 46 46 CArray<double,1>& dataOut, 47 std::vector<bool>& flagInitial) = 0; 47 std::vector<bool>& flagInitial, 48 bool ignoreMissingValue) = 0; 48 49 /*! 49 50 Update local data -
XIOS/dev/dev_olga/src/transformation/Functions/sum_reduction.cpp
r979 r1158 3 3 \author Ha NGUYEN 4 4 \since 27 June 2016 5 \date 27 June 20165 \date 9 Jan 2017 6 6 7 7 \brief sum reduction 8 8 */ 9 9 #include "sum_reduction.hpp" 10 #include "utils.hpp" 10 11 11 12 namespace xios { … … 29 30 const double* dataInput, 30 31 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial) 32 std::vector<bool>& flagInitial, 33 bool ignoreMissingValue) 32 34 { 33 int nbLocalIndex = localIndex.size(); 34 int currentlocalIndex = 0; 35 double currentWeight = 0.0; 36 for (int idx = 0; idx < nbLocalIndex; ++idx) 35 if (ignoreMissingValue) 37 36 { 38 currentlocalIndex = localIndex[idx].first; 39 currentWeight = localIndex[idx].second; 40 if (flagInitial[currentlocalIndex]) 37 int nbLocalIndex = localIndex.size(); 38 int currentlocalIndex = 0; 39 40 dataOut=std::numeric_limits<double>::quiet_NaN(); 41 42 for (int idx = 0; idx < nbLocalIndex; ++idx) 41 43 { 42 dataOut(currentlocalIndex) = *(dataInput + idx); 43 flagInitial[currentlocalIndex] = false; 44 } 45 else 44 currentlocalIndex = localIndex[idx].first; 45 if (!NumTraits<double>::isnan(*(dataInput + idx))) 46 { 47 if (flagInitial[currentlocalIndex]) 48 { 49 dataOut(currentlocalIndex) = *(dataInput + idx); 50 flagInitial[currentlocalIndex] = false; 51 } 52 else 53 { 54 dataOut(currentlocalIndex) += *(dataInput + idx); 55 } 56 } 57 } 58 } 59 else 60 { 61 int nbLocalIndex = localIndex.size(); 62 int currentlocalIndex = 0; 63 for (int idx = 0; idx < nbLocalIndex; ++idx) 46 64 { 47 dataOut(currentlocalIndex) += *(dataInput + idx); 65 currentlocalIndex = localIndex[idx].first; 66 if (flagInitial[currentlocalIndex]) 67 { 68 dataOut(currentlocalIndex) = *(dataInput + idx); 69 flagInitial[currentlocalIndex] = false; 70 } 71 else 72 { 73 dataOut(currentlocalIndex) += *(dataInput + idx); 74 } 48 75 } 49 76 } -
XIOS/dev/dev_olga/src/transformation/Functions/sum_reduction.hpp
r979 r1158 26 26 const double* dataInput, 27 27 CArray<double,1>& dataOut, 28 std::vector<bool>& flagInitial); 28 std::vector<bool>& flagInitial, 29 bool ignoreMissingValue); 29 30 30 31 virtual ~CSumReductionAlgorithm() {} -
XIOS/dev/dev_olga/src/transformation/axis_algorithm_extract_domain.cpp
r980 r1158 68 68 const double* dataInput, 69 69 CArray<double,1>& dataOut, 70 std::vector<bool>& flagInitial, 71 const double& defaultValue)70 std::vector<bool>& flagInitial, 71 bool ignoreMissingValue) 72 72 { 73 reduction_->apply(localIndex, dataInput, dataOut, flagInitial );73 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 74 74 } 75 75 -
XIOS/dev/dev_olga/src/transformation/axis_algorithm_extract_domain.hpp
r933 r1158 33 33 const double* dataInput, 34 34 CArray<double,1>& dataOut, 35 std::vector<bool>& flagInitial, 36 const double& defaultValue);35 std::vector<bool>& flagInitial, 36 bool ignoreMissingValue); 37 37 38 38 virtual ~CAxisAlgorithmExtractDomain(); -
XIOS/dev/dev_olga/src/transformation/axis_algorithm_reduce_domain.cpp
r980 r1158 76 76 const double* dataInput, 77 77 CArray<double,1>& dataOut, 78 std::vector<bool>& flagInitial, 79 const double& defaultValue)78 std::vector<bool>& flagInitial, 79 bool ignoreMissingValue) 80 80 { 81 reduction_->apply(localIndex, dataInput, dataOut, flagInitial );81 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 82 82 } 83 83 -
XIOS/dev/dev_olga/src/transformation/axis_algorithm_reduce_domain.hpp
r979 r1158 32 32 const double* dataInput, 33 33 CArray<double,1>& dataOut, 34 std::vector<bool>& flagInitial, 35 const double& defaultValue);34 std::vector<bool>& flagInitial, 35 bool ignoreMissingValue); 36 36 37 37 virtual void updateData(CArray<double,1>& dataOut); -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_expand.cpp
r978 r1158 45 45 CDomain* domainSource, 46 46 CExpandDomain* expandDomain) 47 : CDomainAlgorithmTransformation(domainDestination, domainSource) 47 : CDomainAlgorithmTransformation(domainDestination, domainSource), 48 isXPeriodic_(false), isYPeriodic_(false) 48 49 { 49 50 if (domainDestination == domainSource) … … 55 56 } 56 57 57 // if (!domainDestination->hasRefTo(domainSource))58 // {59 // ERROR("CDomainAlgorithmExpand::CDomainAlgorithmExpand(CDomain* domainDestination,CDomain* domainSource, CExpandDomain* expandDomain)",60 // << "Domain domain destination must refer to domain source (directly or indirectly) by domain_ref " << std::endl61 // << "Domain source " <<domainSource->getId() << std::endl62 // << "Domain destination " <<domainDestination->getId() << std::endl);63 // }64 65 58 this->type_ = (ELEMENT_MODIFICATION_WITH_DATA); 59 // Make sure domain source have all valid attributes 60 // domainSource->checkAllAttributes(); 66 61 expandDomain->checkValid(domainDestination); 67 62 if (!expandDomain->i_periodic.isEmpty()) isXPeriodic_ = expandDomain->i_periodic; 63 if (!expandDomain->j_periodic.isEmpty()) isYPeriodic_ = expandDomain->j_periodic; 64 68 65 switch (expandDomain->type) 69 66 { … … 92 89 CContextClient* client=context->client; 93 90 91 int type = 1; // For edge 92 CMesh mesh; 94 93 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 95 94 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 96 95 CArray<int,2> neighborsSrc; 97 98 int type = 1; // For edge 99 CMesh mesh; 100 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 101 updateDomainAttributes(domainDestination, domainSource, neighborsSrc); 96 switch (domainSource->type) { 97 case CDomain::type_attr::unstructured: 98 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 99 updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 100 break; 101 default: 102 updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc); 103 break; 104 } 102 105 } 103 106 … … 113 116 CContextClient* client=context->client; 114 117 118 int type = 1; // For edge 119 CMesh mesh; 115 120 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 116 121 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 117 122 CArray<int,2> neighborsSrc; 118 119 int type = 0; // For node 120 CMesh mesh; 121 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 122 updateDomainAttributes(domainDestination, domainSource, neighborsSrc); 123 switch (domainSource->type) { 124 case CDomain::type_attr::unstructured: 125 mesh.getGlobalNghbFaces(type, client->intraComm, domainSource->i_index, bounds_lon_src, bounds_lat_src, neighborsSrc); 126 updateUnstructuredDomainAttributes(domainDestination, domainSource, neighborsSrc); 127 break; 128 default: 129 updateRectilinearDomainAttributes(domainDestination, domainSource, neighborsSrc); 130 break; 131 } 132 } 133 134 /*! 135 * Extend rectilinear or curvilinear domain destination and update its attributes 136 * Suppose that domain destination and domain source have the same values for all attributes (by inheritance) 137 * \param [in/out] domainDestination domain destination 138 * \param [in] domainSource domain source 139 * \param [in] neighborsDomainSrc neighbor of domain source. For now, we don't need it for rectilinear 140 */ 141 void CDomainAlgorithmExpand::updateRectilinearDomainAttributes(CDomain* domainDestination, 142 CDomain* domainSource, 143 CArray<int,2>& neighborsDomainSrc) 144 { 145 int index, globalIndex, idx; 146 int iindexDst, jindexDst, globIndexDst; 147 int iindexSrc, jindexSrc, globIndexSrc; 148 CContext* context = CContext::getCurrent(); 149 CContextClient* client=context->client; 150 151 // First of all, "copy" all attributes of domain source to domain destination 152 StdString domainDstRef = (!domainDestination->domain_ref.isEmpty()) ? domainDestination->domain_ref.getValue() 153 : ""; 154 if (domainDstRef != domainSource->getId()) 155 { 156 domainDestination->domain_ref.setValue(domainSource->getId()); 157 domainDestination->solveRefInheritance(true); 158 } 159 160 if (domainDstRef.empty()) domainDestination->domain_ref.reset(); 161 else domainDestination->domain_ref.setValue(domainDstRef); 162 163 // Here are attributes of source need tranfering 164 int niGloSrc = domainSource->ni_glo; 165 int njGloSrc = domainSource->nj_glo; 166 int niSrc = domainSource->ni, ibegin = domainSource->ibegin; 167 int njSrc = domainSource->nj, jbegin = domainSource->jbegin; 168 int dataDimSrc = domainSource->data_dim; 169 CArray<bool,1>& mask_1d_src = domainSource->mask_1d; 170 CArray<int,1>& i_index_src = domainSource->i_index; 171 CArray<int,1>& j_index_src = domainSource->j_index; 172 CArray<int,1>& data_i_index_src = domainSource->data_i_index; 173 CArray<int,1>& data_j_index_src = domainSource->data_j_index; 174 int data_i_begin_src = domainSource->data_ibegin; 175 int data_j_begin_src = domainSource->data_jbegin; 176 CArray<double,1>& lon_src = domainSource->lonvalue; 177 CArray<double,1>& lat_src = domainSource->latvalue; 178 179 // We need to generate boundary for longitude and latitude 180 if (domainSource->bounds_lon_1d.isEmpty() || domainSource->bounds_lat_1d.isEmpty()) 181 { 182 CArray<double,1> lon = lon_src(Range(0,niSrc-1)); 183 CArray<double,1> lat = lat_src(Range(0,lat_src.numElements()-niSrc,niSrc)); 184 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 185 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 186 domainSource->fillInRectilinearBoundLonLat(lon_src, lat_src, bounds_lon_src, bounds_lat_src); 187 } 188 189 190 CArray<double,2>& bounds_lon_src = domainSource->bounds_lon_1d; 191 CArray<double,2>& bounds_lat_src = domainSource->bounds_lat_1d; 192 193 int nVertex = bounds_lon_src.shape()[0]; 194 int oldNbLocal = i_index_src.numElements(); 195 // Calculate ni, nj by using i_index and j_index 196 int niSrcByIndex = max(i_index_src) - min(i_index_src) + 1; 197 int njSrcByIndex = max(j_index_src) - min(j_index_src) + 1; 198 int dataIindexBoundSrc = (1 == dataDimSrc) ? (niSrcByIndex * njSrcByIndex) : niSrcByIndex; 199 int dataJindexBoundSrc = (1 == dataDimSrc) ? (niSrcByIndex * njSrcByIndex) : njSrcByIndex; 200 201 // Uncompress data_i_index, data_j_index 202 CArray<int,1> data_i_index_src_full(oldNbLocal); 203 CArray<int,1> data_j_index_src_full(oldNbLocal); 204 int nbUnMaskedPointOnLocalDomain = 0; 205 data_i_index_src_full = -1; // Suppose all values are masked 206 data_j_index_src_full = -1; // Suppose all values are masked 207 for (idx = 0; idx < data_i_index_src.numElements(); ++idx) 208 { 209 int dataIidx = data_i_index_src(idx) + data_i_begin_src; 210 int dataJidx = data_j_index_src(idx) + data_j_begin_src; 211 if ((0 <= dataIidx) && (dataIidx < dataIindexBoundSrc) && 212 (0 <= dataJidx) && (dataJidx < dataJindexBoundSrc)) 213 { 214 data_i_index_src_full(nbUnMaskedPointOnLocalDomain) = dataIidx; 215 data_j_index_src_full(nbUnMaskedPointOnLocalDomain) = dataJidx; 216 ++nbUnMaskedPointOnLocalDomain; 217 } 218 } 219 220 // Expand domain destination, not only local but also global 221 int niGloDst = niGloSrc + 2; 222 int njGloDst = njGloSrc + 2; 223 int niDst = niSrc + 2; 224 int njDst = njSrc + 2; 225 domainDestination->ni_glo.setValue(niGloDst); 226 domainDestination->nj_glo.setValue(njGloDst); 227 domainDestination->ni.setValue(niDst); 228 domainDestination->nj.setValue(njDst); 229 domainDestination->global_zoom_ni.setValue(domainSource->global_zoom_ni+2); 230 domainDestination->global_zoom_nj.setValue(domainSource->global_zoom_nj+2); 231 232 CArray<bool,1>& mask_1d_dst = domainDestination->mask_1d; 233 CArray<int,1>& i_index_dst = domainDestination->i_index; 234 CArray<int,1>& j_index_dst = domainDestination->j_index; 235 CArray<int,1>& data_i_index_dst = domainDestination->data_i_index; 236 CArray<int,1>& data_j_index_dst = domainDestination->data_j_index; 237 238 // Make sure that we use only lonvalue_client, latvalue_client 239 if (!domainDestination->lonvalue_1d.isEmpty()) domainDestination->lonvalue_1d.reset(); 240 if (!domainDestination->latvalue_1d.isEmpty()) domainDestination->latvalue_1d.reset(); 241 if (!domainDestination->lonvalue_2d.isEmpty()) domainDestination->lonvalue_2d.reset(); 242 if (!domainDestination->latvalue_2d.isEmpty()) domainDestination->latvalue_2d.reset(); 243 244 // Recalculate i_index, j_index of extended domain 245 // Should be enough for common case, but if we have arbitrary distribution? 246 int newNbLocalDst = niDst * njDst; 247 248 mask_1d_dst.resize(newNbLocalDst); 249 i_index_dst.resize(newNbLocalDst); 250 j_index_dst.resize(newNbLocalDst); 251 CArray<int,1> data_i_index_dst_full(newNbLocalDst); 252 CArray<int,1> data_j_index_dst_full(newNbLocalDst); 253 254 domainDestination->lonvalue.resizeAndPreserve(newNbLocalDst); 255 domainDestination->latvalue.resizeAndPreserve(newNbLocalDst); 256 domainDestination->bounds_lon_1d.resizeAndPreserve(nVertex, newNbLocalDst); 257 domainDestination->bounds_lat_1d.resizeAndPreserve(nVertex, newNbLocalDst); 258 CArray<double,1>& lon_dst = domainDestination->lonvalue; 259 CArray<double,1>& lat_dst = domainDestination->latvalue; 260 CArray<double,2>& bounds_lon_dst = domainDestination->bounds_lon_1d; 261 CArray<double,2>& bounds_lat_dst = domainDestination->bounds_lat_1d; 262 263 // Update i_index, j_index 264 for (int j = 0; j < njDst; ++j) 265 for (int i = 0; i < niDst; ++i) 266 { 267 idx = j * niDst + i; 268 i_index_dst(idx) = i + ibegin; 269 j_index_dst(idx) = j + jbegin; 270 } 271 272 273 // 1. Fill in array relating to global index (i_index, j_index, transmap, etc, ...) 274 // Global index mapping between destination and source 275 this->transformationMapping_.resize(1); 276 this->transformationWeight_.resize(1); 277 TransformationIndexMap& transMap = this->transformationMapping_[0]; 278 TransformationWeightMap& transWeight = this->transformationWeight_[0]; 279 280 transMap.rehash(std::ceil(newNbLocalDst/transMap.max_load_factor())); 281 transWeight.rehash(std::ceil(newNbLocalDst/transWeight.max_load_factor())); 282 283 // Index mapping for local domain 284 // Mapping global index of expanded domain into original one 285 // (Representing global index of expanded domain in form of global index of original one) 286 CArray<size_t,1> globalIndexSrcOnDstDomain(newNbLocalDst); 287 for (idx = 0; idx < newNbLocalDst; ++idx) 288 { 289 iindexDst = i_index_dst(idx); 290 jindexDst = j_index_dst(idx); 291 globIndexDst = jindexDst * niGloDst + iindexDst; 292 globIndexSrc = (((jindexDst-1)+njGloSrc) % njGloSrc) * niGloSrc + (((iindexDst-1)+niGloSrc) % niGloSrc) ; 293 globalIndexSrcOnDstDomain(idx) = globIndexSrc; 294 295 transMap[globIndexDst].push_back(globIndexSrc); 296 transWeight[globIndexDst].push_back(1.0); 297 } 298 299 // 2. Exchange local info among domains (lon,lat,bounds,mask,etc,...) 300 CClientClientDHTDouble::Index2VectorInfoTypeMap localData; 301 localData.rehash(std::ceil(oldNbLocal/localData.max_load_factor())); 302 303 // Information exchanged among domains (attention to their order), number in parentheses presents size of data 304 // lon(1) + lat(1) + bounds_lon(nVertex) + bounds_lat(nVertex) + mask(1) + data_i_index(1) 305 int dataPackageSize = 1 + 1 + // lon + lat 306 nVertex + nVertex + //bounds_lon + bounds_lat 307 1 + // mask_1d_dst; 308 1 + 1; // data_i_index + data_j_index 309 // Initialize database 310 for (int idx = 0; idx < oldNbLocal; ++idx) 311 { 312 index = i_index_src(idx) + j_index_src(idx) * niGloSrc; 313 localData[index].resize(dataPackageSize); 314 std::vector<double>& data = localData[index]; 315 316 //Pack data 317 int dataIdx = 0; 318 data[dataIdx] = lon_src(idx);++dataIdx; 319 data[dataIdx] = lat_src(idx);++dataIdx; 320 for (int i = 0; i < nVertex; ++i) 321 { 322 data[dataIdx] = bounds_lon_src(i,idx); ++dataIdx; 323 } 324 for (int i = 0; i < nVertex; ++i) 325 { 326 data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx; 327 } 328 data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx; 329 data[dataIdx] = data_i_index_src_full(idx);++dataIdx; 330 data[dataIdx] = data_j_index_src_full(idx); 331 } 332 333 CClientClientDHTDouble dhtData(localData,client->intraComm); 334 dhtData.computeIndexInfoMapping(globalIndexSrcOnDstDomain); 335 CClientClientDHTDouble::Index2VectorInfoTypeMap& neighborData = dhtData.getInfoIndexMap(); 336 CClientClientDHTDouble::Index2VectorInfoTypeMap::iterator ite = neighborData.end(), it; 337 338 // Ok get all data for destination 339 // If domain is not periodic, then we mask all extended part. 340 int nbUnMaskedPointOnExtendedPart = 0, remainder = 0, dataIIndex, dataJIndex; 341 size_t nIdx; 342 double maskValue = 1.0; 343 for (index = 0; index < newNbLocalDst; ++index) 344 { 345 nIdx = globalIndexSrcOnDstDomain(index); 346 it = neighborData.find(nIdx); 347 if (ite != it) 348 { 349 std::vector<double>& data = it->second; 350 // Unpack data 351 int dataIdx = 0; 352 lon_dst(index) = data[dataIdx]; ++dataIdx; 353 lat_dst(index) = data[dataIdx]; ++dataIdx; 354 for (int i = 0; i < nVertex; ++i) 355 { 356 bounds_lon_dst(i,index) = data[dataIdx]; ++dataIdx; 357 } 358 for (int i = 0; i < nVertex; ++i) 359 { 360 bounds_lat_dst(i,index) = data[dataIdx]; ++dataIdx; 361 } 362 363 // Check whether we have x periodic. If we don't, we should mask all point at 0 and niGloDst-1 364 maskValue = data[dataIdx]; 365 if (!isXPeriodic_) 366 { 367 remainder = i_index_dst(index) % (niGloDst-1); 368 if (0 == remainder) 369 { 370 maskValue = -1.0; 371 } 372 } 373 374 if (!isYPeriodic_) 375 { 376 remainder = j_index_dst(index) % (njGloDst-1); 377 if (0 == remainder) 378 { 379 maskValue = -1.0; 380 } 381 } 382 383 mask_1d_dst(index) = (1.0 == maskValue) ? true : false; ++dataIdx; 384 385 dataIIndex = (int) data[dataIdx]; 386 if (!isXPeriodic_) 387 { 388 remainder = i_index_dst(index) % (niGloDst-1); 389 if (0 == remainder) 390 { 391 dataIIndex = -1; 392 } 393 } 394 data_i_index_dst_full(index) = dataIIndex; ++dataIdx; 395 396 dataJIndex = (int) data[dataIdx]; 397 if (!isYPeriodic_) 398 { 399 remainder = j_index_dst(index) % (njGloDst-1); 400 if (0 == remainder) 401 { 402 dataJIndex = -1; 403 } 404 } 405 data_j_index_dst_full(index) = dataJIndex; 406 407 if ((0 <= data_i_index_dst_full(index)) && (0 <= data_j_index_dst_full(index))) 408 { 409 ++nbUnMaskedPointOnExtendedPart; 410 } 411 } 412 } 413 414 415 // Finally, update data_i_index, data_j_index 416 int dataDstDim = domainDestination->data_dim; 417 data_i_index_dst.resize(nbUnMaskedPointOnExtendedPart); 418 data_j_index_dst.resize(nbUnMaskedPointOnExtendedPart); 419 int count = 0; 420 for (idx = 0; idx < newNbLocalDst; ++idx) 421 { 422 dataIIndex = data_i_index_dst_full(idx); 423 dataJIndex = data_j_index_dst_full(idx); 424 if ((0 <= dataIIndex) && (0 <= dataJIndex)) 425 { 426 data_i_index_dst(count) = (1 == dataDstDim) ? idx : i_index_dst(idx) - i_index_dst(0); 427 data_j_index_dst(count) = (1 == dataDstDim) ? 0 : j_index_dst(idx) - j_index_dst(0); 428 ++count; 429 } 430 } 431 432 // Update data_ni, data_nj 433 434 domainDestination->data_ni.setValue((1==dataDstDim) ? niDst * njDst : niDst); 435 domainDestination->data_nj.setValue((1==dataDstDim) ? niDst * njDst : njDst); 436 domainDestination->data_ibegin.setValue(0); 437 domainDestination->data_jbegin.setValue(0); 438 439 // Update longitude and latitude 440 if (niSrc == domainSource->lonvalue_1d.numElements() && njSrc == domainSource->latvalue_1d.numElements()) // Ok, we have rectilinear here 441 { 442 domainDestination->lonvalue_1d.resize(niDst); 443 domainDestination->lonvalue_1d = lon_dst(Range(0,niDst-1)); 444 domainDestination->latvalue_1d.resize(njDst); 445 domainDestination->latvalue_1d = lat_dst(Range(0,lat_dst.numElements()-niDst,niDst)); 446 } 447 else // It should be curvilinear 448 { 449 domainDestination->lonvalue_1d.resize(lon_dst.numElements()); 450 domainDestination->lonvalue_1d = lon_dst; 451 domainDestination->latvalue_1d.resize(lat_dst.numElements()); 452 domainDestination->latvalue_1d = (lat_dst); 453 } 454 123 455 } 124 456 … … 130 462 * \param [in] neighborsDomainSrc domain extended part 131 463 */ 132 void CDomainAlgorithmExpand::updateDomainAttributes(CDomain* domainDestination, 133 CDomain* domainSource, 134 CArray<int,2>& neighborsDomainSrc) 135 { 464 void CDomainAlgorithmExpand::updateUnstructuredDomainAttributes(CDomain* domainDestination, 465 CDomain* domainSource, 466 CArray<int,2>& neighborsDomainSrc) 467 { 468 136 469 CContext* context = CContext::getCurrent(); 137 470 CContextClient* client=context->client; … … 255 588 data[dataIdx] = bounds_lat_src(i,idx); ++dataIdx; 256 589 } 257 data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1 ; ++dataIdx;590 data[dataIdx] = mask_1d_src(idx) ? 1.0 : -1.0; ++dataIdx; 258 591 data[dataIdx] = data_i_index_src_full(idx); 259 592 } … … 308 641 { 309 642 dataIdx = data_i_index_dst_full(idx); 310 if ((0 <= dataIdx) && (dataIdx < newNbLocalDst))643 if ((0 <= dataIdx)) 311 644 { 312 645 ++count; … … 322 655 { 323 656 dataIdx = data_i_index_dst_full(idx); 324 if ((0 <= dataIdx) && (dataIdx < newNbLocalDst))657 if ((0 <= dataIdx)) 325 658 { 326 659 data_i_index_dst(count) = dataIdx; … … 331 664 // Update ni 332 665 domainDestination->ni.setValue(newNbLocalDst); 333 334 666 } 335 667 -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_expand.hpp
r941 r1158 30 30 31 31 protected: 32 bool isXPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear) 33 bool isYPeriodic_; // Flag to determine the periodicity of expansion (only for rectilinear) 34 35 protected: 32 36 void expandDomainEdgeConnectivity(CDomain* domainDestination, CDomain* domainSource); 33 37 void expandDomainNodeConnectivity(CDomain* domainDestination, CDomain* domainSource); 34 void updateDomainAttributes(CDomain* domainDestination, 35 CDomain* domainSource, 36 CArray<int,2>& neighborsDomainSrc); 38 void updateRectilinearDomainAttributes(CDomain* domainDestination, 39 CDomain* domainSource, 40 CArray<int,2>& neighborsDomainSrc); 41 42 void updateUnstructuredDomainAttributes(CDomain* domainDestination, 43 CDomain* domainSource, 44 CArray<int,2>& neighborsDomainSrc); 37 45 38 46 protected: -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_generate_rectilinear.cpp
r933 r1158 127 127 void CDomainAlgorithmGenerateRectilinear::fillInAttributesDomainDestination() 128 128 { 129 domainDest_->redistribute(nbDomainDistributedPart_); 129 if (!domainDest_->distributionAttributesHaveValue()) 130 domainDest_->redistribute(nbDomainDistributedPart_); 131 domainDest_->fillInLonLat(); 130 132 } 131 133 -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.cpp
r1021 r1158 100 100 int orderInterp = interpDomain_->order.getValue(); 101 101 bool renormalize ; 102 bool quantity ; 102 103 103 104 if (interpDomain_->renormalize.isEmpty()) renormalize=true; 104 105 else renormalize = interpDomain_->renormalize; 106 107 if (interpDomain_->quantity.isEmpty()) quantity=false; 108 else quantity = interpDomain_->quantity; 105 109 106 110 const double poleValue = 90.0; … … 342 346 mapper.setTargetMesh(boundsLonDestUnmasked.dataFirst(), boundsLatDestUnmasked.dataFirst(), nVertexDest, nDstLocalUnmasked, &dstPole[0], globalDstUnmasked); 343 347 344 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize );348 std::vector<double> timings = mapper.computeWeights(orderInterp,renormalize,quantity); 345 349 346 350 std::map<int,std::vector<std::pair<int,double> > > interpMapValue; … … 677 681 /*! Redefined some functions of CONetCDF4 to make use of them */ 678 682 CDomainAlgorithmInterpolate::WriteNetCdf::WriteNetCdf(const StdString& filename, const MPI_Comm comm) 679 : CNc4DataOutput( filename, false, false, true, comm, false, true) {}683 : CNc4DataOutput(NULL, filename, false, false, true, comm, false, true) {} 680 684 int CDomainAlgorithmInterpolate::WriteNetCdf::addDimensionWrite(const StdString& name, 681 685 const StdSize size) 682 686 { 683 CONetCDF4::addDimension(name, size);687 return CONetCDF4::addDimension(name, size); 684 688 } 685 689 … … 687 691 const std::vector<StdString>& dim) 688 692 { 689 CONetCDF4::addVariable(name, type, dim); 693 return CONetCDF4::addVariable(name, type, dim); 694 } 695 696 void CDomainAlgorithmInterpolate::WriteNetCdf::endDefinition() 697 { 698 CONetCDF4::definition_end(); 690 699 } 691 700 … … 751 760 MPI_Scan(&localNbWeight, &startIndex, 1, MPI_LONG, MPI_SUM, client->intraComm); 752 761 762 if (0 == globalNbWeight) 763 { 764 info << "There is no interpolation weights calculated between " 765 << "domain source: " << domainSrc_->getDomainOutputName() 766 << " and domain destination: " << domainDest_->getDomainOutputName() 767 << std::endl; 768 return; 769 } 770 753 771 std::vector<StdSize> start(1, startIndex - localNbWeight); 754 772 std::vector<StdSize> count(1, localNbWeight); 755 756 WriteNetCdf netCdfWriter(filename, client->intraComm); 757 758 // netCdfWriter = CONetCDF4(filename, false, false, true, client->intraComm, false); 773 774 WriteNetCdf netCdfWriter(filename, client->intraComm); 759 775 760 776 // Define some dimensions … … 770 786 netCdfWriter.addVariableWrite("weight", NC_DOUBLE, dims); 771 787 788 // End of definition 789 netCdfWriter.endDefinition(); 790 772 791 // // Write variables 773 netCdfWriter.writeDataIndex(src_idx, "src_idx", true, 0, &start, &count); 774 netCdfWriter.writeDataIndex(dst_idx, "dst_idx", true, 0, &start, &count); 775 netCdfWriter.writeDataIndex(weights, "weight", true, 0, &start, &count); 792 if (0 != localNbWeight) 793 { 794 netCdfWriter.writeDataIndex(src_idx, "src_idx", false, 0, &start, &count); 795 netCdfWriter.writeDataIndex(dst_idx, "dst_idx", false, 0, &start, &count); 796 netCdfWriter.writeDataIndex(weights, "weight", false, 0, &start, &count); 797 } 776 798 777 799 netCdfWriter.closeFile(); -
XIOS/dev/dev_olga/src/transformation/domain_algorithm_interpolate.hpp
r1021 r1158 59 59 int addVariableWrite(const StdString& name, nc_type type, 60 60 const std::vector<StdString>& dim); 61 void endDefinition(); 61 62 void writeDataIndex(const CArray<int,1>& data, const StdString& name, 62 63 bool collective, StdSize record, -
XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp
r979 r1158 11 11 #include "context_client.hpp" 12 12 #include "client_client_dht_template.hpp" 13 #include "utils.hpp" 13 14 14 15 namespace xios { … … 29 30 CArray<double,1>& dataOut, 30 31 std::vector<bool>& flagInitial, 31 const double& defaultValue)32 { 33 int nbLocalIndex = localIndex.size(); 34 bool hasMissingValue = (0.0 != defaultValue) ? true : false;35 if ( hasMissingValue)32 bool ignoreMissingValue) 33 { 34 int nbLocalIndex = localIndex.size(); 35 double defaultValue = std::numeric_limits<double>::quiet_NaN(); 36 if (ignoreMissingValue) 36 37 { 37 38 for (int idx = 0; idx < nbLocalIndex; ++idx) 38 39 { 39 if ( defaultValue == *(dataInput + idx))40 if (NumTraits<double>::isnan(*(dataInput + idx))) 40 41 { 41 42 flagInitial[localIndex[idx].first] = false; … … 47 48 } 48 49 49 for (int idx = 0; idx < nbLocalIndex; ++idx)50 {51 if (!flagInitial[localIndex[idx].first])52 dataOut(localIndex[idx].first) = defaultValue;53 }50 // for (int idx = 0; idx < nbLocalIndex; ++idx) 51 // { 52 // if (!flagInitial[localIndex[idx].first]) 53 // dataOut(localIndex[idx].first) = defaultValue; 54 // } 54 55 } 55 56 else -
XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.hpp
r979 r1158 63 63 \param [in/out] dataOut Array contains local data 64 64 \param [in/out] flagInitial vector of boolean to mark the local index already initialized. True means there is a need for initalization 65 \param [in] ignoreMissingValue don't count missing value in operation if this flag is true 65 66 */ 66 67 virtual void apply(const std::vector<std::pair<int,double> >& localIndex, 67 68 const double* dataInput, 68 69 CArray<double,1>& dataOut, 69 std::vector<bool>& flagInitial, 70 const double& defaultValue);70 std::vector<bool>& flagInitial, 71 bool ignoreMissingValue); 71 72 72 73 /*! -
XIOS/dev/dev_olga/src/transformation/grid_transformation.cpp
r978 r1158 236 236 } 237 237 238 tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder); 239 tmpGridDestination_->computeGridGlobalDimension(domainDst, axisDst, scalarDst, elementOrder); 238 tmpGridDestination_ = CGrid::createGrid(domainDst, axisDst, scalarDst, elementOrder); 240 239 tempGridDests_.push_back(tmpGridDestination_); 241 240 } … … 322 321 } 323 322 324 gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 325 gridSource_->computeGridGlobalDimension(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 323 gridSource_ = CGrid::createGrid(domainSrc, axisSrc, scalarSrc, tmpGridDestination_->axis_domain_order); 326 324 327 325 tempGridSrcs_.push_back(gridSource_); -
XIOS/dev/dev_olga/src/transformation/grid_transformation_selector.cpp
r980 r1158 202 202 203 203 // If source and destination grid share the same scalar 204 if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && 205 (scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) && !isSameGrid_) return; 204 if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && !isSameGrid_ && 205 ((scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) || 206 (scalarListDestP[scalarDstPos]->isEqual(scalarListSrcP[scalarSrcPos])))) return; 206 207 207 208 if (scalarListDestP[scalarDstPos]->hasTransformation()) … … 242 243 243 244 // If source and destination grid share the same axis 244 if ((-1 != axisDstPos) && (-1 != axisSrcPos) && 245 (axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) && !isSameGrid_) return; 245 if ((-1 != axisDstPos) && (-1 != axisSrcPos) && !isSameGrid_ && 246 ((axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) || 247 (axisListDestP[axisDstPos]->isEqual(axisListSrcP[axisSrcPos]))) ) return; 246 248 247 249 if (axisListDestP[axisDstPos]->hasTransformation()) … … 281 283 282 284 // If source and destination grid share the same domain 283 if ((-1 != domDstPos) && (-1 != domSrcPos) && 284 (domListDestP[domDstPos] == domListSrcP[domSrcPos]) && !isSameGrid_) return; 285 if ((-1 != domDstPos) && (-1 != domSrcPos) && !isSameGrid_ && 286 ((domListDestP[domDstPos] == domListSrcP[domSrcPos]) || 287 (domListDestP[domDstPos]->isEqual(domListSrcP[domSrcPos])))) return; 285 288 286 289 if (domListDestP[domDstPos]->hasTransformation()) -
XIOS/dev/dev_olga/src/transformation/scalar_algorithm_extract_axis.cpp
r980 r1158 55 55 const double* dataInput, 56 56 CArray<double,1>& dataOut, 57 std::vector<bool>& flagInitial, 58 const double& defaultValue)57 std::vector<bool>& flagInitial, 58 bool ignoreMissingValue) 59 59 { 60 reduction_->apply(localIndex, dataInput, dataOut, flagInitial );60 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 61 61 } 62 62 -
XIOS/dev/dev_olga/src/transformation/scalar_algorithm_extract_axis.hpp
r980 r1158 32 32 const double* dataInput, 33 33 CArray<double,1>& dataOut, 34 std::vector<bool>& flagInitial, 35 const double& defaultValue);34 std::vector<bool>& flagInitial, 35 bool ignoreMissingValue); 36 36 37 37 virtual ~CScalarAlgorithmExtractAxis(); -
XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_axis.cpp
r980 r1158 88 88 CArray<double,1>& dataOut, 89 89 std::vector<bool>& flagInitial, 90 const double& defaultValue)90 bool ignoreMissingValue) 91 91 { 92 reduction_->apply(localIndex, dataInput, dataOut, flagInitial );92 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 93 93 } 94 94 -
XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_axis.hpp
r980 r1158 33 33 CArray<double,1>& dataOut, 34 34 std::vector<bool>& flagInitial, 35 const double& defaultValue);35 bool ignoreMissingValue); 36 36 37 37 virtual void updateData(CArray<double,1>& dataOut); -
XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_domain.cpp
r979 r1158 81 81 const double* dataInput, 82 82 CArray<double,1>& dataOut, 83 std::vector<bool>& flagInitial, 84 const double& defaultValue)83 std::vector<bool>& flagInitial, 84 bool ignoreMissingValue) 85 85 { 86 reduction_->apply(localIndex, dataInput, dataOut, flagInitial );86 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue); 87 87 } 88 88 -
XIOS/dev/dev_olga/src/transformation/scalar_algorithm_reduce_domain.hpp
r979 r1158 32 32 const double* dataInput, 33 33 CArray<double,1>& dataOut, 34 std::vector<bool>& flagInitial, 35 const double& defaultValue);34 std::vector<bool>& flagInitial, 35 bool ignoreMissingValue); 36 36 37 37 virtual void updateData(CArray<double,1>& dataOut); -
XIOS/dev/dev_olga/src/type/enum.hpp
r591 r1158 100 100 __INLINE__ const CEnum_ref& operator = (const CEnum_ref& val) const; 101 101 __INLINE__ operator T_enum&() const; 102 bool operator == (const CEnum_ref &other) {return this->get()==other.get() ;}102 103 103 104 104 inline virtual CBaseType* clone(void) const { return _clone(); } … … 134 134 } ; 135 135 136 template <typename T> bool operator== (const CEnum<T>& lhs, const typename T::t_enum& rhs); 137 template <typename T> bool operator== (const typename T::t_enum& lhs, const CEnum<T>& rhs); 138 template <typename T> bool operator== (const CEnum<T>& lhs, const CEnum<T>& rhs); 139 template <typename T> bool operator== (const CEnum_ref<T>& lhs, const CEnum_ref<T>& rhs); 140 template <typename T> bool operator== (const CEnum_ref<T>& lhs, const typename T::t_enum& rhs); 141 template <typename T> bool operator== (const typename T::t_enum& lhs, const CEnum_ref<T>& rhs); 142 template <typename T> bool operator== (const CEnum<T>& lhs, const CEnum_ref<T>& rhs) {return (lhs.get() == rhs.get());} 143 template <typename T> bool operator== (const CEnum_ref<T>& lhs, const CEnum<T>& rhs) {return (rhs == lhs); } 144 136 145 template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) ; 137 146 template <typename T> __INLINE__ CBufferOut& operator<<(CBufferOut& buffer, const typename T::t_enum & type) ; -
XIOS/dev/dev_olga/src/type/enum_impl.hpp
r680 r1158 249 249 << "Enum is not initialized."); 250 250 } 251 252 251 252 template <typename T> 253 bool operator== (const CEnum<T>& lhs, const typename T::t_enum& rhs) 254 { 255 if (lhs.isEmpty()) return false; 256 return (lhs.get() == rhs); 257 } 258 259 template <typename T> 260 bool operator== (const typename T::t_enum& lhs, const CEnum<T>& rhs) 261 { 262 return rhs == lhs; 263 } 264 265 template <typename T> 266 bool operator== (const CEnum<T>& lhs, const CEnum<T>& rhs) 267 { 268 if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 269 if (lhs.isEmpty() && rhs.isEmpty()) return true; 270 return (lhs.get() == rhs.get()); 271 } 272 273 253 274 template <typename T> 254 275 CBufferOut& operator<<(CBufferOut& buffer, const CEnum<T>& type) -
XIOS/dev/dev_olga/src/type/enum_ref_impl.hpp
r680 r1158 263 263 } 264 264 265 265 template <typename T> 266 bool operator== (const CEnum_ref<T>& lhs, const typename T::t_enum& rhs) 267 { 268 if (lhs.isEmpty()) return false; 269 return (lhs.get() == rhs); 270 } 271 272 template <typename T> 273 bool operator== (const typename T::t_enum& lhs, const CEnum_ref<T>& rhs) 274 { 275 return rhs == lhs; 276 } 277 278 template <typename T> 279 bool operator== (const CEnum_ref<T>& lhs, const CEnum_ref<T>& rhs) 280 { 281 if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 282 if (lhs.isEmpty() && rhs.isEmpty()) return true; 283 return (lhs.get() == rhs.get()); 284 } 266 285 267 286 template <typename T> -
XIOS/dev/dev_olga/src/type/message.cpp
r1009 r1158 27 27 size_t retSize=0 ; 28 28 29 for(it=typeList.begin();it!=typeList.end();it++) 30 retSize+=(*it)->size() ; 29 for(it=typeList.begin();it!=typeList.end();it++) retSize+=(*it)->size() ; 31 30 return retSize ; 32 31 } -
XIOS/dev/dev_olga/src/type/type.hpp
r748 r1158 94 94 const CType_ref& operator = (CType<T>& val) const ; 95 95 const CType_ref& operator = (const CType_ref& val) const; 96 operator T&() const; 96 operator T&() const; 97 97 98 98 inline virtual CBaseType* clone(void) const { return _clone(); } … … 127 127 size_t _size(void) const ; 128 128 } ; 129 130 template <typename T> bool operator==(const CType<T>& lhs, const T& rhs); 131 template <typename T> bool operator==(const T& lhs, const CType<T>& rhs); 132 template <typename T> bool operator==(const CType_ref<T>& lhs, const T& rhs); 133 template <typename T> bool operator==(const T& lhs, const CType_ref<T>& rhs); 134 template <typename T> bool operator==(const CType<T>& lhs, const CType<T>& rhs); 135 template <typename T> bool operator==(const CType_ref<T>& lhs, const CType_ref<T>& rhs); 136 137 template <typename T> 138 bool operator==(const CType_ref<T>& lhs, const CType<T>& rhs) 139 { 140 if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 141 if (lhs.isEmpty() && rhs.isEmpty()) return true; 142 return (*lhs.ptrValue == *rhs.ptrValue); 143 } 144 145 template <typename T> 146 bool operator==(const CType<T>& lhs, const CType_ref<T>& rhs) 147 { 148 return (rhs == lhs); 149 } 129 150 130 151 -
XIOS/dev/dev_olga/src/type/type_decl.cpp
r591 r1158 12 12 template class CType<decl_type> ; \ 13 13 template class CType_ref<decl_type> ; \ 14 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType<decl_type>& type) ; \ 15 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType_ref<decl_type>& type) ; \ 16 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, decl_type& type) ; \ 17 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const decl_type& type) ; \ 18 template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, CType<decl_type>& type) ; \ 19 template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, const CType_ref<decl_type>& type) ; \ 20 template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, decl_type& type) ; \ 21 /* template CMessage& operator<< <decl_type> (CMessage& msg, const CType<decl_type>& type) ;*/ \ 22 /* template CMessage& operator<< <decl_type> (CMessage& msg, const CType_ref<decl_type>& type) ;*/ \ 23 template CMessage& operator<< <decl_type> (CMessage& msg, const decl_type& type) ; \ 24 template CMessage& operator<< <decl_type> (CMessage& msg, decl_type& type) ; 14 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType<decl_type>& type) ; \ 15 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const CType_ref<decl_type>& type) ; \ 16 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, decl_type& type) ; \ 17 template CBufferOut& operator<< <decl_type> (CBufferOut& buffer, const decl_type& type) ; \ 18 template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, CType<decl_type>& type) ; \ 19 template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, const CType_ref<decl_type>& type) ; \ 20 template CBufferIn& operator>> <decl_type> (CBufferIn& buffer, decl_type& type) ; \ 21 /* template CMessage& operator<< <decl_type> (CMessage& msg, const CType<decl_type>& type) ;*/ \ 22 /* template CMessage& operator<< <decl_type> (CMessage& msg, const CType_ref<decl_type>& type) ;*/ \ 23 template CMessage& operator<< <decl_type> (CMessage& msg, const decl_type& type) ; \ 24 template CMessage& operator<< <decl_type> (CMessage& msg, decl_type& type) ; \ 25 template bool operator==(const CType<decl_type>& lhs, const decl_type& rhs); \ 26 template bool operator==(const decl_type& lhs, const CType<decl_type>& rhs); \ 27 template bool operator==(const CType_ref<decl_type>& lhs, const decl_type& rhs); \ 28 template bool operator==(const decl_type& lhs, const CType_ref<decl_type>& rhs); \ 29 template bool operator==(const CType_ref<decl_type>& lhs, const CType<decl_type>& rhs); \ 30 template bool operator==(const CType<decl_type>& lhs, const CType_ref<decl_type>& rhs); \ 31 template bool operator==(const CType<decl_type>& lhs, const CType<decl_type>& rhs); \ 32 template bool operator==(const CType_ref<decl_type>& lhs, const CType_ref<decl_type>& rhs); 25 33 26 34 macro(string) -
XIOS/dev/dev_olga/src/type/type_impl.hpp
r748 r1158 211 211 } 212 212 213 template <typename T> 214 bool operator==(const CType<T>& lhs, const T& rhs) 215 { 216 if (lhs.isEmpty()) return false; 217 return (*lhs.ptrValue == rhs); 218 } 219 220 template <typename T> 221 bool operator==(const T& lhs, const CType<T>& rhs) 222 { 223 return (rhs == lhs); 224 } 225 226 template <typename T> 227 bool operator==(const CType<T>& lhs, const CType<T>& rhs) 228 { 229 if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 230 if (lhs.isEmpty() && rhs.isEmpty()) return true; 231 232 return (*lhs.ptrValue == *rhs.ptrValue); 233 } 213 234 214 235 template <typename T> -
XIOS/dev/dev_olga/src/type/type_ref_impl.hpp
r680 r1158 201 201 } 202 202 203 203 template <typename T> 204 bool operator==(const CType_ref<T>& lhs, const T& rhs) 205 { 206 if (lhs.isEmpty()) return false; 207 return (*lhs.ptrValue == rhs); 208 } 209 210 template <typename T> 211 bool operator==(const T& lhs, const CType_ref<T>& rhs) 212 { 213 return (rhs == lhs); 214 } 215 216 template <typename T> 217 bool operator==(const CType_ref<T>& lhs, const CType_ref<T>& rhs) 218 { 219 if ((lhs.isEmpty() && !rhs.isEmpty()) || (!lhs.isEmpty() && rhs.isEmpty())) return false; 220 if (lhs.isEmpty() && rhs.isEmpty()) return true; 221 222 return (*lhs.ptrValue == *rhs.ptrValue); 223 } 204 224 205 225 template <typename T> -
XIOS/dev/dev_olga/src/utils.hpp
r814 r1158 257 257 return 1e-12; 258 258 } 259 static inline bool isnan(const Scalar& v) { 260 return (v != v); 261 } 259 262 }; 260 263 -
XIOS/dev/dev_olga/src/xios_server.f90
r1054 r1158 4 4 INCLUDE "mpif.h" 5 5 INTEGER :: ierr 6 7 CALL xios_init_server 6 8 7 CALL xios_init_server 8 9 END PROGRAM server_main 9 END PROGRAM server_main -
XIOS/dev/dev_olga/src/xios_spl.hpp
r621 r1158 52 52 typedef unsigned long int ulong; 53 53 54 const size_t stringArrayLen=255 ; 55 54 56 /// XIOS headers /// 55 57 #include "configure.hpp" -
XIOS/dev/dev_olga/src/xml_parser.cpp
r509 r1158 70 70 CContext::setCurrent(attributes["id"]) ; 71 71 72 bool hasctxt = CContext::has(attributes["id"]);73 74 if(hasctxt)75 {76 DEBUG("The context will not be processed because it exist an other context with the same id" );77 continue;78 }79 72 80 73 if (isParseAll) 81 74 { 82 75 CContext* context = CContext::create(attributes["id"]); 83 // if (!hasctxt) group_context->addChild(context);84 76 context->parse(node); 85 77 … … 92 84 { 93 85 CContext* context = CContext::create(*it); 94 // if (!hasctxt) group_context->addChild(context);95 86 context->parse(node); 96 87
Note: See TracChangeset
for help on using the changeset viewer.