At the moment, if the user sets the land_sea_mask attribute of their SpaceDomain, it is only used on the outputs and/or internally to a Component if the contributor made use of it.
However, even if the contributor made use of it, the underlying field of SpaceDomain used in the remapping (either as source or destination) is initialised as a regular numpy array. Assigning a masked array to a regular array does not turn the regular array into a masked array, rather it unmaskes the masked array.
This needs to be changed so that the mask is taken into account in the remapping. To do so, when the land_sea_mask attribute is assigned, it needs to be used to mask the underlying field. This way, whether the component contributor decided to return masked or regular numpy arrays, the masked nature of the transfer and potential remapping will be determined by the user's decision to assign a mask to their space domain or not.
At the moment, if the user sets the
land_sea_mask
attribute of theirSpaceDomain
, it is only used on the outputs and/or internally to aComponent
if the contributor made use of it.However, even if the contributor made use of it, the underlying field of
SpaceDomain
used in the remapping (either as source or destination) is initialised as a regular numpy array. Assigning a masked array to a regular array does not turn the regular array into a masked array, rather it unmaskes the masked array.This needs to be changed so that the mask is taken into account in the remapping. To do so, when the
land_sea_mask
attribute is assigned, it needs to be used to mask the underlying field. This way, whether the component contributor decided to return masked or regular numpy arrays, the masked nature of the transfer and potential remapping will be determined by the user's decision to assign a mask to their space domain or not.