- Timestamp:
- 02/07/24 17:26:41 (4 months ago)
- Location:
- branches/GRISLIv3/SOURCES
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GRISLIv3/SOURCES/flottab2-0.7.f90
r471 r477 17 17 18 18 !$ USE OMP_LIB 19 USE geography, only: nx,ny20 19 21 20 implicit none … … 66 65 67 66 use runparam, only:itracebug,nt 67 use geography, only:nx,ny 68 68 use module3D_phy, only:igrdline,mk_init,flot,H,sealevel_2d,Bsoc,S,H,B,& 69 69 ice,front,& … … 342 342 !$OMP END PARALLEL 343 343 344 call determin_front_tof 344 call determin_front_tof(front,ice) 345 345 346 346 ! pour sorties initMIP: … … 356 356 !> 357 357 subroutine determin_tache 358 358 359 use geography, only:nx,ny 359 360 use module3D_phy, only:ice,flot,gzmx,gzmy,S,flgzmx,flgzmy,sealevel,time,iceberg,& 360 361 debug_3D … … 552 553 !!Routine pour la determination du front 553 554 !> 554 subroutine determin_front 555 556 use module3D_phy, only:ice,H,front 557 555 subroutine determin_front(ice,H,front) 558 556 559 557 !!$ USE OMP_LIB 560 558 implicit none 561 559 560 integer,dimension(:,:), intent(inout) :: ice,front 561 real, dimension(:,:), intent(inout) :: H 562 563 integer :: nxl,nyl 562 564 integer :: pmx,pmy !pm=plus-moins -1 ou 1 pour x et y 563 565 integer :: i,j,k … … 565 567 integer :: j_moins1,j_plus1,j_plus2 566 568 569 nxl=ubound(ice,1) 570 nyl=ubound(ice,2) 571 567 572 !$OMP PARALLEL 568 573 !$OMP DO 569 do j=3,ny -2570 do i=3,nx -2574 do j=3,nyl-2 575 do i=3,nxl-2 571 576 572 577 surice:if (ice(i,j).eq.0) then … … 627 632 !$OMP PARALLEL 628 633 !$OMP DO PRIVATE(i_moins1,j_moins1,i_plus1,j_plus1,i_plus2,j_plus2) 629 do j=1,ny 630 do i=1,nx 634 do j=1,nyl 635 do i=1,nxl 631 636 632 637 surice_xy: if (ice(i,j).eq.0) then 633 638 i_moins1=max(i-1,1) 634 639 j_moins1=max(j-1,1) 635 i_plus1=min(i+1,nx )636 j_plus1=min(j+1,ny )637 i_plus2=min(i+2,nx )638 j_plus2=min(j+2,ny )640 i_plus1=min(i+1,nxl) 641 j_plus1=min(j+1,nyl) 642 i_plus2=min(i+2,nxl) 643 j_plus2=min(j+2,nyl) 639 644 640 645 ! test (iii) pour trouver les baies de largeur 1 ou 2 cases … … 668 673 !$OMP PARALLEL 669 674 !$OMP DO 670 do j=2,ny -1671 do i=2,nx -1675 do j=2,nyl-1 676 do i=2,nxl-1 672 677 673 678 if (ice(i,j).eq.1) then ! test si ice=1 … … 687 692 688 693 !$OMP DO PRIVATE(i) 689 do j=2,ny -1694 do j=2,nyl-1 690 695 i=1 691 696 front(i,j)=(ice(i+1,j)+ice(i,j+1)+ice(i,j-1)) 692 i=nx 697 i=nxl 693 698 front(i,j)=(ice(i-1,j)+ice(i,j+1)+ice(i,j-1)) 694 699 end do … … 696 701 697 702 !$OMP DO PRIVATE(j) 698 do i=2,nx -1703 do i=2,nxl-1 699 704 j=1 700 705 front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j+1)) 701 j=ny 706 j=nyl 702 707 front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j-1)) 703 708 end do … … 707 712 708 713 front(1,1)=ice(2,1)+ice(2,1) 709 front(1,ny )=ice(2,ny)+ice(1,ny-1)710 front(nx ,1)=ice(nx,2)+ice(nx-1,1)711 front(nx ,ny)=ice(nx,ny-1)+ice(nx-1,ny)714 front(1,nyl)=ice(2,nyl)+ice(1,nyl-1) 715 front(nxl,1)=ice(nxl,2)+ice(nxl-1,1) 716 front(nxl,nyl)=ice(nxl,nyl-1)+ice(nxl-1,nyl) 712 717 713 718 … … 718 723 719 724 !$OMP DO 720 do j=1,ny 721 do i=1,nx -1725 do j=1,nyl 726 do i=1,nxl-1 722 727 if (front(i,j).eq.1) then 723 728 if (front(i+1,j).eq.1) then … … 733 738 734 739 !$OMP DO 735 do j=1,ny -1736 do i=1,nx 740 do j=1,nyl-1 741 do i=1,nxl 737 742 if (front(i,j).eq.1) then 738 743 if (front(i,j+1).eq.1) then … … 753 758 !------------------------------------------------------------------------------ 754 759 755 subroutine determin_front_tof 756 757 use module3D_phy, only:front,ice 760 subroutine determin_front_tof(front,ice) 758 761 759 762 implicit none 760 763 764 integer, dimension(:,:), intent(inout) :: front,ice 765 766 integer :: nxl,nyl 761 767 integer :: i,j 762 integer,dimension(nx,ny) :: nofront ! tableau de travail (points au dela du front) 768 integer,dimension(ubound(ice,1),ubound(ice,2)) :: nofront ! tableau de travail (points au dela du front) 769 770 nxl=ubound(ice,1) 771 nyl=ubound(ice,2) 772 763 773 !$OMP PARALLEL 764 774 !$OMP DO 765 do j=2,ny -1766 do i=2,nx -1775 do j=2,nyl-1 776 do i=2,nxl-1 767 777 768 778 if (ice(i,j).eq.1) then ! test si ice=1 … … 782 792 783 793 !$OMP DO PRIVATE(i) 784 do j=2,ny -1794 do j=2,nyl-1 785 795 i=1 786 796 front(i,j)=(ice(i+1,j)+ice(i,j+1)+ice(i,j-1)) 787 i=nx 797 i=nxl 788 798 front(i,j)=(ice(i-1,j)+ice(i,j+1)+ice(i,j-1)) 789 799 end do … … 791 801 792 802 !$OMP DO PRIVATE(j) 793 do i=2,nx -1803 do i=2,nxl-1 794 804 j=1 795 805 front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j+1)) 796 j=ny 806 j=nyl 797 807 front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j-1)) 798 808 end do … … 802 812 803 813 front(1,1)=ice(2,1)+ice(2,1) 804 front(1,ny )=ice(2,ny)+ice(1,ny-1)805 front(nx ,1)=ice(nx,2)+ice(nx-1,1)806 front(nx ,ny)=ice(nx,ny-1)+ice(nx-1,ny)814 front(1,nyl)=ice(2,nyl)+ice(1,nyl-1) 815 front(nxl,1)=ice(nxl,2)+ice(nxl-1,1) 816 front(nxl,nyl)=ice(nxl,nyl-1)+ice(nxl-1,nyl) 807 817 808 818 ! Les points à plus d'un point de grille du bord sont front=-1 … … 813 823 814 824 !$OMP DO 815 do j=2,ny -1816 do i=2,nx -1825 do j=2,nyl-1 826 do i=2,nxl-1 817 827 if ((ice(i,j).eq.0).and.(front(i-1,j)+front(i+1,j)+front(i,j-1)+front(i,j+1)).eq.0) then 818 828 nofront(i,j)=-1 … … 838 848 !! Copie sauvage de determin_tache, adapte au probleme du marais 839 849 !> 840 subroutine determin_marais 841 842 use module3D_phy, only:ice,flot,flot_marais,debug_3D 850 subroutine determin_marais(ice,flot,flot_marais,debug_3D) 851 843 852 !$ USE OMP_LIB 844 853 845 854 implicit none 846 855 856 integer,dimension(:,:),intent(inout) :: ice 857 logical,dimension(:,:),intent(inout) :: flot,flot_marais 858 real,dimension(:,:,:), intent(inout) :: debug_3D 859 847 860 integer,parameter :: n_ta_max=2000!< nombre de tache max 848 861 862 integer :: nxl,nyl 849 863 integer :: i,j 850 864 integer :: indice … … 854 868 integer,dimension(mask_nb) :: mask ! numero de tache des points adjacents 855 869 856 integer,dimension( nx,ny):: table_out_marais !< numeros de tache d'un point ij870 integer,dimension(ubound(ice,1),ubound(ice,2)) :: table_out_marais !< numeros de tache d'un point ij 857 871 integer,dimension(0:n_ta_max) :: compt_marais !< contient les equivalence entre les taches 858 872 integer,dimension(0:n_ta_max) :: nb_pts_marais !< indique le nombre de points par tache … … 862 876 ! 1-initialisation 863 877 !----------------- 878 nxl=ubound(ice,1) 879 nyl=ubound(ice,2) 864 880 label_max=1 ! numero de la tache, la premiere tache est notée 1 865 881 label=1 … … 878 894 !---------------------- 879 895 880 do j=2,ny -1881 do i=2,nx -1896 do j=2,nyl-1 897 do i=2,nxl-1 882 898 if ((ice(i,j).ge.1).and.flot(i,j)) then ! on est sur la glace qui flotte-------------------! 883 899 … … 936 952 !$OMP PARALLEL 937 953 !$OMP DO 938 do j=1,ny 939 do i=1,nx 954 do j=1,nyl 955 do i=1,nxl 940 956 if (table_out_marais(i,j).ne.0) then 941 957 nb_pts_marais(compt_marais(table_out_marais(i,j)))= nb_pts_marais(compt_marais(table_out_marais(i,j)))+1 -
branches/GRISLIv3/SOURCES/steps_time_loop.f90
r476 r477 16 16 use module3d_phy, only: ispinup,isynchro,timemax,time,flot,S,B,Bsoc,H,sealevel_2d,hmx,hmy,& 17 17 ice,bm,bmelt,ablbord,ablbord_dtt,dt, & 18 uxbar,uybar,hdot,dtmax,dtmin,iout 18 uxbar,uybar,hdot,dtmax,dtmin,iout,flot_marais,debug_3D 19 19 use runparam, only: itracebug,nt,num_tracebug 20 20 use equat_adv_diff_2D_vect, only: icethick3 … … 65 65 call bilan_flux_output 66 66 call flottab 67 if (isynchro.eq.1.or.nt.eq.1) call determin_marais 67 if (isynchro.eq.1.or.nt.eq.1) call determin_marais(ice,flot,flot_marais,debug_3D) 68 68 if (itracebug.eq.1) call tracebug('apres marais') 69 69
Note: See TracChangeset
for help on using the changeset viewer.