Skip to content
Snippets Groups Projects
Commit 40eda742 authored by Joerg Behrens's avatar Joerg Behrens
Browse files

extend update_column to borders

parent 20177b70
No related branches found
No related tags found
No related merge requests found
......@@ -97,9 +97,12 @@ void show_view(const std::string &label, const ViewType &view, const bool with_v
template<typename ViewType>
inline HOST_DEVICE_ATTRIBUTES void update_column(ViewType &v) {
const int nlev = v.extent(0);
{int k = 0; v(k) += v(k+1)/10000;}
for (int k=1; k < nlev-1; ++k) {
v(k) = v(k) + v(k-1)/100 + v(k+1)/10000;
v(k) += v(k-1)/100 + v(k+1)/10000;
}
{int k = nlev-1; v(k) += v(k-1)/100;}
}
......@@ -107,7 +110,7 @@ template<typename ViewType>
inline HOST_DEVICE_ATTRIBUTES void update_field(ViewType &v, int i0, AllLevels all, int i2) {
const int nlev = v.extent(1);
check_bounds(i0, i2, v.extent(0), v.extent(2));
auto column = subview(v,i0,Kokkos::ALL, i2);
auto column = subview(v,i0,Kokkos::ALL, i2); // why can't we use the RHS as argument to update_column directly?
update_column(column);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment