-
-
Notifications
You must be signed in to change notification settings - Fork 283
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
Fortran configury: Ensure F08 real_kinds are actually valid kinds #5401
base: develop
Are you sure you want to change the base?
Conversation
max_decimal_prec = 1 | ||
|
||
prec: DO ik = 2, 36 | ||
exp: DO jk = 1, 700 | ||
k = SELECTED_REAL_KIND(ik,jk) | ||
IF(k.LT.0) EXIT exp | ||
do kk = 1,num_rkinds | ||
if (real_kinds(kk) == k) found_rkinds(kk) = .true. | ||
end do | ||
max_decimal_prec = ik |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the KIND is not supported, then the maximum decimal precision, max_decimal_prec, should not be set for that KIND.
For consistency, the same changes should be made to FC_AVAIL_KINDS. |
m4/aclocal_fc.f90
Outdated
INTEGER :: num_rkinds, num_ikinds, num_lkinds | ||
logical :: found_rkinds( 1:SIZE(real_kinds) ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use uppercase keyword intrinsics
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed.
I have to ensure this does not suppress detected kinds of other compilers since that scenario would not cause tests to fail. |
Issue: HDFGroup#5090 Signed-off-by: Luke Robison <[email protected]>
Done!
Sure. In my testing I saw that GNU Fortran was unaffected. You can see output here. For these next two points let me clarify that SELECTED_REAL_KIND is correct in ACfL, it is only the F08 ISO_FORTRAN_ENV array REAL_KINDS that was wrong. That array was only used to print the real kinds the compiler supported (not max precision), so I don't think the following comments items require a change:
The REAL_KINDS array was not used in the loop to determine max decimal precision, so it is already correct.
The non-F08 version of this loop builds the list of kinds based on the return values of SELECTED_REAL_KIND, so it never had the problem. ... however it makes me wonder if the preferred fix is just to ignore REAL_KINDS altogether and use FC_AVAIL_KINDS's logic to find real kinds. |
I'm not sure the compiler does not also have an issue with SELECTED_REAL_KIND, as from our discussion, #5090,
Printed -1, so it does not support KIND=16. |
Correct. ACfL does not support |
Issue: #5090