×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with dimensioning arrays

Problem with dimensioning arrays

Problem with dimensioning arrays

(OP)
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.

RE: Problem with dimensioning arrays

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.

RE: Problem with dimensioning arrays

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close