- #1
ASGtFT
- 10
- 0
I'm having problems compiling files with interfaces in Fortran. My compiler is NAG Fortran Compiler Release 5.2. I get this error:
-------------------------------------
Error: subroutines.f90, line 2: USE TEST_MOD in program-unit MY_SUB imports
symbol MY_SUB
detected at TEST_MOD@<end-of-statement
---------------------------------------
This happens when I try to compile this file, called 'subroutines.f90':
The mod file 'test_mod' it refers to compiles correctly, and its code is here:
Am I using the correct code, or is something wrong here? Thanks!
-------------------------------------
Error: subroutines.f90, line 2: USE TEST_MOD in program-unit MY_SUB imports
symbol MY_SUB
detected at TEST_MOD@<end-of-statement
---------------------------------------
This happens when I try to compile this file, called 'subroutines.f90':
Code:
subroutine my_sub (a)
use test_mod
real a
print *, a
end subroutine
The mod file 'test_mod' it refers to compiles correctly, and its code is here:
Code:
module test_mod interface
subroutine my_sub (a)
real a
end subroutine
end interface
end module
END
Am I using the correct code, or is something wrong here? Thanks!