1 | !> \file dragging-vit_bil_CISM_gen_neem_mod.f90 |
---|
2 | !! Definition des zones de streams apres lecture d'une carte evaluee offline |
---|
3 | !< |
---|
4 | |
---|
5 | !> \namespace dragging_neem |
---|
6 | !! Definition zone stream. Input neem : critere sur vitesse de bilan et sur la 'courbure' |
---|
7 | !! \author ... |
---|
8 | !! \date ... |
---|
9 | !! @note Defini les zones de stream avec : |
---|
10 | !! @note - un critere sur la hauteur d'eau |
---|
11 | !! @note - un critere de fleuves actuels |
---|
12 | !! @note Attention il faut fonctionner en additionnant SIA et Stream pour éviter les pb |
---|
13 | !! de fleuves en pointille |
---|
14 | !! @note Used module |
---|
15 | !! @note - use module3D_phy |
---|
16 | !! @note - use param_phy_mod |
---|
17 | !< |
---|
18 | |
---|
19 | |
---|
20 | module dragging_plastic_LGM |
---|
21 | |
---|
22 | ! Defini les zones de stream avec : |
---|
23 | ! * un critere sur la hauteur d'eau |
---|
24 | ! * un critere de fleuves actuels |
---|
25 | ! attention il faut fonctionner en additionnant SIA et Stream pour éviter les pb |
---|
26 | ! de fleuves en pointille |
---|
27 | |
---|
28 | |
---|
29 | use module3d_phy |
---|
30 | use param_phy_mod |
---|
31 | use interface_input |
---|
32 | |
---|
33 | |
---|
34 | implicit none |
---|
35 | logical,dimension(nx,ny) :: fleuvemx !< fleuves sont les tableaux courants (dep. time) |
---|
36 | logical,dimension(nx,ny) :: fleuvemy |
---|
37 | logical,dimension(nx,ny) :: fleuve |
---|
38 | logical,dimension(nx,ny) :: cote |
---|
39 | real, dimension(nx,ny) :: Vcol_x !< uniquement pour compatibilite dans le spinup cat (aurel) |
---|
40 | real, dimension(nx,ny) :: Vcol_y !< uniquement pour compatibilite dans le spinup cat (aurel) |
---|
41 | real, dimension(nx,ny) :: Vsl_x !< pour compatibilite dragging beta (aurel) |
---|
42 | real, dimension(nx,ny) :: Vsl_y !< pour compatibilite dragging beta (aurel) |
---|
43 | real, dimension(nx,ny) :: work_tab ! pour lire les masques |
---|
44 | real, dimension(nx,ny) :: drag_centre ! |
---|
45 | real, dimension(nx,ny) :: uslid_centre ! pour calcul beta vitesse de glissement du pas précédent |
---|
46 | real, dimension(nx,ny) :: uslid_old ! vitesse de glissement du pas antepenultieme pour test convergence |
---|
47 | |
---|
48 | logical :: corr_def = .false. !< for deformation correction, pour compatibilite beta (aurel) |
---|
49 | |
---|
50 | character(len=100) :: masque_stream !< file masque streams autorises |
---|
51 | character(len=100) :: file_ncdf !< fichier netcdf issue des fichiers .dat |
---|
52 | |
---|
53 | real :: Tstream_lim !< limit for streaming (lower than melting point to account for spatial variability) |
---|
54 | real :: tob_prescrit !< valeur pour les ice streams |
---|
55 | real :: valmax |
---|
56 | integer :: imax,jmax |
---|
57 | integer :: i_moins1,i_plus1,j_moins1,j_plus1 |
---|
58 | integer :: lmax=20 |
---|
59 | integer :: idep,jdep,iloc,jloc |
---|
60 | |
---|
61 | integer :: nestim !< pour les estimateurs de convergence |
---|
62 | integer :: mm |
---|
63 | real :: uslid_diff |
---|
64 | real :: uslid_absdiff |
---|
65 | real :: uslid_moy |
---|
66 | |
---|
67 | |
---|
68 | real :: tostick ! pour la glace posee |
---|
69 | real :: tob_ile ! pour les iles |
---|
70 | |
---|
71 | contains |
---|
72 | !------------------------------------------------------------------------------- |
---|
73 | |
---|
74 | |
---|
75 | !> SUBROUTINE: init_dragging |
---|
76 | !! Cette routine fait l'initialisation du dragging. |
---|
77 | !< |
---|
78 | |
---|
79 | subroutine init_dragging ! Cette routine fait l'initialisation du dragging. |
---|
80 | |
---|
81 | implicit none |
---|
82 | |
---|
83 | integer :: bidon |
---|
84 | |
---|
85 | |
---|
86 | namelist/drag_plastic_LGM/Tstream_lim,tob_prescrit,betamax,masque_stream |
---|
87 | |
---|
88 | if (itracebug.eq.1) write(num_tracebug,*)' init_dragging avec dragging_plastic_LGM' |
---|
89 | |
---|
90 | |
---|
91 | ! formats pour les ecritures dans 42 |
---|
92 | 428 format(A) |
---|
93 | |
---|
94 | ! lecture des parametres du run |
---|
95 | !-------------------------------------------------------------------- |
---|
96 | |
---|
97 | rewind(num_param) ! pour revenir au debut du fichier param_list.dat |
---|
98 | read(num_param,drag_plastic_LGM) |
---|
99 | |
---|
100 | write(num_rep_42,428) '!___________________________________________________________' |
---|
101 | write(num_rep_42,428) '! module dragging_plasticLGM ' |
---|
102 | write(num_rep_42,drag_plastic_LGM) |
---|
103 | write(num_rep_42,428) '! critere de temperature pour passage en stream' |
---|
104 | write(num_rep_42,428) '! si T > Tlim' |
---|
105 | write(num_rep_42,428) '! seulement pour les points cotiers' |
---|
106 | write(num_rep_42,428) '! tob_prescrit : (Pa) frottement maxi sous les streams ' |
---|
107 | write(num_rep_42,428) '! masque_stream : nom du fichier qui contient le masque de streams autorises' |
---|
108 | write(num_rep_42,*) |
---|
109 | |
---|
110 | tostick=betamax ! valeurs pour les points non flgzmx |
---|
111 | tob_ile=tob_prescrit/2. |
---|
112 | !moteurmax=1.e5 |
---|
113 | !moteurmax=0. |
---|
114 | |
---|
115 | !------------------------------------------------------------------- |
---|
116 | ! masque stream : lecture du masque |
---|
117 | |
---|
118 | masque_stream = trim(dirnameinp)//trim(masque_stream) |
---|
119 | |
---|
120 | !call lect_input(1,'z',1,work_tab,masque_stream,file_ncdf) |
---|
121 | |
---|
122 | call lect_input(1,'z',1,work_tab,masque_stream,file_ncdf) |
---|
123 | |
---|
124 | !call lect_ncfile('cry',work_tab,masque_stream) |
---|
125 | mstream(:,:) = int(work_tab(:,:)) |
---|
126 | |
---|
127 | !i = 154 |
---|
128 | !j = 123 |
---|
129 | !if (itracebug.eq.1) write(num_tracebug,*) 'init_dragging', masque_stream, work_tab(i,j) |
---|
130 | |
---|
131 | ! elargit les streams autorisés aux noeuds mineurs adjacents |
---|
132 | do j=1,ny |
---|
133 | do i=1,nx |
---|
134 | if (mstream(i,j).eq.1) then ! allowed ice streams |
---|
135 | mstream_mx(i:i+1,j) = 1 |
---|
136 | mstream_my(i,j:j+1) = 1 |
---|
137 | end if |
---|
138 | end do |
---|
139 | end do |
---|
140 | |
---|
141 | |
---|
142 | debug_3D(:,:,25) = mstream(:,:) |
---|
143 | |
---|
144 | |
---|
145 | ! coefficient permettant de modifier le basal drag. |
---|
146 | drag_centre(:,:) = 1 |
---|
147 | drag_mx(:,:) = 1. |
---|
148 | drag_my(:,:) = 1. |
---|
149 | |
---|
150 | do j=2,ny-1 |
---|
151 | do i=2,nx-1 |
---|
152 | uslid_centre(i,j) = (ux(i,j,nz)+ux(i-1,j,nz))**2+(uy(i,j,nz)+uy(i,j-1,nz))**2 |
---|
153 | uslid_centre(i,j) = uslid_centre(i,j)**0.5 |
---|
154 | uslid_centre(i,j) = max(uslid_centre(i,j),0.1) |
---|
155 | end do |
---|
156 | end do |
---|
157 | |
---|
158 | uslid_old(:,:) = uslid_centre(:,:) |
---|
159 | |
---|
160 | !!$call diffusiv() |
---|
161 | !!$call mix_SIA_L1 |
---|
162 | !!$call strain_rate() |
---|
163 | !!$ |
---|
164 | !!$do mm=1,50 |
---|
165 | !!$ write(6,*)'time, m',time, mm |
---|
166 | !!$ call diagnoshelf |
---|
167 | !!$ call mix_SIA_L1 |
---|
168 | !!$ call strain_rate() |
---|
169 | !!$end do |
---|
170 | |
---|
171 | |
---|
172 | return |
---|
173 | end subroutine init_dragging |
---|
174 | !________________________________________________________________________________ |
---|
175 | |
---|
176 | !> SUBROUTINE: dragging |
---|
177 | !! defini la localisation des streams et le frottement basal |
---|
178 | !< |
---|
179 | |
---|
180 | !------------------------------------------------------------------------- |
---|
181 | subroutine dragging ! defini la localisation des streams et le frottement basal |
---|
182 | |
---|
183 | |
---|
184 | ! les iles n'ont pas de condition neff mais ont la condition toblim |
---|
185 | ! (ce bloc etait avant dans flottab) |
---|
186 | |
---|
187 | |
---|
188 | do j=2,ny |
---|
189 | do i=2,nx |
---|
190 | ilemx(i,j)=ilemx(i,j).and.(abs(rog*Hmx(i,j)*sdx(i,j)).lt.toblim) |
---|
191 | ilemy(i,j)=ilemy(i,j).and.(abs(rog*Hmy(i,j)*sdy(i,j)).lt.toblim) |
---|
192 | end do |
---|
193 | end do |
---|
194 | |
---|
195 | fleuvemx(:,:)=.false. |
---|
196 | fleuvemy(:,:)=.false. |
---|
197 | fleuve(:,:)=.false. |
---|
198 | cote(:,:)=.false. |
---|
199 | cotemx(:,:)=.false. |
---|
200 | cotemy(:,:)=.false. |
---|
201 | |
---|
202 | ! detection des cotes |
---|
203 | do j=2,ny-1 |
---|
204 | do i=2,nx-1 |
---|
205 | if ((.not.flot(i,j)).and. & |
---|
206 | ((flot(i+1,j)).or.(flot(i,j+1)).or.(flot(i-1,j)).or.(flot(i,j-1)))) then |
---|
207 | cote(i,j)=.true. |
---|
208 | cotemx(i:i+1,j) = .true. |
---|
209 | cotemy(i,j:j+1) = .true. |
---|
210 | gzmx(i:i+1,j)=.true. |
---|
211 | gzmy(i,j:j+1)=.true. |
---|
212 | endif |
---|
213 | end do |
---|
214 | end do |
---|
215 | |
---|
216 | ! le calcul des fleuves se fait sur les mailles majeures |
---|
217 | ! normalement, les points cotiers sont deja tagges gzmx dans la routine flottab |
---|
218 | |
---|
219 | do j=2,ny-1 |
---|
220 | do i=2,nx-1 |
---|
221 | uslid_centre(i,j) = (ux(i,j,nz)+ux(i-1,j,nz))**2+(uy(i,j,nz)+uy(i,j-1,nz))**2 |
---|
222 | uslid_centre(i,j) = uslid_centre(i,j)**0.5 |
---|
223 | uslid_centre(i,j) = max(uslid_centre(i,j),0.1) |
---|
224 | end do |
---|
225 | end do |
---|
226 | |
---|
227 | ! calcul des estimateurs |
---|
228 | |
---|
229 | |
---|
230 | nestim = 0 |
---|
231 | uslid_diff = 0. |
---|
232 | uslid_absdiff = 0. |
---|
233 | uslid_moy = 0. |
---|
234 | |
---|
235 | |
---|
236 | do j=2,ny-1 |
---|
237 | do i=2,nx-1 |
---|
238 | if ((uslid_centre(i,j).gt..2).and.(.not.flot(i,j))) then |
---|
239 | nestim = nestim +1 |
---|
240 | uslid_diff = uslid_diff + (uslid_centre(i,j)-uslid_old(i,j)) |
---|
241 | uslid_absdiff = uslid_absdiff + abs( (uslid_centre(i,j)-uslid_old(i,j))) |
---|
242 | uslid_moy = uslid_moy + uslid_centre(i,j) |
---|
243 | end if |
---|
244 | end do |
---|
245 | end do |
---|
246 | |
---|
247 | if (nestim.gt.0) then |
---|
248 | write(6,*) 'conv uslid',nestim,uslid_diff/nestim,uslid_absdiff/nestim,uslid_moy/nestim |
---|
249 | end if |
---|
250 | |
---|
251 | uslid_old(:,:) = uslid_centre(:,:) |
---|
252 | |
---|
253 | do j=2,ny-1 |
---|
254 | do i=2,nx-1 |
---|
255 | if ( (T(i,j,nz)-Tpmp(i,j,nz).gt.Tstream_lim).and.(mstream(i,j).eq.1).and.(.not.flot(i,j))) then |
---|
256 | fleuve(i,j) = .true. |
---|
257 | drag_centre(i,j) = tob_prescrit/uslid_centre(i,j) |
---|
258 | drag_centre(i,j) = max(drag_centre(i,j),10.) |
---|
259 | fleuvemx(i:i+1,j)=.true. |
---|
260 | fleuvemy(i,j:j+1)=.true. |
---|
261 | gzmx(i:i+1,j)=.true. |
---|
262 | gzmy(i,j:j+1)=.true. |
---|
263 | else |
---|
264 | drag_centre(i,j) = tostick |
---|
265 | endif |
---|
266 | end do |
---|
267 | end do |
---|
268 | |
---|
269 | !i = 154 |
---|
270 | !j = 123 |
---|
271 | !write(num_tracebug,*)'dans drag_plastic', mstream(i,j),drag_centre(i,j),tob_prescrit,uslid_centre(i,j) |
---|
272 | |
---|
273 | where (flot(:,:)) |
---|
274 | drag_centre(:,:) = 0. |
---|
275 | end where |
---|
276 | |
---|
277 | call beta_c2stag(nx,ny,drag_mx,drag_my,drag_centre) ! redistribute on staggered grid |
---|
278 | |
---|
279 | |
---|
280 | |
---|
281 | where (cotemx(:,:)) ! point cotier forcement beta faible |
---|
282 | drag_mx(:,:)=min(drag_mx(:,:),1000.) |
---|
283 | end where |
---|
284 | |
---|
285 | where (cotemy(:,:)) ! point cotier forcement beta faible |
---|
286 | drag_my(:,:)=min(drag_my(:,:),1000.) |
---|
287 | end where |
---|
288 | |
---|
289 | betamx(:,:) = drag_mx(:,:) |
---|
290 | betamy(:,:) = drag_my(:,:) |
---|
291 | beta_centre(:,:) = drag_centre(:,:) |
---|
292 | |
---|
293 | where (fleuve(:,:)) |
---|
294 | debug_3D(:,:,1)=1 |
---|
295 | elsewhere (flot(:,:)) |
---|
296 | debug_3D(:,:,1)=2 |
---|
297 | elsewhere |
---|
298 | debug_3D(:,:,1)=0 |
---|
299 | endwhere |
---|
300 | |
---|
301 | where (cote(:,:)) |
---|
302 | debug_3D(:,:,2)=1 |
---|
303 | elsewhere |
---|
304 | debug_3D(:,:,2)=0 |
---|
305 | endwhere |
---|
306 | |
---|
307 | where (fleuvemx(:,:)) |
---|
308 | debug_3D(:,:,3)=1 |
---|
309 | elsewhere |
---|
310 | debug_3D(:,:,3)=0 |
---|
311 | endwhere |
---|
312 | |
---|
313 | where (flotmx(:,:)) |
---|
314 | debug_3D(:,:,3)=-1 |
---|
315 | endwhere |
---|
316 | |
---|
317 | !_____________________ |
---|
318 | |
---|
319 | |
---|
320 | where (fleuvemy(:,:)) |
---|
321 | debug_3D(:,:,4)=1 |
---|
322 | elsewhere |
---|
323 | debug_3D(:,:,4)=0 |
---|
324 | endwhere |
---|
325 | |
---|
326 | where (flotmy(:,:)) |
---|
327 | debug_3D(:,:,4)=-1 |
---|
328 | end where |
---|
329 | |
---|
330 | debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5) |
---|
331 | debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5) |
---|
332 | |
---|
333 | |
---|
334 | return |
---|
335 | end subroutine dragging |
---|
336 | |
---|
337 | !______________________________________________________________________________________ |
---|
338 | !>SUBROUTINE: beta_c2stag_min |
---|
339 | !! redistribute central values on staggered grid |
---|
340 | !< |
---|
341 | |
---|
342 | subroutine beta_c2stag(nxx,nyy,R_mx,R_my,R_centre) ! redistribute central values on staggered grid |
---|
343 | |
---|
344 | implicit none |
---|
345 | integer :: nxx,nyy ! dimension des tableaux |
---|
346 | real, dimension(nxx,nyy), intent(out) :: R_mx ! valeur du beta sur maille mx |
---|
347 | real, dimension(nxx,nyy), intent(out) :: R_my ! valeur du beta sur maille my |
---|
348 | real, dimension(nxx,nyy), intent(in) :: R_centre ! valeur du beta sur maille centree |
---|
349 | |
---|
350 | do j=2,nyy |
---|
351 | do i=2,nxx |
---|
352 | R_mx(i,j)= (R_centre(i-1,j)+R_centre(i,j))*0.5 |
---|
353 | R_my(i,j)= (R_centre(i,j-1)+R_centre(i,j))*0.5 |
---|
354 | end do |
---|
355 | end do |
---|
356 | |
---|
357 | end subroutine beta_c2stag |
---|
358 | |
---|
359 | |
---|
360 | end module dragging_plastic_LGM |
---|
361 | |
---|
362 | |
---|
363 | |
---|