KIND parameter in PGI Fortran

I don’t know the maximum number of digits after decimal points is allowed in PGI Fortran.

I get compiling error (e.g. KIND must be non-negative) when I set Precision to 31.

  INTEGER, PARAMETER :: dp = SELECTED_REAL_KIND(P=31)

Tuan

P=31 is much too precise unless your on a Cray or Itanium as it’s quad-precision (or even oct-precision) which PGI Fortran doesn’t support (hence the KIND returned as -1). For double-precision on a 64-bit machine

SELECTED_REAL_KIND(p=13,r=200)

will return the correct KIND.

Thanks, Matt.
It turns out that C/C++ supports more number of bits in the mantissa.

Tuan