Reputation: 168
In the main program, a module is declared with many variables as follows :
module my_module
integer kindi
parameter (kindi=4)
integer (kindi) my_var_from_module
end module my_module
In a particular function, the module is used, but the only variable from the module seems to have no type :
subroutine my_function(param1, param2)
use my_module
implicit none
integer (kindi) param1, param2
print*, 'my_var_from_module = ', my_var_from_module
end function
Also, I've tried to declare a variable locally with the same name, but it replaces its value.
The result is the message from the compiler :
error #6404: This name does not have a type, and must have an explicit type.
Upvotes: 1
Views: 318
Reputation: 168
The minimal example did work.
So I removed the main program .o
file where the module is declared and it solved the problem...
Final explanation : the computer that stores the code and the one that compiles/executes it are not the same. So to test modifications, everything needs to be moved from a computer to the other. However, a parasitic my_module.mod
used to be in the development file system and make
wouldn't replace it. For this reason, if the main file had not been modified at the same time as the subroutine, the variable wasn't known from the compiler who was using an old version of the .mod
file.
Upvotes: 1