The TELEMAC-MASCARET system  trunk
gaia_step.F
Go to the documentation of this file.
1 ! ********************
2  SUBROUTINE gaia_step
3 ! ********************
4 !
5  &(loopcount,grafcount,listcount,telnit,
6  & u_tel,v_tel,h_tel,zf_tel,uetcar,deltar,
7  & cf_tel,ks_tel,
8  & code,u3d,v3d,t_tel,visc_tel,dt_tel,charr_tel,susp_tel,
9  & xmve_tel,grav_tel,
10  & thetaw_tel,hw_tel,tw_tel,uw_tel,yagout,api_iter,grcomp)
11 !
12 !***********************************************************************
13 ! GAIA
14 !***********************************************************************
15 !
18 !
26 !
48 !
49 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79 !
80  USE interface_gaia, ex_gaia_step => gaia_step
81  USE bief
86 !
87  USE interface_parallel, ONLY : p_min,p_max
88  IMPLICIT NONE
89 !
90 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
91 !
92  INTEGER, INTENT(IN) :: LOOPCOUNT,GRAFCOUNT
93  INTEGER, INTENT(IN) :: LISTCOUNT,TELNIT
94  CHARACTER(LEN=24), INTENT(IN) :: CODE
95  TYPE(bief_obj), INTENT(IN) :: U_TEL,V_TEL,H_TEL
96  TYPE(bief_obj), INTENT(INOUT) :: ZF_TEL,UETCAR,KS_TEL
97  TYPE(bief_obj), INTENT(IN) :: DELTAR
98  TYPE(bief_obj), INTENT(IN) :: U3D,V3D,VISC_TEL
99  TYPE(bief_obj), INTENT(INOUT) :: CF_TEL
100  DOUBLE PRECISION, INTENT(IN) :: T_TEL,XMVE_TEL,GRAV_TEL
101  LOGICAL, INTENT(INOUT) :: CHARR_TEL,SUSP_TEL
102  DOUBLE PRECISION, INTENT(IN) :: DT_TEL
103  TYPE(bief_obj), INTENT(IN) :: THETAW_TEL,HW_TEL,TW_TEL
104  TYPE(bief_obj), INTENT(IN) :: UW_TEL
105  LOGICAL, INTENT(IN) :: YAGOUT
106  INTEGER, OPTIONAL, INTENT(IN) :: API_ITER,GRCOMP
107 !
108 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
109 !
110  LOGICAL :: COMP
111  INTEGER :: GGRCOMP
112 !=======================================================================
113 !------------------------------------------------------------------
114 ! CASE 1: SECOND_SUSP_STEP = FALSE: NO SUSPENSION IN THE CALCULATION OR
115 ! FIRST CALL OF GAIA IN THE TIME LOOP. COMPUTE THE
116 ! BEDLOAD AND/OR PREPARE THE SUSPENSION IF REQUIRED
117 !------------------------------------------------------------------
118  IF(.NOT.second_susp_step) THEN
119  CALL gaia_prepare_step
120  & (h_tel, u_tel, v_tel, cf_tel, charr_tel, code, deltar, dt_tel,
121  & hw_tel, ks_tel, listcount, loopcount, susp_tel,
122  & t_tel, thetaw_tel, tw_tel, uetcar, uw_tel, zf_tel)
123 !
124 ! BEDLOAD COMPUTATION
125 !
126  IF(charr) THEN
127 !
128  IF(debug.GT.0) WRITE(lu,*) 'BEDLOAD_MAIN_GAIA'
129  CALL bedload_main_gaia
135  & npoin,nptfr,nsicla,
140  & it1,t1,t2,t3,t4,t5,t6,t7,t8,t9,
141  & t10,t11,t12,t13,unorm,ac,dt,
144  & qsyc,salfa_cl,entet,
146  & sedco,houle,u3d,v3d,code,flbcla,maxadv,ratio_sand,
147  & h_tel, hw, thetac, tobcw_mean, tobcw_max, cstaeq)
148 !
149  IF(debug.GT.0) WRITE(lu,*) 'END_BEDLOAD_MAIN'
150 !
151 !
152  ENDIF !ENDIF(CHARR)
153 !
154 ! SUSPENSION COMPUTATION
155 !
156  IF(susp) THEN
157 !
158  IF(bed_model.EQ.1.OR.bed_model.EQ.2)THEN
159 ! CALL TO BED1_UPDATE TO UPDATE MASS_MIX_TOT,
160 ! NECESSARY TO SUSPENSION_ERODE
161  CALL bed1_update(zr,zf,volu2d)
162  ENDIF
163 !
164  IF(debug.GT.0) WRITE(lu,*) 'SUSPENSION_COMPUTATION'
166  second_susp_step = .true.
167  IF(debug.GT.0) WRITE(lu,*) 'END_SUSPENSION_COMPUTATION'
168 !
169 ! THIS RETURN CALL ENDS THE GAIA CALL TO GO BACK TO
170 ! T2D OR T3D AND SOLVE ADVECTION-DIFFUSION EQ.
171 ! GAIA WILL BE CALLED AGAIN FURTHER ON THE COMPLETE THE
172 ! BED EVOLUTION AND MASS BALANCE
173  RETURN
174 !
175  ENDIF
176 !
177  ENDIF !.NOT.SECOND_SUSP_STEP
178 !
179 !---------------------------------------------------------------------
180 ! CASE 2: SECOND_SUSP_STEP AND SUSP = TRUE OR SUSP = FALSE:
181 ! SECOND CALL TO GAIA IN THE TIME LOOP IF SUSP = TRUE
182 ! OR CONTINUATION OF THE ONLY CALL TO GAIA IF SUSP = FALSE
183 ! COMPUTE THE BED EVOLUTION AND THE MASS BALANCE
184 !---------------------------------------------------------------------
185  IF(second_susp_step.AND.susp) THEN
186 !
187  CALL gaia_suspension_deposit(code)
188 !
189  ENDIF
190 
191  CALL gaia_bedload_update()
192 !
193 !=======================================================================
194 !
195 ! MAXIMUM BOTTOM SLOPE : EVOL IN T1
196 !
197  IF(slide) THEN
198 !
199  CALL gaia_slide()
200 !
201  ENDIF !ENDIF (SLIDE)
202 !
203 !========================================================================
204 !
205 ! CONSOLIDATION
206 !
207  CALL gaia_consolidation()
208 !
209 ! BED EVOLUTION
210  CALL gaia_evolutions()
211 !=====================================================================
212 ! COMPUTES THE EVOLUTIONS FOR THIS CYCLE OF TIMESTEP
213 ! AND UPDATES AFTER THIS COMPUTATION
214 !=====================================================================
215 
216  CALL gaia_balance(zf_tel)
217 !
218 !=====================================================================
219 ! PRINTS OUT RESULTS AT THIS TIMESTEP
220 ! AND COMPARES AGAINST A REFERENCE FILE
221 !=====================================================================
222 !
223  IF(PRESENT(grcomp)) THEN
224  ggrcomp = grcomp
225  comp = .true.
226  ELSE
227  ggrcomp = 0
228  comp = .false.
229  ENDIF
230 
231  CALL gaia_write_results
232  & (code,grafcount,ggrcomp,comp,listcount,yagout,t_tel)
233 !
234 ! SENDS THE NEW ZF TO TELEMAC-2D OR 3D
235 !
236  CALL ov ('X=Y ', x=zf_tel%R, y=zf%R, dim1=npoin)
237 !
238 !------------------------------------------------------------------
239 !
240 #if defined COMPAD
242 #endif
243 !
244 !------------------------------------------------------------------
245 !
246  IF(valid) THEN
247  IF(debug.GT.0) WRITE(lu,*) 'CALL TO BIEF_VALIDA'
248 !
249 ! THE SUBROUTINE VALIDA FROM THE LIBRARY IS STANDARD
250 ! IT CAN BE MODIFIED FOR EACH PARTICULAR CASE
251 ! BUT ITS CALL MUST BE LEFT IN THE LOOP ON TIME
252 !
254  & gai_files(gairef)%FMT,
256  & gai_files(gaires)%FMT,
258  IF(debug.GT.0) WRITE(lu,*) 'RETURN FROM BIEF_VALIDA'
259  ENDIF
260 !
261 !------------------------------------------------------------------
262 !
263 #if defined COMPAD
265 #endif
266 !
267 !=====================================================================
268 ! RESET SECOND_SUSP_STEP TO FALSE FOR THE NEXT TIME STEP
269 !=====================================================================
270  second_susp_step=.false.
271 !
272  IF(debug.GT.0) WRITE(lu,*) 'END OF GAIA STEP'
273 !=======================================================================
274 !
275 ! /* END LOOP ON TIME */
276 !
277 !=======================================================================
278 !
279 #if defined COMPAD
280  CALL ad_gaia_end
281 #endif
282 !
283 !-----------------------------------------------------------------------
284 !
285  RETURN
286  END
integer, pointer nptfr
Number of boundary points.
subroutine gaia_write_results(CODE, GRAFCOUNT, GRCOMP, COMP, LISTCOUNT, YAGOUT, T_TEL)
type(bief_obj), target uw
Orbital wave velocity.
type(bief_obj), target s
Void structure.
type(bief_obj), target liqbor
Type of boundary conditions on sand transport rate.
type(bief_obj), target breach
Array saying whether the non-erodable bottom has been reached (vf)
subroutine ov(OP, X, Y, Z, C, DIM1)
Definition: ov.f:7
type(bief_obj), pointer t10
logical entet
Writes out (or not)
type(bief_obj), target maskel
Mask.
type(bief_obj), target acladm
Mean diameter of active-layer.
type(bief_obj), target limtec
Type of boundary conditions.
integer, target gaires
Various files ranks, which are also logical units if no coupling.
double precision hmin
Minimal value of the water height: below this value, the sediment flow rate is set to 0...
type(bief_obj), target u2d
Components of depth-averaged velocity.
type(bief_obj), target tob
Bed shear stress [n/m2].
subroutine gaia_bedload_update
double precision pi
Pi.
type(bief_obj), pointer t7
type(bief_obj), target calfa_cl
Cosinus of the angle between mean flow q and transport qs.
type(bief_obj), pointer t5
logical seccurrent
Secondary currents.
type(bief_obj), target v2d
subroutine ad_gaia_looprecords_end
logical, target susp
Suspension : yes if there is at least one suspended sediment this is the case if there is mud or if s...
logical valid
Validation.
subroutine gaia_prepare_step(H_TEL, U_TEL, V_TEL, CF_TEL, CHARR_TEL, CODE, DELTAR, DT_TEL, HW_TEL, KS_TEL, LISTCOUNT, LOOPCOUNT, SUSP_TEL, T_TEL, THETAW_TEL, TW_TEL, UETCAR, UW_TEL, ZF_TEL)
double precision, dimension(:), pointer x
2d coordinates of the mesh
double precision, dimension(nsiclm), target xwc
Settling velocities.
type(bief_obj), target zr
Non erodable (rigid) bottom elevation.
type(bief_obj), target volu2d
Integral of bases.
subroutine gaia_step(LOOPCOUNT, GRAFCOUNT, LISTCOUNT, TELNIT, U_TEL, V_TEL, H_TEL, ZF_TEL, UETCAR, DELTAR, CF_TEL, KS_TEL, CODE, U3D, V3D, T_TEL, VISC_TEL, DT_TEL, CHARR_TEL, SUSP_TEL, XMVE_TEL, GRAV_TEL, THETAW_TEL, HW_TEL, TW_TEL, UW_TEL, YAGOUT, API_ITER, GRCOMP)
Definition: gaia_step.F:12
type(bief_obj), target qscl_s
Suspended load transport rate for a sediment class.
double precision, target dt
Time step It may be different from the one in TELEMAC because of the morphological factor...
type(bief_file), dimension(maxlu_gai), target gai_files
For storing information on files.
logical houle
Include wave effects.
double precision xmve
Water density (from steering file of T2D or T3D)
integer bed_model
Bed model (3 choices, cf. dico)
integer, parameter kddl
type(bief_obj), target qsxc
Solid discharge (bedload), along x and y.
type(bief_obj), target qbor
Imposed solid transport at the boundary In m3/s, for every class.
integer optban
Option for the treatment of tidal flats.
character(len=32), dimension(maxvar) texte
Name of output variable.
type(bief_obj), target tobcw_max
Maximum of total current + wave shear stress.
double precision, dimension(:), pointer y
double precision vce
Water viscosity: it is defined here because the viscosity set in TELEMAC2D or TELEMAC3D may not b the...
type(bief_obj), target thetaw
Wave direction (deg wrt ox axis) !!!!!some say oy axis!!!!!
subroutine ad_gaia_timestep_end
type(bief_obj), target thetac
Current direction (deg trigo)
type(bief_obj), target fw
Quadratic friction coefficient (waves)
subroutine gaia_suspension_erode
integer, parameter maxvar
Maximum number of output variables.
type(bief_obj), target qsyc
subroutine ad_gaia_end
Definition: ad_gaia_end.f:3
integer, parameter kneu
integer, dimension(maxvar) alirv
For validation, each variable in the file is compared.
integer slopeff
Formula for slope effect.
double precision, dimension(nsiclm) xmvs0
Sand density.
integer, parameter kent
type(bief_obj), target salfa_cl
Sinus of the angle between mean flow q and transport qs.
logical slide
Sediment slide.
double precision zero
Parameter used for clipping variables or testing values against zero.
type(bief_obj), target hw
Significant wave height.
subroutine bedload_main_gaia(ACLADM, KSP, KSR, V2DPAR, UNSV2D, CF, EBOR, FW, HN, LIQBOR, MASK, MASKEL, MASKPT, QBOR, U2D, V2D, S, UNLADM, UW, THETAW, MU, TOB, TOBW, TW, ZF, DEBUG, HIDFAC, ICF, IELMT, KDDL, KDIR, KENT, KLOG, KNEU, KSORT, NPOIN, NPTFR, NSICLA, OPTBAN, BETA, DCLA, GRAV, HIDI, HMIN, VCE, XMVE, XMVS0, XWC, PI, KARMAN, ZERO, KARIM_HOLLY_YANG, MSK, SUSP, VF, MESH, LIEBOR, LIMTEC, MASKTR, IT1, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, UNORM, AC, DT, BREACH, CALFA_CL, COEFPN, HIDING, QSCL_C, QSCL_S, QS_C, QSCLXC, QSXC, QSCLYC, QSYC, SALFA_CL, ENTETS, SECCURRENT, SLOPEFF, PHISED, DEVIA, BETA2, BIJK, SEDCO, HOULE, U3D, V3D, CODE, FLBCLA, MAXADV, RATIO_SAND, H_TEL, HW, THETAC, TOBCW_MEAN, TOBCW_MAX, CSTAEQ)
type(bief_obj), target coefpn
Correction of transport for sloping bed effect.
integer icf
Bed-load transport formula.
type(bief_obj), pointer t8
type(bief_obj), target tb
Blocks of working arrays.
type(bief_obj), target hn
Water depth.
double precision, dimension(nsiclm), target dcla
Sediment diameter for each class It is only relevant for non-cohesive sediments. For the bedload...
type(bief_obj), target unorm
Norm of the mean flow velocity.
subroutine gaia_slide
Definition: gaia_slide.f:4
type(bief_obj), target unsv2d
Inverse of integral of bases.
type(bief_obj), target masktr
Mask.
logical, dimension(nsiclm) sedco
Cohesive sediments (for each class)
type(bief_obj), pointer t6
double precision, target phised
Friction angle of the sediment.
logical vf
Use a Finite Volumes formulation.
integer, target nsicla
Number of sediment classes of bed material (less than NISCLM)
integer, parameter kdir
double precision grav
Gravity acceleration.
type(bief_obj), pointer t2
type(bief_obj), target qsclyc
logical msk
Include masking.
type(bief_obj), pointer t1
Aliases for work vectors in tb.
type(bief_obj), target mu
Skin friction correction factor for bed roughness: Ratio between shear stress due skin friction and t...
type(bief_obj), target mask
Block of masks.
type(bief_obj), target qs_c
Solid discharge (bedload)
double precision, dimension(:,:,:), allocatable, target ratio_sand
Ratio of sand to all sands, for isand,ilayer,ipoin.
integer, target lt
Numero du pas de temps.
type(bief_obj), target qsclxc
Bedload transport rate in the x and y direction for a sediment class [kg*(m-1*s-1)].
double precision, dimension(nsiclm), target ac
Critical shields parameter.
integer devia
Formula for deviation.
type(bief_obj), pointer t4
double precision karim_holly_yang
Karim, Holly & Yang constant for hiding (with multiclass beds)
integer maxadv
Maximum number of iterations used for ensuring positive layer thickness. Beware that with larger time...
type(bief_obj), target qscl_c
Bedload transport rate for a sediment class [kg*(m-1*s-1)].
type(bief_obj), target tw
Mean wave period.
double precision bijk
B value for the Bijker formula.
subroutine gaia_consolidation
integer debug
Debugger.
subroutine gaia_suspension_deposit(CODE)
type(bief_obj), target ebor
Imposed bed evolution at the boundary [m].
type(bief_obj), target cstaeq
Sediment equilibrium concentration.
type(bief_obj), target varsor
Block of variables for output.
type(bief_obj), target cf
Quadratic friction coefficient.
double precision beta
Beta coefficient for Koch and Flokstra slope effect formulation.
type(bief_obj), target zf
Bottom elevation.
type(bief_obj), target tobw
Wave induced shear stress.
type(bief_mesh), target mesh
Mesh structure.
subroutine bief_valida(VARREF, TEXTREF, UREF, REFFORMAT, VARRES, TEXTRES, URES, RESFORMAT, MAXTAB, NP, IT, MAXIT, ACOMPARER)
Definition: bief_valida.f:8
integer ielmt
Missing comment.
logical, target charr
Include bedload in the simulation.
type(bief_obj), target liebor
Type of boundary conditions on bed evolution.
type(bief_obj), target hiding
Hiding factor correction.
integer, target gairef
type(bief_obj), pointer t12
logical second_susp_step
Logical used for coupling with T2D/T3D when suspension activated.
type(bief_obj), target tobcw_mean
Mean of total current + wave shear stress.
subroutine gaia_balance(ZF_TEL)
Definition: gaia_balance.f:6
subroutine bed1_update(ZR, ZF, VOLU2D)
Definition: bed1_update.f:7
double precision karman
Karman constant.
double precision, dimension(nsiclm) hidi
Hiding factor for each sediment class Used only if HIDFAC is set to 0. By default it is set to 1...
type(bief_obj), target ksr
Ripple bed roughness.
type(bief_obj), target ksp
Bed skin roughness.
integer, parameter klog
double precision, target beta2
Parameter for deviation.
subroutine gaia_evolutions
type(bief_obj), target it1
Integer working arrays.
type(bief_obj), target unladm
Mean diameter of under-layer.
type(bief_obj), pointer t13
integer, parameter ksort
integer, pointer npoin
Number of 2d points in the mesh.
character(len=32), dimension(maxvar) textpr
Name of variable in previous computation file.
type(bief_obj), pointer t11
type(bief_obj), pointer t9
integer hidfac
Hiding factor formulas.
type(bief_obj), pointer t3
type(bief_obj), target flbcla
Fluxes at boundary for every class.
Definition: bief.f:3
type(bief_obj), target maskpt
Mask on points.