home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / hp / 8619 < prev    next >
Encoding:
Internet Message Format  |  1992-07-28  |  2.2 KB

  1. Path: sparky!uunet!darwin.sura.net!mips!swrinde!sdd.hp.com!hpscdc!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!acmeyer
  2. From: acmeyer@hpfcso.FC.HP.COM (Alan C. Meyer)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: adjustable arrays 720's f77
  5. Message-ID: <7371177@hpfcso.FC.HP.COM>
  6. Date: 28 Jul 92 14:13:32 GMT
  7. References: <simon.712287118@giaeb>
  8. Organization: Hewlett-Packard, Fort Collins, CO, USA
  9. Lines: 59
  10.  
  11. In comp.sys.hp, simon@giaec.cc.monash.edu.au (simon shields) writes:
  12.  
  13. > I am having problems compiling fortran 77 programs I wrote on an 800
  14. > series that made use of adjustable arrays. I won't compile on the
  15. > 720's we have. 
  16. > The machine I'm using is
  17. > HP-UX giaec A.08.07 A 9000/720 2001133857
  18.  
  19.     ...
  20.  
  21. >       SUBROUTINE graph (coords, curves, fname)
  22. >       EXTERNAL fill the array
  23. >       INTEGER coords, curves
  24. >       LOGICAL fill the array
  25. >       CHARACTER fname*(*)
  26. > -->>> REAL xdra (coords,curves), ydra (coords, curves),tr(curves)
  27.  
  28. The arrays xdra, ydra and tr are *automatic* arrays, not adjustable arrays
  29. (automatics are local arrays of non-constant size, and adjustables are
  30. dummy arguments of non-constant size).
  31.  
  32. S800 Fortran supports automatic arrays, also calling them dynamic arrays.
  33. At 8.07, the S700 compiler does not support this feature.  However, they
  34. have been implemented and will ship with the next S700 release.
  35.  
  36. Until then, one workaround, which will involve changing the source, would
  37. be to use the Cray pointer feature to dynamically allocate the arrays.  So,
  38. change:
  39.  
  40.        SUBROUTINE graph (coords, curves, fname)
  41.        INTEGER coords, curves
  42.        REAL xdra (coords,curves), ydra (coords, curves),tr(curves)
  43.  
  44. to
  45.        SUBROUTINE graph (coords, curves, fname)
  46.        INTEGER coords, curves
  47.        POINTER (ipxdra, xdra(coords,curves))
  48.        POINTER (ipydra, ydra(coords,curves))
  49.        POINTER (iptr, tr(curves))
  50.  
  51.        ipxdra = MALLOC(coords*curves*4)
  52.        ipydra = MALLOC(coords*curves*4)
  53.        iptr = MALLOC(curves*4)
  54.  
  55.        ! reference xdra, ydra and tr as usual
  56.  
  57.        ...
  58.        FREE(ipxdra)
  59.        FREE(ipydra)
  60.        FREE(tr)
  61.        END
  62.  
  63. Alan Meyer
  64. Hewlett-Packard
  65. Colorado Language Lab
  66. acmeyer@fc.hp.com
  67.  
  68. "These are my own opinions ..."
  69.