sph Subroutine

public pure subroutine sph(r, c, theta, phi, p)

球座標 (theta, phi) を中心 c・半径 r の直交座標へ変換する。

Arguments

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

球半径 [m]。

real(kind=dp), intent(in) :: c(3)

球半径 [m]。

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

球半径 [m]。 方位角 [rad]。

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

球半径 [m]。 方位角 [rad]。 極角(+Z軸基準) [rad]。

real(kind=dp), intent(out) :: p(3)

Called by

proc~~sph~~CalledByGraph proc~sph sph proc~make_sphere make_sphere proc~make_sphere->proc~sph proc~build_one_template build_one_template proc~build_one_template->proc~make_sphere proc~build_template_mesh build_template_mesh proc~build_template_mesh->proc~build_one_template proc~build_mesh_from_config build_mesh_from_config proc~build_mesh_from_config->proc~build_template_mesh proc~load_or_init_run_state load_or_init_run_state proc~load_or_init_run_state->proc~build_mesh_from_config program~main main program~main->proc~load_or_init_run_state

Source Code

  pure subroutine sph(r, c, theta, phi, p)
    real(dp), intent(in) :: r, c(3), theta, phi
    real(dp), intent(out) :: p(3)
    p(1) = c(1) + r*sin(phi)*cos(theta)
    p(2) = c(2) + r*sin(phi)*sin(theta)
    p(3) = c(3) + r*cos(phi)
  end subroutine sph