The TELEMAC-MASCARET system  trunk
bedload_effpnt_gaia.f
Go to the documentation of this file.
1 ! ******************************
2  SUBROUTINE bedload_effpnt_gaia
3 ! ******************************
4 !
5  & (maskel,liqbor,s,zf,npoin,nptfr,ielmt,kent,
6  & beta,pi,msk,mesh,dzfdx,dzfdy,cteta,steta,
7  & coef,calfa,salfa,slopeff,phised,devia,beta2,
8  & tob,xmvs,xmve,dcla,grav,unsv2d)
9 !
10 !***********************************************************************
11 ! GAIA
12 !***********************************************************************
13 !
15 !
16 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
51 !
52  USE interface_gaia,ex_bedload_effpnt => bedload_effpnt_gaia
53  USE bief
55  IMPLICIT NONE
56 !
57 ! GLOBAL VARIABLES
58  TYPE(bief_obj), INTENT(IN) :: MASKEL,LIQBOR,S,UNSV2D
59  TYPE(bief_obj), INTENT(IN) :: ZF, TOB
60  INTEGER, INTENT(IN) :: NPOIN, NPTFR, IELMT, KENT
61  INTEGER, INTENT(IN) :: SLOPEFF,DEVIA
62  DOUBLE PRECISION, INTENT(IN) :: BETA, PI, PHISED, BETA2
63  DOUBLE PRECISION, INTENT(IN) :: XMVS, XMVE, GRAV, DCLA
64  LOGICAL, INTENT(IN) :: MSK
65  TYPE(bief_mesh), INTENT(INOUT) :: MESH
66  TYPE(bief_obj), INTENT(INOUT) :: DZFDX, DZFDY
67  TYPE(bief_obj), INTENT(INOUT) :: CTETA,STETA
68  TYPE(bief_obj), INTENT(INOUT) :: COEF, CALFA, SALFA
69 !
70 ! LOCAL VARIABLES
71  INTEGER :: I, K
72  DOUBLE PRECISION :: C,ZETA,C1,CALPHA,SALPHA,AA,BB
73  DOUBLE PRECISION :: CPSI,SPSI,DZF,TANPHI,CZETA,SZETA,SURBETA2
74  DOUBLE PRECISION :: NORM,TT1
75 !
76 !======================================================================!
77 !======================================================================!
78 ! PROGRAM !
79 !======================================================================!
80 !======================================================================!
81 !
82 !
83 ! NOTE JMH : IF WE SWAP THE DEVIA AND THE SLOPEFF ACTIONS BELOW
84 ! IT IS PROBABLY NOT USEFUL TO DO A COPY OF CALFA AND SALFA ?
85 !
86 ! COS AND SIN TETA (CALFA AND SALFA HAVE ALREADY BEEN COMPUTED
87 ! IN BEDLOAD_SOLIDISCHARGE_GAIA, SO JUST A COPY HERE)
88 ! TETA = ANGLE OF THE FLOW WITH OX
89 !
90  CALL os('X=Y ',x=cteta,y=calfa)
91  CALL os('X=Y ',x=steta,y=salfa)
92 !
93 !----------------------------------------------------------------------
94 !
95 ! COMPUTES THE SLOPE : D(ZF)/DX ET D(ZF)/DY (AT THE NODES)
96 !
97  CALL vector(dzfdx, '=', 'GRADF X',ielmt,1.d0,zf,s,s,
98  & s,s,s,mesh,msk,maskel)
99  CALL vector(dzfdy, '=', 'GRADF Y',ielmt,1.d0,zf,s,s,
100  & s,s,s,mesh,msk,maskel)
101 !
102  IF(ncsize.GT.1) THEN
103  CALL parcom(dzfdx,2,mesh)
104  CALL parcom(dzfdy,2,mesh)
105  ENDIF
106 !
107  CALL os('X=XY ',x=dzfdx,y=unsv2d)
108  CALL os('X=XY ',x=dzfdy,y=unsv2d)
109 !
110 !======================================================================
111 !
112 ! COMPUTES THE SOLID TRANSPORT ANGLE ALFA = TETA + DEVIATION
113 !
114 ! 1 : KOCH AND FLOKSTRA
115 !
116  IF(devia==1) THEN
117 !
118  c = 2.d0*(xmvs-xmve)*grav*dcla/3.d0
119  DO i=1,npoin
120  tt1=c/max(tob%R(i),1.d-10)
121  aa=steta%R(i)-tt1*dzfdy%R(i)
122  bb=cteta%R(i)-tt1*dzfdx%R(i)
123  norm=max(sqrt(aa**2+bb**2),1.d-10)
124  salfa%R(i)=aa/norm
125  calfa%R(i)=bb/norm
126  ENDDO
127 !
128 ! 2 : TALMON ET AL. JHR 1995 33(4)
129 !
130  ELSEIF(devia==2) THEN
131 !
132  surbeta2=1.d0/beta2
133  c = (xmvs-xmve)*grav*dcla*surbeta2**2
134  DO i=1,npoin
135  tt1=sqrt(c/max(tob%R(i),1.d-10))
136  aa=steta%R(i)-tt1*dzfdy%R(i)
137  bb=cteta%R(i)-tt1*dzfdx%R(i)
138  norm=max(sqrt(aa**2+bb**2),1.d-10)
139  salfa%R(i)=aa/norm
140  calfa%R(i)=bb/norm
141  ENDDO
142 !
143  ENDIF
144 !
145 !======================================================================
146 !
147 ! COMPUTES THE COEFFICIENT TO TAKE THE SLOPE EFFECT ON THE MAGNITUDE
148 ! OF THE SOLID TRANSPORT INTO ACCOUNT
149 !
150 ! METHOD 1 (EMPIRICAL)
151 !
152  IF(slopeff==1) THEN
153 !
154  DO i=1,npoin
155  coef%R(i)=max(0.d0,
156  & 1.d0-beta*(dzfdx%R(i)*cteta%R(i)+dzfdy%R(i)*steta%R(i)) )
157  ENDDO
158 !
159 ! METHOD 2 : SOULSBY 1997 DYNAMICS OF MARINE SANDS P107-108
160 !
161  ELSEIF(slopeff.EQ.2) THEN
162 !
163  tanphi = tan(phised*pi/180.d0)
164 !
165  DO i=1,npoin
166 !
167 ! COSINE AND SINE OF THE DIRECTION OF THE SLOPE
168  dzf=sqrt(dzfdx%R(i)**2+dzfdy%R(i)**2)
169  IF(dzf.GT.1.d-12) THEN
170  calpha=dzfdx%R(i)/dzf
171  salpha=dzfdy%R(i)/dzf
172  ELSE
173  calpha=1.d0
174  salpha=0.d0
175  ENDIF
176 !
177 ! ZETA: ANGLE OF THE SLOPE WITH HORIZONTAL (BETA IN SOULSBY)
178  zeta=atan(dzf)
179  czeta=cos(zeta)
180  szeta=sin(zeta)
181 !
182 ! PSI: ANGLE OF THE CURRENT WITH THE SLOPE DIRECTION
183 ! PSI=TETA%R(I)-ALPHA
184  cpsi=cteta%R(i)*calpha+steta%R(i)*salpha
185  spsi=steta%R(i)*calpha-cteta%R(i)*salpha
186  c1=(czeta*tanphi)**2-(spsi*szeta)**2
187  coef%R(i)=max((cpsi*szeta+sqrt(max(c1,0.d0)))/tanphi,0.d0)
188  coef%R(i)=max(coef%R(i),0.d0)
189 !
190  ENDDO
191 !
192  ENDIF
193 !
194 ! ********************************************************************* !
195 ! V - TREATS THE BOUNDARY POINTS WITH IMPOSED RATE !
196 ! QS IS NOT MODIFIED WHEN SPECIFIED BY THE USER !
197 ! ********************************************************************* !
198 !
199 ! RK no slope effect at the open boundaries
200  DO k = 1, nptfr
201  IF (liqbor%I(k) == kent) THEN
202  coef%R(mesh%NBOR%I(k)) = 1.d0
203  calfa%R(mesh%NBOR%I(k)) = cteta%R(mesh%NBOR%I(k))
204  salfa%R(mesh%NBOR%I(k)) = steta%R(mesh%NBOR%I(k))
205  ENDIF
206 ! R.K. MAY 2007
207 ! KSORT = 4
208  IF (liqbor%I(k) == 4) THEN
209  coef%R(mesh%NBOR%I(k)) = 1.d0
210  calfa%R(mesh%NBOR%I(k)) = cteta%R(mesh%NBOR%I(k))
211  salfa%R(mesh%NBOR%I(k)) = steta%R(mesh%NBOR%I(k))
212  ENDIF
213  ENDDO
214 !
215 !======================================================================
216 !======================================================================
217 !
218  RETURN
219  END SUBROUTINE bedload_effpnt_gaia
subroutine bedload_effpnt_gaia(MASKEL, LIQBOR, S, ZF, NPOIN, NPTFR, IELMT, KENT, BETA, PI, MSK, MESH, DZFDX, DZFDY, CTETA, STETA, COEF, CALFA, SALFA, SLOPEFF, PHISED, DEVIA, BETA2, TOB, XMVS, XMVE, DCLA, GRAV, UNSV2D)
subroutine vector(VEC, OP, FORMUL, IELM1, XMUL, F, G, H, U, V, W, MESH, MSK, MASKEL, LEGO, ASSPAR)
Definition: vector.f:7
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
subroutine parcom(X, ICOM, MESH)
Definition: parcom.f:7
subroutine coef(S3D_IVIDE, S3D_EPAI, TRA01, S3D_NPFMAX, IMAX, NDEB, S3D_RHOS, GRAV, S3D_DTC, DSIG1)
Definition: coef.f:9
Definition: bief.f:3