The TELEMAC-MASCARET system  trunk
predes_gaia.f
Go to the documentation of this file.
1 ! **********************
2  SUBROUTINE predes_gaia
3 ! **********************
4 !
5  &(llt,aat,yagout,code,listcount)
6 !
7 !***********************************************************************
8 ! GAIA
9 !***********************************************************************
10 !
13 !
14 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
21 !
22  USE bief
24  IMPLICIT NONE
25 !
26 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
27 !
28  INTEGER , INTENT(IN) :: LLT,LISTCOUNT
29  DOUBLE PRECISION , INTENT(IN) :: AAT
30  CHARACTER(LEN=24) , INTENT(IN) :: CODE
31  LOGICAL , INTENT(IN) :: YAGOUT
32 !
33 !!-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
34 !
35  INTEGER LTT,I,J,K
36  LOGICAL IMP,LEO
37 !
38 !-----------------------------------------------------------------------
39 !
40 ! THE OUTPUT VARIABLES ARE BUILT ONLY IF NECESSARY, HENCE THE
41 ! FOLLOWING TESTS, WHICH MUST BE THE SAME AS IN DESIMP (BIEF LIBRARY)
42 !
43  imp=.false.
44  leo=.false.
45  ltt=(llt/listcount)*listcount
46  IF(llt.EQ.ltt.AND.llt.GE.ptinil) imp=.true.
47 ! IF CODE =TELEMAC2D OUTOUT IS MANAGED BY T2D
48  IF(code(8:9).EQ.'2D'.OR.code(8:9).EQ.'3D') leo=yagout
49 !
50 ! NO PRINTOUTS REUIRED: LEAVING
51  IF (.NOT.(leo.OR.imp)) GO TO 1000
52 !
53 !=======================================================================
54 ! COMPUTES SECONDARY VARIABLES
55 !=======================================================================
56 !
57 ! FREE SURFACE: H+ZF
58 !
59  IF((leo.AND.sorleo(4)).OR.(imp.AND.sorimp(4))) THEN
60  CALL os('X=Y+Z ',x=z,y=hn,z=zf)
61  ENDIF
62 !
63 ! DISCHARGE
64 !
65  IF((leo.AND.sorleo(6)).OR.(imp.AND.sorimp(6))) THEN
66  DO i=1,npoin
67  q%R(i)=hn%R(i)*sqrt(u2d%R(i)**2+v2d%R(i)**2)
68  ENDDO
69  ENDIF
70 !
71 ! DISCHARGE ALONG X
72 !
73  IF((leo.AND.sorleo(7)).OR.(imp.AND.sorimp(7))) THEN
74  CALL os('X=YZ ',x=qu,y=u2d,z=hn)
75  ENDIF
76 !
77 ! DISCHARGE ALONG Y
78 !
79  IF((leo.AND.sorleo(8)).OR.(imp.AND.sorimp(8))) THEN
80  CALL os('X=YZ ',x=qv,y=v2d,z=hn)
81  ENDIF
82 !
83 !=======================================================================
84 !
85 ! VARIABLES WHICH ARE NOT INITIALISED AT THE FIRST CALL OF PREDES_GAIA
86 !
87  IF(llt.EQ.0) THEN
88 ! JMH ON 27/11/2009
89  IF((leo.AND.sorleo(19)).OR.(imp.AND.sorimp(19))) THEN
90  CALL os('X=0 ',x=ks)
91  ENDIF
92  ENDIF
93 !
94 !=======================================================================
95 ! UPDATE THE Values of the writing blocks
96 !=======================================================================
97 !
98  ! For memory optimisation (from intel debug)
99  ! For RATIOS
100  IF ((leo.AND.sorleo(nvar_ratios+1)).OR.
101  & (imp.AND.sorimp(nvar_ratios+1))) THEN
102  DO k=1,nomblay
103  DO i=1,nsand
104  ratios%ADR(k+(i-1)*nomblay)%P%R=ratio_sand(i,k,1:npoin)
105  ENDDO
106  ENDDO
107  ENDIF
108  ! For RATIOM
109  IF((leo.AND.sorleo(nvar_ratiom+1)).OR.
110  & (imp.AND.sorimp(nvar_ratiom+1))) THEN
111  DO k=1,nomblay
112  DO i=1,nmud
113  ratiom%ADR(k+(i-1)*nomblay)%P%R=ratio_mud(i,k,1:npoin)
114  ENDDO
115  ENDDO
116  ENDIF
117  ! For Layconc
118  IF((leo.AND.sorleo(nvar_layconc+1)).OR.
119  & (imp.AND.sorimp(nvar_layconc+1))) THEN
120  DO k=1,nomblay
121  layconc%ADR(k)%P%R=conc_mud(k,1:npoin)
122  ENDDO
123  ENDIF
124  ! For mass_s
125  IF((leo.AND.sorleo(nvar_mass_s+1)).OR.
126  & (imp.AND.sorimp(nvar_mass_s+1))) THEN
127  DO k=1,nomblay
128  DO i=1,nsand
129  mass_s%ADR(k+(i-1)*nomblay)%P%R=mass_sand(i,k,1:npoin)
130  ENDDO
131  ENDDO
132  ENDIF
133  ! For mass_m
134  IF((leo.AND.sorleo(nvar_mass_m+1)).OR.
135  & (imp.AND.sorimp(nvar_mass_m+1))) THEN
136  DO k=1,nomblay
137  DO i=1,nmud
138  mass_m%ADR(k+(i-1)*nomblay)%P%R=mass_mud(i,k,1:npoin)
139  ENDDO
140  ENDDO
141  ENDIF
142  ! For mtransfer
143  IF((leo.AND.sorleo(nvar_mtrans+1)).OR.
144  & (imp.AND.sorimp(nvar_mtrans+1))) THEN
145  DO k=1,nomblay
146  mtransfer%ADR(k)%P%R=trans_mass(k,1:npoin)
147  ENDDO
148  ENDIF
149  ! For tocemud
150  IF((leo.AND.sorleo(nvar_tocemud+1)).OR.
151  & (imp.AND.sorimp(nvar_tocemud+1))) THEN
152  DO k=1,nomblay
153  tocemud%ADR(k)%P%R=toce_mud(k,1:npoin)
154  ENDDO
155  ENDIF
156  ! For partheniades
157  IF((leo.AND.sorleo(nvar_parthe+1)).OR.
158  & (imp.AND.sorimp(nvar_parthe+1))) THEN
159  DO k=1,nomblay
160  parthe%ADR(k)%P%R=partheniades(k,1:npoin)
161  ENDDO
162  ENDIF
163 !
164 !=======================================================================
165 ! UPDATE THE POINTERS TO THE DIFFERENTIATED VARIABLES
166 !=======================================================================
167 !
168  j = nvar_advar
169  DO i = 1,nadvar
170  IF((leo.AND.sorleo(j)).OR.(imp.AND.sorimp(j))) THEN
171  CALL ad_get_gaia(i,advar%ADR(i)%P)
172  j = j + 1
173  ENDIF
174  ENDDO
175 !
176 !=======================================================================
177 !
178 1000 CONTINUE
179 !
180 !=======================================================================
181 !
182  RETURN
183  END
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 u2d
Components of depth-averaged velocity.
double precision, dimension(:,:), allocatable, target toce_mud
Critical erosion shear stress of the mud, for each bed layer, for each point. It is variable in space...
type(bief_obj), target q
Flow rate.
double precision, dimension(:,:,:), allocatable, target mass_mud
Surface mass of mud (kg/m2), for imud,ilayer,ipoin.
type(bief_obj), target v2d
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
type(bief_obj), target ratiom
Sediment composition : mud (for output variables)
logical, dimension(maxvar) sorimp
Listing output.
logical, dimension(maxvar) sorleo
Graphical output.
type(bief_obj), target ks
Total bed roughness.
double precision, dimension(:), pointer y
double precision, dimension(:,:,:), allocatable, target mass_sand
Surface mass of sand (kg/m2), for isand,ilayer,ipoin.
type(bief_obj), target parthe
Partheniades erosion coefficient (for output variables)
type(bief_obj), target ratios
Sediment composition : sand (for output variables)
type(bief_obj), target qu
X component of the flow rate.
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...
integer nsand
Total number of sand.
integer ptinil
First time from which to write the listing outputs.
type(bief_obj), target advar
Block of differentiated vectors.
subroutine predes_gaia(LLT, AAT, YAGOUT, CODE, LISTCOUNT)
Definition: predes_gaia.f:7
subroutine ad_get_gaia(IVAR, ADOBJ)
Definition: ad_get_gaia.F:7
type(bief_obj), target hn
Water depth.
type(bief_obj), target layconc
Layer concentration (for output variables)
double precision, dimension(:,:), allocatable, target partheniades
Partheniades erosion coefficient, for each bed layer, for each point. It is variable in space for the...
double precision, dimension(:,:,:), allocatable, target ratio_mud
Ratio of mud to all muds, for imud,ilayer,ipoin.
type(bief_obj), target z
Free surface elevation.
type(bief_obj), target qv
Y component of the flow rate.
integer nmud
Total number of muds.
double precision, dimension(:,:,:), allocatable, target ratio_sand
Ratio of sand to all sands, for isand,ilayer,ipoin.
type(bief_obj), target mass_m
Mud mass (for output variables)
subroutine os(OP, X, Y, Z, C, IOPT, INFINI, ZERO)
Definition: os.f:7
type(bief_obj), target zf
Bottom elevation.
type(bief_obj), target mass_s
Sand mass (for output variables)
type(bief_obj), target tocemud
Critical erosion shear stress of the mud (for output variables)
integer nadvar
Number of differentiating arrays, and those with a given name.
integer nvar_ratios
Index in varsor for output variables.
integer, pointer npoin
Number of 2d points in the mesh.
Definition: bief.f:3
type(bief_obj), target mtransfer
Mass transfer for consolidation between layers (for output variables)