home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / fortran / 4206 < prev    next >
Encoding:
Internet Message Format  |  1992-11-04  |  2.5 KB

  1. Path: sparky!uunet!ogicse!uwm.edu!cs.utexas.edu!hermes.chpc.utexas.edu!michael
  2. From: michael@chpc.utexas.edu (Michael Lemke)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: VAX FORTRAN COMMON block problem
  5. Message-ID: <1992Nov5.073450.1798@chpc.utexas.edu>
  6. Date: 5 Nov 92 07:34:50 GMT
  7. Article-I.D.: chpc.1992Nov5.073450.1798
  8. References: <1992Nov4.215456.9045@Princeton.EDU> <1992Nov4.231000.16114@doug.cae.wisc.edu>
  9. Organization: The University of Texas System - CHPC
  10. Lines: 48
  11.  
  12. In article <1992Nov4.231000.16114@doug.cae.wisc.edu> dafnioti@cae.wisc.edu (Petros Dafniotis) writes:
  13. >In article <1992Nov4.215456.9045@Princeton.EDU> mfterman@phoenix.Princeton.EDU (Mutant for Hire) writes:
  14. >>Here's the problem. I have the following set of lines in my code. This
  15. >>is the only common block in the entire program. These lines are repeated
  16. >>verbatim in every subroutine and in the main code.
  17. >>
  18. >>      real t0,ts,c1,c2
  19. >>      real e(-ks:ks,-ks:ks,-ks:ks)
  20. >>      real ei(-ks:ks,-ks:ks,-ks:ks)
  21. >>      real qqi(-ks:ks,-ks:ks,-ks:ks)
  22. >>      complex y(0:iter,-ks:ks,-ks:ks,-ks:ks,1:dimf)
  23. >>      common t0,ts,c1,c2,e,ei,qqi,y
  24. >
  25. >Martin,
  26. >  I cannot find (at first glance) anything wrong with your code; so I only
  27. >have three suggestions:
  28.  
  29. [1 and 2 deleted]
  30.  
  31. >3) you might want to use the debugger and set a watch point for your y
  32. >   variable that you know is messed up
  33.  
  34. I want to strongly recommend the debugger which is my favorite tool
  35. for spotting such problems.  The VAX debugger is not a toy like what
  36. you get in Unix but is an amazingly powerful tool.  Compile you code
  37. with
  38.  
  39.     $ for/noop/deb ....for
  40.     $ link/deb ....
  41.     $ run the_stuff
  42.  
  43. After a while noticably longer than usual you get the debugger prompt.
  44. Now press PF2 to get your code on the screen.  With KP0 (keypad 0) you
  45. can step through your code line by line.  PF1 KP0 will step into a
  46. subroutine when you are on a line that calls one; KP0 alone will step
  47. over it.  KP, runs the code without further interruption.  To do what
  48. dafnioti@cae.wisc.edu (Petros Dafniotis) suggests just enter SET WATCH Y
  49. <return> and press KP,.  However, if your code is compute intensive this
  50. will probably slow it down that much that you don't want to trace it
  51. this way.  SET WATCH Y(1,1,1,1,1) might help a little.  Unless it is a
  52. very complex code I usually spot the error just by following the code's
  53. logic with STEPs (KP0) and a couple EXAMINEs.  Also, make frequent use 
  54. of HELP (PF2 as always) to find out more.
  55.  
  56. -- 
  57. Michael Lemke
  58. Astronomy, UT Austin, Texas
  59. (michael@io.as.utexas.edu or UTSPAN::UTADNX::IO::MICHAEL [SPAN])
  60.