Changeset 4103 for LMDZ6/trunk/libf/phy_common
- Timestamp:
- Mar 17, 2022, 11:51:36 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_omp_transfert.F90
r3465 r4103 498 498 REAL,INTENT(OUT),DIMENSION(:) :: VarOut 499 499 500 CALL Check_buffer_r(size(VarOut)) 501 CALL gather_omp_rgen(VarIn,Varout,1,buffer_r) 500 CALL gather_omp_rgen(VarIn,Varout,1) 502 501 503 502 END SUBROUTINE gather_omp_r … … 509 508 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn 510 509 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut 511 512 CALL Check_buffer_r(size(VarOut)) 513 CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2),buffer_r) 510 511 CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)) 514 512 515 513 END SUBROUTINE gather_omp_r1 … … 521 519 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn 522 520 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 523 524 CALL Check_buffer_r(size(VarOut)) 525 CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3),buffer_r) 521 522 CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)) 526 523 527 524 END SUBROUTINE gather_omp_r2 … … 533 530 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 534 531 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 535 536 CALL Check_buffer_r(size(VarOut)) 537 CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4),buffer_r) 532 533 CALL gather_omp_rgen(VarIn,Varout,Size(VarIn,2)*Size(VarIn,3)*Size(VarIn,4)) 538 534 539 535 END SUBROUTINE gather_omp_r3 … … 1071 1067 1072 1068 1073 SUBROUTINE gather_omp_rgen(VarIn,VarOut,dimsize ,Buff)1069 SUBROUTINE gather_omp_rgen(VarIn,VarOut,dimsize) 1074 1070 USE mod_phys_lmdz_omp_data 1075 1071 USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi … … 1078 1074 INTEGER,INTENT(IN) :: dimsize 1079 1075 REAL,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn 1080 REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut 1081 REAL,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff 1076 REAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize),TARGET :: VarOut 1077 1078 REAL, POINTER, SAVE :: Varout_ptr(:,:) ! Shared between threads NOT THREADPRIVATE 1079 1080 INTEGER :: i,ij 1081 1082 !$omp master 1083 Varout_ptr => VarOut 1084 !$omp end master 1085 !$omp barrier 1086 1087 DO i=1,dimsize 1088 DO ij=1,klon_omp 1089 Varout_ptr(klon_omp_begin-1+ij,i)=VarIn(ij,i) 1090 ENDDO 1091 ENDDO 1092 !$omp barrier 1093 END SUBROUTINE gather_omp_rgen 1094 1095 1096 SUBROUTINE gather_omp_lgen(VarIn,VarOut,dimsize,Buff) 1097 USE mod_phys_lmdz_omp_data 1098 USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi 1099 IMPLICIT NONE 1100 1101 INTEGER,INTENT(IN) :: dimsize 1102 LOGICAL,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn 1103 LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut 1104 LOGICAL,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff 1082 1105 1083 1106 INTEGER :: i,ij … … 1100 1123 !$OMP BARRIER 1101 1124 1102 END SUBROUTINE gather_omp_rgen1103 1104 1105 SUBROUTINE gather_omp_lgen(VarIn,VarOut,dimsize,Buff)1106 USE mod_phys_lmdz_omp_data1107 USE mod_phys_lmdz_mpi_data, ONLY : klon_mpi1108 IMPLICIT NONE1109 1110 INTEGER,INTENT(IN) :: dimsize1111 LOGICAL,INTENT(IN),DIMENSION(klon_omp,dimsize) :: VarIn1112 LOGICAL,INTENT(OUT),DIMENSION(klon_mpi,dimsize) :: VarOut1113 LOGICAL,INTENT(INOUT),DIMENSION(klon_mpi,dimsize) :: Buff1114 1115 INTEGER :: i,ij1116 1117 DO i=1,dimsize1118 DO ij=1,klon_omp1119 Buff(klon_omp_begin-1+ij,i)=VarIn(ij,i)1120 ENDDO1121 ENDDO1122 !$OMP BARRIER1123 1124 1125 !$OMP MASTER1126 DO i=1,dimsize1127 DO ij=1,klon_mpi1128 VarOut(ij,i)=Buff(ij,i)1129 ENDDO1130 ENDDO1131 !$OMP END MASTER1132 !$OMP BARRIER1133 1134 1125 END SUBROUTINE gather_omp_lgen 1135 1126
Note: See TracChangeset
for help on using the changeset viewer.