Ignore:
Timestamp:
11/05/18 13:57:52 (6 years ago)
Author:
oabramkina
Message:

Backporting r1578 and r1586 to dev, cleaning the code before merging it to XIOS 2.5.

Location:
XIOS/dev/dev_olga/src/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/io/nc4_data_input.cpp

    r1577 r1589  
    494494      domain->ni_glo.setValue(itMapNi->second); 
    495495    } 
     496 
     497// determine if coordinates values are present in file 
     498    if ((CDomain::type_attr::rectilinear == domain->type)) 
     499    { 
     500      // Ok, try to read some attributes such as longitude and latitude 
     501      domain->hasLatInReadFile_ = SuperClassWriter::hasVariable(itMapNj->first); 
     502      domain->hasLonInReadFile_  = SuperClassWriter::hasVariable(itMapNi->first); 
     503    } 
     504    else if ((CDomain::type_attr::curvilinear == domain->type) || (CDomain::type_attr::unstructured == domain->type) ) 
     505    { 
     506      StdString latName = this->getLatCoordName(fieldId); 
     507      domain->hasLatInReadFile_ = SuperClassWriter::hasVariable(latName) ; 
     508      StdString lonName = this->getLonCoordName(fieldId);         
     509      domain->hasLonInReadFile_ = SuperClassWriter::hasVariable(lonName) ;  
     510      StdString boundsLatName = this->getBoundsId(latName); 
     511      domain->hasBoundsLatInReadFile_ = SuperClassWriter::hasVariable(boundsLatName) ;  
     512      StdString boundsLonName = this->getBoundsId(lonName); 
     513      domain->hasBoundsLonInReadFile_ = SuperClassWriter::hasVariable(boundsLonName) ; 
     514    } 
    496515  } 
    497516 
  • XIOS/dev/dev_olga/src/io/nc4_data_output.cpp

    r1571 r1589  
    166166           for (int idx = 0; idx < nbWritten; ++idx) 
    167167           { 
    168                   if (indexToWrite(idx) < 0) 
    169                   { 
    170               writtenLat(idx) = -1.;   // hole 
    171               writtenLon(idx) = -1.; 
    172                   } 
    173                   else 
    174                   { 
    175               writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 
    176               writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 
    177                   } 
    178            } 
    179           
     168             if (indexToWrite(idx) < 0) 
     169             { 
     170               writtenLat(idx) = -1.;   // hole 
     171               writtenLon(idx) = -1.; 
     172             } 
     173             else 
     174             { 
     175               writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 
     176               writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 
     177             } 
     178           } 
    180179 
    181180           if (domain->hasBounds) 
     
    999998           for (int idx = 0; idx < nbWritten; ++idx) 
    1000999           { 
    1001                   if (indexToWrite(idx) < 0) 
    1002               writtenArea(idx) = -1.; 
    1003                   else 
    1004                     writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
     1000             if (indexToWrite(idx) < 0) 
     1001               writtenArea(idx) = -1.; 
     1002             else 
     1003               writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
    10051004           } 
    10061005         } 
     
    13291328                      axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 
    13301329                      axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 
    1331  
    13321330                    } 
    13331331                  } 
Note: See TracChangeset for help on using the changeset viewer.