source: branches/GRISLIv3/SOURCES/Draggings_modules/dragging_param_beta_mod.f90 @ 504

Last change on this file since 504 was 504, checked in by aquiquet, 6 weeks ago

Cleaning branch: remove unused cote variable

File size: 7.5 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_param_beta
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
25  use geography, only: nx,ny
26  ! pour compilation de steps_time_loop :
27  use fake_beta_iter_vitbil_mod, only:time_iter,time_iter_end,nb_iter_vitbil,beta_iter_vitbil
28
29  implicit none
30
31  real,dimension(nx,ny) :: beta_param ! local variable
32
33  real :: betamin   ! betamin : (Pa) frottement mini sous les streams
34
35  real :: beta_slope        ! = A in:     B = A x Neff ** K
36  real :: beta_expo         ! = K in:     B = A x Neff ** K
37
38  real,dimension(nx,ny) :: neff   ! pression effective noeuds majeurs
39  real,dimension(nx,ny) :: hwatmx ! hauteur d'eau staggered grille - afq
40  real,dimension(nx,ny) :: hwatmy ! hauteur d'eau staggered grille - afq
41
42  real :: neffmin = 1.e5 ! as in neffect, but this should be the exact same variable
43
44  real, dimension(nx,ny) :: Vcol_x           !< uniquement pour compatibilite avec spinup cat
45  real, dimension(nx,ny) :: Vcol_y           !< uniquement pour compatibilite avec spinup cat
46  real, dimension(nx,ny) :: Vsl_x            !< uniquement pour compatibilite avec spinup cat
47  real, dimension(nx,ny) :: Vsl_y            !< uniquement pour compatibilite avec spinup cat
48  logical :: corr_def = .false.              !< for deformation correction, pour compatibilite beta
49
50contains
51  !-------------------------------------------------------------------------------
52
53  !> SUBROUTINE: init_dragging
54  !! Cette routine fait l'initialisation du dragging.
55  !>
56  subroutine init_dragging      ! Cette routine fait l'initialisation du dragging.
57
58    use module3d_phy, only:betamax,num_param,num_rep_42,inv_beta,mstream_mx,mstream_my,&
59         drag_mx,drag_my,betamax_2d,niter_nolin
60    use runparam, only:itracebug
61
62    implicit none
63
64    namelist/drag_param_beta/beta_slope,beta_expo,betamax,betamin
65
66    if (itracebug.eq.1)  call tracebug(' dragging avec neff et slope')
67
68
69
70    ! lecture des parametres du run                      block drag neff
71    !--------------------------------------------------------------------
72
73    rewind(num_param)        ! pour revenir au debut du fichier param_list.dat
74    read(num_param,drag_param_beta)
75
76    write(num_rep_42,'(A)')'!___________________________________________________________' 
77    write(num_rep_42,'(A)') '&drag_param_beta          ! nom du bloc dragging param beta'
78    write(num_rep_42,*)
79    write(num_rep_42,*) 'beta_slope            = ', beta_slope
80    write(num_rep_42,*) 'beta_expo             = ', beta_expo
81    write(num_rep_42,*) 'betamax               = ', betamax
82    write(num_rep_42,*) 'betamin               = ', betamin
83    write(num_rep_42,*)'/'                           
84    write(num_rep_42,'(A)') '! Slope & expo of beta = - slope x Neff ** expo'
85   
86    inv_beta=0
87    !-------------------------------------------------------------------
88    ! masque stream
89    mstream_mx(:,:)=1
90    mstream_my(:,:)=1
91
92
93    ! coefficient permettant de modifier le basal drag.
94    drag_mx(:,:)=1.
95    drag_my(:,:)=1.
96
97    betamax_2d(:,:) = betamax
98
99    niter_nolin = 1
100
101    return
102  end subroutine init_dragging
103  !________________________________________________________________________________
104
105  !> SUBROUTINE: dragging
106  !! Defini la localisation des streams et le frottement basal
107  !>
108  !-------------------------------------------------------------------------
109  subroutine dragging   ! defini le frottement basal
110
111    use module3d_phy, only:neffmx,neffmy,hwater,betamx,betamy,betamax,flot,&
112         beta_centre
113   
114    !$ USE OMP_LIB
115
116
117    implicit none
118    integer :: i,j
119
120    !$OMP PARALLEL
121    ! calcul de neff (pression effective sur noeuds majeurs)
122    if (sum(neffmx(:,:)).le.0.) neffmx(:,:) =1.e8
123    if (sum(neffmy(:,:)).le.0.) neffmy(:,:) =1.e8
124
125    !$OMP DO
126    do j=1,ny-1
127       do i=1,nx-1
128          neff(i,j)=(neffmx(i,j)+neffmx(i+1,j)+neffmy(i,j)+neffmy(i,j+1))/4
129       enddo
130    enddo
131    !$OMP END DO
132    !aurel, for the borders:
133    !$OMP WORKSHARE
134    neff(:,ny)=neffmin
135    neff(nx,:)=neffmin
136    ! calcul de hwat (staggered)
137    hwatmx(:,:)=0.
138    hwatmy(:,:)=0.
139    !$OMP END WORKSHARE
140    !$OMP DO
141    do i=2,nx
142       hwatmx(i,:)=(hwater(i-1,:)+hwater(i,:))/2.
143    enddo
144    !$OMP END DO
145    !$OMP DO
146    do j=2,ny
147       hwatmy(:,j)=(hwater(:,j-1)+hwater(:,j))/2.
148    enddo
149    !$OMP END DO
150
151    !$OMP WORKSHARE
152
153    ! new parametrisation of beta on Neff:
154    betamx(:,:)= beta_slope*(neffmx(:,:)**beta_expo)
155    betamy(:,:)= beta_slope*(neffmy(:,:)**beta_expo)
156
157    betamx(:,:)=max(betamx(:,:),betamin)
158    betamy(:,:)=max(betamy(:,:),betamin)
159    betamx(:,:)=min(betamx(:,:),betamax)
160    betamy(:,:)=min(betamy(:,:),betamax)
161
162    where ( hwatmx(:,:) .lt. 0.5 ) betamx(:,:) = betamax
163    where ( hwatmy(:,:) .lt. 0.5 ) betamy(:,:) = betamax
164
165    !$OMP END WORKSHARE
166
167    ! points flottants
168    !$OMP DO
169    do j=2,ny
170       do i=2,nx
171          if (flot(i,j).and.(flot(i-1,j))) then
172             betamx(i,j)=0.
173          end if
174          if (flot(i,j).and.(flot(i,j-1))) then
175             betamy(i,j)=0.
176          end if
177       end do
178    end do
179    !$OMP END DO
180
181    !$OMP DO
182    do j=2,ny-1
183       do i=2,nx-1
184          beta_centre(i,j) = ((betamx(i,j)+betamx(i+1,j)) &
185               + (betamy(i,j)+betamy(i,j+1)))*0.25
186       end do
187    end do
188    !$OMP END DO
189    !$OMP END PARALLEL
190
191    return
192  end subroutine dragging
193  !________________________________________________________________________________
194
195  !> SUBROUTINE: mstream_dragging
196  !! Defini la localisation des streams
197  !>
198  !-------------------------------------------------------------------------
199  subroutine mstream_dragging   ! defini la localisation des streams
200
201    use module3d_phy, only:fleuvemx,fleuvemy,gzmx,gzmy,flgzmx,flgzmy,flotmx,flotmy,flot,&
202         betamx,betamy,betamax
203    !$ USE OMP_LIB
204   
205    implicit none
206    integer :: i,j
207
208    !$OMP PARALLEL
209
210    !$OMP WORKSHARE
211    fleuvemx(:,:)=.false.
212    fleuvemy(:,:)=.false.
213    gzmx(:,:)=.true.
214    gzmy(:,:)=.true.
215    flgzmx(:,:)=.false.
216    flgzmy(:,:)=.false.
217    !$OMP END WORKSHARE
218
219
220    ! calcul de gzmx
221
222    ! points flottants : flgzmx mais pas gzmx
223    !$OMP DO
224    do j=2,ny
225       do i=2,nx
226          if (flot(i,j).and.(flot(i-1,j))) then
227             flotmx(i,j)=.true.
228             flgzmx(i,j)=.true.
229             gzmx(i,j)=.false.
230             betamx(i,j)=0.
231          end if
232          if (flot(i,j).and.(flot(i,j-1))) then
233             flotmy(i,j)=.true.
234             flgzmy(i,j)=.true.
235             gzmy(i,j)=.false.
236             betamy(i,j)=0.
237          end if
238       end do
239    end do
240    !$OMP END DO
241
242    !--------- autres criteres
243
244    ! points poses
245    !$OMP WORKSHARE
246    gzmx(:,:)=gzmx(:,:).and.(betamx(:,:).lt.betamax)   !  Pas de calcul pour les points
247    gzmy(:,:)=gzmy(:,:).and.(betamy(:,:).lt.betamax)   !  au fort beta
248
249    flgzmx(:,:) = flgzmx(:,:) .or. gzmx(:,:)
250    flgzmy(:,:) = flgzmy(:,:) .or. gzmy(:,:)
251
252    fleuvemx(:,:)=gzmx(:,:)
253    fleuvemy(:,:)=gzmy(:,:)
254    !$OMP END WORKSHARE
255
256    !$OMP END PARALLEL
257
258    return
259  end subroutine mstream_dragging
260
261end module dragging_param_beta
262
Note: See TracBrowser for help on using the repository browser.