The TELEMAC-MASCARET system  trunk
allblo.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE allblo
3 ! *****************
4 !
5  &( blo , nom )
6 !
7 !***********************************************************************
8 ! BIEF V7P3
9 !***********************************************************************
10 !
11 !brief ALLOCATES MEMORY FOR A BLOCK STRUCTURE.
12 !
13 !history J-M HERVOUET (LNH)
14 !+ 10/01/95
15 !+ V5P5
16 !+
17 !
18 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
19 !+ 13/07/2010
20 !+ V6P0
21 !+ Translation of French comments within the FORTRAN sources into
22 !+ English comments
23 !
24 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
25 !+ 21/08/2010
26 !+ V6P0
27 !+ Creation of DOXYGEN tags for automated documentation and
28 !+ cross-referencing of the FORTRAN sources
29 !
30 !history J-M HERVOUET (LNHE)
31 !+ 09/08/2011
32 !+ V6P25
33 !+ Maximum size BLO%MAXBLOCK increased from 128 to 256
34 !+
35 !history J-M HERVOUET (jubilado)
36 !+ 04/11/2016
37 !+ V7P3
38 !+ Allowing several successive allocations of the same BIEF_OBJ.
39 !
40 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
41 !| BLO |-->| THE BLOCK TO BE ALLOCATED
42 !| NOM |-->| FORTRAN NAME OF THIS BLOCK
43 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44 !
45  USE bief, ex_allblo => allblo
46 !
48  IMPLICIT NONE
49 !
50 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
51 !
52  TYPE(bief_obj) , INTENT(INOUT) :: BLO
53  CHARACTER(LEN=6), INTENT(IN) :: NOM
54 !
55 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
56 !
57  INTEGER I,ERR
58 !
59 !-----------------------------------------------------------------------
60 ! COMMON PART FOR ALL OBJECTS
61 !-----------------------------------------------------------------------
62 !
63 ! KEY OF THE OBJECT
64 !
65  blo%KEY = 123456
66 !
67 ! TYPE OF THE OBJECT
68 !
69  blo%TYPE = 4
70 !
71 ! Defines how the object was created
72 !
73  blo%FATHER = 'XXXXXX'
74 !
75 ! NAME OF THE OBJECT
76 !
77  blo%NAME = nom
78 !
79 !-----------------------------------------------------------------------
80 ! PART SPECIFIC TO BLOCKS
81 !-----------------------------------------------------------------------
82 !
83 ! NUMBER OF OBJECTS IN THE BLOCK
84 !
85  blo%N = 0
86 !
87 ! ALLOCATES THE POINTERS ARRAY ADR
88 !
89  blo%MAXBLOCK = 256
90  err=0
91  IF(.NOT.ASSOCIATED(blo%ADR)) THEN
92  ALLOCATE(blo%ADR(blo%MAXBLOCK),stat=err)
93  DO i=1,blo%MAXBLOCK
94  NULLIFY(blo%ADR(i)%P)
95  ENDDO
96  ENDIF
97 !
98 !-----------------------------------------------------------------------
99 !
100  IF(err.NE.0) THEN
101  WRITE(lu,20) nom,err
102 20 FORMAT(1x,'ERROR DURING ALLOCATION OF BLOCK: ',a6,/,1x,
103  & 'ERROR CODE: ',1i6)
104  CALL plante(1)
105  stop
106  ENDIF
107 !
108 !-----------------------------------------------------------------------
109 !
110  RETURN
111  END
subroutine allblo(BLO, NOM)
Definition: allblo.f:7
Definition: bief.f:3