In your first example the ::
is not needed and can be omitted. The general syntax is:
type-spec [ [,attr-spec]... :: ] entities
In your first case:
type-spec: real(8)
entities: a and b
The square brackets in the syntax definition mean that that part is optional. If however you specify an attr-spec
(like intent(in)
or parameter
), then the ::
is required. Specifically:
[ [, attr-spec] :: ]
means that the ::
is optional and attr-spec
is optional, but if you give and attr-spec
you MUST also give the ::
.
I suspect people just get into the habit of providing the ::
for every declaration.
In the example:
real :: a=4.5
The =4.5
forces a
to be SAVE
ed which may cover the second part of your question.