Changeset 477 for branches


Ignore:
Timestamp:
02/07/24 17:26:41 (4 months ago)
Author:
aquiquet
Message:

Cleaning branch: determin_front and determin_marais with explicit arguments

Location:
branches/GRISLIv3/SOURCES
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/GRISLIv3/SOURCES/flottab2-0.7.f90

    r471 r477  
    1717 
    1818  !$ USE OMP_LIB 
    19   USE geography, only: nx,ny 
    2019 
    2120  implicit none 
     
    6665     
    6766    use runparam, only:itracebug,nt 
     67    use geography, only:nx,ny 
    6868    use module3D_phy, only:igrdline,mk_init,flot,H,sealevel_2d,Bsoc,S,H,B,& 
    6969         ice,front,& 
     
    342342    !$OMP END PARALLEL 
    343343 
    344     call determin_front_tof 
     344    call determin_front_tof(front,ice) 
    345345 
    346346    ! pour sorties initMIP: 
     
    356356  !> 
    357357  subroutine determin_tache 
    358      
     358 
     359    use geography, only:nx,ny 
    359360    use module3D_phy, only:ice,flot,gzmx,gzmy,S,flgzmx,flgzmy,sealevel,time,iceberg,& 
    360361         debug_3D 
     
    552553  !!Routine pour la determination du front 
    553554  !> 
    554   subroutine determin_front 
    555  
    556     use module3D_phy, only:ice,H,front 
    557  
     555  subroutine determin_front(ice,H,front) 
    558556     
    559557!!$ USE OMP_LIB 
    560558    implicit none 
    561      
     559 
     560    integer,dimension(:,:), intent(inout) :: ice,front 
     561    real, dimension(:,:),   intent(inout) :: H 
     562 
     563    integer :: nxl,nyl 
    562564    integer :: pmx,pmy !pm=plus-moins -1 ou 1 pour x et y  
    563565    integer :: i,j,k 
     
    565567    integer :: j_moins1,j_plus1,j_plus2 
    566568 
     569    nxl=ubound(ice,1) 
     570    nyl=ubound(ice,2) 
     571 
    567572    !$OMP PARALLEL 
    568573    !$OMP DO 
    569     do j=3,ny-2 
    570        do i=3,nx-2 
     574    do j=3,nyl-2 
     575       do i=3,nxl-2 
    571576 
    572577          surice:if  (ice(i,j).eq.0) then 
     
    627632       !$OMP PARALLEL 
    628633       !$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 
    631636 
    632637             surice_xy: if  (ice(i,j).eq.0) then 
    633638                i_moins1=max(i-1,1) 
    634639                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) 
    639644 
    640645                ! test (iii) pour trouver les baies de largeur 1 ou 2 cases  
     
    668673    !$OMP PARALLEL 
    669674    !$OMP DO 
    670     do j=2,ny-1 
    671        do i=2,nx-1 
     675    do j=2,nyl-1 
     676       do i=2,nxl-1 
    672677 
    673678          if (ice(i,j).eq.1) then     !         test si ice=1 
     
    687692 
    688693    !$OMP DO PRIVATE(i) 
    689     do j=2,ny-1 
     694    do j=2,nyl-1 
    690695       i=1 
    691696       front(i,j)=(ice(i+1,j)+ice(i,j+1)+ice(i,j-1)) 
    692        i=nx 
     697       i=nxl 
    693698       front(i,j)=(ice(i-1,j)+ice(i,j+1)+ice(i,j-1)) 
    694699    end do 
     
    696701 
    697702    !$OMP DO PRIVATE(j) 
    698     do i=2,nx-1 
     703    do i=2,nxl-1 
    699704       j=1  
    700705       front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j+1)) 
    701        j=ny 
     706       j=nyl 
    702707       front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j-1)) 
    703708    end do 
     
    707712 
    708713    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) 
    712717 
    713718 
     
    718723 
    719724    !$OMP DO  
    720     do j=1,ny 
    721        do i=1,nx-1 
     725    do j=1,nyl 
     726       do i=1,nxl-1 
    722727          if (front(i,j).eq.1) then 
    723728             if (front(i+1,j).eq.1) then 
     
    733738 
    734739    !$OMP DO  
    735     do j=1,ny-1 
    736        do i=1,nx 
     740    do j=1,nyl-1 
     741       do i=1,nxl 
    737742          if (front(i,j).eq.1) then 
    738743             if (front(i,j+1).eq.1) then 
     
    753758  !------------------------------------------------------------------------------ 
    754759 
    755   subroutine determin_front_tof 
    756  
    757     use module3D_phy, only:front,ice 
     760  subroutine determin_front_tof(front,ice) 
    758761 
    759762    implicit none 
    760      
     763 
     764    integer, dimension(:,:), intent(inout) :: front,ice 
     765     
     766    integer :: nxl,nyl 
    761767    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 
    763773    !$OMP PARALLEL 
    764774    !$OMP DO 
    765     do j=2,ny-1 
    766        do i=2,nx-1 
     775    do j=2,nyl-1 
     776       do i=2,nxl-1 
    767777 
    768778          if (ice(i,j).eq.1) then     !         test si ice=1 
     
    782792 
    783793    !$OMP DO PRIVATE(i) 
    784     do j=2,ny-1 
     794    do j=2,nyl-1 
    785795       i=1 
    786796       front(i,j)=(ice(i+1,j)+ice(i,j+1)+ice(i,j-1)) 
    787        i=nx 
     797       i=nxl 
    788798       front(i,j)=(ice(i-1,j)+ice(i,j+1)+ice(i,j-1)) 
    789799    end do 
     
    791801 
    792802    !$OMP DO PRIVATE(j) 
    793     do i=2,nx-1 
     803    do i=2,nxl-1 
    794804       j=1  
    795805       front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j+1)) 
    796        j=ny 
     806       j=nyl 
    797807       front(i,j)=(ice(i-1,j)+ice(i+1,j)+ice(i,j-1)) 
    798808    end do 
     
    802812 
    803813    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) 
    807817 
    808818    ! Les points à plus d'un point de grille du bord sont front=-1 
     
    813823 
    814824    !$OMP DO 
    815     do j=2,ny-1 
    816        do i=2,nx-1 
     825    do j=2,nyl-1 
     826       do i=2,nxl-1 
    817827          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 
    818828             nofront(i,j)=-1 
     
    838848  !! Copie sauvage de determin_tache, adapte au probleme du marais 
    839849  !> 
    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 
    843852    !$ USE OMP_LIB 
    844853 
    845854    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    
    847860    integer,parameter               :: n_ta_max=2000!< nombre de tache max 
    848861 
     862    integer :: nxl,nyl 
    849863    integer :: i,j 
    850864    integer :: indice 
     
    854868    integer,dimension(mask_nb) :: mask ! numero de tache des points adjacents 
    855869 
    856     integer,dimension(nx,ny)          :: table_out_marais    !< numeros de tache d'un point ij 
     870    integer,dimension(ubound(ice,1),ubound(ice,2))    :: table_out_marais    !< numeros de tache d'un point ij 
    857871    integer,dimension(0:n_ta_max)     :: compt_marais        !< contient les equivalence entre les taches 
    858872    integer,dimension(0:n_ta_max)     :: nb_pts_marais       !< indique le nombre de points par tache 
     
    862876    ! 1-initialisation 
    863877    !----------------- 
     878    nxl=ubound(ice,1) 
     879    nyl=ubound(ice,2) 
    864880    label_max=1      ! numero de la tache, la premiere tache est notée 1 
    865881    label=1 
     
    878894    !---------------------- 
    879895 
    880     do j=2,ny-1 
    881        do i=2,nx-1 
     896    do j=2,nyl-1 
     897       do i=2,nxl-1 
    882898          if ((ice(i,j).ge.1).and.flot(i,j)) then ! on est sur la glace qui flotte-------------------! 
    883899 
     
    936952    !$OMP PARALLEL 
    937953    !$OMP DO 
    938     do j=1,ny 
    939        do i=1,nx 
     954    do j=1,nyl 
     955       do i=1,nxl 
    940956          if (table_out_marais(i,j).ne.0) then 
    941957             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  
    1616  use module3d_phy, only: ispinup,isynchro,timemax,time,flot,S,B,Bsoc,H,sealevel_2d,hmx,hmy,& 
    1717       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 
    1919  use runparam, only: itracebug,nt,num_tracebug 
    2020  use equat_adv_diff_2D_vect, only: icethick3 
     
    6565     call bilan_flux_output      
    6666     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) 
    6868     if (itracebug.eq.1)  call tracebug('apres marais') 
    6969 
Note: See TracChangeset for help on using the changeset viewer.