- Timestamp:
- May 6, 2015, 12:14:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/mod_phys_lmdz_mpi_data.F90
r3817 r3825 1 !2 !$Header$3 !4 1 MODULE mod_phys_lmdz_mpi_data 5 2 … … 46 43 CONTAINS 47 44 48 SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib,communicator)45 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator) 49 46 IMPLICIT NONE 50 47 #ifdef CPP_MPI 51 48 INCLUDE 'mpif.h' 52 49 #endif 53 INTEGER,INTENT( in) :: iim54 INTEGER,INTENT( in) :: jjp155 INTEGER,INTENT( in) :: nb_proc56 INTEGER,INTENT( in) :: distrib(0:nb_proc-1)57 INTEGER,INTENT(in) :: communicator58 50 INTEGER,INTENT(IN) :: nbp 51 INTEGER,INTENT(IN) :: nbp_lon 52 INTEGER,INTENT(IN) :: nbp_lat 53 INTEGER,INTENT(IN) :: communicator 54 55 INTEGER,ALLOCATABLE :: distrib(:) 59 56 INTEGER :: ierr 60 57 INTEGER :: klon_glo … … 67 64 #endif 68 65 69 if ( iim.eq.1) then66 if (nbp_lon.eq.1) then 70 67 klon_glo=1 71 68 else 72 klon_glo= iim*(jjp1-2)+269 klon_glo=nbp_lon*(nbp_lat-2)+2 73 70 endif 74 71 … … 85 82 mpi_rank=0 86 83 ENDIF 87 84 85 ALLOCATE(distrib(0:mpi_size-1)) 86 87 IF (is_using_mpi) THEN 88 #ifdef CPP_MPI 89 CALL MPI_ALLGATHER(nbp,1,MPI_REAL8,distrib,1,MPI_REAL_LMDZ,COMM_LMDZ_PHY) 90 #endif 91 ELSE 92 distrib(:)=nbp 93 ENDIF 94 95 88 96 IF (mpi_rank == 0) THEN 89 97 mpi_master = 0 … … 119 127 120 128 121 klon_mpi_para_nb(0:mpi_size-1)=distrib(0: nb_proc-1)129 klon_mpi_para_nb(0:mpi_size-1)=distrib(0:mpi_size-1) 122 130 123 131 DO i=0,mpi_size-1 … … 136 144 ij_para_begin(i) = 1 137 145 ELSE 138 ij_para_begin(i) = klon_mpi_para_begin(i)+ iim-1146 ij_para_begin(i) = klon_mpi_para_begin(i)+nbp_lon-1 139 147 ENDIF 140 148 141 jj_para_begin(i) = (ij_para_begin(i)-1)/ iim+ 1142 ii_para_begin(i) = MOD(ij_para_begin(i)-1, iim) + 1149 jj_para_begin(i) = (ij_para_begin(i)-1)/nbp_lon + 1 150 ii_para_begin(i) = MOD(ij_para_begin(i)-1,nbp_lon) + 1 143 151 144 152 145 ij_para_end(i) = klon_mpi_para_end(i)+ iim-1146 jj_para_end(i) = (ij_para_end(i)-1)/ iim+ 1147 ii_para_end(i) = MOD(ij_para_end(i)-1, iim) + 1153 ij_para_end(i) = klon_mpi_para_end(i)+nbp_lon-1 154 jj_para_end(i) = (ij_para_end(i)-1)/nbp_lon + 1 155 ii_para_end(i) = MOD(ij_para_end(i)-1,nbp_lon) + 1 148 156 149 157
Note: See TracChangeset
for help on using the changeset viewer.