Slightly rewrite init_orszag_tang().

This commit is contained in:
Grzegorz Kowal 2011-05-12 09:04:42 -03:00
parent 146991d7b9
commit 94ef1e83d0

View File

@ -1237,11 +1237,10 @@ module problem
! !
!=============================================================================== !===============================================================================
! !
subroutine init_orszag_tang(pblock) subroutine init_orszag_tang(pdata)
use constants, only : dpi, qpi
use blocks , only : block_data use blocks , only : block_data
use config , only : im, jm, km, in, jn, kn, ng use config , only : im, jm, km
use config , only : dens, bamp use config , only : dens, bamp
#ifdef ADI #ifdef ADI
use config , only : gamma, pres use config , only : gamma, pres
@ -1249,6 +1248,8 @@ module problem
#ifdef ISO #ifdef ISO
use config , only : csnd use config , only : csnd
#endif /* ISO */ #endif /* ISO */
use constants, only : dpi, qpi
use coords , only : ax, ay
use scheme , only : prim2cons use scheme , only : prim2cons
use variables, only : nvr, nqt use variables, only : nvr, nqt
use variables, only : idn, ivx, ivy, ivz use variables, only : idn, ivx, ivy, ivz
@ -1264,13 +1265,11 @@ module problem
! input arguments ! input arguments
! !
type(block_data), pointer, intent(inout) :: pblock type(block_data), pointer, intent(inout) :: pdata
! local variables ! local variables
! !
integer(kind=4), dimension(3) :: dm integer :: i, j, k
integer :: i, j, k
real :: dx, dy
! local arrays ! local arrays
! !
@ -1292,17 +1291,12 @@ module problem
bamp = csnd * (5.0d0 / 3.0d0) / qpi bamp = csnd * (5.0d0 / 3.0d0) / qpi
#endif /* ISO */ #endif /* ISO */
! calculate the cell sizes ! obtain block coordinates
! !
dx = (pblock%meta%xmax - pblock%meta%xmin) / in x(:) = pdata%meta%xmin + ax(pdata%meta%level,:)
dy = (pblock%meta%ymax - pblock%meta%ymin) / jn y(:) = pdata%meta%ymin + ay(pdata%meta%level,:)
! generate the coordinates ! initialize the primitive variables
!
x(:) = ((/(i, i = 1, im)/) - ng - 0.5d0) * dx + pblock%meta%xmin
y(:) = ((/(j, j = 1, jm)/) - ng - 0.5d0) * dy + pblock%meta%ymin
! set variables
! !
q(idn,:) = dens q(idn,:) = dens
#ifdef ADI #ifdef ADI
@ -1335,7 +1329,7 @@ module problem
! copy conservative variables to the current block ! copy conservative variables to the current block
! !
pblock%u(1:nqt,1:im,j,k) = u(1:nqt,1:im) pdata%u(1:nqt,1:im,j,k) = u(1:nqt,1:im)
end do end do
end do end do