Skip to content

Conversation

@b-barton
Copy link
Collaborator

@b-barton b-barton commented Jun 6, 2025

There was a problem with zeros or FillValues in the bottom layer and cells near land because the flood fill wasn't happening correctly. Shown in issue #205
This has been fixed by making sure land in source data is masked before flood fill downwards. Horizontal flood filling now also occurs.

@b-barton b-barton requested a review from jdha June 6, 2025 14:17
@b-barton b-barton self-assigned this Jun 6, 2025
@b-barton b-barton added the bug Something isn't working label Jun 6, 2025
@b-barton b-barton linked an issue Jun 6, 2025 that may be closed by this pull request
@b-barton b-barton marked this pull request as draft June 6, 2025 14:17
b-barton added 2 commits June 6, 2025 17:07
…vertical because this has now been taken out of the interp_vertical function
… bottom layer and gdept being smaller. Max_gdept has decreased because it is not marked one cell shallower, this has increased Sum_mask and decreased Sum_unmask. Mean_temp, Mean_sal, Mean_u and Mean_v have increased because they don't entrain zeros near the bottom.
@b-barton b-barton marked this pull request as ready for review June 12, 2025 12:35
Copy link
Collaborator

@jdha jdha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I get what's happening - just a little concerned that if there's no data from the source grid (which is using 9 grid points around the destination bdy point) that things might get messy - I think the same applies when flood filling down as you could be putting surface waters to depth. I generally horizontally fill before vertically to avoid this last instance as much as possible. But I think you're vertically flood filling before horizontally doing so... this needs more thought.

@b-barton
Copy link
Collaborator Author

The code is doing the horizontal flood filling on a given chunks so won't be across any land barriers. Do you mean if there is a chunk without source data? I understand what you mean with doing it horizontally first instead of vertically first. I'll swap it.

b-barton added 6 commits June 16, 2025 16:34
…curs in the centre point of 9 first, then in surrounding points. valid_index() has been moved inside flood_fill().
…me of the 9 surrounding points have data but not the centre so only flood filling the centre can change the weighted averaging.
@b-barton
Copy link
Collaborator Author

I've updated the branch.

@jdha jdha self-requested a review June 27, 2025 12:47
@b-barton b-barton merged commit a26cb3d into master Jun 27, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bottom level filled with zeros in error

3 participants