Skip to content

Commit

Permalink
Fixed 2273 - Missing values not correctly handled (#2277)
Browse files Browse the repository at this point in the history
* Fixed 2273 - Missing values not correctly handled

* 0-dimensional variables were not being handled correctly by
DC::GetVarDimensions
  • Loading branch information
clyne authored Apr 13, 2020
1 parent d89212d commit bf69e4c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/vdc/DC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ bool DC::_getDataVarDimensions(
if (! status) return(false);

string mname = var.GetMeshName();
if (mname.empty()) return(true); // 0-d variable

Mesh mesh;
status = GetMesh(mname, mesh);
Expand Down
6 changes: 3 additions & 3 deletions lib/vdc/DerivedVar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2466,21 +2466,21 @@ int DerivedCoordVarStandardOceanSCoordinate::initialize_missing_values() {
SetErrMsg("Invalid variable \"%s\"", _CVar.c_str());
return(-1);
}
if (dataInfo.GetHasMissing()) _CVarMV = dataInfo.GetHasMissing();
if (dataInfo.GetHasMissing()) _CVarMV = dataInfo.GetMissingValue();

status = _dc->GetDataVarInfo(_etaVar, dataInfo);
if (! status) {
SetErrMsg("Invalid variable \"%s\"", _etaVar.c_str());
return(-1);
}
if (dataInfo.GetHasMissing()) _etaVarMV = dataInfo.GetHasMissing();
if (dataInfo.GetHasMissing()) _etaVarMV = dataInfo.GetMissingValue();

status = _dc->GetDataVarInfo(_depthVar, dataInfo);
if (! status) {
SetErrMsg("Invalid variable \"%s\"", _depthVar.c_str());
return(-1);
}
if (dataInfo.GetHasMissing()) _depthVarMV = dataInfo.GetHasMissing();
if (dataInfo.GetHasMissing()) _depthVarMV = dataInfo.GetMissingValue();

return(0);
}
Expand Down

0 comments on commit bf69e4c

Please sign in to comment.