HINTS - FDS programming hints and techniques.

Description:

The following information should help you use the F77 Debugging System (FDS) more effectively.

While still debugging your program, using ATCALL and NTCALL to put FDEBUG on the wrapup list is a very useful technique. If you do this, then when your program aborts you will be able to examine the state of the program when the error occurs. The Fortran error monitor tends to attempt to terminate the program normally even in the face of serious errors, so you may need to use NTCALL as well as ATCALL.

In batch it probably makes more sense to use FDUMP instead of FDEBUG.

C mainline
      external fdebug
      call atcall(fdebug)
      call ntcall(fdebug)

         <Body of program>

C  don't call FDEBUG if we finish properly
      call nocall(fdebug)
      stop

FDEBUG has no built in way to dump all or part of an array. It may be useful to include a short routine in your program to that takes an array argument and dumps it. You can then call this from FDEBUG to dump a vector. e.g.

subroutine dpreal(x,n)
real x(n)
write(6,*)x
stop
end

FDEBUG has no explicit command to set a break point on entering a subroutine or function. Experienced users make it a habit to give the first executable statement in every procedure a fixed label (say 1), and also to put a label on their RETURN statements. This doesn't affect the program, and gives allows them to inspect values on entry to or exit from the routine.

      subroutine p(x)
      real x,y
    1 y = x
        ...
 9999 return
      end

Copyright © 1996, Thinkage Ltd.