-
Notifications
You must be signed in to change notification settings - Fork 2
/
SEM_statistics.f90
62 lines (49 loc) · 2.98 KB
/
SEM_statistics.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
!------------------------------------------------------------------------------!
! !
! PROGRAM : SEM_statistics.f90 !
! !
! PURPOSE : Make a statistics about flows including mean and rms data !
! !
! 2017.03.06 K.Noh !
! !
!------------------------------------------------------------------------------!
SUBROUTINE SEM_STAT
USE SEM_module, &
ONLY : N, Ny, Nz, Nt, dt, time
USE SEM_module, &
ONLY : Y, Z, U, V, W, T, RS, THS, &
SEM_EDDY, U_INLET, V_INLET, W_INLET, &
U_COMB, V_COMB, W_COMB, T_COMB, T_INLET, U_c, U_pr, rms_pr
IMPLICIT NONE
INTEGER :: it,j,k,tt
REAL(KIND=8) :: U_tmp(4,1:Ny), rms_tmp(8,1:Ny)
tt = INT(time / dt)
U_tmp(1:4,1:Ny) = 0.0
rms_tmp(1:8,1:Ny) = 0.0
!$OMP PARALLEL DO private(k,j)
DO j = 1,Ny
DO k = 1,Nz
U_tmp(1,j) = U_tmp(1,j) + U_COMB(j,k)
U_tmp(2,j) = U_tmp(2,j) + V_COMB(j,k)
U_tmp(3,j) = U_tmp(3,j) + W_COMB(j,k)
U_tmp(4,j) = U_tmp(4,j) + T_COMB(j,k)
rms_tmp(1,j) = rms_tmp(1,j) + (U_COMB(j,k) - U(j,k))**2
rms_tmp(2,j) = rms_tmp(2,j) + (V_COMB(j,k) - V(j,k))**2
rms_tmp(3,j) = rms_tmp(3,j) + (W_COMB(j,k) - W(j,k))**2
rms_tmp(4,j) = rms_tmp(4,j) + (T_COMB(j,k) - T(j,k))**2
rms_tmp(5,j) = rms_tmp(5,j) + &
(U_COMB(j,k) - U(j,k))*(V_COMB(j,k) - V(j,k))
rms_tmp(6,j) = rms_tmp(6,j) + &
(U_COMB(j,k) - U(j,k))*(T_COMB(j,k) - T(j,k))
rms_tmp(7,j) = rms_tmp(7,j) + &
(V_COMB(j,k) - V(j,k))*(T_COMB(j,k) - T(j,k))
rms_tmp(8,j) = rms_tmp(8,j) + &
(W_COMB(j,k) - W(j,k))*(T_COMB(j,k) - T(j,k))
END DO
U_tmp(1:4,j) = U_tmp(1:4,j)/Nz
U_pr(1:4,j) = ( U_pr(1:4,j) * (tt - 1) + U_tmp(1:4,j) )/tt
rms_tmp(1:8,j) = rms_tmp(1:8,j)/Nz
rms_pr(1:8,j) = ( rms_pr(1:8,j) * (tt - 1) + rms_tmp(1:8,j) )/tt
END DO
!OMP END PARALLEL
END SUBROUTINE SEM_STAT