Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!exodus-bb!khb From: khb@chiba.Eng.Sun.COM (Keith Bierman fpgroup) Newsgroups: comp.lang.fortran Subject: Re: Pointers in FORTRAN Message-ID: Date: 5 Feb 91 01:54:59 GMT References: <57829@eerie.acsu.Buffalo.EDU> Sender: news@exodus.Eng.Sun.COM Organization: Sun MegaSystems Lines: 36 In-reply-to: stein-c@acsu.buffalo.edu's message of 5 Feb 91 00:48:18 GMT Check out the examples (#4 seems apt) in the Reference Guide. The syntax and sematics are quite similar to Cray, so you could get by with their docs (I think). Here is what I did to your code: program readme pointer(pa, a) integer size ! you meant this, didn't you real a size=27*4 ! real is 4, not 8 bytes pa=malloc(size) call sub(a,3) ! we don't have a proper way to adjust shape here end subroutine sub(array,idim) ! generally array,maxi,maxj, maxk real array(idim,idim,idim) ! here we establish shape read(1,*)(((array(i,j,k),i=1,idim),j=1,idim),k=1,idim) write(2,*)(((array(i,j,k),i=1,idim),j=1,idim),k=1,idim) end and it runs diff fort.1 fort.2 returns silently .... the files match. -- ---------------------------------------------------------------- Keith H. Bierman kbierman@Eng.Sun.COM | khb@chiba.Eng.Sun.COM SMI 2550 Garcia 12-33 | (415 336 2648) Mountain View, CA 94043