Ignore:
Timestamp:
04/25/17 10:57:55 (7 years ago)
Author:
mhnguyen
Message:

Fixing bug of referencing to an object.

+) From now on, two objects of a same grid element (domain, axis, scalar) are equal if
they have the same non-empty attributes and the same transformations.
(This is very common case with inheritance by *_ref).

Test
+) On Curie
+) Ok with toy_cmip6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/grid_transformation_selector.cpp

    r980 r1106  
    202202 
    203203    // If source and destination grid share the same scalar 
    204     if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && 
    205         (scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) && !isSameGrid_) return; 
     204    if ((-1 != scalarDstPos) && (-1 != scalarSrcPos)  && !isSameGrid_ && 
     205        ((scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) || 
     206         (scalarListDestP[scalarDstPos]->isEqual(scalarListSrcP[scalarSrcPos])))) return; 
    206207 
    207208    if (scalarListDestP[scalarDstPos]->hasTransformation()) 
     
    242243 
    243244    // If source and destination grid share the same axis 
    244     if ((-1 != axisDstPos) && (-1 != axisSrcPos) && 
    245         (axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) && !isSameGrid_) return; 
     245    if ((-1 != axisDstPos) && (-1 != axisSrcPos) && !isSameGrid_ && 
     246        ((axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) || 
     247         (axisListDestP[axisDstPos]->isEqual(axisListSrcP[axisSrcPos]))) ) return; 
    246248 
    247249    if (axisListDestP[axisDstPos]->hasTransformation()) 
     
    281283 
    282284    // If source and destination grid share the same domain 
    283     if ((-1 != domDstPos) && (-1 != domSrcPos) && 
    284         (domListDestP[domDstPos] == domListSrcP[domSrcPos]) && !isSameGrid_) return; 
     285    if ((-1 != domDstPos) && (-1 != domSrcPos) && !isSameGrid_ && 
     286        ((domListDestP[domDstPos] == domListSrcP[domSrcPos]) || 
     287         (domListDestP[domDstPos]->isEqual(domListSrcP[domSrcPos])))) return; 
    285288 
    286289    if (domListDestP[domDstPos]->hasTransformation()) 
Note: See TracChangeset for help on using the changeset viewer.