atlas icon indicating copy to clipboard operation
atlas copied to clipboard

implement a procedure to carry out a regridding from high to low resolution (binning)

Open mo-lormi opened this issue 9 months ago • 7 comments


Description


This PR is intended to extend the group of the interpolation operations, in particular to:

  • implement a procedure to evaluate the areas of the grid cells (grid type: CS-LFR)
  • implement a procedure to carry out a regridding from high to low resolution (binning)
  • add new tests to the test battery

Rigridding from high to low resolution via binning ...

method: binning binning matrix: B = N A^T W area weights matrix: W interpolation matrix: A normalization factor matrix: N

Acceptance Criteria (Definition of Done)

All the tests pass.

mo-lormi avatar May 03 '24 10:05 mo-lormi

@wdeconinck , @odlomax This PR covers the implementation of the regridding procedure (from high to low resolution). At this stage, I implemented a simple test associated with the procedure to generate data in Gmsh format for data visualization. Further tests will be added.

mo-lormi avatar May 03 '24 10:05 mo-lormi

Thanks, @mo-lormi

Could you add some of the outputs to this PR so we can easily have a look?

odlomax avatar May 03 '24 10:05 odlomax

The following plots refer to two fields:

  1. field: field_01_s ; regridding type: high to low; source grid: CS-LFR-100
  2. field: field_01_t ; regridding type: high to low; target grid: CS-LFR-50

regridding_h2l_field_s regridding_h2l_field_t

mo-lormi avatar May 03 '24 10:05 mo-lormi

This looks very nice! I am curious as a bystander why you haven't used the interpolation elements. Perhaps if you had it would have worked for any grid? https://github.com/ecmwf/atlas/blob/develop/src/atlas/interpolation/element/Quad2D.h

Maybe out of scope though!

twsearle avatar May 03 '24 10:05 twsearle


I carried out further testing. The procedure also works for a different type of grid (function space: StructuredColumns).

The following plots refer to two fields:

  1. field: field_02_s ; regridding type: high to low; source grid: O32
  2. field: field_02_t ; regridding type: high to low; target grid: O16

(note -- It seems that a set of contiguous cells is missing in both plots. Thus, further investigation is needed)

regridding_h2l_field02_s regridding_h2l_field02_t

mo-lormi avatar May 03 '24 15:05 mo-lormi

@mo-lormi concerning the "missing" part in the Gmsh plot, is nothing to worry about. That's because the StructuredColumns fields are unlike NodeColumns and don't have extra duplicated nodes at 360 degrees.

wdeconinck avatar May 08 '24 09:05 wdeconinck

@mo-lormi concerning the "missing" part in the Gmsh plot, is nothing to worry about. That's because the StructuredColumns fields are unlike NodeColumns and don't have extra duplicated nodes at 360 degrees.

@wdeconinck thanks for this info ... To take into account this point, I will need to update the procedure.

mo-lormi avatar May 08 '24 09:05 mo-lormi


@wdeconinck thanks again for the comments and suggestions. I re-implemented the procedure to evaluate the areas of the grid cells based on your proposal. Thanks also to @odlomax for helping to identify the cause of a segmentation fault failure.

mo-lormi avatar Jun 13 '24 16:06 mo-lormi

Thanks so much for this contribution and addressing all my suggestions. 🙏

@wdeconinck thanks again.

mo-lormi avatar Jun 17 '24 12:06 mo-lormi

This will be released in 0.38.0 some time this week.

wdeconinck avatar Jun 17 '24 14:06 wdeconinck