Changeset 713


Ignore:
Timestamp:
10/01/15 09:43:07 (6 years ago)
Author:
rlacroix
Message:

Fix axis bounds: the dimensions were reversed.

Location:
XIOS
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-1.0/src/node/axis.cpp

    r609 r713  
    8282      if (!bounds.isEmpty()) 
    8383      { 
    84         if (bounds.extent(0) != size || bounds.extent(1) != 2) 
     84        if (bounds.extent(0) != 2 || bounds.extent(1) != size) 
    8585            ERROR("CAxis::checkAttributes(void)", 
    86                   << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension axis size x 2" << endl 
     86                  << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension axis 2 x size" << endl 
    8787                  << "Axis size is " << size << endl 
    8888                  << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1)); 
  • XIOS/branchs/xios-1.0/src/output/nc4_data_output.cpp

    r692 r713  
    658658                   for (int i = 0; i < zoom_size; i++) 
    659659                   { 
    660                      axisBounds(0, i) = axis->bounds(i + zoom_begin, 0); 
    661                      axisBounds(1, i) = axis->bounds(i + zoom_begin, 1); 
     660                     axisBounds(0, i) = axis->bounds(0, i + zoom_begin); 
     661                     axisBounds(1, i) = axis->bounds(1, i + zoom_begin); 
    662662                   } 
    663663                   SuperClassWriter::writeData(axisBounds, axisBoundsId, isCollective, 0); 
  • XIOS/trunk/src/io/nc4_data_output.cpp

    r710 r713  
    685685 
    686686              if (!axis->bounds.isEmpty()) 
    687               { 
    688                 CArray<double,2> axisBounds(2, zoom_size_srv); 
    689                 for (int i = 0; i < zoom_size_srv; i++) 
    690                 { 
    691                   axisBounds(0, i) = axis->bound_srv(i, 0); 
    692                   axisBounds(1, i) = axis->bound_srv(i, 1); 
    693                 } 
    694                 SuperClassWriter::writeData(axisBounds, axisBoundsId, isCollective, 0); 
    695               } 
     687                SuperClassWriter::writeData(axis->bound_srv, axisBoundsId, isCollective, 0); 
    696688 
    697689              SuperClassWriter::definition_start(); 
     
    711703 
    712704              if (!axis->bounds.isEmpty()) 
    713               { 
    714                 CArray<double,2> axisBounds(2, zoom_size_srv); 
    715                 for (int i = 0; i < zoom_size_srv; ++i) 
    716                 { 
    717                   axisBounds(0, i+zoom_begin_srv) = axis->bound_srv(i, 0); 
    718                   axisBounds(1, i+zoom_begin_srv) = axis->bound_srv(i, 1); 
    719                 } 
    720                 SuperClassWriter::writeData(axisBounds, axisBoundsId, isCollective, 0, &start, &count); 
    721               } 
     705                SuperClassWriter::writeData(axis->bound_srv, axisBoundsId, isCollective, 0, &start, &count); 
    722706 
    723707              SuperClassWriter::definition_start(); 
  • XIOS/trunk/src/node/axis.cpp

    r679 r713  
    224224    if (!bounds.isEmpty()) 
    225225    { 
    226       if (bounds.extent(0) != n || bounds.extent(1) != 2) 
    227           ERROR("CAxis::checkAttributes(void)", 
    228                 << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension axis size x 2." << std::endl 
    229                 << "Axis size is " << n.getValue() << "." << std::endl 
    230                 << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << "."); 
     226      if (bounds.extent(0) != 2 || bounds.extent(1) != n) 
     227        ERROR("CAxis::checkAttributes(void)", 
     228              << "The bounds array of the axis [ id = '" << getId() << "' , context = '" << CObjectFactory::GetCurrentContextId() << "' ] must be of dimension 2 x axis size." << std::endl 
     229              << "Axis size is " << n.getValue() << "." << std::endl 
     230              << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << "."); 
    231231      hasBounds_ = true; 
    232232    } 
Note: See TracChangeset for help on using the changeset viewer.