Use a pointer to the data structure in prolong_block().

This commit is contained in:
Grzegorz Kowal 2010-09-19 11:46:00 +02:00
parent 8ae2964b4f
commit d4e6f7d0ee

View File

@ -807,7 +807,7 @@ module mesh
! !
subroutine prolong_block(pblock) subroutine prolong_block(pblock)
use blocks , only : block_meta, nchild, nfl, nqt use blocks , only : block_meta, block_data, nchild, nfl, nqt
#ifdef MHD #ifdef MHD
use blocks , only : ibx, iby, ibz use blocks , only : ibx, iby, ibz
#endif /* MHD */ #endif /* MHD */
@ -840,9 +840,14 @@ module mesh
! local pointers ! local pointers
! !
type(block_meta), pointer :: pchild type(block_meta), pointer :: pchild
type(block_data), pointer :: pdata
!------------------------------------------------------------------------------- !-------------------------------------------------------------------------------
! !
! assign the pdata pointer
!
pdata => pblock%data
! prepare dimensions ! prepare dimensions
! !
dm(:) = (/ im, jm, km /) dm(:) = (/ im, jm, km /)
@ -861,7 +866,7 @@ module mesh
! expand all variables and place them in the array u ! expand all variables and place them in the array u
! !
do q = 1, nfl do q = 1, nfl
call expand(dm, fm, ng, pblock%data%u(q,:,:,:), u(q,:,:,:), 't', 't', 't') call expand(dm, fm, ng, pdata%u(q,:,:,:), u(q,:,:,:), 't', 't', 't')
end do end do
#ifdef MHD #ifdef MHD
@ -869,16 +874,14 @@ module mesh
! expand the cell centered magnetic field components ! expand the cell centered magnetic field components
! !
do q = ibx, ibz do q = ibx, ibz
call expand(dm, fm, ng, pblock%data%u(q,:,:,:), u(q,:,:,:), 't', 't', 't') call expand(dm, fm, ng, pdata%u(q,:,:,:), u(q,:,:,:), 't', 't', 't')
end do end do
#endif /* FIELDCD */ #endif /* FIELDCD */
#ifdef FLUXCT #ifdef FLUXCT
! expand the staggered magnetic field components preserving divergence-free ! expand the staggered magnetic field components preserving divergence-free
! condition ! condition
! !
call expand_mag(dm, fm, ng, pblock%data%u(ibx,:,:,:) & call expand_mag(dm, fm, ng, pdata%u(ibx,:,:,:), pdata%u(iby,:,:,:), pdata%u(ibz,:,:,:) &
, pblock%data%u(iby,:,:,:) &
, pblock%data%u(ibz,:,:,:) &
, u(ibx,:,:,:), u(iby,:,:,:), u(ibz,:,:,:)) , u(ibx,:,:,:), u(iby,:,:,:), u(ibz,:,:,:))
#endif /* FLUXCT */ #endif /* FLUXCT */
#endif /* MHD */ #endif /* MHD */