TEST1_GW Function

public function TEST1_GW(NTH)

Test 1's target quantity computed via the GWI-coefficient expansion in scalar spherical harmonics, rather than direct VSH DOT products -- must agree with TEST1_ANALYTIC and TEST1_VSH to machine precision. This is the check that specifically exercises GWI (see also TEST2_GW for the GWJ counterpart).

Returns: Complex array of size NTH, matching TEST1_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~~test1_gw~~CallsGraph proc~test1_gw TEST1_GW interface~gwi GWI proc~test1_gw->interface~gwi interface~ssh SSH proc~test1_gw->interface~ssh proc~gwi_dp GWI_DP interface~gwi->proc~gwi_dp proc~ssh_dp SSH_DP interface~ssh->proc~ssh_dp interface~cgcoeff CGCOEFF proc~gwi_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~~test1_gw~~CalledByGraph proc~test1_gw TEST1_GW program~main MAIN program~main->proc~test1_gw

Source Code

  FUNCTION TEST1_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) :: TEST1_GW

  PH = 0.123d0   !- 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=1,3,2
      TEMP1 = TEMP1-((8.d0-I1*(I1+1.d0))/2.d0/DSQRT(12.d0))* &
        GWI(2,0,1,1,I1,1)*SSH(I1,1,TH,PH)
    ENDDO
    I2 = 1
    TEMP2 = -(1.d0/DSQRT(3.d0))*GWI(1,-1,1,1,0,0)* &
        CONJG(SSH(1,1,TH,PH))

    TEST1_GW(I) = TEMP1*TEMP2
  ENDDO
  RETURN
  END FUNCTION TEST1_GW