Have you considered OPTIONAL attribute?
Somehow I didn’t try that option. From a quick test it may work, but I really need to check with all possible cases. Basically within the subroutines I have operations of the form tmp = f(a, b) or tmp = f(a); I need to test if using optional :: y does the job without having to resort to if (present(y)) ... and then an if every time there is a function call, of two copies of the same code with just the function calls being different.
“containers” for procedure pointers is something you can consider
But that still requires me to define two different subroutines for fx and fxy, does it not? That wouldn’t make much of a difference.
@sblionel
Thank you for the explanation. Perhaps I am missing something, but given the TKR resolution, how does this example work?
INTERFACE GOOD5
SUBROUTINE S5A(X)
REAL :: X
END SUBROUTINE S5A
SUBROUTINE S5B(Y,X)
REAL :: Y,X
END SUBROUTINE S5B
END INTERFACE GOOD5
This can be called with good5(..., ...).