COORDINATES: Add decay factors, used in boundaries.

Decay factors determines the factor by which the variable is decayed at
the boundaries.

Signed-off-by: Grzegorz Kowal <grzegorz@amuncode.org>
This commit is contained in:
Grzegorz Kowal 2014-08-20 18:17:39 -03:00
parent 64b386cb9d
commit e5536c37c4

View File

@ -88,6 +88,10 @@ module coordinates
real(kind=8), save :: vol = 1.0d+00
real(kind=8), save :: voli = 1.0d+00
! the characteristic decay length
!
real(kind=8), save :: ldec = 1.0d-03
! the block coordinates for all levels of refinement
!
real(kind=8), dimension(:,:), allocatable, save :: ax , ay , az
@ -95,6 +99,10 @@ module coordinates
real(kind=8), dimension(: ), allocatable, save :: adxi, adyi, adzi
real(kind=8), dimension(: ), allocatable, save :: advol
! the decay factors for all levels
!
real(kind=8), dimension(: ), allocatable, save :: adec
! by default everything is private
!
public
@ -261,6 +269,7 @@ module coordinates
allocate(adyi (toplev))
allocate(adzi (toplev))
allocate(advol(toplev))
allocate(adec (toplev))
! reset all coordinate variables to initial values
!
@ -323,6 +332,16 @@ module coordinates
end do ! l = 1, toplev
! get the characteristic decay scale
!
call get_parameter_real("ldecay", ldec)
! calculate the decay factors
!
do l = 1, toplev
adec(l) = exp(- adx(l) / ldec)
end do ! l = 1, toplev
! print general information about the level resolutions
!
if (verbose) then
@ -403,6 +422,7 @@ module coordinates
if (allocated(adyi) ) deallocate(adyi)
if (allocated(adzi) ) deallocate(adzi)
if (allocated(advol)) deallocate(advol)
if (allocated(adec) ) deallocate(adec)
!-------------------------------------------------------------------------------
!