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,uldef,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 de déformation et totale |
---|
53 | ulgliss = V_limit |
---|
54 | ultot = V_limit |
---|
55 | uldef = 2000. |
---|
56 | |
---|
57 | |
---|
58 | INV_4DX=1/(4*dx) |
---|
59 | INV_4DY=1/(4*dy) |
---|
60 | |
---|
61 | ! initialisation de la diffusion |
---|
62 | diffmx(:,:)=0. |
---|
63 | diffmy(:,:)=0. |
---|
64 | |
---|
65 | |
---|
66 | ! calcul de SDX, SDY et de la pente au carre en mx et en my : |
---|
67 | |
---|
68 | call slope_surf |
---|
69 | |
---|
70 | !call sliding ! au sens vitesse de glissement, afq, commented 21 apr 16 |
---|
71 | |
---|
72 | ! le glissement est maintenant dans un module a part choisi dans le module choix |
---|
73 | ! pour l'instant seules les lois Heino (loigliss=4) et Bindshadler(loigliss=2) |
---|
74 | ! sont programmees. |
---|
75 | |
---|
76 | ! ddbx et ddby termes dus au glissement |
---|
77 | ! relation avec la vitesse de glissement ubx et uby |
---|
78 | ! ubx=-ddbx*sdx et uby=-ddby*sdy |
---|
79 | ! ------------------------------------------------- |
---|
80 | |
---|
81 | ! Calcul de la vitesse de glissement, qu'elle soit calculee par diagno ou par sliding |
---|
82 | !------------------------------------------------------------------------------------ |
---|
83 | ! |
---|
84 | where (flgzmx(:,:)) |
---|
85 | ubx(:,:) = uxflgz(:,:) |
---|
86 | elsewhere |
---|
87 | ubx(:,:) = ddbx(:,:)* (-sdx(:,:)) ! on pourrait mettre une limitation |
---|
88 | endwhere |
---|
89 | |
---|
90 | where (flgzmy(:,:)) |
---|
91 | uby(:,:) = uyflgz(:,:) |
---|
92 | elsewhere |
---|
93 | uby(:,:) = ddby(:,:)* (-sdy(:,:)) |
---|
94 | endwhere |
---|
95 | |
---|
96 | |
---|
97 | if (itracebug.eq.1) call tracebug(' diffusiv apres calcul glissement') |
---|
98 | |
---|
99 | |
---|
100 | |
---|
101 | ! Deformation SIA : Calcul de ddy et ddx pour chaque valeur de iglen |
---|
102 | !------------------------------------------------------------------ |
---|
103 | |
---|
104 | do iglen=n1poly,n2poly |
---|
105 | glenexp=max(0.,(glen(iglen)-1.)/2.) |
---|
106 | |
---|
107 | |
---|
108 | do j=1,ny |
---|
109 | do i=1,nx |
---|
110 | |
---|
111 | if (.not.flotmy(i,j)) then ! On calcule quand la deformation même pour les ice streams |
---|
112 | ddy(i,j,iglen)=((slope2my(i,j)** & ! slope2my calcule en debut de routine |
---|
113 | glenexp)*(rog)**glen(iglen)) & |
---|
114 | *hmy(i,j)**(glen(iglen)+1) |
---|
115 | |
---|
116 | |
---|
117 | endif |
---|
118 | end do |
---|
119 | end do |
---|
120 | end do |
---|
121 | |
---|
122 | do iglen=n1poly,n2poly |
---|
123 | glenexp=max(0.,(glen(iglen)-1.)/2.) |
---|
124 | |
---|
125 | |
---|
126 | do j=1,ny |
---|
127 | do i=1,nx |
---|
128 | |
---|
129 | if (.not.flotmx(i,j)) then ! bug y->x corrige le 5 avril 2008 ( |
---|
130 | |
---|
131 | ddx(i,j,iglen)=((slope2mx(i,j)** & ! slope2mx calcule en debut de routine |
---|
132 | glenexp)*(rog)**glen(iglen)) & |
---|
133 | *hmx(i,j)**(glen(iglen)+1) |
---|
134 | endif |
---|
135 | end do |
---|
136 | end do |
---|
137 | end do |
---|
138 | |
---|
139 | ! vitesse due a la déformation----------------------------------------------- |
---|
140 | |
---|
141 | |
---|
142 | ydef: do j=2,ny |
---|
143 | do i=1,nx |
---|
144 | |
---|
145 | if (.not.flotmy(i,j)) then ! On calcule la deformation même pour les ice streams |
---|
146 | |
---|
147 | uydef(i,j)=0. |
---|
148 | diffmy(i,j)=0. |
---|
149 | |
---|
150 | do iglen=n1poly,n2poly |
---|
151 | diffmy(i,j)=diffmy(i,j)+ddy(i,j,iglen)*(s2a_my(i,j,1,iglen)) |
---|
152 | end do |
---|
153 | |
---|
154 | uydef(i,j)=diffmy(i,j)*(-sdy(i,j)) ! partie deformation |
---|
155 | uydef(i,j)=min(uydef(i,j),uldef) |
---|
156 | uydef(i,j)=max(uydef(i,j),-uldef) |
---|
157 | |
---|
158 | diffmy(i,j)=diffmy(i,j)+ddby(i,j) ! pour utilisation comme diffusion, a multiplier par H |
---|
159 | |
---|
160 | uybar(i,j)=uby(i,j)+uydef(i,j) |
---|
161 | |
---|
162 | |
---|
163 | else ! points flottants |
---|
164 | uydef(i,j)=0. ! normalement uxbed est attribue |
---|
165 | endif |
---|
166 | end do |
---|
167 | end do ydef |
---|
168 | |
---|
169 | xdef: do j=1,ny |
---|
170 | do i=2,nx |
---|
171 | |
---|
172 | if (.not.flotmx(i,j)) then ! On calcule la deformation même pour les ice streams |
---|
173 | |
---|
174 | uxdef(i,j)=0. |
---|
175 | diffmx(i,j)=0. |
---|
176 | |
---|
177 | do iglen=n1poly,n2poly |
---|
178 | diffmx(i,j)=diffmx(i,j)+ddx(i,j,iglen)*(s2a_mx(i,j,1,iglen)) |
---|
179 | end do |
---|
180 | |
---|
181 | uxdef(i,j)=diffmx(i,j)*(-sdx(i,j)) ! partie deformation |
---|
182 | uxdef(i,j)=min(uxdef(i,j),uldef) |
---|
183 | uxdef(i,j)=max(uxdef(i,j),-uldef) |
---|
184 | |
---|
185 | |
---|
186 | diffmx(i,j)=diffmx(i,j)+ddbx(i,j) ! pour utilisation comme diffusion, |
---|
187 | ! a multiplier par H |
---|
188 | uxbar(i,j)=ubx(i,j)+uxdef(i,j) |
---|
189 | |
---|
190 | |
---|
191 | else ! points flottants |
---|
192 | uxdef(i,j)=0. ! normalement uxbed est attribue |
---|
193 | endif |
---|
194 | end do |
---|
195 | end do xdef |
---|
196 | |
---|
197 | if (itracebug.eq.1) call tracebug(' diffusiv avant limit') |
---|
198 | |
---|
199 | |
---|
200 | ! limitation par ultot---------------------------------------------------------- |
---|
201 | |
---|
202 | ! la limitation selon x |
---|
203 | where(.not.flgzmx(:,:)) |
---|
204 | uxbar(:,:)=min(uxbar(:,:),ultot) |
---|
205 | uxbar(:,:)=max(uxbar(:,:),-ultot) |
---|
206 | end where |
---|
207 | |
---|
208 | ! la limitation selon y |
---|
209 | where(.not.flgzmy(:,:)) |
---|
210 | uybar(:,:)=min(uybar(:,:),ultot) |
---|
211 | uybar(:,:)=max(uybar(:,:),-ultot) |
---|
212 | end where |
---|
213 | |
---|
214 | ! cas particulier des sommets ou il ne reste plus de neige. |
---|
215 | do j=2,ny-1 |
---|
216 | do i=2,nx-1 |
---|
217 | if ((H(i,j).le.1.).and.(.not.flot(i,j))) then |
---|
218 | uxbar(i+1,j)=min(uxbar(i+1,j),ultot) ! n'agit que si ux -> |
---|
219 | uxbar(i,j)=max(uxbar(i,j),-ultot) ! n'agit que si ux <- |
---|
220 | uybar(i,j+1)=min(uybar(i,j+1),ultot) |
---|
221 | uybar(i,j)=max(uybar(i,j),-ultot) |
---|
222 | endif |
---|
223 | end do |
---|
224 | end do |
---|
225 | |
---|
226 | if (itracebug.eq.1) call tracebug(' fin diffusiv ') |
---|
227 | |
---|
228 | return |
---|
229 | end subroutine diffusiv |
---|
230 | |
---|