The TELEMAC-MASCARET system  trunk
bedload_calcdw.f
Go to the documentation of this file.
1 ! ***********************************
2  SUBROUTINE bedload_calcdw ! (_IMP_)
3 ! ***********************************
4 !
5  & (ucw, uw, tw, npoin, pi, uw1, uw2, tw1, tw2)
6 !
7 !***********************************************************************
8 ! SISYPHE V6P1 21/07/2011
9 !***********************************************************************
10 !
11 !brief COMPUTES QUADRATIC VELOCITIES AND PERIODS
12 !+ (CASE WITH WAVES).
13 !
14 !history C. VILLARET
15 !+ **/10/2003
16 !+ V5P4
17 !+
18 !
19 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
20 !+ 13/07/2010
21 !+ V6P0
22 !+ Translation of French comments within the FORTRAN sources into
23 !+ English comments
24 !
25 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
26 !+ 21/08/2010
27 !+ V6P0
28 !+ Creation of DOXYGEN tags for automated documentation and
29 !+ cross-referencing of the FORTRAN sources
30 !
31 !history C.VILLARET (EDF-LNHE), P.TASSI (EDF-LNHE)
32 !+ 19/07/2011
33 !+ V6P1
34 !+ Name of variables
35 !+
36 !
37 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38 !| NPOIN |-->| NUMBER OF POINTS
39 !| PI |-->| PI
40 !| TW |-->| WAVE PERIOD
41 !| TW1 |<->| MID WAVE PERIOD, CURRENT IN THE WAVE DIRECTION
42 !| TW2 |<->| MID WAVE PERIOD, CURRENT IN THE OPPOSITE DIRECTION
43 !| UCW |-->| CURRENT PROJECTED IN THE WAVE DIRECTION
44 !| UW |-->| ORBITAL WAVE VELOCITY
45 !| UW1 |<->| WORK ARRAY
46 !| UW2 |<->| WORK ARRAY
47 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 !
49  USE interface_sisyphe,ex_bedload_calcdw => bedload_calcdw
50  USE bief
52  IMPLICIT NONE
53 !
54 ! 2/ GLOBAL VARIABLES
55 !
56  TYPE(bief_obj), INTENT(IN) :: UCW, UW, TW
57  INTEGER, INTENT(IN) :: NPOIN
58  DOUBLE PRECISION, INTENT(IN) :: PI
59  TYPE(bief_obj), INTENT(INOUT) :: UW1, UW2, TW1, TW2
60 !
61 ! 3/ LOCAL VARIABLES
62 !
63  INTEGER :: I
64  DOUBLE PRECISION :: UCMOY, RAP
65  DOUBLE PRECISION :: ACOSMRAP, ACOSPRAP, SQRTRAP
66  DOUBLE PRECISION, PARAMETER :: ZERO = 1.d-06
67 !
68 !======================================================================!
69 !======================================================================!
70 ! PROGRAM !
71 !======================================================================!
72 !======================================================================!
73 !
74  DO i = 1,npoin
75  ucmoy = abs(ucw%R(i))
76  ! ****************** !
77  ! I - WAVES ONLY ! (_IMP_)
78  ! ****************** !
79  IF (ucmoy <= zero) THEN
80  uw1%R(i) = uw%R(i)
81  uw2%R(i) = uw%R(i)
82  tw1%R(i) = tw%R(i) / 2.d0
83  tw2%R(i) = tw%R(i) / 2.d0
84  ELSE
85  rap = uw%R(i) / ucmoy
86  ! ******************** !
87  ! II - WAVES ARE PREDOMINANT ! (_IMP_)
88  ! ******************** !
89  IF (rap > 1.d0) THEN
90  acosmrap = acos(-1.d0/rap)
91  acosprap = acos( 1.d0/rap)
92  sqrtrap = sqrt(1.d0-1.d0/rap**2)
93  tw1%R(i) = tw%R(i)*acosmrap / pi
94  tw2%R(i) = tw%R(i)*acosprap / pi
95  uw1%R(i) = 2.d0*ucmoy**2 + uw%R(i)**2
96  & + 3.d0*ucmoy*uw%R(i)*sqrtrap/acosmrap
97  uw1%R(i) = sqrt(uw1%R(i))
98  uw2%R(i) = 2.d0*ucmoy**2 + uw%R(i)**2
99  & - 3.d0*ucmoy*uw%R(i)*sqrtrap/acosprap
100  uw2%R(i) = sqrt(uw2%R(i))
101  ! ********************** !
102  ! III - CURRENTS ARE PREDOMINANT ! (_IMP_)
103  ! ********************** !
104  ELSE
105  uw1%R(i) = ucw%R(i)*sqrt(2.d0 + rap**2)
106  uw2%R(i) = zero
107  tw1%R(i) = tw%R(i)
108  tw2%R(i) = zero
109  ENDIF
110  ENDIF
111  ENDDO
112 !
113 !======================================================================!
114 !======================================================================!
115 !
116  RETURN
117  END SUBROUTINE bedload_calcdw
subroutine bedload_calcdw
Definition: bedload_calcdw.f:4
Definition: bief.f:3