Is it possible to make a precision of a variable itself a variable that will be defined at a run time? Say, if I try to compile:
SUBROUTINE FOO( VARIABLE, PRECISION_VALUE )
IMPLICIT NONE
INTEGER(4) :: PRECISION_VALUE
INTEGER(PRECISION_VALUE) :: VARIABLE
RETURN
END
the compiler output is:
error #6683: A kind type parameter must be a compile-time constant. [PRECISION_VALUE]
INTEGER(PRECISION_VALUE) :: VARIABLE
--------------^
compilation aborted for trial.f (code 1)
Anyway around it? I understand that not any arbitrary value can be used for KIND
, but that's not my concern in this question.