Changeset 1436


Ignore:
Timestamp:
02/21/18 11:10:56 (6 years ago)
Author:
oabramkina
Message:

Corrections for scalar bounds.

Location:
XIOS/dev/XIOS_DEV_CMIP6/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/XIOS_DEV_CMIP6/src/config/scalar_attribute.conf

    r1435 r1436  
    88DECLARE_ATTRIBUTE(double, value) 
    99DECLARE_ATTRIBUTE(StdString, bounds_name) 
    10 DECLARE_ATTRIBUTE(double, bounds) 
     10DECLARE_ARRAY(double, 1 , bounds) 
    1111 
    1212DECLARE_ATTRIBUTE(StdString, scalar_ref) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/io/nc4_data_output.cpp

    r1435 r1436  
    15311531            if (!scalar->bounds.isEmpty() && scalar->label.isEmpty()) 
    15321532            { 
     1533              dims.clear(); 
     1534              dims.push_back("axis_nbounds"); 
    15331535              boundsId = (scalar->bounds_name.isEmpty()) ? (scalaId + "_bounds") : scalar->bounds_name.getValue(); 
    1534               SuperClassWriter::addAttribute("bounds_name", boundsId, &scalaId); 
    1535               SuperClassWriter::addDimension(boundsId, 1); 
    15361536              SuperClassWriter::addVariable(boundsId, typePrec, dims); 
     1537              SuperClassWriter::addAttribute("bounds", boundsId, &scalaId); 
    15371538            } 
    15381539 
     
    15451546                CArray<double,1> scalarValue(scalarSize); 
    15461547                CArray<string,1> scalarLabel(scalarSize); 
     1548                CArray<double,1> scalarBounds(scalarSize*2); 
    15471549 
    15481550                if (!scalar->value.isEmpty() && scalar->label.isEmpty()) 
     
    15541556                if (!scalar->bounds.isEmpty() && scalar->label.isEmpty()) 
    15551557                { 
    1556                   scalarValue(0) = scalar->bounds; 
    1557                   SuperClassWriter::writeData(scalarValue, boundsId, isCollective, 0); 
     1558                  scalarBounds(0) = scalar->bounds(0); 
     1559                  scalarBounds(1) = scalar->bounds(1); 
     1560                  SuperClassWriter::writeData(scalarBounds, boundsId, isCollective, 0); 
    15581561                } 
    15591562 
     
    15721575                CArray<double,1> scalarValue(scalarSize); 
    15731576                CArray<string,1> scalarLabel(scalarSize); 
     1577                CArray<double,1> scalarBounds(scalarSize*2); 
    15741578 
    15751579                std::vector<StdSize> start(1); 
     
    15841588                if (!scalar->bounds.isEmpty() && scalar->label.isEmpty()) 
    15851589                { 
    1586                   scalarValue(0) = scalar->bounds; 
    1587                   SuperClassWriter::writeData(scalarValue, boundsId, isCollective, 0, &start, &count); 
     1590                  scalarBounds(0) = scalar->bounds(0); 
     1591                  scalarBounds(1) = scalar->bounds(1); 
     1592                  count[0] = 2; 
     1593                  SuperClassWriter::writeData(scalarBounds, boundsId, isCollective, 0, &start, &count); 
    15881594                } 
    15891595                if (!scalar->label.isEmpty()) 
  • XIOS/dev/XIOS_DEV_CMIP6/src/node/scalar.hpp

    r1158 r1436  
    1010#include "attribute_enum.hpp" 
    1111#include "attribute_enum_impl.hpp" 
     12#include "attribute_array.hpp" 
    1213#include "transformation.hpp" 
    1314#include "transformation_enum.hpp" 
Note: See TracChangeset for help on using the changeset viewer.