I’ve started wrapping my fortran sph code, with the aim of being able to reuse a lot of code. In particular the second order spatial gradients code is long, and error prone. Python wrapping not only means I can use fast fortran for my real-time 3d fluids code, but it makes testing and verification that much easier. Plotting for fortran was a matter of spitting out ASCII files and writing a script to plot them. Somewhat ad-hoc, and either leading to the code being littered with commented out write statements, or multiple hardly ever used output files being written every run.
I’ve had to remove a lot of the more whizz-bang features, like derived types and assumed shape arrays from the argument lists of the subroutines I’ve ported, but a) this is only a subset of the code and b) it’s not hard to make these changes on neat, tidy, single purpose routines, which are the best candidates for wrapping and reuse in the first place.