-
Notifications
You must be signed in to change notification settings - Fork 25
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
Bugfix kOBL #182
Bugfix kOBL #182
Conversation
4630523
to
d9ab2ff
Compare
d9ab2ff
to
7582f47
Compare
7582f47
to
484bd40
Compare
I think kOBL as used in mod_difest.F is supposed to be the index of the interface (not cell center) above the OBLdepth. Then line 1164 should be kOBL = int(hOBL(i,j)), which seems consistent with the previous implicit truncation when converting from real to integer (better to do the conversion explicitly). Then in the argument of CVMix_coeffs_conv, I wonder if kOBL is correct to use. This is similar as in MOM6, but the routine cvmix_coeffs_conv_wrap in cvmix_convection.F90 seems to use a different index (similar to nint(hOBL(i,j))+1). I hope @milicak can comment on this. Would it be an idea to pass hOBL(:,:) to iHAMOCC? Then iHAMOCC can decide on the most appropriate definition (nint(hOBL(i,j))-1 : cell center above OBLdepth; int(hOBL(i,j)) : interface above OBLdepth). |
I agree with @matsbn -1 doesn't make sense to me. we shoudl change it as kOBL = int(hOBL(i,j)). |
Hi @matsbn , @matsbn I still need to pass hOBL(i,j) as a field to iHAMOCC, but I can make this change in a separate PR. |
484bd40
to
5adb996
Compare
Sorry, int and floor should behave the same way in this case, but nint could have a different output. |
5adb996
to
1ee5e61
Compare
I would prefer kOBL = int(hOBL(i,j)) over kOBL = floor(hOBL(i,j)). They should behave identical for the positive real values in question here, but kOBL = int(hOBL(i,j)) is consistent with the CVMix comment on how to obtain the interface index (also, although hardly important, int might be slightly more efficient compared to floor). |
1ee5e61
to
bf76a52
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
@milicak @matsbn
Hi,
the assignment of kOBL looks strange to me (see #179). The code change suggested here is according to code description in CVMix, assuming that kOBL should represent the index of the cell center above the OBL depth (this is what we want to use in iHAMOCC). If this was not your intention, we should perhaps define a new index variable according to
kt
below, that can be imported in iHAMOCC.