Skip to content

Commit f51c536

Browse files
Do not reconstruct FD grid
1 parent ca17dd2 commit f51c536

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/netcdf_writer_coordinates.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ function add_space_coordinates_maybe!(
503503
add_space_coordinates_maybe!(nc, horizontal_space, num_points_horiz)
504504

505505
vertical_space = Spaces.FiniteDifferenceSpace(
506-
Spaces.vertical_topology(space),
506+
Spaces.grid(space).vertical_grid,
507507
Spaces.staggering(space),
508508
)
509509

@@ -611,7 +611,7 @@ function target_coordinates(
611611
target_coordinates(Spaces.horizontal_space(space), num_points_horiz)
612612

613613
vertical_space = Spaces.FiniteDifferenceSpace(
614-
Spaces.vertical_topology(space),
614+
Spaces.grid(space).vertical_grid,
615615
Spaces.staggering(space),
616616
)
617617
vcoords =
@@ -682,13 +682,13 @@ Return a tuple with number of points that are optimally suited to interpolate th
682682
`space`.
683683
"""
684684
function default_num_points(
685-
space::ClimaCore.Spaces.ExtrudedFiniteDifferenceSpace,
685+
space::Spaces.ExtrudedFiniteDifferenceSpace,
686686
)
687-
horizontal_space = ClimaCore.Spaces.horizontal_space(space)
687+
horizontal_space = Spaces.horizontal_space(space)
688688
num_horz = default_num_points(horizontal_space)
689689

690-
vertical_space = ClimaCore.Spaces.FiniteDifferenceSpace(
691-
Spaces.vertical_topology(space),
690+
vertical_space = Spaces.FiniteDifferenceSpace(
691+
Spaces.grid(space).vertical_grid,
692692
Spaces.staggering(space),
693693
)
694694
num_vert = default_num_points(vertical_space)
@@ -697,17 +697,17 @@ end
697697

698698
# 2D sphere
699699
function default_num_points(
700-
space::ClimaCore.Spaces.CubedSphereSpectralElementSpace2D,
700+
space::Spaces.CubedSphereSpectralElementSpace2D,
701701
)
702702
# A cubed sphere has 4 panels to cover the range of longitudes, each panel has
703703
# `num_elements_per_panel` elements, each with `unique_degrees_of_freedom` points. Same
704704
# for latitudes, except that we need 2 panels to cover from 0 to 180.
705705

706706
unique_degrees_of_freedom = ClimaCore.Quadratures.unique_degrees_of_freedom(
707-
ClimaCore.Grids.quadrature_style(space),
707+
Grids.quadrature_style(space),
708708
)
709709
num_elements_per_panel = ClimaCore.Meshes.n_elements_per_panel_direction(
710-
ClimaCore.Spaces.topology(space).mesh,
710+
Spaces.topology(space).mesh,
711711
)
712712
num_lat = 2 * num_elements_per_panel * unique_degrees_of_freedom
713713
num_lon = 2num_lat
@@ -716,37 +716,37 @@ end
716716

717717
# TODO: Maybe move to ClimaCore?
718718
const RectilinearSpectralElementSpace1D =
719-
ClimaCore.Spaces.SpectralElementSpace1D{
720-
<:ClimaCore.Grids.SpectralElementGrid1D{
719+
Spaces.SpectralElementSpace1D{
720+
<:Grids.SpectralElementGrid1D{
721721
<:ClimaCore.Topologies.IntervalTopology,
722722
},
723723
}
724724

725725
# 1D box
726726
function default_num_points(space::RectilinearSpectralElementSpace1D)
727727
unique_degrees_of_freedom = ClimaCore.Quadratures.unique_degrees_of_freedom(
728-
ClimaCore.Grids.quadrature_style(space),
728+
Grids.quadrature_style(space),
729729
)
730730
return (
731731
unique_degrees_of_freedom *
732-
ClimaCore.Meshes.nelements(ClimaCore.Spaces.topology(space).mesh),
732+
ClimaCore.Meshes.nelements(Spaces.topology(space).mesh),
733733
)
734734
end
735735

736736
# 2D box
737737
function default_num_points(
738-
space::ClimaCore.Spaces.RectilinearSpectralElementSpace2D,
738+
space::Spaces.RectilinearSpectralElementSpace2D,
739739
)
740740
unique_degrees_of_freedom = ClimaCore.Quadratures.unique_degrees_of_freedom(
741-
ClimaCore.Grids.quadrature_style(space),
741+
Grids.quadrature_style(space),
742742
)
743743

744744
return (
745745
unique_degrees_of_freedom * ClimaCore.Meshes.nelements(
746-
ClimaCore.Spaces.topology(space).mesh.intervalmesh1,
746+
Spaces.topology(space).mesh.intervalmesh1,
747747
),
748748
unique_degrees_of_freedom * ClimaCore.Meshes.nelements(
749-
ClimaCore.Spaces.topology(space).mesh.intervalmesh2,
749+
Spaces.topology(space).mesh.intervalmesh2,
750750
),
751751
)
752752
end
@@ -755,5 +755,5 @@ end
755755
function default_num_points(space::Spaces.FiniteDifferenceSpace)
756756
# We always want the center space for interpolation
757757
cspace = Spaces.center_space(space)
758-
return (ClimaCore.Spaces.nlevels(cspace),)
758+
return (Spaces.nlevels(cspace),)
759759
end

0 commit comments

Comments
 (0)