Lahey Support
08-15-2003, 01:19 AM
As long as you dimension arrays singly, there is no tradeoff, actually
it will be even faster. If you have matrix calculations (inversions,
multiplications, etc.), take some time to linearize the subroutines
which perform these to use a single index for matrices and go right
ahead and dynamically allocate.
If subroutines take in the matrix as a formal argument (e.g SUBROUTINE
INVERT(A,N)), the dynamically allocated array can be doubly dimensioned
while the subroutine uses it as a singly dimensioned matrix.
The only way to make code fast with multiply dimensioned arrays is to
statically dimension them inside the code segment where they are used
and, to me, that is unacceptable.
Charles.
Regards
Charles H. Stoyer
President
Interpex Limited
www.interpex.com
Join the Interpex Geophysical Network (IXGN). It's an informative new
forum for the exchange of ideas between Earth Scientist. And best of all
it's free!.
Visit our WEB site at http://www.interpex.com/whatsnew.htm for more
information.
> -----Original Message-----
> From: Fortran Forum [address removed]
> Sent: Wednesday, August 12, 1998 3:29 PM
> To: [address removed]
> Subject: [LF] Structure question
>
> From: roger smith [address removed]
> To: [address removed] [address removed]
> Date: Monday, August 10, 1998 4:59 AM
> Subject: Re: structure question
>
>
> Forum Experts:
> I am setting about to convert some older code (not mine) to use
> F90 features and windows interfacing. The existing code has several
> subroutines in which all values are passed by formal parameters,
> including many large arrays. I am not sure why this was originally
> done, but it brings up an old question. It would be easier from a
> structure point of view to create modules for access of array values,
> but I wish to have some allocatable arrays in the revised code. What
> is the tradeoff in terms of computation speed for my various options?
> There have been some earlier discussions abour the slowness of code
> using allocatable arrays. What about the differences of formal
> parameter passing in comparison with module or common block access?
>
> Roger
>
>
> Roger E. Smith
> ARS-USDA
> AERC Foothills Campus
> Colorado State Univ.
> Fort Collins, CO 80523
> USA
> [address removed]
> 970-491-8263
> FAX 970-491-8247
>
it will be even faster. If you have matrix calculations (inversions,
multiplications, etc.), take some time to linearize the subroutines
which perform these to use a single index for matrices and go right
ahead and dynamically allocate.
If subroutines take in the matrix as a formal argument (e.g SUBROUTINE
INVERT(A,N)), the dynamically allocated array can be doubly dimensioned
while the subroutine uses it as a singly dimensioned matrix.
The only way to make code fast with multiply dimensioned arrays is to
statically dimension them inside the code segment where they are used
and, to me, that is unacceptable.
Charles.
Regards
Charles H. Stoyer
President
Interpex Limited
www.interpex.com
Join the Interpex Geophysical Network (IXGN). It's an informative new
forum for the exchange of ideas between Earth Scientist. And best of all
it's free!.
Visit our WEB site at http://www.interpex.com/whatsnew.htm for more
information.
> -----Original Message-----
> From: Fortran Forum [address removed]
> Sent: Wednesday, August 12, 1998 3:29 PM
> To: [address removed]
> Subject: [LF] Structure question
>
> From: roger smith [address removed]
> To: [address removed] [address removed]
> Date: Monday, August 10, 1998 4:59 AM
> Subject: Re: structure question
>
>
> Forum Experts:
> I am setting about to convert some older code (not mine) to use
> F90 features and windows interfacing. The existing code has several
> subroutines in which all values are passed by formal parameters,
> including many large arrays. I am not sure why this was originally
> done, but it brings up an old question. It would be easier from a
> structure point of view to create modules for access of array values,
> but I wish to have some allocatable arrays in the revised code. What
> is the tradeoff in terms of computation speed for my various options?
> There have been some earlier discussions abour the slowness of code
> using allocatable arrays. What about the differences of formal
> parameter passing in comparison with module or common block access?
>
> Roger
>
>
> Roger E. Smith
> ARS-USDA
> AERC Foothills Campus
> Colorado State Univ.
> Fort Collins, CO 80523
> USA
> [address removed]
> 970-491-8263
> FAX 970-491-8247
>