[comp.sys.sgi] f77 question/space saver

knosp@umaxc.weeg.uiowa.edu (Boyd Knosp) (03/01/90)

Why do I get this error using f77 on a 4D120GTX:

	Program x

	Implicit None

	Structure  	/test/
		Character*80	text
	End Structure

	Record		/test/	Myvar
	Integer*4	I

	Myvar.text="(Hello)"
	I=Index(Myvar.text,")")
	
	End

%f77 x.f
Error on line 16 of x.f: bad argument type to intrinsic index

Note: 	The same thing happens with other intrinsic functions when I
	try to pass subrecords to them.  If I assign to a temp var 
	and pass the temp var to the fn instead, it compiles fine...

f77 creates huge exectuables.  I reduce size by linking with shared
libs and 'strip'ing the labels out of them (once they're debugged).
It is nice to note that the old unix dynamic memory allocation trick
for FORTRAN works with the SGI compiler.  Dynamically allocating large
arrays also reduces f77 execuatble size.  (I have the source code if
anyone has need for dynamically allocated FORTRAN arrays)

Randy Frank
University of Iowa Image Analysis Facility
randy@tessa.iaf.uiowa.edu

calvin@dinkum.sgi.com (Calvin H. Vu) (03/01/90)

In article <765@ns-mx.uiowa.edu> knosp@umaxc.weeg.uiowa.edu (Boyd Knosp) writes:


>Why do I get this error using f77 on a 4D120GTX:

>	Program x

>	Implicit None

>	Structure  	/test/
>		Character*80	text
>	End Structure

>	Record		/test/	Myvar
>	Integer*4	I

>	Myvar.text="(Hello)"
>	I=Index(Myvar.text,")")
>	
>	End

>%f77 x.f
>Error on line 16 of x.f: bad argument type to intrinsic index

>Note: 	The same thing happens with other intrinsic functions when I
>	try to pass subrecords to them.  If I assign to a temp var 
>	and pass the temp var to the fn instead, it compiles fine...
   There was a bug in the MIPS 1.31 release of the compiler regarding the
   use of record elements as arguments.   This has been fixed in the 
   MIPS 2.0 compiler which will be in our next release.

>f77 creates huge exectuables.  I reduce size by linking with shared
>libs and 'strip'ing the labels out of them (once they're debugged).
>It is nice to note that the old unix dynamic memory allocation trick
>for FORTRAN works with the SGI compiler.  Dynamically allocating large
>arrays also reduces f77 execuatble size.  (I have the source code if
>anyone has need for dynamically allocated FORTRAN arrays)
   In the next release, we will have POINTER type so you can associate
   a pointer to a dynamically-allocated array.  This will make dynamic
   array allocation much easier to do.

>Randy Frank
>University of Iowa Image Analysis Facility
>randy@tessa.iaf.uiowa.edu

Calvin Vu