The TELEMAC-MASCARET system  trunk
bed1_update_activelayer_hirano.f
Go to the documentation of this file.
1 ! *****************************************
3 ! *****************************************
4 !
5 !***********************************************************************
6 ! GAIA
7 !***********************************************************************
8 !
21 !
22 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 !
24  USE bief
27  & mass_mud,nsand,nmud,npoin,nomblay,xkv0,conc_mud,
28  & elay,conc_mud_activ_layer,mass_mud_activ_layer,
29  & mass_mud_activ_layer,flux_mass_mud,
30  & flux_mass_sand
32  IMPLICIT NONE
33 !
34 !----------------------------------------------------------------------
35 !
36  INTEGER IPOIN,ILAYER,ISAND,IMUD
37  DOUBLE PRECISION THICK_TRANSFER,THICK_TRANSFER_TEMPO
38  DOUBLE PRECISION RATIO_XKV
39 !
40 !----------------------------------------------------------------------
41 !
42 ! INITIALIZATION
43 !
44  DO ipoin=1,npoin
45  DO ilayer=1,nomblay
46  DO imud=1,nmud
47  flux_mass_mud(imud,ilayer,ipoin)=0.d0
48  ENDDO
49  DO isand=1,nsand
50  flux_mass_sand(isand,ilayer,ipoin)=0.d0
51  ENDDO
52  ENDDO
53  ENDDO
54 
55 
56  CALL activelayer
57 
58 !
59 ! COMPUTATION OF THE THICKNESS FOR TRANSFER
60 !
61  DO ipoin=1,npoin
62 ! TOTAL MASS MUD AND CONCENTRATION OF MUD IN THE ACTIVE LAYER BEFORE UPDATE
63  conc_mud_activ_layer(ipoin)=
64  & max(conc_mud(1,ipoin),conc_mud(2,ipoin))
65  mass_mud_activ_layer(ipoin)= 0.d0
66  DO imud = 1,nmud
67  mass_mud_activ_layer(ipoin)= mass_mud_activ_layer(ipoin)+
68  & mass_mud(imud,1,ipoin)
69  ENDDO
70  thick_transfer = es(ipoin,1)- elay%R(ipoin)
71 ! POSITIVE SIGNE MEANS DEPOSITION, NEGATIVE MEANS EROSION
72 !
73 !-----------------------------------------------------------------------
74 ! DEPOSITION CASE
75 !-----------------------------------------------------------------------
76 !
77  IF(thick_transfer.GT.0.d0) THEN
78 ! ACTIVE LAYER TOO LARGE: TRANSFER OF MASS FROM UPPER LAYER TO
79 ! LOWER LAYER
80  IF(nmud.GE.1) THEN
81  DO imud = 1,nmud
82  flux_mass_mud(imud,1,ipoin)= -(thick_transfer/es(ipoin,1))
83  & *mass_mud(imud,1,ipoin)
84  flux_mass_mud(imud,2,ipoin)=+(thick_transfer/es(ipoin,1))
85  & *mass_mud(imud,1,ipoin)
86  ENDDO
87  ENDIF
88  IF(nsand.GE.1) THEN
89  DO isand=1,nsand
90  flux_mass_sand(isand,1,ipoin)=-(thick_transfer/es(ipoin,1))
91  & *mass_sand(isand,1,ipoin)
92  flux_mass_sand(isand,2,ipoin)=+(thick_transfer/es(ipoin,1))
93  & *mass_sand(isand,1,ipoin)
94  ENDDO
95  ENDIF
96 ! IN THIS CASE: CONCENTRATION OF MUD IN THE ACTIVE LAYER DONT CHANGE
97 !
98 !-----------------------------------------------------------------------
99 ! EROSION CASE
100 !-----------------------------------------------------------------------
101 !
102  ELSE !IF(THICK_TRANSFER.LE.0.D0) THEN
103 ! ACTIVE LAYER TOO SMALL: TRANSFER OF MASS FROM SUBLAYER TO
104 ! UPPER LAYER
105  thick_transfer_tempo = abs(thick_transfer)
106 
107  DO ilayer =2,nomblay
108  ratio_xkv = (1.d0-xkv0(ilayer))/(1.d0-xkv0(1))
109  IF(thick_transfer_tempo.GE.es(ipoin,ilayer)*ratio_xkv) THEN
110 
111  IF(nmud.GE.1) THEN
112  DO imud=1,nmud
113  flux_mass_mud(imud,ilayer,ipoin)=
114  & flux_mass_mud(imud,ilayer,ipoin)-
115  & mass_mud(imud,ilayer,ipoin)
116 
117  flux_mass_mud(imud,1,ipoin)=
118  & flux_mass_mud(imud,1,ipoin)+
119  & mass_mud(imud,ilayer,ipoin)
120  IF(mass_mud(imud,ilayer,ipoin).GE.min_sed_mass_comp)
121  & THEN
122 ! UPDATE CONCENTRATION OF MUD IN THE ACTIVE LAYER
123  conc_mud_activ_layer(ipoin)=
124  & (conc_mud_activ_layer(ipoin)*
125  & mass_mud_activ_layer(ipoin)+
126  & conc_mud(ilayer,ipoin)*mass_mud(imud,ilayer,ipoin))/
127  & (mass_mud_activ_layer(ipoin)+mass_mud(imud,ilayer,ipoin))
128 
129  mass_mud_activ_layer(ipoin)=
130  & mass_mud_activ_layer(ipoin)+mass_mud(imud,ilayer,ipoin)
131  ELSE
132  conc_mud_activ_layer(ipoin)=conc_mud(ilayer,ipoin)
133  ENDIF
134  ENDDO
135  ENDIF
136  IF(nsand.GE.1) THEN
137  DO isand=1,nsand
138  flux_mass_sand(isand,ilayer,ipoin)=
139  & flux_mass_sand(isand,ilayer,ipoin)-
140  & mass_sand(isand,ilayer,ipoin)
141 
142  flux_mass_sand(isand,1,ipoin)=
143  & flux_mass_sand(isand,1,ipoin)+
144  & mass_sand(isand,ilayer,ipoin)
145  ENDDO
146  ENDIF
147  thick_transfer_tempo = thick_transfer_tempo
148  & - es(ipoin,ilayer)*ratio_xkv
149  ELSE
150  IF(nmud.GE.1) THEN
151  DO imud=1,nmud
152  flux_mass_mud(imud,ilayer,ipoin)=
153  & flux_mass_mud(imud,ilayer,ipoin)-
154  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
155  & *mass_mud(imud,ilayer,ipoin)
156 !
157  flux_mass_mud(imud,1,ipoin)=
158  & flux_mass_mud(imud,1,ipoin)+
159  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
160  & *mass_mud(imud,ilayer,ipoin)
161 ! UPDATE CONCENTRATION OF MUD IN THE ACTIVE LAYER
162  IF(mass_mud(imud,ilayer,ipoin).GE.min_sed_mass_comp)
163  & THEN
164  conc_mud_activ_layer(ipoin)=
165  & (conc_mud_activ_layer(ipoin)*
166  & mass_mud_activ_layer(ipoin)+
167  & conc_mud(ilayer,ipoin)*
168  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
169  & *mass_mud(imud,ilayer,ipoin))/
170  & (mass_mud_activ_layer(ipoin)+
171  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
172  & *mass_mud(imud,ilayer,ipoin))
173  ELSE
174  conc_mud_activ_layer(ipoin)=conc_mud(ilayer,ipoin)
175  ENDIF
176 !
177  mass_mud_activ_layer(ipoin)=
178  & mass_mud_activ_layer(ipoin)+
179  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
180  & *mass_mud(imud,ilayer,ipoin)
181  ENDDO
182  ENDIF
183  IF(nsand.GE.1) THEN
184  DO isand=1,nsand
185  flux_mass_sand(isand,ilayer,ipoin)=
186  & flux_mass_sand(isand,ilayer,ipoin)-
187  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
188  & *mass_sand(isand,ilayer,ipoin)
189 
190  flux_mass_sand(isand,1,ipoin)=
191  & flux_mass_sand(isand,1,ipoin)+
192  & (thick_transfer_tempo/(es(ipoin,ilayer)*ratio_xkv))
193  & *mass_sand(isand,ilayer,ipoin)
194  ENDDO
195  ENDIF
196  GOTO 100
197  ENDIF
198  ENDDO
199 100 CONTINUE
200  ENDIF ! THICK_TRANSFER.GE.0.D0
201  IF(nmud.GE.1) THEN
202 ! CHECK CONCENTRATION OF ACTIVE LAYER AND UPDATE CONC_MUD(1,IPOIN)
203  IF(conc_mud_activ_layer(ipoin).LE.conc_mud(2,ipoin))THEN
204  conc_mud(1,ipoin)= conc_mud(2,ipoin)
205  ELSEIF(conc_mud_activ_layer(ipoin).GE.
206  & conc_mud(nomblay,ipoin))THEN
207  conc_mud(1,ipoin)=conc_mud(nomblay,ipoin)
208  ELSE
209  conc_mud(1,ipoin)= conc_mud_activ_layer(ipoin)
210  ENDIF
211  ENDIF
212  ENDDO ! NPOIN
213 !
214 !-----------------------------------------------------------------------
215 ! TRANSFER OF MUD MASSES
216 !-----------------------------------------------------------------------
217 !
218  IF(nmud.GE.1) THEN
219  DO ipoin=1,npoin
220  DO ilayer=1,nomblay
221  DO imud = 1,nmud
222  mass_mud(imud,ilayer,ipoin)= mass_mud(imud,ilayer,ipoin)
223  & +flux_mass_mud(imud,ilayer,ipoin)
224  ENDDO
225  ENDDO
226  ENDDO
227  ENDIF
228 !
229 !-----------------------------------------------------------------------
230 ! TRANSFER OF SAND MASSES
231 !-----------------------------------------------------------------------
232 !
233 ! NEGATIVE FLUX_MASS_SAND MEANS THE FLUX IS FROM UPPER LAYER TO
234 ! LOWER LAYER
235  IF(nsand.GE.1) THEN
236  DO ipoin=1,npoin
237  DO ilayer=1,nomblay
238  DO isand=1,nsand
239  mass_sand(isand,ilayer,ipoin)=
240  & mass_sand(isand,ilayer,ipoin)
241  & +flux_mass_sand(isand,ilayer,ipoin)
242  ENDDO
243  ENDDO
244  ENDDO
245  ENDIF
246 !
247 !-----------------------------------------------------------------------
248 !-----------------------------------------------------------------------
249 !
250  RETURN
251  END
subroutine activelayer
Definition: activelayer.f:4
double precision, dimension(:,:), allocatable, target es
Layer thicknesses as double precision.
double precision, parameter min_sed_mass_comp
Minimum value to detect sediment mass.
double precision, dimension(:,:,:), allocatable, target mass_sand
Surface mass of sand (kg/m2), for isand,ilayer,ipoin.
subroutine bed1_update_activelayer_hirano
Definition: bief.f:3