Print

Print


Daniel Kidger writes:
 > >     REAL(DP), ALLOCATABLE, DIMENSION(:, :)  :: xxxx
 > >or
 > >     REAL(DP), DIMENSION(:, :)  , allocatable :: xxxx
 > Both are equivalent!

Yes.  As another poster mentioned, this is a question of style rather
than of language requirements.  I would hope that any book would
clearly distinguish personal style recommendations from language
requirements.  Even as style questions go, I'd find it unusually picky
to specify the order of attributes, though I suppose there is some
merit to adopting a somewhat consistent pattern so as to facilitate
visual scanning.

 > As an aside, I do not like the use of DIMENSION at all, (unless you have
 > several arrays that are to be the same shape and so it can save some typing)
 >
 > The style:
 >
 >      real,allocatable :: a(:,:), b(:), c(:)
 >
 > is also perfectly valid.

Agree.  This is the style that I use.

--
Richard Maine                |  Good judgment comes from experience;
[log in to unmask]   |  experience comes from bad judgment.
                             |        -- Mark Twain