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

Two changes to fpmix indexing #320

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

mnlevy1981
Copy link
Collaborator

There were two instances of indexing arrays out of bounds:

  1. kfsc>=1, but we were looking for iFaceHeight(ksfc-1); I changed this to iFaceHeight(ksfc) instead
  2. kbl was set to nint(CS%kOBL(i,j)), and nint() would round up to ke+1 in some instances so I changed this to int(CS%kOBL(i,j,)) instead

We need to verify that these are scientifically correct, they just seemed like easy ways to avoid exceeding the array bounds

There were two instances of indexing arrays out of bounds:

1. kfsc>=1, but we were looking for iFaceHeight(ksfc-1); I changed this to ksfc
   instead
2. kbl was set to nint(CS%kOBL(i,j)), and nint() would round up to ke+1 in some
   instances so I changed this to int(CS%kOBL(i,j,)) instead
hbl_u and hbl_v were not being initialized in vertFPmix unless G%mask2dCu(I,j)
and G%mask2dCv(i,J) were > 0.5 (2dCu for hbl_u and 2dCv for hbl_v), but we were
using those values to determine whether to compute uInc_u and vInc_v. Now the
computation of those two values are also in the if (G%mask2d...) block.
@gustavo-marques gustavo-marques marked this pull request as ready for review October 30, 2024 21:04
@mnlevy1981 mnlevy1981 merged commit c6d6dcc into NCAR:dev/ncar Oct 30, 2024
10 checks passed
@mnlevy1981 mnlevy1981 deleted the fpmix_debug branch October 30, 2024 21:35
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.

2 participants