The TELEMAC-MASCARET system  trunk
calcqb.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE calcqb
3 ! *****************
4 !
5  &(q1,q2,q3)
6 !
7 !***********************************************************************
8 ! ARTEMIS V6P1 21/08/2010
9 !***********************************************************************
10 !
11 !brief COMPUTES THE SQUARE ROOT OF THE TRANSCENDENT EQUATION
12 !+ IN QB, WHICH IS THE RATE OF BREAKING OR BROKEN WAVES.
13 !+
14 !
15 !history D. AELBRECHT (LNH)
16 !+ 04/06/1999
17 !+ V5P1
18 !+
19 !
20 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
21 !+ 13/07/2010
22 !+ V6P0
23 !+ Translation of French comments within the FORTRAN sources into
24 !+ English comments
25 !
26 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
27 !+ 21/08/2010
28 !+ V6P0
29 !+ Creation of DOXYGEN tags for automated documentation and
30 !+ cross-referencing of the FORTRAN sources
31 !
32 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 !| Q1 |-->| INITIAL LEFT EXTREMITY OF THE SEGMENT
34 !| Q2 |-->| INITIAL RIGTH EXTREMITY OF THE SEGMENT
35 !| Q3 |<--| APPROXIMATION FOR QB
36 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37 !
38  IMPLICIT NONE
39 !
40  DOUBLE PRECISION Q1,Q2,Q3,FQ1,FQ2,FQ3,EPSIQB,RAP
41 !
42  epsiqb = 1.d-4
43  rap = q2
44 !
45  IF(q2.GE.1.d0) THEN
46  q3 = 1.d0
47  ELSE
48  fq3 = 1000.d0
49 !
50 ! 10 FQ1 = (1.D0-Q1)+RAP*LOG(Q1)
51  10 fq1 = (1.d0-q1)+rap*log(abs(q1))
52  fq2 = (1.d0-q2)+rap*log(abs(q2))
53 ! FQ2 = (1.D0-Q2)+RAP*LOG(Q2)
54  IF (fq1.GE.0.d0) THEN
55  q3 = q1
56  fq3 = epsiqb/10.d0
57  ELSE
58  q3 = q1 - fq1*(q2-q1)/(fq2-fq1)
59  fq3 = (1.d0-q3)+rap*log(abs(q3))
60 ! FQ3 = (1.D0-Q3)+RAP*LOG(Q3)
61  IF ((fq3*fq1).GT.0.d0) THEN
62  q1 = q3
63  ELSE
64  q2 = q3
65  ENDIF
66  ENDIF
67  IF(abs(fq3).GE.epsiqb) GOTO 10
68 !
69  ENDIF
70 !
71 !-----------------------------------------------------------------------
72 !
73  RETURN
74  END
double precision function q3(I, TIME, ENTET)
Definition: q3.f:7
subroutine calcqb(Q1, Q2, Q3)
Definition: calcqb.f:7