Ignore:
Timestamp:
10/06/20 10:19:12 (4 years ago)
Author:
ymipsl
Message:

Xios coupling :

"label" axis attribute is now working again.

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/io/nc4_data_output.cpp

    r1930 r1950  
    12611261 
    12621262          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           
    12911264          switch (SuperClass::type) 
    12921265          { 
     
    12991272 
    13001273                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 hole 
    1308                       axis_bounds(1, i) = -1.; 
    1309                     } 
    1310                     else 
    1311                     { 
    1312                       axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 
    1313                       axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 
    1314                     } 
    1315                   } 
    13161274                  SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0); 
    1317                 } 
    13181275              } 
    13191276              else 
    1320                 SuperClassWriter::writeData(axis_label, axisid, isCollective, 0); 
     1277                SuperClassWriter::writeData(axis->label, axisid, isCollective, 0); 
    13211278 
    13221279              SuperClassWriter::definition_start(); 
     
    13381295 
    13391296                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                     else 
    1350                     { 
    1351                       axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 
    1352                       axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 
    1353                     } 
    1354                   } 
    13551297                  SuperClassWriter::writeData(axis->bounds, axisBoundsId, isCollective, 0, &startBounds, &countBounds); 
    1356                 } 
    13571298              } 
    13581299              else 
     
    13611302                startLabel[0] = start[0]; startLabel[1] = 0; 
    13621303                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); 
    13641305              } 
    13651306 
Note: See TracChangeset for help on using the changeset viewer.