source: branches/iLoveclim/SOURCES/dragging_hwat_contmaj_mod.f90 @ 244

Last change on this file since 244 was 187, checked in by aquiquet, 6 years ago

Grisli-iloveclim branch merged to trunk at revision 185

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