Skip to content

Commit 30fc87d

Browse files
committed
Fix LongLat in default coordinates for Remapper
Latitude and longitudes were flipped in the default target coordiantes in the remapper, leading to non-sense.
1 parent 86388ae commit 30fc87d

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ ClimaCore.jl Release Notes
44
main
55
-------
66

7+
- Latitude and longitudes were flipped in the default target coordiantes
8+
in the remapper, leading to non-sense values.
9+
710
v0.14.33
811
-------
912

src/Remapping/remapping_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,8 @@ function default_target_hcoords_as_vectors(
175175
topology = Spaces.topology(space)
176176
domain = Meshes.domain(topology.mesh)
177177
if domain isa Domains.SphereDomain
178-
return FT.(range(-180.0, 180.0, hresolution)),
179-
FT.(range(-90.0, 90.0, hresolution))
178+
return FT.(range(-90.0, 90.0, hresolution)),
179+
FT.(range(-180.0, 180.0, hresolution))
180180
else
181181
x1min = Geometry.component(domain.interval1.coord_min, 1)
182182
x2min = Geometry.component(domain.interval2.coord_min, 1)

test/Remapping/distributed_remapping.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,14 +813,14 @@ end
813813
)
814814

815815
@test Remapping.default_target_hcoords(hv_center_space) == [
816-
Geometry.LatLongPoint(x, y) for x in range(-180.0, 180.0, length = 180),
817-
y in range(-90.0, 90.0, length = 180)
816+
Geometry.LatLongPoint(x, y) for x in range(-90.0, 90.0, length = 180),
817+
y in range(-180.0, 180.0, length = 180)
818818
]
819819

820820
# Purely horizontal 2D space sphere
821821
@test Remapping.default_target_hcoords(horzspace) == [
822-
Geometry.LatLongPoint(x, y) for x in range(-180.0, 180.0, length = 180),
823-
y in range(-90.0, 90.0, length = 180)
822+
Geometry.LatLongPoint(x, y) for x in range(-90.0, 90.0, length = 180),
823+
y in range(-180.0, 180.0, length = 180)
824824
]
825825

826826
# Purely vertical spaces

0 commit comments

Comments
 (0)