I am writing a vector type in Fortran and am getting very confused.
Suppose I have the following derived type
Type (Vector)
Real :: x, y
Contains
Pro
You are just defining a type-bound procedure xyz%smul
that points to vector_smul
! The original module procedure vector_smul
is not effected!
To stay in the terminology of the Fortran Standard (2008, ch. 4.5.5), smul
is the binding name for the procedure name vector_smul
. You still can access the procedure itself.
You can "rename" the function when using it in the main program:
Program Test
Use Vector, only: Vector, smul => vector_smul
Implicit None
Real :: c
Type (Vector) :: va, vb
c = smul (va, vb)
End Program
[Although it is not possible to have the same name for the type different and the module, i.e. not name them both Vector...]
Take a look at the corresponding topic at the Fortran Wiki...