The TELEMAC-MASCARET system  trunk
bed1_consolidation_layer.f
Go to the documentation of this file.
1 ! ***********************************
2  SUBROUTINE bed1_consolidation_layer
3 ! ***********************************
4 !
5 !
6 !***********************************************************************
7 ! GAIA
8 !***********************************************************************
9 !
11 !
12 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
13 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14 !
15 !
16  USE bief
19  IMPLICIT NONE
20 !
21  INTEGER IPOIN,ILAYER,ISAND,IMUD
22  DOUBLE PRECISION INTERPOL
23 !======================================================================
24 ! total mass of sediment in each point before consolidation
25 ! just for check that evolution of mass = 0
27 ! INITIALISES
28  CALL os('X=0 ',x=evol_mc)
29 ! EVOL_MC%R() contained -mass of sediment before consolidation
30 ! after we add mass of sediment after consolidation to have evolution
31 !
32  IF(nsand.GE.1) THEN
33  DO ipoin = 1,npoin
34  DO ilayer = 1,nomblay
35  DO isand = 1,nsand
36  evol_mc%R(ipoin) = evol_mc%R(ipoin)
37  & - mass_sand(isand,ilayer,ipoin)
38  ENDDO
39  ENDDO
40  ENDDO
41  ENDIF
42  IF(nmud.GE.1) THEN
43  DO ipoin = 1,npoin
44  DO ilayer = 1,nomblay
45  DO imud = 1,nmud
46  evol_mc%R(ipoin) = evol_mc%R(ipoin)
47  & - mass_mud(imud,ilayer,ipoin)
48  ENDDO
49  ENDDO
50  ENDDO
51  ENDIF
52 !-------------------------------------------------------------------------
53 ! For the active layer the concentration of mud is not constant in time
54 ! UPDATE TRANS_MASS OF MUD IN ACTIV LAYER IN FUNCTION OF CONCENTRATION
55 ! OF MUD IN THE ACTIVE LAYER:
56 ! SIMPLE INTERPOLATION BETWEEN TRANS_MASS DISCRETIZATION GIVEN BY USER
57 ! NUM_TRANSF IS LAYER NUMBER WHERE MASS OF ACTIVE LAYER IS TRANSFERED
58  IF(hirano)THEN
59  DO ipoin = 1,npoin
60  IF(conc_mud(1,ipoin).LE.conc_mud(2,ipoin))THEN
61  conc_mud(1,ipoin)=conc_mud(2,ipoin)
62  trans_mass(1,ipoin)= trans_mass(2,ipoin)
63  num_transf(ipoin)= 2
64  ELSEIF(conc_mud(1,ipoin).GE.
65  & conc_mud(nomblay,ipoin))THEN
66  conc_mud(1,ipoin)= conc_mud(nomblay,ipoin)
67  trans_mass(1,ipoin)= trans_mass(nomblay,ipoin)
68 ! TRANS_MASS(NOMBLAY,IPOIN) is equal to 0
69  num_transf(ipoin)= nomblay
70  ELSE
71  DO ilayer=2,nomblay
72  IF(conc_mud(1,ipoin).LE.
73  & conc_mud(ilayer,ipoin))THEN
74 !
75  interpol=(conc_mud(1,ipoin)-
76  & conc_mud(ilayer-1,ipoin))/
77  & (conc_mud(ilayer,ipoin)-
78  & conc_mud(ilayer-1,ipoin))
79 !
80  trans_mass(1,ipoin)=interpol*
81  & (trans_mass(ilayer,ipoin)-trans_mass(ilayer-1,ipoin))
82  & +trans_mass(ilayer-1,ipoin)
83 !
84  num_transf(ipoin)= ilayer
85 !
86  GOTO 200
87  ENDIF
88  ENDDO
89 200 CONTINUE
90  ENDIF
91  ENDDO ! NPOIN
92  ELSE
93 ! IF NOT HIRANO NUM_TRANSF = 0 is usefull
94 ! this can be done in the initialization step
95  DO ipoin = 1,npoin
96  num_transf(ipoin)=0
97  ENDDO
98  ENDIF
99 !
100 ! For other layers the concentration of mud is fixed
101 ! The flux of mass from upper layer to layer is dM/dt=TRANS_MASS*M
102 !
103 ! Computes the mud flux transfer between layers
104  DO ipoin = 1,npoin
105  DO ilayer = 1,nomblay
106  IF(mass_mud_tot(ilayer,ipoin).GE.min_sed_mass_comp) THEN
107 !
108  flux_mass_mud_tot(ilayer,ipoin) =
109  & trans_mass(ilayer,ipoin)*mass_mud_tot(ilayer,ipoin)*dt
110 
111 !
112  DO imud = 1,nmud
113 !
114  flux_mass_mud(imud,ilayer,ipoin) =
115  & min(mass_mud(imud,ilayer,ipoin),
116  & flux_mass_mud_tot(ilayer,ipoin)
117  & *ratio_mud(imud,ilayer,ipoin))
118 !
119  ENDDO
120  ELSE
121  DO imud = 1,nmud
122  flux_mass_mud(imud,ilayer,ipoin) = 0.d0
123  ENDDO
124  ENDIF
125 ! Computes the total flux transfer for all mud classes
126  flux_mass_mud_tot(ilayer,ipoin) = 0.d0
127  DO imud = 1,nmud
128 !
129  flux_mass_mud_tot(ilayer,ipoin) =
130  & flux_mass_mud_tot(ilayer,ipoin)
131  & +flux_mass_mud(imud,ilayer,ipoin)
132 !
133  ENDDO
134  ENDDO
135  ENDDO
136 ! Computes the flux transfer of sand (valid for sand-mud mixtures)
137  IF(nsand.GE.1) THEN
138  DO ipoin = 1,npoin
139  DO ilayer = 1,nomblay
140  DO isand = 1,nsand
141  IF(mass_mud_tot(ilayer,ipoin).GE.min_sed_mass_comp) THEN
142 !
143  flux_mass_sand(isand,ilayer,ipoin) =
144  & flux_mass_mud_tot(ilayer,ipoin)/
145  & mass_mud_tot(ilayer,ipoin)
146  & *mass_sand(isand,ilayer,ipoin)
147 !
148  flux_mass_sand(isand,ilayer,ipoin) =
149  & max(0.d0,flux_mass_sand(isand,ilayer,ipoin))
150 !
151  flux_mass_sand(isand,ilayer,ipoin) =
152  & min(flux_mass_sand(isand,ilayer,ipoin),
153  & mass_sand(isand,ilayer,ipoin))
154 !
155  ELSE
156  flux_mass_sand(isand,ilayer,ipoin) = 0.d0
157  ENDIF
158  ENDDO
159  ENDDO
160  ENDDO
161  ENDIF
162 !
163 ! Mass transfer of mud
164 !
165  IF(hirano)THEN
166 ! the active layer is treated independently
167 ! removing the flux from the active layer
168  DO ipoin = 1,npoin
169  DO imud = 1,nmud
170  flux_neg_mud_activ_layer(imud,ipoin) =
171  & flux_mass_mud(imud,1,ipoin)
172  flux_mass_mud(imud,1,ipoin)= 0.d0
173  ENDDO
174  ENDDO
175 !
176 ! Mass transfer of sand
177 !
178  DO ipoin = 1,npoin
179  DO isand = 1,nsand
180  flux_neg_sand_activ_layer(isand,ipoin) =
181  & flux_mass_sand(isand,1,ipoin)
182  flux_mass_sand(isand,1,ipoin)=0.d0
183  ENDDO
184  ENDDO
185 ! here we add the active layer flux for the suitable layer
186  DO ipoin = 1,npoin
187  DO ilayer = 1,nomblay
188  IF(num_transf(ipoin).EQ.ilayer)THEN
189  DO imud = 1,nmud
190  flux_pos_mud_activ_layer(imud,ilayer,ipoin) =
191  & flux_neg_mud_activ_layer(imud,ipoin)
192  ENDDO
193  DO isand = 1,nsand
194  flux_pos_sand_activ_layer(isand,ilayer,ipoin) =
195  & flux_neg_sand_activ_layer(isand,ipoin)
196  ENDDO
197  ELSE
198  DO imud = 1,nmud
199  flux_pos_mud_activ_layer(imud,ilayer,ipoin) =0.d0
200  ENDDO
201  DO isand = 1,nsand
202  flux_pos_sand_activ_layer(isand,ilayer,ipoin) =0.d0
203  ENDDO
204  ENDIF
205  ENDDO
206  ENDDO
207 ! ELSE
208 ! if not hirano (init_zero)
209 !FLUX_POS_MUD_ACTIV_LAYER=0
210 !FLUX_NEG_MUD_ACTIV_LAYER=0
211  ENDIF !HIRANO
212 !
213 ! GENERAL CASE (HIRANO OR NOT)
214  DO ipoin = 1,npoin
215  DO ilayer = 1,nomblay
216  DO imud = 1,nmud
217 !
218  IF(ilayer.EQ.nomblay) THEN
219 !
220  mass_mud(imud,ilayer,ipoin) =
221  & mass_mud(imud,ilayer,ipoin)
222  & +flux_mass_mud(imud,ilayer-1,ipoin)
223  & +flux_pos_mud_activ_layer(imud,ilayer,ipoin)
224 !
225  ELSEIF(ilayer.EQ.1) THEN
226 !
227  mass_mud(imud,ilayer,ipoin) =
228  & mass_mud(imud,ilayer,ipoin)
229  & -flux_mass_mud(imud,ilayer,ipoin)
230  & -flux_neg_mud_activ_layer(imud,ipoin)
231 !
232  ELSE
233 !
234  mass_mud(imud,ilayer,ipoin) =
235  & mass_mud(imud,ilayer,ipoin)
236  & +flux_mass_mud(imud,ilayer-1,ipoin)
237  & -flux_mass_mud(imud,ilayer,ipoin)
238  & +flux_pos_mud_activ_layer(imud,ilayer,ipoin)
239  ENDIF
240  ENDDO
241  ENDDO
242  ENDDO
243 ! mass transfer of sand
244  IF(nsand.GE.1) THEN
245  DO ipoin = 1,npoin
246  DO ilayer = 1,nomblay
247  DO isand = 1,nsand
248 !
249  IF(ilayer.EQ.nomblay) THEN
250 !
251  mass_sand(isand,ilayer,ipoin) =
252  & mass_sand(isand,ilayer,ipoin)
253  & +flux_mass_sand(isand,ilayer-1,ipoin)
254  & +flux_pos_sand_activ_layer(isand,ilayer,ipoin)
255 !
256  ELSEIF(ilayer.EQ.1) THEN
257 !
258  mass_sand(isand,ilayer,ipoin) =
259  & mass_sand(isand,ilayer,ipoin)
260  & -flux_mass_sand(isand,ilayer,ipoin)
261  & -flux_neg_sand_activ_layer(isand,ipoin)
262 !
263  ELSE
264 !
265  mass_sand(isand,ilayer,ipoin) =
266  & mass_sand(isand,ilayer,ipoin)
267  & +flux_mass_sand(isand,ilayer-1,ipoin)
268  & -flux_mass_sand(isand,ilayer,ipoin)
269  & +flux_pos_sand_activ_layer(isand,ilayer,ipoin)
270 !
271  ENDIF
272  ENDDO
273  ENDDO
274  ENDDO
275  ENDIF
276 !----------------------------------------------------------------------
277 ! total mass of sediment in each point after consolidation
278 ! just for check that evolution of mass = 0
279 ! EVOLUTIONS FOR EACH CLASS ARE ADDED: TOTAL MASS EVOLUTION
280 ! EVOL_MC%R() contained -mass of sediment before consolidation
281 ! we add mass of sediment after consolidation to have evolution
283  IF(nsand.GE.1) THEN
284  DO ipoin = 1,npoin
285  DO ilayer = 1,nomblay
286  DO isand = 1,nsand
287  evol_mc%R(ipoin) = evol_mc%R(ipoin)
288  & + mass_sand(isand,ilayer,ipoin)
289  ENDDO
290  ENDDO
291  ENDDO
292  ENDIF
293  IF(nmud.GE.1) THEN
294  DO ipoin = 1,npoin
295  DO ilayer = 1,nomblay
296  DO imud = 1,nmud
297  evol_mc%R(ipoin) =evol_mc%R(ipoin)
298  & + mass_mud(imud,ilayer,ipoin)
299  ENDDO
300  ENDDO
301  ENDDO
302  ENDIF
303 !
304  RETURN
305  END SUBROUTINE bed1_consolidation_layer
double precision, dimension(:,:), allocatable, target trans_mass
Mass transfer for consolidation between layers, for each bed layer, for each point. It is variable in space for the active layer (layer 1) only. It is a choice related to the way the bed model is done: the active layer is treated along with the others, there are no specialised arrays for the active layer.
type(bief_obj), target evol_mc
Total mass evolution due to consolidation [kg/m2].
double precision, dimension(:,:,:), allocatable, target mass_mud
Surface mass of mud (kg/m2), for imud,ilayer,ipoin.
integer, target nomblay
Number of bed load model layers = NUMSTRAT+1 to take the active layer into account.
double precision, dimension(:), pointer x
2d coordinates of the mesh
double precision, target dt
Time step It may be different from the one in TELEMAC because of the morphological factor...
double precision, dimension(:,:), allocatable flux_neg_sand_activ_layer
Negative sand transfer to apply in case we have an active layer.
double precision, parameter min_sed_mass_comp
Minimum value to detect sediment mass.
double precision, dimension(:,:,:), allocatable flux_mass_mud
Flux of mud transfert inbetween layers.
logical hirano
Hirano model used.
double precision, dimension(:,:,:), allocatable, target mass_sand
Surface mass of sand (kg/m2), for isand,ilayer,ipoin.
double precision, dimension(:,:), allocatable, target conc_mud
Mud concentration for each bed layer, at each point. It is variable in space for the active layer (la...
double precision, dimension(:,:), allocatable mass_mud_tot
Surface total mass of mud (kg/m2), for ilayer,ipoin.
integer nsand
Total number of sand.
double precision, dimension(:,:,:), allocatable, target ratio_mud
Ratio of mud to all muds, for imud,ilayer,ipoin.
integer nmud
Total number of muds.
double precision, dimension(:,:,:), allocatable flux_pos_sand_activ_layer
Positive sand transfer to apply in case we have an active layer.
double precision, dimension(:,:,:), allocatable flux_pos_mud_activ_layer
Positive mud transfer to apply in case we have an active layer.
integer, dimension(:), allocatable num_transf
Layer of mud of active layer into which mud will be added.
double precision, dimension(:,:), allocatable flux_mass_mud_tot
Same as FLUX_MASS_MUD but summed on the mud layer.
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
double precision, dimension(:,:,:), allocatable flux_mass_sand
Flux of sand transfert inbetween layers.
subroutine bed1_consolidation_layer
integer, pointer npoin
Number of 2d points in the mesh.
double precision, dimension(:,:), allocatable flux_neg_mud_activ_layer
Negative mud transfer to apply in case we have an active layer.
Definition: bief.f:3