Store FIDA weight photons in fweight
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | eind | Energy index |
||
integer, | intent(in) | :: | pind | Pitch index |
||
real(kind=Float64), | intent(in), | dimension(3) | :: | pos | Position of neutral |
|
real(kind=Float64), | intent(in), | dimension(3) | :: | vi | Velocity of neutral [cm/s] |
|
real(kind=Float64), | intent(in) | :: | denf | Fast-ion density [cm^-3] |
||
real(kind=Float64), | intent(in) | :: | photons | Photons from colrad [Ph/(s*cm^3)] |
subroutine store_fw_photons(eind, pind, pos, vi, denf, photons)
!+ Store FIDA weight photons in [[libfida:fweight]]
integer, intent(in) :: eind
!+ Energy index
integer, intent(in) :: pind
!+ Pitch index
real(Float64), dimension(3), intent(in) :: pos
!+ Position of neutral
real(Float64), dimension(3), intent(in) :: vi
!+ Velocity of neutral [cm/s]
real(Float64), intent(in) :: denf
!+ Fast-ion density [cm^-3]
real(Float64), intent(in) :: photons
!+ Photons from [[libfida:colrad]] [Ph/(s*cm^3)]
real(Float64) :: dlength, sigma_pi
type(LocalEMFields) :: fields
integer(Int32), dimension(3) :: ind
real(Float64), dimension(3) :: vp
type(LOSInters) :: inter
integer :: ichan,nchan,i
call get_indices(pos,ind)
inter = spec_chords%inter(ind(1),ind(2),ind(3))
nchan = inter%nchan
if(nchan.eq.0) return
call get_fields(fields,pos=pos)
loop_over_channels: do i=1,nchan
ichan = inter%los_elem(i)%id
dlength = inter%los_elem(i)%length
sigma_pi = spec_chords%los(ichan)%sigma_pi
vp = pos - spec_chords%los(ichan)%lens
call store_fw_photons_at_chan(ichan, eind, pind, &
vp, vi, fields, dlength, sigma_pi, denf, photons)
enddo loop_over_channels
end subroutine store_fw_photons