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

bug in ggl90/IDEMIX code? #665

Open
mjlosch opened this issue Nov 2, 2022 · 2 comments
Open

bug in ggl90/IDEMIX code? #665

mjlosch opened this issue Nov 2, 2022 · 2 comments

Comments

@mjlosch
Copy link
Member

mjlosch commented Nov 2, 2022

In pkg/ggl90/ggl90_calc.F, recip_hFacI (inverse cell thickness of w-cells) is used a few times to scale variables and coefficients, but only when useIDEMIX=.TRUE.. Two places, where I think this is wrong are:

verticalShear(i,j) = verticalShear(i,j)
& * recip_hFacI(i,j,k)*recip_hFacI(i,j,k)

because verticalShear is also used to compute the Ri-number, where sigmaR has been computed without taking hFacs into account (grad_sigma.F). So in my view it would be consistent to not scale verticalShear with recip_hFacI**2
and

#ifdef ALLOW_GGL90_IDEMIX
IF ( useIDEMIX ) THEN
DO k=2,Nr
DO j=jMin,jMax
DO i=iMin,iMax
a3d(i,j,k) = a3d(i,j,k)*recip_hFacI(i,j,k)
c3d(i,j,k) = c3d(i,j,k)*recip_hFacI(i,j,k)
ENDDO
ENDDO
ENDDO
ENDIF
#endif /* ALLOW_GGL90_IDEMIX */

The implicit solver code was initially more or less a copy of impldiff.F, so I think that the GGL90 code is consistent with how we do things in general (i.e. only use recip_drF*recip_hFacC but not recip_hFacI with recip_drC).

As a consequence verticalShear can be too large near the bottom leading to too much forcing, and similarly for the coefficients a3d and c3d. Any opinions are welcome.

@jm-c
Copy link
Member

jm-c commented Jul 24, 2023

@mjlosch Did the changes in PR #714 (also dealing with some recip_hFacI) address this issue above ?

@mjlosch
Copy link
Member Author

mjlosch commented Jul 24, 2023

Yes, but in #714, we took a different stance and agreed that using recip_hFacI in the coefficients a3d and c3d is correct and now we do it for all cases and in #714 we did not address the first part with the verticalShear, and I am not longer certain, that the current code is wrong.

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

No branches or pull requests

2 participants