Changeset 2280 for XIOS/trunk/src/io/nc4_data_input.cpp
- Timestamp:
- 01/07/22 12:17:18 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/nc4_data_input.cpp
r1639 r2280 35 35 if (SuperClassWriter::isTemporal(fieldId)) 36 36 { 37 // return SuperClassWriter::getDimensions(&fieldId)[SuperClassWriter::getUnlimitedDimensionName()];38 37 return SuperClassWriter::getDimensions(&fieldId)[SuperClassWriter::getTimeCounterName()]; 39 38 } … … 159 158 if (SuperClassWriter::isTemporal(fieldId)) 160 159 { 161 dimSizeMap.erase(SuperClassWriter::get UnlimitedDimensionName());160 dimSizeMap.erase(SuperClassWriter::getTimeCounterName()); 162 161 dimList.pop_front() ; // assume time dimension is first 163 162 } … … 195 194 listDimSize.push_front(*dimSizeMap.find(*it)); 196 195 } 196 197 // read specific field attribute 198 if (field->add_offset.isEmpty()) 199 { 200 if (SuperClassWriter::hasAttribute<float>("add_offset",&fieldId)) 201 field->add_offset = SuperClassWriter::getAttributeValue<float>("add_offset",&fieldId)[0] ; 202 else if (SuperClassWriter::hasAttribute<double>("add_offset",&fieldId)) 203 field->add_offset = SuperClassWriter::getAttributeValue<double>("add_offset",&fieldId)[0] ; 204 } 205 206 if (field->scale_factor.isEmpty()) 207 { 208 if (SuperClassWriter::hasAttribute<float>("scale_factor",&fieldId)) 209 field->scale_factor = SuperClassWriter::getAttributeValue<float>("scale_factor",&fieldId)[0] ; 210 else if (SuperClassWriter::hasAttribute<double>("scale_factor",&fieldId)) 211 field->scale_factor = SuperClassWriter::getAttributeValue<double>("scale_factor",&fieldId)[0] ; 212 } 197 213 198 214 // Now process domain and axis … … 579 595 if (!axis->n.isEmpty()) n = axis->n.getValue(); 580 596 axis->value.resize(n); 581 for (int i = 0; i < n; ++i) axis->value(i) = readAxisValue(begin + i); 597 double convertFromFactor=1.0 ; 598 if (!axis->convert_from_factor.isEmpty()) convertFromFactor = axis->convert_from_factor ; 599 for (int i = 0; i < n; ++i) axis->value(i) = readAxisValue(begin + i)*convertFromFactor; 582 600 } 583 601 }
Note: See TracChangeset
for help on using the changeset viewer.