43 lines
987 B
Fortran
43 lines
987 B
Fortran
module limiter
|
|
use const_and_precisions, only : wp_
|
|
|
|
implicit none
|
|
|
|
! Inner wall radius
|
|
real(wp_), save :: rwallm
|
|
|
|
! Limiter contourn
|
|
integer, public, save :: nlim
|
|
real(wp_), dimension(:), allocatable, save :: rlim, zlim
|
|
|
|
contains
|
|
|
|
subroutine set_globals(data)
|
|
! Set global variables exposed by this module.
|
|
use gray_params, only : equilibrium_data
|
|
|
|
! subroutine arguments
|
|
type(equilibrium_data), intent(in) :: data
|
|
|
|
if (allocated(rlim)) deallocate(rlim)
|
|
if (allocated(zlim)) deallocate(zlim)
|
|
nlim = size(data%rlim)
|
|
allocate(rlim(nlim), zlim(nlim))
|
|
rlim = data%rlim
|
|
zlim = data%zlim
|
|
rwallm = minval(rlim)
|
|
end subroutine set_globals
|
|
|
|
|
|
subroutine unset_globals
|
|
! Unset global variables exposed by this module.
|
|
use const_and_precisions, only : zero
|
|
|
|
if(allocated(rlim)) deallocate(rlim)
|
|
if(allocated(zlim)) deallocate(zlim)
|
|
nlim = 0
|
|
rwallm = zero
|
|
end subroutine unset_globals
|
|
|
|
end module limiter
|