Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with dimensioning arrays

Status
Not open for further replies.

wein3967

Programmer
Jun 28, 2005
3
US
I have been given the task converting some Fortran 77 code and I am having problems understanding the way the arrays are dimensioned. I have some code like this:
Code:
IMPLICIT REAL*4(A-H,M,O-Z)
PARAMETER (NP = 2000, NL = 500, NSAMP = 1000)
PARAMETER (N1 = 400, N2 = 10)
DIMENSION PREPTB(NP),DENPTB(NP),TEMPTB(NP),SSPPTB(NP)
DIMENSION  X(0:N1,0:N2),  R(0:N1,0:N2)
To me, that says that arrays PREPTB, DENPTB, etc should contain 2000 elements (1-2000). I am not sure about the X and R arrays except that they are zero based.

When I run a debugger, I find that PREPTB, DENPTB, etc. are arrays going from 1 to 100, and X and R go from 0 to 99. Does anyone know what is going on with this? It has had me throughly confused for awhile. Thank you for your time.
 
X and R are 0:400, 0:10

Your assumption is correct.

Don't know which platform you're on so I can't comment on your debugger. At a guess, it lists the elements 100 at a time just in case the array size is 100000 - you may not want all of it so 100 is a good compromise.
 
xwb
Hmm, I think you may be right about it only showing me the first 100 elements. If I define NP as any number less then 100 it shows up correctly in the debugger. I am using the Abisoft fortran editior and the bundled Fx2 Debugger. I need to see if there is a way to force it to show all of the array elements. Thanks for your help.[thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top