home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4694 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.9 KB  |  55 lines

  1. Newsgroups: comp.lang.fortran
  2. Path: sparky!uunet!netnews!bandy
  3. From: bandy@netnews.jhuapl.edu (Mike Bandy)
  4. Subject: Re: Need help with named common blocks
  5. Message-ID: <Bz9Hnp.E43@netnews.jhuapl.edu>
  6. Organization: JHU/Applied Physics Laboratory
  7. References: <jumper.724304615@fritz.catt.ncsu.edu>
  8. Distribution: comp
  9. Date: Mon, 14 Dec 1992 18:21:25 GMT
  10. Lines: 43
  11.  
  12. jumper@fritz.catt.ncsu.edu (Michael Lanham) writes:
  13.  
  14. >Hi,
  15.  
  16. >I need a moderate tutorial on named common blocks. Let me describe what I have
  17. >and then you can tell me how to think of it.
  18.  
  19. >I have several program src files.  In the file with the BLOCK DATA segment,
  20. >the COMMON block is named and shaped as follows:
  21.  
  22. >      IMPLICIT INTEGER (A-Z)
  23. >      COMMON/SHARE1/TABLE(1770),NOPU(54),FLHS(54),UNUSE0(122),
  24. >     -           XLATE(127),KWT1(50),KWT2(50),STACK1(50),STACK2(50),
  25. >     -           SYMBOL(8),VALUE(8),UNUSE5(16),CHAR(80),VALUXY(12),
  26. >     -           LISTX(61),INTERX(70),SYNTAB(2,26),CHARX(26),TAG(50),
  27. >     -           (50)
  28.  
  29.  
  30.  
  31. >In most of the other modules the common block share1 is entered the same way.
  32. >Now I found an additional SHARE1 that is different.
  33.  
  34. >      COMMON/SHARE1/NSVT(1000),OSVT(1000),
  35. >     -             OPND(3),LINE(133),UNUSE3(574),
  36. >     -             OUTTAB(50,4),SUPP(100,2),SYMBL(2),UNUSE2(18)
  37.  
  38. >Is an accurate way of thinking of SHARE1 is the first declaration plus the
  39. >second concatenated to the end of the second?  I need to know this so I can
  40. >correctly build my union in C to accurately reflect the SHARE1 structure.
  41.  
  42. Yes, if what you're saying is that both definitions occur in the same
  43. Fortran source module.
  44.  
  45. IMHO this is bad style.  Perhaps as you convert these, you can pull the
  46. definition out into a seperate file and INCLUDE it into each source
  47. file that needs to reference the block.  Now you're maintaining a
  48. single copy of the common block.
  49.  
  50. -- 
  51.  
  52.     Mike Bandy
  53.     bandy@aplcomm.jhuapl.edu
  54.     Johns Hopkins University / Applied Physics Lab
  55.