Changeset 74
- Timestamp:
- 06/24/16 09:19:59 (8 years ago)
- Location:
- trunk/SOURCES
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/New-remplimat/remplimat-shelves-tabTu.f90
r65 r74 41 41 !----------------------------------------------------------------------- 42 42 43 !$ USE OMP_LIB 43 44 use module3d_phy 44 45 use remplimat_declar ! les tableaux tuij, .... … … 104 105 105 106 !----------------------------- 107 !$OMP PARALLEL 108 !$OMP WORKSHARE 106 109 Tu(:,:,:,:) = 0. ; Tv(:,:,:,:) = 0. ; Su(:,:,:,:) = 0. ; Sv(:,:,:,:) = 0. 107 110 opposx(:,:) = 0. ; opposy(:,:) = 0. … … 117 120 Hmx_oppos(:,:) = Hmx(:,:) 118 121 Hmy_oppos(:,:) = Hmy(:,:) 119 122 !$OMP END WORKSHARE 123 !$OMP END PARALLEL 120 124 121 125 ! calcul de Hmx_oppos et Hmy_oppos dans le cas de fronts … … 164 168 call limit_frotm 165 169 else 170 !$OMP PARALLEL 171 !$OMP WORKSHARE 166 172 frotmx(:,:)= betamx(:,:) 167 173 frotmy(:,:)= betamy(:,:) 174 !$OMP END WORKSHARE 175 !$OMP END PARALLEL 168 176 end if 169 177 … … 272 280 ! pour avoir la diagonale=1 a faire imperativement APRES okmat 273 281 !-------------------------------------------------------------- 274 282 !$OMP PARALLEL 283 !$OMP DO PRIVATE(scal) 275 284 do j=ny1,ny2 276 285 do i=nx1,nx2 … … 319 328 end do 320 329 end do 321 330 !$OMP END DO 331 !$OMP END PARALLEL 322 332 323 333 ! mise a identite des noeuds fantomes … … 329 339 330 340 331 332 debug_3d(:,:,35) = opposx(:,:) 333 debug_3d(:,:,36) = opposy(:,:) 341 !debug_3d(:,:,35) = opposx(:,:) 342 !debug_3d(:,:,36) = opposy(:,:) 334 343 335 344 … … 349 358 350 359 ! remise a 0 des noeuds fantomes 351 360 !$OMP PARALLEL 361 !$OMP WORKSHARE 352 362 where ((Hmx(nx1:nx2,ny1:ny2).le.1.).and.(flgzmx(nx1:nx2,ny1:ny2))) 353 363 uxnew(nx1:nx2,ny1:ny2)=0. … … 357 367 uynew(nx1:nx2,ny1:ny2)=0. 358 368 end where 359 369 !$OMP END WORKSHARE 370 !$OMP END PARALLEL 360 371 361 372 ! call graphique_L2(kl,ku,nx1,nx2,ny1,ny2,imx(nx1:nx2,ny1:ny2),imy(nx1:nx2,ny1:ny2)) … … 404 415 405 416 subroutine limit_frotm 417 418 !$USE OMP_LIB 406 419 !------------------------- 407 420 ! limite la valeur de frotmx a betamax … … 411 424 if (itracebug.eq.1) write(Num_tracebug,*)'betamax = ',betamax 412 425 426 !$OMP PARALLEL 427 !$OMP WORKSHARE 413 428 where (flgzmx(:,:)) 414 429 frotmx(:,:)=min(abs(betamx(:,:)),betamax_2d(:,:)) … … 422 437 frotmy(:,:)=0 423 438 end where 439 !$OMP END WORKSHARE 440 !$OMP END PARALLEL 424 441 425 442 end subroutine limit_frotm … … 433 450 434 451 subroutine rempli_Tuij ! appelle tous les cas 452 453 !$ USE OMP_LIB 435 454 436 455 ! imx(i,j)=0 -> ne pas traiter cette vitesse … … 464 483 count_line=1 ! pour numeroter les lignes 465 484 !------------------------------------------------------------------ 466 485 !$OMP PARALLEL 486 !$OMP DO 467 487 lignes_UV: do j=ny1,ny2 468 488 do i=nx1,nx2 … … 470 490 if (i.gt.nx1) then ! Vitesses U 471 491 ligu_L2(i,j)=count_line 492 !$OMP ATOMIC 472 493 count_line=count_line+1 473 494 … … 480 501 481 502 case(1) ! vitesse imposee 482 call vel_U_presc 503 call vel_U_presc(uxprec(i,j),Tu(i,j,0,0),opposx(i,j)) 483 504 484 505 case(2) ! cas general 485 call vel_U_general 506 call vel_U_general(frotmx(i,j),dx2,pvi(i,j),pvi(i-1,j),pvm(i,j),pvm(i,j+1),sdx(i,j),rog,hmx_oppos(i,j), & 507 Tu(i,j,:,:),Tv(i,j,:,:),opposx(i,j)) 486 508 487 509 case(-1) ! bord sud 488 call vel_U_South 510 call vel_U_South(Tu(i,j,:,:),Tv(i,j,:,:),opposx(i,j)) 489 511 490 512 case(-2) ! bord Est 491 call vel_U_East 513 call vel_U_East(pvi(i,j),pvi(i-1,j),rog,H(i-1,j),rowg,slv(i-1,j),B(i-1,j),dx,Tu(i,j,:,:),Tv(i,j,:,:),opposx(i,j)) 492 514 493 515 case(-3) ! bord nord 494 call vel_U_North 516 call vel_U_North(Tu(i,j,:,:),Tv(i,j,:,:),opposx(i,j)) 495 517 496 518 case(-4) ! bord West 497 call vel_U_West 519 call vel_U_West(pvi(i,j),pvi(i-1,j),rog,H(i,j),rowg,slv(i,j),B(i,j),dx,Tu(i,j,:,:),Tv(i,j,:,:),opposx(i,j)) 498 520 499 521 case(-12) ! coin SE 500 call vel_U_SE 522 call vel_U_SE(Tu(i,j,:,:),opposx(i,j)) 501 523 502 524 case(-23) ! coin NE 503 call vel_U_NE 525 call vel_U_NE(Tu(i,j,:,:),opposx(i,j)) 504 526 505 527 case(-34) ! coin NW 506 call vel_U_NW 528 call vel_U_NW(Tu(i,j,:,:),opposx(i,j)) 507 529 508 530 case(-41) ! coin SW 509 call vel_U_SW 531 call vel_U_SW(Tu(i,j,:,:),opposx(i,j)) 510 532 511 533 end select case_imx … … 515 537 516 538 ligv_L2(i,j)=count_line 539 !$OMP ATOMIC 517 540 count_line=count_line+1 518 541 … … 525 548 526 549 case(1) ! vitesse imposee 527 call vel_V_presc 550 call vel_V_presc(uyprec(i,j),Sv(i,j,0,0),opposy(i,j)) 528 551 529 552 case(2) ! cas general 530 call vel_V_general 553 call vel_V_general(frotmy(i,j),dx2,pvi(i,j),pvi(i,j-1),pvm(i,j),pvm(i+1,j),sdy(i,j),rog,hmy_oppos(i,j), & 554 Su(i,j,:,:),Sv(i,j,:,:),opposy(i,j)) 531 555 532 556 case(-1) ! bord sud 533 call vel_V_South 557 call vel_V_South(pvi(i,j),pvi(i,j-1),rog,H(i,j),rowg,slv(i,j),B(i,j),dx,Sv(i,j,:,:),Su(i,j,:,:),opposy(i,j)) 534 558 535 559 case(-2) ! bord Est 536 call vel_V_East 560 call vel_V_East(Sv(i,j,:,:),Su(i,j,:,:),opposy(i,j)) 537 561 538 562 case(-3) ! bord nord 539 call vel_V_North 563 call vel_V_North(pvi(i,j),pvi(i,j-1),rog,H(i-1,j),rowg,slv(i-1,j),B(i-1,j),dx,Sv(i,j,:,:),Su(i,j,:,:),opposy(i,j)) 540 564 541 565 case(-4) ! bord West 542 call vel_V_West 566 call vel_V_West(Sv(i,j,:,:),Su(i,j,:,:),opposy(i,j)) 543 567 544 568 case(-12) ! coin SE 545 call vel_V_SE 569 call vel_V_SE(Sv(i,j,:,:),opposy(i,j)) 546 570 547 571 case(-23) ! coin NE 548 call vel_V_NE 572 call vel_V_NE(Sv(i,j,:,:),opposy(i,j)) 549 573 550 574 case(-34) ! coin NW 551 call vel_V_NW 575 call vel_V_NW(Sv(i,j,:,:),opposy(i,j)) 552 576 553 577 case(-41) ! coin SW 554 578 555 call vel_V_SW 579 call vel_V_SW(Sv(i,j,:,:),opposy(i,j)) 556 580 557 581 end select case_imy … … 559 583 end do 560 584 end do lignes_UV 585 !$OMP END DO 586 !$OMP END PARALLEL 561 587 562 588 end subroutine rempli_Tuij … … 570 596 !------------------------------------------------------------------ 571 597 572 subroutine vel_U_presc ! ! vitesse imposee 573 574 Tu(i,j,0,0)=1. 575 opposx(i,j)=uxprec(i,j) 598 subroutine vel_U_presc(uxprec,Tu,opposx) ! ! vitesse imposee 599 600 implicit none 601 602 real,intent(in) :: uxprec 603 real,intent(out) :: Tu 604 real,intent(out) :: opposx 605 606 Tu=1. 607 opposx=uxprec 576 608 577 609 end subroutine vel_U_presc 578 610 !------------------------------------------------------------------ 579 611 580 subroutine vel_U_general ! cas general 581 582 583 beta=frotmx(i,j)*dx2 ! Terme en u(i,j) 584 585 586 587 Tu(i,j,0,0) = -4.*pvi(i,j)-4.*pvi(i-1,j)- pvm(i,j+1)-pvm(i,j)-beta 588 589 Tu(i,j,-1,0) = 4.*pvi(i-1,j) ! Terme en u(i-1,j) 590 591 Tu(i,j,1,0) = 4.*pvi(i,j) ! Terme en u(i+1,j) 592 593 Tu(i,j,0,-1) = pvm(i,j) ! Terme en u(i,j-1) 594 595 Tu(i,j,0,1) = pvm(i,j+1) ! Terme en u(i,j+1) 596 597 Tv(i,j,0,0) = -2.*pvi(i,j)-pvm(i,j) ! Terme en v(i,j) 598 599 Tv(i,j,-1,0) = 2.*pvi(i-1,j)+pvm(i,j) ! Terme en v(i-1,j) 600 601 Tv(i,j,-1,1) = -2.*pvi(i-1,j)-pvm(i,j+1) ! Terme en v(i-1,j+1) 602 603 Tv(i,j,0,1) = 2.*pvi(i,j)+pvm(i,j+1) ! Terme en v(i,j+1) 604 605 opposx(i,j) = rog*hmx_oppos(i,j)*sdx(i,j)*dx2 ! Terme en opposx(i,j) 612 subroutine vel_U_general(frotmx,dx2,pvi,pvi_imoinsun,pvm,pvm_jplusun,sdx,rog,hmx_oppos,Tu,Tv,opposx) ! cas general 613 614 implicit none 615 616 real,intent(in) :: frotmx 617 real,intent(in) :: dx2 618 real,intent(in) :: pvi 619 real,intent(in) :: pvi_imoinsun 620 real,intent(in) :: pvm 621 real,intent(in) :: pvm_jplusun 622 real,intent(in) :: sdx 623 real,intent(in) :: rog 624 real,intent(in) :: hmx_oppos 625 real,dimension(-1:1,-1:1),intent(inout) :: Tu 626 real,dimension(-1:1,-1:1),intent(inout) :: Tv 627 real,intent(out) :: opposx 628 629 beta=frotmx*dx2 ! Terme en u(i,j) 630 631 Tu(0,0) = -4.*pvi - 4.*pvi_imoinsun - pvm_jplusun - pvm - beta 632 633 Tu(-1,0) = 4.*pvi_imoinsun ! Terme en u(i-1,j) 634 635 Tu(1,0) = 4.*pvi ! Terme en u(i+1,j) 636 637 Tu(0,-1) = pvm ! Terme en u(i,j-1) 638 639 Tu(0,1) = pvm_jplusun ! Terme en u(i,j+1) 640 641 Tv(0,0) = -2.*pvi - pvm ! Terme en v(i,j) 642 643 Tv(-1,0) = 2.*pvi_imoinsun + pvm ! Terme en v(i-1,j) 644 645 Tv(-1,1) = -2.*pvi_imoinsun - pvm_jplusun ! Terme en v(i-1,j+1) 646 647 Tv(0,1) = 2.*pvi + pvm_jplusun ! Terme en v(i,j+1) 648 649 opposx = rog*hmx_oppos*sdx*dx2 ! Terme en opposx(i,j) 606 650 607 651 return … … 611 655 ! voir explications dans vel_U_West 612 656 613 subroutine vel_U_South ! bord sud non cisaillement 614 615 Tu(i,j,0,0) = 1. 616 Tu(i,j,0,1) = -1. 617 Tv(i,j,0,1) = -1. 618 Tv(i,j,-1,1) = 1. 619 opposx(i,j) = 0. 657 subroutine vel_U_South(Tu,Tv,opposx) ! bord sud non cisaillement 658 659 implicit none 660 real,dimension(-1:1,-1:1),intent(inout) :: Tu 661 real,dimension(-1:1,-1:1),intent(inout) :: Tv 662 real, intent(out) :: opposx 663 664 Tu(0,0) = 1. 665 Tu(0,1) = -1. 666 Tv(0,1) = -1. 667 Tv(-1,1) = 1. 668 opposx = 0. 620 669 621 670 return … … 623 672 !------------------------------------------------------------------ 624 673 625 subroutine vel_U_North ! bord nord non cisaillement 626 627 Tu(i,j,0,0) = 1. 628 Tu(i,j,0,-1) = -1. 629 Tv(i,j,0,0) = 1. 630 Tv(i,j,-1,0) = -1. 631 opposx(i,j) = 0. 674 subroutine vel_U_North(Tu,Tv,opposx) ! bord nord non cisaillement 675 676 implicit none 677 real,dimension(-1:1,-1:1),intent(inout) :: Tu 678 real,dimension(-1:1,-1:1),intent(inout) :: Tv 679 real, intent(out) :: opposx 680 681 Tu(0,0) = 1. 682 Tu(0,-1) = -1. 683 Tv(0,0) = 1. 684 Tv(-1,0) = -1. 685 opposx = 0. 632 686 633 687 return … … 636 690 ! voir explications dans vel_U_West 637 691 638 subroutine vel_U_East ! bord Est pression 692 subroutine vel_U_East(pvi,pvi_imoinsun,rog,H_imoinsun,rowg,slv_imoinsun,B_imoinsun,dx,Tu,Tv,opposx) ! bord Est pression 693 694 implicit none 695 real,intent(in) :: pvi 696 real,intent(in) :: pvi_imoinsun 697 real,intent(in) :: rog 698 real,intent(in) :: H_imoinsun 699 real,intent(in) :: rowg 700 real,intent(in) :: slv_imoinsun 701 real,intent(in) :: B_imoinsun 702 real,intent(in) :: dx 703 real,dimension(-1:1,-1:1),intent(inout) :: Tu 704 real,dimension(-1:1,-1:1),intent(inout) :: Tv 705 real, intent(out) :: opposx 639 706 640 Tu( i,j,0,0) = 4.*pvi(i-1,j)641 Tu( i,j,-1,0) = -4.*pvi(i-1,j)642 Tv( i,j,0,1) = 2.*pvi(i,j)643 Tv( i,j,0,0) = -2.*pvi(i,j)644 opposx (i,j) = 0.5*(rog*H(i-1,j)**2-rowg*(max(slv(i-1,j)-B(i-1,j),0.))**2)*dx707 Tu(0,0) = 4.*pvi_imoinsun 708 Tu(-1,0) = -4.*pvi_imoinsun 709 Tv(0,1) = 2.*pvi 710 Tv(0,0) = -2.*pvi 711 opposx = 0.5*(rog*H_imoinsun**2-rowg*(max(slv_imoinsun-B_imoinsun,0.))**2)*dx 645 712 646 713 return … … 648 715 !------------------------------------------------------------------ 649 716 650 subroutine vel_U_West 717 subroutine vel_U_West(pvi,pvi_imoinsun,rog,H,rowg,slv,B,dx,Tu,Tv,opposx) ! bord West pression 651 718 ! tous les coef * -1 719 implicit none 720 real,intent(in) :: pvi 721 real,intent(in) :: pvi_imoinsun 722 real,intent(in) :: rog 723 real,intent(in) :: H 724 real,intent(in) :: rowg 725 real,intent(in) :: slv 726 real,intent(in) :: B 727 real,intent(in) :: dx 728 real,dimension(-1:1,-1:1),intent(inout) :: Tu 729 real,dimension(-1:1,-1:1),intent(inout) :: Tv 730 real, intent(out) :: opposx 731 652 732 653 733 ! Tu(i,j,0,0) = 4.*pvi(i-1,j) 654 734 ! Tu(i,j,1,0) = -4.*pvi(i-1,j) 655 735 656 Tu( i,j,0,0) = 4.*pvi(i,j)! quand le bord est epais, il faut prendre657 Tu( i,j,1,0) = -4.*pvi(i,j)! le noeud du shelf pas celui en H=1736 Tu(0,0) = 4.*pvi ! quand le bord est epais, il faut prendre 737 Tu(1,0) = -4.*pvi ! le noeud du shelf pas celui en H=1 658 738 ! s'il est fin, pas de difference 659 739 … … 661 741 !!$ Tv(i-1,j,-1,1) = -2.*pvi(i-1,j) 662 742 663 Tv( i,j,-1,0) = 2.*pvi(i-1,j)664 Tv( i,j,-1,1) = -2.*pvi(i-1,j)665 opposx (i,j) = -0.5*(rog*H(i,j)**2-rowg*(max(slv(i,j)-B(i,j),0.))**2)*dx743 Tv(-1,0) = 2.*pvi_imoinsun 744 Tv(-1,1) = -2.*pvi_imoinsun 745 opposx = -0.5*(rog*H**2-rowg*(max(slv-B,0.))**2)*dx 666 746 667 747 … … 674 754 !------------------------------------------------------------------ 675 755 676 subroutine vel_V_presc ! vitesse imposee 677 678 Sv(i,j,0,0)=1. 679 opposy(i,j)=uyprec(i,j) 756 subroutine vel_V_presc(uyprec,Sv,opposy) ! vitesse imposee 757 758 implicit none 759 real,intent(in) :: uyprec 760 real,intent(out) :: Sv 761 real,intent(out) :: opposy 762 763 Sv=1. 764 opposy=uyprec 680 765 681 766 return … … 683 768 !------------------------------------------------------------------ 684 769 685 subroutine vel_V_general ! cas general 686 687 688 beta = frotmy(i,j)*dx2 ! Terme en v(i,j) 689 Sv(i,j,0,0) = -4.*pvi(i,j)-4.*pvi(i,j-1)- pvm(i+1,j)-pvm(i,j)-beta 690 691 Sv(i,j,0,-1) = 4.*pvi(i,j-1) ! Terme en v(i,j-1) 692 693 Sv(i,j,0,1) = 4.*pvi(i,j) ! Terme en v(i,j+1) 694 695 Sv(i,j,-1,0) = pvm(i,j) ! Terme en v(i-1,j) 696 697 Sv(i,j,1,0) = pvm(i+1,j) ! Terme en v(i+1,j) 698 699 Su(i,j,0,0) = -2.*pvi(i,j)-pvm(i,j) ! Terme en u(i,j) 700 701 Su(i,j,0,-1) = 2.*pvi(i,j-1)+pvm(i,j) ! Terme en u(i,j-1) 702 703 Su(i,j,1,-1) = -2.*pvi(i,j-1)-pvm(i+1,j) ! Terme en u(i+1,j-1) 704 705 Su(i,j,1,0) = 2.*pvi(i,j)+pvm(i+1,j) ! Terme en u(i+1,j) 706 707 opposy(i,j) = rog*hmy_oppos(i,j)*sdy(i,j)*dx2 ! Terme en opposy(i,j) 770 subroutine vel_V_general(frotmy,dx2,pvi,pvi_jmoinsun,pvm,pvm_iplusun,sdy,rog,hmy_oppos,Su,Sv,opposy)! cas general 771 772 implicit none 773 real,intent(in) :: frotmy 774 real,intent(in) :: dx2 775 real,intent(in) :: pvi 776 real,intent(in) :: pvi_jmoinsun 777 real,intent(in) :: pvm 778 real,intent(in) :: pvm_iplusun 779 real,intent(in) :: sdy 780 real,intent(in) :: rog 781 real,intent(in) :: hmy_oppos 782 real,dimension(-1:1,-1:1),intent(inout) :: Su 783 real,dimension(-1:1,-1:1),intent(inout) :: Sv 784 real,intent(out) :: opposy 785 786 real :: beta 787 788 789 beta = frotmy*dx2 ! Terme en v(i,j) 790 Sv(0,0) = -4.*pvi - 4.*pvi_jmoinsun - pvm_iplusun - pvm-beta 791 792 Sv(0,-1) = 4.*pvi_jmoinsun ! Terme en v(i,j-1) 793 794 Sv(0,1) = 4.*pvi ! Terme en v(i,j+1) 795 796 Sv(-1,0) = pvm ! Terme en v(i-1,j) 797 798 Sv(1,0) = pvm_iplusun ! Terme en v(i+1,j) 799 800 Su(0,0) = -2.*pvi - pvm ! Terme en u(i,j) 801 802 Su(0,-1) = 2.*pvi_jmoinsun + pvm ! Terme en u(i,j-1) 803 804 Su(1,-1) = -2.*pvi_jmoinsun - pvm_iplusun ! Terme en u(i+1,j-1) 805 806 Su(1,0) = 2.*pvi + pvm_iplusun ! Terme en u(i+1,j) 807 808 opposy = rog*hmy_oppos*sdy*dx2 ! Terme en opposy(i,j) 708 809 709 810 return … … 712 813 !------------------------------------------------------------------ 713 814 714 subroutine vel_V_West ! bord West non cisaillement 715 716 Sv(i,j,0,0) = 1. 717 Sv(i,j,1,0) = -1. 718 Su(i,j,1,0) = -1. 719 Su(i,j,1,-1) = 1. 720 opposy(i,j) = 0. 815 subroutine vel_V_West(Sv,Su,opposy) ! bord West non cisaillement 816 817 implicit none 818 real,dimension(-1:1,-1:1),intent(inout) :: Sv 819 real,dimension(-1:1,-1:1),intent(inout) :: Su 820 real,intent(out) :: opposy 821 822 Sv(0,0) = 1. 823 Sv(1,0) = -1. 824 Su(1,0) = -1. 825 Su(1,-1) = 1. 826 opposy = 0. 721 827 722 828 return … … 725 831 726 832 727 subroutine vel_V_East ! bord Est non cisaillement 728 729 Sv(i,j,0,0) = 1. 730 Sv(i,j,-1,0) = -1. 731 Su(i,j,0,0) = 1. 732 Su(i,j,0,-1) = -1. 733 opposy(i,j) = 0. 833 subroutine vel_V_East(Sv,Su,opposy) ! bord Est non cisaillement 834 835 implicit none 836 real,dimension(-1:1,-1:1),intent(inout) :: Sv 837 real,dimension(-1:1,-1:1),intent(inout) :: Su 838 real,intent(out) :: opposy 839 840 Sv(0,0) = 1. 841 Sv(-1,0) = -1. 842 Su(0,0) = 1. 843 Su(0,-1) = -1. 844 opposy = 0. 734 845 735 846 return … … 739 850 ! voir explications dans vel_U_West 740 851 741 subroutine vel_V_North ! bord Nord pression 852 subroutine vel_V_North(pvi,pvi_jmoinsun,rog,H_imoinsun,rowg,slv_imoinsun,B_imoinsun,dx,Sv,Su,opposy) ! bord Nord pression 853 854 implicit none 855 real,intent(in) :: pvi 856 real,intent(in) :: pvi_jmoinsun 857 real,intent(in) :: rog 858 real,intent(in) :: H_imoinsun 859 real,intent(in) :: rowg 860 real,intent(in) :: slv_imoinsun 861 real,intent(in) :: B_imoinsun 862 real,intent(in) :: dx 863 real,dimension(-1:1,-1:1),intent(inout) :: Sv 864 real,dimension(-1:1,-1:1),intent(inout) :: Su 865 real,intent(out) :: opposy 742 866 743 Sv( i,j,0,0) = 4.*pvi(i,j-1)744 Sv( i,j,0,-1) = -4.*pvi(i,j-1)745 Su( i,j,1,0) = 2.*pvi(i,j)746 Su( i,j,0,0) = -2.*pvi(i,j)747 opposy (i,j) = 0.5*(rog*H(i-1,j)**2-rowg*(max(slv(i-1,j)-B(i-1,j),0.))**2)*dx867 Sv(0,0) = 4.*pvi_jmoinsun 868 Sv(0,-1) = -4.*pvi_jmoinsun 869 Su(1,0) = 2.*pvi 870 Su(0,0) = -2.*pvi 871 opposy = 0.5*(rog*H_imoinsun**2-rowg*(max(slv_imoinsun-B_imoinsun,0.))**2)*dx 748 872 749 873 return … … 752 876 ! voir explications dans vel_U_West 753 877 754 subroutine vel_V_South 878 subroutine vel_V_South(pvi,pvi_jmoinsun,rog,H,rowg,slv,B,dx,Sv,Su,opposy) ! bord sud pression 755 879 ! tous les coef * -1 756 757 Sv(i,j,0,0) = 4.*pvi(i,j) 758 Sv(i,j,0,1) =-4.*pvi(i,j) 759 Su(i,j,0,-1) = 2.*pvi(i,j-1) 760 Su(i,j,1,-1) =-2.*pvi(i,j-1) 761 opposy(i,j) = -0.5*(rog*H(i,j)**2-rowg*(max(slv(i,j)-B(i,j),0.))**2)*dx 880 implicit none 881 real,intent(in) :: pvi 882 real,intent(in) :: pvi_jmoinsun 883 real,intent(in) :: rog 884 real,intent(in) :: H 885 real,intent(in) :: rowg 886 real,intent(in) :: slv 887 real,intent(in) :: B 888 real,intent(in) :: dx 889 real,dimension(-1:1,-1:1),intent(inout) :: Sv 890 real,dimension(-1:1,-1:1),intent(inout) :: Su 891 real,intent(out) :: opposy 892 893 Sv(0,0) = 4.*pvi 894 Sv(0,1) =-4.*pvi 895 Su(0,-1) = 2.*pvi_jmoinsun 896 Su(1,-1) =-2.*pvi_jmoinsun 897 opposy = -0.5*(rog*H**2-rowg*(max(slv-B,0.))**2)*dx 762 898 763 899 return … … 780 916 !Coin SE 781 917 !---------- 782 subroutine vel_U_SE 783 784 Tu(i,j,0,0) = 1. !*pvi(i,j) 785 Tu(i,j,0,1) = -1. !*pvi(i,j) 786 opposx(i,j) = 0. 918 subroutine vel_U_SE(Tu,opposx) 919 920 implicit none 921 real,dimension(-1:1,-1:1),intent(inout) :: Tu 922 real,intent(out) :: opposx 923 924 Tu(0,0) = 1. !*pvi(i,j) 925 Tu(0,1) = -1. !*pvi(i,j) 926 opposx = 0. 787 927 788 928 return … … 790 930 !------------------------------------------------------------------ 791 931 792 subroutine vel_V_SE 793 794 Sv(i,j,0,0) = 1. !*pvi(i,j) 795 Sv(i,j,-1,0)= -1. !*pvi(i,j) 796 opposy(i,j) = 0. 932 subroutine vel_V_SE(Sv,opposy) 933 934 implicit none 935 real,dimension(-1:1,-1:1),intent(inout) :: Sv 936 real,intent(out) :: opposy 937 938 Sv(0,0) = 1. !*pvi(i,j) 939 Sv(-1,0)= -1. !*pvi(i,j) 940 opposy = 0. 797 941 798 942 return … … 803 947 !Coin SW 804 948 !---------- 805 subroutine vel_U_SW 806 807 Tu(i,j,0,0) = 1. ! *pvi(i,j) 808 Tu(i,j,0,1) = -1. ! *pvi(i,j) 809 opposx(i,j) = 0. 949 subroutine vel_U_SW(Tu,opposx) 950 951 implicit none 952 real,dimension(-1:1,-1:1),intent(inout) :: Tu 953 real,intent(out) :: opposx 954 955 Tu(0,0) = 1. ! *pvi(i,j) 956 Tu(0,1) = -1. ! *pvi(i,j) 957 opposx = 0. 810 958 811 959 return … … 813 961 !------------------------------------------------------------------ 814 962 815 subroutine vel_V_SW 816 817 Sv(i,j,0,0) = 1. !*pvi(i,j) 818 Sv(i,j,1,0) = -1. !*pvi(i,j) 819 opposy(i,j) = 0. 963 subroutine vel_V_SW(Sv,opposy) 964 965 implicit none 966 real,dimension(-1:1,-1:1),intent(inout) :: Sv 967 real,intent(out) :: opposy 968 969 Sv(0,0) = 1. !*pvi(i,j) 970 Sv(1,0) = -1. !*pvi(i,j) 971 opposy = 0. 820 972 821 973 return … … 825 977 !Coin NE 826 978 !---------- 827 subroutine vel_U_NE 828 829 Tu(i,j,0,0) = 1. ! *pvi(i,j) 830 Tu(i,j,0,-1) = -1. ! *pvi(i,j) 831 opposx(i,j) = 0. 979 subroutine vel_U_NE(Tu,opposx) 980 981 implicit none 982 real,dimension(-1:1,-1:1),intent(inout) :: Tu 983 real,intent(out) :: opposx 984 985 Tu(0,0) = 1. ! *pvi(i,j) 986 Tu(0,-1) = -1. ! *pvi(i,j) 987 opposx = 0. 832 988 833 989 return … … 835 991 !------------------------------------------------------------------ 836 992 837 subroutine vel_V_NE 838 839 Sv(i,j,0,0) = 1. ! *pvi(i,j) 840 Sv(i,j,-1,0) = -1. ! *pvi(i,j) 841 opposy(i,j) = 0. 993 subroutine vel_V_NE(Sv,opposy) 994 995 implicit none 996 real,dimension(-1:1,-1:1),intent(inout) :: Sv 997 real,intent(out) :: opposy 998 999 Sv(0,0) = 1. ! *pvi(i,j) 1000 Sv(-1,0) = -1. ! *pvi(i,j) 1001 opposy = 0. 842 1002 843 1003 return … … 847 1007 !Coin NW 848 1008 !---------- 849 subroutine vel_U_NW 850 851 Tu(i,j,0,0) = 1. ! *pvi(i,j) 852 Tu(i,j,0,-1) = -1. ! *pvi(i,j) 853 opposx(i,j) = 0. 1009 subroutine vel_U_NW(Tu,opposx) 1010 1011 implicit none 1012 real,dimension(-1:1,-1:1),intent(inout) :: Tu 1013 real,intent(out) :: opposx 1014 1015 Tu(0,0) = 1. ! *pvi(i,j) 1016 Tu(0,-1) = -1. ! *pvi(i,j) 1017 opposx = 0. 854 1018 855 1019 return … … 857 1021 !------------------------------------------------------------------ 858 1022 859 subroutine vel_V_NW 860 861 Sv(i,j,0,0) = 1. !*pvi(i,j) 862 Sv(i,j,1,0) = -1. !*pvi(i,j) 863 opposy(i,j) = 0. 1023 subroutine vel_V_NW(Sv,opposy) 1024 1025 implicit none 1026 real,dimension(-1:1,-1:1),intent(inout) :: Sv 1027 real,intent(out) :: opposy 1028 1029 Sv(0,0) = 1. !*pvi(i,j) 1030 Sv(1,0) = -1. !*pvi(i,j) 1031 opposy = 0. 864 1032 865 1033 return -
trunk/SOURCES/litho-0.4.f90
r65 r74 37 37 38 38 39 subroutine litho 39 subroutine litho 40 !$ USE OMP_LIB 41 USE module3D_phy 42 USE param_phy_mod 43 USE ISO_DECLAR ! module de declaration des variables specifiques a l'isostasie 40 44 41 USE module3D_phy 42 USE param_phy_mod 43 USE ISO_DECLAR ! module de declaration des variables specifiques a l'isostasie 45 implicit none 44 46 45 implicit none 46 47 INTEGER :: II,SOM1,SOM2 48 REAL, dimension(:,:), allocatable :: WLOC 47 INTEGER :: II,SOM1,SOM2 48 REAL, dimension(:,:), allocatable :: WLOC 49 49 50 50 51 !----- allocation de WLOC et de croix -----------51 !----- allocation de WLOC et de croix ----------- 52 52 53 54 55 56 57 58 59 53 if (.not.allocated(WLOC)) THEN 54 allocate(WLOC(-LBLOC:LBLOC,-LBLOC:LBLOC),stat=err) 55 if (err/=0) then 56 print *,"Erreur a l'allocation du tableau WLOC",err 57 stop 4 58 end if 59 end if 60 60 61 !----- fin de l'allocation --------------61 !----- fin de l'allocation -------------- 62 62 63 ! calcul de la deflexion par sommation des voisins appartenant64 ! au bloc de taille 2*LBLOC65 66 63 ! calcul de la deflexion par sommation des voisins appartenant 64 ! au bloc de taille 2*LBLOC 65 som1=0. 66 som2=0. 67 67 68 ! On somme aussi les contributions des points exterieurs au domaine 69 ! lorsque la charge est due a l'ocean. On suppose alors que 70 ! ces points ont la meme charge que les limites 71 72 boucleij : do J=1,NY 73 do I=1,NX 68 ! On somme aussi les contributions des points exterieurs au domaine 69 ! lorsque la charge est due a l'ocean. On suppose alors que 70 ! ces points ont la meme charge que les limites 71 !$OMP PARALLEL 72 !$OMP DO PRIVATE(Wloc) 73 boucleij : do J=1,NY 74 do I=1,NX 74 75 75 76 76 77 77 W1(I,J)=0. 78 ! ii=0 78 79 79 ! Wloc : enfoncement centre sur ij du a chaque charges autour80 80 ! Wloc : enfoncement centre sur ij du a chaque charges autour 81 Wloc(:,:) = We(:,:) * charge(i-lbloc:i+lbloc,j-lbloc:j+lbloc) 81 82 82 83 83 84 W1(i,j) = sum (Wloc(:,:)) ! effet en ij de toutes les charges autour (distance < lbloc) 84 85 85 ! ------------------------ FIN DE L'INTEGRATION SUR LE PAVE LBLOC86 87 86 ! ------------------------ FIN DE L'INTEGRATION SUR LE PAVE LBLOC 87 ! som1=som1+W1(I,J) 88 ! som2=som2-charge(I,J)/ROMG 88 89 89 end do 90 end do boucleij 91 92 ! write(6,*)'enfoncement total avec rigidite de la lithosphere:', 93 ! & som1 94 ! write(6,*)'enfoncement total avec isostasie locale :', 95 ! & som2 90 end do 91 end do boucleij 92 !$OMP END DO 93 !$OMP END PARALLEL 94 95 ! write(6,*)'enfoncement total avec rigidite de la lithosphere:', 96 ! & som1 97 ! write(6,*)'enfoncement total avec isostasie locale :', 98 ! & som2 96 99 97 100 98 99 101 end subroutine litho 102 -
trunk/SOURCES/taubed-0.3.f90
r4 r74 43 43 subroutine taubed() 44 44 45 !$USE OMP_LIB 45 46 USE module3D_phy 46 47 USE param_phy_mod … … 52 53 ! NLITH est defini dans isostasie et permet le choix du modele d'isostasie 53 54 55 54 56 if (NLITH.eq.1) then 55 57 ! avec rigidite de la lithosphere 58 !$OMP PARALLEL 59 !$OMP DO 56 60 do J=1,NY 57 61 do I=1,NX … … 65 69 end do 66 70 end do 67 71 !$OMP END DO 68 72 69 73 ! il faut remplir CHARGE dans les parties a l'exterieur de la grille : 70 74 ! a l'exterieur de la grille CHARGE est egale a la valeur sur le bord 71 75 !$OMP DO 72 76 do J=1,NY 73 77 CHARGE(1-LBLOC:0,J)=CHARGE(1,J) ! bord W 74 78 CHARGE(NX+1:NX+LBLOC,J)=CHARGE(NX,J) ! bord E 75 79 end do 80 !$OMP END DO 81 !$OMP DO 76 82 do I=1,NX 77 83 CHARGE(I,1-LBLOC:0)=CHARGE(I,1) ! bord S 78 84 CHARGE(I,NY+1:NY+LBLOC)=CHARGE(I,NY) ! bord N 79 85 end do 86 !$OMP END DO 80 87 81 88 ! valeur dans les quatres coins exterieurs au domaine 89 !$OMP WORKSHARE 82 90 CHARGE(1-LBLOC:0,1-LBLOC:0)=CHARGE(1,1) ! coin SW 83 91 CHARGE(1-LBLOC:0,NY+1:NY+LBLOC)=CHARGE(1,NY) ! coin NW 84 92 CHARGE(NX+1:NX+LBLOC,1-LBLOC:0)=CHARGE(NX,1) ! coin SE 85 93 CHARGE(NX+1:NX+LBLOC,NY+1:NY+LBLOC)=CHARGE(NX,NY) ! coin NE 86 94 !$OMP END WORKSHARE 95 !$OMP END PARALLEL 87 96 call litho 88 97 89 98 else 90 99 ! enfoncement local 100 !$OMP PARALLEL 101 !$OMP DO 91 102 do J=1,NY 92 103 do I=1,NX … … 100 111 end do 101 112 end do 113 !$OMP END DO 114 !$OMP END PARALLEL 102 115 endif 103 116 104 117 ! decroissance exponentielle de l'enfoncement 118 !$OMP PARALLEL 119 !$OMP DO 105 120 do J=1,NY 106 121 do I=1,NX … … 109 124 end do 110 125 end do 126 !$OMP END DO 127 !$OMP END PARALLEL 111 128 112 129 end subroutine taubed
Note: See TracChangeset
for help on using the changeset viewer.