private function PVSH_POL_DP(L, K, THETA, PHI) result(PVSH_POL)
Poloidal (horizontal) member of the polar vector spherical harmonic
basis, -- purely horizontal (zero radial component),
i.e. GRAD_SSH normalized by . Combined
with a radial stream function , this is the horizontal-field
piece of a poloidal field,
. Zero for
(a constant has no horizontal gradient).
Warning
Built on the unnormalized ASSOC_LEGENDRE_AND_DERIV --
inherits its stability limit (safe for at any
), notPVSH_POL_ALL's . See
STABILITY_FINDINGS.md at the repo root, Part 2.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Source Code
FUNCTION PVSH_POL_DP(L,K,THETA,PHI)RESULT(PVSH_POL)IMPLICIT NONEINTEGER(KIND=i4),INTENT(IN)::LINTEGER(KIND=i4),INTENT(IN)::KREAL(KIND=dp),INTENT(IN)::THETAREAL(KIND=dp),INTENT(IN)::PHIREAL(KIND=dp)::SINTH,NORM,PLK,DPLK,SCALECOMPLEX(KIND=dp)::EPHIM,YLM,GTH,GPHCOMPLEX(KIND=dp),DIMENSION(3)::PVSH_POLPVSH_POL(1)=DCMPLX(0.d0,0.d0)IF(L.GT.0)THENSINTH=DSIN(THETA)NORM=DSQRT((2.d0*L+1.d0)/(4.d0*pi))*&EXP(0.5_dp*(LOG_FACT(L-K)-LOG_FACT(L+K)))CALL ASSOC_LEGENDRE_AND_DERIV(L,K,DCOS(THETA),PLK,DPLK)EPHIM=EXP(j*K*PHI)YLM=NORM*PLK*EPHIMGTH=-SINTH*NORM*DPLK*EPHIMIF(SINTH.NE.0.d0)THENGPH=j*K*YLM/SINTHELSEGPH=DCMPLX(0.d0,0.d0)END IFSCALE=1.d0/DSQRT(L*(L+1.d0))PVSH_POL(2)=GTH*SCALEPVSH_POL(3)=GPH*SCALEELSEPVSH_POL(2)=DCMPLX(0.d0,0.d0)PVSH_POL(3)=DCMPLX(0.d0,0.d0)END IF RETURN END FUNCTION PVSH_POL_DP