VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
spectrum.f90
Go to the documentation of this file.
1
3
8SUBROUTINE spectrum(rmn, zmn)
9
10 USE vmec_main
11 USE vmec_params, ONLY: mscale, nscale, ntmax, rss, zcs, rsc, zcc
12
13 IMPLICIT NONE
14
15 REAL(rprec), DIMENSION(ns,0:ntor,0:mpol1,ntmax), INTENT(inout) :: rmn
16 REAL(rprec), DIMENSION(ns,0:ntor,0:mpol1,ntmax), INTENT(inout) :: zmn
17
18 INTEGER :: ntype
19 INTEGER :: n
20 INTEGER :: m
21 INTEGER :: js
22 REAL(rprec) :: scale_fac
23 REAL(rprec), DIMENSION(ns) :: t1
24 REAL(rprec), DIMENSION(ns) :: dnumer
25 REAL(rprec), DIMENSION(ns) :: denom
26
27 ! CONVERT FROM INTERNAL XC REPRESENTATION FOR m=1 MODES,
28 ! R+(at rsc) = .5(rsc + zcc),
29 ! R-(at zcc) = .5(rsc - zcc),
30 ! TO REQUIRED rsc, zcc FORMS
31
32! #ifndef _HBANGLE
33 IF (lthreed) CALL convert_sym (rmn(:,:,:,rss), zmn(:,:,:,zcs))
34 IF (lasym) CALL convert_asym (rmn(:,:,:,rsc), zmn(:,:,:,zcc))
35! #end /* ndef _HBANGLE */
36
37 dnumer(2:ns) = zero
38 denom(2:ns) = zero
39
40 DO ntype = 1,ntmax
41 DO n = 0,ntor
42 DO m = 1,mpol1
43
44 scale_fac = (mscale(m)*nscale(n))**2.0_dp
45
46 DO js = 2,ns
47 t1(js) =(rmn(js,n,m,ntype)**2.0_dp + zmn(js,n,m,ntype)**2.0_dp)*scale_fac
48 END DO
49
50 dnumer(2:ns) = dnumer(2:ns) + t1(2:ns)*xmpq(m,3)
51 denom(2:ns) = denom(2:ns) + t1(2:ns)*xmpq(m,2)
52
53 END DO
54 END DO
55 ENDDO
56
57 specw(2:ns) = dnumer(2:ns)/denom(2:ns)
58
59END SUBROUTINE spectrum
real(rprec), dimension(:), allocatable specw
spectral width (diagnostic)
Definition vmec_main.f90:46
real(rprec), dimension(0:mpol1d, 3) xmpq
spectral condensation weighting factors
Definition vmec_main.f90:81
logical lthreed
real(rprec), dimension(:), allocatable mscale
array for norming theta-trig functions (internal use only) so that the discrete SUM[cos(mu)*cos(m'u)]...
real(rprec), dimension(:), allocatable nscale
array for norming zeta -trig functions (internal use only)
integer ntmax
number of contributing Fourier basis function (can be 1, 2 or 4); assigned in read_indata()
subroutine spectrum(rmn, zmn)
Compute the spectral width of the surface geometry Fourier coefficients.
Definition spectrum.f90:9
subroutine convert_sym(rmnss, zmncs)
Convert from internal representation to "physical" rmnss, zmncs Fourier form.
Definition totzsp.f90:217
subroutine convert_asym(rmnsc, zmncc)
Convert from internal representation to "physical" rmnsc, zmncc Fourier form.
Definition totzsp.f90:380