In your program you do not explicitly declare var
. In days of yore Fortran supported implicit typing and, by default, variables whose name begin with a v
will be of type real
. Fortran retains this capability, though its use is now frowned upon.
I think you are thinking (as if I had a clue what you are thinking) that var
in the program scope will somehow be automatically associated with, or the same as, var
in the subroutine in the module. It won't be.
Do these things:
- Insert
implicit none
on the line afteruse mod1
in your program. - Explicitly declare
var
within the program, egtype(a) :: var