The TELEMAC-MASCARET system
trunk
sources
utils
bief
deallblo.f
Go to the documentation of this file.
1
! *****************
2
SUBROUTINE
deallblo
3
! *****************
4
!
5
&( blo )
6
!
7
!***********************************************************************
8
! BIEF V6P3
9
!***********************************************************************
10
!
11
!brief DEALLOCATES MEMORY FOR A BLOCK STRUCTURE.
12
!
13
!history Y AUDOUIN (LNHE)
14
!+ 25/05/2015
15
!+ V7P0
16
!+
17
!
18
!history S.E.BOURBAN (HRW)
19
!+ 20/01/2017
20
!+ V7P4
21
!+ DEALLOCATION of a pointer switched to a NULLIFY statement
22
!
23
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24
!| BLO |-->| THE BLOCK TO BE DEALLOCATED
25
!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
!
27
USE
bief
28
!
29
USE
declarations_special
30
IMPLICIT NONE
31
!
32
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33
!
34
TYPE
(bief_obj) ,
INTENT(INOUT)
:: BLO
35
!
36
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
37
!
38
INTEGER
I,J
39
!
40
!-----------------------------------------------------------------------
41
!
42
! If the block contains nothing ... do nothing
43
IF
(blo%N.GT.0)
THEN
44
DO
i=1,blo%N
45
IF
(
ASSOCIATED
(blo%ADR(i)%P))
THEN
46
IF
(blo%ADR(i)%P%FATHER.EQ.blo%NAME)
THEN
47
IF
(blo%ADR(i)%P%TYPE.EQ.4)
THEN
48
! Not deallocating element in the block as they should
49
! point on block from a higher level that will be
50
! deallocatted later
51
DO
j=1,blo%ADR(i)%P%N
52
NULLIFY
(blo%ADR(i)%P%ADR(j)%P)
53
ENDDO
54
DEALLOCATE
(blo%ADR(i)%P%ADR)
55
NULLIFY
(blo%ADR(i)%P%ADR)
56
ELSE
IF
(blo%ADR(i)%P%TYPE.EQ.2)
THEN
57
CALL
bief_deallvec
(blo%ADR(i)%P)
58
ELSE
IF
(blo%ADR(i)%P%TYPE.EQ.3)
THEN
59
CALL
bief_deallmat
(blo%ADR(i)%P)
60
ELSE
61
WRITE
(
lu
,*)
'UNKNOWN BIEF_OBJ TYPE'
62
WRITE
(
lu
,*)
'FOR OBJECT NAMED: '
,blo%ADR(i)%P%NAME
63
WRITE
(
lu
,*)
'OF TYPE: '
,blo%ADR(i)%P%TYPE
64
CALL
plante(1)
65
stop
66
ENDIF
67
DEALLOCATE
(blo%ADR(i)%P)
68
NULLIFY
(blo%ADR(i)%P)
69
ENDIF
70
NULLIFY
(blo%ADR(i)%P)
71
ENDIF
72
ENDDO
73
ENDIF
74
DEALLOCATE
(blo%ADR)
75
NULLIFY
(blo%ADR)
76
!
77
!-----------------------------------------------------------------------
78
!
79
RETURN
80
END
declarations_special
Definition:
declarations_special.F:3
bief_deallmat
subroutine bief_deallmat(MAT)
Definition:
bief_deallmat.f:7
declarations_special::lu
integer lu
Definition:
declarations_special.F:45
bief_deallvec
subroutine bief_deallvec(VEC)
Definition:
bief_deallvec.f:7
deallblo
subroutine deallblo(BLO)
Definition:
deallblo.f:7
bief
Definition:
bief.f:3