store_photon_birth Subroutine

public subroutine store_photon_birth(pos, photons, res, passive)

Store neutral birth location of the photon source

Arguments

TypeIntentOptionalAttributesName
real(kind=Float64), intent(in), dimension(3):: pos

Birth location of the photon source neutral

real(kind=Float64), intent(in) :: photons

Number of photons

type(NeutralParticleReservoir), intent(inout), dimension(:):: res

reservoir of neutral particles

logical, intent(in), optional :: passive

Calls

proc~~store_photon_birth~~CallsGraph proc~store_photon_birth store_photon_birth proc~get_passive_grid_indices get_passive_grid_indices proc~store_photon_birth->proc~get_passive_grid_indices proc~update_reservoir update_reservoir proc~store_photon_birth->proc~update_reservoir proc~get_indices get_indices proc~store_photon_birth->proc~get_indices proc~xyz_to_cyl xyz_to_cyl proc~get_passive_grid_indices->proc~xyz_to_cyl interface~randind randind proc~update_reservoir->interface~randind interface~randu randu proc~update_reservoir->interface~randu proc~init_reservoir init_reservoir proc~update_reservoir->proc~init_reservoir proc~xyz_to_uvw xyz_to_uvw proc~xyz_to_cyl->proc~xyz_to_uvw proc~uvw_to_cyl uvw_to_cyl proc~xyz_to_cyl->proc~uvw_to_cyl proc~init_reservoir->interface~randu

Called by

proc~~store_photon_birth~~CalledByGraph proc~store_photon_birth store_photon_birth proc~dcx dcx proc~dcx->proc~store_photon_birth proc~fida_f fida_f proc~fida_f->proc~store_photon_birth proc~fida_mc fida_mc proc~fida_mc->proc~store_photon_birth proc~halo halo proc~halo->proc~store_photon_birth proc~pfida_mc pfida_mc proc~pfida_mc->proc~store_photon_birth proc~pfida_f pfida_f proc~pfida_f->proc~store_photon_birth program~fidasim fidasim program~fidasim->proc~dcx program~fidasim->proc~fida_f program~fidasim->proc~fida_mc program~fidasim->proc~halo program~fidasim->proc~pfida_mc program~fidasim->proc~pfida_f

Contents

Source Code


Source Code

subroutine store_photon_birth(pos, photons, res, passive)
    !+ Store neutral birth location of the photon source
    real(Float64), dimension(3), intent(in)       :: pos
        !+ Birth location of the photon source neutral
    real(Float64), intent(in)                     :: photons
        !+ Number of photons
    type(NeutralParticleReservoir), dimension(:), intent(inout) :: res
        !+ reservoir of neutral particles
    logical, intent(in), optional                 :: passive

    integer :: i = 1, ichan
    logical :: pas = .False.
    real(Float64) :: cyl(3), pos_xyz(3)
    integer(Int32) :: ind(3), nchan
    type(LOSinters) :: inter

    if(present(passive)) pas = passive

    if(pas) then
        cyl(1) = sqrt(pos(1)*pos(1) + pos(2)*pos(2))
        cyl(2) = pos(3)
        cyl(3) = atan2(pos(2), pos(1))
        call get_passive_grid_indices(cyl,ind)
        inter = spec_chords%cyl_inter(ind(1),ind(2),ind(3))
    else
        call get_indices(pos,ind)
        inter = spec_chords%inter(ind(1),ind(2),ind(3))
    endif

    nchan = inter%nchan
    if(nchan.eq.0) return

    loop_over_channels: do i=1,nchan
        ichan = inter%los_elem(i)%id
        call update_reservoir(res(ichan), pos, photons)
    enddo loop_over_channels

end subroutine store_photon_birth