q must be a named integer constant defined somewhere in the code that is given a value of a valid real kind. I.e. look for a statement like integer, parameter :: q = selected_real_kind(15,300).
Before Fortran 2008, at least one of the arguments R or P shall be present; since Fortran 2008, they are assumed to be zero if absent.
Intel Fortran Compiler
If p or r is absent, the result is as if the argument was present with the value zero. If
radix is absent, there is no requirement on the radix of the selected kind.