source: trunk/SOURCES/Antarctique_general_files/dragging_plastic_LGM_mod.f90 @ 150

Last change on this file since 150 was 4, checked in by dumas, 10 years ago

initial import GRISLI trunk

File size: 10.0 KB
Line 
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
20module 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
29use module3d_phy
30use param_phy_mod
31use interface_input
32
33
34implicit none
35logical,dimension(nx,ny) :: fleuvemx       !< fleuves sont les tableaux courants (dep. time)   
36logical,dimension(nx,ny) :: fleuvemy
37logical,dimension(nx,ny) :: fleuve     
38logical,dimension(nx,ny) :: cote   
39real, dimension(nx,ny) :: Vcol_x           !< uniquement pour compatibilite dans le spinup cat (aurel)
40real, dimension(nx,ny) :: Vcol_y           !< uniquement pour compatibilite dans le spinup cat (aurel)
41real, dimension(nx,ny) :: Vsl_x            !< pour compatibilite dragging beta (aurel)
42real, dimension(nx,ny) :: Vsl_y            !< pour compatibilite dragging beta (aurel)
43real, dimension(nx,ny) :: work_tab         ! pour lire les masques
44real, dimension(nx,ny) :: drag_centre      !
45real, dimension(nx,ny) :: uslid_centre     ! pour calcul beta vitesse de glissement du pas précédent
46real, dimension(nx,ny) :: uslid_old        ! vitesse de glissement du pas antepenultieme pour test convergence
47
48logical :: corr_def = .false.              !< for deformation correction, pour compatibilite beta (aurel)
49
50character(len=100) :: masque_stream        !<  file masque streams autorises
51character(len=100) :: file_ncdf            !< fichier netcdf issue des fichiers .dat
52
53real    :: Tstream_lim                     !< limit for streaming (lower than melting point to account for spatial variability)
54real    :: tob_prescrit                    !< valeur pour les ice streams
55real    :: valmax
56integer :: imax,jmax
57integer :: i_moins1,i_plus1,j_moins1,j_plus1
58integer :: lmax=20
59integer :: idep,jdep,iloc,jloc
60
61integer :: nestim                          !< pour les estimateurs de convergence
62integer :: mm
63real    :: uslid_diff
64real    :: uslid_absdiff
65real    :: uslid_moy
66
67
68real :: tostick      ! pour la glace posee
69real :: tob_ile      ! pour les iles
70
71contains
72!-------------------------------------------------------------------------------
73
74
75!> SUBROUTINE: init_dragging
76!! Cette routine fait l'initialisation du dragging.
77!<   
78
79subroutine init_dragging      ! Cette routine fait l'initialisation du dragging.
80
81implicit none
82
83integer :: bidon
84
85 
86namelist/drag_plastic_LGM/Tstream_lim,tob_prescrit,betamax,masque_stream
87
88if (itracebug.eq.1) write(num_tracebug,*)' init_dragging avec dragging_plastic_LGM'
89
90
91! formats pour les ecritures dans 42
92428 format(A)
93
94! lecture des parametres du run                   
95!--------------------------------------------------------------------
96
97rewind(num_param)        ! pour revenir au debut du fichier param_list.dat
98read(num_param,drag_plastic_LGM)
99
100write(num_rep_42,428) '!___________________________________________________________' 
101write(num_rep_42,428) '! module dragging_plasticLGM '
102write(num_rep_42,drag_plastic_LGM)                   
103write(num_rep_42,428) '! critere de temperature pour passage en stream'
104write(num_rep_42,428) '! si T > Tlim'
105write(num_rep_42,428) '! seulement pour les points cotiers'
106write(num_rep_42,428) '! tob_prescrit : (Pa) frottement maxi sous les streams '
107write(num_rep_42,428) '! masque_stream : nom du fichier qui contient le masque de streams autorises'
108write(num_rep_42,*)
109
110tostick=betamax   ! valeurs pour les points non flgzmx
111tob_ile=tob_prescrit/2.
112!moteurmax=1.e5
113!moteurmax=0.
114
115!-------------------------------------------------------------------
116! masque stream : lecture du masque
117
118masque_stream  = trim(dirnameinp)//trim(masque_stream)
119
120!call lect_input(1,'z',1,work_tab,masque_stream,file_ncdf)
121
122call lect_input(1,'z',1,work_tab,masque_stream,file_ncdf)
123
124!call lect_ncfile('cry',work_tab,masque_stream)
125mstream(:,:) = 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
132do 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
139end do
140
141
142debug_3D(:,:,25) = mstream(:,:)
143
144
145! coefficient permettant de modifier le basal drag.
146drag_centre(:,:)  = 1
147drag_mx(:,:)      = 1.
148drag_my(:,:)      = 1.
149
150do 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
156end do
157
158uslid_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
172return
173end subroutine init_dragging
174!________________________________________________________________________________
175
176!> SUBROUTINE: dragging
177!! defini la localisation des streams et le frottement basal
178!<
179
180!-------------------------------------------------------------------------
181subroutine 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
188do 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
193end do
194
195fleuvemx(:,:)=.false.
196fleuvemy(:,:)=.false.
197fleuve(:,:)=.false.
198cote(:,:)=.false.
199cotemx(:,:)=.false.
200cotemy(:,:)=.false.
201
202! detection des cotes
203do  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
214end 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
219do 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
225end do
226
227! calcul des estimateurs
228
229
230nestim        = 0
231uslid_diff    = 0.
232uslid_absdiff = 0.
233uslid_moy     = 0.
234
235
236do 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
245end do
246
247if (nestim.gt.0) then
248   write(6,*) 'conv uslid',nestim,uslid_diff/nestim,uslid_absdiff/nestim,uslid_moy/nestim 
249end if
250
251uslid_old(:,:) = uslid_centre(:,:)
252
253do 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
267end 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
273where (flot(:,:))
274   drag_centre(:,:) = 0.
275end where
276
277call  beta_c2stag(nx,ny,drag_mx,drag_my,drag_centre)         ! redistribute on staggered grid
278
279
280
281where (cotemx(:,:))               ! point cotier forcement beta faible
282   drag_mx(:,:)=min(drag_mx(:,:),1000.)
283end where
284
285where (cotemy(:,:))               ! point cotier forcement beta faible
286   drag_my(:,:)=min(drag_my(:,:),1000.)
287end where
288
289betamx(:,:)     = drag_mx(:,:)
290betamy(:,:)     = drag_my(:,:)
291beta_centre(:,:) = drag_centre(:,:)
292
293where (fleuve(:,:))
294   debug_3D(:,:,1)=1
295elsewhere (flot(:,:))
296   debug_3D(:,:,1)=2
297elsewhere
298   debug_3D(:,:,1)=0
299endwhere
300
301where (cote(:,:))
302   debug_3D(:,:,2)=1
303elsewhere
304   debug_3D(:,:,2)=0
305endwhere
306
307where (fleuvemx(:,:))
308   debug_3D(:,:,3)=1
309elsewhere
310   debug_3D(:,:,3)=0
311endwhere
312
313where (flotmx(:,:))
314   debug_3D(:,:,3)=-1
315endwhere
316
317!_____________________
318
319
320where (fleuvemy(:,:))
321   debug_3D(:,:,4)=1
322elsewhere
323   debug_3D(:,:,4)=0
324endwhere
325
326where (flotmy(:,:))
327   debug_3D(:,:,4)=-1
328end where
329
330debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5) 
331debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5) 
332
333
334return
335end 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
360end module dragging_plastic_LGM
361
362
363
Note: See TracBrowser for help on using the repository browser.