- Timestamp:
- 02/03/14 14:16:20 (10 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 9 added
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/config/var_attribute.conf
r274 r472 1 1 DECLARE_ATTRIBUTE(StdString, type) 2 DECLARE_ATTRIBUTE(StdString, name) -
XIOS/trunk/src/data_output.cpp
r391 r472 37 37 this->writeFile_(file); 38 38 } 39 39 40 void CDataOutput::writeAttribute(CVariable* var) 41 { 42 this->writeAttribute_(var) ; 43 } 44 40 45 void CDataOutput::syncFile(void) 41 46 { -
XIOS/trunk/src/data_output.hpp
r391 r472 21 21 /// Ecriture /// 22 22 void writeFile (CFile* file); 23 void writeAttribute(CVariable* var); 23 24 void syncFile (void); 24 25 void closeFile (void); … … 42 43 43 44 virtual void writeFile_ (CFile* file) = 0; 45 virtual void writeAttribute_(CVariable* var) = 0 ; 44 46 virtual void closeFile_ (void) = 0; 45 47 virtual void syncFile_ (void) = 0; -
XIOS/trunk/src/generate_fortran_interface.cpp
r369 r472 18 18 CField field; 19 19 CFieldGroup fieldgroup ; 20 CVariable variable; 21 CVariableGroup variablegroup ; 20 22 CDomain domain ; 21 23 CDomainGroup domaingroup ; … … 129 131 130 132 133 file.open((path+"variable_interface_attr.f90").c_str()); 134 variable.generateFortran2003Interface(file) ; 135 file.close(); 136 137 file.open((path+"icvariable_attr.cpp").c_str()); 138 variable.generateCInterface(file) ; 139 file.close(); 140 141 file.open((path+"ivariable_attr.F90").c_str()); 142 variable.generateFortranInterface(file) ; 143 file.close(); 144 145 file.open((path+"variablegroup_interface_attr.f90").c_str()); 146 variablegroup.generateFortran2003Interface(file) ; 147 file.close(); 148 149 file.open((path+"icvariablegroup_attr.cpp").c_str()); 150 variablegroup.generateCInterface(file) ; 151 file.close(); 152 153 file.open((path+"ivariablegroup_attr.F90").c_str()); 154 variablegroup.generateFortranInterface(file) ; 155 file.close(); 156 157 158 131 159 file.open((path+"file_interface_attr.f90").c_str()); 132 160 afile.generateFortran2003Interface(file) ; -
XIOS/trunk/src/group_parser.hpp
r462 r472 80 80 } 81 81 } 82 83 /// ////////////////////// Définitions ////////////////////// /// 84 template <class U, class V, class W> 85 void CGroupTemplate<U, V, W>::parseChild(xml::CXMLNode & node) 86 { 82 87 88 89 // PARSING POUR GESTION DES ENFANTS 90 V* group_ptr = (this->hasId()) 91 ? V::get(this->getId()) 92 : boost::polymorphic_downcast<V*>(this); 93 94 StdString name = node.getElementName(); 95 attributes.clear(); 96 attributes = node.getAttributes(); 97 98 if (name.compare(V::GetName()) == 0) 99 { 100 if (attributes.end() == attributes.find("id")) 101 CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node); 102 return ; 103 else 104 CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node); 105 continue; 106 } 107 108 if (name.compare(U::GetName()) == 0) 109 { 110 if (attributes.end() == attributes.find("id")) 111 CGroupFactory::CreateChild(group_ptr->getShared())->parse(node); 112 return ; 113 else 114 CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node); 115 continue; 116 } 117 118 DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId() 119 << "\', un objet de type \'" << V::GetName() 120 << "\' ne peut contenir qu'un objet de type \'" << V::GetName() 121 << "\' ou de type \'" << U::GetName() 122 << "\' (reçu : " << name << ") !"); 123 124 } 83 125 } // namespace xios 84 126 -
XIOS/trunk/src/group_template.hpp
r445 r472 50 50 virtual void parse(xml::CXMLNode & node); 51 51 virtual void parse(xml::CXMLNode & node, bool withAttr); 52 52 virtual void parseChild(xml::CXMLNode & node); 53 53 54 /// Test /// 54 55 virtual bool hasChild(void) const; -
XIOS/trunk/src/group_template_impl.hpp
r462 r472 551 551 } 552 552 } 553 554 template <class U, class V, class W> 555 void CGroupTemplate<U, V, W>::parseChild(xml::CXMLNode & node) 556 { 557 558 559 // PARSING POUR GESTION DES ENFANTS 560 V* group_ptr = (this->hasId()) 561 ? V::get(this->getId()) 562 : boost::polymorphic_downcast<V*>(this); 563 564 StdString name = node.getElementName(); 565 xml::THashAttributes attributes = node.getAttributes(); 566 567 if (name.compare(V::GetName()) == 0) 568 { 569 if (attributes.end() == attributes.find("id")) 570 CGroupFactory::CreateGroup(group_ptr->getShared())->parse(node); 571 else 572 CGroupFactory::CreateGroup(group_ptr->getShared(), attributes["id"])->parse(node); 573 return ; 574 } 575 else if (name.compare(U::GetName()) == 0) 576 { 577 if (attributes.end() == attributes.find("id")) 578 CGroupFactory::CreateChild(group_ptr->getShared())->parse(node); 579 else 580 CGroupFactory::CreateChild(group_ptr->getShared(), attributes["id"])->parse(node); 581 return ; 582 } 583 584 DEBUG(<< "Dans le contexte \'" << CContext::getCurrent()->getId() 585 << "\', un objet de type \'" << V::GetName() 586 << "\' ne peut contenir qu'un objet de type \'" << V::GetName() 587 << "\' ou de type \'" << U::GetName() 588 << "\' (reçu : " << name << ") !"); 589 590 } 553 591 } // namespace xios 554 592 -
XIOS/trunk/src/interface/c/icxml_tree.cpp
r352 r472 20 20 #include "axis.hpp" 21 21 #include "domain.hpp" 22 #include "variable.hpp" 22 23 23 24 extern "C" … … 43 44 typedef xios::CAxis * XAxisPtr; 44 45 typedef xios::CAxisGroup * XAxisGroupPtr; 45 46 47 typedef xios::CVariable * XVariablePtr; 48 typedef xios::CVariableGroup * XVariableGroupPtr; 49 46 50 // ----------------------- Ajout d'enfant à un parent ----------------------- 47 51 … … 155 159 } 156 160 161 void cxios_xml_tree_add_variabletofile 162 (XFilePtr parent_, XVariablePtr * child_, const char * child_id, int child_id_size) 163 { 164 std::string child_id_str; 165 CTimer::get("XIOS").resume() ; 166 167 if (cstr2string(child_id, child_id_size, child_id_str)) 168 { 169 *child_ = parent_->addVariable(child_id_str); 170 parent_->sendAddVariable(child_id_str) ; 171 } 172 else 173 { 174 *child_ = parent_->addVariable(); 175 parent_->sendAddVariable() ; 176 } 177 CTimer::get("XIOS").suspend() ; 178 } 179 180 void cxios_xml_tree_add_variabletofield 181 (XFieldPtr parent_, XVariablePtr * child_, const char * child_id, int child_id_size) 182 { 183 std::string child_id_str; 184 CTimer::get("XIOS").resume() ; 185 186 if (cstr2string(child_id, child_id_size, child_id_str)) 187 { 188 *child_ = parent_->addVariable(child_id_str); 189 parent_->sendAddVariable(child_id_str) ; 190 } 191 else 192 { 193 *child_ = parent_->addVariable(); 194 parent_->sendAddVariable() ; 195 } 196 CTimer::get("XIOS").suspend() ; 197 } 157 198 // ----------------------- Ajout de groupe à un parent ---------------------- 158 199 … … 264 305 CTimer::get("XIOS").suspend() ; 265 306 } 307 308 void cxios_xml_tree_add_variablegrouptofile 309 (XFilePtr parent_, XVariableGroupPtr * child_, const char * child_id, int child_id_size) 310 { 311 std::string child_id_str; 312 CTimer::get("XIOS").resume() ; 313 if (cstr2string(child_id, child_id_size, child_id_str)) 314 { 315 *child_ = parent_->addVariableGroup(child_id_str); 316 parent_->sendAddVariableGroup(child_id_str) ; 317 } 318 else 319 { 320 *child_ = parent_->addVariableGroup(); 321 parent_->sendAddVariableGroup() ; 322 } 323 CTimer::get("XIOS").suspend() ; 324 } 325 326 void cxios_xml_tree_add_variablegrouptofield 327 (XFieldPtr parent_, XVariableGroupPtr * child_, const char * child_id, int child_id_size) 328 { 329 std::string child_id_str; 330 CTimer::get("XIOS").resume() ; 331 if (cstr2string(child_id, child_id_size, child_id_str)) 332 { 333 *child_ = parent_->addVariableGroup(child_id_str); 334 parent_->sendAddVariableGroup(child_id_str) ; 335 } 336 else 337 { 338 *child_ = parent_->addVariableGroup(); 339 parent_->sendAddVariableGroup() ; 340 } 341 CTimer::get("XIOS").suspend() ; 342 } 266 343 267 344 -
XIOS/trunk/src/interface/c_attr/icfield_attr.cpp
r464 r472 88 88 89 89 90 void cxios_set_field_detect_missing_value(field_Ptr field_hdl, bool detect_missing_value) 91 { 92 CTimer::get("XIOS").resume(); 93 field_hdl->detect_missing_value.setValue(detect_missing_value); 94 field_hdl->sendAttributToServer(field_hdl->detect_missing_value); 95 CTimer::get("XIOS").suspend(); 96 } 97 98 void cxios_get_field_detect_missing_value(field_Ptr field_hdl, bool* detect_missing_value) 99 { 100 *detect_missing_value = field_hdl->detect_missing_value.getInheritedValue(); 101 } 102 103 bool cxios_is_defined_field_detect_missing_value(field_Ptr field_hdl ) 104 { 105 CTimer::get("XIOS").resume(); 106 return field_hdl->detect_missing_value.hasInheritedValue(); 107 CTimer::get("XIOS").suspend(); 108 } 109 110 111 90 112 void cxios_set_field_domain_ref(field_Ptr field_hdl, const char * domain_ref, int domain_ref_size) 91 113 { -
XIOS/trunk/src/interface/c_attr/icfieldgroup_attr.cpp
r464 r472 88 88 89 89 90 void cxios_set_fieldgroup_detect_missing_value(fieldgroup_Ptr fieldgroup_hdl, bool detect_missing_value) 91 { 92 CTimer::get("XIOS").resume(); 93 fieldgroup_hdl->detect_missing_value.setValue(detect_missing_value); 94 fieldgroup_hdl->sendAttributToServer(fieldgroup_hdl->detect_missing_value); 95 CTimer::get("XIOS").suspend(); 96 } 97 98 void cxios_get_fieldgroup_detect_missing_value(fieldgroup_Ptr fieldgroup_hdl, bool* detect_missing_value) 99 { 100 *detect_missing_value = fieldgroup_hdl->detect_missing_value.getInheritedValue(); 101 } 102 103 bool cxios_is_defined_fieldgroup_detect_missing_value(fieldgroup_Ptr fieldgroup_hdl ) 104 { 105 CTimer::get("XIOS").resume(); 106 return fieldgroup_hdl->detect_missing_value.hasInheritedValue(); 107 CTimer::get("XIOS").suspend(); 108 } 109 110 111 90 112 void cxios_set_fieldgroup_domain_ref(fieldgroup_Ptr fieldgroup_hdl, const char * domain_ref, int domain_ref_size) 91 113 { -
XIOS/trunk/src/interface/fortran/ixios.F90
r461 r472 43 43 xios(is_defined_fieldgroup_attr), xios(is_defined_fieldgroup_attr_hdl) 44 44 45 USE ivariable, ONLY : txios(variable), txios(variablegroup), xios(get_variable_handle), & 46 xios(get_variablegroup_handle), xios(is_valid_variable), & 47 xios(is_valid_variablegroup) 48 49 USE ivariable_attr, ONLY : xios(set_variable_attr),xios(set_variable_attr_hdl), & 50 xios(get_variable_attr),xios(get_variable_attr_hdl), & 51 xios(is_defined_variable_attr),xios(is_defined_variable_attr_hdl) 52 53 USE ivariablegroup_attr, ONLY : xios(set_variablegroup_attr), xios(set_variablegroup_attr_hdl), & 54 xios(get_variablegroup_attr), xios(get_variablegroup_attr_hdl), & 55 xios(is_defined_variablegroup_attr), xios(is_defined_variablegroup_attr_hdl) 56 45 57 USE ifile, ONLY : txios(file), txios(filegroup), xios(get_file_handle), & 46 58 xios(get_filegroup_handle), xios(is_valid_file), xios(is_valid_filegroup) … … 77 89 78 90 USE ixml_tree, ONLY : xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain), & 79 xios(add_fieldtofile), xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), & 80 xios(add_fieldgroup), xios(add_domaingroup), xios(add_fieldgrouptofile) 81 91 xios(add_fieldtofile), xios(add_variabletofile), xios(add_variabletofield), & 92 xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup), & 93 xios(add_domaingroup), xios(add_fieldgrouptofile), xios(add_variablegrouptofile), & 94 xios(add_variablegrouptofield) 82 95 83 96 PRIVATE … … 86 99 INTERFACE xios(set_attr) 87 100 MODULE PROCEDURE xios(set_domaingroup_attr_hdl), xios(set_domain_attr_hdl), xios(set_fieldgroup_attr_hdl), & 88 xios(set_field_attr_hdl), xios(set_file_attr_hdl), xios(set_filegroup_attr_hdl), & 101 xios(set_field_attr_hdl),xios(set_variable_attr_hdl), xios(set_variablegroup_attr_hdl), & 102 xios(set_file_attr_hdl), xios(set_filegroup_attr_hdl), & 89 103 xios(set_grid_attr_hdl), xios(set_gridgroup_attr_hdl), xios(set_axis_attr_hdl) , & 90 104 xios(set_axisgroup_attr_hdl), xios(set_context_attr_hdl) … … 93 107 INTERFACE xios(get_attr) 94 108 MODULE PROCEDURE xios(get_domaingroup_attr_hdl), xios(get_domain_attr_hdl), xios(get_fieldgroup_attr_hdl), & 95 xios(get_field_attr_hdl), xios(get_file_attr_hdl), xios(get_filegroup_attr_hdl), & 109 xios(get_field_attr_hdl), xios(get_variable_attr_hdl), xios(get_variablegroup_attr_hdl), & 110 xios(get_file_attr_hdl), xios(get_filegroup_attr_hdl), & 96 111 xios(get_grid_attr_hdl), xios(get_gridgroup_attr_hdl), xios(get_axis_attr_hdl) , & 97 112 xios(get_axisgroup_attr_hdl), xios(get_context_attr_hdl) … … 100 115 INTERFACE xios(is_defined_attr) 101 116 MODULE PROCEDURE xios(is_defined_domaingroup_attr_hdl), xios(is_defined_domain_attr_hdl), xios(is_defined_fieldgroup_attr_hdl), & 102 xios(is_defined_field_attr_hdl), xios(is_defined_file_attr_hdl), xios(is_defined_filegroup_attr_hdl), & 117 xios(is_defined_field_attr_hdl), xios(is_defined_variable_attr_hdl), xios(is_defined_variablegroup_attr_hdl), & 118 xios(is_defined_file_attr_hdl), xios(is_defined_filegroup_attr_hdl), & 103 119 xios(is_defined_grid_attr_hdl), xios(is_defined_gridgroup_attr_hdl), xios(is_defined_axis_attr_hdl) , & 104 120 xios(is_defined_axisgroup_attr_hdl), xios(is_defined_context_attr_hdl) … … 109 125 xios(get_file_handle), xios(get_filegroup_handle), xios(get_grid_handle), & 110 126 xios(get_gridgroup_handle), xios(get_axis_handle), xios(get_axisgroup_handle), & 111 xios(get_field_handle), xios(get_fieldgroup_handle) 127 xios(get_field_handle), xios(get_fieldgroup_handle),xios(get_variable_handle), & 128 xios(get_variablegroup_handle) 112 129 END INTERFACE xios(get_handle) 113 130 114 131 INTERFACE xios(add_child) 115 MODULE PROCEDURE xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain), & 116 xios(add_fieldtofile), xios(add_axisgroup), xios(add_filegroup), xios(add_gridgroup), & 117 xios(add_fieldgroup), xios(add_domaingroup), xios(add_fieldgrouptofile) 132 MODULE PROCEDURE xios(add_axis), xios(add_file), xios(add_grid), xios(add_field), xios(add_domain), & 133 xios(add_fieldtofile), xios(add_variabletofile), xios(add_variabletofield), xios(add_axisgroup), & 134 xios(add_filegroup), xios(add_gridgroup), xios(add_fieldgroup), xios(add_domaingroup), & 135 xios(add_fieldgrouptofile), xios(add_variablegrouptofile),xios(add_variablegrouptofield) 118 136 END INTERFACE xios(add_child) 119 137 -
XIOS/trunk/src/interface/fortran/ixml_tree.F90
r325 r472 8 8 USE IGRID 9 9 USE IDOMAIN 10 USE IVARIABLE 10 11 11 12 INTERFACE ! Ne pas appeler directement/Interface FORTRAN 2003 <-> C99 … … 59 60 END SUBROUTINE cxios_xml_tree_add_fieldtofile 60 61 62 SUBROUTINE cxios_xml_tree_add_variabletofile(parent_, child_, child_id, child_id_size) BIND(C) 63 USE ISO_C_BINDING 64 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 65 INTEGER (kind = C_INTPTR_T) :: child_ 66 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 67 INTEGER (kind = C_INT) , VALUE :: child_id_size 68 END SUBROUTINE cxios_xml_tree_add_variabletofile 69 70 71 SUBROUTINE cxios_xml_tree_add_variabletofield(parent_, child_, child_id, child_id_size) BIND(C) 72 USE ISO_C_BINDING 73 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 74 INTEGER (kind = C_INTPTR_T) :: child_ 75 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 76 INTEGER (kind = C_INT) , VALUE :: child_id_size 77 END SUBROUTINE cxios_xml_tree_add_variabletofield 78 79 61 80 SUBROUTINE cxios_xml_tree_add_fieldgroup(parent_, child_, child_id, child_id_size) BIND(C) 62 81 USE ISO_C_BINDING … … 106 125 INTEGER (kind = C_INT) , VALUE :: child_id_size 107 126 END SUBROUTINE cxios_xml_tree_add_fieldgrouptofile 127 128 SUBROUTINE cxios_xml_tree_add_variablegrouptofile(parent_, child_, child_id, child_id_size) BIND(C) 129 USE ISO_C_BINDING 130 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 131 INTEGER (kind = C_INTPTR_T) :: child_ 132 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 133 INTEGER (kind = C_INT) , VALUE :: child_id_size 134 END SUBROUTINE cxios_xml_tree_add_variablegrouptofile 135 136 SUBROUTINE cxios_xml_tree_add_variablegrouptofield(parent_, child_, child_id, child_id_size) BIND(C) 137 USE ISO_C_BINDING 138 INTEGER (kind = C_INTPTR_T), VALUE :: parent_ 139 INTEGER (kind = C_INTPTR_T) :: child_ 140 CHARACTER(kind = C_CHAR) , DIMENSION(*) :: child_id 141 INTEGER (kind = C_INT) , VALUE :: child_id_size 142 END SUBROUTINE cxios_xml_tree_add_variablegrouptofield 108 143 109 144 SUBROUTINE cxios_xml_tree_show(filename, filename_size) BIND(C) … … 210 245 END SUBROUTINE xios(add_fieldtofile) 211 246 247 SUBROUTINE xios(add_variabletofile)(parent_hdl, child_hdl, child_id) 248 TYPE(txios(file)) , INTENT(IN) :: parent_hdl 249 TYPE(txios(variable)) , INTENT(OUT):: child_hdl 250 CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id 251 252 IF (PRESENT(child_id)) THEN 253 CALL cxios_xml_tree_add_variabletofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 254 ELSE 255 CALL cxios_xml_tree_add_variabletofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 256 END IF 257 258 END SUBROUTINE xios(add_variabletofile) 259 260 SUBROUTINE xios(add_variabletofield)(parent_hdl, child_hdl, child_id) 261 TYPE(txios(field)) , INTENT(IN) :: parent_hdl 262 TYPE(txios(variable)) , INTENT(OUT):: child_hdl 263 CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id 264 265 IF (PRESENT(child_id)) THEN 266 CALL cxios_xml_tree_add_variabletofield(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 267 ELSE 268 CALL cxios_xml_tree_add_variabletofield(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 269 END IF 270 271 END SUBROUTINE xios(add_variabletofield) 272 212 273 213 274 SUBROUTINE xios(add_axisgroup)(parent_hdl, child_hdl, child_id) … … 288 349 289 350 END SUBROUTINE xios(add_fieldgrouptofile) 290 351 352 SUBROUTINE xios(add_variablegrouptofile)(parent_hdl, child_hdl, child_id) 353 TYPE(txios(file)) , INTENT(IN) :: parent_hdl 354 TYPE(txios(variablegroup)) , INTENT(OUT):: child_hdl 355 CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id 356 357 IF (PRESENT(child_id)) THEN 358 CALL cxios_xml_tree_add_variablegrouptofile(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 359 ELSE 360 CALL cxios_xml_tree_add_variablegrouptofile(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 361 END IF 362 363 END SUBROUTINE xios(add_variablegrouptofile) 364 365 SUBROUTINE xios(add_variablegrouptofield)(parent_hdl, child_hdl, child_id) 366 TYPE(txios(field)) , INTENT(IN) :: parent_hdl 367 TYPE(txios(variablegroup)) , INTENT(OUT):: child_hdl 368 CHARACTER(len = *), OPTIONAL , INTENT(IN) :: child_id 369 370 IF (PRESENT(child_id)) THEN 371 CALL cxios_xml_tree_add_variablegrouptofield(parent_hdl%daddr, child_hdl%daddr, child_id, len(child_id)) 372 ELSE 373 CALL cxios_xml_tree_add_variablegrouptofield(parent_hdl%daddr, child_hdl%daddr, "NONE", -1) 374 END IF 375 376 END SUBROUTINE xios(add_variablegrouptofield) 377 291 378 END MODULE IXML_TREE -
XIOS/trunk/src/interface/fortran_attr/field_interface_attr.f90
r464 r472 68 68 69 69 70 SUBROUTINE cxios_set_field_detect_missing_value(field_hdl, detect_missing_value) BIND(C) 71 USE ISO_C_BINDING 72 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 73 LOGICAL (KIND=C_BOOL) , VALUE :: detect_missing_value 74 END SUBROUTINE cxios_set_field_detect_missing_value 75 76 SUBROUTINE cxios_get_field_detect_missing_value(field_hdl, detect_missing_value) BIND(C) 77 USE ISO_C_BINDING 78 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 79 LOGICAL (KIND=C_BOOL) :: detect_missing_value 80 END SUBROUTINE cxios_get_field_detect_missing_value 81 82 FUNCTION cxios_is_defined_field_detect_missing_value(field_hdl ) BIND(C) 83 USE ISO_C_BINDING 84 LOGICAL(kind=C_BOOL) :: cxios_is_defined_field_detect_missing_value 85 INTEGER (kind = C_INTPTR_T), VALUE :: field_hdl 86 END FUNCTION cxios_is_defined_field_detect_missing_value 87 88 70 89 SUBROUTINE cxios_set_field_domain_ref(field_hdl, domain_ref, domain_ref_size) BIND(C) 71 90 USE ISO_C_BINDING -
XIOS/trunk/src/interface/fortran_attr/fieldgroup_interface_attr.f90
r464 r472 68 68 69 69 70 SUBROUTINE cxios_set_fieldgroup_detect_missing_value(fieldgroup_hdl, detect_missing_value) BIND(C) 71 USE ISO_C_BINDING 72 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 73 LOGICAL (KIND=C_BOOL) , VALUE :: detect_missing_value 74 END SUBROUTINE cxios_set_fieldgroup_detect_missing_value 75 76 SUBROUTINE cxios_get_fieldgroup_detect_missing_value(fieldgroup_hdl, detect_missing_value) BIND(C) 77 USE ISO_C_BINDING 78 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 79 LOGICAL (KIND=C_BOOL) :: detect_missing_value 80 END SUBROUTINE cxios_get_fieldgroup_detect_missing_value 81 82 FUNCTION cxios_is_defined_fieldgroup_detect_missing_value(fieldgroup_hdl ) BIND(C) 83 USE ISO_C_BINDING 84 LOGICAL(kind=C_BOOL) :: cxios_is_defined_fieldgroup_detect_missing_value 85 INTEGER (kind = C_INTPTR_T), VALUE :: fieldgroup_hdl 86 END FUNCTION cxios_is_defined_fieldgroup_detect_missing_value 87 88 70 89 SUBROUTINE cxios_set_fieldgroup_domain_ref(fieldgroup_hdl, domain_ref, domain_ref_size) BIND(C) 71 90 USE ISO_C_BINDING -
XIOS/trunk/src/interface/fortran_attr/ifield_attr.F90
r464 r472 12 12 13 13 SUBROUTINE xios(set_field_attr) & 14 ( field_id, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&15 , freq_o p, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&16 , valid_max, valid_min )14 ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref & 15 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name & 16 , unit, valid_max, valid_min ) 17 17 18 18 IMPLICIT NONE … … 22 22 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 23 23 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 24 LOGICAL , OPTIONAL, INTENT(IN) :: detect_missing_value 25 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 24 26 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref 25 27 LOGICAL , OPTIONAL, INTENT(IN) :: enabled … … 42 44 CALL xios(get_field_handle)(field_id,field_hdl) 43 45 CALL xios(set_field_attr_hdl_) & 44 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&45 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&46 , valid_max, valid_min )46 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 47 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 48 , standard_name, unit, valid_max, valid_min ) 47 49 48 50 END SUBROUTINE xios(set_field_attr) 49 51 50 52 SUBROUTINE xios(set_field_attr_hdl) & 51 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&52 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&53 , valid_max, valid_min )53 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 54 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 55 , standard_name, unit, valid_max, valid_min ) 54 56 55 57 IMPLICIT NONE … … 58 60 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 59 61 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 62 LOGICAL , OPTIONAL, INTENT(IN) :: detect_missing_value 63 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 60 64 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref 61 65 LOGICAL , OPTIONAL, INTENT(IN) :: enabled … … 77 81 78 82 CALL xios(set_field_attr_hdl_) & 79 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&80 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&81 , valid_max, valid_min )83 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 84 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 85 , standard_name, unit, valid_max, valid_min ) 82 86 83 87 END SUBROUTINE xios(set_field_attr_hdl) 84 88 85 89 SUBROUTINE xios(set_field_attr_hdl_) & 86 ( field_hdl, add_offset_, axis_ref_, default_value_, d omain_ref_, enabled_, field_ref_, freq_offset_ &87 , f req_op_, grid_ref_, level_, long_name_, name_, operation_, prec_, scale_factor_, standard_name_ &88 , unit_, valid_max_, valid_min_ )90 ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_ & 91 , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_ & 92 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 89 93 90 94 IMPLICIT NONE … … 93 97 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_ 94 98 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ 99 LOGICAL , OPTIONAL, INTENT(IN) :: detect_missing_value_ 100 LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp 95 101 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref_ 96 102 LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ … … 123 129 ENDIF 124 130 131 IF (PRESENT(detect_missing_value_)) THEN 132 detect_missing_value__tmp=detect_missing_value_ 133 CALL cxios_set_field_detect_missing_value(field_hdl%daddr, detect_missing_value__tmp) 134 ENDIF 135 125 136 IF (PRESENT(domain_ref_)) THEN 126 137 CALL cxios_set_field_domain_ref(field_hdl%daddr, domain_ref_, len(domain_ref_)) … … 193 204 194 205 SUBROUTINE xios(get_field_attr) & 195 ( field_id, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&196 , freq_o p, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&197 , valid_max, valid_min )206 ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref & 207 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name & 208 , unit, valid_max, valid_min ) 198 209 199 210 IMPLICIT NONE … … 203 214 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 204 215 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 216 LOGICAL , OPTIONAL, INTENT(OUT) :: detect_missing_value 217 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 205 218 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref 206 219 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled … … 223 236 CALL xios(get_field_handle)(field_id,field_hdl) 224 237 CALL xios(get_field_attr_hdl_) & 225 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&226 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&227 , valid_max, valid_min )238 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 239 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 240 , standard_name, unit, valid_max, valid_min ) 228 241 229 242 END SUBROUTINE xios(get_field_attr) 230 243 231 244 SUBROUTINE xios(get_field_attr_hdl) & 232 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&233 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&234 , valid_max, valid_min )245 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 246 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 247 , standard_name, unit, valid_max, valid_min ) 235 248 236 249 IMPLICIT NONE … … 239 252 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 240 253 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 254 LOGICAL , OPTIONAL, INTENT(OUT) :: detect_missing_value 255 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 241 256 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref 242 257 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled … … 258 273 259 274 CALL xios(get_field_attr_hdl_) & 260 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&261 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&262 , valid_max, valid_min )275 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 276 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 277 , standard_name, unit, valid_max, valid_min ) 263 278 264 279 END SUBROUTINE xios(get_field_attr_hdl) 265 280 266 281 SUBROUTINE xios(get_field_attr_hdl_) & 267 ( field_hdl, add_offset_, axis_ref_, default_value_, d omain_ref_, enabled_, field_ref_, freq_offset_ &268 , f req_op_, grid_ref_, level_, long_name_, name_, operation_, prec_, scale_factor_, standard_name_ &269 , unit_, valid_max_, valid_min_ )282 ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_ & 283 , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_ & 284 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 270 285 271 286 IMPLICIT NONE … … 274 289 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_ 275 290 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ 291 LOGICAL , OPTIONAL, INTENT(OUT) :: detect_missing_value_ 292 LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp 276 293 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref_ 277 294 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled_ … … 304 321 ENDIF 305 322 323 IF (PRESENT(detect_missing_value_)) THEN 324 CALL cxios_get_field_detect_missing_value(field_hdl%daddr, detect_missing_value__tmp) 325 detect_missing_value_=detect_missing_value__tmp 326 ENDIF 327 306 328 IF (PRESENT(domain_ref_)) THEN 307 329 CALL cxios_get_field_domain_ref(field_hdl%daddr, domain_ref_, len(domain_ref_)) … … 374 396 375 397 SUBROUTINE xios(is_defined_field_attr) & 376 ( field_id, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&377 , freq_o p, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&378 , valid_max, valid_min )398 ( field_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled, field_ref & 399 , freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name & 400 , unit, valid_max, valid_min ) 379 401 380 402 IMPLICIT NONE … … 387 409 LOGICAL, OPTIONAL, INTENT(OUT) :: default_value 388 410 LOGICAL(KIND=C_BOOL) :: default_value_tmp 411 LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value 412 LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp 389 413 LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref 390 414 LOGICAL(KIND=C_BOOL) :: domain_ref_tmp … … 422 446 CALL xios(get_field_handle)(field_id,field_hdl) 423 447 CALL xios(is_defined_field_attr_hdl_) & 424 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&425 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&426 , valid_max, valid_min )448 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 449 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 450 , standard_name, unit, valid_max, valid_min ) 427 451 428 452 END SUBROUTINE xios(is_defined_field_attr) 429 453 430 454 SUBROUTINE xios(is_defined_field_attr_hdl) & 431 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&432 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&433 , valid_max, valid_min )455 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 456 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 457 , standard_name, unit, valid_max, valid_min ) 434 458 435 459 IMPLICIT NONE … … 441 465 LOGICAL, OPTIONAL, INTENT(OUT) :: default_value 442 466 LOGICAL(KIND=C_BOOL) :: default_value_tmp 467 LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value 468 LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp 443 469 LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref 444 470 LOGICAL(KIND=C_BOOL) :: domain_ref_tmp … … 475 501 476 502 CALL xios(is_defined_field_attr_hdl_) & 477 ( field_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&478 , f req_op, grid_ref, level, long_name, name, operation, prec, scale_factor, standard_name, unit&479 , valid_max, valid_min )503 ( field_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 504 , field_ref, freq_offset, freq_op, grid_ref, level, long_name, name, operation, prec, scale_factor & 505 , standard_name, unit, valid_max, valid_min ) 480 506 481 507 END SUBROUTINE xios(is_defined_field_attr_hdl) 482 508 483 509 SUBROUTINE xios(is_defined_field_attr_hdl_) & 484 ( field_hdl, add_offset_, axis_ref_, default_value_, d omain_ref_, enabled_, field_ref_, freq_offset_ &485 , f req_op_, grid_ref_, level_, long_name_, name_, operation_, prec_, scale_factor_, standard_name_ &486 , unit_, valid_max_, valid_min_ )510 ( field_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_, enabled_ & 511 , field_ref_, freq_offset_, freq_op_, grid_ref_, level_, long_name_, name_, operation_, prec_ & 512 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 487 513 488 514 IMPLICIT NONE … … 494 520 LOGICAL, OPTIONAL, INTENT(OUT) :: default_value_ 495 521 LOGICAL(KIND=C_BOOL) :: default_value__tmp 522 LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value_ 523 LOGICAL(KIND=C_BOOL) :: detect_missing_value__tmp 496 524 LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref_ 497 525 LOGICAL(KIND=C_BOOL) :: domain_ref__tmp … … 542 570 ENDIF 543 571 572 IF (PRESENT(detect_missing_value_)) THEN 573 detect_missing_value__tmp=cxios_is_defined_field_detect_missing_value(field_hdl%daddr) 574 detect_missing_value_=detect_missing_value__tmp 575 ENDIF 576 544 577 IF (PRESENT(domain_ref_)) THEN 545 578 domain_ref__tmp=cxios_is_defined_field_domain_ref(field_hdl%daddr) -
XIOS/trunk/src/interface/fortran_attr/ifieldgroup_attr.F90
r464 r472 12 12 13 13 SUBROUTINE xios(set_fieldgroup_attr) & 14 ( fieldgroup_id, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&15 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&16 , unit, valid_max, valid_min )14 ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 15 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 16 , scale_factor, standard_name, unit, valid_max, valid_min ) 17 17 18 18 IMPLICIT NONE … … 22 22 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 23 23 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 24 LOGICAL , OPTIONAL, INTENT(IN) :: detect_missing_value 25 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 24 26 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref 25 27 LOGICAL , OPTIONAL, INTENT(IN) :: enabled … … 43 45 CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl) 44 46 CALL xios(set_fieldgroup_attr_hdl_) & 45 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&46 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&47 , unit, valid_max, valid_min )47 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 48 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 49 , scale_factor, standard_name, unit, valid_max, valid_min ) 48 50 49 51 END SUBROUTINE xios(set_fieldgroup_attr) 50 52 51 53 SUBROUTINE xios(set_fieldgroup_attr_hdl) & 52 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&53 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&54 , unit, valid_max, valid_min )54 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 55 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 56 , scale_factor, standard_name, unit, valid_max, valid_min ) 55 57 56 58 IMPLICIT NONE … … 59 61 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref 60 62 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value 63 LOGICAL , OPTIONAL, INTENT(IN) :: detect_missing_value 64 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 61 65 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref 62 66 LOGICAL , OPTIONAL, INTENT(IN) :: enabled … … 79 83 80 84 CALL xios(set_fieldgroup_attr_hdl_) & 81 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&82 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&83 , unit, valid_max, valid_min )85 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 86 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 87 , scale_factor, standard_name, unit, valid_max, valid_min ) 84 88 85 89 END SUBROUTINE xios(set_fieldgroup_attr_hdl) 86 90 87 91 SUBROUTINE xios(set_fieldgroup_attr_hdl_) & 88 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, d omain_ref_, enabled_, field_ref_ &89 , freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_, operation_, prec_ &90 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )92 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_ & 93 , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_ & 94 , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 91 95 92 96 IMPLICIT NONE … … 95 99 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: axis_ref_ 96 100 REAL (KIND=8) , OPTIONAL, INTENT(IN) :: default_value_ 101 LOGICAL , OPTIONAL, INTENT(IN) :: detect_missing_value_ 102 LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp 97 103 CHARACTER(len = *) , OPTIONAL, INTENT(IN) :: domain_ref_ 98 104 LOGICAL , OPTIONAL, INTENT(IN) :: enabled_ … … 126 132 ENDIF 127 133 134 IF (PRESENT(detect_missing_value_)) THEN 135 detect_missing_value__tmp=detect_missing_value_ 136 CALL cxios_set_fieldgroup_detect_missing_value(fieldgroup_hdl%daddr, detect_missing_value__tmp) 137 ENDIF 138 128 139 IF (PRESENT(domain_ref_)) THEN 129 140 CALL cxios_set_fieldgroup_domain_ref(fieldgroup_hdl%daddr, domain_ref_, len(domain_ref_)) … … 200 211 201 212 SUBROUTINE xios(get_fieldgroup_attr) & 202 ( fieldgroup_id, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&203 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&204 , unit, valid_max, valid_min )213 ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 214 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 215 , scale_factor, standard_name, unit, valid_max, valid_min ) 205 216 206 217 IMPLICIT NONE … … 210 221 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 211 222 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 223 LOGICAL , OPTIONAL, INTENT(OUT) :: detect_missing_value 224 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 212 225 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref 213 226 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled … … 231 244 CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl) 232 245 CALL xios(get_fieldgroup_attr_hdl_) & 233 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&234 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&235 , unit, valid_max, valid_min )246 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 247 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 248 , scale_factor, standard_name, unit, valid_max, valid_min ) 236 249 237 250 END SUBROUTINE xios(get_fieldgroup_attr) 238 251 239 252 SUBROUTINE xios(get_fieldgroup_attr_hdl) & 240 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&241 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&242 , unit, valid_max, valid_min )253 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 254 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 255 , scale_factor, standard_name, unit, valid_max, valid_min ) 243 256 244 257 IMPLICIT NONE … … 247 260 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref 248 261 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value 262 LOGICAL , OPTIONAL, INTENT(OUT) :: detect_missing_value 263 LOGICAL (KIND=C_BOOL) :: detect_missing_value_tmp 249 264 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref 250 265 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled … … 267 282 268 283 CALL xios(get_fieldgroup_attr_hdl_) & 269 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&270 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&271 , unit, valid_max, valid_min )284 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 285 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 286 , scale_factor, standard_name, unit, valid_max, valid_min ) 272 287 273 288 END SUBROUTINE xios(get_fieldgroup_attr_hdl) 274 289 275 290 SUBROUTINE xios(get_fieldgroup_attr_hdl_) & 276 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, d omain_ref_, enabled_, field_ref_ &277 , freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_, operation_, prec_ &278 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )291 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_ & 292 , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_ & 293 , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 279 294 280 295 IMPLICIT NONE … … 283 298 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: axis_ref_ 284 299 REAL (KIND=8) , OPTIONAL, INTENT(OUT) :: default_value_ 300 LOGICAL , OPTIONAL, INTENT(OUT) :: detect_missing_value_ 301 LOGICAL (KIND=C_BOOL) :: detect_missing_value__tmp 285 302 CHARACTER(len = *) , OPTIONAL, INTENT(OUT) :: domain_ref_ 286 303 LOGICAL , OPTIONAL, INTENT(OUT) :: enabled_ … … 314 331 ENDIF 315 332 333 IF (PRESENT(detect_missing_value_)) THEN 334 CALL cxios_get_fieldgroup_detect_missing_value(fieldgroup_hdl%daddr, detect_missing_value__tmp) 335 detect_missing_value_=detect_missing_value__tmp 336 ENDIF 337 316 338 IF (PRESENT(domain_ref_)) THEN 317 339 CALL cxios_get_fieldgroup_domain_ref(fieldgroup_hdl%daddr, domain_ref_, len(domain_ref_)) … … 388 410 389 411 SUBROUTINE xios(is_defined_fieldgroup_attr) & 390 ( fieldgroup_id, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&391 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&392 , unit, valid_max, valid_min )412 ( fieldgroup_id, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 413 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 414 , scale_factor, standard_name, unit, valid_max, valid_min ) 393 415 394 416 IMPLICIT NONE … … 401 423 LOGICAL, OPTIONAL, INTENT(OUT) :: default_value 402 424 LOGICAL(KIND=C_BOOL) :: default_value_tmp 425 LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value 426 LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp 403 427 LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref 404 428 LOGICAL(KIND=C_BOOL) :: domain_ref_tmp … … 438 462 CALL xios(get_fieldgroup_handle)(fieldgroup_id,fieldgroup_hdl) 439 463 CALL xios(is_defined_fieldgroup_attr_hdl_) & 440 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&441 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&442 , unit, valid_max, valid_min )464 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 465 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 466 , scale_factor, standard_name, unit, valid_max, valid_min ) 443 467 444 468 END SUBROUTINE xios(is_defined_fieldgroup_attr) 445 469 446 470 SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) & 447 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&448 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&449 , unit, valid_max, valid_min )471 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 472 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 473 , scale_factor, standard_name, unit, valid_max, valid_min ) 450 474 451 475 IMPLICIT NONE … … 457 481 LOGICAL, OPTIONAL, INTENT(OUT) :: default_value 458 482 LOGICAL(KIND=C_BOOL) :: default_value_tmp 483 LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value 484 LOGICAL(KIND=C_BOOL) :: detect_missing_value_tmp 459 485 LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref 460 486 LOGICAL(KIND=C_BOOL) :: domain_ref_tmp … … 493 519 494 520 CALL xios(is_defined_fieldgroup_attr_hdl_) & 495 ( fieldgroup_hdl, add_offset, axis_ref, default_value, d omain_ref, enabled, field_ref, freq_offset&496 , f req_op, grid_ref, group_ref, level, long_name, name, operation, prec, scale_factor, standard_name&497 , unit, valid_max, valid_min )521 ( fieldgroup_hdl, add_offset, axis_ref, default_value, detect_missing_value, domain_ref, enabled & 522 , field_ref, freq_offset, freq_op, grid_ref, group_ref, level, long_name, name, operation, prec & 523 , scale_factor, standard_name, unit, valid_max, valid_min ) 498 524 499 525 END SUBROUTINE xios(is_defined_fieldgroup_attr_hdl) 500 526 501 527 SUBROUTINE xios(is_defined_fieldgroup_attr_hdl_) & 502 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, d omain_ref_, enabled_, field_ref_ &503 , freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_, operation_, prec_ &504 , scale_factor_, standard_name_, unit_, valid_max_, valid_min_ )528 ( fieldgroup_hdl, add_offset_, axis_ref_, default_value_, detect_missing_value_, domain_ref_ & 529 , enabled_, field_ref_, freq_offset_, freq_op_, grid_ref_, group_ref_, level_, long_name_, name_ & 530 , operation_, prec_, scale_factor_, standard_name_, unit_, valid_max_, valid_min_ ) 505 531 506 532 IMPLICIT NONE … … 512 538 LOGICAL, OPTIONAL, INTENT(OUT) :: default_value_ 513 539 LOGICAL(KIND=C_BOOL) :: default_value__tmp 540 LOGICAL, OPTIONAL, INTENT(OUT) :: detect_missing_value_ 541 LOGICAL(KIND=C_BOOL) :: detect_missing_value__tmp 514 542 LOGICAL, OPTIONAL, INTENT(OUT) :: domain_ref_ 515 543 LOGICAL(KIND=C_BOOL) :: domain_ref__tmp … … 562 590 ENDIF 563 591 592 IF (PRESENT(detect_missing_value_)) THEN 593 detect_missing_value__tmp=cxios_is_defined_fieldgroup_detect_missing_value(fieldgroup_hdl%daddr) 594 detect_missing_value_=detect_missing_value__tmp 595 ENDIF 596 564 597 IF (PRESENT(domain_ref_)) THEN 565 598 domain_ref__tmp=cxios_is_defined_fieldgroup_domain_ref(fieldgroup_hdl%daddr) -
XIOS/trunk/src/node/field.cpp
r470 r472 27 27 , active(false) , hasOutputFile(false),hasFieldOut(false), slotUpdateDate(NULL) 28 28 , processed(false) 29 { /* Ne rien faire de plus */}29 { setVirtualVariableGroup() ; } 30 30 31 31 CField::CField(const StdString & id) … … 39 39 , active(false), hasOutputFile(false), hasFieldOut(false), slotUpdateDate(NULL) 40 40 , processed(false) 41 { /* Ne rien faire de plus */}41 { setVirtualVariableGroup() ; } 42 42 43 43 CField::~CField(void) … … 51 51 } 52 52 53 54 //---------------------------------------------------------------- 55 56 void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 57 { 58 this->vVariableGroup = newVVariableGroup; 59 } 60 61 void CField::setVirtualVariableGroup(void) 62 { 63 this->setVirtualVariableGroup(CVariableGroup::create()); 64 } 65 66 CVariableGroup* CField::getVirtualVariableGroup(void) const 67 { 68 return (this->vVariableGroup); 69 } 70 71 72 std::vector<CVariable*> CField::getAllVariables(void) const 73 { 74 return (this->vVariableGroup->getAllChildren()); 75 } 76 77 void CField::solveDescInheritance(bool apply, const CAttributeMap * const parent) 78 { 79 SuperClassAttribute::setAttributes(parent,apply); 80 this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 81 } 82 //---------------------------------------------------------------- 53 83 //---------------------------------------------------------------- 54 84 … … 93 123 return true ; 94 124 break ; 125 126 case EVENT_ID_ADD_VARIABLE : 127 recvAddVariable(event) ; 128 return true ; 129 break ; 130 131 case EVENT_ID_ADD_VARIABLE_GROUP : 132 recvAddVariableGroup(event) ; 133 return true ; 134 break ; 95 135 96 136 default : … … 658 698 SuperClass::parse(node); 659 699 node.getContent(this->content) ; 700 if (node.goToChildElement()) 701 { 702 do 703 { 704 if (node.getElementName()=="variable" || node.getElementName()=="variable_group") this->getVirtualVariableGroup()->parseChild(node); 705 } while (node.goToNextElement()) ; 706 node.goToParentElement(); 707 } 708 660 709 } 661 710 … … 782 831 } 783 832 } 833 834 835 836 CVariable* CField::addVariable(const string& id) 837 { 838 return vVariableGroup->createChild(id) ; 839 } 840 841 CVariableGroup* CField::addVariableGroup(const string& id) 842 { 843 return vVariableGroup->createChildGroup(id) ; 844 } 845 846 847 void CField::sendAddVariable(const string& id) 848 { 849 CContext* context=CContext::getCurrent() ; 850 851 if (! context->hasServer ) 852 { 853 CContextClient* client=context->client ; 854 855 CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE) ; 856 if (client->isServerLeader()) 857 { 858 CMessage msg ; 859 msg<<this->getId() ; 860 msg<<id ; 861 event.push(client->getServerLeader(),1,msg) ; 862 client->sendEvent(event) ; 863 } 864 else client->sendEvent(event) ; 865 } 866 867 } 868 869 870 void CField::sendAddVariableGroup(const string& id) 871 { 872 CContext* context=CContext::getCurrent() ; 873 if (! context->hasServer ) 874 { 875 CContextClient* client=context->client ; 876 877 CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP) ; 878 if (client->isServerLeader()) 879 { 880 CMessage msg ; 881 msg<<this->getId() ; 882 msg<<id ; 883 event.push(client->getServerLeader(),1,msg) ; 884 client->sendEvent(event) ; 885 } 886 else client->sendEvent(event) ; 887 } 888 889 } 890 891 void CField::recvAddVariable(CEventServer& event) 892 { 893 894 CBufferIn* buffer=event.subEvents.begin()->buffer; 895 string id; 896 *buffer>>id ; 897 get(id)->recvAddVariable(*buffer) ; 898 } 899 900 901 void CField::recvAddVariable(CBufferIn& buffer) 902 { 903 string id ; 904 buffer>>id ; 905 addVariable(id) ; 906 } 907 908 void CField::recvAddVariableGroup(CEventServer& event) 909 { 910 911 CBufferIn* buffer=event.subEvents.begin()->buffer; 912 string id; 913 *buffer>>id ; 914 get(id)->recvAddVariableGroup(*buffer) ; 915 } 916 917 918 void CField::recvAddVariableGroup(CBufferIn& buffer) 919 { 920 string id ; 921 buffer>>id ; 922 addVariableGroup(id) ; 923 } 924 925 926 784 927 785 928 } // namespace xios -
XIOS/trunk/src/node/field.hpp
r464 r472 54 54 enum EEventId 55 55 { 56 EVENT_ID_UPDATE_DATA 56 EVENT_ID_UPDATE_DATA, EVENT_ID_ADD_VARIABLE, EVENT_ID_ADD_VARIABLE_GROUP 57 57 } ; 58 58 … … 138 138 void parse(xml::CXMLNode & node) ; 139 139 CArray<double,1>* getInstantData(void) ; 140 141 void setVirtualVariableGroup(CVariableGroup* newVVariableGroup); 142 void setVirtualVariableGroup(void); 143 CVariableGroup* getVirtualVariableGroup(void) const; 144 vector<CVariable*> getAllVariables(void) const; 145 virtual void solveDescInheritance(bool apply, const CAttributeMap * const parent = 0); 146 147 CVariable* addVariable(const string& id="") ; 148 CVariableGroup* addVariableGroup(const string& id="") ; 149 void sendAddVariable(const string& id="") ; 150 void sendAddVariableGroup(const string& id="") ; 151 static void recvAddVariable(CEventServer& event) ; 152 void recvAddVariable(CBufferIn& buffer) ; 153 static void recvAddVariableGroup(CEventServer& event) ; 154 void recvAddVariableGroup(CBufferIn& buffer) ; 155 140 156 public : 141 157 142 158 /// Propriétés privées /// 143 159 CVariableGroup* vVariableGroup ; 160 144 161 std::vector<CField*> refObject; 145 162 CField* baseRefObject; -
XIOS/trunk/src/node/file.cpp
r459 r472 24 24 : CObjectTemplate<CFile>(), CFileAttributes() 25 25 , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL) 26 { setVirtualFieldGroup() ;} 26 { 27 setVirtualFieldGroup() ; 28 setVirtualVariableGroup() ; 29 } 27 30 28 31 CFile::CFile(const StdString & id) 29 32 : CObjectTemplate<CFile>(id), CFileAttributes() 30 33 , vFieldGroup(), data_out(), enabledFields(), fileComm(MPI_COMM_NULL) 31 { setVirtualFieldGroup() ;} 34 { 35 setVirtualFieldGroup() ; 36 setVirtualVariableGroup() ; 37 } 32 38 33 39 CFile::~CFile(void) … … 52 58 } 53 59 60 CVariableGroup* CFile::getVirtualVariableGroup(void) const 61 { 62 return (this->vVariableGroup); 63 } 64 54 65 std::vector<CField*> CFile::getAllFields(void) const 55 66 { 56 67 return (this->vFieldGroup->getAllChildren()); 68 } 69 70 std::vector<CVariable*> CFile::getAllVariables(void) const 71 { 72 return (this->vVariableGroup->getAllChildren()); 57 73 } 58 74 … … 120 136 } 121 137 138 void CFile::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) 139 { 140 this->vVariableGroup = newVVariableGroup; 141 } 142 122 143 //---------------------------------------------------------------- 123 144 … … 125 146 { 126 147 this->setVirtualFieldGroup(CFieldGroup::create()); 148 } 149 150 void CFile::setVirtualVariableGroup(void) 151 { 152 this->setVirtualVariableGroup(CVariableGroup::create()); 127 153 } 128 154 … … 313 339 } 314 340 341 vector<CVariable*> listVars = getAllVariables() ; 342 for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) this-> data_out-> writeAttribute(*it) ; 343 315 344 this->data_out->definition_end(); 316 345 } … … 333 362 { 334 363 SuperClass::parse(node); 335 if (node.goToChildElement() & this->hasId()) 336 { // Si la définition du fichier intégre des champs et si le fichier est identifié. 337 node.goToParentElement(); 338 // this->setVirtualFieldGroup(this->getId()); 339 this->getVirtualFieldGroup()->parse(node, false); 340 } 364 365 if (node.goToChildElement()) 366 { 367 do 368 { 369 if (node.getElementName()=="field" || node.getElementName()=="field_group") this->getVirtualFieldGroup()->parseChild(node); 370 else if (node.getElementName()=="variable" || node.getElementName()=="variable_group") this->getVirtualVariableGroup()->parseChild(node); 371 } while (node.goToNextElement()) ; 372 node.goToParentElement(); 373 } 374 341 375 } 342 376 //---------------------------------------------------------------- … … 361 395 { 362 396 SuperClassAttribute::setAttributes(parent,apply); 363 this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL); 397 this->getVirtualFieldGroup()->solveDescInheritance(apply, NULL); 398 this->getVirtualVariableGroup()->solveDescInheritance(apply, NULL); 364 399 } 365 400 … … 422 457 { 423 458 return vFieldGroup->createChildGroup(id) ; 459 } 460 461 CVariable* CFile::addVariable(const string& id) 462 { 463 return vVariableGroup->createChild(id) ; 464 } 465 466 CVariableGroup* CFile::addVariableGroup(const string& id) 467 { 468 return vVariableGroup->createChildGroup(id) ; 424 469 } 425 470 … … 502 547 } 503 548 549 550 551 552 553 554 555 556 557 558 559 void CFile::sendAddVariable(const string& id) 560 { 561 CContext* context=CContext::getCurrent() ; 562 563 if (! context->hasServer ) 564 { 565 CContextClient* client=context->client ; 566 567 CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE) ; 568 if (client->isServerLeader()) 569 { 570 CMessage msg ; 571 msg<<this->getId() ; 572 msg<<id ; 573 event.push(client->getServerLeader(),1,msg) ; 574 client->sendEvent(event) ; 575 } 576 else client->sendEvent(event) ; 577 } 578 579 } 580 581 void CFile::sendAddVariableGroup(const string& id) 582 { 583 CContext* context=CContext::getCurrent() ; 584 if (! context->hasServer ) 585 { 586 CContextClient* client=context->client ; 587 588 CEventClient event(this->getType(),EVENT_ID_ADD_VARIABLE_GROUP) ; 589 if (client->isServerLeader()) 590 { 591 CMessage msg ; 592 msg<<this->getId() ; 593 msg<<id ; 594 event.push(client->getServerLeader(),1,msg) ; 595 client->sendEvent(event) ; 596 } 597 else client->sendEvent(event) ; 598 } 599 600 } 601 602 void CFile::recvAddVariable(CEventServer& event) 603 { 604 605 CBufferIn* buffer=event.subEvents.begin()->buffer; 606 string id; 607 *buffer>>id ; 608 get(id)->recvAddVariable(*buffer) ; 609 } 610 611 612 void CFile::recvAddVariable(CBufferIn& buffer) 613 { 614 string id ; 615 buffer>>id ; 616 addVariable(id) ; 617 } 618 619 void CFile::recvAddVariableGroup(CEventServer& event) 620 { 621 622 CBufferIn* buffer=event.subEvents.begin()->buffer; 623 string id; 624 *buffer>>id ; 625 get(id)->recvAddVariableGroup(*buffer) ; 626 } 627 628 629 void CFile::recvAddVariableGroup(CBufferIn& buffer) 630 { 631 string id ; 632 buffer>>id ; 633 addVariableGroup(id) ; 634 } 635 636 637 638 504 639 505 640 bool CFile::dispatchEvent(CEventServer& event) … … 519 654 return true ; 520 655 break ; 656 657 case EVENT_ID_ADD_VARIABLE : 658 recvAddVariable(event) ; 659 return true ; 660 break ; 521 661 662 case EVENT_ID_ADD_VARIABLE_GROUP : 663 recvAddVariableGroup(event) ; 664 return true ; 665 break ; 522 666 default : 523 667 ERROR("bool CFile::dispatchEvent(CEventServer& event)", <<"Unknown Event") ; -
XIOS/trunk/src/node/file.hpp
r459 r472 42 42 enum EEventId 43 43 { 44 EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP 44 EVENT_ID_ADD_FIELD=0,EVENT_ID_ADD_FIELD_GROUP, EVENT_ID_ADD_VARIABLE,EVENT_ID_ADD_VARIABLE_GROUP 45 45 } ; 46 46 … … 57 57 boost::shared_ptr<CDataOutput> getDataOutput(void) const; 58 58 CFieldGroup* getVirtualFieldGroup(void) const; 59 CVariableGroup* getVirtualVariableGroup(void) const; 59 60 std::vector<CField*> getAllFields(void) const; 61 std::vector<CVariable*> getAllVariables(void) const; 60 62 61 63 std::vector<CField* > getEnabledFields(int default_outputlevel = 5, … … 68 70 void setVirtualFieldGroup(CFieldGroup* newVFieldGroup); 69 71 void setVirtualFieldGroup(void); 72 void setVirtualVariableGroup(CVariableGroup* newVVariableGroup); 73 void setVirtualVariableGroup(void); 70 74 void processEnabledFile(void) ; 71 75 void processEnabledFields(void) ; … … 99 103 CField* addField(const string& id="") ; 100 104 CFieldGroup* addFieldGroup(const string& id="") ; 105 CVariable* addVariable(const string& id="") ; 106 CVariableGroup* addVariableGroup(const string& id="") ; 101 107 void sendAddField(const string& id="") ; 102 108 void sendAddFieldGroup(const string& id="") ; … … 105 111 static void recvAddFieldGroup(CEventServer& event) ; 106 112 void recvAddFieldGroup(CBufferIn& buffer) ; 113 114 void sendAddVariable(const string& id="") ; 115 void sendAddVariableGroup(const string& id="") ; 116 static void recvAddVariable(CEventServer& event) ; 117 void recvAddVariable(CBufferIn& buffer) ; 118 static void recvAddVariableGroup(CEventServer& event) ; 119 void recvAddVariableGroup(CBufferIn& buffer) ; 107 120 static bool dispatchEvent(CEventServer& event) ; 121 108 122 bool isSyncTime(void) ; 109 123 bool checkSplit(void) ; … … 123 137 /// Propriétés privées /// 124 138 CFieldGroup* vFieldGroup; 139 CVariableGroup* vVariableGroup ; 125 140 boost::shared_ptr<CDataOutput> data_out; 126 141 std::vector<CField*> enabledFields; -
XIOS/trunk/src/node/variable.cpp
r389 r472 61 61 oss << "</" << CVariable::GetName() << " >"; 62 62 return (oss.str()); 63 } 64 65 CVariable::EVarType CVariable::getVarType(void) const 66 { 67 EVarType ret ; 68 69 if (type.isEmpty()) ret=t_undefined ; 70 else 71 { 72 string varType=boost::to_lower_copy(boost::trim_copy(type.getValue())) ; 73 if (varType=="int") ret=t_int ; 74 else if (varType=="short int" || varType=="short") ret=t_short_int ; 75 else if (varType=="long int" || varType=="long") ret=t_long_int ; 76 else if (varType=="float") ret=t_float ; 77 else if (varType=="double") ret=t_double ; 78 else if (varType=="long double") ret=t_long_double ; 79 else if (varType=="bool") ret=t_bool ; 80 else if (varType=="long double") ret=t_long_double ; 81 else if (varType=="string") ret=t_string ; 82 } 83 return ret ; 63 84 } 85 64 86 /* 65 87 void CVariable::toBinary(StdOStream & os) const -
XIOS/trunk/src/node/variable.hpp
r459 r472 50 50 51 51 public : 52 52 enum EVarType 53 { t_int, t_short_int, t_long_int, t_float, t_double, t_long_double, t_bool, t_string, t_undefined } ; 54 55 53 56 /// Autres /// 54 57 virtual void parse(xml::CXMLNode & node); 55 58 virtual StdString toString(void) const; 56 59 57 // virtual void toBinary (StdOStream & os) const;58 // virtual void fromBinary(StdIStream & is);59 60 60 /// Accesseur /// 61 61 const StdString & getContent (void) const; 62 62 63 63 64 64 template <typename T> inline T getData(void) const; 65 // bool inline getData<bool>(void) const ;66 // template <> getData<bool>(void) const ;67 65 68 66 template <typename T, StdSize N> 69 67 inline void getData(CArray<T, N>& _data_array) const; 70 68 69 EVarType getVarType(void) const ; 70 71 71 public : 72 72 -
XIOS/trunk/src/output/nc4_data_output.cpp
r465 r472 645 645 SuperClassWriter::addAttribute 646 646 ("online_operation", field->operation.getValue(), &fieldid); 647 648 // write child variables as attributes 649 650 651 vector<CVariable*> listVars = field->getAllVariables() ; 652 for (vector<CVariable*>::iterator it = listVars.begin() ;it != listVars.end(); it++) writeAttribute_(*it, fieldid) ; 653 647 654 648 655 if (wtime) … … 710 717 else singleDomain=false ; 711 718 } 719 720 void CNc4DataOutput::writeAttribute_ (CVariable* var, const string& fieldId) 721 { 722 string name ; 723 if (!var->name.isEmpty()) name=var->name ; 724 else if (var->hasId()) name=var->getId() ; 725 else return ; 726 727 if (var->getVarType()==CVariable::t_int) addAttribute(name,var->getData<int>(),&fieldId) ; 728 else if (var->getVarType()==CVariable::t_short_int) addAttribute(name,var->getData<short int>(),&fieldId) ; 729 else if (var->getVarType()==CVariable::t_long_int) addAttribute(name,var->getData<long int>(),&fieldId) ; 730 else if (var->getVarType()==CVariable::t_float) addAttribute(name,var->getData<float>(),&fieldId) ; 731 else if (var->getVarType()==CVariable::t_double) addAttribute(name,var->getData<double>(),&fieldId) ; 732 else addAttribute(name,var->getData<string>(),&fieldId) ; 733 } 734 735 void CNc4DataOutput::writeAttribute_ (CVariable* var) 736 { 737 string name ; 738 if (!var->name.isEmpty()) name=var->name ; 739 else if (var->hasId()) name=var->getId() ; 740 else return ; 741 742 if (var->getVarType()==CVariable::t_int) addAttribute(name,var->getData<int>()) ; 743 else if (var->getVarType()==CVariable::t_short_int) addAttribute(name,var->getData<short int>()) ; 744 else if (var->getVarType()==CVariable::t_long_int) addAttribute(name,var->getData<long int>()) ; 745 else if (var->getVarType()==CVariable::t_float) addAttribute(name,var->getData<float>()) ; 746 else if (var->getVarType()==CVariable::t_double) addAttribute(name,var->getData<double>()) ; 747 else addAttribute(name,var->getData<string>()) ; 748 } 712 749 713 750 void CNc4DataOutput::syncFile_ (void) -
XIOS/trunk/src/output/nc4_data_output.hpp
r449 r472 44 44 virtual void writeTimeDimension_(void); 45 45 virtual void writeField_ (CField* field); 46 virtual void writeAttribute_ (CVariable* var); 47 virtual void writeAttribute_ (CVariable* var, const string& fieldId); 46 48 virtual void writeFieldData_ (CField* field); 47 49 virtual void writeFile_ (CFile* file); -
XIOS/trunk/src/output/onetcdf4.cpp
r453 r472 349 349 CheckError(nc_put_att_int(grpid, varid, name.c_str(), NC_INT,value.numElements(), value.dataFirst())); 350 350 } 351 //--------------------------------------------------------------- 351 352 353 354 template <> 355 void CONetCDF4::addAttribute 356 (const StdString & name, const short int & value, const StdString * varname ) 357 { 358 int grpid = this->getCurrentGroup(); 359 int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname); 360 CheckError(nc_put_att_short(grpid, varid, name.c_str(), NC_SHORT,1, &value)); 361 } 362 363 template <> 364 void CONetCDF4::addAttribute 365 (const StdString & name, const CArray<short int,1>& value, const StdString * varname ) 366 { 367 int grpid = this->getCurrentGroup(); 368 int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname); 369 CheckError(nc_put_att_short(grpid, varid, name.c_str(), NC_SHORT,value.numElements(), value.dataFirst())); 370 } 371 372 373 374 template <> 375 void CONetCDF4::addAttribute 376 (const StdString & name, const long int & value, const StdString * varname ) 377 { 378 int grpid = this->getCurrentGroup(); 379 int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname); 380 CheckError(nc_put_att_long(grpid, varid, name.c_str(), NC_LONG,1, &value)); 381 } 382 383 template <> 384 void CONetCDF4::addAttribute 385 (const StdString & name, const CArray<long int,1>& value, const StdString * varname ) 386 { 387 int grpid = this->getCurrentGroup(); 388 int varid = (varname == NULL) ? NC_GLOBAL : this->getVariable(*varname); 389 CheckError(nc_put_att_long(grpid, varid, name.c_str(), NC_LONG, value.numElements(), value.dataFirst())); 390 } 391 392 393 394 //--------------------------------------------------------------- 352 395 353 396 void CONetCDF4::getWriteDataInfos(const StdString & name, StdSize record, StdSize & array_size, -
XIOS/trunk/src/output/onetcdf4.hpp
r413 r472 53 53 void setDefaultValue(const StdString & varname, const T * value = NULL); 54 54 55 template <class T> 56 void addAttribute 57 (const StdString & name, const T & value, const StdString * varname = NULL); 55 template <class T> void addAttribute (const StdString & name, const T & value, const StdString * varname = NULL); 58 56 59 57 /// Ecriture des données ///
Note: See TracChangeset
for help on using the changeset viewer.