-
Notifications
You must be signed in to change notification settings - Fork 46
/
Read_Log_Array.f90
38 lines (33 loc) · 1.51 KB
/
Read_Log_Array.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
!==============================================================================!
subroutine Comm_Mod_Read_Log_Array(fh, arr, disp)
!------------------------------------------------------------------------------!
! Read single integer for parallel runs. !
!------------------------------------------------------------------------------!
implicit none
!---------------------------------[Arguments]----------------------------------!
integer :: fh ! file handle
logical, dimension(:) :: arr ! array to write out
integer :: disp ! diplacement in bytes
!-----------------------------------[Locals]-----------------------------------!
integer :: length
integer :: error
!==============================================================================!
! Get array's length
length = size(arr)
! Set it at position disp (same as in Write counterpart)
call Mpi_File_Set_View(fh, &
disp, &
MPI_LOGICAL8, &
MPI_LOGICAL8, &
'native', &
MPI_INFO_NULL, &
error)
! Read integer value
call Mpi_File_Read(fh, &
arr(1), &
length, &
MPI_LOGICAL8, &
MPI_STATUS_IGNORE, &
error)
disp = disp + SIZE_LOG * length
end subroutine