'Diagram of the routines used in the execution of a Fortran code

I am trying to modify a complex Fortran code for fluid dynamics written by many people which consists of many routines, subroutines, and functions. I wonder if there is an option in gdb or any other debugger or code that can generate a diagram of the routines called when the code is executed with a specific option. I am looking to generate a diagram like this or similar where I can see all the routines and subroutines that were called when executing Fortran the code, so I can have an idea about what routines to modify. enter image description here



Solution 1:[1]

Rather than use a debugger it would probably be more common to use the output of a profiler - Is it possible to get a graphical representation of gprof results? provides a few suggestions, and below is the output generated by using gprof and gprof2dot on one of my own little codes

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1