sample_photo_emission_velocity Subroutine

public subroutine sample_photo_emission_velocity(sigma, normal_drift_speed, normal, tangent1, tangent2, vel, vmin_normal, rng_seed, rng_counter)

光電子放出速度を局所法線座標でサンプルする。

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: sigma

熱速度標準偏差 [m/s]。

real(kind=dp), intent(in) :: normal_drift_speed

熱速度標準偏差 [m/s]。 放出法線方向のシフト速度 [m/s]。

real(kind=dp), intent(in) :: normal(3)
real(kind=dp), intent(in) :: tangent1(3)
real(kind=dp), intent(in) :: tangent2(3)
real(kind=dp), intent(out) :: vel(3)
real(kind=dp), intent(in), optional :: vmin_normal

放出法線速度の下限 [m/s](省略時は 0)。

integer(kind=i32), intent(in) :: rng_seed

counter-based 乱数の seed。

integer(kind=i64), intent(in) :: rng_counter(:)

Calls

proc~~sample_photo_emission_velocity~~CallsGraph proc~sample_photo_emission_velocity sample_photo_emission_velocity proc~counter_uniform counter_uniform proc~sample_photo_emission_velocity->proc~counter_uniform proc~sample_flux_weighted_normal_component sample_flux_weighted_normal_component proc~sample_photo_emission_velocity->proc~sample_flux_weighted_normal_component proc~sample_standard_normal sample_standard_normal proc~sample_photo_emission_velocity->proc~sample_standard_normal proc~counter_key counter_key proc~counter_uniform->proc~counter_key proc~pcg64_open_uniform pcg64_open_uniform proc~counter_uniform->proc~pcg64_open_uniform interface~random_uniform random_uniform proc~sample_standard_normal->interface~random_uniform none~next_uniform counter_stream_type%next_uniform proc~sample_standard_normal->none~next_uniform pcg64_random_double53 pcg64_random_double53 none~next_uniform->pcg64_random_double53 proc~open_uniform_from_double53 open_uniform_from_double53 none~next_uniform->proc~open_uniform_from_double53 pcg64_advance pcg64_advance proc~pcg64_open_uniform->pcg64_advance pcg64_create pcg64_create proc~pcg64_open_uniform->pcg64_create pcg64_destroy pcg64_destroy proc~pcg64_open_uniform->pcg64_destroy proc~pcg64_open_uniform->pcg64_random_double53 proc~pcg64_open_uniform->proc~open_uniform_from_double53

Called by

proc~~sample_photo_emission_velocity~~CalledByGraph proc~sample_photo_emission_velocity sample_photo_emission_velocity proc~sample_photo_ray_slot sample_photo_ray_slot proc~sample_photo_ray_slot->proc~sample_photo_emission_velocity

Source Code

  subroutine sample_photo_emission_velocity( &
    sigma, normal_drift_speed, normal, tangent1, tangent2, vel, vmin_normal, rng_seed, rng_counter &
    )
    real(dp), intent(in) :: sigma, normal_drift_speed
    real(dp), intent(in) :: normal(3), tangent1(3), tangent2(3)
    real(dp), intent(out) :: vel(3)
    real(dp), intent(in), optional :: vmin_normal

    integer(i32), intent(in) :: rng_seed
    integer(i64), intent(in) :: rng_counter(:)

    real(dp) :: vn(1), z(2, 1), vt1, vt2

    call sample_flux_weighted_normal_component( &
      normal_drift_speed, sigma, vn, vmin_normal=vmin_normal, sigma_cutoff=default_velocity_sigma_cutoff, &
      uniform=[counter_uniform(rng_seed, rng_counter, 1_i64)] &
      )
    vt1 = 0.0_dp
    vt2 = 0.0_dp
    if (sigma > 0.0_dp) then
      call sample_standard_normal(z, sigma_cutoff=default_velocity_sigma_cutoff, rng_seed=rng_seed, rng_counter=rng_counter)
      vt1 = sigma*z(1, 1)
      vt2 = sigma*z(2, 1)
    end if
    vel = normal*vn(1) + tangent1*vt1 + tangent2*vt2
  end subroutine sample_photo_emission_velocity