Great project! There was also a request from @rouson to add this to fpm. See here: Option to output module dependency tree · Issue #687 · fortran-lang/fpm · GitHub
I have made a similar prototype in a private branch. I used it to plot the fpm module dependencies:
I think I used the neato or fdp layout engine to draw this. One recognizes leaf modules, which typically fulfill concrete tasks. And then you have this inner highly inter-connected part of all the abstract model stuff. There are probably a couple fake dependencies in there too. A hierarchical view can be found here: Option to output module dependency tree · Issue #687 · fortran-lang/fpm · GitHub
I’ll surely take a closer look at fpm-modules to see if there is anything I could borrow for fpm-deps (discussed here previously - Dependency graph for FORD). Vice-versa, I think having a Graphviz option in fpm-modules would be nice. You can find an example here: fpm-deps/app/fpm-deps/fpm-deps.f90 at 2fa1ee77ae78c4b0d4b67d92da4b9a62ad6557ab · ivan-pi/fpm-deps · GitHub
(ps: if you install fpm-modules
in a place on the PATH, it can be invoked as fpm modules
due to the fpm wrapper machinery)
Edit: another very useful feature would be to allow drawing these graphs from a list of source files (for non fpm-based projects).