1 | !> \file diffusiv-polyn-0.5.F90 |
---|
2 | !! Contient la subroutine de calcul diffusivites |
---|
3 | !< |
---|
4 | |
---|
5 | !> SUBROUTINE: diffusiv |
---|
6 | !! Calcule de diffusivites |
---|
7 | !! \author Catherine |
---|
8 | !! \date 18 mars 2006 |
---|
9 | !! @note Used modules: |
---|
10 | !! @note - use module3D_phy |
---|
11 | !! @note - use module_choix |
---|
12 | !! |
---|
13 | !< |
---|
14 | subroutine diffusiv() |
---|
15 | |
---|
16 | ! =============================================================== |
---|
17 | ! ** DIFFUSIVITIES 18 mars 2006 *** |
---|
18 | ! glissement avec reserve d'eau 29 Avril 97 |
---|
19 | ! choix sur le type de discretisation (locale iloc=1 ) |
---|
20 | ! |
---|
21 | ! Modification Vince --> 2 fev 95 |
---|
22 | ! pour couplage avec Shelf |
---|
23 | ! |
---|
24 | ! Modification C. Dumas Dec 99 |
---|
25 | ! DDX, SA,S2A,... ont une dimension en plus (loi de deformation) |
---|
26 | ! |
---|
27 | ! Modifications de Cat du 11 juin 2000 |
---|
28 | ! Modif Christophe 24 janv 2002 : passage au fortran 90 |
---|
29 | ! pour optimisation de la routine |
---|
30 | ! Modif Vincent dec 2003 : on utilise plus frontmx/y > commentaires |
---|
31 | ! |
---|
32 | ! Modif Cat mars 2003 |
---|
33 | ! modif mars 2007 : moyennes de S2a avec S2a_mx et S2a_my |
---|
34 | |
---|
35 | ! =============================================================== |
---|
36 | |
---|
37 | USE module3D_phy |
---|
38 | |
---|
39 | use module_choix |
---|
40 | |
---|
41 | implicit none |
---|
42 | |
---|
43 | REAL :: ulgliss,ultot,glenexp |
---|
44 | REAL :: INV_4DX ! inverse de dx pour eviter les divisions =1/(4*dx) |
---|
45 | REAL :: INV_4DY ! inverse de dy pour eviter les divisions =1/(4*dy) |
---|
46 | INTEGER :: ii |
---|
47 | integer :: ll |
---|
48 | |
---|
49 | if (itracebug.eq.1) call tracebug(' Entree dans routine diffusiv') |
---|
50 | |
---|
51 | ! la valeur de ff est donnee dans initial |
---|
52 | ! limitation de la vitesse de glissement et totale |
---|
53 | ulgliss=10000. |
---|
54 | ultot=10000. |
---|
55 | |
---|
56 | |
---|
57 | INV_4DX=1/(4*dx) |
---|
58 | INV_4DY=1/(4*dy) |
---|
59 | |
---|
60 | ! initialisation de la diffusion |
---|
61 | diffmx(:,:)=0. |
---|
62 | diffmy(:,:)=0. |
---|
63 | |
---|
64 | |
---|
65 | ! calcul de SDX, SDY et de la pente au carre en mx et en my : |
---|
66 | |
---|
67 | call slope_surf |
---|
68 | |
---|
69 | |
---|
70 | ! Mise ne réserve des vitesses flgzmx et flgzmy ! non ca a l'air de se cumuler |
---|
71 | where (flgzmx(:,:)) |
---|
72 | ! uxflgz(:,:)=uxbar(:,:) |
---|
73 | elsewhere |
---|
74 | uxflgz(:,:)=0. |
---|
75 | endwhere |
---|
76 | |
---|
77 | where (flgzmy(:,:)) |
---|
78 | ! uyflgz(:,:)=uybar(:,:) |
---|
79 | elsewhere |
---|
80 | uyflgz(:,:)=0. |
---|
81 | endwhere |
---|
82 | |
---|
83 | |
---|
84 | ! Calcul de ddy et ddx pour chaque valeur de iglen |
---|
85 | !------------------------------------------------------------------------------------ |
---|
86 | |
---|
87 | |
---|
88 | do iglen=n1poly,n2poly |
---|
89 | glenexp=max(0.,(glen(iglen)-1.)/2.) |
---|
90 | |
---|
91 | |
---|
92 | do J=1,NY |
---|
93 | do I=1,NX ! -1 |
---|
94 | |
---|
95 | if (.not.flotmy(i,j)) then ! On calcule quand la deformation même pour les ice streams |
---|
96 | ! if (.not.flgzmy(i,j)) then ! ancienne version |
---|
97 | ! si marine les points de la grounding zone |
---|
98 | ! sont traites avec le shelf |
---|
99 | ! si pas marine, ils sont traites ici |
---|
100 | |
---|
101 | |
---|
102 | |
---|
103 | DDY(I,J,iglen)=((SLOPE2my(I,J)** & ! SLOPE2my calcule en debut de routine |
---|
104 | glenexp)*(ROG)**glen(iglen)) & |
---|
105 | *HMY(I,J)**(glen(iglen)+1) |
---|
106 | endif |
---|
107 | end do |
---|
108 | end do |
---|
109 | end do |
---|
110 | |
---|
111 | do iglen=n1poly,n2poly |
---|
112 | glenexp=max(0.,(glen(iglen)-1.)/2.) |
---|
113 | |
---|
114 | |
---|
115 | do J=1,NY !-1 |
---|
116 | do I=1,NX |
---|
117 | |
---|
118 | if (.not.flotmx(i,j)) then ! bug y->x corrige le 5 avril 2008 ( |
---|
119 | |
---|
120 | |
---|
121 | |
---|
122 | DDX(I,J,iglen)=((SLOPE2mx(I,J)** & ! SLOPE2mx calcule en debut de routine |
---|
123 | glenexp)*(ROG)**glen(iglen)) & |
---|
124 | *HMX(I,J)**(glen(iglen)+1) |
---|
125 | |
---|
126 | endif |
---|
127 | end do |
---|
128 | end do |
---|
129 | end do |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | |
---|
134 | ! ------------------------------------------------- |
---|
135 | ! GLISSEMENT |
---|
136 | ! DDBX et DDBY termes dus au glissement |
---|
137 | ! relation avec la vitesse de glissement UBx et UBy |
---|
138 | ! UBx=-DDBX*SDX et UBy=-DDBY*SDY |
---|
139 | ! ------------------------------------------------- |
---|
140 | |
---|
141 | ! le glissement est maintenant dans un module a part choisi dans le module choix |
---|
142 | ! pour l'instant seules les lois Heino (loigliss=4) et Bindshadler(loigliss=2) sont programmees. |
---|
143 | |
---|
144 | call sliding |
---|
145 | |
---|
146 | ! vitesse de déformation----------------------------------------------- |
---|
147 | |
---|
148 | |
---|
149 | ydef: do j=2,NY |
---|
150 | do I=2,NX ! -1 |
---|
151 | |
---|
152 | |
---|
153 | if (.not.flotmy(i,j)) then ! On calcule la deformation même pour les ice streams |
---|
154 | ! if (.not.flgzmy(i,j)) then ! ancienne version |
---|
155 | |
---|
156 | if (abs(sdy(i,j)).gt.10.e-10) then !limitation de la vitesse de glissement |
---|
157 | ddby(i,j)=min(ddby(i,j),abs(ulgliss/sdy(i,j))) |
---|
158 | endif |
---|
159 | |
---|
160 | uybar(i,j)=ddby(i,j) |
---|
161 | |
---|
162 | do iglen=n1poly,n2poly |
---|
163 | |
---|
164 | ! uybar(i,j)=uybar(i,j)+ddy(i,j,iglen)*(s2a(i,j,1,iglen) & |
---|
165 | ! +s2a(i,j-1,1,iglen))/2. |
---|
166 | uybar(i,j)=uybar(i,j)+ddy(i,j,iglen)*(s2a_my(i,j,1,iglen)) |
---|
167 | |
---|
168 | end do |
---|
169 | diffmy(i,j)=uybar(i,j) ! pour utilisation comme diffusion, a multiplier par H |
---|
170 | uybar(i,j)=uybar(i,j)*(-sdy(i,j)) |
---|
171 | |
---|
172 | uby(i,j)=-(ddby(i,j)*sdy(i,j)) |
---|
173 | uydef(i,j)=uybar(i,j)-uby(i,j) |
---|
174 | |
---|
175 | |
---|
176 | else ! points flottants |
---|
177 | uydef(i,j)=0. |
---|
178 | uby(i,j)=0. |
---|
179 | endif |
---|
180 | end do |
---|
181 | end do ydef |
---|
182 | |
---|
183 | |
---|
184 | |
---|
185 | |
---|
186 | xdef: do J=2,NY !-1 |
---|
187 | do I=2,NX |
---|
188 | |
---|
189 | if (.not.flotmx(i,j)) then |
---|
190 | |
---|
191 | if (abs(sdx(i,j)).gt.10.e-10) then !limitation de la vitesse de glissement |
---|
192 | ddbx(i,j)=min(ddbx(i,j),abs(ulgliss/sdx(i,j))) |
---|
193 | endif |
---|
194 | |
---|
195 | uxbar(i,j)=ddbx(i,j) |
---|
196 | |
---|
197 | |
---|
198 | do iglen=n1poly,n2poly |
---|
199 | |
---|
200 | ! uxbar(i,j)=uxbar(i,j)+ddx(i,j,iglen)*(s2a(i,j,1,iglen) & |
---|
201 | ! +s2a(i-1,j,1,iglen))/2. |
---|
202 | uxbar(i,j)=uxbar(i,j)+ddx(i,j,iglen)*s2a_mx(i,j,1,iglen) |
---|
203 | |
---|
204 | end do |
---|
205 | diffmx(i,j)=uxbar(i,j) ! pour utilisation comme diffusion, a multiplier par H |
---|
206 | uxbar(i,j)=uxbar(i,j)*(-sdx(i,j)) |
---|
207 | ubx(i,j)=-(ddbx(i,j)*sdx(i,j)) |
---|
208 | uxdef(i,j)=uxbar(i,j)-ubx(i,j) |
---|
209 | |
---|
210 | else |
---|
211 | uxdef(i,j)=0. |
---|
212 | ubx(i,j)=0. |
---|
213 | endif |
---|
214 | |
---|
215 | end do |
---|
216 | end do xdef |
---|
217 | |
---|
218 | ! Recherche des vitesses >1000m/an |
---|
219 | ll=0 |
---|
220 | ii=0 |
---|
221 | |
---|
222 | |
---|
223 | ! mise a 0 si pas marine et flottant |
---|
224 | if (marine) goto 88 |
---|
225 | do j=2,ny |
---|
226 | do I=2,nx |
---|
227 | if (.not.marine.and.flotmx(i,j).and..not.gzmx(i,j) ) then |
---|
228 | uxbar(i,j)=0. |
---|
229 | do k=1,nz |
---|
230 | ux(i,j,k)=uxbar(i,j) |
---|
231 | end do |
---|
232 | else if (.not.marine.and.gzmx(i,j)) then |
---|
233 | do k=1,nz |
---|
234 | ux(i,j,k)=uxbar(i,j) |
---|
235 | end do |
---|
236 | endif |
---|
237 | if (.not.marine.and.flotmy(i,j).and..not.gzmy(i,j)) then |
---|
238 | uybar(i,j)=0. |
---|
239 | do k=1,nz |
---|
240 | uy(i,j,k)=uybar(i,j) |
---|
241 | end do |
---|
242 | else if (.not.marine.and.gzmy(i,j)) then |
---|
243 | do k=1,nz |
---|
244 | uy(i,j,k)=uybar(i,j) |
---|
245 | end do |
---|
246 | endif |
---|
247 | end do |
---|
248 | end do |
---|
249 | |
---|
250 | |
---|
251 | 88 continue |
---|
252 | |
---|
253 | ! limitation par ultot---------------------------------------------------------- |
---|
254 | |
---|
255 | ! la limitation selon x |
---|
256 | where(.not.flgzmx(:,:)) |
---|
257 | uxbar(:,:)=min(uxbar(:,:),ultot) |
---|
258 | uxbar(:,:)=max(uxbar(:,:),-ultot) |
---|
259 | end where |
---|
260 | |
---|
261 | ! la limitation selon y |
---|
262 | where(.not.flgzmy(:,:)) |
---|
263 | uybar(:,:)=min(uybar(:,:),ultot) |
---|
264 | uybar(:,:)=max(uybar(:,:),-ultot) |
---|
265 | end where |
---|
266 | |
---|
267 | ! cas particulier des sommets ou il ne reste plus de neige. |
---|
268 | do j=2,ny-1 |
---|
269 | do i=2,nx-1 |
---|
270 | if ((H(i,j).le.1.).and.(.not.flot(i,j))) then |
---|
271 | uxbar(i+1,j)=min(uxbar(i+1,j),ultot) ! n'agit que si ux -> |
---|
272 | uxbar(i,j)=max(uxbar(i,j),-ultot) ! n'agit que si ux <- |
---|
273 | uybar(i,j+1)=min(uybar(i,j+1),ultot) |
---|
274 | uybar(i,j)=max(uybar(i,j),-ultot) |
---|
275 | endif |
---|
276 | end do |
---|
277 | end do |
---|
278 | |
---|
279 | if (itracebug.eq.1) call tracebug(' avant flgz diffusiv ') |
---|
280 | |
---|
281 | ! On remet les vitesses flgz |
---|
282 | where (flgzmx(:,:)) |
---|
283 | uxbar(:,:)=uxflgz(:,:) |
---|
284 | endwhere |
---|
285 | |
---|
286 | where (flgzmy(:,:)) |
---|
287 | uybar(:,:)=uyflgz(:,:) |
---|
288 | endwhere |
---|
289 | if (itracebug.eq.1) call tracebug(' fin diffusiv ') |
---|
290 | |
---|
291 | return |
---|
292 | end subroutine diffusiv |
---|
293 | |
---|