Skip to content

Commit d112926

Browse files
authored
Merge pull request #305 from xylar/omega/fix-max-cells-on-edge-dim-read-order
Fix order of `MaxCellsOnEdge`/`TWO` dimension read We want to try the new name first, then the old one. As it stands, we get an error message like: ``` [error] [IO.cpp:343] PIO error while reading dimension TWO ``` even if `MaxCellsOnEdge` is then successfully read. It isn't great that we're getting an error message at all but at least with this fix the error will only be logged if the old dimension name is being used.
2 parents 7be4290 + 8cc552c commit d112926

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/omega/src/base/Decomp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ void readMesh(const int MeshFileID, // file ID for open mesh file
195195
DimName = "MaxCellsOnEdge";
196196
DimNameOld = "TWO";
197197
I4 MaxCellsOnEdgeID;
198-
Err = IO::getDimFromFile(MeshFileID, DimNameOld, MaxCellsOnEdgeID,
198+
Err = IO::getDimFromFile(MeshFileID, DimName, MaxCellsOnEdgeID,
199199
MaxCellsOnEdge);
200200
if (Err.isFail()) { // dim not found, try again with older MPAS name
201-
Err = IO::getDimFromFile(MeshFileID, DimName, MaxCellsOnEdgeID,
201+
Err = IO::getDimFromFile(MeshFileID, DimNameOld, MaxCellsOnEdgeID,
202202
MaxCellsOnEdge);
203203
CHECK_ERROR_ABORT(Err, "Decomp: error reading MaxCellsOnEdge");
204204
if (MaxCellsOnEdge <= 0)

0 commit comments

Comments
 (0)