GCC, the GNU Compiler Collection is probably best for compiling small programs.
For Windows read this
suggesting outdated MinGW.
Updated mingw-w64 requires 3rd party installer.
bin subfolder to system
To compile a Fortran code run
gfortran codefile -o binaryfile.
For debugging use GDB.
Instructions: compile your code using
-g option and then run
gdb --args binaryfile arguments,
start debugging with
break main followed by
s to go through your program step by step,
print variablename for variables and
q to exit.
Help for Fortran see here.