-
Notifications
You must be signed in to change notification settings - Fork 19
/
StatReadReduceWrite.F90
34 lines (26 loc) · 1.05 KB
/
StatReadReduceWrite.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
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !
! FILE: StatReadReduceWrite.F90 !
! CONTAINS: subroutine StatReadReduceWrite !
! !
! PURPOSE: Reduce statistics across processors, read !
! old statistics if required and write them out !
! !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
subroutine StatReadReduceWrite(var,filename,dsetname)
use param
use mpih
implicit none
character*30,intent(in) :: filename, dsetname
real(fp_kind) :: var(1:nxm)
real(fp_kind) :: var_old(1:nxm)
call MpiSumReal1D(var,nxm)
if (ismaster) then
if(readstats) then
call HdfSerialReadReal1D(dsetname,filename,var_old,nxm)
var = var + var_old
endif
call HdfSerialWriteReal1D(dsetname,filename,var,nxm)
end if
return
end