home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / fortran / 4402 < prev    next >
Encoding:
Text File  |  1992-11-21  |  1.4 KB  |  32 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!gatech!hubcap!jtbell
  3. From: jtbell@hubcap.clemson.edu (Jon Bell)
  4. Subject: Re: Jumping from nested subroutine to main directly?
  5. Message-ID: <1992Nov22.030251.243@hubcap.clemson.edu>
  6. Organization: Presbyterian College, Clinton SC
  7. References: <DODD.92Nov21071326@mycenae.cchem.berkeley.edu> <By2xxC.JAB@mentor.cc.purdue.edu> <1992Nov21.222705.20726@monu6.cc.monash.edu.au>
  8. Date: Sun, 22 Nov 1992 03:02:51 GMT
  9. Lines: 21
  10.  
  11. In article <1992Nov21.222705.20726@monu6.cc.monash.edu.au> map@hal.maths.monash.edu.au (Michael Page) writes:
  12. >
  13. >(Which also prompts me to ask why the ENTRY statement is so frowned upon 
  14. >that it is now deprecated?  Is it superceded by something else?)
  15. >
  16. In situations where where several subroutines need to share the same data,
  17. I think it's considered better form to do one of the following:
  18.  
  19. (a) Pass the data to each subroutine explicitly, as arguments; or, if this is
  20. too clumsy or inefficient,
  21.  
  22. (b) Let the subroutines share the data via a well-documented COMMON block.
  23.  
  24. I understand that FORTRAN 90 allows you to group subroutines together into 
  25. "modules" which share the same data.
  26.  
  27. In situations where two subroutines share much of the same code, it's considered
  28. better form to split off the common code into a separate subroutine, or maybe
  29. put it in an INCLUDE file if your compiler allows it.
  30.  
  31. Jon Bell / Dept. of Physics & Comp. Sci. / Presbyterian College / Clinton SC USA
  32.