The TELEMAC-MASCARET system  trunk
declarations_telemac.f
Go to the documentation of this file.
1 ! ***************************
3 ! ***************************
4 !
5 !
6 !***********************************************************************
7 ! BIEF
8 !***********************************************************************
9 !
10 !brief DECLARATIONS COMMON TO ALL PROGRAMS
11 !+
12 !history J-M HERVOUET (EDF LAB, LNHE)
13 !+ 09/05/2014
14 !+ V7P0
15 !+ Parameter MODASS added.
16 !
17 !history F. HUANG (CLARKSON U.) AND S.E. BOURBAN (HRW)
18 !+ 19/11/2016
19 !+ V7P3
20 !+ New modelling component added KHIONE
21 !
22 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
24 !
25  USE bief_def
26  IMPLICIT NONE
27 !----------------------------------------------------------------------
28 !
29 ! 1./ INTEGER VALUES TO DESCRIBE BOUNDARY CONDITIONS:
30 !
31 !
32 ! FOR THE BOUNDARY CONDITIONS FILE:
33 !
34 ! ENTRANCE: PRESCRIBED VALUES (SAVE VELOCITIES)
35  INTEGER, PARAMETER :: kent = 5
36 !
37 ! VELOCITY IMPOSED (INSTEAD OF DISCHARGE)
38  INTEGER, PARAMETER :: kentu = 6
39 !
40 ! FREE OUTPUT
41  INTEGER, PARAMETER :: ksort = 4
42 !
43 ! NO-SLIP CONDITION
44  INTEGER, PARAMETER :: kadh = 0
45 !
46 ! WALL WITH OR WITHOUT FRICTION
47  INTEGER, PARAMETER :: klog = 2
48 !
49 ! OPEN BOUNDARY WITH INCIDENT WAVE
50  INTEGER, PARAMETER :: kinc = 1
51 !
52 ! ESTEL-2D : FREE DRAINAGE
53  INTEGER, PARAMETER :: kdrain = 3
54 !
55 ! ESTEL-2D : MIXED CONDITION
56  INTEGER, PARAMETER :: kmix = 4
57 !
58 ! DEPENDING ON ALGORITHMS AND CASES, THESE VALUES WILL BE
59 ! TRANSFORMED INTO:
60 !
61 ! TECHNICAL BOUNDARY CONDITIONS
62 !
63 ! NEUMANN
64  INTEGER, PARAMETER :: kneu = 1
65 !
66 ! DIRICHLET
67  INTEGER, PARAMETER :: kdir = 2
68 !
69 ! DEGREE OF FREEDOM
70  INTEGER, PARAMETER :: kddl = 3
71 !
72 ! INCIDENT WAVE
73  INTEGER, PARAMETER :: kond = 4
74 !
75 !----------------------------------------------------------------------
76 !
77 ! 2./ INTEGER VALUES TO DESCRIBE ADVECTION SCHEMES:
78 !
79 ! NO ADVECTION
80  INTEGER, PARAMETER :: adv_void = 0
81 ! CHARACTERISTICS
82  INTEGER, PARAMETER :: adv_car = 1
83 ! SUPG
84  INTEGER, PARAMETER :: adv_sup = 2
85 ! LEO POSTMA
86  INTEGER, PARAMETER :: adv_lpo = 3
87 ! DISTRIBUTIVE N-SCHEME
88  INTEGER, PARAMETER :: adv_nsc = 4
89 ! DISTRIBUTIVE PSI SCHEME
90  INTEGER, PARAMETER :: adv_psi = 5
91 ! LEO POSTMA, EDGE-BASED FOR TIDAL FLATS
92  INTEGER, PARAMETER :: adv_lpo_tf = 13
93 ! DISTRIBUTIVE N SCHEME, EDGE-BASED FOR TIDAL FLATS
94  INTEGER, PARAMETER :: adv_nsc_tf = 14
95 ! DISTRIBUTIVE PSI SCHEME, EDGE-BASED FOR TIDAL FLATS
96  INTEGER, PARAMETER :: adv_psi_tf = 15
97 !
98 !-----------------------------------------------------------------------
99 !
100 ! 3./ CODE COUPLING
101 !
102  CHARACTER(LEN=PATH_LEN), TARGET :: coupling
103 !
104 ! 4./ NAME OF CURRENT CODE (SEE BIEF_OPEN_FILES AND CONFIG_CODE)
105 !
106  CHARACTER(LEN=24) :: namecode,nnamecode(6)
107 !
108 ! 5./ DIFFERENT WAYS OF SPLITTING PRISMS :
109 !
110 ! TO ENSURE MATCHING OF TETRAHEDRONS, FACES OF TRIANGLES ARE "SIGNED"
111 ! WITH 1 OR 2 DEPENDING OF THE GLOBAL NUMBERS OF THEIR POINTS, TAKEN IN
112 ! COUNTER-CLOCKWISE DIRECTION. A FACE 1 IN A TRIANGLE WILL BE 2 IN ITS
113 ! NEIGHBOUR AND THIS IS USED TO HAVE A CORRECT SPLITTING. THE SPLITTING
114 ! DEPENDING ON THE "SIGNS" OF THE 3 FACES IS GIVEN IN ARRAY TETRA.
115 !
116 !
117 ! TETRA(2,2,2,3,4)
118 !
119 ! FIRST 3 DIMENSIONS : TYPE OF FACE
120 ! 1 : CUT RECTANGLE BETWEEN LOW-LEFT AND HIGH-RIGHT
121 ! 2 : CUT RECTANGLE BETWEEN HIGH-LEFT AND LOW-RIGHT
122 !
123 ! 4TH DIMENSION : NUMBER OF TETRAHEDRON
124 ! 5TH DIMENSION : 4 POINTS OF THE TETRAHEDRON (IN LOCAL PRISM NUMBERING)
125 !
126 ! 1 1 2 SPLITTING
127 !
128 ! TETRA(1,1,2,1,1)= 1
129 ! TETRA(1,1,2,1,2)= 2
130 ! TETRA(1,1,2,1,3)= 3
131 ! TETRA(1,1,2,1,4)= 6
132 !
133 ! TETRA(1,1,2,2,1)= 4
134 ! TETRA(1,1,2,2,2)= 6
135 ! TETRA(1,1,2,2,3)= 5
136 ! TETRA(1,1,2,2,4)= 1
137 !
138 ! TETRA(1,1,2,3,1)= 5
139 ! TETRA(1,1,2,3,2)= 2
140 ! TETRA(1,1,2,3,3)= 1
141 ! TETRA(1,1,2,3,4)= 6
142 !
143 ! 2 1 1 SPLITTING
144 !
145 ! TETRA(2,1,1,1,1)= 1
146 ! TETRA(2,1,1,1,2)= 2
147 ! TETRA(2,1,1,1,3)= 3
148 ! TETRA(2,1,1,1,4)= 4
149 !
150 ! TETRA(2,1,1,2,1)= 4
151 ! TETRA(2,1,1,2,2)= 6
152 ! TETRA(2,1,1,2,3)= 5
153 ! TETRA(2,1,1,2,4)= 2
154 !
155 ! TETRA(2,1,1,3,1)= 6
156 ! TETRA(2,1,1,3,2)= 3
157 ! TETRA(2,1,1,3,3)= 2
158 ! TETRA(2,1,1,3,4)= 4
159 !
160 ! 1 2 1 SPLITTING
161 !
162 ! TETRA(1,2,1,1,1)= 1
163 ! TETRA(1,2,1,1,2)= 2
164 ! TETRA(1,2,1,1,3)= 3
165 ! TETRA(1,2,1,1,4)= 5
166 !
167 ! TETRA(1,2,1,2,1)= 4
168 ! TETRA(1,2,1,2,2)= 6
169 ! TETRA(1,2,1,2,3)= 5
170 ! TETRA(1,2,1,2,4)= 3
171 !
172 ! TETRA(1,2,1,3,1)= 4
173 ! TETRA(1,2,1,3,2)= 1
174 ! TETRA(1,2,1,3,3)= 3
175 ! TETRA(1,2,1,3,4)= 5
176 !
177 ! 2 2 1 SPLITTING
178 !
179 ! TETRA(2,2,1,1,1)= 1
180 ! TETRA(2,2,1,1,2)= 2
181 ! TETRA(2,2,1,1,3)= 3
182 ! TETRA(2,2,1,1,4)= 4
183 !
184 ! TETRA(2,2,1,2,1)= 4
185 ! TETRA(2,2,1,2,2)= 6
186 ! TETRA(2,2,1,2,3)= 5
187 ! TETRA(2,2,1,2,4)= 3
188 !
189 ! TETRA(2,2,1,3,1)= 5
190 ! TETRA(2,2,1,3,2)= 2
191 ! TETRA(2,2,1,3,3)= 4
192 ! TETRA(2,2,1,3,4)= 3
193 !
194 ! 1 2 2 SPLITTING
195 !
196 ! TETRA(1,2,2,1,1)= 1
197 ! TETRA(1,2,2,1,2)= 2
198 ! TETRA(1,2,2,1,3)= 3
199 ! TETRA(1,2,2,1,4)= 5
200 !
201 ! TETRA(1,2,2,2,1)= 4
202 ! TETRA(1,2,2,2,2)= 6
203 ! TETRA(1,2,2,2,3)= 5
204 ! TETRA(1,2,2,2,4)= 1
205 !
206 ! TETRA(1,2,2,3,1)= 6
207 ! TETRA(1,2,2,3,2)= 3
208 ! TETRA(1,2,2,3,3)= 5
209 ! TETRA(1,2,2,3,4)= 1
210 !
211 ! 2 1 2 SPLITTING
212 !
213 ! TETRA(2,1,2,1,1)= 1
214 ! TETRA(2,1,2,1,2)= 2
215 ! TETRA(2,1,2,1,3)= 3
216 ! TETRA(2,1,2,1,4)= 6
217 !
218 ! TETRA(2,1,2,2,1)= 4
219 ! TETRA(2,1,2,2,2)= 6
220 ! TETRA(2,1,2,2,3)= 5
221 ! TETRA(2,1,2,2,4)= 2
222 !
223 ! TETRA(2,1,2,3,1)= 4
224 ! TETRA(2,1,2,3,2)= 1
225 ! TETRA(2,1,2,3,3)= 6
226 ! TETRA(2,1,2,3,4)= 2
227 !
228 ! IMPORTANT : ON EACH LAYER THE BOTTOM TETRAHEDRONS MUST BE
229 ! TREATED FIRST, SO THAT IKLE SENT TO SUBROUTINE
230 ! VOISIN BE THE SAME AS WITH PRISMS OR TRIANGLES
231 ! FOR THE NELEM2 FIRST ELEMENTS.
232 ! CONSEQUENTLY THE FIRSt 3 POINTS OF TETRAHEDRON 1
233 ! ARE ALWAYS 1,2 AND 3.
234 !
235 ! TETRA : SEE EXPLANATIONS ABOVE, THE 0 CORRESPOND TO SITUATIONS
236 ! THAT NEVER HAPPEN (TETRA(1,1,1,... OR TETRA(2,2,2,...)
237  INTEGER :: tetra(2,2,2,3,4)
238  parameter( tetra = reshape( (/
239  & 0,1,1,1,1,1,1,0,0,4,4,4,4,4,4,0,0,6,4,5,5,4,6,0,
240  & 0,2,2,2,2,2,2,0,0,6,6,6,6,6,6,0,0,3,1,2,2,1,3,0,
241  & 0,3,3,3,3,3,3,0,0,5,5,5,5,5,5,0,0,2,3,4,1,6,5,0,
242  & 0,4,5,4,6,6,5,0,0,2,3,3,1,2,1,0,0,4,5,3,6,2,1,0
243  & /), shape=(/ 2,2,2,3,4 /) ) )
244 !
245 ! NUMBERING OF SEGMENTS IN A TETRAHEDRON
246 ! ISEGT(N,I) : POINT NUMBER I OF SEGMENT N. GIVES THE POINT IN
247 ! LOCAL NUMBERING
248 !
249  INTEGER :: isegt(6,2)
250  parameter( isegt = reshape( (/
251  & 1,2,3,1,2,3,2,3,1,4,4,4 /), shape=(/ 6,2 /) ) )
252 !
253 ! 6./ ASSEMBLY MODE
254 !
255 ! 1: FINITE ELEMENT ASSEMBLY IN PARALLEL DONE DIRECTLY ON
256 ! DOUBLE PRECISION VALUES
257 !
258 ! 2: FINITE ELEMENT ASSEMBLY IN PARALLEL DONE WITH INTEGERS TO AVOID
259 ! TRUNCATION ERRORS IN PARALLEL, DUE TO DIFFERENT ORDER OF
260 ! ADDITIONS OF MORE THAN 2 NUMBERS.
261 !
262 ! HERE INITIALISED AT 1, IN CASE NO KEYWORD IS DEDICATED TO THIS
263 ! PARAMETER
264 !
265  INTEGER :: modass = 1
266 !
267 ! SAVED VARIABLE
268 !
269  ! TODO: Init values in bief_ini
270  ! matvec
271  LOGICAL :: w_is_full = .false.
272  ! solve
273  TYPE(bief_obj) :: tbb
274  TYPE(bief_obj), TARGET :: bb,bx
275  LOGICAL :: first_solve = .true.
276  ! paraco
277  INTEGER :: paraco_msg_tag = 5000
278  ! paracoi
279  INTEGER :: paracoi_msg_tag = 5000
280  ! paracoi8
281  INTEGER :: paracoi8_msg_tag = 5000
282  ! cvtrvf_pos_2
283  LOGICAL :: deja_cpos2 = .false.
284  INTEGER, ALLOCATABLE :: indic_cpos2(:)
285  ! positive_depths
286  LOGICAL :: deja_pdept_eria = .false.
287  INTEGER, ALLOCATABLE :: indic_pdept_eria(:)
288  LOGICAL :: deja_pdept_nerd = .false.
289  INTEGER, ALLOCATABLE :: indic_pdept_nerd(:)
290  ! cvtrvf_pos
291  LOGICAL :: deja_cpos = .false.
292  INTEGER, ALLOCATABLE :: indic_cpos(:)
293  ! sd_solve_1
294 ! MANAGES THE SIZE OF ALLOCATABLE ARRAYS
295  INTEGER :: size_in = 0
296  INTEGER :: size_ip = 0
297  INTEGER :: size_isegip = 0
298  INTEGER :: size_iw1 = 0
299  INTEGER :: size_indtri = 0
300  INTEGER :: size_inx = 0
301  INTEGER :: size_ipx = 0
302  INTEGER :: size_ac = 0
303  INTEGER :: size_actri = 0
304  INTEGER :: size_isp = 0
305  INTEGER :: size_rsp = 0
306  INTEGER, ALLOCATABLE :: indtri_ss1(:),inx_ss1(:),ipx_ss1(:)
307  INTEGER, ALLOCATABLE :: in_ss1(:),ip_ss1(:),isp_ss1(:),iw1_ss1(:)
308  INTEGER, ALLOCATABLE :: isegip_ss1(:)
309  DOUBLE PRECISION, ALLOCATABLE :: ac_ss1(:),actri_ss1(:),rsp_ss1(:)
310  ! sd_solve_4
311  INTEGER, ALLOCATABLE :: gloseg4_ss4(:)
312  DOUBLE PRECISION, ALLOCATABLE :: xa_ss4(:),da_ss4(:)
313  DOUBLE PRECISION, ALLOCATABLE :: rhs_ss4(:),xinc_ss4(:)
314  INTEGER :: size_gloseg4 = 0
315  INTEGER :: size_da = 0
316  INTEGER :: size_xa = 0
317  INTEGER :: size_rhs = 0
318  INTEGER :: size_xinc = 0
319  ! pre4_mumps
320  INTEGER, ALLOCATABLE :: gloseg4_p4m(:)
321  DOUBLE PRECISION, ALLOCATABLE :: xa_p4m(:),da_p4m(:)
322  DOUBLE PRECISION, ALLOCATABLE :: rhs_p4m(:),xinc_p4m(:)
323  INTEGER :: size_gloseg4_p4m = 0
324  INTEGER :: size_da_p4m = 0
325  INTEGER :: size_xa_p4m = 0
326  INTEGER :: size_rhs_p4m = 0
327  INTEGER :: size_xinc_p4m = 0
328  ! charac
329  LOGICAL :: deja_charac = .false.
331  TYPE(bief_obj), TARGET :: t6weak,t7weak,shpwea
333  ! derive
334  LOGICAL :: deja_derive = .false.
335  LOGICAL :: deja_drogues_utimp = .false.
337 ! DEFINE VARIABLES THAT ARE USED IN ALGAE TRANSPORT
338 ! THESE ARE NECESSARY IF NFLOT_MAX IS TOO LARGE
339  LOGICAL :: init_alg = .true.
340  LOGICAL :: alg_dislodge = .false.
341  REAL :: secu_drogues = 1.0
342  INTEGER sizebuf2_d
343  DOUBLE PRECISION,DIMENSION(:) ,ALLOCATABLE::buff_1d_d
344  DOUBLE PRECISION,DIMENSION(:,:),ALLOCATABLE::buff_2d_d
345  INTEGER, DIMENSION(:), ALLOCATABLE :: buff_elt_i
346 ! VARIABLE FOR DROGUES OUTPUT
347  INTEGER iframe
348 !
349 ! 7./ CHECKING THE MESH
350 !
351 ! KEYWORD INITIALISED TO FALSE (MAY BE MODIFIED BY KEYWORDS)
352 !
353  LOGICAL :: check_mesh = .false.
354 !
355 !-----------------------------------------------------------------------
356 !
357  INTEGER :: gracjg_cnt = 0
358 
359  SAVE
360 !
361 !-----------------------------------------------------------------------
362 !
363  END MODULE declarations_telemac
integer, dimension(:), allocatable indic_cpos2
integer, dimension(:), allocatable isp_ss1
integer, parameter adv_nsc_tf
integer, dimension(:), allocatable inx_ss1
integer, dimension(:), allocatable gloseg4_ss4
integer, dimension(6, 2) isegt
integer, parameter adv_psi
double precision, dimension(:), allocatable rsp_ss1
integer, parameter adv_lpo
integer, parameter adv_sup
type(bief_obj), target t3weak
integer, parameter kadh
character(len=24), dimension(6) nnamecode
type(bief_obj), target shpwea
type(bief_obj), target shpbuf
integer, parameter kmix
integer, parameter kddl
integer, dimension(:), allocatable ip_ss1
integer, parameter kentu
double precision, dimension(:), allocatable da_p4m
double precision, dimension(:), allocatable da_ss4
double precision, dimension(:), allocatable ac_ss1
character(len=24) namecode
integer, parameter adv_void
double precision, dimension(:), allocatable actri_ss1
double precision, dimension(:,:), allocatable buff_2d_d
integer, dimension(:), allocatable indtri_ss1
double precision, dimension(:), allocatable rhs_ss4
integer, dimension(2, 2, 2, 3, 4) tetra
double precision, dimension(:), allocatable xinc_p4m
integer, dimension(:), allocatable iw1_ss1
integer, parameter kneu
integer, parameter adv_nsc
integer, parameter kent
double precision, dimension(:), allocatable xa_ss4
type(bief_obj), target t5weak
integer, parameter adv_psi_tf
type(bief_obj), target shzwea
type(bief_obj), target t7weak
type(bief_obj), target t2weak
integer, parameter kdir
integer, parameter kinc
integer, dimension(:), allocatable in_ss1
type(bief_obj), target t6weak
integer, parameter adv_lpo_tf
integer, parameter kdrain
double precision, dimension(:), allocatable rhs_p4m
type(bief_obj), target bx
type(bief_obj), target t1weak
integer, parameter adv_car
integer, dimension(:), allocatable isegip_ss1
double precision, dimension(:), allocatable xinc_ss4
integer, dimension(:), allocatable buff_elt_i
integer, dimension(:), allocatable ipx_ss1
double precision, dimension(:), allocatable xa_p4m
integer, dimension(:), allocatable indic_pdept_eria
integer, parameter kond
integer, dimension(:), allocatable indic_cpos
integer, dimension(:), allocatable indic_pdept_nerd
double precision, dimension(:), allocatable buff_1d_d
integer, dimension(:), allocatable gloseg4_p4m
integer, parameter klog
type(bief_obj), target bb
character(len=path_len), target coupling
type(bief_obj), target ftild_weak
integer, parameter ksort
type(bief_obj), target shzbuf
type(bief_obj), target t4weak