root / synthbench / euroben-dm / mod1h / stats_agg.f @ 0:839f52ef7657
History | View | Annotate | Download (1.6 kB)
1 |
Subroutine stats_agg( npes, ncases, tn, ops, Xi_t, tmin, tave, |
---|---|
2 |
& tmax, Xi_r, rmin, rave, rmax ) |
3 |
! ---------------------------------------------------------------------- |
4 |
Use numerics |
5 |
Use max_params |
6 |
Implicit None |
7 |
Include 'mpif.h' |
8 |
|
9 |
Integer :: npes, ncases |
10 |
Real(l_) :: tn(1:ncases), ops |
11 |
Real(l_) :: Xi_t, tmin, tave, tmax |
12 |
Real(l_) :: Xi_r, rmin, rave, rmax |
13 |
Real(l_) :: tot_t, tot_t2 |
14 |
Real(l_) :: tot_r, tot_r2 |
15 |
Real(l_) :: rn, tnk |
16 |
Integer :: comm, k, ie, type |
17 |
! ---------------------------------------------------------------------- |
18 |
comm = MPI_Comm_World |
19 |
type = MPI_Real8 |
20 |
Call MPI_Barrier( comm, ie ) |
21 |
Do k = 1,ncases |
22 |
Call MPI_Allreduce( tn(k), tnk, 1, type, MPI_Max, comm, ie ) |
23 |
tn(k) = tnk |
24 |
End Do |
25 |
|
26 |
tmin = tn(1) |
27 |
tmax = tn(1) |
28 |
rmin = ops/tn(1) |
29 |
rmax = ops/tn(1) |
30 |
tot_t = 0.0_l_ |
31 |
tot_t2= 0.0_l_ |
32 |
tot_r = 0.0_l_ |
33 |
tot_r2= 0.0_l_ |
34 |
Do k = 1,ncases |
35 |
tot_t = tot_t + tn(k) |
36 |
tot_t2 = tot_t2+ tn(k)*tn(k) |
37 |
tmin = Min( tmin, tn(k) ) |
38 |
tmax = Max( tmax, tn(k) ) |
39 |
rn = ops/tn(k) |
40 |
tot_r = tot_r + rn |
41 |
tot_r2 = tot_r2+ rn*rn |
42 |
rmin = Min( rmin, rn ) |
43 |
rmax = Max( rmax, rn ) |
44 |
End Do |
45 |
tave = tot_t/ncases |
46 |
rave = tot_r/ncases |
47 |
Xi_t = Sqrt( (tot_t2-ncases*tave**2)/Max( ncases, 1 ) ) |
48 |
Xi_r = sqrt( (tot_r2-ncases*rave**2)/Max( ncases, 1 ) ) |
49 |
! ---------------------------------------------------------------------- |
50 |
End Subroutine stats_agg |