home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / fortran / 4881 < prev    next >
Encoding:
Internet Message Format  |  1992-12-31  |  1.5 KB

  1. Path: sparky!uunet!wupost!usc!cs.utexas.edu!rutgers!news.cs.indiana.edu!arizona.edu!hopey.telcom.arizona.edu!doug
  2. From: doug@hopey.telcom.arizona.edu (Doug Wellington USGS)
  3. Newsgroups: comp.lang.fortran
  4. Subject: SOLVED: Common block problem with MS-FORTRAN
  5. Message-ID: <31DEC199216134211@hopey.telcom.arizona.edu>
  6. Date: 31 Dec 92 23:13:00 GMT
  7. Distribution: world,local
  8. Organization: University of Arizona Telecommunications
  9. Lines: 19
  10. Nntp-Posting-Host: hopey.telcom.arizona.edu
  11. News-Software: VAX/VMS VNEWS 1.41
  12.  
  13. I solved the problem with the common block crossing the segment
  14. barrier by counting all of the bytes in all of the items in the
  15. common block and padding so that no variable actually lay "on top"
  16. of the end of the segment.
  17.  
  18. In this case, I had several arrays of CHARACTER and INTEGER that
  19. added up to a total of 44000 bytes.  Then I had an array of CHARACTER*30
  20. that took the total up to 74000.  (All of the arrays had 1000 elements.)
  21. 64K comes out to 65536 bytes, so I subtracted the 44000 from that which
  22. left 21536, then I divided by 30 (for each element in the CHARACTER*30).
  23. That gave me 717 with a remainder of 26. (Aha!)  That meant that the 718th
  24. element had 26 characters in the first segment and 4 in the second.  So
  25. the solution was to add one CHARACTER*26 in front of the whole array of
  26. CHARACTER*30, so that the 718th element actually started in the second
  27. segment.  Sheesh!
  28.  
  29. Thanks to everyone who replied.  I tossed the mail already, so I'm sorry
  30. I can't thank people by name, but you guys know who you are. Thanks again!
  31. -Doc
  32.