Silverfrost Forums

Welcome to our forums

Real Extended Precision

26 Mar 2025 3:08 #32018

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

      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
27 Mar 2025 7:03 #32019

KL

FTN95 ISO_FORTRAN_ENV has REAL128=-1 which means that 128 bit reals are not supported.

27 Mar 2025 9:20 #32021

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 ?

27 Mar 2025 11:30 #32023

Extended precision (REAL*10) is still supported for Win32 but at the moment there is nothing in ISO_FORTRAN_ENV for this.

28 Mar 2025 10:24 #32026

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

28 Mar 2025 1:39 #32027

Yes but FTN95 extended precision is only available for Win32.

Please login to reply.