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

tranlon in axis_utils2 returns erroneous istrt value when no elements are moved #1156

Closed
J-Lentz opened this issue Mar 11, 2023 · 3 comments · Fixed by #1257
Closed

tranlon in axis_utils2 returns erroneous istrt value when no elements are moved #1156

J-Lentz opened this issue Mar 11, 2023 · 3 comments · Fixed by #1257

Comments

@J-Lentz
Copy link
Contributor

J-Lentz commented Mar 11, 2023

Describe the bug
tranlon's Doxygen comment states: The first istrt-1 entries are moved to the end of the array

But in the case where no elements are moved, tranlon sets istrt to 0, rather than the expected value of 1.

To Reproduce

real :: lon(5) = [1., 2., 3., 4., 5.]
real, parameter :: lon_start = 0.
integer :: istrt

call tranlon(lon, lon_start, istrt)
print "(A)", "istrt=" // string(istrt)

Expected behavior
istrt=1

Additional context
If changing the behavior would break users' code, then it could be argued that the inconsistent istrt=0 return value is acceptable and that the error lies in the Doxygen comment.

@rem1776
Copy link
Contributor

rem1776 commented Apr 20, 2023

fixed with #1172

@rem1776 rem1776 closed this as completed Apr 20, 2023
@J-Lentz
Copy link
Contributor Author

J-Lentz commented Apr 20, 2023

PR #1172 didn't really fix this, except superficially by commenting out the relevant test case.

The question that I don't know the answer to is: do we fix the bug (which could potentially break users' code, since tranlon is a public procedure), or do we crystallize it into the expected behavior by describing it in the Doxygen comment?

@J-Lentz J-Lentz reopened this Apr 20, 2023
@uramirez8707
Copy link
Contributor

@J-Lentz I think you should update the documentation for this corner case.

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 a pull request may close this issue.

3 participants