Skip to content

field2array error statement is inaccurate #2320

@imreddyTeja

Description

@imreddyTeja

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))) 

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions