The TELEMAC-MASCARET system  trunk
gaia_balance.f
Go to the documentation of this file.
1 ! ***********************
2  SUBROUTINE gaia_balance
3 ! ***********************
4  &(zf_tel)
5 !
6 !***********************************************************************
7 ! GAIA
8 !***********************************************************************
9 !
12 !
13 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16  USE interface_gaia, ex_gaia_balance => gaia_balance
17  USE bief
22 !
24  IMPLICIT NONE
25 !
26 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
27 !
28  TYPE(bief_obj), INTENT(INOUT) :: ZF_TEL
29 !
30 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
31 !
32  INTEGER I
33  INTEGER IMA, IMI, IMAX, IMIN
34  DOUBLE PRECISION :: XMA
35  DOUBLE PRECISION :: XMI
36  DOUBLE PRECISION :: XMAX, XMIN
37  DOUBLE PRECISION :: SUM_EVOL_MM
38 !
39 !-----------------------------------------------------------------------
40 !
41 !=======================================================================
42 ! COMPUTES THE EVOLUTIONS FOR THIS CYCLE OF TIMESTEP
43 ! AND UPDATES AFTER THIS COMPUTATION
44 !=======================================================================
45 !
46 ! COMPUTES THE EVOLUTIONS FOR THIS TIMESTEP
47 ! EVOLUTIONS ARE MASS EVOLUTION
48 ! FIXME: E, EVOL_MB, EVOL_MS
49 !
50  IF(charr) THEN
51  CALL os('X=Y ',x=e,y=evol_mb)
52  ELSE
53  CALL os('X=0 ',x=e)
54  ENDIF
55 !
56  IF(susp) CALL os('X=X+Y ',x=e,y=evol_ms)
57 !
58 ! consolidation
59  IF(bed_model.EQ.2.OR.bed_model.EQ.3) THEN
60 ! evolution of mass with consodilation is logicaly 0
61 ! (we check this in bed1_consolidation_layer.f)
63 
64  DO i=1,npoin
65  IF(evol_mc%R(i).GT.min_sed_mass_comp)THEN
66  WRITE(lu,*)'CONSOLIDATION MODEL SEEMS
67  & TO BE NOT CONSERVATIVE'
68  CALL plante(1)
69  stop
70  ENDIF
71  ENDDO
72 ! evolution of mass with consodilation is logicaly 0
74  CALL os('X=X+Y ',x=e,y=evol_mc)
75  ENDIF
76 !
77  IF(slide.AND.entet) THEN
78  sum_evol_mm = 0.d0
79  DO i=1,npoin
80  sum_evol_mm = sum_evol_mm + evol_mm%R(i)*volu2d%R(i)
81  ENDDO
82  IF(ncsize.GT.1) THEN
83  sum_evol_mm = p_sum(sum_evol_mm)
84  ENDIF
85  WRITE(lu,111) sum_evol_mm
86 111 FORMAT(5x,'MASS EVOLUTION DUE TO SLIDING =',g16.7,'(KG)')
87  CALL os('X=X+Y ',x=e,y=evol_mm)
88  ENDIF
89 !
90 ! FIXME: THIS IS NOT USED
91  CALL os('X=X+Y ', x=esomt, y=e)
92 !
93 ! EVOLUTIONS IN METER FOR OUTPUTS
94 !
95  CALL os('X=Y-Z ', x=t1, y=zf, z=zf_tel)
96  CALL os('X=X+Y ', x=cumbe, y=t1)
97 !
98 !=====================================================================
99 ! MASS BALANCE
100 !=====================================================================
101 ! COMPUTES THE COMPONENTS OF SAND TRANSPORT FOR THE MASS BALANCE,
102 ! GRAPHIC OUTPUTS AND VALIDATION STAGE
103 !
104  IF(bilma) THEN
105  IF(debug.GT.0) WRITE(lu,*) 'BILAN_GAIA'
109  & masstot,mass0tot)
110  IF(debug.GT.0) WRITE(lu,*) 'END_BILAN_GAIA'
111  ENDIF
112 !
113 ! CONTROL SECTIONS
114 !
115  IF(ncp.GT.0) THEN
116  IF(debug.GT.0) WRITE(lu,*) 'FLUSEC_GAIA'
117  CALL flusec_gaia(u2d,v2d,hn,
118  & qsxc,qsyc,charr,susp,
119  & mesh%IKLE%I,
120  & mesh%NELMAX,mesh%NELEM,
121  & mesh%X%R,mesh%Y%R,
122  & dt,ncp,ctrlsc,entet,at0)
123  IF(debug.GT.0) WRITE(lu,*) 'END_FLUSEC_GAIA'
124  ENDIF
125 !
126 !------------------------------------------------------------------
127 !
128 #if defined COMPAD
130 #endif
131 !
132 !=====================================================================
133 ! PRINTS OUT EXTREME VALUES
134 !=====================================================================
135 !
136  IF(entet.AND.charr) THEN
137  CALL os('X=Y-Z ', x=t1, y=zf, z=zf_tel)
138  WRITE(lu,*)
139  CALL maxi(xmax,imax,t1%R,npoin)
140  IF(ncsize.GT.1) THEN
141  xma=p_max(xmax)
142  IF(xmax.EQ.xma) THEN
143  ima=mesh%KNOLG%I(imax)
144  ELSE
145  ima=0
146  ENDIF
147  ima=p_max(ima)
148  ELSE
149  ima=imax
150  xma=xmax
151  ENDIF
152  WRITE(lu,372) xma,ima
153 372 FORMAT(' MAXIMAL EVOLUTION (M) : ',g16.7,' NODE :',i6)
154  CALL mini(xmin,imin,t1%R,npoin)
155  IF(ncsize.GT.1) THEN
156  xmi=p_min(xmin)
157  IF(xmin.EQ.xmi) THEN
158  imi=mesh%KNOLG%I(imin)
159  ELSE
160  imi=0
161  ENDIF
162  imi=p_max(imi)
163  ELSE
164  imi=imin
165  xmi=xmin
166  ENDIF
167  WRITE(lu,374) xmi,imi
168 374 FORMAT(' MINIMAL EVOLUTION (M) : ',g16.7,' NODE :',i6)
169 !
170  IF(const_alayer) THEN
171  IF(nsicla.GT.1.AND.xmi.LT.-0.5d0*elay0) THEN
172  WRITE(lu,886)
173 886 FORMAT(' EROSION GREATER THAN ONE LAYER THICKNESS !')
174  ENDIF
175  IF(nsicla.GT.1.AND.xma.GT.elay0) THEN
176  WRITE(lu,888)
177 888 FORMAT(' DEPOSITION MORE THAN ONE LAYER THICKNESS !')
178  ENDIF
179  ENDIF
180  ENDIF
181  IF(entet) THEN
182  CALL maxi(xmax,imax,cumbe%R,npoin)
183  IF(ncsize.GT.1) THEN
184  xma=p_max(xmax)
185  IF(xmax.EQ.xma) THEN
186  ima=mesh%KNOLG%I(imax)
187  ELSE
188  ima=0
189  ENDIF
190  ima=p_max(ima)
191  ELSE
192  ima=imax
193  xma=xmax
194  ENDIF
195  WRITE(lu,882) xma,ima
196 882 FORMAT(' TOTAL MAXIMAL EVOLUTION : ',g16.7,' NODE :',i6)
197  CALL mini(xmin,imin,cumbe%R,npoin)
198  IF(ncsize.GT.1) THEN
199  xmi=p_min(xmin)
200  IF(xmin.EQ.xmi) THEN
201  imi=mesh%KNOLG%I(imin)
202  ELSE
203  imi=0
204  ENDIF
205  imi=p_max(imi)
206  ELSE
207  imi=imin
208  xmi=xmin
209  ENDIF
210  WRITE(lu,884) xmi,imi
211 884 FORMAT(' TOTAL MINIMAL EVOLUTION : ',g16.7,' NODE :',i6)
212  ENDIF
213 !
214 !-----------------------------------------------------------------------
215 !
216  RETURN
217  END
integer, pointer nptfr
Number of boundary points.
type(bief_obj), target esomt
Cumulated bed evolution over time [kg/m2].
double precision, dimension(nsiclm) mass0tot
Initial total mass of sediment of each class.
logical bilma
Mass balance.
subroutine flusec_gaia(U, V, H, QSXC, QSYC, CHARR, SUSP, IKLE, NELMAX, NELEM, X, Y, DT, NCP, CTRLSC, INFO, TPS)
Definition: flusec_gaia.f:8
type(bief_obj), target e
Evolution of the bed mass at each point for each time step [kg/m2].
logical entet
Writes out (or not)
type(bief_obj), target evol_mc
Total mass evolution due to consolidation [kg/m2].
type(bief_obj), target u2d
Components of depth-averaged velocity.
double precision elay0
Wanted active layer thickness; ELAYO is a target value for ELAY, but ELAY may be lower than ELAY0 if ...
type(bief_obj), target v2d
double precision, dimension(nsiclm) masstot
Total mass of sediment of each class.
type(bief_obj), target evcl_mb
Mass evolution for class (due to bedload)
logical, target susp
Suspension : yes if there is at least one suspended sediment this is the case if there is mud or if s...
double precision, dimension(:), pointer x
2d coordinates of the mesh
type(bief_obj), target evol_mb
Total mass evolution due to bedload [kg/m2].
type(bief_obj), target volu2d
Integral of bases.
double precision, target dt
Time step It may be different from the one in TELEMAC because of the morphological factor...
integer bed_model
Bed model (3 choices, cf. dico)
type(bief_obj), target qsxc
Solid discharge (bedload), along x and y.
double precision, parameter min_sed_mass_comp
Minimum value to detect sediment mass.
type(bief_obj), target evcl_ms
Mass evolution for class (due to suspension)
double precision, dimension(:), pointer y
type(bief_obj), target evol_ms
Total mass evolution due to suspension [kg/m2].
type(bief_obj), target numliq
Liquid boundary numbering.
subroutine mini(XMIN, IMIN, X, NPOIN)
Definition: mini.f:7
type(bief_obj), target qsyc
subroutine mass_balance(DT, NPTFR, ENTET, NSICLA, NUMLIQ, NFRLIQ, FLBCLA, LT, NIT, NPOIN, VOLU2D, CHARR, SUSP, EVCL_MB, EVCL_MS, MASSTOT, MASS0TOT)
Definition: mass_balance.f:9
logical slide
Sediment slide.
type(bief_obj), target hn
Water depth.
type(bief_obj), target evol_mm
Total mass evolution due to sliding (maxslope) [kg/m2].
integer, target nsicla
Number of sediment classes of bed material (less than NISCLM)
type(bief_obj), target z
Free surface elevation.
subroutine ad_gaia_subiteration_end
type(bief_obj), pointer t1
Aliases for work vectors in tb.
logical const_alayer
Constant active layer thickness.
integer, target lt
Numero du pas de temps.
type(bief_obj), target cumbe
Cumulated bed evolution over time [m].
integer debug
Debugger.
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
type(bief_obj), target zf
Bottom elevation.
type(bief_mesh), target mesh
Mesh structure.
logical, target charr
Include bedload in the simulation.
double precision at0
integer ncp
Number of control sections points.
subroutine gaia_balance(ZF_TEL)
Definition: gaia_balance.f:6
integer nfrliq
Number of liquid boundaries.
subroutine maxi(XMAX, IMAX, X, NPOIN)
Definition: maxi.f:7
integer, pointer npoin
Number of 2d points in the mesh.
integer, dimension(:), allocatable ctrlsc
Array containing the global number of the points in the control sections.
type(bief_obj), target flbcla
Fluxes at boundary for every class.
Definition: bief.f:3