-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmod.F90
More file actions
323 lines (276 loc) · 9.82 KB
/
Copy pathmod.F90
File metadata and controls
323 lines (276 loc) · 9.82 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
!------------------------------------------------------------------
! */
! Module used in DNS with definitions of variables to be allocated */
! */
! Mark Simens */
! idea by Javier Crespo */
!********************************************************************/
module ctesp
! CTES CODE FOR 2D STAGGERED GRID FINITE DIFERENCES
!--------------------------------------------------------------------
! declaracion de variables
!--------------------------------------------------------------------
integer nx,ny,nz,nz1,nz2,ngz,npos,mcycl,nx1,ny1,nplanes
integer nummpi,pnodes,mpiid2
integer xin,xout
real*8 totmem
! Parameters for genflu and getstart!
!====================================================
parameter ( nx = 4097, ny = 315, nz = 1024)
parameter ( xin = 1 , xout = 600) !50d99
!====================================================
parameter ( nz1 = 2*(nz/3), nz2=nz1/2-1,ngz=nz/2,nx1=nx-1,ny1=ny-1 )
parameter ( nplanes = nz/3)
parameter ( mcycl = 40, npos=6)
#ifdef LINES
!%%%%%%%%%%%%%%%%%%Testing LInes%%%%%%%%%%%
integer,parameter:: nlineas=500*3
real*8:: perfil(1:nx,4,nlineas) !for bigger testing should be ib:ie
!%%%%%%%%%%%%%%%%%%
#endif
real*8:: tracking(ny,28,30)
!blocking for OMP
integer,parameter:: blockl=50
! buffers for real Fourier transform !
integer nmax
parameter (nmax=nz+2)
!For the outflow BC:
real*8:: Uinfinity
parameter (Uinfinity=1d0)
! Points for spectra and correlations
integer nspec,ltot,lxp,ncorr,tots,lxcorr
integer xci,xco
parameter(nspec=25,xci=1,xco=nx)
parameter(lxp=3,lxcorr=lxp,ncorr=nspec)
parameter(tots=ncorr*lxcorr*4*nx)
integer xpoint(lxp),nxp(lxp),xcorpoint(lxcorr)
data xpoint /512,1024,1920/
data xcorpoint /512,1024,1920/
data nxp /10,14,20/ !delta/2 at each X. Averaged Spectra (X-d/2)<X<(X+d/2)
#ifdef PLANESPECTRA
!for debugging purposes!!
integer frequency(7)
! data frequency /1,2,5,10,20,50,100/ !how often we sample
frequency = (/1,2,3,4,5,6,7/) !how often we sample
#endif
#ifdef PLANESPECTRA2
integer:: ss
#endif
#ifdef CREATEPROFILES
integer,parameter:: num_planes=300 !Number of planes to composite U0 & V0
real*8,dimension(:,:),allocatable:: u0c,v0c,u0c_once,v0c_once,w0c_once !Here are storaged the profiles
real*8:: pdiv(ny,nx)
integer:: paso
#endif
end module ctesp
!---------------------------------------------------------------------
! Variables for genflu
! --------------------------------------------------------------------!
module genmod
use ctesp,only: nx,ny,nz,nz2
implicit none
real*8:: um (ny+1),u0(ny+1),cf(1:nx),cf2(1:nx),cfinfo(9)
real*8:: gamma(2),utauout,rthin,rthout,utauin,dout,din
real*8:: timeinit,timec
integer:: flaggen,counter
end module genmod
!---------------------------------------------------------------------
module alloc_dns
use ctesp,only: nx,ny,nz,nz2
implicit none
complex*16:: kaz(0:nz2)
real*8:: kaz2(0:nz2),kazr(0:nz2),kvis(0:nz2)
real*8:: delx(1:nx)
real*8::inxu(3,nx),inyu(3,ny),inxv(3,nx),inyv(3,ny),inbx(4,4),inby(4,4)
real*8::cofivx(2,nx),cofiux(2,nx),cofivy(2,ny),cofiuy(2,ny)
real*8::fd_dvdy(8,ny)
real*8::fd_dx (8,nx)
real*8::fd_ix (8,nx)
real*8::fd_iy (8,ny)
real*8::fd_iyp (8,ny)
real*8::dcxu (3,nx)
real*8::dcyu (3,ny+1)
real*8::dcxv (3,nx)
real*8::dcyv (3,ny)
real*8::dcby (4,4)
real*8::dcbx (5,4)
real*8::cofcyu (2,ny)
real*8::cofcyv (2,ny)
real*8::cofcxu (2,nx)
real*8::cofcxv (2,nx)
real*8::vmagic(nx)
real*8::vixu (3,nx)
real*8::viyu (3,ny+1)
real*8::vixv (3,nx)
real*8::viyv (3,ny)
real*8::vyui (3,ny+1)
real*8::vyvi (3,ny)
real*8::cofvby(4,4)
real*8::cofvbx(4,4)
real*8::cofvyu(3,ny)
real*8::cofvyv(3,ny)
real*8::cofvxu(3,nx)
real*8::cofvxv(3,nx)
real*8::ccon (2,4)
real*8::rkc (3)
real*8::rkd (3)
real*8::rkcv (3)
real*8::rkdv (3)
real*8::signo (3)
real*8::x (0:nx+1)
real*8::xr (0:nx+1)
real*8::y (0:ny+1)
real*8:: l_weight(5,0:ny+1)
real*8:: ldyy(5)
real*8::dy (0:ny)
real*8::dx (0:nx)
real*8::idy(0:ny),idyy(1:ny)
real*8,dimension(:) ,allocatable:: vtop,vtop1,dvtdx,nyy
real*8,dimension(:),allocatable::eta
real*8::axp(3,nx)
real*8::ayp(3,ny)
real*8::phix(nx-1)
real*8::phiy(ny-1)
real*8::ayphi(3,ny-1)
real*8::axphi(3,nx-1)
real*8::kmod(nx-1) !real8
real*8::dymin(ny) !real8
real*8:: v0(ny)
real*8 tiempo,uav,ax,ay,az,re,rex
integer nescr,nesta,nsubstps,nhist,nsteps,istart,stest
integer len,reav,avcrt,flag,iflagr,zero,iflag,stats
real*8 r,pi,times,tvcrt,Wz0,alp,bet,dtret,dxmin,dzmin
! clf
integer cyclx, cycly
real*8 cfl,idx,idxx
logical*4 setstep
#ifdef PLANESPECTRA
logical*4 dostat(7)
#else
logical*4 dostat
#endif
! ------------------------ aux rhsp ----------------------------------------!
real*8:: wki1r(nz+2),vm(ny),vmtmp(ny),wki2r(nz+2,0:7) !8=Max num of threads
end module alloc_dns
! ------------- things for rft -------------------------------!
module fourthings
complex*16, dimension(:), allocatable:: bdum,fdum
integer*8 planf,planb
real*8 dnf,dnb
integer*4 nf,nb
end module fourthings
! ---------------------------------------------------------------!
module shared_mem
implicit none
type nodedata
integer:: startpl, endpl, planes
integer:: startpen, endpen, pencils
integer:: size
integer:: bound
integer, dimension(:), pointer:: scount, sdisp, rcount, rdisp
end type nodedata
type domaindata
integer:: NX, NY, NZ
integer:: pencils, planes
integer:: fatnodes, widenodes
integer:: planesize, pencilsize
integer, dimension(:), pointer:: pb, pe, ib, ie
end type domaindata
contains
subroutine domaindealloc(domain)
implicit none
type(domaindata), intent(inout):: domain
deallocate(domain%ib)
deallocate(domain%ie)
deallocate(domain%pb)
deallocate(domain%pe)
end subroutine domaindealloc
subroutine nodedealloc(node)
implicit none
type(nodedata), intent(inout):: node
deallocate(node%scount)
deallocate(node%sdisp)
deallocate(node%rcount)
deallocate(node%rdisp)
end subroutine nodedealloc
end module shared_mem
! ---------------------------------------------------------------!
module point
use omp_lib
use shared_mem
integer,dimension(:),allocatable :: ibeg,iend,pcibeg,pciend,pcibeg2,pciend2
integer:: ib,ie,ib0,mmx,mpu,mpv,mpiout,ntotb,ntotv,ntot_corr,ntot_corr2
integer:: mp_corr,mp_corr2,pcib,pcie,pcib2,pcie2
! ---- derived types for collective change. ----
type(nodedata):: nodeu,nodev,node_corr,node_corr2
type(domaindata):: domainu,domainv,domain_corr,domain_corr2
!--------Stuff for doing the OMP FFTw & Cosinus transform
integer ompid,nthreads,chunk1,chunk2,chunk3
!$OMP THREADPRIVATE(ompid,nthreads,chunk1,chunk2,chunk3)
integer jbf1,jef1,jbf2,jef2,mpvb,mpve
!$OMP THREADPRIVATE(jbf1,jef1,jbf2,jef2,mpvb,mpve)
end module point
! ---------------------------------------------------------------!
module statistics
use ctesp,only: nx,ny,nz,nz2
implicit none
real*8,dimension(:,:),allocatable:: us,vs,ws,ua,va,wa,uv,uw,vw,vortx,vorty,vortz,&
&vortxa,vortya,vortza,oxp,oyp,ozp,&
&u3,v3,u2v,v2u,w2v,w2u,dispu,dispv,dispw,dispuv,&
&pp,pm,pup,pvp,pdudx,pdvdy,pdudy,pdvdx,pdwdz,&
&dudx0,dudy0,dudz0,dvdx0,dvdy0,dvdz0,dwdx0,dwdy0,dwdz0
#ifdef INFOINTER
real*8,dimension(:,:),allocatable::v_0,u_x0,u_xy0,w_0,w_y0,dwdx_0,dudz_x0,v_y0,dudx_0
#endif
real*8 ener(15)
real*8,allocatable::i1c(:),i2c(:)
real*8:: hy(0:ny)
integer, allocatable::flags(:),jspecy(:,:)!,jspecor(:) ! flags for velocity and vor spectra
! Espectros de Velocidad y vorticidad !
real*8,dimension(:,:,:),allocatable:: ensu,ensv,ensw,ensuv
real*8,dimension(:,:,:),allocatable:: ensomz,ensomx,ensomy,pesp
! Correlaciones (x-x',j,z)
real*8,dimension(:,:),allocatable::coru ,corv ,corw ,coruv,coruw,corvw
real*8,dimension(:,:),allocatable::corox,coroy,coroz,corp
#ifdef PLANESPECTRA
real*8,dimension(:,:,:),allocatable::plane_specu,plane_specv,plane_specw
integer totalcal(7)
#else
integer totalcal
#endif
#ifdef PLANESPECTRA2
complex*16,dimension(:,:,:),allocatable::planesv
#endif
real*4,dimension(:,:,:), allocatable:: ens
end module statistics
! ---------------------------------------------------------------!
module names
implicit none
character*100 stfile,etfile,vetfile,hfile,chfile,chinit,chinfo,chinfoext,corfile,budfile,spectraplane,spectraplane2
integer indst,ifile
end module names
!---------------------------------------------------------------------!
! In this module we define some of the arrays that will change their
! shape during the run
!
! SHC 20/06/06
!---------------------------------------------------------------------!
module main_val
implicit none
real*8,dimension(:),allocatable::u,v,w,p,rhsupa,rhsvpa,rhswpa,rhsu,rhsv,&
& rhsw,res,wki1,wki2,wki3,resv,resw,wkp,wkpo,bufuphy,buf_corr,buf_corr2
end module main_val
!---------------------------------------------------------------------!
!Time parameters...
module temporal
real*8 tc1,tc2,iratec,tm1,tm2,iratem,tr1,tr2,irater
real*8 ttotc,ttotm,tmp1,tmp2,tmp3,ttotr,ttri,ttrv,tci,tcv
real*8 ttotinty,ttotvx,tmp4,tmp5,tmp6,ttotintx,ttotvy,ttotdy
real*8 ttotfftc,ttotfft,ttotaux,ttotpois,ttotrhs,tmp19,tred
real*8 tmp7,tmp8,tmp9,tmp10,tmp11,tmp12,ttotim,ttotvdx,tmp13,tmp14
real*8 tp1,tp2,th1,th2,tmp15,tmp16,tmpois,tmrhs,tmp17,tmp18,ttotgen,ttotbou
real*8 tmp20,tmp21,tmp22,tmp23,tmp24,ttot1,ttot2,ttot3,ttot4,ttot5,ttot6,ttot7,ttot8
real*8 ttot9,ttot10
real*8 tmp25,tmp26,tmp27,tmp28,tmp29,tmp30
real*8 tm3,tm4,tm5,tm6
end module temporal