SAVE attribute in module
- From: "news.solani.org" <springinhetveld@xxxxxxxxxx>
- Date: Wed, 6 Jun 2012 09:59:29 +0200
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
.
- Follow-Ups:
- Re: SAVE attribute in module
- From: Richard Maine
- Re: SAVE attribute in module
- From: Wolfgang Kilian
- Re: SAVE attribute in module
- Prev by Date: Re: Ill-conditioning of sine and cosine
- Next by Date: Re: An object based fortran 2003 / 2008 interface to gnuplot developed in CBFortran
- Previous by thread: Ill-conditioning of sine and cosine
- Next by thread: Re: SAVE attribute in module
- Index(es):