On 22-Sep-98 David R. Leal Valmana wrote:
>Hi,
>
>I have the following simplified code of my programs and
before to first
>executable command
>of my function I expect that my result variables(type var.
with pointers
>elements) are
>non-associated. It happen some times but it seems to be
randomly. I do
>not understand
>why it happens.
>
>function foo(x) result(f)
>real(kind=8),pointer :: f(:)
>!so at this point the result var. f should be
non-associated
As far as i understand the standard right, the pointer has
the status 'undefined' until any operation like
allocate,nullify or any pointer-assignment was done.
At the beginning of your program this is the case.
if you put in your allocation-routine a statement like
!!
nullify(A%ip) ! give the pointer a defined status
!!
everything works as expected.
>allocate(f(10))
>!now it is associated
>end function foo
>
>so in my code I have a similar situation and some times I
obtain that
>the pointer is associated
>at the beginning of the function.
>
>In my code I do not use the component "ip" but when I run
my code
>some time it is associated.
>
>Can some one say to me what I am doing wrong in my code?
>Thanks in advance,
>
>David
>
Olaf
>
>COMPILER: HP FORTRAN 90 compiler version 1.0
>compilation:
>f90 +check=all -o prueba4 prueba4.f90
>
>
>
>--
>David R. Leal Valmana | Office: 10.1.02
>Tel: (34)-916.24.93.14 | Fax: (34)-916.24.98.49
>E-mail : [log in to unmask] |
http://jupiter.uc3m.es/~david/
>Universidad Carlos III de Madrid | Dpto. de Estadistica y
Econometria
>
>
--
Olaf Michelsson mailto:[log in to unmask]
Faculty E/I Dept. of Theoretical Electrical Engineering
Technical University of Ilmenau, Germany
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|