Skip to content

Commit

Permalink
NetCDF high resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
pmaciel committed Nov 23, 2024
1 parent 0379d79 commit 83c8d1e
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/mir/netcdf/DataInputVariable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ void DataInputVariable::get2DValues(MIRValuesVector& values, size_t index) const
dims.pop_back();

std::vector<size_t> coords(dims.size());
for (int i = int(dims.size()) - 1; i >= 0; i--) {
auto j = size_t(i);
for (int i = static_cast<int>(dims.size()) - 1; i >= 0; i--) {
auto j = static_cast<size_t>(i);
coords[j] = (index % dims[j]);
index /= dims[j];
}
Expand All @@ -139,11 +139,8 @@ void DataInputVariable::get2DValues(MIRValuesVector& values, size_t index) const
start[j] = coords[j];
}

std::vector<double> data(nx * ny);
matrix_->read(data, start, count);

// FIXME: this copies, so is slow, but we could 'move' data instead
values.assign(data.begin(), data.end());
values.resize(nx * ny);
matrix_->read(values, start, count);
}


Expand Down

0 comments on commit 83c8d1e

Please sign in to comment.