Fortran Wiki
Callbacks

Callbacks can be carried out using the transfer intrinsic to emulate C’s type casting.
See Advanced Fortran 90: Callbacks with the Transfer Function for details.

The transfer_ex program illustrates encoding a user-defined type in a character array.