Skip to content

Fix to masking of u,v sponge code.#1412

Merged
marshallward merged 7 commits into
mom-ocean:dev/gfdlfrom
ESMG:ESMG_sponge_masking
Jun 6, 2021
Merged

Fix to masking of u,v sponge code.#1412
marshallward merged 7 commits into
mom-ocean:dev/gfdlfrom
ESMG:ESMG_sponge_masking

Conversation

@kshedstrom
Copy link
Copy Markdown
Collaborator

This also has Bob's updates to the user code for my OBC tests.

@kshedstrom kshedstrom mentioned this pull request May 27, 2021
Copy link
Copy Markdown
Collaborator

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

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

After careful visual inspection, I agree with these changes. The one point that I had to mull over was whether the masking of the input data at velocity points should be masked if either tracer column is masked, or whether it should be unmasked if either is unmasked (as in this code). Upon reflection, I agree with the code that if there is valid data, it can be used. The model will take care of any land masking of the velocity points based on the coastlines, which is a separate question than the depths over which the input data exists.

Assuming that this passes the pipeline testing, I am happy to approve this PR.

@marshallward
Copy link
Copy Markdown
Collaborator

@marshallward marshallward merged commit a6a7999 into mom-ocean:dev/gfdl Jun 6, 2021
do j=CS%jsc,CS%jec; do I=CS%iscB,CS%iecB
sp_val_u(I,j,1:nz_data) = 0.5*(sp_val(i,j,1:nz_data)+sp_val(i+1,j,1:nz_data))
sp_val_u(I,j,1:nz_data) = 0.5*(sp_val(i,j,1:nz_data)+sp_val(i+1,j,1:nz_data))
mask_u(I,j,1:nz_data) = max(mask_z(i,j,1:nz_data),mask_z(i+1,j,1:nz_data))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Taking the average of the sp_val will potentially include a masked valued (huge value if set that way in the input file) and it will not be masked by taking the max of the mask_z. So I would suggest, if we want to keep the max of mask idea to weigh the sp_val by mask_z:
sp_val_u=(sp_val(i)*mask_z(i) + sp_val(i+1)*mask_z(i+1)) / max(mask_z(i)+mask_z(I+1),1e-10)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

My bad, that comment was for the main-GFDL-candidate ... on the same code. I added it there.

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 this pull request may close these issues.

4 participants