The TELEMAC-MASCARET system  trunk
declarations_waqtel.f
Go to the documentation of this file.
1 ! **********************************************
3 ! **********************************************
4 !
5 !
6 !***********************************************************************
7 ! WAQTEL V8P2
8 !***********************************************************************
9 !
10 !brief DECLARATION OF PRINCIPAL WAQTEL VARIABLES
11 !
12 !history R. ATA (EDF-LNHE)
13 !+
14 !+
15 !history M.JODEAU (EDF-LNHE)
16 !+ 08/2016
17 !+ V7P3
18 !+ AED2 coupling
19 !
20 !history S.E. BOURBAN (HRW)
21 !+ 07/06/2017
22 !+ V7P3
23 !+ Indexing tracer (IND_*) to avoid conflicting naming convention
24 !+ between user defined tracers, water quality processes and
25 !+ ice processes.
26 !
27 !history S.E. BOURBAN (HRW)
28 !+ 21/09/2017
29 !+ V7P3
30 !+ WAQPROCESS is now a prime number, so that multiple processes
31 !+ can be called by multiplication of the prime numbers.
32 !
33 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
34 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 !
36  USE bief_def
37 !
38 ! NOTE: THIS MODULE IS ORGANIZED IN 6 PARTS
39 !
40 ! (1) VECTORS (WILL BE DECLARED AS BIEF_OBJ STRUCTURES)
41 ! (2) INTEGERS
42 ! (3) LOGICAL VALUES
43 ! (4) REALS
44 ! (5) STRINGS
45 ! (6) ALIASES (IF NECESSARY)
46 !
47 !-----------------------------------------------------------------------
48 ! (1) VECTORS (REAL AND INTEGER)
49 !-----------------------------------------------------------------------
50 !
51 !
52 ! COEFFICIENT OF REAERATION
53 !
54  TYPE(bief_obj), TARGET :: k2
55 !
56 ! EFFECT OF SUNSHINE ON ALGAE GROWTH (BIOMASS PROCESS)
57 !
58  TYPE(bief_obj), TARGET :: rayeff
59 !-----------------------------------------------------------------------
60 !
61 ! 2) INTEGERS
62 !
63 !-----------------------------------------------------------------------
64 !
65 ! MAXIMUM NUMBER OF VALUES OF KEY-WORDS OF ONE KIND (INTEGER, LOGICAL, ETC.)
66 !
67  INTEGER, PARAMETER :: maxkey = 300
68 ! GRAPHIC PRINTOUT PERIOD WAQ
69 !
70  INTEGER leoprd
71 !
72 ! LISTING PRINTOUT PERIOD WAQ
73 !
74  INTEGER lisprd
75 !
76 ! MAXIMUM NUMBER OF OUTPUT VARIABLES
77 !
78  INTEGER, PARAMETER :: maxwqvar = 50
79 !
80 !-----------------------------------------------------------------------
81 !
82 ! WAQ PROCESS, A MULTPLICATIVE COMBINATION OF PRIME NUMBERS:
83 ! - 2: O2,
84 ! - 3: BIOMASS,
85 ! - 5: EUTRO,
86 ! - 7: MICROPOL,
87 ! - 11: THERMIC
88 ! - 13: AED2 LIBRARY
89 ! - 17: TRACER DEGRADATION
90 ! - 19: GHOST PROCESS IN WAITING FOR THE MERGE WITH ICE PROCESS
91 !
92  INTEGER waqprocess
93 !
94 ! TOTAL NUMBER OF TRACERS RELATED TO WAQPROCESS
95 ! AND THEIR ASSOCIATED INDICES
96 !
97  INTEGER waqtr
98  INTEGER ranktr(maxwqvar)
99 !
100 ! TOTAL NUMBER OF TRACERS RELATED TO INDIVIDUAL PROCESSES
101 ! AND THEIR ASSOCIATED INDICES
102 !
103  INTEGER, PARAMETER :: nwaq_oxygn = 3
104  INTEGER rank_oxygn(nwaq_oxygn)
105 !
106  INTEGER, PARAMETER :: nwaq_bioma = 5
107  INTEGER rank_bioma(nwaq_bioma)
108 !
109  INTEGER, PARAMETER :: nwaq_eutro = 8
110  INTEGER rank_eutro(nwaq_eutro)
111 !
112  INTEGER, PARAMETER :: nwaq_micro = 5
113  INTEGER rank_micro(nwaq_micro)
114 !
115  INTEGER, PARAMETER :: nwaq_therm = 1
116  INTEGER rank_therm(nwaq_therm)
117 !
118  INTEGER :: nwaq_aed2
119  INTEGER rank_aed2(maxwqvar)
120 !
121  INTEGER :: nwaq_degra
122  INTEGER rank_degra(maxwqvar)
123 !
124 ! TO KNOW IF A VARIABLE WILL BE EXITED ON FILE, ON LISTING
125 !
126  LOGICAL sorleo(maxwqvar),sorimp(maxwqvar)
127 !
128 ! WAQ RESULT FILE NUMBER
129 !
130  INTEGER waqres
131 !
132 ! WAQ BOUNDARY CONDITION FILE NUMBER
133 !
134  INTEGER waqcli
135 !
136 ! WAQ GEOMETRY FILE NUMBER
137 !
138  INTEGER waqgeo
139 !
140 ! WAQ HYDRODYNAMICS FILE NUMBER
141 !
142  INTEGER waqhyd
143 !
144 ! WAQ STEERING FILE NUMBER
145 !
146  INTEGER waqcas
147 !
148 ! WAQ REFERENCE FILE NUMBER
149 !
150  INTEGER waqref
151 !
152 ! DEBUGGER
153 !
154  INTEGER debug
155 !
156 ! FORMULA FOR COMPUTING K2
157 !
158  INTEGER formk2
159 !
160 ! FORMULA FOR COMPUTING RS
161 !
162  INTEGER formrs
163 !
164 ! FORMULA FOR COMPUTING CS
165 !
166  INTEGER formcs
167 !
168 ! COEFFICIENTS OF AERATION FORMULA
169 !
170  INTEGER cformaera(2)
171 !
172 ! ATMOSPHERE-WATER EXCHANGE MODEL
173 !
174  INTEGER atmosexch
175 !
176 ! NUMBER OF COEFFICIENTS TO CALIBRATE THE ATMOSPHERE-WATER EXCHANGE
177 ! MODEL IN 3D
178 !
179  INTEGER n_c_atmos
180 !
181 ! BRIGHTNESS OF THE SKY
182 !
183  INTEGER iskytype
184 !
185 ! METHOD OF COMPUTATION OF EXTINCTION OF SUN RAY
186 !
187  INTEGER mextinc
188 !
189 ! FORMULA OF ATMOSPHERIC RADIATION (GLM)
190 !
191  INTEGER iray_atm
192 !
193 ! LAW OF TRACERS DEGRADATION
194 !
195  INTEGER, ALLOCATABLE :: loitrac(:)
196 !
197 ! COEFFICIENT 1 FOR LAW OF TRACERS DEGRADATION
198 ! (1 IN CASE OF FUTURE LAW WITH MORE COEF.)
199  DOUBLE PRECISION, ALLOCATABLE :: coef1trac(:)
200 !
201 ! AED2 COUPLING
202 !
203  INTEGER nwqvars,nwqben,nwqdiags
204 !
205 !-----------------------------------------------------------------------
206 !
207 ! WATER QUALITY INDICES
208 ! (EVEN IF SOME ARE DUPLICATED IN TELEMAC)
209 !
210 ! TEMPERATURE
211  INTEGER ind_t
212 ! SALINITY
213  INTEGER ind_s
214 ! DISSOLVED O2
215  INTEGER ind_o2
216 ! ORGANIC LOAD
217  INTEGER ind_ol
218 ! NH4 LOAD
219  INTEGER ind_nh4
220 ! PHYTO BIOMASS
221  INTEGER ind_phy
222 ! DISSOLVED PO4
223  INTEGER ind_po4
224 ! POR NON ASSIM
225  INTEGER ind_por
226 ! DISSOLVED NO3
227  INTEGER ind_no3
228 ! NOR NON ASSIM
229  INTEGER ind_nor
230 ! SUSPENDED LOAD
231  INTEGER ind_ss
232 ! BED SEDIMENTS
233  INTEGER ind_sf
234 ! MICRO POLLUTANT
235  INTEGER ind_c
236 ! ABS. SUSP. LOAD.
237  INTEGER ind_css
238 ! ABSORB. BED SED.
239  INTEGER ind_csf
240 ! THIS COULD ACTUALLY BE AN ARRAY
241  INTEGER ind_aed2(maxwqvar)
242 !
243 !-----------------------------------------------------------------------
244 !
245 ! 3) LOGICAL
246 !
247 !-----------------------------------------------------------------------
248 !
249 ! IF YES, MASS-BALANCE
250 !
251  LOGICAL wqbilmas
252 !
253 ! IF YES, VALIDATION
254 !
255  LOGICAL wqvalid
256 !
257 ! STEADY HYDRODYNAMICS
258 !
259  LOGICAL perma
260 !
261 ! IF TEMPERATURE IS VARIABLE
262 !
263  LOGICAL yatemp
264 !
265 ! AED2 COUPLING
266 !
267  LOGICAL :: deja_sw
268  LOGICAL :: deja_ca
269 !
270 ! IF YES, SOLAR RADIATION IS READ IN THE ASCII ATMOSPHERIC DATA FILE
271 !
272  LOGICAL solradmeteo
273 !
274 !-----------------------------------------------------------------------
275 !
276 ! 4) REALS
277 !
278 !-----------------------------------------------------------------------
279 !
280 ! WATER DENSITY
281 !
282  DOUBLE PRECISION ro0 ! (RHO ZERO)
283 !
284 ! KINEMATIC VISCOSITY
285 !
286  DOUBLE PRECISION vce
287 
288 ! LONGITUDINAL DISPERSION
289 !
290  DOUBLE PRECISION ldisp
291 !
292 ! TRANSVERSAL DISPERSION
293 !
294  DOUBLE PRECISION tdisp
295 !
296 ! WATER QUALITY VARIABLES PCO2
297 !
298  DOUBLE PRECISION pco2
299 !
300 ! WATER QUALITY VARIABLES PVAP
301 !
302 ! DOUBLE PRECISION PVAP
303 !
304 ! WATER QUALITY VARIABLES RAY3
305 !
306 ! DOUBLE PRECISION RAY3
307 !
308 ! SOLAR RADIATION FOR AED2
309 !
310  TYPE(bief_obj), TARGET :: rayaed2
311 !
312 ! WATER QUALITY VARIABLES NEBU
313 !
314  DOUBLE PRECISION nebu
315 !
316 ! WATER QUALITY VARIABLES - RELATIVE HUMIDITY
317 !
318 ! DOUBLE PRECISION HREL
319 !
320 ! WATER QUALITY VARIABLES - RAINFALL
321 !
322  DOUBLE PRECISION rainfall
323 !
324 ! WATER QUALITY VARIABLES - AIR TEMPERATURE
325 !
326 ! TYPE(BIEF_OBJ), TARGET :: TAIR
327 !
328 ! WATER QUALITY VARIABLES - ???
329 !
330  TYPE(bief_obj), TARGET :: tdew
331 !
332 ! WATER QUALITY VARIABLES - ???
333 !
334  TYPE(bief_obj), TARGET :: visbi
335 !
336 ! VALUE OF THE AIR TEMPERATURE
337 !
338  DOUBLE PRECISION tair_value
339 !
340 ! WATER QUALITY VARIABLES ZSD (SECCHI LENGTH)
341 !
342  DOUBLE PRECISION zsd
343 !
344 ! WATER QUALITY VARIABLES EXTINC (LIGHT EXTINCTION COEFFICIENT)
345 !
346  DOUBLE PRECISION extinc
347 !
348 ! WATER QUALITY VARIABLES NWIND (IF CONSTANT WIND IN SPACE)
349 !
350  DOUBLE PRECISION nwind
351 !
352 ! WATER QUALITY VARIABLES C14_ATM
353 !
354  DOUBLE PRECISION c14_atm
355 !
356 ! WATER QUALITY VARIABLES HTO_ATM
357 !
358  DOUBLE PRECISION hto_atm
359 !
360 ! WEIR COEFFICIENT OF REAERATION
361 !
362  DOUBLE PRECISION rsw
363 !
364 ! COEFFICIENT TO CALIBRATE THE ATMOSPHERE-WATER EXCHANGE MODEL
365 !
366  DOUBLE PRECISION, TARGET :: c_atmos
367 !
368 ! WATER QUALITY VARIABLE: EVAPORATION
369 !
370  DOUBLE PRECISION evaporation
371 !
372 ! Water quality specific key-words
373 !
374 !
375 ! EUTRO PROCESS
376 !
377 !
378 ! CONSTANT OF DEGRADATION OF ORGANIC LOAD K120
379 !
380  DOUBLE PRECISION k120
381 !
382 ! CONSTANT OF NITRIFICATION KINETIC K520
383 !
384  DOUBLE PRECISION k520
385 !
386 ! O2 PRODUCED BY PHOTOSYNTHESIS (F FOR TRACER)
387 !
388  DOUBLE PRECISION o2photo
389 !
390 ! O2 CONSUMED BY NITRIFICATION (N FOR TRACER)
391 !
392  DOUBLE PRECISION o2nitri
393 !
394 ! BENTHIC DEMAND
395 !
396  DOUBLE PRECISION demben
397 !
398 ! COEFFICIENT A AND B USED IN RS FORMULA
399 !
400  DOUBLE PRECISION abrs(2)
401 !
402 ! O2 SATURATION DENSITY OF WATER (CS)
403 !
404  DOUBLE PRECISION o2satu
405 !
406 ! SEDIMENTATION VELOCITY OF ORGANIC PHOSPHORUS
407 !
408  DOUBLE PRECISION wpor
409 !
410 ! SEDIMENTATION VELOCITY OF ORGANIC NITROGEN
411 !
412  DOUBLE PRECISION wnor
413 !
414 ! MAXIMUM ALGAL GROWTH
415 !
416  DOUBLE PRECISION cmax
417 !
418 ! COEF VEGETAL TURBIDITY WITHOUT PHYTOPLANKTON
419 !
420  DOUBLE PRECISION kpe
421 !
422 ! PARAMETER OF CALIBRATION OF SMITH FORMULA
423 !
424  DOUBLE PRECISION ik
425 !
426 ! CONSTANT OF HALF-SATURATION WITH PHOSPHATE
427 !
428  DOUBLE PRECISION kp
429 !
430 ! CONSTANT OF HALF-SATURATION WITH PHOSPHA
431 !
432  DOUBLE PRECISION kn
433 !
434 ! ALGAL COEFF OF TOXICITY (ALPHA; ALPHA2)
435 !
436  DOUBLE PRECISION ctoxic(2)
437 !
438 ! RESPIRATION RATE OF ALGAL BIOMASS (RP)
439 !
440  DOUBLE PRECISION trespir
441 !
442 ! PROPORTION OF PHOSPHORUS WITHIN PHYTO CELLS (FP)
443 !
444  DOUBLE PRECISION prophoc
445 !
446 ! PERCENTAGE OF PHYSPHORUS ASSIMILABLE IN DEAD PHYTO
447 !
448  DOUBLE PRECISION dtp
449 !
450 ! RATE OF TRANSFORMATION OF POR INTO PO
451 !
452  DOUBLE PRECISION k320
453 !
454 ! PROPORTION OF NITROGEN WITHIN PHYTO CELLS (FN)
455 !
456  DOUBLE PRECISION pronitc
457 !
458 ! PERCENTAGE OF NITROGEN ASSIMILABLE IN DEAD PHYTO (DTN)
459 !
460  DOUBLE PRECISION pernits
461 !
462 ! RATE OF TRANSFORMATION OF NOR INTO NO3
463 !
464  DOUBLE PRECISION k360
465 !
466 ! COEF OF ALGAL MORTALITY (M1 AND M2)
467 !
468  DOUBLE PRECISION cmoralg(2)
469 !
470 ! SEDIMENTATION VELOCITY OF ORGANIC LOAD
471 !
472  DOUBLE PRECISION wlor
473 !
474 !
475 ! BIOMASS PROCESS
476 !
477 !
478 !
479 ! EFFECTS OF PHOSPHORIOUS AND NITROGENIOUS NUTRIMENTS ON ALGAE GROWTH
480 !
481 ! DOUBLE PRECISION LNUT
482 !
483 ! DENSITY OF SUNSHINE FLUX ON WATER SURFACE
484 !
485  DOUBLE PRECISION i0
486 !
487 !
488 ! O2 PROCESS
489 !
490 !
491 ! CONSTANT OF DEGRADATION OF ORGANIC LOAD K1
492 !
493  DOUBLE PRECISION k1
494 !
495 ! COEFFICIENT OF REAERATION K2 (if constant)
496 !
497  DOUBLE PRECISION k22
498 !
499 ! CONSTANT OF NITRIFICATION KINETIC K4
500 !
501  DOUBLE PRECISION k44
502 !
503 ! PHOTOSYNTHESIS P
504 !
505  DOUBLE PRECISION photo
506 !
507 ! VEGATAL RESPIRATION
508 !
509  DOUBLE PRECISION resp
510 !
511 ! WATER TEMPERATURE
512 !
513  DOUBLE PRECISION wattemp
514 !
515 !
516 ! MICROPOL PROCESS (MOSTLY COMMON WITH EUTRO)
517 !
518 !
519 ! EROSION RATE
520 !
521  DOUBLE PRECISION ero
522 !
523 ! SEDIMENTATION CRITICAL STRESS
524 !
525  DOUBLE PRECISION taus
526 !
527 ! CRITICAL STRESS OF RESUSPENSION
528 !
529  DOUBLE PRECISION taur
530 !
531 ! SEDIMENT SETTLING VELOCITY
532 !
533  DOUBLE PRECISION vitchu
534 !
535 ! COEFF OF DISTRIBUTION (KD)
536 !
537  DOUBLE PRECISION cdistrib
538 !
539 ! CONSTANT OF DESORPTION KINETIC (KDESORP)
540 !
541  DOUBLE PRECISION kdesorp
542 !
543 !
544 !
545 ! THERMIC PROCESS (COMMON VARIABLES WITH EXCHANGE_WITH_ATMOSPHERE MODULE)
546 !
547 !
548 ! WATER SPECIFIC HEAT
549 !
550  DOUBLE PRECISION, TARGET :: cp_eau
551 !
552 ! AIR SPECIFIC HEAT
553 !
554  DOUBLE PRECISION cp_air
555 !
556 ! COEFF OF CLOUDING RATE
557 !
558  DOUBLE PRECISION coef_k
559 !
560 ! COEFFICIENTS FOR CALIBRATING ATMOSPHERIC RADIATION
561 !
562  DOUBLE PRECISION ema
563 !
564 ! COEFFICIENTS FOR CALIBRATING FREE SURFACE RADIATION
565 !
566  DOUBLE PRECISION emi_eau
567 !
568 ! BOLTZMANN CONSTANT (wM-2K-4)
569 !
570  DOUBLE PRECISION, PARAMETER :: boltz=5.67d-8
571 !
572 ! CONVERSION SECOND TO DAYS
573 !
574  DOUBLE PRECISION, PARAMETER :: sectoday=1.d0/86400.d0
575 !
576 ! COEFFICIENTS OF RAERATION FORMULA
577 !
578  DOUBLE PRECISION cfaer(2)
579 !
580 !
581 ! MES PROCESS
582 !
583 !
584 ! EXPONENTIAL DESINTEGRATION CONSTANT (LAMBD)
585 !
586  DOUBLE PRECISION ccsedim
587 !
588 ! EVAPORATION
589 !
590  DOUBLE PRECISION evapor
591 !
592 !
593 ! AED2 PROCESS
594 !
595 !
596  DOUBLE PRECISION, ALLOCATABLE :: extcaed2(:,:),fluxaed2(:,:,:)
597 !
598 !-----------------------------------------------------------------------
599 !
600 ! 5) STRINGS
601 !
602 !-----------------------------------------------------------------------
603 !
604 ! TITLE OF STUDY
605 !
606  CHARACTER(LEN=72) titwaqcas
607 !
608 ! COPY OF SUBMIT STRINGS IN THE DICTIONARY
609 !
610  CHARACTER(LEN=PATH_LEN) submit(4,300)
611 
612 ! MAXIMUM OF LOGICAL UNITS NUMBERS
613 !
614  INTEGER, PARAMETER :: maxlu_waq = 14
615 !
616 ! BIEF_FILES STRUCTURES
617 !
618  TYPE(bief_file), TARGET :: waq_files(maxlu_waq)
619 !
620  SAVE
621 !
622  END MODULE declarations_waqtel
double precision cp_air
double precision nwind
double precision o2nitri
double precision, dimension(:,:), allocatable extcaed2
integer, dimension(:), allocatable loitrac
double precision pernits
integer, dimension(maxwqvar) rank_aed2
logical, dimension(maxwqvar) sorimp
double precision, dimension(2) ctoxic
integer, parameter maxwqvar
character(len=72) titwaqcas
integer, parameter maxkey
double precision ldisp
double precision vitchu
double precision o2satu
double precision kdesorp
integer, dimension(maxwqvar) ranktr
double precision tdisp
double precision extinc
integer, dimension(2) cformaera
integer, dimension(nwaq_therm) rank_therm
integer, dimension(maxwqvar) rank_degra
double precision c14_atm
double precision, dimension(:), allocatable coef1trac
type(bief_obj), target tdew
type(bief_obj), target visbi
integer, dimension(maxwqvar) ind_aed2
double precision emi_eau
double precision trespir
integer, dimension(nwaq_micro) rank_micro
double precision demben
double precision, dimension(:,:,:), allocatable fluxaed2
double precision, dimension(2) abrs
integer, parameter nwaq_bioma
double precision ccsedim
double precision coef_k
double precision evapor
double precision cdistrib
double precision, parameter sectoday
double precision prophoc
integer, parameter nwaq_therm
integer, parameter nwaq_eutro
double precision pronitc
double precision, dimension(2) cfaer
double precision rainfall
double precision, parameter boltz
type(bief_file), dimension(maxlu_waq), target waq_files
double precision, dimension(2) cmoralg
type(bief_obj), target k2
character(len=path_len), dimension(4, 300) submit
double precision, target cp_eau
double precision photo
double precision hto_atm
integer, dimension(nwaq_eutro) rank_eutro
integer, dimension(nwaq_bioma) rank_bioma
double precision evaporation
double precision, target c_atmos
double precision o2photo
integer, parameter nwaq_oxygn
type(bief_obj), target rayaed2
double precision tair_value
double precision wattemp
integer, parameter nwaq_micro
logical, dimension(maxwqvar) sorleo
integer, dimension(nwaq_oxygn) rank_oxygn
type(bief_obj), target rayeff
integer, parameter maxlu_waq