The dbx debugger is very useful for tracking down errors in your code. Used by itself, dbx has a rather primitive user interface, and requires some practice to use. However, the initial effort in learning to use it is often repaid by the time it saves you finding programming errors. There is a fancier X-windows interface for AIX, invoked with the command xde, but I prefer the Gnu-emacs interface, discussed below.
The dbx debugger is able to track the execution of your program line-by-line in the source code (C or Fortran) and tell you the status of every variable you are computing. It is also possible to tell it to watch a particular variable and report when it changes. In order for the debugger to perform this trick, it is necessary to compile your code with a special option, so the compiled code contains information about the symbolic names of your variables and has the appropriate cross references to the source code.