Skip to content

Two changes to fpmix indexing#320

Merged
mnlevy1981 merged 2 commits into
NCAR:dev/ncarfrom
mnlevy1981:fpmix_debug
Oct 30, 2024
Merged

Two changes to fpmix indexing#320
mnlevy1981 merged 2 commits into
NCAR:dev/ncarfrom
mnlevy1981:fpmix_debug

Conversation

@mnlevy1981
Copy link
Copy Markdown
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
@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