home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4714 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  1.3 KB

  1. Path: sparky!uunet!spool.mu.edu!wupost!waikato.ac.nz!comp.vuw.ac.nz!grace.cri.nz!steve
  2. Newsgroups: comp.lang.fortran
  3. Subject: Re: Need help with named common blocks
  4. Message-ID: <STEVE.92Dec15210437@tara.grace.cri.nz>
  5. From: steve@grace.cri.nz (Stephen White)
  6. Date: 15 Dec 92 21:04:37
  7. Sender: news@grace.cri.nz
  8. References: <jumper.724304615@fritz.catt.ncsu.edu><1992Dec13.211623.1@slacvx.slac.stanford.edu>
  9. Distribution: comp
  10. Organization: Dept. of Scientific and Industrial Research, NZ.
  11. In-Reply-To: fairfield@slacvx.slac.stanford.edu's message of Mon, 14 Dec 1992 05:16:23 GMT
  12. Lines: 26
  13.  
  14. Things seem to be getting a little confused on this topic. It was not clear in
  15. the original posting if the situation was 
  16.  
  17.      SUBROUTINE A
  18.     COMMON /SHAR1/ This, That, Somthing, Else(100)
  19.     COMMON /SHAR1/ And, A, Little, More
  20.  
  21.     This is quite legal and equivalent to 
  22.  
  23.     COMMON /SHAR1/ This, That, Somthing, Else(100),
  24.        $      And, A, Little, More
  25.  
  26.     While 
  27.  
  28.     SUBROUTINE A
  29.     COMMON /SHAR1/ This, That, Somthing, Else(100)
  30.  
  31.     SUBROUTINE B
  32.     COMMON /SHAR1/ And, A, Little, More
  33.  
  34.     is also common (although perhaps not wise) and provides a mechanism 
  35. for shareing storage between two routines (perhaps as a large work area).
  36. Many compilers will warn you that you have common blocks of different lengths
  37. if they are in the same file.
  38.  
  39. Steve White
  40.