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

Fix indexing of layers in high freq. output #6497

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xylar
Copy link
Contributor

@xylar xylar commented Jul 3, 2024

Previously, the layer above the one containing the desired depth was being selected, rather than the layer containing the depth.

The default depth if no layer is found is now the deepest layer, rather than the first layer. This is because, if no layer is found, it means that even the deepest layer is shallower than the desired depth, and the only sensible default is the deepest layer.

non-BFB only for MPAS-Ocean high-frequency output.

Fixes #6496

Previously, the layer above the one containing the desired
depth was being selected, rather than the layer containing the
depth.

The default depth if no layer is found is now the deepest layer,
rather than the first layer.  This is because, if no layer is found,
it means that even the deepest layer is shallower than the desired
depth, and the only sensible default is the deepest layer.
@xylar xylar added mpas-ocean bug fix PR non-BFB PR makes roundoff changes to answers. labels Jul 3, 2024
@xylar
Copy link
Contributor Author

xylar commented Jul 3, 2024

I successfully ran ERS_Ld5.T62_oQU120.CMPASO-NYF.chrysalis_intel and added some temporary print statements, see:

/lcrc/group/e3sm/ac.xasay-davis/scratch/chrys/ERS_Ld5.T62_oQU120.CMPASO-NYF.chrysalis_intel.20240703_024722_lcosnw

With this fix, I'm seeing:

var                 i    refBottomDepth(i-1)     refBottomDepth(i)
-----------------------------------------------------------------
iLevel0100          26   97.8969986438751        106.103993177414
iLevel0250          38   237.887019395828        254.577030897141
iLevel0700          55   688.487065076828        729.107051134109
iLevel2000          75   1977.58716273308        2074.75707554817

So I do believe the fix is correct and the previous results were incorrect.

@xylar
Copy link
Contributor Author

xylar commented Jul 3, 2024

@jonbob, I've marked this as non-BFB because I assume high-frequency output is included in E3SM's checks. Could you verify this? And we presumably need to coordinate with @rljacob to find out if this should wait for the maint-3.0 branch or go in before that.

Copy link
Contributor

@vanroekel vanroekel left a comment

Choose a reason for hiding this comment

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

Approved by visual inspection and testing from @xylar. In addition to the bug fix I like the switch to the bottom if the layer is not found. Having a surface value in regions shallower than the target depth (as we do now) can lead to confusion in interpretation.

Thanks for the fixes @xylar!

@xylar
Copy link
Contributor Author

xylar commented Jul 3, 2024

Thanks @vanroekel!

@rljacob
Copy link
Member

rljacob commented Jul 3, 2024

If high-frequency output is in the 3.0 default output, then yes this should wait.

@xylar
Copy link
Contributor Author

xylar commented Jul 3, 2024

@rljacob, yes, it is.

@rljacob rljacob added this to the v3.1beta milestone Jul 3, 2024
@jonbob
Copy link
Contributor

jonbob commented Jul 3, 2024

@xylar -- high frequency output is not used in testing BFBness, but it is in the 3.0 default output. So it makes sense to wait

Copy link
Contributor

@mark-petersen mark-petersen left a comment

Choose a reason for hiding this comment

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

Yes, I agree both based on the logic and your output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix PR mpas-ocean non-BFB PR makes roundoff changes to answers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in finding layers with given depths in MPAS-Ocean high-frequency output
5 participants