-
Notifications
You must be signed in to change notification settings - Fork 35
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 array out of bounds in ectrans-benchmark #84
Conversation
I'm glad you found this, but I think the solution is to enforce positive definiteness for zspsc3a => sp3d(:,:,3:2) to the Is there a specific reason you want to benchmark with no non-wind 3D fields? |
In terms of this: zspsc3a => sp3d(:,:,3:2) it results in zspsc3a being a zero sized array so it depends what the rest of the code does with that. Accessing element 1 (or any other element) of dimension 3 isn't allowed. Beyond that I'm probably the wrong person to ask about the why of this. I'm happy to implement alternative solutions though. |
Fair enough. If you don't have a need to benchmark ecTrans with |
I don't have the need to benchmark it myself, I am just running the standard ctests. I think the ctests should work? If nfld = 0 is invalid then is this a problem with the ctest itself? |
Oh I understand now. Sorry, I see now you were referring to this test. Hmm, I wonder why we have that test at all. @wdeconinck could you enlighten us? (Might take a while to reply as he's away.) |
I think the reasoning is explained in the ectrans-benchmark file:
The change looks a good step in the right direction. Wondering if it's the only problem though, as @samhatfield questions. |
It's certainly not. To be safe we would have to wrap all references to |
As a benchmark it is not useful with --nfld 0, but for testing it is still a useful code path. |
This PR isn't finished yet. We still need to wrap all references to |
@DJDavies2 - could you make these changes in your branch? |
I have updated the branch. |
Addresses #83. I'm not sure what is suposed to happen here; when nfld is 0 the 3rd dimension of the array zspsc3a is 0 and so referencing element 1 is out of bounds. I have fixed this here by skipping that subroutine call when nfld is 0 but there may be a better solution.