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