I am try to replicate some functionality from a C program and I don't quite understand how to do it in fortran. In pseudo code:
! in the main aplication we have: subroutine part_of_my_main_application() use myModule INTERFACE SUBROUTINE fred() IMPORT END SUBROUTINE fred END INTERFACE call mymodulesubroutine_set_callback(fred) !do other stuff end subroutine part_of_my_main_application subroutine fred() !also part of my main app !do stuff end subroutine fred
In a routine within 'mymodule' I would like to call the subroutine that is defined by the last call to mymodulesubroutime_set_callback. Further, it would be nice if possible to be able to check if the call back has been set before try to do it. I guess setting a dummycallback in the modukle initialisation routine would be a workaround.
I am sure this is quite simple when you know the necessary syntax to set up mymodulesubroutine_set_callback and the caller routine for what is set! Help Please!