29 REAL(rprec),
DIMENSION(ns,0:ntor,0:mpol1,3*ntmax),
TARGET,
INTENT(out) :: frzl_array
30 REAL(rprec),
DIMENSION(ns*nzeta*ntheta3,0:1),
INTENT(in) :: &
31 armn, brmn, crmn, azmn, bzmn, czmn, blmn, clmn, arcon, azcon
33 INTEGER :: jmax, m, mparity, i, n, k, l, nsz
34 INTEGER :: ioff, joff, mj, ni, nsl, j2, j2l, jl, jll, jmaxl, js
35 REAL(rprec),
DIMENSION(:,:,:),
POINTER :: frcc, frss, fzcs, fzsc, flcs, flsc
36 REAL(rprec),
ALLOCATABLE,
DIMENSION(:,:) :: work1
37 REAL(rprec),
DIMENSION(:),
ALLOCATABLE :: tempr, tempz
39 frcc => frzl_array(:,:,:,
rcc)
41 flsc => frzl_array(:,:,:,
zsc+2*
ntmax)
43 frss => frzl_array(:,:,:,
rss)
45 flcs => frzl_array(:,:,:,
zcs+2*
ntmax)
50 ALLOCATE (work1(nsz,12), tempr(nsz), tempz(nsz), stat=i)
51 IF (i .ne. 0) stop
'Allocation error in VMEC2000 tomnsps'
60 IF (
ivac .lt. 1) jmax = ns1
87 tempr(:) = armn(jll:nsl,mparity) &
89 +
xmpq(m,1)*arcon(jll:nsl,mparity)
92 tempz(:) = azmn(jll:nsl,mparity) &
94 +
xmpq(m,1)*azcon(jll:nsl,mparity)
97 work1(:, 1) = work1(:, 1) + tempr(:)*cosmui(i,m) + brmn(jll:nsl,mparity)*sinmumi(i,m)
98 work1(:, 7) = work1(:, 7) + tempz(:)*sinmui(i,m) + bzmn(jll:nsl,mparity)*cosmumi(i,m)
99 work1(:,11) = work1(:,11) + blmn(jll:nsl,mparity)*cosmumi(i,m)
103 work1(:, 2) = work1(:, 2) - crmn(jll:nsl,mparity)*cosmui(i,m)
104 work1(:, 3) = work1(:, 3) + tempr(:)*sinmui(i,m) + brmn(jll:nsl,mparity)*cosmumi(i,m)
105 work1(:, 4) = work1(:, 4) - crmn(jll:nsl,mparity)*sinmui(i,m)
106 work1(:, 5) = work1(:, 5) + tempz(:)*cosmui(i,m) + bzmn(jll:nsl,mparity)*sinmumi(i,m)
107 work1(:, 6) = work1(:, 6) - czmn(jll:nsl,mparity)*cosmui(i,m)
108 work1(:, 8) = work1(:, 8) - czmn(jll:nsl,mparity)*sinmui(i,m)
110 work1(:, 9) = work1(:, 9) + blmn(jll:nsl,mparity)*sinmumi(i,m)
111 work1(:,10) = work1(:,10) - clmn(jll:nsl,mparity)*cosmui(i,m)
112 work1(:,12) = work1(:,12) - clmn(jll:nsl,mparity)*sinmui(i,m)
128 frcc(j2:jmax,ni,mj) = frcc(j2:jmax,ni,mj) + work1(j2l:jmaxl,1)*cosnv(k,n)
129 fzsc(j2:jmax,ni,mj) = fzsc(j2:jmax,ni,mj) + work1(j2l:jmaxl,7)*cosnv(k,n)
130 flsc(jl:ns,ni,mj) = flsc(jl:ns,ni,mj) + work1(jll:nsl,11)*cosnv(k,n)
134 frcc(j2:jmax,ni,mj) = frcc(j2:jmax,ni,mj) + work1(j2l:jmaxl,2)*sinnvn(k,n)
135 fzsc(j2:jmax,ni,mj) = fzsc(j2:jmax,ni,mj) + work1(j2l:jmaxl,8)*sinnvn(k,n)
136 frss(j2:jmax,ni,mj) = frss(j2:jmax,ni,mj) + work1(j2l:jmaxl,3)*sinnv(k,n) &
137 + work1(j2l:jmaxl,4)*cosnvn(k,n)
138 fzcs(j2:jmax,ni,mj) = fzcs(j2:jmax,ni,mj) + work1(j2l:jmaxl,5)*sinnv(k,n) &
139 + work1(j2l:jmaxl,6)*cosnvn(k,n)
141 flsc(jl:ns,ni,mj) = flsc(jl:ns,ni,mj) + work1(jll:nsl,12)*sinnvn(k,n)
142 flcs(jl:ns,ni,mj) = flcs(jl:ns,ni,mj) + work1(jll:nsl, 9)*sinnv(k,n) &
143 + work1(jll:nsl,10)*cosnvn(k,n)
148 DEALLOCATE (work1, tempr, tempz)
152 call add_real_3d(
"frcc", ns, ntor1, mpol, frcc)
153 call add_real_3d(
"fzsc", ns, ntor1, mpol, fzsc)
154 call add_real_3d(
"flsc", ns, ntor1, mpol, flsc)
157 call add_real_3d(
"frss", ns, ntor1, mpol, frss)
158 call add_real_3d(
"fzcs", ns, ntor1, mpol, fzcs)
159 call add_real_3d(
"flcs", ns, ntor1, mpol, flcs)
161 call add_null(
"frss")
162 call add_null(
"fzcs")
163 call add_null(
"flcs")
196 REAL(rprec),
DIMENSION(ns,0:ntor,0:mpol1,3*ntmax),
TARGET,
INTENT(inout) :: frzl_array
197 REAL(rprec),
DIMENSION(ns*nzeta,ntheta3,0:1),
INTENT(in) :: &
198 armn, brmn, crmn, azmn, bzmn, czmn, blmn, clmn, arcon, azcon
200 INTEGER :: jmax, m, mparity, i, n, k, l, nsz
201 INTEGER :: ioff, joff, mj, ni, nsl, j2, j2l, jl, jll, jmaxl, js
202 REAL(rprec),
DIMENSION(:,:,:),
POINTER :: frcs, frsc, fzcc, fzss, flcc, flss
203 REAL(rprec),
DIMENSION(:),
ALLOCATABLE :: temp1, temp3
204 REAL(rprec),
DIMENSION(:,:),
ALLOCATABLE :: work1
206 frsc => frzl_array(:,:,:,
rsc)
208 flcc => frzl_array(:,:,:,
zcc+2*
ntmax)
210 frcs => frzl_array(:,:,:,
rcs)
212 flss => frzl_array(:,:,:,
zss+2*
ntmax)
216 ALLOCATE (work1(nsz,12), temp1(nsz), temp3(nsz), stat=i)
217 IF (i .ne. 0) stop
'Allocation error in VMEC tomnspa'
219 ioff = lbound(frsc,2)
220 joff = lbound(frsc,3)
223 IF (
ivac .lt. 1) jmax = ns1
238 temp1(:) = armn(:,i,mparity) &
240 +
xmpq(m,1)*arcon(:,i,mparity)
243 temp3(:) = azmn(:,i,mparity) &
245 +
xmpq(m,1)*azcon(:,i,mparity)
248 work1(:,3) = work1(:,3) + temp1(:)*sinmui(i,m) + brmn(:,i,mparity)*cosmumi(i,m)
249 work1(:,5) = work1(:,5) + temp3(:)*cosmui(i,m) + bzmn(:,i,mparity)*sinmumi(i,m)
250 work1(:,9) = work1(:,9) + blmn(:,i,mparity)*sinmumi(i,m)
254 work1(:,1) = work1(:,1) + temp1(:)*cosmui(i,m) + brmn(:,i,mparity)*sinmumi(i,m)
255 work1(:,2) = work1(:,2) - crmn(:,i,mparity)*cosmui(i,m)
256 work1(:,4) = work1(:,4) - crmn(:,i,mparity)*sinmui(i,m)
257 work1(:,6) = work1(:,6) - czmn(:,i,mparity)*cosmui(i,m)
258 work1(:,7) = work1(:,7) + temp3(:)*sinmui(i,m) + bzmn(:,i,mparity)*cosmumi(i,m)
259 work1(:,8) = work1(:,8) - czmn(:,i,mparity)*sinmui(i,m)
260 work1(:,10) = work1(:,10) - clmn(:,i,mparity)*cosmui(i,m)
261 work1(:,11) = work1(:,11) + blmn(:,i,mparity)*cosmumi(i,m)
262 work1(:,12) = work1(:,12) - clmn(:,i,mparity)*sinmui(i,m)
277 frsc(j2:jmax,ni,mj) = frsc(j2:jmax,ni,mj) + work1(j2l:jmaxl,3)*cosnv(k,n)
278 fzcc(j2:jmax,ni,mj) = fzcc(j2:jmax,ni,mj) + work1(j2l:jmaxl,5)*cosnv(k,n)
279 flcc(jl:ns,ni,mj) = flcc(jl:ns,ni,mj) + work1(jll:nsl,9)*cosnv(k,n)
283 frsc(j2:jmax,ni,mj) = frsc(j2:jmax,ni,mj) + work1(j2l:jmaxl,4)*sinnvn(k,n)
284 fzcc(j2:jmax,ni,mj) = fzcc(j2:jmax,ni,mj) + work1(j2l:jmaxl,6)*sinnvn(k,n)
285 frcs(j2:jmax,ni,mj) = frcs(j2:jmax,ni,mj) + work1(j2l:jmaxl,1)*sinnv(k,n) &
286 + work1(j2l:jmaxl,2)*cosnvn(k,n)
287 fzss(j2:jmax,ni,mj) = fzss(j2:jmax,ni,mj) + work1(j2l:jmaxl,7)*sinnv(k,n) &
288 + work1(j2l:jmaxl,8)*cosnvn(k,n)
289 flcc(jl:ns,ni,mj) = flcc(jl:ns,ni,mj) + work1(jll:nsl,10)*sinnvn(k,n)
290 flss(jl:ns,ni,mj) = flss(jl:ns,ni,mj) + work1(jll:nsl,11)*sinnv(k,n) &
291 + work1(jll:nsl,12)*cosnvn(k,n)
296 DEALLOCATE (work1, temp1, temp3)
300 call add_real_3d(
"frsc", ns, ntor1, mpol, frsc)
301 call add_real_3d(
"fzcc", ns, ntor1, mpol, fzcc)
302 call add_real_3d(
"flcc", ns, ntor1, mpol, flcc)
305 call add_real_3d(
"frcs", ns, ntor1, mpol, frcs)
306 call add_real_3d(
"fzss", ns, ntor1, mpol, fzss)
307 call add_real_3d(
"flss", ns, ntor1, mpol, flss)
309 call add_null(
"frcs")
310 call add_null(
"fzss")
311 call add_null(
"flss")
real(rprec), dimension(0:mpol1d, 3) xmpq
spectral condensation weighting factors