mc_beam_grid Subroutine

public subroutine mc_beam_grid(ind, ri)

Sample uniformally in beam grid cell

Arguments

TypeIntentOptionalAttributesName
integer, intent(in), dimension(3):: ind

Cell index

real(kind=Float64), intent(out), dimension(3):: ri

Position in cell


Calls

proc~~mc_beam_grid~~CallsGraph proc~mc_beam_grid mc_beam_grid interface~randu randu proc~mc_beam_grid->interface~randu

Called by

proc~~mc_beam_grid~~CalledByGraph proc~mc_beam_grid mc_beam_grid proc~mc_fastion mc_fastion proc~mc_fastion->proc~mc_beam_grid proc~halo halo proc~halo->proc~mc_beam_grid proc~dcx dcx proc~dcx->proc~mc_beam_grid proc~fida_f fida_f proc~fida_f->proc~mc_fastion program~fidasim fidasim program~fidasim->proc~halo program~fidasim->proc~dcx program~fidasim->proc~fida_f proc~npa_f npa_f program~fidasim->proc~npa_f proc~npa_f->proc~mc_fastion

Contents

Source Code


Source Code

subroutine mc_beam_grid(ind, ri)
    !+ Sample uniformally in beam grid cell
    integer, dimension(3), intent(in)        :: ind
        !+ Cell index
    real(Float64), dimension(3), intent(out) :: ri
        !+ Position in cell

    real(Float64), dimension(3) :: random3

    call randu(random3)
    ri(1) = beam_grid%xc(ind(1)) + beam_grid%dr(1)*(random3(1) - 0.5)
    ri(2) = beam_grid%yc(ind(2)) + beam_grid%dr(2)*(random3(2) - 0.5)
    ri(3) = beam_grid%zc(ind(3)) + beam_grid%dr(3)*(random3(3) - 0.5)

end subroutine mc_beam_grid