GWJ_DP Function

private function GWJ_DP(J1, M1, J2, M2, L, M) result(GWJ)

Geppert-Wiebicke non-axisymmetric coupling coefficient (Geppert & Wiebicke, 1991), the companion to GWI encoding the amplitude of a two-mode Hall-MHD interaction that generates or amplifies a non-axisymmetric component: Cross-validated against an independent VSH-dot-product expansion in TEST2_GW (src/tests.f90).

Warning

Unlike GWI, the extra square-root factor above is not internally selection-rule-guarded by CGCOEFF alone -- it can go negative for out-of-range (J1,J2,L) triples. This routine guards it explicitly (returning 0, matching the mathematically correct value) so it is still safe to call with any integer sextuple.

Returns: , complex.

Arguments

Type IntentOptional Attributes Name
integer(kind=i4), intent(in) :: J1

First coupled degree, .

integer(kind=i4), intent(in) :: M1

First coupled order, .

integer(kind=i4), intent(in) :: J2

Second coupled degree, .

integer(kind=i4), intent(in) :: M2

Second coupled order, .

integer(kind=i4), intent(in) :: L

Resulting degree, .

integer(kind=i4), intent(in) :: M

Resulting order, .

Return Value complex(kind=dp)


Calls

proc~~gwj_dp~~CallsGraph proc~gwj_dp GWJ_DP interface~cgcoeff CGCOEFF proc~gwj_dp->interface~cgcoeff proc~cgcoeff_dp CGCOEFF_DP interface~cgcoeff->proc~cgcoeff_dp interface~log_fact LOG_FACT proc~cgcoeff_dp->interface~log_fact proc~log_fact_dp LOG_FACT_DP interface~log_fact->proc~log_fact_dp

Called by

proc~~gwj_dp~~CalledByGraph proc~gwj_dp GWJ_DP interface~gwj GWJ interface~gwj->proc~gwj_dp proc~run_gwj_sweep RUN_GWJ_SWEEP proc~run_gwj_sweep->interface~gwj proc~test2_gw TEST2_GW proc~test2_gw->interface~gwj program~gwi_gwj_sweep GWI_GWJ_SWEEP program~gwi_gwj_sweep->proc~run_gwj_sweep program~main MAIN program~main->proc~test2_gw

Source Code

  FUNCTION GWJ_DP(J1,M1,J2,M2,L,M) RESULT(GWJ)
  IMPLICIT NONE
  INTEGER(KIND=i4), INTENT(IN) :: J1
  INTEGER(KIND=i4), INTENT(IN) :: M1
  INTEGER(KIND=i4), INTENT(IN) :: J2
  INTEGER(KIND=i4), INTENT(IN) :: M2
  INTEGER(KIND=i4), INTENT(IN) :: L
  INTEGER(KIND=i4), INTENT(IN) :: M
  REAL(KIND=dp) :: TRIANGLE_ARG
  COMPLEX(KIND=dp) :: GWJ
  ! Guard the sqrt() argument below the same way CGCOEFF guards its own
  ! triangle inequality: this product is negative outside the valid
  ! (J1+1,J2,L) triangle range, which would otherwise silently produce
  ! NaN (or trap under -ffpe-trap builds) instead of the correct zero.
  TRIANGLE_ARG = (J1+J2+L+2.d0)*(J2+L-J1)* &
    (J1+J2-L+1.d0)*(J1-J2+L+1.d0)
  IF (TRIANGLE_ARG < 0.d0) THEN
    GWJ = DCMPLX(0.d0, 0.d0)
    RETURN
  END IF
  GWJ=-DSQRT((2.d0*J1+1.d0)*(2.d0*J2+1.d0)/(2.d0*L+1.d0)/4.d0/pi)* &
    CGCOEFF(J1+1,0,J2,0,L,0)*CGCOEFF(J1,M1,J2,M2,L,M)* &
    DCMPLX(0.d0, 1.d0)*DSQRT(TRIANGLE_ARG)/2.d0
  RETURN
  END FUNCTION GWJ_DP