Store BES photons in Spectra
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=Float64), | intent(in), | dimension(3) | :: | pos | Position of neutral in beam grid coordinates | |
| real(kind=Float64), | intent(in), | dimension(3) | :: | vi | Velocitiy of neutral [cm/s] | |
| real(kind=Float64), | intent(in) | :: | lambda0 | Reference wavelength [nm] | ||
| real(kind=Float64), | intent(in) | :: | photons | Photons from colrad [Ph/(s*cm^3)] | ||
| integer, | intent(in) | :: | neut_type | Neutral type (full,half,third,halo) | 
subroutine store_nbi_photons(pos, vi, lambda0, photons, neut_type)
    !+ Store BES photons in [[libfida:spectra]]
    real(Float64), dimension(3), intent(in) :: pos
        !+ Position of neutral in beam grid coordinates
    real(Float64), dimension(3), intent(in) :: vi
        !+ Velocitiy of neutral [cm/s]
    real(Float64), intent(in)               :: lambda0
        !+ Reference wavelength [nm]
    real(Float64), intent(in)               :: photons
        !+ Photons from [[libfida:colrad]] [Ph/(s*cm^3)]
    integer,intent(in)                      :: neut_type
        !+ Neutral type (full,half,third,halo)
    select case (neut_type)
           case (nbif_type)
               call store_photons(pos,vi,lambda0,photons,spec%full,spec%fullstokes)
           case (nbih_type)
               call store_photons(pos,vi,lambda0,photons,spec%half, spec%halfstokes)
           case (nbit_type)
               call store_photons(pos,vi,lambda0,photons,spec%third,spec%thirdstokes)
           case default
               if(inputs%verbose.ge.0) then
                   write(*,'("STORE_NBI_PHOTONS: Unknown neutral type: ",i2)') neut_type
               endif
               stop
    end select
end subroutine store_nbi_photons