Skip to content

NaN check is slow #1209

@ph-kev

Description

@ph-kev

When running the land simulation with the NaN callback, the SYPD suddenly drops.

This is because we use scalar indexing and there is most likely allocations when making the new field.

ClimaComms.allowscalar(ClimaComms.device()) do
num_nans =
isnothing(mask) ? Int(sum(isnan.(parent(state)))) :
Int(sum(isnan.(parent(state)) .* parent(mask)))
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions