FIELD_GAUSSIAN Function

function FIELD_GAUSSIAN(THETA, PHI) result(F)

Target field for Part B: a smooth angular Gaussian bump with slight modulation (carries and content, on top of effectively unbounded content from the Gaussian profile in ). Purely radial, for simplicity.

Note

The modulation is weighted by so the field stays single-valued at the poles: at (or ), every maps to the same physical point, so any legitimate smooth field must be -independent there. An earlier version of this field used a bare term with no such weighting -- it was multi-valued at the pole (1.5 approaching along , 0.5 along ), and no finite spherical harmonic series can converge to a discontinuous function; the reconstruction error plateaued at exactly 0.5 (the size of the discontinuity) instead of shrinking with . Caught by comparing this driver's convergence curve against an isolated, single- reconstruction check, which did not show the plateau.

Returns: The target vector field , complex 3-vector (purely radial).

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: THETA

Colatitude in radians, .

real(kind=dp), intent(in) :: PHI

Longitude in radians, .

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


Calls

proc~~field_gaussian~~CallsGraph proc~field_gaussian FIELD_GAUSSIAN dcos dcos proc~field_gaussian->dcos dexp dexp proc~field_gaussian->dexp dsin dsin proc~field_gaussian->dsin

Called by

proc~~field_gaussian~~CalledByGraph proc~field_gaussian FIELD_GAUSSIAN proc~run_part_b RUN_PART_B proc~run_part_b->proc~field_gaussian program~vsh_decomposition VSH_DECOMPOSITION program~vsh_decomposition->proc~run_part_b

Source Code

  FUNCTION FIELD_GAUSSIAN(THETA, PHI) RESULT(F)
  IMPLICIT NONE
  REAL(KIND=dp), INTENT(IN) :: THETA
  REAL(KIND=dp), INTENT(IN) :: PHI
  COMPLEX(KIND=dp), DIMENSION(3) :: F
  REAL(KIND=dp) :: BUMP
  BUMP = DEXP(-THETA**2/(2.d0*SIGMA_B**2)) * &
         (1.d0 + 0.5d0*DSIN(THETA)*DCOS(PHI))
  F(1) = DCMPLX(BUMP, 0.d0)
  F(2) = DCMPLX(0.d0, 0.d0)
  F(3) = DCMPLX(0.d0, 0.d0)
  END FUNCTION FIELD_GAUSSIAN