Changeset 76 for trunk/SOURCES/conserv-mass-adv-diff_sept2009_mod.f90
- Timestamp:
- 06/29/16 16:21:13 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/conserv-mass-adv-diff_sept2009_mod.f90
r65 r76 80 80 subroutine icethick3 81 81 82 !$ USE OMP_LIB 83 82 84 implicit none 83 85 real,dimension(nx,ny) :: Dminx,Dminy … … 92 94 ! Copie de H sur vieuxH 93 95 ! -------------------- 96 !$OMP PARALLEL 97 !$OMP WORKSHARE 94 98 where (mk0(:,:).eq.0) 95 99 vieuxH(:,:)=0. … … 99 103 vieuxH(:,:)=H(:,:) 100 104 end where 105 !$OMP END WORKSHARE 101 106 102 107 ! mk0 est le masque à ne jamais dépasser … … 110 115 jmaxdia=0 111 116 112 ! attention limitation ! 117 ! attention limitation ! 118 !$OMP WORKSHARE 113 119 uxbar(:,:)=max(uxbar(:,:),-V_limit) 114 120 uxbar(:,:)=min(uxbar(:,:),V_limit) 115 121 uybar(:,:)=max(uybar(:,:),-V_limit) 116 122 uybar(:,:)=min(uybar(:,:),V_limit) 123 !$OMP END WORKSHARE 117 124 118 125 ! le pas de temps est choisi pour rendre la matrice advective diagonale dominante 119 do i=2,nx-1 120 do j=2,ny-1 126 !$OMP END PARALLEL 127 !$OMP PARALLEL 128 !$OMP DO PRIVATE(aux) 129 !do i=2,nx-1 130 ! do j=2,ny-1 131 do j=2,ny-1 132 do i=2,nx-1 121 133 aux = (abs(uxbar(i,j)) + abs(uxbar(i+1,j))) & 122 134 + (abs(uybar(i,j)) + abs(uybar(i,j+1))) 123 135 aux=aux*dx1*0.5 136 !$OMP CRITICAL 124 137 if (aux.gt.maxdia) then 125 138 maxdia=aux 126 imaxdia=i127 jmaxdia=j139 ! imaxdia=i 140 ! jmaxdia=j 128 141 endif 142 !$OMP END CRITICAL 129 143 end do 130 144 end do 131 145 !$OMP END DO 146 !$OMP END PARALLEL 132 147 133 148 if (maxdia.ge.(testdiag/dtmax)) then … … 141 156 ! avec le pas de temps long (dtt) 142 157 143 158 call next_time(time,dt,dtt,dtmax,dtmin,isynchro,itracebug,num_tracebug) 144 159 145 160 146 161 ! calcul diffusivite - vitesse 147 162 !----------------------------------------------------------------- 148 163 !$OMP PARALLEL 164 !$OMP WORKSHARE 149 165 Uxdiff(:,:)=diffmx(:,:)*(-sdx(:,:)) ! vitesse qui peut s'exprimer en terme diffusif 150 166 Uydiff(:,:)=diffmy(:,:)*(-sdy(:,:)) ! dans les where qui suivent elle est limitee a uxbar … … 172 188 uydiff(:,:)=max(uydiff(:,:),uybar(:,:)) ! pour tenir compte limitation utot 173 189 end where 174 190 !$OMP END WORKSHARE 175 191 176 192 … … 179 195 180 196 if (adv_frac.gt.1.) then ! advection seulement 197 !$OMP WORKSHARE 181 198 advmx(:,:)=Uxbar(:,:) 182 199 advmy(:,:)=Uybar(:,:) 183 200 Dmx(:,:)=0. 184 201 Dmy(:,:)=0. 185 202 !$OMP END WORKSHARE 186 203 else if (abs(adv_frac).lt.1.e-8) then ! diffusion seulement 204 !$OMP WORKSHARE 187 205 advmx(:,:)=0. 188 206 advmy(:,:)=0. 189 207 !$OMP END WORKSHARE 190 208 ! D reste la valeur au dessus) 191 209 … … 197 215 ! diffusion = ce qui peut être exprime en diffusion 198 216 ! + une partie (1-adv_frac) de l'advection 199 217 !$OMP WORKSHARE 200 218 where ((abs(sdx(:,:)).gt.1.e-8).and.(Hmx(:,:).gt.2.)) ! cas general 201 219 advmx(:,:)=(Uxbar(:,:)-Uxdiff(:,:)) ! tout ce qui n'est pas diffusion … … 236 254 dmy(:,:)=dminy(:,:)*H(:,:) 237 255 end where 238 239 240 241 256 elsewhere ! zones trop plates ou trop fines 242 257 Dmy(:,:)=0. 243 258 advmy(:,:)=Uybar(:,:) 244 259 end where 245 260 !$OMP END WORKSHARE 246 261 247 262 else if (adv_frac.lt.0) then ! diffusif dans zones SIA, advectif ailleurs 248 263 !$OMP WORKSHARE 249 264 zonemx(:,:)=flgzmx(:,:) 250 265 zonemy(:,:)=flgzmy(:,:) … … 265 280 advmy(:,:)=0. 266 281 end where 267 282 !$OMP END WORKSHARE 268 283 end if 269 284 270 285 !$OMP WORKSHARE 271 286 where (flot(:,:) ) 272 287 tabtest(:,:)=1. … … 274 289 tabtest(:,:)=0. 275 290 end where 276 291 !$OMP END WORKSHARE 292 !$OMP END PARALLEL 277 293 !------------------------------------------------------------------detect 278 294 !!$ tabtest(:,:)=dmx(:,:) … … 375 391 376 392 377 debug_3D(:,:,45)=dmx(:,:) 378 debug_3D(:,:,46)=dmy(:,:) 379 debug_3D(:,:,47)=advmx(:,:) 380 debug_3D(:,:,48)=advmy(:,:) 381 382 393 !debug_3D(:,:,45)=dmx(:,:) 394 !debug_3D(:,:,46)=dmy(:,:) 395 !debug_3D(:,:,47)=advmx(:,:) 396 !debug_3D(:,:,48)=advmy(:,:) 397 398 !$OMP PARALLEL 399 !$OMP WORKSHARE 383 400 bilmass(:,:)=bm(:,:)-bmelt(:,:) ! surface and bottom mass balance 401 !$OMP END WORKSHARE 402 !$OMP END PARALLEL 384 403 385 404 ! diverses precription de l'epaisseur en fonction de l'objectif … … 387 406 388 407 389 call prescribe_fixed_points ! ceux qui sont fixes pour tout le run (bords de grille, regions) 390 391 392 408 call prescribe_fixed_points ! ceux qui sont fixes pour tout le run (bords de grille, regions) 393 409 394 410 … … 436 452 !!$end if 437 453 438 debug_3D(:,:,87)=S(:,:)-debug_3D(:,:,88)439 440 debug_3D(:,:,86)=Hp(:,:)441 debug_3D(:,:,85)=i_Hp(:,:)454 !debug_3D(:,:,87)=S(:,:)-debug_3D(:,:,88) 455 456 !debug_3D(:,:,86)=Hp(:,:) 457 !debug_3D(:,:,85)=i_Hp(:,:) 442 458 443 459 !!$where (i_hp(:,:).eq.1) … … 463 479 call resol_adv_diff_2D_vect (Dmx,Dmy,advmx,advmy,Hp,i_Hp,bilmass,vieuxH,H) 464 480 465 ! remise à 0 des epaisseurs negatives, on garde la difference dans ablbord 481 ! remise à 0 des epaisseurs negatives, on garde la difference dans ablbord 482 !$OMP PARALLEL 483 !$OMP WORKSHARE 466 484 where (H(:,:).lt.0.) 467 485 ablbord(:,:)=H(:,:)/dt … … 489 507 endwhere 490 508 491 492 509 ! eventuellement retirer apres spinup ou avoir un cas serac 493 510 Hdot(:,:)=(H(:,:)-vieuxH(:,:))/dt 511 !$OMP END WORKSHARE 494 512 495 513 if (igrdline.ne.3) then 514 !$OMP WORKSHARE 496 515 Hdot(:,:)=min(Hdot(:,:),10.) 497 516 Hdot(:,:)=max(Hdot(:,:),-10.) 517 !$OMP END WORKSHARE 498 518 endif 499 519 520 !$OMP WORKSHARE 500 521 where (i_hp(:,:).ne.1) 501 522 H(:,:)=vieuxH(:,:)+Hdot(:,:)*dt … … 511 532 Hdot(:,:)=0. 512 533 end where 513 514 534 !$OMP END WORKSHARE 535 !$OMP END PARALLEL 515 536 516 537 !calul de l'ablation sur les bords (pourrait n'être appelé que pour les sorties courtes)
Note: See TracChangeset
for help on using the changeset viewer.