module_variables.f90
Go to the documentation of this file.
1 !*************************************************************************
2 ! This file is part of HERCULES.
3 !
4 ! HERCULES is free software; you can redistribute it and/or modify
5 ! it under the terms of the GNU General Public License as published by
6 ! the Free Software Foundation; either version 3 of the License, or
7 ! (at your option) any later version.
8 !
9 ! HERCULES is distributed in the hope that it will be useful,
10 ! but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ! GNU General Public License for more details.
13 !
14 ! You should have received a copy of the GNU General Public License
15 ! along with this program. If not, see <http://www.gnu.org/licenses/>.
16 !
17 ! Copyright 2015, Ping He, MEAS, NCSU
18 !*************************************************************************
19 
20 
21 
23 
25 
26  implicit none
27 
28  ! By default the variables are on z pencil
29 
30  ! u, v, w: velocity in the x, y, and z directions, p: pressure.
31  ! phi: pseudo pressure, t: temperature
32  real(mytype),dimension(:,:,:),allocatable,save :: u, v, w, p, phi, t
33 
34  ! interpolated variables using either 2nd or 4th order interpolation scheme
35  ! e.g., uhx is the half-way interpolated value of u along the x direction,
36  ! i.e., uhx(i,j,k) is located at the mid point between u(i,j,k) and u(i-1,j,k)
37  real(mytype),dimension(:,:,:),allocatable,save :: uhx,uhy,uhz,vhx,vhy,vhz
38  real(mytype),dimension(:,:,:),allocatable,save :: whx,why,thx,thy,thz
39 
40  ! mean variables and turbulence statistics.
41  real(mytype),dimension(:,:,:),allocatable,save :: mean_u,mean_v,mean_w,mean_t
42  real(mytype),dimension(:,:,:),allocatable,save :: mean_uu,mean_vv,mean_ww
43  real(mytype),dimension(:,:,:),allocatable,save :: mean_uw,mean_vw,mean_tw,mean_tt
44 
45  ! ff, gg, hh, ss: differential convective terms used in
46  ! momentum and temperature equations for RK3 and AB2 schemes
47  ! 0 means value at the previous time step (n-1)
48  real(mytype),dimension(:,:,:),allocatable,save :: ff,ff0,gg,gg0,hh,hh0,ss,ss0
49 
50  ! right hand side terms for momentum equations,
51  ! for pressure and temperature equations,
52  ! we reuse these variables to save memory
53  real(mytype),dimension(:,:,:),allocatable,save :: qu,qv,qw
54 
55  ! coefficients for Thomas algorithm, the 1st and 2nd dimensions is for l and m
56  ! note: a,b,c have ghost cells in k. aa,bb,cc are temporary arrays
57  ! the a,b,c values for each equations are stored in aa_u,bb_u,cc_u, etc.
58  real(mytype), dimension(:,:,:),allocatable,save :: aa,cc
59  complex(mytype),dimension(:,:,:),allocatable,save :: bb
60  complex(mytype),dimension(:,:,:),allocatable,save :: bb_u,bb_w,bb_p,bb_t
61  real(mytype), dimension(:), allocatable,save :: aa_u,cc_u,aa_w,cc_w, &
63 
64  ! temporary variables (z pencil), note that they do not have any ghost cells
65  complex(mytype),dimension(:,:,:),allocatable,save :: c_var,c_src
66  ! temporary array for mpi_2dfft, they are on x and y pencil
67  complex(mytype),dimension(:,:,:),allocatable,save :: c_tmp1,c_tmp2
68 
69  !!!! variables only used for spectral method !!!
70  ! Fourier coefficients of the fundamental variables (z pencil)
71  complex(mytype),dimension(:,:,:),allocatable,save :: c_u,c_v,c_w,c_p,c_phi,c_t
72  ! Fourier coefficients of the right hand side terms and ff, gg, hh,ss
73  complex(mytype),dimension(:,:,:),allocatable,save :: c_qu,c_qv,c_qw
74  complex(mytype),dimension(:,:,:),allocatable,save :: c_ff,c_gg,c_hh,c_ss
75 
76 end module
real(mytype), dimension(:,:,:), allocatable, save mean_uw
real(mytype), dimension(:), allocatable, save aa_w
real(mytype), dimension(:), allocatable, save aa_t
complex(mytype), dimension(:,:,:), allocatable, save c_qu
real(mytype), dimension(:,:,:), allocatable, save vhy
complex(mytype), dimension(:,:,:), allocatable, save bb_u
real(mytype), dimension(:,:,:), allocatable, save thx
real(mytype), dimension(:,:,:), allocatable, save ss
complex(mytype), dimension(:,:,:), allocatable, save c_u
complex(mytype), dimension(:,:,:), allocatable, save c_qv
real(mytype), dimension(:,:,:), allocatable, save uhz
complex(mytype), dimension(:,:,:), allocatable, save c_src
real(mytype), dimension(:), allocatable, save aa_p
complex(mytype), dimension(:,:,:), allocatable, save c_ss
real(mytype), dimension(:,:,:), allocatable, save mean_w
complex(mytype), dimension(:,:,:), allocatable, save c_hh
real(mytype), dimension(:,:,:), allocatable, save ff0
real(mytype), dimension(:,:,:), allocatable, save mean_u
real(mytype), dimension(:), allocatable, save cc_p
complex(mytype), dimension(:,:,:), allocatable, save c_p
real(mytype), dimension(:), allocatable, save cc_w
real(mytype), dimension(:,:,:), allocatable, save ss0
real(mytype), dimension(:,:,:), allocatable, save mean_v
real(mytype), dimension(:,:,:), allocatable, save cc
real(mytype), dimension(:,:,:), allocatable, save p
real(mytype), dimension(:,:,:), allocatable, save thz
real(mytype), dimension(:,:,:), allocatable, save mean_vw
real(mytype), dimension(:,:,:), allocatable, save aa
complex(mytype), dimension(:,:,:), allocatable, save c_tmp2
complex(mytype), dimension(:,:,:), allocatable, save c_phi
complex(mytype), dimension(:,:,:), allocatable, save bb_t
real(mytype), dimension(:), allocatable, save cc_u
real(mytype), dimension(:,:,:), allocatable, save mean_tt
complex(mytype), dimension(:,:,:), allocatable, save bb_w
complex(mytype), dimension(:,:,:), allocatable, save c_gg
real(mytype), dimension(:,:,:), allocatable, save gg
real(mytype), dimension(:,:,:), allocatable, save vhx
real(mytype), dimension(:,:,:), allocatable, save hh0
complex(mytype), dimension(:,:,:), allocatable, save c_tmp1
real(mytype), dimension(:,:,:), allocatable, save mean_ww
real(mytype), dimension(:,:,:), allocatable, save mean_t
real(mytype), dimension(:,:,:), allocatable, save w
real(mytype), dimension(:,:,:), allocatable, save u
real(mytype), dimension(:,:,:), allocatable, save hh
complex(mytype), dimension(:,:,:), allocatable, save c_v
complex(mytype), dimension(:,:,:), allocatable, save c_ff
complex(mytype), dimension(:,:,:), allocatable, save c_qw
real(mytype), dimension(:,:,:), allocatable, save mean_vv
real(mytype), dimension(:), allocatable, save aa_u
complex(mytype), dimension(:,:,:), allocatable, save c_w
real(mytype), dimension(:,:,:), allocatable, save t
real(mytype), dimension(:,:,:), allocatable, save qw
real(mytype), dimension(:,:,:), allocatable, save whx
real(mytype), dimension(:,:,:), allocatable, save uhx
complex(mytype), dimension(:,:,:), allocatable, save c_t
real(mytype), dimension(:,:,:), allocatable, save why
real(mytype), dimension(:,:,:), allocatable, save mean_tw
real(mytype), dimension(:), allocatable, save cc_t
real(mytype), dimension(:,:,:), allocatable, save ff
real(mytype), dimension(:,:,:), allocatable, save mean_uu
real(mytype), dimension(:,:,:), allocatable, save v
real(mytype), dimension(:,:,:), allocatable, save gg0
real(mytype), dimension(:,:,:), allocatable, save qu
real(mytype), dimension(:,:,:), allocatable, save phi
complex(mytype), dimension(:,:,:), allocatable, save bb
real(mytype), dimension(:,:,:), allocatable, save thy
real(mytype), dimension(:,:,:), allocatable, save qv
complex(mytype), dimension(:,:,:), allocatable, save c_var
real(mytype), dimension(:,:,:), allocatable, save uhy
complex(mytype), dimension(:,:,:), allocatable, save bb_p
real(mytype), dimension(:,:,:), allocatable, save vhz