init_velocity seperate n_shell range test and e_spec value test

This commit is contained in:
ignis 2017-01-24 15:09:27 +09:00
parent 6f0c1f44fa
commit 383b2c5aa7

View file

@ -266,8 +266,10 @@ subroutine init_velocity
do i = 1,nx+2
n_shell = nint(sqrt(real(akx(i)**2 + aky(k)**2 + akz(j)**2, 4)))
if (n_shell .gt. 0 .and. n_shell .le. kmax .and. e_spec(n_shell) .gt. zip) then
if (n_shell .gt. 0 .and. n_shell .le. kmax ) then
if (e_spec(n_shell) .gt. zip) then
fields(i,j,k,1:3) = fields(i,j,k,1:3) * sqrt(e_spec1(n_shell)/e_spec(n_shell))
endif
else
fields(i,j,k,1:3) = zip
end if