Silverfrost Forums

Welcome to our forums

Dimension declaration

4 Jul 2011 1:16 #8506

Please can anyone tell me the difference between declation using DIMENSION or just feclaring as INTEGER/REAL?

5 Jul 2011 6:13 #8513

Lets work with real variable (its the same with integers).

When you want arrays, you can use the dimension keyword. This can either be a dimension statement, or a dimension attribute. For example if you want an array of 10 values you declare it in different ways.

! Method 1. Using the dimension statement
real a
dimension a(10)

! Method 2. Using the dimension attribute (note :: is mandatory)
real, dimension(10) :: a

! Method 3. Getting by without dimension
real a(10)

There is no difference in behaviour in each case.

Please login to reply.