44 include
'include/fftw3.f03' 49 integer :: indx_bk,indx_m,indx_ins,indx_slc
83 open(99,file=
'results/tmsr_u.dat',status=
'replace')
85 open(98,file=
'results/tmsr_v.dat',status=
'replace')
87 open(97,file=
'results/tmsr_w.dat',status=
'replace')
89 open(96,file=
'results/tmsr_t.dat',status=
'replace')
91 open(95,file=
'results/tmsr_p.dat',status=
'replace')
178 if (indx_bk/
ibackup .eq. 1 )
then 184 if (indx_m/
imeanfl .eq. 1)
then 192 if (indx_ins/
iinstfl .eq. 1)
then 199 if (indx_slc/
intv_2d .eq. 1)
then 235 integer :: t_its,t_its_max
247 do t_its=1,t_its_max,1
250 if (
dts .eq. 2 .and.
myid .eq. 0)
then 253 218
format(
' RK3, Step: ',i2)
274 call get_interp_fields_uvwhxyz(
u,
v,
w,
uhx,
uhy,
uhz,
vhx,
vhy,
vhz,
whx,
why)
285 (
u,
v,
w,
p,
t,
uhx,
uhy,
uhz,
vhx,
vhy,
vhz,
whx,
why,
ff,
ff0,
gg,
gg0,
hh,
hh0,
qu,
qv,
qw)
346 elseif (t_its .ne. 3)
then 360 (
u,
v,
w,
t,
uhx,
vhy,
mean_u,
mean_v,
mean_w,
mean_t,
mean_uu,
mean_vv, &
383 integer :: t_its,t_its_max
395 do t_its=1,t_its_max,1
398 if (
dts .eq. 2 .and.
myid .eq. 0)
then 401 218
format(
' RK3, Step: ',i2)
421 (
u,
v,
w,
p,
t,
c_u,
c_v,
c_w,
c_p,
c_ff,
c_gg,
c_hh,
c_qu,
c_qv,
c_qw)
501 elseif (t_its .ne. 3)
then 512 (
u,
v,
w,
t,
mean_u,
mean_v,
mean_w,
mean_t,
mean_uu,
mean_vv,
mean_ww, &
523 subroutine assign_abc(aa_in,bb_in,cc_in,aa,bb,cc)
529 real(mytype),
dimension(:),
intent(in) :: aa_in,cc_in
530 complex(mytype),
dimension(:,:,:),
intent(in) :: bb_in
531 real(mytype),
dimension(:,:,:),
intent(out) :: aa,cc
532 complex(mytype),
dimension(:,:,:),
intent(out) :: bb
542 do k=1,zsize(3)+2*
ghst,1
546 aa(i,j,k)=
rk_c*aa_in(k)
547 cc(i,j,k)=
rk_c*cc_in(k)
548 bb(i,j,k)=1.d0+
rk_c*bb_in(i,j,k)
556 do k=1,zsize(3)+2*
ghst,1
562 bb(i,j,k)=1.d0+bb_in(i,j,k)
584 real(mytype),
dimension(:),
intent(in) :: aa_in,cc_in
585 complex(mytype),
dimension(:,:,:),
intent(in) :: bb_in
586 real(mytype),
dimension(:,:,:),
intent(out) :: aa,cc
587 complex(mytype),
dimension(:,:,:),
intent(out) :: bb
593 do k=1,zsize(3)+2*
ghst,1
596 aa(i,j,k)=
rk_c*aa_in(k)
597 cc(i,j,k)=
rk_c*cc_in(k)
598 bb(i,j,k)=
rk_c*bb_in(i,j,k)
605 do k=1,zsize(3)+2*
ghst,1
610 bb(i,j,k)=bb_in(i,j,k)
628 real(mytype),
dimension(:,:,:),
intent(in) :: ff,gg,hh
629 real(mytype),
dimension(:,:,:),
intent(inout) :: ff0,gg0,hh0
647 real(mytype),
dimension(:,:,:),
intent(in) :: ss
648 real(mytype),
dimension(:,:,:),
intent(out) :: ss0
663 real(mytype),
dimension(:,:,:),
intent(in) :: phi
664 real(mytype),
dimension(:,:,:),
intent(inout) :: u,v,w
669 if (
cds .eq. 1)
then 675 u(i,j,k)= u(i,j,k) -
rk_c*
dt* &
676 ( phi(i+1,j,k) - phi(i,j,k) ) /
dx 686 v(i,j,k)= v(i,j,k) -
rk_c*
dt* &
687 ( phi(i,j+1,k) - phi(i,j,k) ) /
dy 693 elseif (
cds .eq. 2)
then 699 u(i,j,k)= u(i,j,k) -
rk_c*
dt*( -phi(i+2,j,k) + &
700 27.d0*phi(i+1,j,k) - &
702 phi(i-1,j,k) ) / 24.d0 /
dx 711 v(i,j,k)= v(i,j,k) -
rk_c*
dt*( -phi(i,j+2,k) + &
712 27.d0*phi(i,j+1,k) - &
714 phi(i,j-1,k) ) / 24.d0 /
dy 725 w(i,j,k)= w(i,j,k) -
rk_c*
dt* &
726 ( phi(i,j,k+1) - phi(i,j,k) ) /
dz_t(k)
743 real(mytype),
dimension(:,:,:),
intent(in) :: phi
744 real(mytype),
dimension(:,:,:),
intent(out) :: p
747 real(mytype) :: phixx,phiyy,phizz
750 if (
cds .eq. 1)
then 756 phixx = ( phi(i+1,j,k) - &
760 phiyy = ( phi(i,j+1,k) - &
764 phizz= ( (phi(i,j,k+1)-phi(i,j,k))/
dz_t(k) - &
765 (phi(i,j,k)-phi(i,j,k-1))/
dz_b(k) ) /
dz(k)
767 p(i,j,k)=p(i,j,k)+phi(i,j,k) - &
768 rk_c*0.5d0*
dt*
nu*(phixx+phiyy+phizz)
774 elseif (
cds .eq. 2)
then 780 phixx= ( -phi(i+2,j,k) + &
781 16.d0*phi(i+1,j,k) - &
783 16.d0*phi(i-1,j,k) - &
784 phi(i-2,j,k) ) / 12.d0 /
dx2 786 phiyy= ( -phi(i,j+2,k) + &
787 16.d0*phi(i,j+1,k) - &
789 16.d0*phi(i,j-1,k) - &
790 phi(i,j-2,k) ) / 12.d0 /
dy2 792 phizz= ( (phi(i,j,k+1)-phi(i,j,k))/
dz_t(k) - &
793 (phi(i,j,k)-phi(i,j,k-1))/
dz_b(k) ) /
dz(k)
795 p(i,j,k)=p(i,j,k)+phi(i,j,k) - &
796 rk_c*0.5d0*
dt*
nu*(phixx+phiyy+phizz)
subroutine output_time_series(u, v, w, p, t)
real(mytype), dimension(:,:,:), allocatable, save mean_uw
subroutine update_boundary_p(p)
real(mytype), dimension(:), allocatable, save aa_w
integer, save, protected is_ri_var
integer, save, protected imeanfl
integer, save, protected myid
real(mytype), dimension(:), allocatable, save aa_t
complex(mytype), dimension(:,:,:), allocatable, save c_qu
integer, save, protected isxy2d
integer, save, protected ibackup
real(mytype), dimension(:,:,:), allocatable, save vhy
complex(mytype), dimension(:,:,:), allocatable, save bb_u
integer, save, protected isyz2d
real(mytype), dimension(:,:,:), allocatable, save thx
subroutine get_u_eqn_coeff(aa, bb, cc)
real(mytype), dimension(:,:,:), allocatable, save ss
complex(mytype), dimension(:,:,:), allocatable, save c_u
complex(mytype), dimension(:,:,:), allocatable, save c_qv
subroutine real_2_cmplx(r_in, c_out)
real(mytype), dimension(:,:,:), allocatable, save uhz
subroutine get_p_eqn_src(u, v, w, qp)
subroutine screen_div_error(u, v, w, isfinal, ishistout)
real(mytype), dimension(:), allocatable, save aa_p
real(mytype), save, protected dt
integer, save, protected dts
complex(mytype), dimension(:,:,:), allocatable, save c_ss
real(mytype), dimension(:,:,:), allocatable, save mean_w
complex(mytype), dimension(:,:,:), allocatable, save c_hh
subroutine get_temperature_cnvdiff_spec(u, v, w, t, c_t, c_ss, c_qt)
real(mytype), dimension(:,:,:), allocatable, save ff0
integer, save, protected jend3
real(mytype), dimension(:,:,:), allocatable, save mean_u
real(mytype), save, protected nu
real(mytype), dimension(:), allocatable, save cc_p
integer, save, protected intv_2d
complex(mytype), dimension(:,:,:), allocatable, save c_p
subroutine get_t_eqn_coeff(aa, bb, cc)
real(mytype), dimension(:), allocatable, save cc_w
real(mytype), dimension(:,:,:), allocatable, save ss0
integer, save, protected p_row
real(mytype), dimension(:,:,:), allocatable, save mean_v
real(mytype), dimension(:,:,:), allocatable, save cc
real(mytype), dimension(:,:,:), allocatable, save p
subroutine time_advancement_fd
subroutine calculate_mean_fields_spec(u, v, w, t, mean_u, mean_v, mean_w, mean_t, mean_uu, mean_vv, mean_ww, mean_uw, mean_vw, mean_tt, mean_tw)
real(mytype), dimension(:,:,:), allocatable, save thz
subroutine calculate_ubar(u)
subroutine output_2d_slices(u, v, w, p, t, time_step)
real(mytype), dimension(:,:,:), allocatable, save mean_vw
integer, save, protected iinstfl
type(c_ptr), save, protected fft_plan1
subroutine spectral_truncation(c_inout3)
real(mytype), dimension(:,:,:), allocatable, save aa
real(mytype), dimension(:), allocatable, save, protected dz
complex(mytype), dimension(:,:,:), allocatable, save c_phi
subroutine poisson_solver_fft(aa, bb, cc, r_src, r_var, zstagger, delnull, tbnd, ubnd)
subroutine update_boundary_uvwhxyz(u, v, uhx, uhy, uhz, vhx, vhy, vhz, whx, why)
complex(mytype), dimension(:,:,:), allocatable, save bb_t
integer, save, protected myid_rowindx
real(mytype), dimension(:), allocatable, save cc_u
real(mytype), save, protected dy2
integer, save, protected isscalar
subroutine update_boundary_thxyz(thx, thy, thz)
real(mytype), dimension(:,:,:), allocatable, save mean_tt
complex(mytype), dimension(:,:,:), allocatable, save bb_w
subroutine assign_fgh_old(ff, gg, hh, ff0, gg0, hh0)
complex(mytype), dimension(:,:,:), allocatable, save c_gg
real(mytype), dimension(:,:,:), allocatable, save gg
subroutine get_p_eqn_coeff(aa, bb, cc)
real(mytype), dimension(:,:,:), allocatable, save vhx
integer, save, protected istr3
real(mytype), dimension(:,:,:), allocatable, save hh0
subroutine assign_s_old(ss, ss0)
integer, save, protected isxz2d
real(mytype), dimension(:,:,:), allocatable, save mean_ww
real(mytype), save, protected dx
subroutine get_momentum_cnvdiff_spec(u, v, w, p, t, c_u, c_v, c_w, c_p, c_ff, c_gg, c_hh, c_qu, c_qv, c_qw)
subroutine rayleigh_damping_spec(c_varin)
integer, save, protected jstr3
real(mytype), dimension(:,:,:), allocatable, save mean_t
real(mytype), dimension(:,:,:), allocatable, save w
integer, save, protected istmsr
real(mytype), dimension(:,:,:), allocatable, save u
real(mytype), dimension(:), allocatable, save, protected dz_b
type(c_ptr), save, protected ifft_plan1
subroutine update_ri(stps)
real(mytype), save, protected dx2
subroutine calculate_new_p(phi, p)
type(c_ptr), save, protected ifft_plan2
subroutine get_temperature_cnvdiff(u, v, w, t, thx, thy, thz, ss, ss0, qt)
subroutine cmplx_2_real(c_in, r_out)
subroutine output_backup(u, v, w, p, t, ff, gg, hh, ss)
integer, save, protected p_col
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
integer, save, protected cds
real(mytype), dimension(:,:,:), allocatable, save mean_vv
integer, save, protected isdamp
real(mytype), dimension(:), allocatable, save aa_u
complex(mytype), dimension(:,:,:), allocatable, save c_w
real(mytype), dimension(3), parameter rkc1
real(mytype), dimension(:,:,:), allocatable, save t
subroutine get_mesh_param
integer, save, protected imax
subroutine update_boundary_uvw(u, v, w)
subroutine calculate_uvw(u, v, w, phi)
real(mytype), dimension(:), allocatable, save, protected dz_t
real(mytype), dimension(:,:,:), allocatable, save qw
real(mytype), dimension(:,:,:), allocatable, save whx
real(mytype), dimension(:,:,:), allocatable, save uhx
real(mytype), save, protected dy
subroutine poisson_solver_fft_spec(aa, bb, cc, c_src_in, c_var_out, zstagger, delnull, tbnd, ubnd)
complex(mytype), dimension(:,:,:), allocatable, save c_t
real(mytype), dimension(:,:,:), allocatable, save why
subroutine update_boundary_t(t)
real(mytype), dimension(:,:,:), allocatable, save mean_tw
subroutine assign_abc(aa_in, bb_in, cc_in, aa, bb, cc)
real(mytype), dimension(:), allocatable, save cc_t
subroutine get_w_eqn_coeff(aa, bb, cc)
subroutine screen_div_error_spec(u, v, w, c_u, c_v, isfinal, ishistout)
real(mytype), dimension(:,:,:), allocatable, save ff
subroutine assign_abc_p(aa_in, bb_in, cc_in, aa, bb, cc)
subroutine time_advancement_sp
real(mytype), dimension(:,:,:), allocatable, save mean_uu
real(mytype), dimension(:,:,:), allocatable, save v
subroutine output_inst_fields(u, v, w, p, t, time_step)
subroutine get_div_spec(c_u, c_v, w, c_div)
real(mytype), dimension(3), parameter rkc2
type(c_ptr), save, protected fft_plan2
subroutine calculate_new_p_spec(phi, c_phi, c_p)
subroutine calculate_uvw_spec(phi, c_phi, c_u, c_v, c_w)
real(mytype), dimension(:,:,:), allocatable, save gg0
real(mytype), save, protected rk_c
real(mytype), dimension(:,:,:), allocatable, save qu
integer, save, protected iend3
real(mytype), dimension(:,:,:), allocatable, save phi
subroutine get_momentum_cnvdiff(u, v, w, p, t, uhx, uhy, uhz, vhx, vhy, vhz, whx, why, ff, ff0, gg, gg0, hh, hh0, qu, qv, qw)
subroutine output_mean_fields(mean_u, mean_v, mean_w, mean_t, mean_uu, mean_vv, mean_ww, mean_uw, mean_vw, mean_tt, mean_tw, time_step)
complex(mytype), dimension(:,:,:), allocatable, save bb
real(mytype), dimension(3), parameter rkc3
real(mytype), dimension(:,:,:), allocatable, save thy
subroutine screen_cpu_time(u, v, w)
real(mytype), dimension(:,:,:), allocatable, save qv
subroutine assign_rk_coeff(a_in, b_in, c_in)
integer, save, protected dp_opt
real(mytype), dimension(:,:,:), allocatable, save uhy
complex(mytype), dimension(:,:,:), allocatable, save bb_p
integer, save, protected kstr3
integer, save, protected myid_colindx
real(mytype), dimension(:,:,:), allocatable, save vhz
integer, save, protected kend3