Hello everyone,

I’m currently stuck on a **homework** and would appreciate if you could give me a hint on how to solve the problem. The task is to correctly execute the provided test.f90 file, which uses **parameterized derived types** with a resolution of **real32** or **real64**. The idea is to assign **parameterized operators** to the derived types that can handle this. However, I do not currently understand what I am doing wrong. I am getting the following errors:

```
Non-polymorphic passed-object dummy argument of 'point_multiply_scalar_vct_32' at (1) [15,17]
Non-polymorphic passed-object dummy argument of 'point_multiply_scalar_vct_64' at (1) [15,17]
Undefined specific binding 'point_multiply_scalar_vct_64' as target of GENERIC '*' at (1) [19,63]
'point_64' at (1) is not a member of the 'point' structure [78,53]
'point_64' at (1) is not a member of the 'point' structure [79,53]
'point_64' at (1) is not a member of the 'point' structure [80,53]
'point_64' at (1) is not a member of the 'point' structure [86,53]
'point_64' at (1) is not a member of the 'point' structure [87,53]
'point_64' at (1) is not a member of the 'point' structure [88,53]
```

The provided file is as follows:

```
program test
use coords
use iso_fortran_env
implicit none
real(real32) :: r4
real(real64) :: r8
type(point) :: p1, p2, p3
type(pointT) :: pT1, pT2
!test
r4 = p1
r8 = p1
r4 = p1.dot.p2
p3 = p1.cros.p2
p3 = p1 * r4
p3 = p1 * r8
p3 = r4 * p1
p3 = r8 * p1
p3 = p1 / r4
p3 = p1 / r8
r4 = pT1%Tplus(pT2)
r4 = pT1%Tminus(pT2)
end program test
```

And I wrote my code in the following module:

```
module coords
use iso_fortran_env
implicit none
private
public :: point
type point
real :: x,y,z
contains
procedure,private :: pointplus, pointminus, pointseparation
procedure,private :: vecotr_dot, vecotr_cros
procedure,private :: point_multiply_vct_scalar_32, point_multiply_vct_scalar_64
procedure,private :: point_multiply_scalar_vct_32, point_multiply_scalar_vct_64
procedure,private,pass(this) :: absvec_real32, absvec_real64
generic,public :: operator(+) => pointplus
generic,public :: operator(-) => pointminus
generic,public :: operator(*) => point_multiply_vct_scalar_32, point_multiply_vct_scalar_64
generic,public :: operator(*) => point_multiply_scalar_vct_32, point_multiply_scalar_vct_64
generic,public :: operator(.distance.) => pointseparation
generic,public :: assignment(=) => absvec_real32, absvec_real64
generic,public :: operator(.dot.) => vecotr_dot
generic,public :: operator(.cros.) => vecotr_cros
end type point
type, extends(point) :: pointT
real, PUBLIC :: T
contains
procedure,PRIVATE :: Tplus,Tminus
end type pointT
type, extends(point) :: point_64
real(real64),PUBLIC :: x_64, y_64, z_64
end type point_64
interface absvec
module procedure absvec_real32, absvec_real64
end interface absvec
contains
type(point) function Tplus(this,b) ! for +
class(pointT),intent(in) :: this, b
Tplus%x = this%T + b%T
end function Tplus
type(point) function Tminus(this,b) ! for +
class(pointT),intent(in) :: this, b
Tminus%x = this%T - b%T
end function Tminus
type(point) function pointplus(this,b) ! for +
class(point),intent(in) :: this, b
pointplus%x = this%x + b%x
pointplus%y = this%y + b%y
pointplus%z = this%z + b%z
end function pointplus
type(point) function point_multiply_vct_scalar_32(this,scalar) ! for +
class(point),intent(in) :: this
real(real32), INTENT(IN) :: scalar
point_multiply_vct_scalar_32%x = this%x * scalar
point_multiply_vct_scalar_32%y = this%y * scalar
point_multiply_vct_scalar_32%z = this%z * scalar
end function point_multiply_vct_scalar_32
type(point) function point_multiply_scalar_vct_32(scalar,this) ! for +
class(point),intent(in) :: this
real(real32), INTENT(IN) :: scalar
point_multiply_scalar_vct_32%x = this%x * scalar
point_multiply_scalar_vct_32%y = this%y * scalar
point_multiply_scalar_vct_32%z = this%z * scalar
end function point_multiply_scalar_vct_32
type(point_64) function point_multiply_vct_scalar_64(this,scalar) ! for +
class(point),intent(in) :: this
real(real64), INTENT(IN) :: scalar
point_multiply_vct_scalar_64%x = this%point_64%x_64 * scalar
point_multiply_vct_scalar_64%y = this%point_64%y_64 * scalar
point_multiply_vct_scalar_64%z = this%point_64%z_64 * scalar
end function point_multiply_vct_scalar_64
type(point) function point_multiply_scalar_vct_64(scalar,this) ! for +
class(point),intent(in) :: this
real(real64), INTENT(IN) :: scalar
point_multiply_scalar_vct_64%x = this%point_64%x_64 * scalar
point_multiply_scalar_vct_64%y = this%point_64%y_64 * scalar
point_multiply_scalar_vct_64%z = this%point_64%z_64 * scalar
end function point_multiply_scalar_vct_64
type(point) function pointminus(this,b) ! for -
class(point),intent(in):: this, b
pointminus%x = this%x - b%x
pointminus%y = this%y - b%y
pointminus%z = this%z - b%z
end function pointminus
real function pointseparation(this,b) ! for .distance.
class(point),intent(in) :: this,b
pointseparation = sqrt( &
(this%x-b%x)**2+(this%y-b%y)**2+(this%z-b%z)**2)
end function pointseparation
subroutine absvec_real64(a,this) ! for = (distance
real(real64),intent(out) :: a ! from origin)
class(point),intent(in) :: this
a = sqrt(this%x**2+this%y**2+this%z**2)
end subroutine absvec_real64
subroutine absvec_real32(a,this) ! for = (distance
real(real32),intent(out) :: a ! from origin)
class(point),intent(in) :: this
a = sqrt(this%x**2 + this%y**2 + this%z**2)
end subroutine absvec_real32
real function vecotr_dot(this,b) ! for .distance.
class(point),intent(in) :: this,b
vecotr_dot = (this%x*b%x)+(this%y*b%y)+(this%z*b%z)
end function vecotr_dot
type(point) function vecotr_cros(this,b) ! for -
class(point),intent(in):: this, b
vecotr_cros%x = this%y * b%z - this%z * b%y
vecotr_cros%y = this%z * b%x - this%x * b%z
vecotr_cros%z = this%x * b%y - this%y * b%x
end function vecotr_cros
end module coords
```

So far I have not been able to resolve and understand these error messages. Could you maybe help me to accomplish this? I would be very grateful for any help.

Best regards,

fidu13