Skip to content

What to do when the user tries to add two terms with different dimensions? #2

@hdrake

Description

@hdrake

Currently, we have no protection against users getting incorrect answers because they accidentally add a 2D (lon, lat) flux to a 3D (lon, lat, z) flux difference. This is allowed by xarray, but gives the incorrect behavior of mapping the flux to all vertical levels. To correctly add them, the user should map the flux conservatively to the correct levels. xwmt handles each of these two cases separately, and it is fine for the terms to be added after they pass through xwmt, but not before!

I think we should probably give an error when two terms with different dimensions are explicitly added, and tell the users to break them down in the budget.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions