SAVE attribute in module



Dear Fortran Guru's,

I have a problem with a piece of code which may be summarized as follows:

MODULE somemodule

IMPLICIT NONE

TYPE sometype
INTEGER :: i
DOUBLE PRECISION, POINTER, DIMENSION(:,:) :: coef => NULL()
END TYPE sometype

TYPE(sometype) :: somevariable

CONTAINS

....
....
END MODULE somemodule


The problem I have is that on some compilers this compiles and runs perfectly fine whereas other compilers complain and say that the declaration:

TYPE(sometype) :: somevariable

should be:

TYPE(sometype), SAVE :: somevariable

To my (sometime limited) understanding of the fortran 95 standard module variables are "SAVE" by default! So I do not understand why a compiler would "demand" this. It seems that it is related to the NULLIFY statement in the type declaration. So I was wondering whether that might be something non-standard!?

So my main question is, how should the piece of code look in proper fortran 95 (f90, f2003, and/or f2008) standard. Is the compiler right to "demand" the save statement? Is the NULLIFY in the type allowed according to the standard or not?

Many thanks for any help you can give me on this topic!

Cheers,
Tim

---------------------
Destiny is not a matter of chance
.....it is a matter of choice
It is not something to be waited for
.....it is something to be achieved


.