TEST2_GW Function

public function TEST2_GW(NTH)

Test 2's target quantity computed via the GWJ-coefficient expansion (combined with a GWI term) in scalar spherical harmonics -- must agree with TEST2_ANALYTIC and TEST2_VSH to machine precision. This is the check that specifically exercises GWJ.

Returns: Complex array of size NTH, matching TEST2_ANALYTIC's grid.

Arguments

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

Number of colatitude samples over .

Return Value complex(kind=dp), DIMENSION(NTH)


Calls

proc~~test2_gw~~CallsGraph proc~test2_gw TEST2_GW interface~gwi GWI proc~test2_gw->interface~gwi interface~gwj GWJ proc~test2_gw->interface~gwj interface~ssh SSH proc~test2_gw->interface~ssh proc~gwi_dp GWI_DP interface~gwi->proc~gwi_dp proc~gwj_dp GWJ_DP interface~gwj->proc~gwj_dp proc~ssh_dp SSH_DP interface~ssh->proc~ssh_dp interface~cgcoeff CGCOEFF proc~gwi_dp->interface~cgcoeff proc~gwj_dp->interface~cgcoeff dcos dcos proc~ssh_dp->dcos interface~assoc_legendre ASSOC_LEGENDRE proc~ssh_dp->interface~assoc_legendre interface~log_fact LOG_FACT proc~ssh_dp->interface~log_fact proc~assoc_legendre_dp ASSOC_LEGENDRE_DP interface~assoc_legendre->proc~assoc_legendre_dp proc~cgcoeff_dp CGCOEFF_DP interface~cgcoeff->proc~cgcoeff_dp proc~log_fact_dp LOG_FACT_DP interface~log_fact->proc~log_fact_dp proc~assoc_legendre_dp->interface~log_fact proc~cgcoeff_dp->interface~log_fact

Called by

proc~~test2_gw~~CalledByGraph proc~test2_gw TEST2_GW program~main MAIN program~main->proc~test2_gw

Source Code

  FUNCTION TEST2_GW(NTH)
  IMPLICIT NONE
  INTEGER(KIND=i4), INTENT(IN) :: NTH
  INTEGER(KIND=i4) :: I,I1,I2
  REAL(KIND=dp) :: TH,PH
  COMPLEX(KIND=dp) :: TEMP1, TEMP2
  COMPLEX(KIND=dp), DIMENSION(NTH) :: TEST2_GW

  PH = 1.006d0   !- arbitrary choice
  DO I=1,NTH
    TH = (I-1)*pi/(NTH-1)
    TEMP1 = DCMPLX(0.d0,0.d0)
    TEMP2 = DCMPLX(0.d0,0.d0)
    DO I1=2,4,2
      TEMP1 = TEMP1+GWJ(3,2,2,0,I1,2)*SSH(I1,2,TH,PH)
    ENDDO
    TEMP1=-TEMP1*j/DSQRT(6.d0*12.d0)
    DO I2=1,3,2
      TEMP2 = TEMP2+GWI(1,0,I2,-2,2,-2)* &
        CONJG(SSH(I2,-2,TH,PH))
    ENDDO
    TEST2_GW(I) = TEMP1*TEMP2
  ENDDO
  RETURN
  END FUNCTION TEST2_GW