Changeset 76
- Timestamp:
- 06/29/16 16:21:13 (8 years ago)
- Location:
- trunk/SOURCES
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/Fichiers-parametres/Makefile.tof-lsce3130.inc
r75 r76 40 40 IFORT= ifort 41 41 42 ARITHMi = -O2 -fp-model precise 42 ARITHMi = -O2 -fp-model precise #-openmp 43 43 # (normalement reproductible) 44 44 ifeq ($(debug), 1) -
trunk/SOURCES/Temperature-routines/prop_th_icetemp.f90
r24 r76 15 15 16 16 Subroutine Thermal_prop_icetemp 17 !$ USE OMP_LIB 17 18 Use Icetemp_declar 18 19 … … 21 22 If (Itracebug.Eq.1) Write(Num_tracebug,*)' Entree Dans Routine Thermal_prop_icetemp' 22 23 24 !$OMP PARALLEL 25 !$OMP DO COLLAPSE(2) 23 26 Do K=1,Nz 24 27 Do J=1,Ny … … 29 32 ! Attention Pour La Conductivite C'Est La Formule De Yin-Chao Yen 30 33 31 Ct(I,J,K)=6.62E732 Cp(I,J,K)=2009.34 ! Ct(I,J,K)=6.62E7 35 ! Cp(I,J,K)=2009. 33 36 Tpmp(I,J,K)=-0.00087*(K-1)*1./(Nz-1)*H(I,J)!De=1/(Nz_m-1) 34 37 Cp(I,J,K)=(2115.3+7.79293*T(I,J,K)) … … 38 41 End Do 39 42 End Do 40 43 !$OMP END DO 44 !$OMP END PARALLEL 41 45 End Subroutine Thermal_prop_icetemp 42 46 -
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) -
trunk/SOURCES/diffusiv-polyn-0.6.f90
r68 r76 34 34 35 35 ! =============================================================== 36 36 !$ USE OMP_LIB 37 37 USE module3D_phy 38 38 … … 58 58 59 59 ! initialisation de la diffusion 60 !$OMP PARALLEL 61 !$OMP WORKSHARE 60 62 diffmx(:,:)=0. 61 63 diffmy(:,:)=0. 62 64 !$OMP END WORKSHARE 65 !$OMP END PARALLEL 63 66 64 67 ! calcul de SDX, SDY et de la pente au carre en mx et en my : … … 79 82 ! Calcul de la vitesse de glissement, qu'elle soit calculee par diagno ou par sliding 80 83 !------------------------------------------------------------------------------------ 81 ! 84 !$OMP PARALLEL 85 !$OMP WORKSHARE 82 86 where (flgzmx(:,:)) 83 87 ubx(:,:) = uxflgz(:,:) … … 91 95 uby(:,:) = ddby(:,:)* (-sdy(:,:)) 92 96 endwhere 93 94 97 !$OMP END WORKSHARE 98 !$OMP END PARALLEL 95 99 if (itracebug.eq.1) call tracebug(' diffusiv apres calcul glissement') 96 100 … … 99 103 ! Deformation SIA : Calcul de ddy et ddx pour chaque valeur de iglen 100 104 !------------------------------------------------------------------ 101 102 105 do iglen=n1poly,n2poly 103 106 glenexp=max(0.,(glen(iglen)-1.)/2.) 104 105 107 !$OMP PARALLEL 108 !$OMP DO 106 109 do j=1,ny 107 110 do i=1,nx 108 109 111 if (.not.flotmy(i,j)) then ! On calcule quand la deformation même pour les ice streams 110 112 ddy(i,j,iglen)=((slope2my(i,j)** & ! slope2my calcule en debut de routine 111 113 glenexp)*(rog)**glen(iglen)) & 112 114 *hmy(i,j)**(glen(iglen)+1) 113 114 115 115 endif 116 116 end do 117 117 end do 118 !$OMP END DO 119 !$OMP END PARALLEL 118 120 end do 121 122 119 123 120 124 do iglen=n1poly,n2poly 121 125 glenexp=max(0.,(glen(iglen)-1.)/2.) 122 123 126 !$OMP PARALLEL 127 !$OMP DO 124 128 do j=1,ny 125 129 do i=1,nx 126 127 130 if (.not.flotmx(i,j)) then ! bug y->x corrige le 5 avril 2008 ( 128 129 131 ddx(i,j,iglen)=((slope2mx(i,j)** & ! slope2mx calcule en debut de routine 130 132 glenexp)*(rog)**glen(iglen)) & … … 133 135 end do 134 136 end do 137 !$OMP END DO 138 !$OMP END PARALLEL 135 139 end do 136 140 141 137 142 ! vitesse due a la déformation----------------------------------------------- 138 139 143 !$OMP PARALLEL 144 !$OMP DO 140 145 ydef: do j=2,ny 141 146 do i=1,nx … … 164 169 end do 165 170 end do ydef 166 171 !$OMP END DO 172 173 !$OMP DO 167 174 xdef: do j=1,ny 168 175 do i=2,nx … … 192 199 end do 193 200 end do xdef 201 !$OMP END DO 194 202 195 203 if (itracebug.eq.1) call tracebug(' diffusiv avant limit') … … 199 207 200 208 ! la limitation selon x 209 !$OMP WORKSHARE 201 210 where(.not.flgzmx(:,:)) 202 211 uxbar(:,:)=min(uxbar(:,:),ultot) … … 209 218 uybar(:,:)=max(uybar(:,:),-ultot) 210 219 end where 220 !$OMP END WORKSHARE 211 221 212 222 ! cas particulier des sommets ou il ne reste plus de neige. 223 !$OMP DO 213 224 do j=2,ny-1 214 225 do i=2,nx-1 … … 221 232 end do 222 233 end do 223 234 !$OMP END DO 235 !$OMP END PARALLEL 224 236 if (itracebug.eq.1) call tracebug(' fin diffusiv ') 225 237 -
trunk/SOURCES/dragging_neff_slope_mod.f90
r66 r76 168 168 !------------------------------------------------------------------------- 169 169 subroutine dragging ! defini la localisation des streams et le frottement basal 170 170 !$ USE OMP_LIB 171 171 172 172 ! les iles n'ont pas de condition neff mais ont la condition toblim 173 173 ! (ce bloc etait avant dans flottab) 174 174 175 175 !$OMP PARALLEL 176 !$OMP DO 176 177 do j=2,ny 177 178 do i=2,nx … … 180 181 end do 181 182 end do 183 !$OMP END DO 182 184 183 185 ! le calcul des fleuves se fait sur les mailles majeures en partant de la cote … … 193 195 ! Attention : ce systeme ne permet pas d'avoir des fleuves convergents 194 196 ! et les fleuves n'ont une épaisseur que de 1 noeud. 195 197 !$OMP WORKSHARE 196 198 fleuvemx(:,:)=.false. 197 199 fleuvemy(:,:)=.false. 198 200 fleuve(:,:)=.false. 199 201 cote(:,:)=.false. 202 !$OMP END WORKSHARE 200 203 201 204 ! detection des cotes 205 !$OMP DO 202 206 do j=2,ny-1 203 207 do i=2,nx-1 … … 208 212 end do 209 213 end do 214 !$OMP END DO 210 215 211 216 ! calcul de neff (pression effective sur noeuds majeurs) 217 !$OMP DO 212 218 do j=1,ny-1 213 219 do i=1,nx-1 … … 215 221 enddo 216 222 enddo 223 !$OMP END DO 217 224 !aurel, for the borders: 225 !$OMP WORKSHARE 218 226 neff(:,ny)=1.e5 219 227 neff(nx,:)=1.e5 228 220 229 221 230 !!$ … … 277 286 ! aurel, we add the neff threshold: 278 287 where ((neff(:,:).le.seuil_neff).and.(.not.flot(:,:)).and.(H(:,:).gt.1.)) fleuve(:,:)=.true. 279 288 !$OMP END WORKSHARE 289 290 !$OMP DO 280 291 do j=1,ny-1 281 292 do i=1,nx-1 … … 288 299 end do 289 300 end do 301 !$OMP END DO 290 302 291 303 ! we look for the warm based points that will not be treated as stream (ub from SSA): 304 !$OMP WORKSHARE 292 305 slowssa(:,:)=.false. 293 306 slowssamx(:,:)=.false. 294 307 slowssamy(:,:)=.false. 308 !$OMP END WORKSHARE 309 !$OMP DO 295 310 do j=1,ny 296 311 do i=1,nx … … 299 314 end do 300 315 end do 316 !$OMP END DO 317 !$OMP DO 301 318 do j=1,ny-1 302 319 do i=1,nx-1 … … 309 326 end do 310 327 end do 311 328 !$OMP END DO 329 !$OMP DO 312 330 do j=1,ny 313 331 do i=1,nx … … 354 372 end do 355 373 end do 356 374 !$OMP END DO 375 376 !$OMP DO 357 377 do j=1,ny 358 378 do i=1,nx … … 399 419 end do 400 420 end do 401 402 421 !$OMP END DO 422 423 !$OMP DO 403 424 do j=2,ny-1 404 425 do i=2,nx-1 … … 407 428 end do 408 429 end do 409 410 411 where (fleuve(:,:)) 412 debug_3D(:,:,1)=1 413 elsewhere (flot(:,:)) 414 debug_3D(:,:,1)=2 415 elsewhere 416 debug_3D(:,:,1)=0 417 endwhere 418 419 where (cote(:,:)) 420 debug_3D(:,:,2)=1 421 elsewhere 422 debug_3D(:,:,2)=0 423 endwhere 424 425 where (fleuvemx(:,:)) 426 debug_3D(:,:,3)=1 427 elsewhere 428 debug_3D(:,:,3)=0 429 endwhere 430 431 where (flotmx(:,:)) 432 debug_3D(:,:,3)=-1 433 endwhere 430 !$OMP END DO 431 !$OMP END PARALLEL 432 433 !~ where (fleuve(:,:)) 434 !~ debug_3D(:,:,1)=1 435 !~ elsewhere (flot(:,:)) 436 !~ debug_3D(:,:,1)=2 437 !~ elsewhere 438 !~ debug_3D(:,:,1)=0 439 !~ endwhere 440 !~ 441 !~ where (cote(:,:)) 442 !~ debug_3D(:,:,2)=1 443 !~ elsewhere 444 !~ debug_3D(:,:,2)=0 445 !~ endwhere 446 !~ 447 !~ where (fleuvemx(:,:)) 448 !~ debug_3D(:,:,3)=1 449 !~ elsewhere 450 !~ debug_3D(:,:,3)=0 451 !~ endwhere 452 !~ 453 !~ where (flotmx(:,:)) 454 !~ debug_3D(:,:,3)=-1 455 !~ endwhere 434 456 435 457 !_____________________ 436 458 437 459 438 where (fleuvemy(:,:))439 debug_3D(:,:,4)=1440 elsewhere441 debug_3D(:,:,4)=0442 endwhere443 444 where (flotmy(:,:))445 debug_3D(:,:,4)=-1446 end where447 448 debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5)449 debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5)460 !~ where (fleuvemy(:,:)) 461 !~ debug_3D(:,:,4)=1 462 !~ elsewhere 463 !~ debug_3D(:,:,4)=0 464 !~ endwhere 465 !~ 466 !~ where (flotmy(:,:)) 467 !~ debug_3D(:,:,4)=-1 468 !~ end where 469 !~ 470 !~ debug_3D(:,:,23)= abs(RO*G*HMX(:,:)*sdx(:,:)*1.e-5) 471 !~ debug_3D(:,:,24)= abs(RO*G*HMY(:,:)*sdy(:,:)*1.e-5) 450 472 451 473 return -
trunk/SOURCES/eaubasale-0.5_mod.f90
r4 r76 133 133 subroutine eaubasale !(pwater) version correspondant à la thèse de Vincent 134 134 ! A terme, il faudrait en faire un module 135 136 135 !$ USE OMP_LIB 136 !~ integer :: t1,t2,ir 137 !~ real :: temps, t_cpu_0, t_cpu_1, t_cpu, norme 138 !~ 139 !~ ! Temps CPU de calcul initial. 140 !~ call cpu_time(t_cpu_0) 141 !~ ! Temps elapsed de reference. 142 !~ call system_clock(count=t1, count_rate=ir) 137 143 138 144 … … 141 147 if (itracebug.eq.1) call tracebug(' Entree dans routine eau basale') 142 148 149 !$OMP PARALLEL 150 !$OMP WORKSHARE 143 151 vieuxhwater(:,:) = hwater(:,:) 144 152 kond(:,:) = kond0*SECYEAR … … 148 156 klimit(:,:)=0 149 157 limit_hw(:,:)=-9999. 158 !$OMP END WORKSHARE 159 !$OMP DO 150 160 do j=1,ny 151 161 do i=1,nx … … 167 177 end do 168 178 end do 169 170 171 172 do i=1,nx 173 do j=2,ny-1 179 !$OMP END DO 180 181 !$OMP DO 182 ! do j=2,ny-1 183 do j=1,ny 184 do i=1,nx 174 185 bmelt_w(i,j)=bmelt(i,j)*rofresh/ro 175 186 hwater(i,j)=max(hwater(i,j),0.) 176 187 hw(i,j)=min(hwater(i,j),hmax_wat) 177 178 188 enddo 179 189 enddo 180 190 !$OMP END DO 191 !$OMP END PARALLEL 181 192 182 193 ecoul: if (ecoulement_eau) then 183 194 ! print*,'===dans eaubasale t, dt',time,dt,'kond 1.0e-5' 184 195 ! write(6,*) 'entree ecoulement_eau' 185 186 do J=1,NY 187 do I=1,NX 196 !$OMP PARALLEL 197 !$OMP DO 198 do j=1,ny 199 do i=1,nx 188 200 tetar(i,j)=(xlong(i,j))*PI/180. ! pourrait etre fait une fois pour toute 189 201 PGX(I,J)=101*sin(tetar(i,j))*1.e-2 … … 200 212 enddo 201 213 enddo 214 !$OMP END DO 202 215 203 216 ! sorties debug 17 juillet 2007 204 debug_3D(:,:,5)=pot_w(:,:)205 debug_3D(:,:,6)=pot_f(:,:)206 debug_3D(:,:,7)=pot_w(:,:)+rofreshg*hwater(:,:)207 debug_3D(:,:,8)=hwater(:,:)208 217 ! debug_3D(:,:,5)=pot_w(:,:) 218 ! debug_3D(:,:,6)=pot_f(:,:) 219 ! debug_3D(:,:,7)=pot_w(:,:)+rofreshg*hwater(:,:) 220 ! debug_3D(:,:,8)=hwater(:,:) 221 !$OMP DO 209 222 do j=2,ny 210 223 do i=2,nx 211 224 if (H(i,j).gt.25.) then 212 213 225 ! calcul du gradient de pression 214 ! _______________________________________215 216 226 if (flotmx(i,j)) then 217 227 pgx(i,j)=(pot_f(i-1,j)-pot_f(i,j))/dx … … 225 235 pgy(i,j)=(pot_w(i,j-1)-pot_w(i,j))/dy 226 236 endif 227 228 229 237 endif 230 231 232 238 pgx(i,j)=pgx(i,j)/rofreshg ! pour passer pgx sans unité 233 239 pgy(i,j)=pgy(i,j)/rofreshg 234 240 end do 235 241 end do 236 237 242 !$OMP END DO 243 !$OMP END PARALLEL 238 244 239 245 if (nt.gt.0) then 240 246 if (dt.gt.0.) then !!!!!!!!!!!!!!!!!!!!!!relax_water si dt>0 241 242 243 247 !------------------------------------------------------------------------- 244 248 ! les points de la grounding line ont une conductivité hydraulique élevée 245 249 ! même si la base est froide. modif catritz 18 janvier 2005 246 250 !open(166,file='erreur_eau') 247 248 do J=2,NY-1 249 do I=2,NX-1250 251 !$OMP PARALLEL 252 !$OMP DO 253 do j=2,Ny-1 254 do i=2,Nx-1 251 255 ! cond=0 si glace froide et pas sur la grounding line 252 253 if ((IBASE(I,J).eq.1).and. & 256 if ((IBASE(i,j).eq.1).and. & 254 257 (.not.flot(i,j-1)).and.(.not.flot(i,j+1)).and. & 255 (.not.flot(i-1,j)).and.(.not.flot(i+1,j))) KOND( I,J)=0.! 1.0e-5258 (.not.flot(i-1,j)).and.(.not.flot(i+1,j))) KOND(i,j)=0.! 1.0e-5 256 259 257 260 ! cond infinie quand epaisseur faible et glace flottante … … 267 270 268 271 ! conductivite effective (conductivité * taille du tuyau en m2/an) 269 270 272 keff(i,j)=kond(i,j)*hw(i,j) 271 273 end do 272 274 end do 273 275 !$OMP END DO 274 276 ! condition sur les bords de la grille 275 277 !$OMP WORKSHARE 276 278 kond(1,:)=kondmax 277 279 kond(nx,:)=kondmax 278 280 kond(:,1)=kondmax 279 281 kond(:,ny)=kondmax 280 281 ! fin de la modif 18 janvier 2005---------------------------------------282 283 282 vieuxhwater(:,:) = hwater(:,:) 284 285 283 !$OMP END WORKSHARE 284 !$OMP END PARALLEL 285 !!$OMP SINGLE 286 286 call relaxation_waterdif(nxlocal,nylocal,dt,dx,vieuxhwater,limit_hw,klimit,bmelt_w,infiltr,pgx,pgy,keff,keffmax,hwater) 287 288 289 287 !!$OMP END SINGLE 290 288 else 291 289 ! print*,'dt=',dt,'pas de relax_water' … … 303 301 304 302 ! on le fait avant les butoirs pour justement pouvoir les estimer 305 303 !$OMP PARALLEL 306 304 if (dt.gt.0.) then 307 305 ! print*,'dt=',dt,'pas de relax_water' 306 !$OMP DO 308 307 do j=1,ny 309 308 do i=1,nx … … 311 310 end do 312 311 end do 312 !$OMP END DO 313 313 endif 314 314 315 315 !$OMP DO PRIVATE(Zflot) 316 316 do i=1,nx 317 317 do j=1,ny … … 353 353 ! Hwater(i,j)=hw(i,j) 354 354 ! pwater(i,j)=rog*H(I,J)*(hw(I,J)/hmax_wat)**(3.5) 355 356 357 358 359 355 endif 360 361 356 362 357 ! bloc qui pourrait servir pour mettre l'eau encore plus sous pression … … 365 360 ! pwater(i,j)=pwater(i,j)+(HWATER(i,j)-poro_till*hmax_till)/(compress_w*hmax_till) 366 361 ! endif 367 368 369 370 371 362 end do 372 363 end do 373 364 !$OMP END DO 374 365 375 366 ! ************ valeurs de HWATER pour les coins ******** … … 381 372 382 373 ! pour les sorties de flux d'eau 374 !$OMP DO 383 375 do j=2,ny 384 376 do i=2,nx … … 390 382 phiwx(i,j)=phiwx(i,j)*2*(keff(i,j)*keff(i-1,j))/(keff(i,j)+keff(i-1,j)) 391 383 endif 392 393 384 ! ligne pour sortir les pgx 394 395 385 pgx(i,j)=(pgx(i,j)+(hwater(i-1,j)-hwater(i,j))/dx) 396 386 end do 397 387 end do 398 388 !$OMP END DO 389 !$OMP DO 399 390 do j=2,ny 400 391 do i=2,nx … … 406 397 endif 407 398 pgy(i,j)=(pgy(i,j)+(hwater(i,j-1)-hwater(i,j))/dx) 408 409 399 enddo 410 400 enddo 411 412 401 !$OMP END DO 402 !$OMP END PARALLEL 413 403 414 404 else ! partie originellement dans icetemp à mettre dans un autre module … … 416 406 417 407 if (ISYNCHRO.eq.1) then 408 !$OMP PARALLEL 409 !$OMP DO 418 410 do j=1,ny 419 411 do i=1,nx … … 429 421 end do 430 422 end do 423 !$OMP END DO 424 !$OMP END PARALLEL 431 425 end if 426 432 427 endif ecoul 428 429 !~ ! Temps elapsed final 430 !~ call system_clock(count=t2, count_rate=ir) 431 !~ temps=real(t2 - t1,kind=4)/real(ir,kind=4) 432 !~ ! Temps CPU de calcul final 433 !~ call cpu_time(t_cpu_1) 434 !~ t_cpu = t_cpu_1 - t_cpu_0 435 436 !~ ! Impression du resultat. 437 !~ print '(//,3X,"Valeurs de nx et ny : ",I5,I5/, & 438 !~ & 3X,"Temps elapsed : ",1PE10.3," sec.",/, & 439 !~ & 3X,"Temps CPU : ",1PE10.3," sec.",/, & 440 !~ & 3X,"Norme (PB si /= 0) : ",1PE10.3,//)', & 441 !~ nx,ny,temps,t_cpu,norme 433 442 434 443 return -
trunk/SOURCES/relaxation_water_diffusion.f90
r65 r76 18 18 19 19 subroutine relaxation_waterdif(NXX,NYY,DT,DX,vieuxHWATER,limit_hw,klimit,BMELT,INFILTR,PGMX,PGMY,KOND,KONDMAX,HWATER) 20 implicit none 20 21 !$ USE OMP_LIB 22 23 implicit none 21 24 22 25 … … 57 60 58 61 ! write(166,*)' entree relaxation waterdif' 62 !$OMP PARALLEL 63 !$OMP WORKSHARE 59 64 HWATER(:,:)= vieuxHWATER(:,:) 60 65 !$OMP END WORKSHARE 61 66 ! calcul de kmx et kmx a partir de KOND 62 67 ! conductivite hyrdraulique sur les noeuds mineurs 63 68 ! moyenne harmonique 64 69 ! ---------------------------------------- 65 70 !$OMP DO 66 71 do j=2,nyy 67 72 do i=2,nxx … … 75 80 end do 76 81 end do 77 82 !$OMP END DO 83 84 !$OMP DO 78 85 do j=2,nyy 79 86 do i=2,nxx … … 86 93 enddo 87 94 enddo 88 95 !$OMP END DO 89 96 90 97 ! attribution des coefficients arelax .... … … 100 107 dtwdx2=dt/dx/dx 101 108 102 arelax(:,:)=0. 103 brelax(:,:)=0. 104 crelax(:,:)=1. 105 drelax(:,:)=0. 106 erelax(:,:)=0. 107 frelax(:,:)=limit_hw(:,:) 108 109 110 109 !$OMP WORKSHARE 110 arelax(:,:)=0. 111 brelax(:,:)=0. 112 crelax(:,:)=1. 113 drelax(:,:)=0. 114 erelax(:,:)=0. 115 frelax(:,:)=limit_hw(:,:) 116 !$OMP END WORKSHARE 117 118 !$OMP DO 111 119 do J=2,NYY-1 112 120 do I=2,NXX-1 113 121 114 122 if (klimit(i,j).eq.0) then 115 116 123 ! calcul du vecteur 117 118 124 FRELAX(I,J)= VIEUXHWATER(I,J)+(BMELT(I,J)-INFILTR)*DT 119 125 frelax(i,j)=frelax(i,j)+(kmx(i,j)*pgmx(i,j)-kmx(i+1,j)*pgmx(i+1,j))*dtsrgdx 120 126 frelax(i,j)=frelax(i,j)+(kmy(i,j)*pgmy(i,j)-kmy(i,j+1)*pgmy(i,j+1))*dtsrgdx 121 122 127 ! calcul des diagonales 123 128 arelax(i,j)=-kmx(i,j)*dtwdx2 ! arelax : diagonale i-1,j … … 131 136 crelax(i,j)=1.+((kmx(i,j)+kmx(i+1,j))+(kmy(i,j)+kmy(i,j+1)))*dtwdx2 132 137 !crelax : diagonale i,j 133 134 138 else if (klimit(i,j).eq.1) then 135 139 hwater(i,j)=limit_hw(i,j) 136 140 ! write(6,*) i,j,hwater(i,j),crelax(i,j),frelax(i,j),arelax(i,j) 137 138 141 endif 139 140 142 end do 141 143 end do 142 143 144 !$OMP END DO 145 !$OMP END PARALLEL 144 146 145 147 ! Boucle de relaxation : … … 152 154 ntour=ntour+1 153 155 ! write(6,*) 'boucle de relaxation numero',ntour 154 156 !$OMP PARALLEL 157 !$OMP DO PRIVATE(reste) 155 158 do j=2,NYY-1 156 159 do i=2,NXX-1 … … 161 164 162 165 DELTAH(I,J) = RESTE/CRELAX(I,J) 163 164 166 end do 165 167 end do 166 167 deltah(:,:)=min(deltah(:,:),10.) 168 deltah(:,:)=max(deltah(:,:),-10.) 169 170 171 168 !$OMP END DO 169 170 !$OMP WORKSHARE 171 deltah(:,:)=min(deltah(:,:),10.) 172 deltah(:,:)=max(deltah(:,:),-10.) 173 !$OMP END WORKSHARE 172 174 ! il faut faire le calcul suivant dans une autre boucle car RESTE est fonction 173 175 ! de hwater sur les points voisins. 176 !$OMP DO 174 177 do j=2,NYY-1 175 178 do i=2,NXX-1 176 179 HWATER(I,J) = HWATER(I,J) - DELTAH(I,J) 177 178 180 end do 179 181 end do 180 182 !$OMP END DO 181 183 182 184 ! critere d'arret: 183 184 185 186 185 Delh=0 187 186 Vh=0 188 187 188 !$OMP DO REDUCTION(+:Delh) 189 189 DO j=2,NYY-1 190 190 DO i=2,NXX-1 191 191 192 192 ! write(166,*) I,J,delh,deltah(i,j) 193 193 Delh=Delh+deltah(i,j)**2 194 194 ! Vh=Vh+h(i,j)**2. 195 195 END DO 196 196 END DO 197 197 !$OMP END DO 198 !$OMP END PARALLEL 198 199 ! write(6,*) delh,maxval(deltah),minval(deltah) 199 200 ! testh=SQRT(Delh/Vh)
Note: See TracChangeset
for help on using the changeset viewer.