Changeset 417 for branches/GRISLIv3/SOURCES/moy_mxmy.f90
- Timestamp:
- 04/24/23 10:37:26 (14 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GRISLIv3/SOURCES/moy_mxmy.f90
r71 r417 17 17 !< 18 18 subroutine moy_mxmy(n1,n2,X2D,X_mx,X_my) 19 ! fait la moyenne ponderee d'un tableau X2D sur les mailles staggered20 !$ USE OMP_LIB21 implicit none22 integer, intent(in) :: n1,n2 !< dimension des tableaux23 real, dimension(n1,n2),intent(in) :: X2D !< tableau sur les noeuds majeurs24 real, dimension(n1,n2),intent(out) :: X_mx !< tableau sur les noeuds mineurs x25 real, dimension(n1,n2),intent(out) :: X_my !< tableau sur les noeuds mineurs y19 ! fait la moyenne ponderee d'un tableau X2D sur les mailles staggered 20 !$ USE OMP_LIB 21 implicit none 22 integer, intent(in) :: n1,n2 !< dimension des tableaux 23 real, dimension(n1,n2),intent(in) :: X2D !< tableau sur les noeuds majeurs 24 real, dimension(n1,n2),intent(out) :: X_mx !< tableau sur les noeuds mineurs x 25 real, dimension(n1,n2),intent(out) :: X_my !< tableau sur les noeuds mineurs y 26 26 27 integer :: i,j28 integer :: i_moins1,j_moins1,i_plus1,j_plus127 integer :: i,j 28 integer :: i_moins1,j_moins1,i_plus1,j_plus1 29 29 30 30 31 31 !$OMP PARALLEL PRIVATE(i_moins1,j_moins1,i_plus1,j_plus1) 32 32 !$OMP DO 33 34 35 36 37 38 33 do j=1,n2 34 do i=1,n1 35 i_moins1=max(1,i-1) 36 j_moins1=max(1,j-1) 37 i_plus1=min(n1,i+1) 38 j_plus1=min(n2,j+1) 39 39 40 41 + 0.125*((X2D(i_moins1,j_plus1)+X2D(i,j_plus1)) &42 + (X2D(i_moins1,j_moins1)+X2D(i,j_moins1)))40 X_mx(i,j)=0.25*(X2D(i,j)+X2D(i_moins1,j)) & 41 + 0.125*((X2D(i_moins1,j_plus1)+X2D(i,j_plus1)) & 42 + (X2D(i_moins1,j_moins1)+X2D(i,j_moins1))) 43 43 44 45 + 0.125*((X2D(i_plus1,j_moins1)+X2D(i_plus1,j)) &46 + (X2D(i_moins1,j_moins1)+X2D(i_moins1,j)))47 48 44 X_my(i,j)=0.25*(X2D(i,j)+X2D(i,j_moins1)) & 45 + 0.125*((X2D(i_plus1,j_moins1)+X2D(i_plus1,j)) & 46 + (X2D(i_moins1,j_moins1)+X2D(i_moins1,j))) 47 end do 48 end do 49 49 !$OMP END DO 50 50 !$OMP END PARALLEL 51 51 52 return52 return 53 53 end subroutine moy_mxmy 54 54
Note: See TracChangeset
for help on using the changeset viewer.