@@ -153,7 +153,7 @@ subroutine gaussian_cmplx(G)
153
153
call kiss64_double(ndim, kiss64_state, Rnd(1 :ndim))
154
154
arg = (Rnd(1 :ndim) * 2.0 * PI) - 1.0
155
155
156
- G = cmplx (mag * cos (arg), mag * sin (arg))
156
+ G = cmplx (mag * cos (arg), mag * sin (arg), kind = cdp )
157
157
158
158
! Method 2: Gaussian real and imaginary components
159
159
! do d=1,ndim
@@ -187,19 +187,21 @@ subroutine add_turbulence(turb_field, dt)
187
187
! Wiener process
188
188
189
189
integer :: i, j, k ! Loop variables
190
- integer :: ii,jj,kk ! Hermitian pair
191
190
integer :: halfway ! Half of grid size
192
191
193
192
#if defined(HERMITIAN_FIELD)
193
+ integer :: ii,jj,kk ! Hermitian pair
194
194
logical :: hermitian_pair ! Do we need to take conjugate?
195
195
logical :: own_conjg ! Are we are own conjugate pair?
196
196
#endif
197
197
198
- real (kind= dp) :: unitk(1 :NDIM) ! Unit vector parallel to k
199
198
complex (kind= cdp) :: complex_vec(1 :NDIM) ! Complex Fourier vector
199
+ #if NDIM>1
200
+ real (kind= dp) :: unitk(1 :NDIM) ! Unit vector parallel to k
200
201
complex (kind= cdp) :: unitk_cmplx(1 :NDIM) ! Unit vector parallel to k
201
202
complex (kind= cdp) :: comp_cmplx(1 :NDIM) ! Compressive component
202
203
complex (kind= cdp) :: sol_cmplx(1 :NDIM) ! Solenoidal components
204
+ #endif
203
205
204
206
halfway = TURB_GS / 2 ! integer division
205
207
@@ -262,7 +264,7 @@ subroutine add_turbulence(turb_field, dt)
262
264
#if NDIM>1
263
265
! Helmholtz decomposition!
264
266
call find_unitk(i, j, k, halfway, unitk)
265
- unitk_cmplx = cmplx (unitk)
267
+ unitk_cmplx = cmplx (unitk, kind = cdp )
266
268
comp_cmplx = unitk_cmplx * dot_product (unitk_cmplx,complex_vec)
267
269
sol_cmplx = complex_vec - comp_cmplx
268
270
complex_vec = comp_cmplx* comp_frac + sol_cmplx* sol_frac
@@ -490,7 +492,7 @@ subroutine power_rms_norm(power_in, P)
490
492
integer :: d ! Dimension counter
491
493
492
494
do d= 1 ,NDIM
493
- complex_field(d,:,:,:) = cmplx (power_in)
495
+ complex_field(d,:,:,:) = cmplx (power_in, kind = cdp )
494
496
end do
495
497
496
498
#if NDIM==1
0 commit comments