Changeset 352 for XIOS/trunk/src/output
- Timestamp:
- 07/09/12 11:33:05 (12 years ago)
- Location:
- XIOS/trunk/src/output
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/output/nc4_data_output.cpp
r351 r352 3 3 4 4 #include <boost/lexical_cast.hpp> 5 #include "attribute_template _impl.hpp"6 #include "group_template _impl.hpp"5 #include "attribute_template.hpp" 6 #include "group_template.hpp" 7 7 8 8 #include "file.hpp" -
XIOS/trunk/src/output/nc4_data_output.hpp
r347 r352 81 81 const StdString & units, 82 82 const StdString & nav_model); 83 /* 83 84 template <class T> 84 85 void writeAxisData(const StdString & axis_name, … … 87 88 const std::vector<StdSize> * start = NULL, 88 89 const std::vector<StdSize> * count = NULL); 89 90 */ 90 91 private : 91 92 -
XIOS/trunk/src/output/onetcdf4.cpp
r350 r352 1 1 #include "onetcdf4.hpp" 2 #include "group_template _impl.hpp"2 #include "group_template.hpp" 3 3 4 4 namespace xios -
XIOS/trunk/src/output/onetcdf4.hpp
r347 r352 126 126 ///--------------------------------------------------------------- 127 127 128 template <class T, StdSize ndim>129 void CONetCDF4::writeData(const ARRAY(T, ndim) data, const StdString & name,130 bool collective, StdSize record,131 const std::vector<StdSize> * start,132 const std::vector<StdSize> * count)133 {134 int grpid = this->getCurrentGroup();135 int varid = this->getVariable(name);136 StdSize array_size = 1;137 std::vector<StdSize> sstart, scount;138 128 139 if (this->wmpi && collective)140 CheckError(nc_var_par_access(grpid, varid, NC_COLLECTIVE));141 if (this->wmpi && !collective)142 CheckError(nc_var_par_access(grpid, varid, NC_INDEPENDENT));143 144 this->getWriteDataInfos145 (name, record, array_size, sstart, scount, start, count);146 if (data->num_elements() != array_size)147 {148 ERROR("CONetCDF4::writeData(...)",149 << "[ input array size = " << data->num_elements()150 << ", intern array size = " << array_size151 << " ] Invalid input data !" );152 }153 154 this->writeData_(grpid, varid, sstart, scount, data->data());155 }156 157 //----------------------------------------------------------------158 159 template <class T>160 void CONetCDF4::setDefaultValue(const StdString & varname, const T * value)161 {162 int grpid = this->getCurrentGroup();163 int varid = this->getVariable(varname);164 165 if (value != NULL)166 {167 CheckError(nc_def_var_fill(grpid, varid, 0, value));168 this->addAttribute(StdString("missing_value"), *value, &varname);169 }170 else171 CheckError(nc_def_var_fill(grpid, varid, 1, NULL));172 }173 174 ///---------------------------------------------------------------175 129 176 130 } // namespace xios
Note: See TracChangeset
for help on using the changeset viewer.