The /alt_kinds option is convenient to use when compiling large existing Fortran codes in which the kind numbers 4 and 8 for single- and double-precison reals are hard-wired into the source code. Because other widely-used compilers use these kind numbers, /alt_kinds enables one to reuse codes from, for example, www.netlib.org, without having to modify the code to use the FTN95 native kind numbers (1 and 2), or to make the code fully portable using SELECTED_REAL_KIND.
The implementation of /alt_kinds is, unfortunately, incomplete/inconsistent. I found at least three previous posts in which this question was debated:
https://forums.silverfrost.com/Forum/Topic/504
https://forums.silverfrost.com/Forum/Topic/1192
https://forums.silverfrost.com/Forum/Topic/2931
Today, I ran into problems when I was working with code in which expressions of the type real(<integer_expression>, KIND=<symbolic_kind_number>). Here is a short program to illustrate the problem.
program tst
implicit none
integer, parameter :: sp = selected_real_kind(7,30), &
dp = selected_real_kind(15,300)
integer :: ij
real(sp) :: x(2)
real(dp) :: xd(2)
!
ij = 15729
x(1) = real(ij, sp)
x(2) = -acos(-1.0_sp)
xd(1) = real(ij,dp)
xd(2) = -acos(-1.0_dp)
print *, 'sp, dp = ', sp, dp
print *, 'x, xd = ', x, xd
end program tst
Note that the code makes no assumptions regarding kind numbers (beyond assuming that single and double precision are available, which are required by the standards). The program runs fine with FTN95 (as long as you do not use /alt_kinds), Gfortran, Intel, etc. It also works fine with NAG, with or without the -kind=byte option, which has the same purpose as /alt_kinds. With FTN95 /alt_kinds, the compilation fails:
[FTN95/Win32 Ver. 8.10.0 Copyright (c) Silverfrost Ltd 1993-2017]
0010) x(1) = real(ij, sp)
*** KIND parameter out of range, permitted KINDs are 1, 2, or 3
0012) xd(1) = real(ij,dp)
*** KIND parameter out of range, permitted KINDs are 1, 2, or 3
2 ERRORS [<TST> FTN95 v8.20.0]
*** Compilation failed
Thus, the kind number(s) returned by SELECTED_REAL_KIND is not accepted as valid for use as the optional argument KIND of the intrinsic function REAL, which is inconsistent.
One could object that the example code does not need /alt_kinds at all. That is true, but imagine a large source file containing many declarations and lots of code spread over many files, the compiling of which requires the use of /alt_kinds.
P.S., added on March 7: It turns out (see responses below) that SELECTED_REAL_KIND(7,30) means double precision, rather than single precision. The program should have contained SELECTED_REAL_KIND(6,30) instead.