- Timestamp:
- 06/18/18 20:32:55 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/src/interface/c_attr/icdomain_attr.cpp
r1052 r1545 4 4 5 5 #include <boost/multi_array.hpp> 6 #include < boost/shared_ptr.hpp>6 #include <memory> 7 7 #include "xios.hpp" 8 8 #include "attribute_template.hpp" … … 93 93 94 94 95 void cxios_set_domain_bounds_lat_name(domain_Ptr domain_hdl, const char * bounds_lat_name, int bounds_lat_name_size) 96 { 97 std::string bounds_lat_name_str; 98 if (!cstr2string(bounds_lat_name, bounds_lat_name_size, bounds_lat_name_str)) return; 99 CTimer::get("XIOS").resume(); 100 domain_hdl->bounds_lat_name.setValue(bounds_lat_name_str); 101 CTimer::get("XIOS").suspend(); 102 } 103 104 void cxios_get_domain_bounds_lat_name(domain_Ptr domain_hdl, char * bounds_lat_name, int bounds_lat_name_size) 105 { 106 CTimer::get("XIOS").resume(); 107 if (!string_copy(domain_hdl->bounds_lat_name.getInheritedValue(), bounds_lat_name, bounds_lat_name_size)) 108 ERROR("void cxios_get_domain_bounds_lat_name(domain_Ptr domain_hdl, char * bounds_lat_name, int bounds_lat_name_size)", << "Input string is too short"); 109 CTimer::get("XIOS").suspend(); 110 } 111 112 bool cxios_is_defined_domain_bounds_lat_name(domain_Ptr domain_hdl) 113 { 114 CTimer::get("XIOS").resume(); 115 bool isDefined = domain_hdl->bounds_lat_name.hasInheritedValue(); 116 CTimer::get("XIOS").suspend(); 117 return isDefined; 118 } 119 120 95 121 void cxios_set_domain_bounds_lon_1d(domain_Ptr domain_hdl, double* bounds_lon_1d, int* extent) 96 122 { … … 143 169 144 170 171 void cxios_set_domain_bounds_lon_name(domain_Ptr domain_hdl, const char * bounds_lon_name, int bounds_lon_name_size) 172 { 173 std::string bounds_lon_name_str; 174 if (!cstr2string(bounds_lon_name, bounds_lon_name_size, bounds_lon_name_str)) return; 175 CTimer::get("XIOS").resume(); 176 domain_hdl->bounds_lon_name.setValue(bounds_lon_name_str); 177 CTimer::get("XIOS").suspend(); 178 } 179 180 void cxios_get_domain_bounds_lon_name(domain_Ptr domain_hdl, char * bounds_lon_name, int bounds_lon_name_size) 181 { 182 CTimer::get("XIOS").resume(); 183 if (!string_copy(domain_hdl->bounds_lon_name.getInheritedValue(), bounds_lon_name, bounds_lon_name_size)) 184 ERROR("void cxios_get_domain_bounds_lon_name(domain_Ptr domain_hdl, char * bounds_lon_name, int bounds_lon_name_size)", << "Input string is too short"); 185 CTimer::get("XIOS").suspend(); 186 } 187 188 bool cxios_is_defined_domain_bounds_lon_name(domain_Ptr domain_hdl) 189 { 190 CTimer::get("XIOS").resume(); 191 bool isDefined = domain_hdl->bounds_lon_name.hasInheritedValue(); 192 CTimer::get("XIOS").suspend(); 193 return isDefined; 194 } 195 196 197 void cxios_set_domain_comment(domain_Ptr domain_hdl, const char * comment, int comment_size) 198 { 199 std::string comment_str; 200 if (!cstr2string(comment, comment_size, comment_str)) return; 201 CTimer::get("XIOS").resume(); 202 domain_hdl->comment.setValue(comment_str); 203 CTimer::get("XIOS").suspend(); 204 } 205 206 void cxios_get_domain_comment(domain_Ptr domain_hdl, char * comment, int comment_size) 207 { 208 CTimer::get("XIOS").resume(); 209 if (!string_copy(domain_hdl->comment.getInheritedValue(), comment, comment_size)) 210 ERROR("void cxios_get_domain_comment(domain_Ptr domain_hdl, char * comment, int comment_size)", << "Input string is too short"); 211 CTimer::get("XIOS").suspend(); 212 } 213 214 bool cxios_is_defined_domain_comment(domain_Ptr domain_hdl) 215 { 216 CTimer::get("XIOS").resume(); 217 bool isDefined = domain_hdl->comment.hasInheritedValue(); 218 CTimer::get("XIOS").suspend(); 219 return isDefined; 220 } 221 222 145 223 void cxios_set_domain_data_dim(domain_Ptr domain_hdl, int data_dim) 146 224 { … … 308 386 309 387 388 void cxios_set_domain_dim_i_name(domain_Ptr domain_hdl, const char * dim_i_name, int dim_i_name_size) 389 { 390 std::string dim_i_name_str; 391 if (!cstr2string(dim_i_name, dim_i_name_size, dim_i_name_str)) return; 392 CTimer::get("XIOS").resume(); 393 domain_hdl->dim_i_name.setValue(dim_i_name_str); 394 CTimer::get("XIOS").suspend(); 395 } 396 397 void cxios_get_domain_dim_i_name(domain_Ptr domain_hdl, char * dim_i_name, int dim_i_name_size) 398 { 399 CTimer::get("XIOS").resume(); 400 if (!string_copy(domain_hdl->dim_i_name.getInheritedValue(), dim_i_name, dim_i_name_size)) 401 ERROR("void cxios_get_domain_dim_i_name(domain_Ptr domain_hdl, char * dim_i_name, int dim_i_name_size)", << "Input string is too short"); 402 CTimer::get("XIOS").suspend(); 403 } 404 405 bool cxios_is_defined_domain_dim_i_name(domain_Ptr domain_hdl) 406 { 407 CTimer::get("XIOS").resume(); 408 bool isDefined = domain_hdl->dim_i_name.hasInheritedValue(); 409 CTimer::get("XIOS").suspend(); 410 return isDefined; 411 } 412 413 414 void cxios_set_domain_dim_j_name(domain_Ptr domain_hdl, const char * dim_j_name, int dim_j_name_size) 415 { 416 std::string dim_j_name_str; 417 if (!cstr2string(dim_j_name, dim_j_name_size, dim_j_name_str)) return; 418 CTimer::get("XIOS").resume(); 419 domain_hdl->dim_j_name.setValue(dim_j_name_str); 420 CTimer::get("XIOS").suspend(); 421 } 422 423 void cxios_get_domain_dim_j_name(domain_Ptr domain_hdl, char * dim_j_name, int dim_j_name_size) 424 { 425 CTimer::get("XIOS").resume(); 426 if (!string_copy(domain_hdl->dim_j_name.getInheritedValue(), dim_j_name, dim_j_name_size)) 427 ERROR("void cxios_get_domain_dim_j_name(domain_Ptr domain_hdl, char * dim_j_name, int dim_j_name_size)", << "Input string is too short"); 428 CTimer::get("XIOS").suspend(); 429 } 430 431 bool cxios_is_defined_domain_dim_j_name(domain_Ptr domain_hdl) 432 { 433 CTimer::get("XIOS").resume(); 434 bool isDefined = domain_hdl->dim_j_name.hasInheritedValue(); 435 CTimer::get("XIOS").suspend(); 436 return isDefined; 437 } 438 439 310 440 void cxios_set_domain_domain_ref(domain_Ptr domain_hdl, const char * domain_ref, int domain_ref_size) 311 441 { … … 430 560 431 561 562 void cxios_set_domain_lat_name(domain_Ptr domain_hdl, const char * lat_name, int lat_name_size) 563 { 564 std::string lat_name_str; 565 if (!cstr2string(lat_name, lat_name_size, lat_name_str)) return; 566 CTimer::get("XIOS").resume(); 567 domain_hdl->lat_name.setValue(lat_name_str); 568 CTimer::get("XIOS").suspend(); 569 } 570 571 void cxios_get_domain_lat_name(domain_Ptr domain_hdl, char * lat_name, int lat_name_size) 572 { 573 CTimer::get("XIOS").resume(); 574 if (!string_copy(domain_hdl->lat_name.getInheritedValue(), lat_name, lat_name_size)) 575 ERROR("void cxios_get_domain_lat_name(domain_Ptr domain_hdl, char * lat_name, int lat_name_size)", << "Input string is too short"); 576 CTimer::get("XIOS").suspend(); 577 } 578 579 bool cxios_is_defined_domain_lat_name(domain_Ptr domain_hdl) 580 { 581 CTimer::get("XIOS").resume(); 582 bool isDefined = domain_hdl->lat_name.hasInheritedValue(); 583 CTimer::get("XIOS").suspend(); 584 return isDefined; 585 } 586 587 432 588 void cxios_set_domain_latvalue_1d(domain_Ptr domain_hdl, double* latvalue_1d, int* extent) 433 589 { … … 480 636 481 637 638 void cxios_set_domain_lon_name(domain_Ptr domain_hdl, const char * lon_name, int lon_name_size) 639 { 640 std::string lon_name_str; 641 if (!cstr2string(lon_name, lon_name_size, lon_name_str)) return; 642 CTimer::get("XIOS").resume(); 643 domain_hdl->lon_name.setValue(lon_name_str); 644 CTimer::get("XIOS").suspend(); 645 } 646 647 void cxios_get_domain_lon_name(domain_Ptr domain_hdl, char * lon_name, int lon_name_size) 648 { 649 CTimer::get("XIOS").resume(); 650 if (!string_copy(domain_hdl->lon_name.getInheritedValue(), lon_name, lon_name_size)) 651 ERROR("void cxios_get_domain_lon_name(domain_Ptr domain_hdl, char * lon_name, int lon_name_size)", << "Input string is too short"); 652 CTimer::get("XIOS").suspend(); 653 } 654 655 bool cxios_is_defined_domain_lon_name(domain_Ptr domain_hdl) 656 { 657 CTimer::get("XIOS").resume(); 658 bool isDefined = domain_hdl->lon_name.hasInheritedValue(); 659 CTimer::get("XIOS").suspend(); 660 return isDefined; 661 } 662 663 482 664 void cxios_set_domain_long_name(domain_Ptr domain_hdl, const char * long_name, int long_name_size) 483 665 {
Note: See TracChangeset
for help on using the changeset viewer.