home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / fortran / 3491 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  1.1 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!pedro
  2. From: pedro@eerc.berkeley.edu (Peter Clark)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Problem with WRITE for large arrays
  5. Date: 9 Sep 1992 18:59:12 GMT
  6. Organization: University of California, Berkeley
  7. Lines: 33
  8. Message-ID: <18lhi0INNf0@agate.berkeley.edu>
  9. NNTP-Posting-Host: jolt.eerc.berkeley.edu
  10.  
  11. Hi all,
  12.  
  13. I am having a problem writing out a large array of single precision
  14. numbers.  I am using SUN FORTRAN on a SUN4 running SUNOS4.1.1.
  15.  
  16. Here is some code:
  17.  
  18.      real*4 sdata(10000)
  19.      open(13,file='shimzdata',form='unformatted')
  20.  
  21.      write(13) (sdata(k),k=1,NPTS)
  22.  
  23. The problem is, if NPTS is greater than about 2000, the program
  24. crashes with this message:
  25.  
  26. *** Segmentation Violation = signal 11 code 3  
  27. Traceback has been recorded in file:
  28.      /tmp/./conv.trace 
  29. Note: Line numbers for system and library calls may be incorrect 
  30. IOT trap
  31.  
  32. When I try to write out the same data to the terminal with
  33.  
  34.     write(6,*) (sdata(k),k=1,NPTS)
  35.  
  36. there is no problem for NPTS as large as 10000.
  37.  
  38. What's going on here?
  39.  
  40. Thanks for any and all help or advice,   Peter Clark
  41.  
  42. pedro@eerc.berkeley.edu
  43.  
  44.