V3FIT
denmf.f
1  SUBROUTINE denmf(trigsu, trigsv, ifaxu, ifaxv, irho)
2 c Evaluate the coefficients d(m,n) using CRAY fft991, cfft99
3 c vectorized 1D FFT routines. Also evaluate fraction trapped and fraction
4 c passing.
5 C-----------------------------------------------
6 C M o d u l e s
7 C-----------------------------------------------
8  USE parambs
9  USE vmec0
10  IMPLICIT NONE
11 C-----------------------------------------------
12 C D u m m y A r g u m e n t s
13 C-----------------------------------------------
14  INTEGER :: irho
15  INTEGER, DIMENSION(13) :: ifaxu, ifaxv
16  REAL(rprec), DIMENSION(3*nthetah/2 + 1) :: trigsu
17  REAL(rprec), DIMENSION(2*nzetah) :: trigsv
18 C-----------------------------------------------
19 C L o c a l P a r a m e t e r s
20 C-----------------------------------------------
21  REAL(rprec), PARAMETER :: zero = 0, d18 = 1.0e-18_dp,
22  1 one = 1
23 C-----------------------------------------------
24 C L o c a l V a r i a b l e s
25 C-----------------------------------------------
26  REAL(rprec), DIMENSION(nthetah + 2,nzetah) :: a11
27 C-----------------------------------------------
28 c
29 c- First evaluate the complex coefficients d(n,m).
30 c
31 c- Load the the array a11 with (Bm/B)**2 * (1-B/Bm)**1.5.
32 c Remember that the arrays BFIELD now CONTAINS B/Bm.
33 c this is a flux surface average
34 
35  IF (isymm0 .eq. 0) THEN
36  a11(:nthetah,:nzetah) =
37  1 (abs(one - bfield(:nthetah,:nzetah)) + d18)**1.5_dp
38  2 *b2avg(irho)/(bmax1(irho)*bfield(:nthetah,:nzetah))**2
39  a11(nthetah+1,:nzetah) = zero
40  a11(nthetah+2,:nzetah) = zero
41 
42  CALL do_fft (a11, dmn, trigsu, trigsv, ifaxu, ifaxv, nthetah,
43  1 nzetah, mbuse, nbuse)
44 
45  ENDIF
46 
47  avgbobm2 = b2avg(irho)/bmax1(irho)**2
48 
49 c Now calculate the fraction passing and the fraction trapped.
50 
51  CALL fraction(irho)
52 
53  END SUBROUTINE denmf