- Timestamp:
- Jul 24, 2024, 8:45:54 PM (5 months ago)
- Location:
- LMDZ6/branches/Amaury_dev
- Files:
-
- 3 added
- 6 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxy.f90
r5108 r5122 5 5 rlonu, xprimu, rlonv, xprimv, rlonm025, xprimm025, rlonp025, xprimp025) 6 6 7 USE comconst_mod, ONLY: pi 8 USE serre_mod, ONLY: pxo, pyo, alphax, alphay, transx, transy 9 USE lmdz_fxy, ONLY: fxy_new 7 USE lmdz_fxy_new, ONLY: fx, fxprim, fy, fyprim 10 8 11 9 IMPLICIT NONE … … 26 24 REAL :: rlonu(iip1), xprimu(iip1), rlonv(iip1), xprimv(iip1), & 27 25 rlonm025(iip1), xprimm025(iip1), rlonp025(iip1), xprimp025(iip1) 28 REAL :: ripx, fx, fxprim, fy, fyprim, ri, rj, bigy29 30 CALL fxy_new(ripx, fx, fxprim, fy, fyprim, ri, rj, bigy)31 26 32 27 ! ...... calcul des latitudes et de y' ..... -
LMDZ6/branches/Amaury_dev/libf/dyn3d_common/fxysinus.f90
r5108 r5122 6 6 7 7 USE comconst_mod, ONLY: pi 8 USE lmdz_fxy , ONLY: fxy_sin8 USE lmdz_fxy_sin, ONLY: fx, fxprim, fy, fyprim 9 9 IMPLICIT NONE 10 10 ! … … 24 24 REAL :: rlonu(iip1), xprimu(iip1), rlonv(iip1), xprimv(iip1), & 25 25 rlonm025(iip1), xprimm025(iip1), rlonp025(iip1), xprimp025(iip1) 26 REAL :: fy, fx, fxprim, fyprim, ri, rj27 28 CALL fxy_sin(fy, fx, fxprim, fyprim, ri, rj)29 30 26 31 27 ! ...... calcul des latitudes et de y' ..... -
LMDZ6/branches/Amaury_dev/libf/grid/lmdz_fxy_new.f90
r5118 r5122 1 ! This module replaces grid/fxy *.h1 ! This module replaces grid/fxy_new.h 2 2 3 MODULE lmdz_fxy 3 MODULE lmdz_fxy_new 4 USE comconst_mod, ONLY: pi 5 USE serre_mod, ONLY: pxo, pyo, alphax, alphay, transx, transy 4 6 IMPLICIT NONE; PRIVATE 5 PUBLIC fxy_new, fxy_reg, fxy_sin, fxy_prim 7 PUBLIC fx, fxprim, fy, fyprim 8 INCLUDE "dimensions.h" 9 INCLUDE "paramet.h" 6 10 CONTAINS 7 SUBROUTINE fxy_new(ripx, fx, fxprim, fy, fyprim, ri, rj, bigy) 8 INCLUDE "dimensions.h" 9 REAL :: ripx, fx, fxprim, fy, fyprim, ri, rj, bigy 11 REAL FUNCTION ripx(ri) 12 REAL, INTENT(IN) :: ri 13 ripx = (ri - 1.0) * 2. * pi / REAL(iim) 14 END FUNCTION ripx 10 15 11 !....stretching in x... 12 ripx(ri) = (ri - 1.0) * 2. * pi / REAL(iim) 13 fx (ri) = ripx(ri) + transx + & 14 alphax * SIN(ripx(ri) + transx - pxo) - pi 15 fxprim(ri) = 2. * pi / REAL(iim) * & 16 (1. + alphax * COS(ripx(ri) + transx - pxo)) 16 REAL FUNCTION fx(ri) 17 REAL, INTENT(IN) :: ri 18 fx = ripx(ri) + transx + alphax * SIN(ripx(ri) + transx - pxo) - pi 19 END FUNCTION fx 17 20 18 !....stretching in y... 19 bigy(rj) = 2. * (REAL(jjp1) - rj) * pi / jjm 20 fy(rj) = (bigy(rj) + transy + & 21 alphay * SIN(bigy(rj) + transy - pyo)) / 2. - pi / 2. 22 fyprim(rj) = (pi / jjm) * (1. + & 23 alphay * COS(bigy(rj) + transy - pyo)) 21 REAL FUNCTION fxprim(ri) 22 REAL, INTENT(IN) :: ri 23 fxprim = 2. * pi / REAL(iim) * (1. + alphax * COS(ripx(ri) + transx - pxo)) 24 END FUNCTION fxprim 24 25 25 ! fy(rj)= pyo-pisjjm*(rj-transy)+coefalpha*SIN(depisjm*(rj- 26 ! * transy )) 27 ! fyprim(rj)= pisjjm-pisjjm*coefy2* COS(depisjm*(rj-transy)) 28 !-------------------------------------------------------------- 29 END SUBROUTINE fxy_new 26 REAL FUNCTION bigy(rj) 27 REAL, INTENT(IN) :: rj 28 bigy = 2. * (REAL(jjp1) - rj) * pi / jjm 29 END FUNCTION bigy 30 30 31 SUBROUTINE fxy_reg(fy, fx, fxprim, fyprim, ri, rj) 32 INCLUDE "dimensions.h" 33 REAL :: fy, fx, fxprim, fyprim, ri, rj 31 REAL FUNCTION fy(rj) 32 REAL, INTENT(IN) :: rj 33 fy = (bigy(rj) + transy + alphay * SIN(bigy(rj) + transy - pyo)) / 2. - pi / 2. 34 END FUNCTION fy 34 35 35 fy (rj) = pi / REAL(jjm) * (0.5 * REAL(jjm) + 1. - rj) 36 fyprim(rj) = pi / REAL(jjm) 37 38 ! fy(rj)=ASIN(1.+2.*((1.-rj)/REAL(jjm))) 39 ! fyprim(rj)=1./SQRT((rj-1.)*(jjm+1.-rj)) 40 41 fx (ri) = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.) 42 ! fx ( ri ) = 2.*pi/REAL(iim) * ( ri - 0.5* ( REAL(iim) + 1.) ) 43 fxprim(ri) = 2. * pi / REAL(iim) 44 ! 45 ! La valeur de pi est passee par le common/const/ou /const2/ . 46 ! Sinon, il faut la calculer avant d'appeler ces fonctions . 47 ! 48 ! ---------------------------------------------------------------- 49 ! Fonctions a changer eventuellement, selon x(x) et y(y) choisis . 50 ! ----------------------------------------------------------------- 51 ! 52 ! ..... ici, on a l'application particuliere suivante ........ 53 ! 54 ! ************************************** 55 ! ** x = 2. * pi/iim * X ** 56 ! ** y = pi/jjm * Y ** 57 ! ************************************** 58 ! 59 ! .................................................................. 60 ! .................................................................. 61 ! 62 ! 63 ! 64 !----------------------------------------------------------------------- 65 66 END SUBROUTINE fxy_reg 67 68 SUBROUTINE fxy_sin(fy, fx, fxprim, fyprim, ri, rj) 69 REAL :: fy, fx, fxprim, fyprim, ri, rj 70 71 fy(rj) = ASIN(1. + 2. * ((1. - rj) / REAL(jjm))) 72 fyprim(rj) = 1. / SQRT((rj - 1.) * (jjm + 1. - rj)) 73 74 fx (ri) = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.) 75 ! fx ( ri ) = 2.*pi/REAL(iim) * ( ri - 0.5* ( REAL(iim) + 1.) ) 76 fxprim(ri) = 2. * pi / REAL(iim) 77 ! 78 ! 79 ! La valeur de pi est passee par le common/const/ou /const2/ . 80 ! Sinon, il faut la calculer avant d'appeler ces fonctions . 81 ! 82 ! ---------------------------------------------------------------- 83 ! Fonctions a changer eventuellement, selon x(x) et y(y) choisis . 84 ! ----------------------------------------------------------------- 85 ! 86 ! ..... ici, on a l'application particuliere suivante ........ 87 ! 88 ! ************************************** 89 ! ** x = 2. * pi/iim * X ** 90 ! ** y = pi/jjm * Y ** 91 ! ************************************** 92 ! 93 ! .................................................................. 94 ! .................................................................. 95 ! 96 ! 97 ! 98 !----------------------------------------------------------------------- 99 END SUBROUTINE fxy_sin 100 101 SUBROUTINE fxy_prim(fy, fx, fxprim, fyprim, ri, rj) 102 REAL :: fy, fx, fxprim, fyprim, ri, rj 103 104 fy (rj) = pi / REAL(jjm) * (0.5 * REAL(jjm) + 1. - rj) 105 fyprim(rj) = pi / REAL(jjm) 106 107 ! fy(rj)=ASIN(1.+2.*((1.-rj)/REAL(jjm))) 108 ! fyprim(rj)=1./SQRT((rj-1.)*(jjm+1.-rj)) 109 110 fx (ri) = 2. * pi / REAL(iim) * (ri - 0.5 * REAL(iim) - 1.) 111 ! fx ( ri ) = 2.*pi/REAL(iim) * ( ri - 0.5* ( REAL(iim) + 1.) ) 112 fxprim(ri) = 2. * pi / REAL(iim) 113 ! 114 ! 115 ! La valeur de pi est passee par le common/const/ou /const2/ . 116 ! Sinon, il faut la calculer avant d'appeler ces fonctions . 117 ! 118 ! ---------------------------------------------------------------- 119 ! Fonctions a changer eventuellement, selon x(x) et y(y) choisis . 120 ! ----------------------------------------------------------------- 121 ! 122 ! ..... ici, on a l'application particuliere suivante ........ 123 ! 124 ! ************************************** 125 ! ** x = 2. * pi/iim * X ** 126 ! ** y = pi/jjm * Y ** 127 ! ************************************** 128 ! 129 ! .................................................................. 130 ! .................................................................. 131 ! 132 ! 133 ! 134 !----------------------------------------------------------------------- 135 END SUBROUTINE fxy_prim 136 END MODULE lmdz_fxy 36 REAL FUNCTION fyprim(rj) 37 REAL, INTENT(IN) :: rj 38 fyprim = (pi / jjm) * (1. + alphay * COS(bigy(rj) + transy - pyo)) 39 END FUNCTION fyprim 40 END MODULE lmdz_fxy_new -
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_libmath.f90
r5116 r5122 3 3 MODULE lmdz_libmath 4 4 IMPLICIT NONE; PRIVATE 5 PUBLIC ismin, ismax 5 PUBLIC ismin, ismax, minmax 6 6 7 7 CONTAINS -
LMDZ6/branches/Amaury_dev/libf/misc/lmdz_readTracFiles.f90
r5117 r5122 429 429 IF(LEN_TRIM(str) == 0) CYCLE !--- Empty line (probably end of file) 430 430 IF(str == '') CYCLE !--- Skip empty line (probably at the end of the file) 431 IF(str(1:1)== 432 '&') THEN !=== SECTION HEADER LINE 431 IF(str(1:1)=='&') THEN !=== SECTION HEADER LINE 433 432 ndb = SIZE(dBase) !--- Number of sections so far 434 433 secn = str(2:LEN_TRIM(str)) // ' ' !--- Current section name -
LMDZ6/branches/Amaury_dev/libf/phy_common/lmdz_phys_omp_transfert.f90
r5110 r5122 1 2 1 !$Header$ 3 2 4 3 MODULE lmdz_phys_omp_transfert 5 6 4 PRIVATE 7 8 REAL,PARAMETER :: grow_factor=1.5 9 INTEGER,PARAMETER :: size_min=1024 10 11 CHARACTER(LEN=size_min),SAVE :: buffer_c 12 ! INTEGER,SAVE :: size_c=0 13 INTEGER,SAVE,ALLOCATABLE,DIMENSION(:) :: buffer_i 14 INTEGER,SAVE :: size_i=0 15 REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: buffer_r 16 INTEGER,SAVE :: size_r=0 17 LOGICAL,SAVE,ALLOCATABLE,DIMENSION(:) :: buffer_l 18 INTEGER,SAVE :: size_l=0 19 20 21 22 5 6 REAL, PARAMETER :: grow_factor = 1.5 7 INTEGER, PARAMETER :: size_min = 1024 8 9 CHARACTER(LEN = size_min), SAVE :: buffer_c 10 INTEGER, SAVE, ALLOCATABLE, DIMENSION(:) :: buffer_i 11 INTEGER, SAVE :: size_i = 0 12 REAL, SAVE, ALLOCATABLE, DIMENSION(:) :: buffer_r 13 INTEGER, SAVE :: size_r = 0 14 LOGICAL, SAVE, ALLOCATABLE, DIMENSION(:) :: buffer_l 15 INTEGER, SAVE :: size_l = 0 16 23 17 INTERFACE bcast_omp 24 MODULE PROCEDURE bcast_omp_c, 25 bcast_omp_i,bcast_omp_i1,bcast_omp_i2,bcast_omp_i3,bcast_omp_i4, &26 bcast_omp_r,bcast_omp_r1,bcast_omp_r2,bcast_omp_r3,bcast_omp_r4, &27 bcast_omp_l,bcast_omp_l1,bcast_omp_l2,bcast_omp_l3,bcast_omp_l418 MODULE PROCEDURE bcast_omp_c, & 19 bcast_omp_i, bcast_omp_i1, bcast_omp_i2, bcast_omp_i3, bcast_omp_i4, & 20 bcast_omp_r, bcast_omp_r1, bcast_omp_r2, bcast_omp_r3, bcast_omp_r4, & 21 bcast_omp_l, bcast_omp_l1, bcast_omp_l2, bcast_omp_l3, bcast_omp_l4 28 22 END INTERFACE 29 23 30 24 INTERFACE scatter_omp 31 MODULE PROCEDURE scatter_omp_i, scatter_omp_i1,scatter_omp_i2,scatter_omp_i3, &32 scatter_omp_r,scatter_omp_r1,scatter_omp_r2,scatter_omp_r3, &33 scatter_omp_l,scatter_omp_l1,scatter_omp_l2,scatter_omp_l325 MODULE PROCEDURE scatter_omp_i, scatter_omp_i1, scatter_omp_i2, scatter_omp_i3, & 26 scatter_omp_r, scatter_omp_r1, scatter_omp_r2, scatter_omp_r3, & 27 scatter_omp_l, scatter_omp_l1, scatter_omp_l2, scatter_omp_l3 34 28 END INTERFACE 35 29 36 37 30 INTERFACE gather_omp 38 MODULE PROCEDURE gather_omp_i, gather_omp_i1,gather_omp_i2,gather_omp_i3, &39 gather_omp_r,gather_omp_r1,gather_omp_r2,gather_omp_r3, &40 gather_omp_l,gather_omp_l1,gather_omp_l2,gather_omp_l331 MODULE PROCEDURE gather_omp_i, gather_omp_i1, gather_omp_i2, gather_omp_i3, & 32 gather_omp_r, gather_omp_r1, gather_omp_r2, gather_omp_r3, & 33 gather_omp_l, gather_omp_l1, gather_omp_l2, gather_omp_l3 41 34 END INTERFACE 42 43 35 44 36 INTERFACE reduce_sum_omp 45 MODULE PROCEDURE reduce_sum_omp_i, reduce_sum_omp_i1,reduce_sum_omp_i2,reduce_sum_omp_i3,reduce_sum_omp_i4, &46 reduce_sum_omp_r,reduce_sum_omp_r1,reduce_sum_omp_r2,reduce_sum_omp_r3,reduce_sum_omp_r447 END INTERFACE 37 MODULE PROCEDURE reduce_sum_omp_i, reduce_sum_omp_i1, reduce_sum_omp_i2, reduce_sum_omp_i3, reduce_sum_omp_i4, & 38 reduce_sum_omp_r, reduce_sum_omp_r1, reduce_sum_omp_r2, reduce_sum_omp_r3, reduce_sum_omp_r4 39 END INTERFACE 48 40 49 41 INTERFACE reduce_min_omp 50 MODULE PROCEDURE reduce_min_omp_i,reduce_min_omp_i1,reduce_min_omp_i2,reduce_min_omp_i3,reduce_min_omp_i4, & 51 reduce_min_omp_r,reduce_min_omp_r1,reduce_min_omp_r2,reduce_min_omp_r3,reduce_min_omp_r4 52 END INTERFACE 53 54 55 PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, reduce_min_omp 42 MODULE PROCEDURE reduce_min_omp_i, reduce_min_omp_i1, reduce_min_omp_i2, reduce_min_omp_i3, reduce_min_omp_i4, & 43 reduce_min_omp_r, reduce_min_omp_r1, reduce_min_omp_r2, reduce_min_omp_r3, reduce_min_omp_r4 44 END INTERFACE 45 46 PUBLIC bcast_omp, scatter_omp, gather_omp, reduce_sum_omp, reduce_min_omp 56 47 57 48 CONTAINS 58 49 59 50 SUBROUTINE check_buffer_i(buff_size) 60 IMPLICIT NONE61 INTEGER :: buff_size62 63 !$OMP BARRIER64 !$OMP MASTER51 IMPLICIT NONE 52 INTEGER :: buff_size 53 54 !$OMP BARRIER 55 !$OMP MASTER 65 56 IF (buff_size>size_i) THEN 66 57 IF (ALLOCATED(buffer_i)) DEALLOCATE(buffer_i) 67 size_i =MAX(size_min,INT(grow_factor*buff_size))58 size_i = MAX(size_min, INT(grow_factor * buff_size)) 68 59 ALLOCATE(buffer_i(size_i)) 69 60 ENDIF 70 !$OMP END MASTER71 !$OMP BARRIER72 61 !$OMP END MASTER 62 !$OMP BARRIER 63 73 64 END SUBROUTINE check_buffer_i 74 65 75 66 SUBROUTINE check_buffer_r(buff_size) 76 IMPLICIT NONE77 INTEGER :: buff_size78 79 !$OMP BARRIER80 !$OMP MASTER67 IMPLICIT NONE 68 INTEGER :: buff_size 69 70 !$OMP BARRIER 71 !$OMP MASTER 81 72 IF (buff_size>size_r) THEN 82 73 IF (ALLOCATED(buffer_r)) DEALLOCATE(buffer_r) 83 size_r =MAX(size_min,INT(grow_factor*buff_size))74 size_r = MAX(size_min, INT(grow_factor * buff_size)) 84 75 ALLOCATE(buffer_r(size_r)) 85 76 ENDIF 86 !$OMP END MASTER87 !$OMP BARRIER88 77 !$OMP END MASTER 78 !$OMP BARRIER 79 89 80 END SUBROUTINE check_buffer_r 90 81 91 82 SUBROUTINE check_buffer_l(buff_size) 92 IMPLICIT NONE93 INTEGER :: buff_size94 95 !$OMP BARRIER96 !$OMP MASTER83 IMPLICIT NONE 84 INTEGER :: buff_size 85 86 !$OMP BARRIER 87 !$OMP MASTER 97 88 IF (buff_size>size_l) THEN 98 89 IF (ALLOCATED(buffer_l)) DEALLOCATE(buffer_l) 99 size_l =MAX(size_min,INT(grow_factor*buff_size))90 size_l = MAX(size_min, INT(grow_factor * buff_size)) 100 91 ALLOCATE(buffer_l(size_l)) 101 92 ENDIF 102 !$OMP END MASTER103 !$OMP BARRIER104 93 !$OMP END MASTER 94 !$OMP BARRIER 95 105 96 END SUBROUTINE check_buffer_l 106 107 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!108 !! Definition des Broadcast --> 4D !!109 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!110 111 !! -- Les chaine de charactère -- !!97 98 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 99 !! Definition des Broadcast --> 4D !! 100 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 101 102 !! -- Les chaine de charactère -- !! 112 103 113 104 SUBROUTINE bcast_omp_c(var) 114 IMPLICIT NONE115 CHARACTER(LEN =*),INTENT(INOUT) :: Var116 117 CALL bcast_omp_cgen(Var, len(Var),buffer_c)118 105 IMPLICIT NONE 106 CHARACTER(LEN = *), INTENT(INOUT) :: Var 107 108 CALL bcast_omp_cgen(Var, len(Var), buffer_c) 109 119 110 END SUBROUTINE bcast_omp_c 120 111 121 !! -- Les entiers -- !!122 112 !! -- Les entiers -- !! 113 123 114 SUBROUTINE bcast_omp_i(var) 124 IMPLICIT NONE125 INTEGER, INTENT(INOUT) :: Var115 IMPLICIT NONE 116 INTEGER, INTENT(INOUT) :: Var 126 117 INTEGER :: Var_tmp(1) 127 128 Var_tmp(1) =Var118 119 Var_tmp(1) = Var 129 120 CALL check_buffer_i(1) 130 CALL bcast_omp_igen(Var_tmp, 1,buffer_i)131 Var =Var_tmp(1)121 CALL bcast_omp_igen(Var_tmp, 1, buffer_i) 122 Var = Var_tmp(1) 132 123 133 124 END SUBROUTINE bcast_omp_i … … 135 126 136 127 SUBROUTINE bcast_omp_i1(var) 137 IMPLICIT NONE138 INTEGER, INTENT(INOUT) :: Var(:)139 128 IMPLICIT NONE 129 INTEGER, INTENT(INOUT) :: Var(:) 130 140 131 CALL check_buffer_i(size(Var)) 141 CALL bcast_omp_igen(Var, size(Var),buffer_i)132 CALL bcast_omp_igen(Var, size(Var), buffer_i) 142 133 143 134 END SUBROUTINE bcast_omp_i1 … … 145 136 146 137 SUBROUTINE bcast_omp_i2(var) 147 IMPLICIT NONE148 INTEGER, INTENT(INOUT) :: Var(:,:)149 138 IMPLICIT NONE 139 INTEGER, INTENT(INOUT) :: Var(:, :) 140 150 141 CALL check_buffer_i(size(Var)) 151 CALL bcast_omp_igen(Var, size(Var),buffer_i)142 CALL bcast_omp_igen(Var, size(Var), buffer_i) 152 143 153 144 END SUBROUTINE bcast_omp_i2 … … 155 146 156 147 SUBROUTINE bcast_omp_i3(var) 157 IMPLICIT NONE158 INTEGER, INTENT(INOUT) :: Var(:,:,:)148 IMPLICIT NONE 149 INTEGER, INTENT(INOUT) :: Var(:, :, :) 159 150 160 151 CALL check_buffer_i(size(Var)) 161 CALL bcast_omp_igen(Var, size(Var),buffer_i)152 CALL bcast_omp_igen(Var, size(Var), buffer_i) 162 153 163 154 END SUBROUTINE bcast_omp_i3 … … 165 156 166 157 SUBROUTINE bcast_omp_i4(var) 167 IMPLICIT NONE168 INTEGER, INTENT(INOUT) :: Var(:,:,:,:)169 158 IMPLICIT NONE 159 INTEGER, INTENT(INOUT) :: Var(:, :, :, :) 160 170 161 CALL check_buffer_i(size(Var)) 171 CALL bcast_omp_igen(Var, size(Var),buffer_i)162 CALL bcast_omp_igen(Var, size(Var), buffer_i) 172 163 173 164 END SUBROUTINE bcast_omp_i4 174 165 175 166 176 !! -- Les reels -- !!167 !! -- Les reels -- !! 177 168 178 169 SUBROUTINE bcast_omp_r(var) 179 IMPLICIT NONE180 REAL, INTENT(INOUT) :: Var170 IMPLICIT NONE 171 REAL, INTENT(INOUT) :: Var 181 172 REAL :: Var_tmp(1) 182 183 Var_tmp(1) =Var173 174 Var_tmp(1) = Var 184 175 CALL check_buffer_r(1) 185 CALL bcast_omp_rgen(Var_tmp, 1,buffer_r)186 Var =Var_tmp(1)176 CALL bcast_omp_rgen(Var_tmp, 1, buffer_r) 177 Var = Var_tmp(1) 187 178 188 179 END SUBROUTINE bcast_omp_r … … 190 181 191 182 SUBROUTINE bcast_omp_r1(var) 192 IMPLICIT NONE193 REAL, INTENT(INOUT) :: Var(:)194 183 IMPLICIT NONE 184 REAL, INTENT(INOUT) :: Var(:) 185 195 186 CALL check_buffer_r(size(Var)) 196 CALL bcast_omp_rgen(Var, size(Var),buffer_r)187 CALL bcast_omp_rgen(Var, size(Var), buffer_r) 197 188 198 189 END SUBROUTINE bcast_omp_r1 … … 200 191 201 192 SUBROUTINE bcast_omp_r2(var) 202 IMPLICIT NONE203 REAL, INTENT(INOUT) :: Var(:,:)204 193 IMPLICIT NONE 194 REAL, INTENT(INOUT) :: Var(:, :) 195 205 196 CALL check_buffer_r(size(Var)) 206 CALL bcast_omp_rgen(Var, size(Var),buffer_r)197 CALL bcast_omp_rgen(Var, size(Var), buffer_r) 207 198 208 199 END SUBROUTINE bcast_omp_r2 … … 210 201 211 202 SUBROUTINE bcast_omp_r3(var) 212 IMPLICIT NONE213 REAL, INTENT(INOUT) :: Var(:,:,:)203 IMPLICIT NONE 204 REAL, INTENT(INOUT) :: Var(:, :, :) 214 205 215 206 CALL check_buffer_r(size(Var)) 216 CALL bcast_omp_rgen(Var, size(Var),buffer_r)207 CALL bcast_omp_rgen(Var, size(Var), buffer_r) 217 208 218 209 END SUBROUTINE bcast_omp_r3 … … 220 211 221 212 SUBROUTINE bcast_omp_r4(var) 222 IMPLICIT NONE223 REAL, INTENT(INOUT) :: Var(:,:,:,:)224 213 IMPLICIT NONE 214 REAL, INTENT(INOUT) :: Var(:, :, :, :) 215 225 216 CALL check_buffer_r(size(Var)) 226 CALL bcast_omp_rgen(Var, size(Var),buffer_r)217 CALL bcast_omp_rgen(Var, size(Var), buffer_r) 227 218 228 219 END SUBROUTINE bcast_omp_r4 229 220 230 231 !! -- Les booleans -- !!221 222 !! -- Les booleans -- !! 232 223 233 224 SUBROUTINE bcast_omp_l(var) 234 IMPLICIT NONE235 LOGICAL, INTENT(INOUT) :: Var225 IMPLICIT NONE 226 LOGICAL, INTENT(INOUT) :: Var 236 227 LOGICAL :: Var_tmp(1) 237 238 Var_tmp(1) =Var228 229 Var_tmp(1) = Var 239 230 CALL check_buffer_l(1) 240 CALL bcast_omp_lgen(Var_tmp, 1,buffer_l)241 Var =Var_tmp(1)231 CALL bcast_omp_lgen(Var_tmp, 1, buffer_l) 232 Var = Var_tmp(1) 242 233 243 234 END SUBROUTINE bcast_omp_l … … 245 236 246 237 SUBROUTINE bcast_omp_l1(var) 247 IMPLICIT NONE248 LOGICAL, INTENT(INOUT) :: Var(:)249 238 IMPLICIT NONE 239 LOGICAL, INTENT(INOUT) :: Var(:) 240 250 241 CALL check_buffer_l(size(Var)) 251 CALL bcast_omp_lgen(Var, size(Var),buffer_l)242 CALL bcast_omp_lgen(Var, size(Var), buffer_l) 252 243 253 244 END SUBROUTINE bcast_omp_l1 … … 255 246 256 247 SUBROUTINE bcast_omp_l2(var) 257 IMPLICIT NONE258 LOGICAL, INTENT(INOUT) :: Var(:,:)259 248 IMPLICIT NONE 249 LOGICAL, INTENT(INOUT) :: Var(:, :) 250 260 251 CALL check_buffer_l(size(Var)) 261 CALL bcast_omp_lgen(Var, size(Var),buffer_l)252 CALL bcast_omp_lgen(Var, size(Var), buffer_l) 262 253 263 254 END SUBROUTINE bcast_omp_l2 … … 265 256 266 257 SUBROUTINE bcast_omp_l3(var) 267 IMPLICIT NONE268 LOGICAL, INTENT(INOUT) :: Var(:,:,:)258 IMPLICIT NONE 259 LOGICAL, INTENT(INOUT) :: Var(:, :, :) 269 260 270 261 CALL check_buffer_l(size(Var)) 271 CALL bcast_omp_lgen(Var, size(Var),buffer_l)262 CALL bcast_omp_lgen(Var, size(Var), buffer_l) 272 263 273 264 END SUBROUTINE bcast_omp_l3 … … 275 266 276 267 SUBROUTINE bcast_omp_l4(var) 277 IMPLICIT NONE278 LOGICAL, INTENT(INOUT) :: Var(:,:,:,:)279 268 IMPLICIT NONE 269 LOGICAL, INTENT(INOUT) :: Var(:, :, :, :) 270 280 271 CALL check_buffer_l(size(Var)) 281 CALL bcast_omp_lgen(Var, size(Var),buffer_l)272 CALL bcast_omp_lgen(Var, size(Var), buffer_l) 282 273 283 274 END SUBROUTINE bcast_omp_l4 284 275 285 276 286 287 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 288 !! Definition des Scatter --> 4D !! 289 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 277 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 278 !! Definition des Scatter --> 4D !! 279 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 290 280 291 281 SUBROUTINE scatter_omp_i(VarIn, VarOut) 292 282 IMPLICIT NONE 293 294 INTEGER, INTENT(IN),DIMENSION(:) :: VarIn295 INTEGER, INTENT(OUT),DIMENSION(:) :: VarOut296 297 CALL Check_buffer_i(size(VarIn)) 298 CALL scatter_omp_igen(VarIn, Varout,1,buffer_i)299 283 284 INTEGER, INTENT(IN), DIMENSION(:) :: VarIn 285 INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut 286 287 CALL Check_buffer_i(size(VarIn)) 288 CALL scatter_omp_igen(VarIn, Varout, 1, buffer_i) 289 300 290 END SUBROUTINE scatter_omp_i 301 291 … … 303 293 SUBROUTINE scatter_omp_i1(VarIn, VarOut) 304 294 IMPLICIT NONE 305 306 INTEGER, INTENT(IN),DIMENSION(:,:) :: VarIn307 INTEGER, INTENT(OUT),DIMENSION(:,:) :: VarOut308 309 CALL Check_buffer_i(size(VarIn)) 310 CALL scatter_omp_igen(VarIn, Varout,Size(VarOut,2),buffer_i)311 295 296 INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn 297 INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut 298 299 CALL Check_buffer_i(size(VarIn)) 300 CALL scatter_omp_igen(VarIn, Varout, Size(VarOut, 2), buffer_i) 301 312 302 END SUBROUTINE scatter_omp_i1 313 314 303 304 315 305 SUBROUTINE scatter_omp_i2(VarIn, VarOut) 316 306 IMPLICIT NONE 317 318 INTEGER, INTENT(IN),DIMENSION(:,:,:) :: VarIn319 INTEGER, INTENT(OUT),DIMENSION(:,:,:) :: VarOut320 321 CALL Check_buffer_i(size(VarIn)) 322 CALL scatter_omp_igen(VarIn, Varout,Size(VarOut,2)*Size(VarOut,3),buffer_i)307 308 INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn 309 INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 310 311 CALL Check_buffer_i(size(VarIn)) 312 CALL scatter_omp_igen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3), buffer_i) 323 313 324 314 END SUBROUTINE scatter_omp_i2 … … 327 317 SUBROUTINE scatter_omp_i3(VarIn, VarOut) 328 318 IMPLICIT NONE 329 330 INTEGER, INTENT(IN),DIMENSION(:,:,:,:) :: VarIn331 INTEGER, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut332 333 CALL Check_buffer_i(size(VarIn)) 334 CALL scatter_omp_igen(VarIn, Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4),buffer_i)335 319 320 INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 321 INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 322 323 CALL Check_buffer_i(size(VarIn)) 324 CALL scatter_omp_igen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3) * Size(VarOut, 4), buffer_i) 325 336 326 END SUBROUTINE scatter_omp_i3 337 327 338 328 339 340 341 329 SUBROUTINE scatter_omp_r(VarIn, VarOut) 342 330 IMPLICIT NONE 343 344 REAL, INTENT(IN),DIMENSION(:) :: VarIn345 REAL, INTENT(OUT),DIMENSION(:) :: VarOut346 347 CALL Check_buffer_r(size(VarIn)) 348 CALL scatter_omp_rgen(VarIn, Varout,1,buffer_r)349 331 332 REAL, INTENT(IN), DIMENSION(:) :: VarIn 333 REAL, INTENT(OUT), DIMENSION(:) :: VarOut 334 335 CALL Check_buffer_r(size(VarIn)) 336 CALL scatter_omp_rgen(VarIn, Varout, 1, buffer_r) 337 350 338 END SUBROUTINE scatter_omp_r 351 339 … … 353 341 SUBROUTINE scatter_omp_r1(VarIn, VarOut) 354 342 IMPLICIT NONE 355 356 REAL, INTENT(IN),DIMENSION(:,:) :: VarIn357 REAL, INTENT(OUT),DIMENSION(:,:) :: VarOut358 359 CALL Check_buffer_r(size(VarIn)) 360 CALL scatter_omp_rgen(VarIn, Varout,Size(VarOut,2),buffer_r)361 343 344 REAL, INTENT(IN), DIMENSION(:, :) :: VarIn 345 REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut 346 347 CALL Check_buffer_r(size(VarIn)) 348 CALL scatter_omp_rgen(VarIn, Varout, Size(VarOut, 2), buffer_r) 349 362 350 END SUBROUTINE scatter_omp_r1 363 364 351 352 365 353 SUBROUTINE scatter_omp_r2(VarIn, VarOut) 366 354 IMPLICIT NONE 367 368 REAL, INTENT(IN),DIMENSION(:,:,:) :: VarIn369 REAL, INTENT(OUT),DIMENSION(:,:,:) :: VarOut370 371 CALL Check_buffer_r(size(VarIn)) 372 CALL scatter_omp_rgen(VarIn, Varout,Size(VarOut,2)*Size(VarOut,3),buffer_r)355 356 REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn 357 REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 358 359 CALL Check_buffer_r(size(VarIn)) 360 CALL scatter_omp_rgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3), buffer_r) 373 361 374 362 END SUBROUTINE scatter_omp_r2 … … 377 365 SUBROUTINE scatter_omp_r3(VarIn, VarOut) 378 366 IMPLICIT NONE 379 380 REAL, INTENT(IN),DIMENSION(:,:,:,:) :: VarIn381 REAL, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut382 383 CALL Check_buffer_r(size(VarIn)) 384 CALL scatter_omp_rgen(VarIn, Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4),buffer_r)385 367 368 REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 369 REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 370 371 CALL Check_buffer_r(size(VarIn)) 372 CALL scatter_omp_rgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3) * Size(VarOut, 4), buffer_r) 373 386 374 END SUBROUTINE scatter_omp_r3 387 388 375 389 376 390 377 SUBROUTINE scatter_omp_l(VarIn, VarOut) 391 378 IMPLICIT NONE 392 393 LOGICAL, INTENT(IN),DIMENSION(:) :: VarIn394 LOGICAL, INTENT(OUT),DIMENSION(:) :: VarOut395 396 CALL Check_buffer_l(size(VarIn)) 397 CALL scatter_omp_lgen(VarIn, Varout,1,buffer_l)398 379 380 LOGICAL, INTENT(IN), DIMENSION(:) :: VarIn 381 LOGICAL, INTENT(OUT), DIMENSION(:) :: VarOut 382 383 CALL Check_buffer_l(size(VarIn)) 384 CALL scatter_omp_lgen(VarIn, Varout, 1, buffer_l) 385 399 386 END SUBROUTINE scatter_omp_l 400 387 … … 402 389 SUBROUTINE scatter_omp_l1(VarIn, VarOut) 403 390 IMPLICIT NONE 404 405 LOGICAL, INTENT(IN),DIMENSION(:,:) :: VarIn406 LOGICAL, INTENT(OUT),DIMENSION(:,:) :: VarOut407 408 CALL Check_buffer_l(size(VarIn)) 409 CALL scatter_omp_lgen(VarIn, Varout,Size(VarOut,2),buffer_l)410 391 392 LOGICAL, INTENT(IN), DIMENSION(:, :) :: VarIn 393 LOGICAL, INTENT(OUT), DIMENSION(:, :) :: VarOut 394 395 CALL Check_buffer_l(size(VarIn)) 396 CALL scatter_omp_lgen(VarIn, Varout, Size(VarOut, 2), buffer_l) 397 411 398 END SUBROUTINE scatter_omp_l1 412 413 399 400 414 401 SUBROUTINE scatter_omp_l2(VarIn, VarOut) 415 402 IMPLICIT NONE 416 417 LOGICAL, INTENT(IN),DIMENSION(:,:,:) :: VarIn418 LOGICAL, INTENT(OUT),DIMENSION(:,:,:) :: VarOut419 420 CALL Check_buffer_l(size(VarIn)) 421 CALL scatter_omp_lgen(VarIn, Varout,Size(VarOut,2)*Size(VarOut,3),buffer_l)403 404 LOGICAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn 405 LOGICAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 406 407 CALL Check_buffer_l(size(VarIn)) 408 CALL scatter_omp_lgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3), buffer_l) 422 409 423 410 END SUBROUTINE scatter_omp_l2 … … 426 413 SUBROUTINE scatter_omp_l3(VarIn, VarOut) 427 414 IMPLICIT NONE 428 429 LOGICAL, INTENT(IN),DIMENSION(:,:,:,:) :: VarIn430 LOGICAL, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut431 432 CALL Check_buffer_l(size(VarIn)) 433 CALL scatter_omp_lgen(VarIn, Varout,Size(VarOut,2)*Size(VarOut,3)*Size(VarOut,4),buffer_l)434 435 END SUBROUTINE scatter_omp_l3 436 415 416 LOGICAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 417 LOGICAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 418 419 CALL Check_buffer_l(size(VarIn)) 420 CALL scatter_omp_lgen(VarIn, Varout, Size(VarOut, 2) * Size(VarOut, 3) * Size(VarOut, 4), buffer_l) 421 422 END SUBROUTINE scatter_omp_l3 423 437 424 438 425 SUBROUTINE gather_omp_i(VarIn, VarOut) 439 426 IMPLICIT NONE 440 441 INTEGER, INTENT(IN),DIMENSION(:) :: VarIn442 INTEGER, INTENT(OUT),DIMENSION(:) :: VarOut443 444 CALL Check_buffer_i(size(VarOut)) 445 CALL gather_omp_igen(VarIn, Varout,1,buffer_i)446 427 428 INTEGER, INTENT(IN), DIMENSION(:) :: VarIn 429 INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut 430 431 CALL Check_buffer_i(size(VarOut)) 432 CALL gather_omp_igen(VarIn, Varout, 1, buffer_i) 433 447 434 END SUBROUTINE gather_omp_i 448 435 … … 450 437 SUBROUTINE gather_omp_i1(VarIn, VarOut) 451 438 IMPLICIT NONE 452 453 INTEGER, INTENT(IN),DIMENSION(:,:) :: VarIn454 INTEGER, INTENT(OUT),DIMENSION(:,:) :: VarOut455 456 CALL Check_buffer_i(size(VarOut)) 457 CALL gather_omp_igen(VarIn, Varout,Size(VarIn,2),buffer_i)458 439 440 INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn 441 INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut 442 443 CALL Check_buffer_i(size(VarOut)) 444 CALL gather_omp_igen(VarIn, Varout, Size(VarIn, 2), buffer_i) 445 459 446 END SUBROUTINE gather_omp_i1 460 447 … … 462 449 SUBROUTINE gather_omp_i2(VarIn, VarOut) 463 450 IMPLICIT NONE 464 465 INTEGER, INTENT(IN),DIMENSION(:,:,:) :: VarIn466 INTEGER, INTENT(OUT),DIMENSION(:,:,:) :: VarOut467 468 CALL Check_buffer_i(size(VarOut)) 469 CALL gather_omp_igen(VarIn, Varout,Size(VarIn,2)*Size(VarIn,3),buffer_i)470 451 452 INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn 453 INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 454 455 CALL Check_buffer_i(size(VarOut)) 456 CALL gather_omp_igen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3), buffer_i) 457 471 458 END SUBROUTINE gather_omp_i2 472 459 473 460 474 461 SUBROUTINE gather_omp_i3(VarIn, VarOut) 475 462 IMPLICIT NONE 476 477 INTEGER, INTENT(IN),DIMENSION(:,:,:,:) :: VarIn478 INTEGER, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut479 480 CALL Check_buffer_i(size(VarOut)) 481 CALL gather_omp_igen(VarIn, Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4),buffer_i)482 463 464 INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 465 INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 466 467 CALL Check_buffer_i(size(VarOut)) 468 CALL gather_omp_igen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3) * Size(VarIn, 4), buffer_i) 469 483 470 END SUBROUTINE gather_omp_i3 484 471 485 472 486 487 473 SUBROUTINE gather_omp_r(VarIn, VarOut) 488 474 IMPLICIT NONE 489 490 REAL, INTENT(IN),DIMENSION(:) :: VarIn491 REAL, INTENT(OUT),DIMENSION(:) :: VarOut492 493 CALL gather_omp_rgen(VarIn, Varout,1)494 475 476 REAL, INTENT(IN), DIMENSION(:) :: VarIn 477 REAL, INTENT(OUT), DIMENSION(:) :: VarOut 478 479 CALL gather_omp_rgen(VarIn, Varout, 1) 480 495 481 END SUBROUTINE gather_omp_r 496 482 … … 498 484 SUBROUTINE gather_omp_r1(VarIn, VarOut) 499 485 IMPLICIT NONE 500 501 REAL, INTENT(IN),DIMENSION(:,:) :: VarIn502 REAL, INTENT(OUT),DIMENSION(:,:) :: VarOut503 504 CALL gather_omp_rgen(VarIn, Varout,Size(VarIn,2))505 486 487 REAL, INTENT(IN), DIMENSION(:, :) :: VarIn 488 REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut 489 490 CALL gather_omp_rgen(VarIn, Varout, Size(VarIn, 2)) 491 506 492 END SUBROUTINE gather_omp_r1 507 493 … … 509 495 SUBROUTINE gather_omp_r2(VarIn, VarOut) 510 496 IMPLICIT NONE 511 512 REAL, INTENT(IN),DIMENSION(:,:,:) :: VarIn513 REAL, INTENT(OUT),DIMENSION(:,:,:) :: VarOut514 515 CALL gather_omp_rgen(VarIn, Varout,Size(VarIn,2)*Size(VarIn,3))516 497 498 REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn 499 REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 500 501 CALL gather_omp_rgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3)) 502 517 503 END SUBROUTINE gather_omp_r2 518 504 519 505 520 506 SUBROUTINE gather_omp_r3(VarIn, VarOut) 521 507 IMPLICIT NONE 522 523 REAL, INTENT(IN),DIMENSION(:,:,:,:) :: VarIn524 REAL, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut525 526 CALL gather_omp_rgen(VarIn, Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4))527 508 509 REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 510 REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 511 512 CALL gather_omp_rgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3) * Size(VarIn, 4)) 513 528 514 END SUBROUTINE gather_omp_r3 529 515 … … 531 517 SUBROUTINE gather_omp_l(VarIn, VarOut) 532 518 IMPLICIT NONE 533 534 LOGICAL, INTENT(IN),DIMENSION(:) :: VarIn535 LOGICAL, INTENT(OUT),DIMENSION(:) :: VarOut536 537 CALL Check_buffer_l(size(VarOut)) 538 CALL gather_omp_lgen(VarIn, Varout,1,buffer_l)539 519 520 LOGICAL, INTENT(IN), DIMENSION(:) :: VarIn 521 LOGICAL, INTENT(OUT), DIMENSION(:) :: VarOut 522 523 CALL Check_buffer_l(size(VarOut)) 524 CALL gather_omp_lgen(VarIn, Varout, 1, buffer_l) 525 540 526 END SUBROUTINE gather_omp_l 541 527 … … 543 529 SUBROUTINE gather_omp_l1(VarIn, VarOut) 544 530 IMPLICIT NONE 545 546 LOGICAL, INTENT(IN),DIMENSION(:,:) :: VarIn547 LOGICAL, INTENT(OUT),DIMENSION(:,:) :: VarOut548 549 CALL Check_buffer_l(size(VarOut)) 550 CALL gather_omp_lgen(VarIn, Varout,Size(VarIn,2),buffer_l)551 531 532 LOGICAL, INTENT(IN), DIMENSION(:, :) :: VarIn 533 LOGICAL, INTENT(OUT), DIMENSION(:, :) :: VarOut 534 535 CALL Check_buffer_l(size(VarOut)) 536 CALL gather_omp_lgen(VarIn, Varout, Size(VarIn, 2), buffer_l) 537 552 538 END SUBROUTINE gather_omp_l1 553 539 … … 555 541 SUBROUTINE gather_omp_l2(VarIn, VarOut) 556 542 IMPLICIT NONE 557 558 LOGICAL, INTENT(IN),DIMENSION(:,:,:) :: VarIn559 LOGICAL, INTENT(OUT),DIMENSION(:,:,:) :: VarOut560 561 CALL Check_buffer_l(size(VarOut)) 562 CALL gather_omp_lgen(VarIn, Varout,Size(VarIn,2)*Size(VarIn,3),buffer_l)563 543 544 LOGICAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn 545 LOGICAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 546 547 CALL Check_buffer_l(size(VarOut)) 548 CALL gather_omp_lgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3), buffer_l) 549 564 550 END SUBROUTINE gather_omp_l2 565 551 566 552 567 553 SUBROUTINE gather_omp_l3(VarIn, VarOut) 568 554 IMPLICIT NONE 569 570 LOGICAL, INTENT(IN),DIMENSION(:,:,:,:) :: VarIn571 LOGICAL, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut572 573 CALL Check_buffer_l(size(VarOut)) 574 CALL gather_omp_lgen(VarIn, Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4),buffer_l)575 555 556 LOGICAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 557 LOGICAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 558 559 CALL Check_buffer_l(size(VarOut)) 560 CALL gather_omp_lgen(VarIn, Varout, Size(VarIn, 2) * Size(VarIn, 3) * Size(VarIn, 4), buffer_l) 561 576 562 END SUBROUTINE gather_omp_l3 577 563 578 564 579 580 581 565 SUBROUTINE reduce_sum_omp_i(VarIn, VarOut) 582 566 IMPLICIT NONE 583 584 INTEGER, INTENT(IN):: VarIn585 INTEGER, INTENT(OUT) :: VarOut586 INTEGER 587 INTEGER 588 589 VarIn_tmp(1) =VarIn590 CALL Check_buffer_i(1) 591 CALL reduce_sum_omp_igen(VarIn_tmp, Varout_tmp,1,buffer_i)592 VarOut =VarOut_tmp(1)593 567 568 INTEGER, INTENT(IN) :: VarIn 569 INTEGER, INTENT(OUT) :: VarOut 570 INTEGER :: VarIn_tmp(1) 571 INTEGER :: VarOut_tmp(1) 572 573 VarIn_tmp(1) = VarIn 574 CALL Check_buffer_i(1) 575 CALL reduce_sum_omp_igen(VarIn_tmp, Varout_tmp, 1, buffer_i) 576 VarOut = VarOut_tmp(1) 577 594 578 END SUBROUTINE reduce_sum_omp_i 595 579 596 580 SUBROUTINE reduce_sum_omp_i1(VarIn, VarOut) 597 581 IMPLICIT NONE 598 599 INTEGER, INTENT(IN),DIMENSION(:):: VarIn600 INTEGER, INTENT(OUT),DIMENSION(:) :: VarOut601 602 CALL Check_buffer_i(size(VarIn)) 603 CALL reduce_sum_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)604 582 583 INTEGER, INTENT(IN), DIMENSION(:) :: VarIn 584 INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut 585 586 CALL Check_buffer_i(size(VarIn)) 587 CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 588 605 589 END SUBROUTINE reduce_sum_omp_i1 606 607 590 591 608 592 SUBROUTINE reduce_sum_omp_i2(VarIn, VarOut) 609 593 IMPLICIT NONE 610 611 INTEGER, INTENT(IN),DIMENSION(:,:):: VarIn612 INTEGER, INTENT(OUT),DIMENSION(:,:) :: VarOut613 614 CALL Check_buffer_i(size(VarIn)) 615 CALL reduce_sum_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)616 594 595 INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn 596 INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut 597 598 CALL Check_buffer_i(size(VarIn)) 599 CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 600 617 601 END SUBROUTINE reduce_sum_omp_i2 618 602 … … 620 604 SUBROUTINE reduce_sum_omp_i3(VarIn, VarOut) 621 605 IMPLICIT NONE 622 623 INTEGER, INTENT(IN),DIMENSION(:,:,:):: VarIn624 INTEGER, INTENT(OUT),DIMENSION(:,:,:) :: VarOut625 626 CALL Check_buffer_i(size(VarIn)) 627 CALL reduce_sum_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)628 606 607 INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn 608 INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 609 610 CALL Check_buffer_i(size(VarIn)) 611 CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 612 629 613 END SUBROUTINE reduce_sum_omp_i3 630 614 … … 633 617 IMPLICIT NONE 634 618 635 INTEGER, INTENT(IN),DIMENSION(:,:,:,:):: VarIn636 INTEGER, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut637 638 CALL Check_buffer_i(size(VarIn)) 639 CALL reduce_sum_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)640 619 INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 620 INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 621 622 CALL Check_buffer_i(size(VarIn)) 623 CALL reduce_sum_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 624 641 625 END SUBROUTINE reduce_sum_omp_i4 642 626 … … 644 628 SUBROUTINE reduce_sum_omp_r(VarIn, VarOut) 645 629 IMPLICIT NONE 646 647 REAL, INTENT(IN):: VarIn648 REAL, INTENT(OUT) :: VarOut649 REAL 650 REAL 651 652 VarIn_tmp(1) =VarIn653 CALL Check_buffer_r(1) 654 CALL reduce_sum_omp_rgen(VarIn_tmp, Varout_tmp,1,buffer_r)655 VarOut =VarOut_tmp(1)656 630 631 REAL, INTENT(IN) :: VarIn 632 REAL, INTENT(OUT) :: VarOut 633 REAL :: VarIn_tmp(1) 634 REAL :: VarOut_tmp(1) 635 636 VarIn_tmp(1) = VarIn 637 CALL Check_buffer_r(1) 638 CALL reduce_sum_omp_rgen(VarIn_tmp, Varout_tmp, 1, buffer_r) 639 VarOut = VarOut_tmp(1) 640 657 641 END SUBROUTINE reduce_sum_omp_r 658 642 659 643 SUBROUTINE reduce_sum_omp_r1(VarIn, VarOut) 660 644 IMPLICIT NONE 661 662 REAL, INTENT(IN),DIMENSION(:):: VarIn663 REAL, INTENT(OUT),DIMENSION(:) :: VarOut664 665 CALL Check_buffer_r(size(VarIn)) 666 CALL reduce_sum_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)667 645 646 REAL, INTENT(IN), DIMENSION(:) :: VarIn 647 REAL, INTENT(OUT), DIMENSION(:) :: VarOut 648 649 CALL Check_buffer_r(size(VarIn)) 650 CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 651 668 652 END SUBROUTINE reduce_sum_omp_r1 669 670 653 654 671 655 SUBROUTINE reduce_sum_omp_r2(VarIn, VarOut) 672 656 IMPLICIT NONE 673 674 REAL, INTENT(IN),DIMENSION(:,:):: VarIn675 REAL, INTENT(OUT),DIMENSION(:,:) :: VarOut676 677 CALL Check_buffer_r(size(VarIn)) 678 CALL reduce_sum_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)679 657 658 REAL, INTENT(IN), DIMENSION(:, :) :: VarIn 659 REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut 660 661 CALL Check_buffer_r(size(VarIn)) 662 CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 663 680 664 END SUBROUTINE reduce_sum_omp_r2 681 665 … … 683 667 SUBROUTINE reduce_sum_omp_r3(VarIn, VarOut) 684 668 IMPLICIT NONE 685 686 REAL, INTENT(IN),DIMENSION(:,:,:):: VarIn687 REAL, INTENT(OUT),DIMENSION(:,:,:) :: VarOut688 689 CALL Check_buffer_r(size(VarIn)) 690 CALL reduce_sum_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)691 669 670 REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn 671 REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 672 673 CALL Check_buffer_r(size(VarIn)) 674 CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 675 692 676 END SUBROUTINE reduce_sum_omp_r3 693 677 … … 696 680 IMPLICIT NONE 697 681 698 REAL, INTENT(IN),DIMENSION(:,:,:,:):: VarIn699 REAL, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut700 701 CALL Check_buffer_r(size(VarIn)) 702 CALL reduce_sum_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)703 682 REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 683 REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 684 685 CALL Check_buffer_r(size(VarIn)) 686 CALL reduce_sum_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 687 704 688 END SUBROUTINE reduce_sum_omp_r4 705 689 706 690 707 708 691 SUBROUTINE reduce_min_omp_i(VarIn, VarOut) 709 692 IMPLICIT NONE 710 711 INTEGER, INTENT(IN):: VarIn712 INTEGER, INTENT(OUT) :: VarOut713 INTEGER 714 INTEGER 715 716 VarIn_tmp(1) =VarIn717 CALL Check_buffer_i(1) 718 CALL reduce_min_omp_igen(VarIn_tmp, Varout_tmp,1,buffer_i)719 VarOut =VarOut_tmp(1)720 693 694 INTEGER, INTENT(IN) :: VarIn 695 INTEGER, INTENT(OUT) :: VarOut 696 INTEGER :: VarIn_tmp(1) 697 INTEGER :: VarOut_tmp(1) 698 699 VarIn_tmp(1) = VarIn 700 CALL Check_buffer_i(1) 701 CALL reduce_min_omp_igen(VarIn_tmp, Varout_tmp, 1, buffer_i) 702 VarOut = VarOut_tmp(1) 703 721 704 END SUBROUTINE reduce_min_omp_i 722 705 723 706 SUBROUTINE reduce_min_omp_i1(VarIn, VarOut) 724 707 IMPLICIT NONE 725 726 INTEGER, INTENT(IN),DIMENSION(:):: VarIn727 INTEGER, INTENT(OUT),DIMENSION(:) :: VarOut728 729 CALL Check_buffer_i(size(VarIn)) 730 CALL reduce_min_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)731 708 709 INTEGER, INTENT(IN), DIMENSION(:) :: VarIn 710 INTEGER, INTENT(OUT), DIMENSION(:) :: VarOut 711 712 CALL Check_buffer_i(size(VarIn)) 713 CALL reduce_min_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 714 732 715 END SUBROUTINE reduce_min_omp_i1 733 734 716 717 735 718 SUBROUTINE reduce_min_omp_i2(VarIn, VarOut) 736 719 IMPLICIT NONE 737 738 INTEGER, INTENT(IN),DIMENSION(:,:):: VarIn739 INTEGER, INTENT(OUT),DIMENSION(:,:) :: VarOut740 741 CALL Check_buffer_i(size(VarIn)) 742 CALL reduce_min_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)743 720 721 INTEGER, INTENT(IN), DIMENSION(:, :) :: VarIn 722 INTEGER, INTENT(OUT), DIMENSION(:, :) :: VarOut 723 724 CALL Check_buffer_i(size(VarIn)) 725 CALL reduce_min_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 726 744 727 END SUBROUTINE reduce_min_omp_i2 745 728 … … 747 730 SUBROUTINE reduce_min_omp_i3(VarIn, VarOut) 748 731 IMPLICIT NONE 749 750 INTEGER, INTENT(IN),DIMENSION(:,:,:):: VarIn751 INTEGER, INTENT(OUT),DIMENSION(:,:,:) :: VarOut752 753 CALL Check_buffer_i(size(VarIn)) 754 CALL reduce_min_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)755 732 733 INTEGER, INTENT(IN), DIMENSION(:, :, :) :: VarIn 734 INTEGER, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 735 736 CALL Check_buffer_i(size(VarIn)) 737 CALL reduce_min_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 738 756 739 END SUBROUTINE reduce_min_omp_i3 757 740 … … 760 743 IMPLICIT NONE 761 744 762 INTEGER, INTENT(IN),DIMENSION(:,:,:,:):: VarIn763 INTEGER, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut764 765 CALL Check_buffer_i(size(VarIn)) 766 CALL reduce_min_omp_igen(VarIn, Varout,Size(VarIn),buffer_i)767 745 INTEGER, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 746 INTEGER, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 747 748 CALL Check_buffer_i(size(VarIn)) 749 CALL reduce_min_omp_igen(VarIn, Varout, Size(VarIn), buffer_i) 750 768 751 END SUBROUTINE reduce_min_omp_i4 769 752 … … 771 754 SUBROUTINE reduce_min_omp_r(VarIn, VarOut) 772 755 IMPLICIT NONE 773 774 REAL, INTENT(IN):: VarIn775 REAL, INTENT(OUT) :: VarOut776 REAL 777 REAL 778 779 VarIn_tmp(1) =VarIn780 CALL Check_buffer_r(1) 781 CALL reduce_min_omp_rgen(VarIn_tmp, Varout_tmp,1,buffer_r)782 VarOut =VarOut_tmp(1)783 756 757 REAL, INTENT(IN) :: VarIn 758 REAL, INTENT(OUT) :: VarOut 759 REAL :: VarIn_tmp(1) 760 REAL :: VarOut_tmp(1) 761 762 VarIn_tmp(1) = VarIn 763 CALL Check_buffer_r(1) 764 CALL reduce_min_omp_rgen(VarIn_tmp, Varout_tmp, 1, buffer_r) 765 VarOut = VarOut_tmp(1) 766 784 767 END SUBROUTINE reduce_min_omp_r 785 768 786 769 SUBROUTINE reduce_min_omp_r1(VarIn, VarOut) 787 770 IMPLICIT NONE 788 789 REAL, INTENT(IN),DIMENSION(:):: VarIn790 REAL, INTENT(OUT),DIMENSION(:) :: VarOut791 792 CALL Check_buffer_r(size(VarIn)) 793 CALL reduce_min_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)794 771 772 REAL, INTENT(IN), DIMENSION(:) :: VarIn 773 REAL, INTENT(OUT), DIMENSION(:) :: VarOut 774 775 CALL Check_buffer_r(size(VarIn)) 776 CALL reduce_min_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 777 795 778 END SUBROUTINE reduce_min_omp_r1 796 797 779 780 798 781 SUBROUTINE reduce_min_omp_r2(VarIn, VarOut) 799 782 IMPLICIT NONE 800 801 REAL, INTENT(IN),DIMENSION(:,:):: VarIn802 REAL, INTENT(OUT),DIMENSION(:,:) :: VarOut803 804 CALL Check_buffer_r(size(VarIn)) 805 CALL reduce_min_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)806 783 784 REAL, INTENT(IN), DIMENSION(:, :) :: VarIn 785 REAL, INTENT(OUT), DIMENSION(:, :) :: VarOut 786 787 CALL Check_buffer_r(size(VarIn)) 788 CALL reduce_min_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 789 807 790 END SUBROUTINE reduce_min_omp_r2 808 791 … … 810 793 SUBROUTINE reduce_min_omp_r3(VarIn, VarOut) 811 794 IMPLICIT NONE 812 813 REAL, INTENT(IN),DIMENSION(:,:,:):: VarIn814 REAL, INTENT(OUT),DIMENSION(:,:,:) :: VarOut815 816 CALL Check_buffer_r(size(VarIn)) 817 CALL reduce_min_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)818 795 796 REAL, INTENT(IN), DIMENSION(:, :, :) :: VarIn 797 REAL, INTENT(OUT), DIMENSION(:, :, :) :: VarOut 798 799 CALL Check_buffer_r(size(VarIn)) 800 CALL reduce_min_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 801 819 802 END SUBROUTINE reduce_min_omp_r3 820 803 … … 823 806 IMPLICIT NONE 824 807 825 REAL, INTENT(IN),DIMENSION(:,:,:,:):: VarIn826 REAL, INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut827 828 CALL Check_buffer_r(size(VarIn)) 829 CALL reduce_min_omp_rgen(VarIn, Varout,Size(VarIn),buffer_r)830 808 REAL, INTENT(IN), DIMENSION(:, :, :, :) :: VarIn 809 REAL, INTENT(OUT), DIMENSION(:, :, :, :) :: VarOut 810 811 CALL Check_buffer_r(size(VarIn)) 812 CALL reduce_min_omp_rgen(VarIn, Varout, Size(VarIn), buffer_r) 813 831 814 END SUBROUTINE reduce_min_omp_r4 832 815 833 816 834 835 836 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 837 ! LES ROUTINES GENERIQUES ! 838 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 839 840 SUBROUTINE bcast_omp_cgen(Var,Nb,Buff) 841 IMPLICIT NONE 842 843 CHARACTER(LEN=*),INTENT(INOUT) :: Var 844 CHARACTER(LEN=*),INTENT(INOUT) :: Buff 845 INTEGER,INTENT(IN) :: Nb 846 817 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 818 ! LES ROUTINES GENERIQUES ! 819 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 820 821 SUBROUTINE bcast_omp_cgen(Var, Nb, Buff) 822 IMPLICIT NONE 823 824 CHARACTER(LEN = *), INTENT(INOUT) :: Var 825 CHARACTER(LEN = *), INTENT(INOUT) :: Buff 826 INTEGER, INTENT(IN) :: Nb 827 847 828 INTEGER :: i 848 849 !$OMP MASTER850 Buff=Var851 !$OMP END MASTER852 !$OMP BARRIER853 854 DO i =1,Nb855 Var =Buff856 ENDDO 857 !$OMP BARRIER858 829 830 !$OMP MASTER 831 Buff = Var 832 !$OMP END MASTER 833 !$OMP BARRIER 834 835 DO i = 1, Nb 836 Var = Buff 837 ENDDO 838 !$OMP BARRIER 839 859 840 END SUBROUTINE bcast_omp_cgen 860 841 861 842 862 863 SUBROUTINE bcast_omp_igen(Var,Nb,Buff) 864 IMPLICIT NONE 865 866 INTEGER,INTENT(IN) :: Nb 867 INTEGER,DIMENSION(Nb),INTENT(INOUT) :: Var 868 INTEGER,DIMENSION(Nb),INTENT(INOUT) :: Buff 843 SUBROUTINE bcast_omp_igen(Var, Nb, Buff) 844 IMPLICIT NONE 845 846 INTEGER, INTENT(IN) :: Nb 847 INTEGER, DIMENSION(Nb), INTENT(INOUT) :: Var 848 INTEGER, DIMENSION(Nb), INTENT(INOUT) :: Buff 869 849 870 850 INTEGER :: i 871 872 !$OMP MASTER873 DO i =1,Nb874 Buff(i) =Var(i)875 ENDDO 876 !$OMP END MASTER877 !$OMP BARRIER878 879 DO i =1,Nb880 Var(i) =Buff(i)881 ENDDO 882 !$OMP BARRIER851 852 !$OMP MASTER 853 DO i = 1, Nb 854 Buff(i) = Var(i) 855 ENDDO 856 !$OMP END MASTER 857 !$OMP BARRIER 858 859 DO i = 1, Nb 860 Var(i) = Buff(i) 861 ENDDO 862 !$OMP BARRIER 883 863 884 864 END SUBROUTINE bcast_omp_igen 885 865 886 866 887 SUBROUTINE bcast_omp_rgen(Var, Nb,Buff)888 IMPLICIT NONE889 890 INTEGER, INTENT(IN) :: Nb891 REAL, DIMENSION(Nb),INTENT(INOUT) :: Var892 REAL, DIMENSION(Nb),INTENT(INOUT) :: Buff867 SUBROUTINE bcast_omp_rgen(Var, Nb, Buff) 868 IMPLICIT NONE 869 870 INTEGER, INTENT(IN) :: Nb 871 REAL, DIMENSION(Nb), INTENT(INOUT) :: Var 872 REAL, DIMENSION(Nb), INTENT(INOUT) :: Buff 893 873 894 874 INTEGER :: i 895 896 !$OMP MASTER897 DO i =1,Nb898 Buff(i) =Var(i)899 ENDDO 900 !$OMP END MASTER901 !$OMP BARRIER902 903 DO i =1,Nb904 Var(i) =Buff(i)905 ENDDO 906 !$OMP BARRIER875 876 !$OMP MASTER 877 DO i = 1, Nb 878 Buff(i) = Var(i) 879 ENDDO 880 !$OMP END MASTER 881 !$OMP BARRIER 882 883 DO i = 1, Nb 884 Var(i) = Buff(i) 885 ENDDO 886 !$OMP BARRIER 907 887 908 888 END SUBROUTINE bcast_omp_rgen 909 889 910 SUBROUTINE bcast_omp_lgen(Var, Nb,Buff)911 IMPLICIT NONE912 913 INTEGER, INTENT(IN) :: Nb914 LOGICAL, DIMENSION(Nb),INTENT(INOUT) :: Var915 LOGICAL, DIMENSION(Nb),INTENT(INOUT) :: Buff916 890 SUBROUTINE bcast_omp_lgen(Var, Nb, Buff) 891 IMPLICIT NONE 892 893 INTEGER, INTENT(IN) :: Nb 894 LOGICAL, DIMENSION(Nb), INTENT(INOUT) :: Var 895 LOGICAL, DIMENSION(Nb), INTENT(INOUT) :: Buff 896 917 897 INTEGER :: i 918 919 !$OMP MASTER920 DO i =1,Nb921 Buff(i) =Var(i)922 ENDDO 923 !$OMP END MASTER924 !$OMP BARRIER925 926 DO i =1,Nb927 Var(i) =Buff(i)928 ENDDO 929 !$OMP BARRIER898 899 !$OMP MASTER 900 DO i = 1, Nb 901 Buff(i) = Var(i) 902 ENDDO 903 !$OMP END MASTER 904 !$OMP BARRIER 905 906 DO i = 1, Nb 907 Var(i) = Buff(i) 908 ENDDO 909 !$OMP BARRIER 930 910 931 911 END SUBROUTINE bcast_omp_lgen 932 912 933 913 934 SUBROUTINE scatter_omp_igen(VarIn, VarOut,dimsize,Buff)914 SUBROUTINE scatter_omp_igen(VarIn, VarOut, dimsize, Buff) 935 915 USE lmdz_phys_omp_data 936 916 USE lmdz_phys_mpi_data, ONLY: klon_mpi 937 917 IMPLICIT NONE 938 918 939 INTEGER, INTENT(IN) :: dimsize940 INTEGER, INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn941 INTEGER, INTENT(OUT),DIMENSION(klon_omp,dimsize) :: VarOut942 INTEGER, INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff943 944 INTEGER :: i, ij945 946 !$OMP MASTER947 DO i =1,dimsize948 DO ij =1,klon_mpi949 Buff(ij, i)=VarIn(ij,i)919 INTEGER, INTENT(IN) :: dimsize 920 INTEGER, INTENT(IN), DIMENSION(klon_mpi, dimsize) :: VarIn 921 INTEGER, INTENT(OUT), DIMENSION(klon_omp, dimsize) :: VarOut 922 INTEGER, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff 923 924 INTEGER :: i, ij 925 926 !$OMP MASTER 927 DO i = 1, dimsize 928 DO ij = 1, klon_mpi 929 Buff(ij, i) = VarIn(ij, i) 950 930 ENDDO 951 ENDDO 952 !$OMP END MASTER953 !$OMP BARRIER954 955 DO i =1,dimsize956 DO ij =1,klon_omp957 VarOut(ij, i)=Buff(klon_omp_begin-1+ij,i)931 ENDDO 932 !$OMP END MASTER 933 !$OMP BARRIER 934 935 DO i = 1, dimsize 936 DO ij = 1, klon_omp 937 VarOut(ij, i) = Buff(klon_omp_begin - 1 + ij, i) 958 938 ENDDO 959 939 ENDDO 960 !$OMP BARRIER961 940 !$OMP BARRIER 941 962 942 END SUBROUTINE scatter_omp_igen 963 943 964 944 965 SUBROUTINE scatter_omp_rgen(VarIn, VarOut,dimsize,Buff)966 USE lmdz_phys_omp_data967 USE lmdz_phys_mpi_data, ONLY: klon_mpi968 IMPLICIT NONE969 970 INTEGER, INTENT(IN) :: dimsize971 REAL, INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn972 REAL, INTENT(OUT),DIMENSION(klon_omp,dimsize) :: VarOut973 REAL, INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff974 975 INTEGER :: i, ij976 977 !$OMP MASTER978 DO i =1,dimsize979 DO ij =1,klon_mpi980 Buff(ij, i)=VarIn(ij,i)945 SUBROUTINE scatter_omp_rgen(VarIn, VarOut, dimsize, Buff) 946 USE lmdz_phys_omp_data 947 USE lmdz_phys_mpi_data, ONLY: klon_mpi 948 IMPLICIT NONE 949 950 INTEGER, INTENT(IN) :: dimsize 951 REAL, INTENT(IN), DIMENSION(klon_mpi, dimsize) :: VarIn 952 REAL, INTENT(OUT), DIMENSION(klon_omp, dimsize) :: VarOut 953 REAL, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff 954 955 INTEGER :: i, ij 956 957 !$OMP MASTER 958 DO i = 1, dimsize 959 DO ij = 1, klon_mpi 960 Buff(ij, i) = VarIn(ij, i) 981 961 ENDDO 982 ENDDO 983 !$OMP END MASTER984 !$OMP BARRIER985 986 DO i =1,dimsize987 DO ij =1,klon_omp988 VarOut(ij, i)=Buff(klon_omp_begin-1+ij,i)962 ENDDO 963 !$OMP END MASTER 964 !$OMP BARRIER 965 966 DO i = 1, dimsize 967 DO ij = 1, klon_omp 968 VarOut(ij, i) = Buff(klon_omp_begin - 1 + ij, i) 989 969 ENDDO 990 970 ENDDO 991 !$OMP BARRIER971 !$OMP BARRIER 992 972 993 973 END SUBROUTINE scatter_omp_rgen 994 974 995 975 996 SUBROUTINE scatter_omp_lgen(VarIn, VarOut,dimsize,Buff)997 USE lmdz_phys_omp_data998 USE lmdz_phys_mpi_data, ONLY: klon_mpi999 IMPLICIT NONE1000 1001 INTEGER, INTENT(IN) :: dimsize1002 LOGICAL, INTENT(IN),DIMENSION(klon_mpi,dimsize) :: VarIn1003 LOGICAL, INTENT(OUT),DIMENSION(klon_omp,dimsize) :: VarOut1004 LOGICAL, INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff1005 1006 INTEGER :: i, ij1007 1008 !$OMP MASTER1009 DO i =1,dimsize1010 DO ij =1,klon_mpi1011 Buff(ij, i)=VarIn(ij,i)976 SUBROUTINE scatter_omp_lgen(VarIn, VarOut, dimsize, Buff) 977 USE lmdz_phys_omp_data 978 USE lmdz_phys_mpi_data, ONLY: klon_mpi 979 IMPLICIT NONE 980 981 INTEGER, INTENT(IN) :: dimsize 982 LOGICAL, INTENT(IN), DIMENSION(klon_mpi, dimsize) :: VarIn 983 LOGICAL, INTENT(OUT), DIMENSION(klon_omp, dimsize) :: VarOut 984 LOGICAL, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff 985 986 INTEGER :: i, ij 987 988 !$OMP MASTER 989 DO i = 1, dimsize 990 DO ij = 1, klon_mpi 991 Buff(ij, i) = VarIn(ij, i) 1012 992 ENDDO 1013 ENDDO 1014 !$OMP END MASTER1015 !$OMP BARRIER1016 1017 DO i =1,dimsize1018 DO ij =1,klon_omp1019 VarOut(ij, i)=Buff(klon_omp_begin-1+ij,i)993 ENDDO 994 !$OMP END MASTER 995 !$OMP BARRIER 996 997 DO i = 1, dimsize 998 DO ij = 1, klon_omp 999 VarOut(ij, i) = Buff(klon_omp_begin - 1 + ij, i) 1020 1000 ENDDO 1021 1001 ENDDO 1022 !$OMP BARRIER1002 !$OMP BARRIER 1023 1003 1024 1004 END SUBROUTINE scatter_omp_lgen 1025 1005 1026 1006 1027 1028 1029 1030 SUBROUTINE gather_omp_igen(VarIn,VarOut,dimsize,Buff) 1031 USE lmdz_phys_omp_data 1032 USE lmdz_phys_mpi_data, ONLY: klon_mpi 1033 IMPLICIT NONE 1034 1035 INTEGER,INTENT(IN) :: dimsize 1036 INTEGER,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn 1037 INTEGER,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut 1038 INTEGER,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff 1039 1040 INTEGER :: i,ij 1041 1042 DO i=1,dimsize 1043 DO ij=1,klon_omp 1044 Buff(klon_omp_begin-1+ij,i)=VarIn(ij,i) 1007 SUBROUTINE gather_omp_igen(VarIn, VarOut, dimsize, Buff) 1008 USE lmdz_phys_omp_data 1009 USE lmdz_phys_mpi_data, ONLY: klon_mpi 1010 IMPLICIT NONE 1011 1012 INTEGER, INTENT(IN) :: dimsize 1013 INTEGER, INTENT(IN), DIMENSION(klon_omp, dimsize) :: VarIn 1014 INTEGER, INTENT(OUT), DIMENSION(klon_mpi, dimsize) :: VarOut 1015 INTEGER, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff 1016 1017 INTEGER :: i, ij 1018 1019 DO i = 1, dimsize 1020 DO ij = 1, klon_omp 1021 Buff(klon_omp_begin - 1 + ij, i) = VarIn(ij, i) 1045 1022 ENDDO 1046 1023 ENDDO 1047 !$OMP BARRIER1048 1049 1050 !$OMP MASTER1051 DO i =1,dimsize1052 DO ij =1,klon_mpi1053 VarOut(ij, i)=Buff(ij,i)1024 !$OMP BARRIER 1025 1026 1027 !$OMP MASTER 1028 DO i = 1, dimsize 1029 DO ij = 1, klon_mpi 1030 VarOut(ij, i) = Buff(ij, i) 1054 1031 ENDDO 1055 ENDDO 1056 !$OMP END MASTER1057 !$OMP BARRIER1032 ENDDO 1033 !$OMP END MASTER 1034 !$OMP BARRIER 1058 1035 1059 1036 END SUBROUTINE gather_omp_igen 1060 1037 1061 1038 1062 SUBROUTINE gather_omp_rgen(VarIn, VarOut,dimsize)1063 USE lmdz_phys_omp_data1064 USE lmdz_phys_mpi_data, ONLY: klon_mpi1065 IMPLICIT NONE1066 1067 INTEGER, INTENT(IN) :: dimsize1068 REAL, INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn1069 REAL, INTENT(OUT),DIMENSION(klon_mpi,dimsize),TARGET :: VarOut1070 1071 REAL, POINTER, SAVE :: Varout_ptr(:, :) ! Shared between threads NOT THREADPRIVATE1072 1073 INTEGER :: i, ij1074 1039 SUBROUTINE gather_omp_rgen(VarIn, VarOut, dimsize) 1040 USE lmdz_phys_omp_data 1041 USE lmdz_phys_mpi_data, ONLY: klon_mpi 1042 IMPLICIT NONE 1043 1044 INTEGER, INTENT(IN) :: dimsize 1045 REAL, INTENT(IN), DIMENSION(klon_omp, dimsize) :: VarIn 1046 REAL, INTENT(OUT), DIMENSION(klon_mpi, dimsize), TARGET :: VarOut 1047 1048 REAL, POINTER, SAVE :: Varout_ptr(:, :) ! Shared between threads NOT THREADPRIVATE 1049 1050 INTEGER :: i, ij 1051 1075 1052 !$omp master 1076 1053 Varout_ptr => VarOut … … 1078 1055 !$omp barrier 1079 1056 1080 DO i =1,dimsize1081 DO ij =1,klon_omp1082 Varout_ptr(klon_omp_begin -1+ij,i)=VarIn(ij,i)1057 DO i = 1, dimsize 1058 DO ij = 1, klon_omp 1059 Varout_ptr(klon_omp_begin - 1 + ij, i) = VarIn(ij, i) 1083 1060 ENDDO 1084 1061 ENDDO … … 1087 1064 1088 1065 1089 SUBROUTINE gather_omp_lgen(VarIn, VarOut,dimsize,Buff)1090 USE lmdz_phys_omp_data1091 USE lmdz_phys_mpi_data, ONLY: klon_mpi1092 IMPLICIT NONE1093 1094 INTEGER, INTENT(IN) :: dimsize1095 LOGICAL, INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn1096 LOGICAL, INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut1097 LOGICAL, INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff1098 1099 INTEGER :: i, ij1100 1101 DO i =1,dimsize1102 DO ij =1,klon_omp1103 Buff(klon_omp_begin -1+ij,i)=VarIn(ij,i)1066 SUBROUTINE gather_omp_lgen(VarIn, VarOut, dimsize, Buff) 1067 USE lmdz_phys_omp_data 1068 USE lmdz_phys_mpi_data, ONLY: klon_mpi 1069 IMPLICIT NONE 1070 1071 INTEGER, INTENT(IN) :: dimsize 1072 LOGICAL, INTENT(IN), DIMENSION(klon_omp, dimsize) :: VarIn 1073 LOGICAL, INTENT(OUT), DIMENSION(klon_mpi, dimsize) :: VarOut 1074 LOGICAL, INTENT(INOUT), DIMENSION(klon_mpi, dimsize) :: Buff 1075 1076 INTEGER :: i, ij 1077 1078 DO i = 1, dimsize 1079 DO ij = 1, klon_omp 1080 Buff(klon_omp_begin - 1 + ij, i) = VarIn(ij, i) 1104 1081 ENDDO 1105 1082 ENDDO 1106 !$OMP BARRIER1107 1108 1109 !$OMP MASTER1110 DO i =1,dimsize1111 DO ij =1,klon_mpi1112 VarOut(ij, i)=Buff(ij,i)1083 !$OMP BARRIER 1084 1085 1086 !$OMP MASTER 1087 DO i = 1, dimsize 1088 DO ij = 1, klon_mpi 1089 VarOut(ij, i) = Buff(ij, i) 1113 1090 ENDDO 1114 ENDDO 1115 !$OMP END MASTER1116 !$OMP BARRIER1091 ENDDO 1092 !$OMP END MASTER 1093 !$OMP BARRIER 1117 1094 1118 1095 END SUBROUTINE gather_omp_lgen 1119 1096 1120 1097 1121 SUBROUTINE reduce_sum_omp_igen(VarIn, VarOut,dimsize,Buff)1122 IMPLICIT NONE1123 1124 INTEGER, INTENT(IN) :: dimsize1125 INTEGER, INTENT(IN),DIMENSION(dimsize) :: VarIn1126 INTEGER, INTENT(OUT),DIMENSION(dimsize) :: VarOut1127 INTEGER, INTENT(INOUT),DIMENSION(dimsize) :: Buff1098 SUBROUTINE reduce_sum_omp_igen(VarIn, VarOut, dimsize, Buff) 1099 IMPLICIT NONE 1100 1101 INTEGER, INTENT(IN) :: dimsize 1102 INTEGER, INTENT(IN), DIMENSION(dimsize) :: VarIn 1103 INTEGER, INTENT(OUT), DIMENSION(dimsize) :: VarOut 1104 INTEGER, INTENT(INOUT), DIMENSION(dimsize) :: Buff 1128 1105 1129 1106 INTEGER :: i 1130 1107 1131 !$OMP MASTER1132 Buff(:) =01133 !$OMP END MASTER1134 !$OMP BARRIER1135 1136 !$OMP CRITICAL1137 DO i =1,dimsize1138 Buff(i) =Buff(i)+VarIn(i)1139 ENDDO 1140 !$OMP END CRITICAL1141 !$OMP BARRIER1142 1143 !$OMP MASTER1144 DO i =1,dimsize1145 VarOut(i) =Buff(i)1146 ENDDO 1147 !$OMP END MASTER1148 !$OMP BARRIER1149 1108 !$OMP MASTER 1109 Buff(:) = 0 1110 !$OMP END MASTER 1111 !$OMP BARRIER 1112 1113 !$OMP CRITICAL 1114 DO i = 1, dimsize 1115 Buff(i) = Buff(i) + VarIn(i) 1116 ENDDO 1117 !$OMP END CRITICAL 1118 !$OMP BARRIER 1119 1120 !$OMP MASTER 1121 DO i = 1, dimsize 1122 VarOut(i) = Buff(i) 1123 ENDDO 1124 !$OMP END MASTER 1125 !$OMP BARRIER 1126 1150 1127 END SUBROUTINE reduce_sum_omp_igen 1151 1128 1152 SUBROUTINE reduce_sum_omp_rgen(VarIn, VarOut,dimsize,Buff)1153 IMPLICIT NONE1154 1155 INTEGER, INTENT(IN) :: dimsize1156 REAL, INTENT(IN),DIMENSION(dimsize) :: VarIn1157 REAL, INTENT(OUT),DIMENSION(dimsize) :: VarOut1158 REAL, INTENT(INOUT),DIMENSION(dimsize) :: Buff1129 SUBROUTINE reduce_sum_omp_rgen(VarIn, VarOut, dimsize, Buff) 1130 IMPLICIT NONE 1131 1132 INTEGER, INTENT(IN) :: dimsize 1133 REAL, INTENT(IN), DIMENSION(dimsize) :: VarIn 1134 REAL, INTENT(OUT), DIMENSION(dimsize) :: VarOut 1135 REAL, INTENT(INOUT), DIMENSION(dimsize) :: Buff 1159 1136 1160 1137 INTEGER :: i 1161 1138 1162 !$OMP MASTER1163 Buff(:) =01164 !$OMP END MASTER1165 !$OMP BARRIER1166 1167 !$OMP CRITICAL1168 DO i =1,dimsize1169 Buff(i) =Buff(i)+VarIn(i)1170 ENDDO 1171 !$OMP END CRITICAL1172 !$OMP BARRIER1173 1174 !$OMP MASTER1175 DO i =1,dimsize1176 VarOut(i) =Buff(i)1177 ENDDO 1178 !$OMP END MASTER1179 !$OMP BARRIER1180 1139 !$OMP MASTER 1140 Buff(:) = 0 1141 !$OMP END MASTER 1142 !$OMP BARRIER 1143 1144 !$OMP CRITICAL 1145 DO i = 1, dimsize 1146 Buff(i) = Buff(i) + VarIn(i) 1147 ENDDO 1148 !$OMP END CRITICAL 1149 !$OMP BARRIER 1150 1151 !$OMP MASTER 1152 DO i = 1, dimsize 1153 VarOut(i) = Buff(i) 1154 ENDDO 1155 !$OMP END MASTER 1156 !$OMP BARRIER 1157 1181 1158 END SUBROUTINE reduce_sum_omp_rgen 1182 1159 1183 1160 1184 SUBROUTINE reduce_min_omp_igen(VarIn, VarOut,dimsize,Buff)1185 IMPLICIT NONE1186 1187 INTEGER, INTENT(IN) :: dimsize1188 INTEGER, INTENT(IN),DIMENSION(dimsize) :: VarIn1189 INTEGER, INTENT(OUT),DIMENSION(dimsize) :: VarOut1190 INTEGER, INTENT(INOUT),DIMENSION(dimsize) :: Buff1161 SUBROUTINE reduce_min_omp_igen(VarIn, VarOut, dimsize, Buff) 1162 IMPLICIT NONE 1163 1164 INTEGER, INTENT(IN) :: dimsize 1165 INTEGER, INTENT(IN), DIMENSION(dimsize) :: VarIn 1166 INTEGER, INTENT(OUT), DIMENSION(dimsize) :: VarOut 1167 INTEGER, INTENT(INOUT), DIMENSION(dimsize) :: Buff 1191 1168 1192 1169 INTEGER :: i 1193 1170 INTEGER :: var 1194 1171 1195 !$OMP MASTER1196 Buff(:) =HUGE(var)1197 !$OMP END MASTER1198 !$OMP BARRIER1199 1200 !$OMP CRITICAL1201 DO i =1,dimsize1202 Buff(i) =MIN(Buff(i),VarIn(i))1203 ENDDO 1204 !$OMP END CRITICAL1205 !$OMP BARRIER1206 1207 !$OMP MASTER1208 DO i =1,dimsize1209 VarOut(i) =Buff(i)1210 ENDDO 1211 !$OMP END MASTER1212 !$OMP BARRIER1213 1172 !$OMP MASTER 1173 Buff(:) = HUGE(var) 1174 !$OMP END MASTER 1175 !$OMP BARRIER 1176 1177 !$OMP CRITICAL 1178 DO i = 1, dimsize 1179 Buff(i) = MIN(Buff(i), VarIn(i)) 1180 ENDDO 1181 !$OMP END CRITICAL 1182 !$OMP BARRIER 1183 1184 !$OMP MASTER 1185 DO i = 1, dimsize 1186 VarOut(i) = Buff(i) 1187 ENDDO 1188 !$OMP END MASTER 1189 !$OMP BARRIER 1190 1214 1191 END SUBROUTINE reduce_min_omp_igen 1215 1192 1216 SUBROUTINE reduce_min_omp_rgen(VarIn, VarOut,dimsize,Buff)1217 IMPLICIT NONE1218 1219 INTEGER, INTENT(IN) :: dimsize1220 REAL, INTENT(IN),DIMENSION(dimsize) :: VarIn1221 REAL, INTENT(OUT),DIMENSION(dimsize) :: VarOut1222 REAL, INTENT(INOUT),DIMENSION(dimsize) :: Buff1193 SUBROUTINE reduce_min_omp_rgen(VarIn, VarOut, dimsize, Buff) 1194 IMPLICIT NONE 1195 1196 INTEGER, INTENT(IN) :: dimsize 1197 REAL, INTENT(IN), DIMENSION(dimsize) :: VarIn 1198 REAL, INTENT(OUT), DIMENSION(dimsize) :: VarOut 1199 REAL, INTENT(INOUT), DIMENSION(dimsize) :: Buff 1223 1200 1224 1201 INTEGER :: i 1225 1202 REAL :: var 1226 1203 1227 !$OMP MASTER1228 Buff(:) =HUGE(var)1229 !$OMP END MASTER1230 !$OMP BARRIER1231 1232 !$OMP CRITICAL1233 DO i =1,dimsize1234 Buff(i) =MIN(Buff(i),VarIn(i))1235 ENDDO 1236 !$OMP END CRITICAL1237 !$OMP BARRIER1238 1239 !$OMP MASTER1240 DO i =1,dimsize1241 VarOut(i) =Buff(i)1242 ENDDO 1243 !$OMP END MASTER1244 !$OMP BARRIER1245 1204 !$OMP MASTER 1205 Buff(:) = HUGE(var) 1206 !$OMP END MASTER 1207 !$OMP BARRIER 1208 1209 !$OMP CRITICAL 1210 DO i = 1, dimsize 1211 Buff(i) = MIN(Buff(i), VarIn(i)) 1212 ENDDO 1213 !$OMP END CRITICAL 1214 !$OMP BARRIER 1215 1216 !$OMP MASTER 1217 DO i = 1, dimsize 1218 VarOut(i) = Buff(i) 1219 ENDDO 1220 !$OMP END MASTER 1221 !$OMP BARRIER 1222 1246 1223 END SUBROUTINE reduce_min_omp_rgen 1247 1224 -
LMDZ6/branches/Amaury_dev/makelmdz_fcm
r5111 r5122 386 386 fi 387 387 388 if [[ $veget = "true" || $veget = "orchidee1.9" || $veget = "orchidee2.0" \388 if [[ $veget = "true" || $veget = "orchidee1.9" || $veget = "orchidee2.0" \ 389 389 || $veget = "orchidee2.1" || $veget = "orchideetrunk" ]]; then 390 390 echo "doing orchidee" … … 394 394 INCLUDE="${INCLUDE} ${ORCH_INCDIR}" 395 395 CPP_KEY="$CPP_KEY CPP_VEGET" 396 # temporary, for Orchidee versions 1.9.* (before openmp activat ion)396 # temporary, for Orchidee versions 1.9.* (before openmp activatmodion) 397 397 if [[ "$veget" = "orchidee1.9" ]]; then 398 398 CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP"
Note: See TracChangeset
for help on using the changeset viewer.