PyREC scaffolding (from YREC development, 7be4133)/ qgauss.fGlossary

qgauss.f

43 lines · 1 definitions · on GitHub (7be4133)

Python version: qgauss.py, 47 lines, on the right (switch to Python above the code).

Variables on this page (1)

json

Purpose

Ten-point Gauss–Legendre quadrature over the polar angle on one equipotential shell of a rotating star. It returns three integrals that FPFT uses to find the shell's mean gravity $\langle g\rangle$ and $\langle g^{-1}\rangle$ ("find and across the shell by Gaussian quadrature," in FPFT's comment), and from them the distortion factors $f_P$ and $f_T$.

How it fits

  • Inputs: the upper limit B of the angle; the shell's data passed through to the integrand (R0, HS, AINT, Q, W2, A, the shell index I).
  • Who calls it: only FPFT.
  • What it calls: FUNC, which returns at an angle the local effective gravity G $= |\nabla\Phi| = \sqrt{(\partial\Phi/\partial r)^2 + (\partial\Phi/\partial\theta)^2}$ (as the code writes it) and the surface element S ($\propto 4\pi r\sin\theta$, C4PI*R*DSIN(X)*…, counting both hemispheres).
  • Outputs: G0G $= \int g\,dS$, GINVG $= \int g^{-1}\,dS$, SPHIG $= \int dS$, all over $\theta\in[0, B]$.

The method

With $x_m = x_r = B/2$ and the five positive nodes $\xi_j$ and weights $w_j$ of the 10-point rule, $$\int_0^B f\,d\theta \approx x_r \sum_{j=1}^{5} w_j\left[f(x_m + x_r\xi_j) + f(x_m - x_r\xi_j)\right],$$ applied to $g\,s$, $s/g$ and $s$.

Definitions

subroutineQGAUSS

lines 4–43 · GitHub

Uses modules DIMENSIONS_MOD

Called by FPFT

Flowchart of its calls, in order (2)
for J = 1,5 (DO 10), lines 31–38

Change log

The changes since rp_1

Changed since rp_1. Declarations only: JSON from DIMENSIONS_MOD, IMPLICIT NONE (the unused /CONST1/ and /CONST2/ dropped).