diff --git a/src/atlas/grid/detail/grid/CubedSphere2.cc b/src/atlas/grid/detail/grid/CubedSphere2.cc index 11583887c..498ef4287 100644 --- a/src/atlas/grid/detail/grid/CubedSphere2.cc +++ b/src/atlas/grid/detail/grid/CubedSphere2.cc @@ -120,7 +120,7 @@ PointXYZ CubedSphere2::tangent_to_xyz_coord(const PointXY& tan_coord, idx_t tile tan_point << tan_coord[0], tan_coord[1], 1; - xyz = lfric_rotations_[tile].transpose() * tan_point; + xyz = lfric_rotations_transposed_[tile] * tan_point; xyz.normalize(); return {xyz(0), xyz(1), xyz(2)}; diff --git a/src/atlas/grid/detail/grid/CubedSphere2.h b/src/atlas/grid/detail/grid/CubedSphere2.h index ec47bd280..66889a20a 100644 --- a/src/atlas/grid/detail/grid/CubedSphere2.h +++ b/src/atlas/grid/detail/grid/CubedSphere2.h @@ -181,6 +181,15 @@ class CubedSphere2 : public Grid { Matrix({{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}}) }; + std::array lfric_rotations_transposed_ = { + Matrix({{0, 0, 1}, {1, 0, 0}, {0, -1, 0}}), + Matrix({{-1, 0, 0}, {0, 0, 1}, {0, -1, 0}}), + Matrix({{0, 0, -1}, {-1, 0, 0}, {0, -1, 0}}), + Matrix({{1, 0, 0}, {0, 0, -1}, {0, -1, 0}}), + Matrix({{-1, 0, 0}, {0, 1, 0}, {0, 0, 1}}), + Matrix({{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}}) + }; + }; } // namespace grid