Skip to content

Masking added to ESMF regridding for samplers incompatible with external code #3280

Closed
@bena-nasa

Description

A while ago for @metdyn sampler work we added made use of the masking capability in ESMF regridding to handle the geostationary sampler. When creating a grid, we added a mask, anywhere the satellite sees is set to a constant MAPL_MASK_IN and everywhere else MAPL_MASK_OUT, via enumerators so assuming these are 0 and 1. Then when creating the ESMF_RouteHandle we say set anywhere that is MAPL_MASK_OUT to MAPL_UNDF if a mask is present in the destination grid.

Turns out this is problem for UFS. Remember here the grid is passed in from outside and they have a land/ocean mask which are 0 and 1 so the it says, oh the grid has a mask, I'll mask, but in this case we do not want to be masking based on this for the emissions since this is for GOCART.

I'm not sure best solution. Clearly this is dangerous. Dusan suggested, making our mask or there's just different values from 0/1 but that's just relying on coincidence so seems not the ideal solution

How about this, what if in our own grid factory when the mask is set, we also set an attribute on the grid, saying the values to mask out. So in the MAPL/ESMF regridding layer the grid just have BOTH a mask and an attribute saying what values to mask. So if the UFS grid doesn't set this, even if there is a mask, it won't be applied to the ESMF_RouteHandle unless this attribute is set.

Metadata

Labels

0 DiffThe changes in this pull request have verified to be zero-diff with the target branch.❗ High PriorityThis is a high priority PR❓ QuestionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions