Since DP is not PRIVATE, it is available for use by the module procedure but is not exported together with the interface of that procedure, and so it is not declared in the main program. NAG Fortran Compiler Release 5.2(668) [NAG Fortran Compiler normal termination] smaug$nagfor -C=all -c ex_08.5.1.f90 NAG Fortran Compiler Release 5.2(668) [NAG Fortran Compiler normal termination] smaug$nagfor -C=all ex_08.5.0.f90 ex_08.5.1.o double.o NAG Fortran Compiler Release 5.2(668) Error: ex_08.5.0.f90, line 4: Implicit type for DP detected at DP@) Error: ex_08.5.0.f90, line 4: DP is not a constant detected at _@DP Warning: ex_08.5.0.f90, line 20: Symbol DP referenced but never set detected at MAIN@ [NAG Fortran Compiler pass 1 error termination, 2 errors, 1 warning]