davidb
Joined: 17 Jul 2009 Posts: 560 Location: UK
|
Posted: Tue Jul 05, 2011 7:13 am Post subject: |
|
|
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.
Code: |
! 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. _________________ Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl |
|