4
1
mirror of https://github.com/pfloos/quack synced 2024-11-13 01:23:59 +01:00
quack/src/BasCor/mu_grid.f90

47 lines
708 B
Fortran
Raw Normal View History

2019-07-09 16:17:10 +02:00
subroutine mu_grid(nGrid,rho,f,mu)
! Compute mu
implicit none
include 'parameters.h'
! Input variables
integer,intent(in) :: nGrid
double precision,intent(in) :: rho(nGrid)
double precision,intent(in) :: f(nGrid)
! Local variables
integer :: iG
double precision,parameter :: thres = 1d-10
double precision :: n2
! Output variables
double precision,intent(out) :: mu(nGrid)
! Initialization
mu(:) = 0d0
do iG=1,ngrid
2019-07-09 17:25:21 +02:00
n2 = 0.25d0*rho(iG)**2
2019-07-09 16:17:10 +02:00
if(abs(n2) > thres) then
mu(iG) = f(iG)/n2
else
mu(iG) = 1d0/thres
end if
end do
mu(:) = 0.5d0*sqrt(pi)*mu(:)
end subroutine mu_grid