I have a whole bunch of variables defined in a Fortran module called. I want to have a subroutine that, at its simplest, initializes the module level variables to those provided by the user. The simplified code below works, however, I've had to use a dummy variable "iii_" in the subroutine argument list to ultimately set the value of module variable "iii". Is there any way to use the same variable name in the subroutine argument list and the module?
MODULE foo
IMPLICIT NONE
INTEGER :: iii
CONTAINS
SUBROUTINE initilize(iii_)
IMPLICIT NONE
INTEGER :: iii_
iii = iii_
print *, iii
END SUBROUTINE
END MODULE
So what I really want is:
MODULE foo
IMPLICIT NONE
INTEGER :: iii
CONTAINS
SUBROUTINE initilize(iii)
IMPLICIT NONE
[code to set subroutine iii to module iii]
print *, iii
END SUBROUTINE
END MODULE