How to write user-defined sources and scatter functions in Fortran