Child pages
  • Hyak_fortran_quad_precision
Skip to end of metadata
Go to start of metadata

For ifort use below command on ikt and mox

module load icc_17

For gfortran, use below code only on mox.

program quadprec
!try quadprecision in 3 ways

  use ISO_FORTRAN_ENV
  real(REAL128) x

!from http://fortranwiki.org/fortran/show/Real+precision
!integer, parameter :: sp = selected_real_kind(6, 37)
!integer, parameter :: dp = selected_real_kind(15, 307)
  integer, parameter :: qp = selected_real_kind(33, 4931)
  real(qp) y

  real(16) z

!This gives kind=10 for gfortran
  x=1.0e4000_REAL128
  x=x*10
  write(*,*)x
  write(*,*) kind(x)

  y=1.0e4000_qp
  y=y*10
  write(*,*)y
  write(*,*) kind(y)

  z=1.0e4000_16
  z=z*10
  write(*,*)z
  write(*,*) kind(z)

end program quadprec


  • No labels