Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ IceWaterThermalEquilibrium(; salinity=0) = IceWaterThermalEquilibrium(salinity)
@inline bottom_temperature(i, j, grid, bc::PrescribedTemperature{<:Number}, args...) = bc.temperature

@inline function bottom_temperature(i, j, grid, bc::IceWaterThermalEquilibrium, liquidus)
Sₒ = get_tracer(i, j, 1, grid, bc.salinity)
kᴺ = size(grid, 3)
Sₒ = get_tracer(i, j, kᴺ, grid, bc.salinity)
Copy link
Member

Choose a reason for hiding this comment

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

so grid is the ocean grid or the sea ice grid?

Copy link
Member

Choose a reason for hiding this comment

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

confusing to find this inside ClimaSeaIce

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I guess this is ocean salinity, so logically this should be the ocean's grid. However, in this case, we are passing to the bottom_temperature function the sea ice grid. Luckily, there is no ambiguity in case of a slab thermodynamic model as we have decided in #68 to have the momentum equations (and by extension any 2D field which in principle has no k-location) live at the top of the grid to comply with bathymetry and a possible coupled ocean. So if this function is used in the slab model (2D) it should be kᴺ = size(grid, 3) and not k = 1.
We still have to think about a strategy for a possible multi-layer model (is the k-index the index of the layers? Do we add another dimension?).

Copy link
Member

Choose a reason for hiding this comment

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

I feel we likely want a 3D grid for multi-layer sea ice, because we need that for 3D fields and 3D kernels (though many of the kernels will be 2D)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, I guess we can delay this until we decide the strategy for multi-layer sea ice. In the meantime, in ClimaOcean we can pass the ocean salinity to the boundary condition as

interior(S, :, :, grid.Nz : grid.Nz)

instead of

view(S, :, :, grid.Nz)

to make sure the indexing is correct.

return melting_temperature(liquidus, Sₒ)
end

Expand Down
Loading