As you discovered, the syntax for declaring a procedure pointer declaration requires procedure([interface]), pointer [, ...] :: ... You have selected procedure(), pointer, nopass :: operator .
The consequence of procedure() is that you do not declare whether operator function or subroutine. There is nothing unpleasant about this, but more work remains to convince the compiler that you use links in sequence. Your compiler does not seem to believe you.
Instead of explaining in detail about the compiler you are thinking about, I will take a different approach.
You refer to the A%operator on an A type structure with this component as a result of the operate function. You say clearly by declaring this last function that its result is an integer.
Now, assuming that you do not want to do interesting things with type / type conversion in order to get to this integer result, we will assume that you always intend to use A%operator as a function with an integer result. This means that you can declare that the component of the procedure pointer is a function with an integer result.
This still leaves you a choice:
type type_A procedure(integer),pointer,nopass :: operator end type
- a function with an integer result and an implicit interface, and
type type_A procedure(add),pointer,nopass :: operator end type
is a function with an explicit interface corresponding to the add function.
Your current design options tell you the final decision.
As a final note, you are not using implicit none . This is important when we review your string.
external :: operator
If operator is a function, then (by implicit input rules) it has a real result (by default). So you want to go to one of the following
integer, external :: operator
or
procedure(integer) :: operator
or
procedure(add) :: operator
In conclusion, and I will repeat the comment of Vladimir F, think carefully about your design. Currently, you have restrictions on the operate link (as a result of the function and its arguments) that look like you really know that the component will have a specific interface. If you are sure about this, then use procedure(add) as the declaration /