Selecting kind parameters by an explicit integer is still not portable,
the explicit integer will correspond to different precisions on
different machines, a mechanism is needed to select a kind value on the
basis of the desired precision.
For integers this can only be achieved by using the SELECTED_INT_KIND intrinsic function.
For example, SELECTED_INT_KIND(2) returns an integer which corresponds
to the kind representation capable of expressing numbers in
the range, . In the case of SELECTED_INT_KIND the argument
specifies the minimum decimal exponent range for the desired model.
For example,
INTEGER :: short, medium, long, vlong PARAMETER (short = SELECTED_INT_KIND(2), medium = SELECTED_INT_KIND(4), & long = SELECTED_INT_KIND(10), vlong = SELECTED_INT_KIND(100)) INTEGER(short) :: a,b,c INTEGER(medium) :: d,e,f INTEGER(long) :: g,h,i
The above declarations specify that precision should be at least:
Return to corresponding overview page