Skip to content

Commit d0c8653

Browse files
authored
Merge pull request #2319 from CliMA/gb/bump
Loosen type restriction in remapping
2 parents 2f170b0 + 30fc87d commit d0c8653

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
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/distributed_remapping.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@ function interpolate!(
910910

911911
found_type = nameof(typeof(dest))
912912

913-
dest isa expected_array_type ||
913+
parent(dest) isa expected_array_type ||
914914
error("dest is a $found_type, expected $expected_array_type")
915915
end
916916
index_field_begin, index_field_end =

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)