Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally support C-grid connectivity in deseas #37

Open
aekiss opened this issue Oct 16, 2024 · 7 comments · May be fixed by #39
Open

Optionally support C-grid connectivity in deseas #37

aekiss opened this issue Oct 16, 2024 · 7 comments · May be fixed by #39
Assignees

Comments

@aekiss
Copy link
Contributor

aekiss commented Oct 16, 2024

Hi @micaeljtoliveira, does deseas assume B-grid connectivity requirements? I guess this is controlled by the choke criteria in topography_number_seas? https://github.com/COSIMA/domain-tools/blob/master/src/topography.f90#L225

i.e. will we need to change this to allow marginal seas to be regarded as connected to the ocean when the outlet is 1 cell wide on a C-grid (e.g. Gibraltar)?

@micaeljtoliveira
Copy link
Contributor

@aekiss Yes, my understanding is that it does assume B-grid connectivity.

I don't remember anymore all the details of the algorithm, but I think this is the relevant piece of code:

!get chokes
choke_east = .not. (any(sea(i:ip, jp) == land) .and. any(sea(i:ip, jm) == land))
choke_west = .not. (any(sea(im:i, jp) == land) .and. any(sea(im:i, jm) == land))
choke_south = .not. (any(sea(im, jm:j) == land) .and. any(sea(ip, jm:j) == land))
choke_north = .not. (any(sea(im, j:jp) == land) .and. any(sea(ip, j:jp) == land))
new_sea = min(minval([sea(im, j), sea(ip, j), sea(i, jm), sea(i, jp)], &
mask=[choke_west, choke_east, choke_south, choke_north]), land)
if (sea(i, j) /= new_sea) then
sea(i, j) = new_sea

@aekiss
Copy link
Contributor Author

aekiss commented Oct 16, 2024

ok, ta, as suspected then.

@aekiss
Copy link
Contributor Author

aekiss commented Oct 18, 2024

@micaeljtoliveira it looks to me like we could optionally support C-grid connectivity rules by simply omitting the mask argument to minval here (and also in the duplicate code for the backward sweep, lines 365-6) - does that sound right?

new_sea = min(minval([sea(im, j), sea(ip, j), sea(i, jm), sea(i, jp)], &
mask=[choke_west, choke_east, choke_south, choke_north]), land)

@micaeljtoliveira
Copy link
Contributor

@aekiss Yes, that sounds right.

@aekiss aekiss changed the title Does deseas assume B-grid connectivity requirements? Optionally support C-grid connectivity in deseas Oct 18, 2024
@aekiss aekiss self-assigned this Oct 21, 2024
@aekiss aekiss linked a pull request Oct 21, 2024 that will close this issue
@aekiss
Copy link
Contributor Author

aekiss commented Oct 22, 2024

Just for reference, mom6-regional has this code for removing narrow channels https://github.com/COSIMA/regional-mom6/blob/0bfe4ba7aab3f27821476b83130861d6922a6c80/regional_mom6/regional_mom6.py#L1311

@aekiss
Copy link
Contributor Author

aekiss commented Oct 22, 2024

@micaeljtoliveira, @angus-g do you know whether topography_nonadvective is necessary for MOM6? We don't want to do coastal, but is potholes worthwhile on a z* vertical grid (using different criteria to suit a C grid)? I guess I'm asking, does anything bad happen if a cell is surrounded on all sides by vanishing layers? (I'm guessing it's fine)

subroutine topography_nonadvective(this, vgrid_file, vgrid_type, potholes, coastal, fix)

@angus-g
Copy link

angus-g commented Oct 23, 2024

I guess I'm asking, does anything bad happen if a cell is surrounded on all sides by vanishing layers? (I'm guessing it's fine)

As long as it's wet on all those sides, I don't think there's an issue, no.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants