Skip to content

Restrict size 1 dimension to source field in regridding #250

@ThibHlln

Description

@ThibHlln

Hi David, Hi Sadie,

In the regridding functionality, there currently is a restriction on the size of the dimensions of the grid: any dimension needs to be greater than one.

But after some testing, I found out that it is only problematic to have a size 1 dimension on the source grid, but not on the destination grid. Indeed, ESMF only raises an error when the source grid has a size 1 dimension (see https://github.com/esmf-org/esmf/blob/b4c535d3b3925f43ccad78191f40d6c51f6f2e7e/src/Infrastructure/Field/src/ESMF_FieldRegrid.F90#L2840-L2847). I am not sure what is the underlying reason for this restriction in ESMF, and it is surprising that it complains only for the source grid.

Nevertheless, as a user, I see some situations where I could benefit from the ability to regrid to a destination resolution composed of a single grid cell (e.g. pre-process some gridded data to get a lumped value for a given region). Since it seems to be working for all regridding methods, I thought it may be good to lift the restriction on the destination grid in cf-python.

What do you think?
Also, do you have any idea why ESMF would restrict the size 1 dimension on the source grid only?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions