Skip to content

field2array error statement is inaccurate #2320

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

Open
imreddyTeja opened this issue May 7, 2025 · 0 comments
Open

field2array error statement is inaccurate #2320

imreddyTeja opened this issue May 7, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@imreddyTeja
Copy link
Member

The field2array error when the field is not a field of scalars is inaccurate.

julia> ClimaCore.Fields.field2array(ClimaCore.Fields.fill((1.0, 2.0), ClimaCore.Spaces.PointSpace(ClimaCore.Geometry.YPoint(0.5))))
ERROR: unable to use field2array because each Field element is represented by 0 array elements (must be 1)
Stacktrace:

I think this is caused by

f_axis_size = sizeof(eltype(parent(field))) ÷ sizeof(eltype(field))
        error("unable to use field2array because each Field element is \
               represented by $f_axis_size array elements (must be 1)")

which should be

f_axis_size = sizeof(eltype(field)) ÷ sizeof(eltype(parent(field))) 
@imreddyTeja imreddyTeja added the bug Something isn't working label May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant