View previous topic :: View next topic |
Author |
Message |
KL
Joined: 16 Nov 2009 Posts: 155
|
Posted: Wed Mar 26, 2025 4:08 pm Post subject: Real Extended Precision |
|
|
On my PC, version ftn95 9.10.0.0 under Windows 11 Pro 24H2 fails to run the attached program with the error messages:
Line 15 error 62 � Invalid KIND specifier
Line 19 error 636 � KIND parameter out of range
Gfortran runs test116 in all variations without any problem.
KL
Code: |
program test116
use iso_fortran_env
implicit none
integer, parameter :: sp = real32
integer, parameter :: dp = real64
integer, parameter :: qp = real128
!!! integer, parameter :: qp = selected_real_kind(2*precision(1.0_dp))
!!! integer, parameter :: qp = SELECTED_REAL_KIND(33, 4931)
real (sp) :: real_sp
real (dp) :: real_dp
real (qp) :: real_qp
real_sp = 1.0_sp
real_dp = 1.0_dp
real_qp = 1.0_qp
write (*,*) real_sp
write (*,*) real_dp
write (*,*) real_qp
end program test116
|
|
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8165 Location: Salford, UK
|
Posted: Thu Mar 27, 2025 8:03 am Post subject: |
|
|
KL
FTN95 ISO_FORTRAN_ENV has REAL128=-1 which means that 128 bit reals are not supported. |
|
Back to top |
|
 |
JohnCampbell
Joined: 16 Feb 2006 Posts: 2614 Location: Sydney
|
Posted: Thu Mar 27, 2025 10:20 am Post subject: |
|
|
It was the case that non /64 supported real*10.
Has that now changed for version ftn95 9.10.0.0 under Windows 11 Pro 24H2 ? |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8165 Location: Salford, UK
|
Posted: Thu Mar 27, 2025 12:30 pm Post subject: |
|
|
Extended precision (REAL*10) is still supported for Win32 but at the moment there is nothing in ISO_FORTRAN_ENV for this. |
|
Back to top |
|
 |
KL
Joined: 16 Nov 2009 Posts: 155
|
Posted: Fri Mar 28, 2025 11:24 am Post subject: |
|
|
Thank you very much for the brief explanation. I assumed that all Fortran compilers using the module iso_fortran_env "understand" the kind definition real128.
However, it seems that gfortran, using real128 defined by the module iso_fortran_env, and Silverfrost ftn95 employing kind(3) give identical results for extended precision.
KL |
|
Back to top |
|
 |
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 8165 Location: Salford, UK
|
Posted: Fri Mar 28, 2025 2:39 pm Post subject: |
|
|
Yes but FTN95 extended precision is only available for Win32. |
|
Back to top |
|
 |
|