source: trunk/SOURCES/dragging_neff_contmaj_mod.f90 @ 56

Last change on this file since 56 was 56, checked in by aquiquet, 8 years ago

Preventing Hemin40 to be very slow when using dragging_neff_contmaj

File size: 10.8 KB
Line 
1!> \file dragging_neff_contmaj_mod.f90
2!! Defini les zones de stream avec 3 criteres
3!<
4
5!> \namespace  dragging_neff_contmaj
6!! Defini les zones de stream avec 3 criteres
7!! \author ...
8!! \date ...
9!! @note Les trois criteres sont:
10!! @note   * un critere sur la pression effective
11!! @note   * un critere de continuite depuis la cote
12!! @note   * un critere sur la courbure du socle (si negatif, vallees)
13!! @note Used module
14!! @note   - use module3D_phy
15!! @note   - use param_phy_mod
16!<
17
18module dragging_neff_contmaj
19
20! Defini les zones de stream avec :
21! * un critere sur la pression effective
22! * un critere de continuite depuis la cote
23! * un critere sur la courbure du socle (si negatif, vallees)
24
25use module3d_phy
26use param_phy_mod
27
28implicit none
29logical,dimension(nx,ny) :: fleuvemx
30logical,dimension(nx,ny) :: fleuvemy
31logical,dimension(nx,ny) :: fleuve
32logical,dimension(nx,ny) :: cote
33
34
35real :: valmax
36integer :: imax,jmax
37integer :: i_moins1,i_plus1,j_moins1,j_plus1
38integer :: lmax=20
39integer :: idep,jdep,iloc,jloc
40
41
42real :: tostick   ! pour la glace posee
43real :: betamin   ! betamin : (Pa) frottement mini sous les streams
44real :: tob_ile    ! pour les iles
45real :: cry_lim=50.  ! courbure limite pour le suivi des fleuves
46
47real,dimension(nx,ny) :: neff ! pression effective noeuds majeurs
48real :: seuil_neff    ! seuil sur la pression effective pour avoir glissement en zone sediment
49real :: coef_gz       ! coef frottement zones stream std  (10)
50real :: coef_ile      ! coef frottement zones iles   (0.1)
51
52real, dimension(nx,ny) :: Vcol_x           !< uniquement pour compatibilite avec spinup cat
53real, dimension(nx,ny) :: Vcol_y           !< uniquement pour compatibilite avec spinup cat
54real, dimension(nx,ny) :: Vsl_x            !< uniquement pour compatibilite avec spinup cat
55real, dimension(nx,ny) :: Vsl_y            !< uniquement pour compatibilite avec spinup cat
56logical :: corr_def = .false.              !< for deformation correction, pour compatibilite beta
57
58contains
59!-------------------------------------------------------------------------------
60
61!> SUBROUTINE: init_dragging
62!! Cette routine fait l'initialisation du dragging.
63!>
64subroutine init_dragging      ! Cette routine fait l'initialisation du dragging.
65
66implicit none
67 
68namelist/drag_neff_cont/hwatstream,cf,betamax,betamin,toblim,seuil_neff,coef_gz,coef_ile
69
70if (itracebug.eq.1)  call tracebug(' dragging avec hwatermax')
71
72
73! formats pour les ecritures dans 42
74428 format(A)
75
76! lecture des parametres du run                      block drag neff
77!--------------------------------------------------------------------
78
79rewind(num_param)        ! pour revenir au debut du fichier param_list.dat
80read(num_param,drag_neff_cont)
81
82write(num_rep_42,428)'!___________________________________________________________' 
83write(num_rep_42,428) '&drag_neff_cont              ! nom du bloc dragging neff cont'
84write(num_rep_42,*)
85write(num_rep_42,*) 'hwatstream      = ',hwatstream 
86write(num_rep_42,*) 'cf              = ',cf
87write(num_rep_42,*) 'betamax         = ', betamax
88write(num_rep_42,*) 'betamin         = ', betamin
89write(num_rep_42,*) 'toblim          = ', toblim
90write(num_rep_42,*) 'seuil_neff      = ', seuil_neff
91write(num_rep_42,*) 'coef_gz         = ', coef_gz
92write(num_rep_42,*) 'coef_ile        = ', coef_ile
93write(num_rep_42,*)'/'                           
94write(num_rep_42,428) '! hwatstream (m) :  critere de passage en stream en partant de la cote'
95write(num_rep_42,428) '!  si hwater > hwatstream '
96write(num_rep_42,428) '! cf coefficient de la loi de frottement fonction Neff'
97write(num_rep_42,428) '! betamax : (Pa) frottement maxi sous les streams '
98write(num_rep_42,428) '! betamin : (Pa) frottement mini sous les streams '
99write(num_rep_42,428) '! toblim : (Pa)  pour les iles '
100write(num_rep_42,428) '! seuil_neff (Pa) seuil sur la pression effective pour avoir glissement'
101write(num_rep_42,428) '! coef_gz : coef frottement zones stream std'
102write(num_rep_42,428) '! coef_ile : coef frottement zones iles'
103write(num_rep_42,*)
104
105tostick=1.e5   ! valeurs pour les points non flgzmx
106tob_ile=betamax/2.
107moteurmax=toblim
108
109!-------------------------------------------------------------------
110! masque stream
111
112      mstream_mx(:,:)=1
113      mstream_my(:,:)=1
114
115
116! coefficient permettant de modifier le basal drag.
117      drag_mx(:,:)=1.
118      drag_my(:,:)=1.
119
120where (socle_cry(:,:).lt.cry_lim)
121   debug_3D(:,:,25)=1
122elsewhere
123   debug_3D(:,:,25)=0
124endwhere
125
126   
127      return
128      end subroutine init_dragging
129!________________________________________________________________________________
130
131!> SUBROUTINE: dragging
132!! Defini la localisation des streams et le frottement basal
133!>
134!-------------------------------------------------------------------------
135subroutine dragging   ! defini la localisation des streams et le frottement basal
136
137
138!         les iles n'ont pas de condition neff mais ont la condition toblim
139!         (ce bloc etait avant dans flottab)
140
141
142do j=2,ny
143   do i=2,nx
144      ilemx(i,j)=ilemx(i,j).and.(abs(rog*Hmx(i,j)*sdx(i,j)).lt.toblim)
145      ilemy(i,j)=ilemy(i,j).and.(abs(rog*Hmy(i,j)*sdy(i,j)).lt.toblim)
146   end do
147end do
148
149! le calcul des fleuves se fait sur les mailles majeures en partant de la cote
150
151
152
153
154! le gzmx initial a ete calculé dans flottab pour les points a cheval sur la grounding line
155
156! Partant de la cote, le fleuve est determine en remontant vers le point de hauteur d'eau max
157! tant que ce point est superieur a hwatermax.
158
159! Attention : ce systeme ne permet pas d'avoir des fleuves convergents
160!             et les fleuves n'ont une épaisseur que de 1 noeud.
161
162fleuvemx(:,:)=.false.
163fleuvemy(:,:)=.false.
164fleuve(:,:)=.false.
165cote(:,:)=.false.
166
167! detection des cotes
168do  j=2,ny-1 
169   do i=2,nx-1 
170      if ((.not.flot(i,j)).and. & 
171      ((flot(i+1,j)).or.(flot(i,j+1)).or.(flot(i-1,j)).or.(flot(i,j-1)))) then
172         cote(i,j)=.true.
173      endif
174   end do
175end do
176
177! calcul de neff (pression effective sur noeuds majeurs)
178do j=1,ny-1
179   do i=1,nx-1
180        neff(i,j)=(neffmx(i,j)+neffmx(i+1,j)+neffmy(i,j)+neffmy(i,j+1))/4
181   enddo
182enddo
183!aurel, for the borders:
184neff(:,ny)=1.e5
185neff(nx,:)=1.e5
186
187
188fleuve_maj: do j=2,ny-1 
189ifleuve:   do i=2,nx-1                     
190
191cote_detect :  if (cote(i,j)) then
192         idep=i
193         jdep=j
194
195         if (socle_cry(i,j).lt.0.) then    ! dans une vallee
196            fleuve(i,j)=.true. 
197         else
198            cote(i,j)=.false.
199            cycle ifleuve
200         endif
201
202suit : do l=1,lmax         ! debut de la boucle de suivi, lmax longueur maxi des fleuves
203           i_moins1=max(idep-1,2)
204           j_moins1=max(jdep-1,1)
205           i_plus1=min(idep+1,nx)
206           j_plus1=min(jdep+1,ny)
207           
208! recherche du max en suivant le socle le plus profond
209! * en excluant les points flottants
210! * et ceux qui sont deja tagges fleuves
211
212           valmax=1000.
213
214           do jloc=j_moins1,j_plus1
215              do iloc=i_moins1,i_plus1
216 
217                 if ((B(iloc,jloc).lt.valmax)      & 
218                      .and.(.not.flot(iloc,jloc))  &
219                      .and.(.not.fleuve(iloc,jloc)).and.(socle_cry(iloc,jloc).lt.cry_lim)) then
220                    imax=iloc
221                    jmax=jloc
222                    valmax=B(iloc,jloc)
223                 endif
224              end do
225           end do
226
227         if ((hwater(imax,jmax).gt.hwatstream).and.(socle_cry(i,j).lt.cry_lim)) then
228            fleuve(imax,jmax)=.true.
229            idep=imax
230            jdep=jmax
231         else
232            fleuve(imax,jmax)=.false.
233            exit suit
234         end if
235 
236      end do suit
237
238   end if cote_detect
239
240end do ifleuve
241end do fleuve_maj
242
243! aurel, we add the neff threshold:
244where ((neff(:,:).le.seuil_neff).and.(.not.flot(:,:)).and.(H(:,:).gt.1.)) fleuve(:,:)=.true.
245
246do j=1,ny-1
247   do i=1,nx-1
248      if (fleuve(i,j)) then
249         fleuvemx(i,j)=.true.
250         fleuvemx(i+1,j)=.true.
251         fleuvemy(i,j)=.true.
252         fleuvemy(i,j+1)=.true.
253      end if
254   end do
255end do
256
257! pas de fleuve dans les endroits trop en pente
258
259!fleuvemx(:,:)=fleuvemx(:,:).and.(abs(rog*Hmx(:,:)*sdx(:,:)).lt.toblim)
260!fleuvemy(:,:)=fleuvemy(:,:).and.(abs(rog*Hmy(:,:)*sdy(:,:)).lt.toblim)
261
262do j=1,ny
263   do i=1,nx
264      if ((.not.ilemx(i,j)).and.(fleuvemx(i,j))) gzmx(i,j)=.true. 
265
266! calcul du frottement basal (ce bloc etait avant dans neffect)
267
268      if (cotemx(i,j)) then                        ! point cotier
269         betamx(i,j)=cf*neffmx(i,j) 
270         betamx(i,j)=min(betamx(i,j),betamax)
271      else if ((gzmx(i,j)).and.(.not.cotemx(i,j))) then  ! stream
272         betamx(i,j)=cf*neffmx(i,j)*coef_gz
273         betamx(i,j)=min(betamx(i,j),betamax)
274         betamx(i,j)=max(betamx(i,j),betamin)
275
276         !aurel, function of betamax and not 1500 as before:
277         if (cf*neffmx(i,j).gt.betamax*2.) then
278            gzmx(i,j)=.false.
279            betamx(i,j)=tostick
280         endif
281
282      else if (ilemx(i,j)) then
283         betamx(i,j)=cf*neffmx(i,j)*coef_ile 
284         betamx(i,j)=min(betamx(i,j),tob_ile)       
285      else if (flotmx(i,j)) then     ! flottant ou ile
286         betamx(i,j)=0.
287      else                                         ! grounded, SIA
288         betamx(i,j)=tostick                       ! frottement glace posee (1 bar)
289      endif
290
291   end do
292end do
293
294
295do j=1,ny                  ! le noeud 1 n'est pas attribue
296   do i=1,nx   
297
298      if ((.not.ilemy(i,j)).and.(fleuvemy(i,j))) gzmy(i,j)=.true. 
299
300
301 ! calcul du frottement basal (ce bloc etait avant dans neffect)
302
303      if (cotemy(i,j)) then                        ! point cotier
304         betamy(i,j)=cf*neffmy(i,j) 
305         betamy(i,j)=min(betamy(i,j),betamax)
306      else if ((gzmy(i,j)).and.(.not.cotemy(i,j))) then  ! stream
307         betamy(i,j)=cf*neffmy(i,j)*coef_gz
308         betamy(i,j)=min(betamy(i,j),betamax)
309         betamy(i,j)=max(betamy(i,j),betamin)
310
311         !aurel, function of betamax and not 1500 as before:
312         if (cf*neffmy(i,j).gt.betamax*2.) then
313            gzmy(i,j)=.false.
314            betamy(i,j)=tostick
315         endif
316
317      else if (ilemy(i,j)) then
318         betamy(i,j)=cf*neffmy(i,j)*coef_ile
319         betamy(i,j)=min(betamy(i,j),tob_ile)     
320      else if (flotmy(i,j)) then     ! flottant ou ile
321         betamy(i,j)=0.
322      else                               ! grounded, SIA
323         betamy(i,j)=tostick             ! frottement glace posee
324      endif
325     
326   end do
327end do
328
329
330where (fleuve(:,:))
331   debug_3D(:,:,1)=1
332elsewhere (flot(:,:))
333   debug_3D(:,:,1)=2
334elsewhere
335   debug_3D(:,:,1)=0
336endwhere
337
338where (cote(:,:))
339   debug_3D(:,:,2)=1
340elsewhere
341   debug_3D(:,:,2)=0
342endwhere
343
344where (fleuvemx(:,:))
345   debug_3D(:,:,3)=1
346elsewhere
347   debug_3D(:,:,3)=0
348endwhere
349
350where (flotmx(:,:))
351   debug_3D(:,:,3)=-1
352endwhere
353
354!_____________________
355
356
357where (fleuvemy(:,:))
358   debug_3D(:,:,4)=1
359elsewhere
360   debug_3D(:,:,4)=0
361endwhere
362
363where (flotmy(:,:))
364   debug_3D(:,:,4)=-1
365end where
366
367debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5) 
368debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5) 
369
370return
371end subroutine dragging
372
373end module dragging_neff_contmaj
374
Note: See TracBrowser for help on using the repository browser.