Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect output from broadcast expression with conversion #2150

Open
charleskawczynski opened this issue Jan 21, 2025 · 1 comment
Open
Assignees
Labels

Comments

@charleskawczynski
Copy link
Member

Reproducer:

using ClimaCore.CommonSpaces
using ClimaCore: Geometry, Fields
FT = Float64
space = ColumnSpace(FT;
    z_elem = 10,
    z_min = 0,
    z_max = 10,
    staggering = CellCenter()
)
const CTh = Geometry.Contravariant12Vector
ᶜuₕ = Fields.Field(Geometry.Covariant12Vector{FT}, space)
∂ᶜK_∂ᶜuₕ = Fields.Field(Geometry.Contravariant12Vector{FT}, space)
@. ∂ᶜK_∂ᶜuₕ = CTh(ᶜuₕ)

This is a reproducer that @dennisYatunin and I conjured up, which needs fixed for supporting FiniteDifferenceSpace simulations in ClimaAtmos.

cc @imreddyTeja

@charleskawczynski
Copy link
Member Author

Some local notes:

# 0 padding of components
# 1 padding of metric tensors
# axfrom, axto
# both exist: do standard conversion
# space ax exists, in ax not exist: 0 pad
# space ax not exists, in ax exists: propagate components without modifying 1


# return Geometry.transform(Geometry.UVWAxis(), arg, local_geometry) # (from DSS logic)
u₁, v = Geometry.components(arg)
uw_vector = Geometry.project(
    Geometry.UWAxis(),
    Geometry.Covariant13Vector(u₁, zero(u₁)),
    local_geometry,
)
u, w = Geometry.components(uw_vector)
return Geometry.UVWVector(u, v, w) * weight

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant