The TELEMAC-MASCARET system  trunk
reaer.f
Go to the documentation of this file.
1 ! ****************
2  SUBROUTINE reaer
3 ! ****************
4 !
5  &(formk2,k2,k22,npoin2,nplan,un,vn,h,eps)
6 !
7 !***********************************************************************
8 ! WAQTEL V8P1
9 !***********************************************************************
10 !
11 !brief COMPUTES THE COEFFICIENT OF REAERATION K2
12 !
13 !
14 !
15 !history R. ATA (LNHE)
16 !+ 02/09/2015
17 !+ V7P1
18 !+
19 !history R. ATA (LNHE)
20 !+ 22/02/2016
21 !+ V7P2
22 !+ ADD CONVERSION SEC TO DAY
23 !
24 !
25 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26 !| EPS |-->| TO AVOID DIVISION BY 0
27 !| FORMK2 |-->| WHICH FROMULA TO COMPUTE K2
28 !| H |-->| WATER DEPTH
29 !| K2 |<--| COEFFICIENT OF REAERATION
30 !| K22 |-->| COEFFICIENT OF REAERATION IF IT IS CONSTANT
31 !| NPLAN |-->| NUMBER OF VERTICAL LAYERS
32 !| NPOIN2 |-->| NUMBER OF MESH NODES OF THE SURFACE LAYER
33 !| UN,VN |-->| VELOCITY COMPONENTS
34 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 !
36  USE bief
39  USE interface_waqtel, ex_reaer => reaer
40 !
41  IMPLICIT NONE
42 !
43 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
44 !
45  INTEGER ,INTENT(IN ) :: FORMK2,NPOIN2,NPLAN
46  DOUBLE PRECISION ,INTENT(IN ) :: EPS,K22
47  TYPE(bief_obj) ,INTENT(IN ) :: H,UN,VN
48  TYPE(bief_obj) ,INTENT(INOUT) :: K2
49  INTRINSIC abs,sqrt,max
50 !
51 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
52 !
53 !
54 ! LOCAL VARIABLES
55  INTEGER I,J
56  DOUBLE PRECISION UNORM,PJ
57 !
58 !
59  IF(formk2.EQ.0)THEN ! ==> CONSTANT K2
60  CALL os('X=C ',x=k2,c=k22)
61  ELSE ! ==> VARIABLE K2
62  DO j =1,npoin2
63 !
64  i=(nplan-1)*npoin2+j
65  unorm = sqrt(un%R(i)**2+vn%R(i)**2) ! GENERALIZATION OF U IN 1D
66 ! HEAD OR WATER DEPTH TO REPLACE RH ?
67  pj = h%R(i) !ZF%R(I)+H%R(I)+UNORM**2/DEUXG
68 ! FORMULA OF THE TENESSEE VALLEY AUTHORITY
69  IF( formk2.EQ.1 ) THEN
70  k2%R(j) = 5.23d0*unorm* max(h%R(i),eps)**(-1.67d0)
71 ! FORMULA OF OWENS ET AL.
72  ELSEIF(formk2.EQ.2)THEN
73  k2%R(j) = 5.33d0*(unorm**0.67d0)*
74  & max(h%R(i),eps)**(-1.85d0)
75 ! FORMULA OF CHURCHILL ET AL.
76  ELSEIF(formk2.EQ.3)THEN
77  k2%R(j) = 0.746d0 * (unorm**2.695d0) /
78  & (max(h%R(i),eps)**3.085d0 *
79  & max(abs(pj),eps)**0.823d0) ! VERIFY THE FORMULA, SOME DOUBT ?
80 ! FORMULA OF O CONNOR & DOBBINS'
81  ELSEIF(formk2.EQ.4)THEN
82  k2%R(j) = (3.90d0 * unorm**0.5d0 ) /
83  & max(h%R(i),eps)**1.5d0
84 ! FORMULA OF ?? INVISIBLE MAN :) : IT SEEMS TO BE A COMBINATION OF THE 3 LAST FORMULA ?!
85  ELSEIF( formk2.EQ.5 ) THEN
86  IF( h%R(i).LE.0.6d0 ) THEN
87  k2%R(j) = 5.33d0 * (unorm**0.67d0) *
88  & max(h%R(i),eps)**(-1.85d0)
89  ELSEIF (h%R(i).LT.(12.d0*unorm-6.6d0)) THEN
90  k2%R(j) = 0.746d0*(unorm**2.695d0)/
91  & (max(h%R(i), eps)**3.085d0 *
92  & max(abs(pj),eps)**0.823d0)
93  ELSE
94  k2%R(j) = 3.90d0 * (unorm**0.5d0)/
95  & max(h%R(i),eps)**1.5d0
96  ENDIF
97  ELSE
98  WRITE(lu,111)formk2
99  CALL plante(1)
100  stop
101  ENDIF
102  ENDDO
103  ENDIF
104 !
105 ! CONVERT DAY TO SEC
106 !
107 ! CALL OS('X=CX ',X=K2,C=SECTODAY)
108 !
109 ! ERROR MESSAGES
110 !
111 !
112 111 FORMAT(1x,'REAR.F: K2 FORMULA :',i3,/,1x, 'NOT AVAILABLE')
113 !
114  RETURN
115  END
double precision, parameter sectoday
subroutine reaer(FORMK2, K2, K22, NPOIN2, NPLAN, UN, VN, H, EPS)
Definition: reaer.f:7
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
Definition: bief.f:3