Right now, ClimaCoupler reads in a land fraction (in get_land_fraction). This is correctly used to provide atmos-surface fluxes to the atmosphere, and to combine/weight them across surfaces where we have fractional area fractions.
The piece that is missing is that fraction should be sent to the surface models during their initialization and used to determine where each model gets evaluated. Any cell with fractional land/ocean area fraction should be set to 1 for that model's mask. This way, anywhere we have multiple models present at the surface, both models will be evaluated and we can reasonably compute fluxes with both.
Put another way, if the land fraction is nonzero where land is present, we should construct masks is_land and is_ocean, where is_land = land_fraction .>= 0 and is_ocean = land_fraction .< 1. Note that the area fractions of ocean and land will sum to 1 at each point, but this is not the case for the masks - anywhere the fractions are non-binary the masks should both be 1.
All surface area fractions live on the exchange grid since this is where fluxes are computed. The surface masks, on the other hand, need to be defined on the surface models' grids. I suppose if they're used to construct the surface model grids, we'll construct them on the exchange space first and provide them to the constructors.
Because of grid and resolution differences, we may still end up with nodal points where no surface model is present. To get a better understanding of this, we should plot the SE nodal points and FV cell boundaries of each grid along a coastline and check for any discrepancies. We should also do this once we have these masks implemented and make sure they align/have some overlap.
Right now, ClimaCoupler reads in a land fraction (in get_land_fraction). This is correctly used to provide atmos-surface fluxes to the atmosphere, and to combine/weight them across surfaces where we have fractional area fractions.
The piece that is missing is that fraction should be sent to the surface models during their initialization and used to determine where each model gets evaluated. Any cell with fractional land/ocean area fraction should be set to 1 for that model's mask. This way, anywhere we have multiple models present at the surface, both models will be evaluated and we can reasonably compute fluxes with both.
Put another way, if the land fraction is nonzero where land is present, we should construct masks
is_landandis_ocean, whereis_land = land_fraction .>= 0andis_ocean = land_fraction .< 1. Note that the area fractions of ocean and land will sum to 1 at each point, but this is not the case for the masks - anywhere the fractions are non-binary the masks should both be 1.All surface area fractions live on the exchange grid since this is where fluxes are computed. The surface masks, on the other hand, need to be defined on the surface models' grids. I suppose if they're used to construct the surface model grids, we'll construct them on the exchange space first and provide them to the constructors.
Because of grid and resolution differences, we may still end up with nodal points where no surface model is present. To get a better understanding of this, we should plot the SE nodal points and FV cell boundaries of each grid along a coastline and check for any discrepancies. We should also do this once we have these masks implemented and make sure they align/have some overlap.