-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathallocate_vars.f90
More file actions
executable file
·151 lines (121 loc) · 4.3 KB
/
Copy pathallocate_vars.f90
File metadata and controls
executable file
·151 lines (121 loc) · 4.3 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
module allocate_vars
use global
implicit none
contains
subroutine global_allocations
implicit none
integer :: alloc_err
allocate(T (Ny,Nx), stat=alloc_err)
allocate(Tptrb(Ny,Nx), stat=alloc_err)
allocate(uy (Ny,Nx), stat=alloc_err)
allocate(phi (Ny,Nx), stat=alloc_err)
allocate(ux (Ny,Nx), stat=alloc_err)
allocate(nlT(Ny,Nx), stat=alloc_err)
allocate(nlphi(Ny,Nx), stat=alloc_err)
allocate(phi1(Ny,Nx), phi2(Ny,Nx), stat=alloc_err)
allocate(V1(Ny,Nx), V2(Ny,Nx), stat=alloc_err)
allocate(dyv1_B(Nx), dyv1_T(Nx), stat=alloc_err)
allocate(dyv2_B(Nx), dyv2_T(Nx), stat=alloc_err)
allocate(tT_real(Nx), stat=alloc_err)
allocate(tux_real(Nx), stat=alloc_err)
allocate(tuy_real(Nx), stat=alloc_err)
allocate(tnlT_real(Nx), stat=alloc_err)
allocate(tnlphi_real(Nx), stat=alloc_err)
allocate(tphi_real(Nx), stat=alloc_err)
allocate(tT_comp(Nx/2+1), stat=alloc_err)
allocate(tux_comp(Nx/2+1), stat=alloc_err)
allocate(tuy_comp(Nx/2+1), stat=alloc_err)
allocate(tnlT_comp(Nx/2+1), stat=alloc_err)
allocate(tnlphi_comp(Nx/2+1), stat=alloc_err)
allocate(tphi_comp(Nx/2+1), stat=alloc_err)
allocate(xp(Nx), stat=alloc_err)
allocate(yp(Ny), stat=alloc_err)
allocate(zp(Nz), stat=alloc_err)
allocate(kx(Nx/2+1), stat=alloc_err)
allocate(kz(Nz), stat=alloc_err)
allocate(kx_modes(Nx/2+1), stat=alloc_err)
allocate(dynu(Ny-1), stat=alloc_err)
allocate(g1(Ny), g2(Ny), g3(Ny), stat=alloc_err)
allocate(h1(Ny), h2(Ny), h3(Ny), stat=alloc_err)
allocate(tmp_phi(Ny), tmp_T(Ny), tmp_uy(Ny), stat=alloc_err)
allocate(tmp_phi1(Ny), tmp_uy1(Ny), stat=alloc_err)
allocate(tmp_K_phi(Ny), tmp_K_T(Ny), stat=alloc_err)
allocate(phii(Ny,Nx), Ti(Ny,Nx), stat=alloc_err)
allocate(uyi(Ny,Nx), uxi(Ny,Nx), stat=alloc_err)
allocate(K1_phi(Ny,Nx/2+1), K1_T(Ny,Nx/2+1), stat=alloc_err)
allocate(K2_phi(Ny,Nx/2+1), K2_T(Ny,Nx/2+1), stat=alloc_err)
allocate(K3_phi(Ny,Nx/2+1), K3_T(Ny,Nx/2+1), stat=alloc_err)
allocate(K1hat_phi(Ny,Nx/2+1), K1hat_T(Ny,Nx/2+1), stat=alloc_err)
allocate(K2hat_phi(Ny,Nx/2+1), K2hat_T(Ny,Nx/2+1), stat=alloc_err)
allocate(K3hat_phi(Ny,Nx/2+1), K3hat_T(Ny,Nx/2+1), stat=alloc_err)
allocate(K4hat_phi(Ny,Nx/2+1), K4hat_T(Ny,Nx/2+1), stat=alloc_err)
if (alloc_err /= 0) then
write(*,*) "ERROR: Global allocations failed."
stop
end if
T = (0.0_dp, 0.0_dp)
Tptrb = (0.0_dp, 0.0_dp)
ux = (0.0_dp, 0.0_dp)
phi = (0.0_dp, 0.0_dp)
uy = (0.0_dp, 0.0_dp)
nlT = (0.0_dp, 0.0_dp)
nlphi = (0.0_dp, 0.0_dp)
tT_real = 0.0_dp
tux_real = 0.0_dp
tuy_real = 0.0_dp
tnlT_real = 0.0_dp
tnlphi_real = 0.0_dp
tphi_real = 0.0_dp
tT_comp = (0.0_dp, 0.0_dp)
tux_comp = (0.0_dp, 0.0_dp)
tuy_comp = (0.0_dp, 0.0_dp)
tnlT_comp = (0.0_dp, 0.0_dp)
tnlphi_comp = (0.0_dp, 0.0_dp)
tphi_comp = (0.0_dp, 0.0_dp)
phi1 = 0.0_dp
phi2 = 0.0_dp
V1 = 0.0_dp
V2 = 0.0_dp
dyv1_T = 0.0_dp
dyv2_T = 0.0_dp
dyv1_B = 0.0_dp
dyv2_B = 0.0_dp
phii = (0.0_dp, 0.0_dp)
Ti = (0.0_dp, 0.0_dp)
uyi = (0.0_dp, 0.0_dp)
uxi = (0.0_dp, 0.0_dp)
K1_phi = (0.0_dp, 0.0_dp)
K2_phi = (0.0_dp, 0.0_dp)
K3_phi = (0.0_dp, 0.0_dp)
K1_T = (0.0_dp, 0.0_dp)
K2_T = (0.0_dp, 0.0_dp)
K3_T = (0.0_dp, 0.0_dp)
K1hat_phi = (0.0_dp, 0.0_dp)
K2hat_phi = (0.0_dp, 0.0_dp)
K3hat_phi = (0.0_dp, 0.0_dp)
K4hat_phi = (0.0_dp, 0.0_dp)
K1hat_T = (0.0_dp, 0.0_dp)
K2hat_T = (0.0_dp, 0.0_dp)
K3hat_T = (0.0_dp, 0.0_dp)
K4hat_T = (0.0_dp, 0.0_dp)
tmp_phi = (0.0_dp, 0.0_dp)
tmp_T = (0.0_dp, 0.0_dp)
tmp_uy = (0.0_dp, 0.0_dp)
tmp_K_phi = (0.0_dp, 0.0_dp)
tmp_K_T = (0.0_dp, 0.0_dp)
tmp_phi1 = (0.0_dp, 0.0_dp)
tmp_uy1 = (0.0_dp, 0.0_dp)
kx = 0.0_dp
kx_modes = 0.0_dp
kz = 0.0_dp
end subroutine global_allocations
subroutine global_deallocations
implicit none
deallocate(T )
deallocate(ux )
deallocate(uy )
deallocate(phi)
deallocate(xp, yp, zp)
deallocate(kx, kz)
end subroutine global_deallocations
end module allocate_vars