Re: Could this result in Array Distortion ??
 From: "robin" <robin_v@xxxxxxxxxxx>
 Date: Fri, 04 Dec 2009 12:39:46 GMT
"monir" <monirg@xxxxxxxxxxxx> wrote in message news:8ff694937eda4715b82f7d59a51a6748@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 Could someone please have a quick look at the following snippets of
 code and advise whether there is a potential problem.

 My concern is: (F77, g95)
 1) In main: variable Vx is declared as 3D array (10,10,30), and is
 passed as argument to Sub Splint3d().
 Sub Splint3d() sees the 3D Vx array as ya(k,m,n) of size
 (k=nP,m=nR,n=nT), where nP<=10, nR<=10, nT<=30.
 (I believe it would be correct if: nP=10, nR=10, nT<=30 ??)

 2) I'm also using similar arrangements with 2D arrays, and I suspect
 might be causing array distortions as well.

 3) For the 1D arrays Xg, Rg, Tg, there shouldn't be a problem
 resulting from k<=10, m<=10, n<=30

 Your help would be greatly appreciated.
 Monir


 Program main_1
 implicit double precision (ah,oz)
 Parameter (maxP=10, maxR=10, maxT=30)

 dimension Xg(maxP), Rg(maxR), Tg(maxT)
 dimension Vx(maxP,maxR,maxT)
 ! ......................................................
 call Splint3d( Xg, Rg, Tg,
 1 Vx,
 2 nP,nR,nT,
 3 P1,P2,P3,
 4 VxPm)
 ! ......................................................
 end program main_1

 ! ************************************************************
 Subroutine Splint3d( x1a, x2a, x3a,
 1 ya,
 2 k, m, n,
 3 x1, x2, x3,
 4 Z)
 ! ************************************************************
 implicit double precision (ah,oz)

 dimension x1a(k),x2a(m),x3a(n)
 dimension ya(k,m,n)
 ! ......................................................
 return
 end subroutine splint3d
This is generally OK as long as you don't read in or compute
any values for Vx in the main program.
All values for a 2D or 3D array must be computed and/or used
in subroutines or in functions.
(the declaration stays in the main program, of course.)
.
 References:
 Could this result in Array Distortion ??
 From: monir
 Could this result in Array Distortion ??
 Prev by Date: Re: Stack or Heap
 Next by Date: Re: Could this result in Array Distortion ??
 Previous by thread: Re: Could this result in Array Distortion ??
 Next by thread: Re: Could this result in Array Distortion ??
 Index(es):