Skip to content

The default KIND of some size/position intrinsic functions should not be default integer #73

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

Closed
klausler opened this issue Nov 5, 2019 · 0 comments
Labels
duplicate This issue or pull request already exists

Comments

@klausler
Copy link

klausler commented Nov 5, 2019

Fortran mandates that the default kind of INTEGER occupy one numeric storage unit; so does the default kind of REAL. In 2019, default REAL is expected to be IEEE-754 single precision. Consequently, the default kind of INTEGER ends up having to be 32 bits wide.

This is a problem for real applications using arrays that are (or can be) very large, as the default KIND= parameter values for intrinsic functions like SIZE, SHAPE, LBOUND, UBOUND, FINDLOC, MAXLOC, and MINLOC (*) are all defined to be the default kind of INTEGER. One must determine the proper kind of "long" integer (or assume it) and remember to specify that KIND= on every use of these intrinsic functions in order to ensure that they work with large arrays.

I propose that the default result kinds of these intrinsic functions be redefined to be processor-dependent, so that a processor supporting large memories can do the obvious right thing.

(*) this list is probably incomplete; maybe it should include LEN but that's less of an issue and it would be the hardest to change

@klausler
Copy link
Author

klausler commented Nov 5, 2019

Duplicate of #72.

@klausler klausler closed this as completed Nov 5, 2019
@certik certik added the duplicate This issue or pull request already exists label Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants