I have two derived types in a module, Interval
and Inrset
. Both have same functionality, however one operates on reals, the other on integers.
The problem being encountered is as follows
lib/interval.f:85:11:
Procedure :: eptset => inrval_set
1
Error: Argument 't' of 'inrval_set' with PASS(t) at (1)
must be of the derived-type 'inrset'
lib/interval.f:55:11:
Procedure :: eptset => inrval_set
1
Error: Argument 't' of 'inrval_set' with PASS(t) at (1)
must be of the derived-type 'interval'
Here is the Interval
derived type
Type Interval
Real (Real32) :: inf, sup
Contains
Procedure :: eptset => inrval_set
End Type Interval
And this is is the Intrset
derived type
Type Inrset
Integer (Int32) :: inf, sup
Contains
Procedure :: eptset => inrval_set
End Type Inrset
This shall be the common subroutine for setting inf
and sup
.
Subroutine inrval_set &
( &
t, inf, sup &
)
Class (*), Intent (InOut) :: t
Class (*), Intent (In) :: inf, sup
!!$--------------------------------------------------
!!$ Sets t% inf = inf; t% sup = sup
Select Type (t)
Type Is (Interval)
Call numtrf (t% inf, inf)
Call numtrf (t% sup, sup)
Type Is (Inrset)
Call numtrf (t% inf, inf)
Call numtrf (t% sup, sup)
End Select
End Subroutine inrval_set