Changeset 1950 for XIOS/dev/dev_ym/XIOS_COUPLING/src/io
- Timestamp:
- 10/06/20 10:19:12 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp
r1930 r1950 1261 1261 1262 1262 SuperClassWriter::definition_end(); 1263 1264 CArray<int, 1>& indexToWrite = axis->localIndexToWriteOnServer; 1265 int nbWritten = indexToWrite.numElements(); 1266 CArray<double,1> axis_value(indexToWrite.numElements()); 1267 if (!axis->value.isEmpty()) 1268 { 1269 for (int i = 0; i < nbWritten; i++) 1270 { 1271 if (indexToWrite(i) < 0) 1272 axis_value(i) = -1; // Some value in case of a hole 1273 else 1274 axis_value(i) = axis->value(indexToWrite(i)); 1275 } 1276 } 1277 CArray<double,2> axis_bounds; 1278 CArray<string,1> axis_label; 1279 if (!axis->label.isEmpty()) 1280 { 1281 axis_label.resize(indexToWrite.numElements()); 1282 for (int i = 0; i < nbWritten; i++) 1283 { 1284 if (indexToWrite(i) < 0) 1285 axis_label(i) = boost::lexical_cast<string>(-1); // Some value in case of a hole 1286 else 1287 axis_label(i) = axis->label(indexToWrite(i)); 1288 } 1289 } 1290 1263 1291 1264 switch (SuperClass::type) 1292 1265 { … … 1299 1272 1300 1273 if (!axis->bounds.isEmpty()) 1301 {1302 axis_bounds.resize(2, indexToWrite.numElements());1303 for (int i = 0; i < nbWritten; ++i)1304 {1305 if (indexToWrite(i) < 0)1306 {1307 axis_bounds(0, i) = -1.; // Some value in case of a hole1308 axis_bounds(1, i) = -1.;1309 }1310 else1311 {1312 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i)));1313 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i)));1314 }1315 }1316 1274 SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0); 1317 }1318 1275 } 1319 1276 else 1320 SuperClassWriter::writeData(axis _label, axisid, isCollective, 0);1277 SuperClassWriter::writeData(axis->label, axisid, isCollective, 0); 1321 1278 1322 1279 SuperClassWriter::definition_start(); … … 1338 1295 1339 1296 if (!axis->bounds.isEmpty()) 1340 {1341 axis_bounds.resize(2, indexToWrite.numElements());1342 for (int i = 0; i < nbWritten; ++i)1343 {1344 if (indexToWrite(i) < 0)1345 {1346 axis_bounds(0, i) = -1.;1347 axis_bounds(1, i) = -1.;1348 }1349 else1350 {1351 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i)));1352 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i)));1353 }1354 }1355 1297 SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds); 1356 }1357 1298 } 1358 1299 else … … 1361 1302 startLabel[0] = start[0]; startLabel[1] = 0; 1362 1303 countLabel[0] = count[0]; countLabel[1] = stringArrayLen; 1363 SuperClassWriter::writeData(axis _label, axisid, isCollective, 0, &startLabel, &countLabel);1304 SuperClassWriter::writeData(axis->label, axisid, isCollective, 0, &startLabel, &countLabel); 1364 1305 } 1365 1306
Note: See TracChangeset
for help on using the changeset viewer.