Skip to content

Add space with multiple columns#2525

Open
ph-kev wants to merge 3 commits into
mainfrom
kp/multiple-columns
Open

Add space with multiple columns#2525
ph-kev wants to merge 3 commits into
mainfrom
kp/multiple-columns

Conversation

@ph-kev

@ph-kev ph-kev commented Jun 10, 2026

Copy link
Copy Markdown
Member

This PR adds a space that can supports multiple columns. This is needed to complete CliMA/ClimaLand.jl#1723.

This PR have been tested with the FluxnetSimulations in ClimaLand and it produces identical results with the current single column used for the FluxnetSimulation.

The remapping feature will not be done in this PR. For the purpose of calibration, this is not needed because the data is extracted from the ClimaCore fields rather than from the NetCDF files produced from the diagnostics.

Note that most of the code in this PR have been written with Claude.

@ph-kev
ph-kev force-pushed the kp/multiple-columns branch 6 times, most recently from 7567810 to e78f8a4 Compare June 10, 2026 23:20

@nefrathenrici nefrathenrici left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I only saw a few immediate correctness issues.

Comment thread test/TestUtilities/TestUtilities.jl Outdated
Comment thread src/Grids/pointcloud.jl Outdated
s_lat = FT(radius) * deg2rad
s_lon = FT(radius) * deg2rad * cosd(pt.lat)
J = s_lat * s_lon # det of diagonal Jacobian
∂x∂ξ_mat = SMatrix{2, 2, FT, 4}(s_lat, zero(FT), zero(FT), s_lon)

@nefrathenrici nefrathenrici Jun 12, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
∂x∂ξ_mat = SMatrix{2, 2, FT, 4}(s_lat, zero(FT), zero(FT), s_lon)
∂x∂ξ_mat = SMatrix{2, 2, FT, 4}(0, s_lat, s_lon, 0)

The axes need to be flipped. SMatrix enforces float type so I 0 is fine here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this and it wasn't giving the same answer when comparing it against the ClimaLand single column run.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested this again and they are identical (up to some tolerance). I am not sure why I was getting different answers before.

Comment thread src/Spaces/extruded.jl Outdated
@ph-kev
ph-kev marked this pull request as ready for review June 12, 2026 17:53
@ph-kev
ph-kev force-pushed the kp/multiple-columns branch from e78f8a4 to 02c2eb2 Compare June 12, 2026 20:28
Comment thread ext/cuda/adapt.jl Outdated
Comment thread src/Grids/extruded.jl Outdated
Comment thread src/Grids/pointcloud.jl

@dennisYatunin dennisYatunin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! It has a fair bit of code duplication, both in terms of method definitions and const type declarations, but that's a higher-level design issue that can be fixed separately. I left a few nitpicks about readability and error handling, but overall it looks ready to merge in.

Comment thread src/CommonGrids/CommonGrids.jl Outdated
Comment thread src/Grids/extruded.jl Outdated
Comment thread src/Grids/extruded.jl Outdated
Comment thread src/Grids/pointcloud.jl Outdated
Comment thread src/Grids/pointcloud.jl
Comment thread src/Grids/pointcloud.jl Outdated
Comment thread src/Grids/pointcloud.jl Outdated
Comment thread src/Spaces/multicolumn.jl Outdated
Comment thread src/Spaces/multicolumn.jl Outdated
Comment thread src/Spaces/multicolumn.jl Outdated
@ph-kev
ph-kev force-pushed the kp/multiple-columns branch from 7692c10 to bf2127c Compare July 22, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants