Marcelo Grafulha Vanti wrote:
>
> Dear users:
>
> If I have a array of pointers allocated like this:
>
> type P
> real,dimension(:),pointer :: PONT
> end type
>
> type (P),allocatable :: LISTA(:)
> ...
>
> allocate (LISTA(100))
> do i=1,100
> allocate (LISTA(i)%PONT(i))
> end do
>
> The question is: What is the correct way of DEALLOCATE the array
> "LISTA"?
>
> a) deallocate (LISTA)
>
> b) do i=1,100
> deallocate(LISTA(i)%PONT)
> end do
> deallocate LISTA
>
b) is OK
--
+-----------------------------------+-----------------------------+
| Pierre Hugonnet | mail....CGG |
| | 1, rue Leon Migaux |
| Seismic Data Processing R&D | 91341 MASSY cedex |
| | FRANCE |
| COMPAGNIE GENERALE DE GEOPHYSIQUE | phone...(33/0) 164 47 45 59 |
| Massy processing centre (France) | fax.....(33/0) 164 47 32 49 |
| http://www.cgg.com | [log in to unmask] |
+-----------------------------------+-----------------------------+
My opinions are not necessarily those of CGG
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|