Changeset 807 for LMDZ4/trunk/libf/dyn3dpar/mod_hallo.F90
- Timestamp:
- Jul 5, 2007, 2:11:45 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/trunk/libf/dyn3dpar/mod_hallo.F90
r792 r807 2 2 USE parallel 3 3 implicit none 4 ! include 'mpif.h' 4 5 5 integer, parameter :: MaxRequest=200 6 6 integer, parameter :: MaxProc=80 … … 11 11 12 12 real,save,pointer,dimension(:) :: Buffer 13 ! pointer (Pbuffer,Buffer) 14 ! real,dimension(:) :: Buffer 13 15 14 integer,dimension(Listsize) :: Buffer_Pos 16 15 integer :: Index_Pos … … 26 25 type request_SR 27 26 integer :: NbRequest=0 28 ! real,dimension(:),allocatable :: Buffer29 ! real,dimension(:),pointer :: Buffer30 27 integer :: Pos 31 28 integer :: Index … … 43 40 contains 44 41 45 subroutine Init_mod_hallo (MPI_Buffer)42 subroutine Init_mod_hallo 46 43 implicit none 47 real,dimension(:),target :: MPI_BUFFER 48 integer i 44 49 45 Index_Pos=1 50 46 Buffer_Pos(Index_Pos)=1 51 52 Buffer=>MPI_Buffer53 47 MaxBufferSize_Used=0 48 49 CALL create_global_mpi_buffer 50 54 51 end subroutine init_mod_hallo 52 53 54 SUBROUTINE create_standard_mpi_buffer 55 IMPLICIT NONE 56 57 ALLOCATE(Buffer(MaxBufferSize)) 58 59 END SUBROUTINE create_standard_mpi_buffer 60 61 62 SUBROUTINE create_global_mpi_buffer 63 IMPLICIT NONE 64 INCLUDE 'mpif.h' 65 POINTER (Pbuffer,MPI_Buffer(MaxBufferSize)) 66 REAL :: MPI_Buffer 67 INTEGER(KIND=MPI_ADDRESS_KIND) :: BS 68 INTEGER :: i,ierr 69 70 71 Bs=8*MaxBufferSize 72 CALL MPI_ALLOC_MEM(BS,MPI_INFO_NULL,Pbuffer,ierr) 73 DO i=1,MaxBufferSize 74 MPI_Buffer(i)=i 75 ENDDO 76 77 CALL Associate_buffer(MPI_Buffer) 78 79 CONTAINS 80 81 SUBROUTINE Associate_buffer(MPI_Buffer) 82 IMPLICIT NONE 83 REAL,DIMENSION(:),target :: MPI_Buffer 84 85 Buffer=>MPI_Buffer 86 87 END SUBROUTINE Associate_buffer 88 89 END SUBROUTINE create_global_mpi_buffer 90 91 55 92 56 93 subroutine allocate_buffer(Size,Index,Pos)
Note: See TracChangeset
for help on using the changeset viewer.