- 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/icgrid_attr.cpp
r932 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" … … 18 18 typedef xios::CGrid* grid_Ptr; 19 19 20 void cxios_set_grid_comment(grid_Ptr grid_hdl, const char * comment, int comment_size) 21 { 22 std::string comment_str; 23 if (!cstr2string(comment, comment_size, comment_str)) return; 24 CTimer::get("XIOS").resume(); 25 grid_hdl->comment.setValue(comment_str); 26 CTimer::get("XIOS").suspend(); 27 } 28 29 void cxios_get_grid_comment(grid_Ptr grid_hdl, char * comment, int comment_size) 30 { 31 CTimer::get("XIOS").resume(); 32 if (!string_copy(grid_hdl->comment.getInheritedValue(), comment, comment_size)) 33 ERROR("void cxios_get_grid_comment(grid_Ptr grid_hdl, char * comment, int comment_size)", << "Input string is too short"); 34 CTimer::get("XIOS").suspend(); 35 } 36 37 bool cxios_is_defined_grid_comment(grid_Ptr grid_hdl) 38 { 39 CTimer::get("XIOS").resume(); 40 bool isDefined = grid_hdl->comment.hasInheritedValue(); 41 CTimer::get("XIOS").suspend(); 42 return isDefined; 43 } 44 45 20 46 void cxios_set_grid_description(grid_Ptr grid_hdl, const char * description, int description_size) 21 47 { … … 44 70 45 71 72 void cxios_set_grid_mask_0d(grid_Ptr grid_hdl, bool* mask_0d, int* extent) 73 { 74 CTimer::get("XIOS").resume(); 75 CArray<bool,1> tmp(mask_0d, shape(extent[0]), neverDeleteData); 76 grid_hdl->mask_0d.reference(tmp.copy()); 77 CTimer::get("XIOS").suspend(); 78 } 79 80 void cxios_get_grid_mask_0d(grid_Ptr grid_hdl, bool* mask_0d, int* extent) 81 { 82 CTimer::get("XIOS").resume(); 83 CArray<bool,1> tmp(mask_0d, shape(extent[0]), neverDeleteData); 84 tmp=grid_hdl->mask_0d.getInheritedValue(); 85 CTimer::get("XIOS").suspend(); 86 } 87 88 bool cxios_is_defined_grid_mask_0d(grid_Ptr grid_hdl) 89 { 90 CTimer::get("XIOS").resume(); 91 bool isDefined = grid_hdl->mask_0d.hasInheritedValue(); 92 CTimer::get("XIOS").suspend(); 93 return isDefined; 94 } 95 96 46 97 void cxios_set_grid_mask_1d(grid_Ptr grid_hdl, bool* mask_1d, int* extent) 47 98 {
Note: See TracChangeset
for help on using the changeset viewer.