12SUBROUTINE freeb_data (rmnc, zmns, rmns, zmnc, bmodmn, bmodmn1)
21 REAL(rprec),
DIMENSION(mnmax) :: rmnc, zmns, rmns, zmnc, bmodmn, bmodmn1
23 INTEGER :: iprint, nzskip, l, k, lk, mn, &
24 mn0, n, nedge, iu, iv, nl, lkr
25 REAL(rprec) :: zeta, potsin, potcos
26 REAL(rprec),
ALLOCATABLE,
DIMENSION(:) :: rb, phib, zb
28 logical :: dbgout_active
32 IF (
ivac.le.0 .or. .not.lfreeb)
RETURN
35 ALLOCATE (rb(2*nznt), phib(2*nznt), zb(2*nznt), stat=l)
36 IF (l .ne. 0) stop
'allocation error in freeb_data'
43 zeta = (twopi*(iv-1))/(nzeta*nfp)
45 lk = iv + nzeta*(iu-1)
49 rb(lk) =
r1(nl,0) +
r1(nl,1)
51 zb(lk) =
z1(nl,0) +
z1(nl,1)
54 IF (.not.lasym .and. (iu.ne.1 .and. iu.ne.ntheta2))
THEN
71 DEALLOCATE (rb, phib, zb, stat=l)
81750
FORMAT(/,3x,
'NF*PHI',7x,
' Rb ',8x,
' Zb ',&
82 6x,
'BSQMHDI',5x,
'BSQVACI', &
83 5x,
'BSQMHDF',5x,
'BSQVACF',/)
84 DO l = 1, nzeta, nzskip
85 zeta = (360.0_dp*(l - 1))/nzeta
88 lk = l + nzeta*(k - 1)
89 WRITE (nthreed, 770) zeta, rb(lk), zb(lk), &
91770
FORMAT(1p,e10.2,6e12.4)
97760
FORMAT(/,3x,
'NF*PHI',7x,
' Rb ',8x,
' Zb ',&
98 6x,
'BR', 8x,
'BPHI', 6x,
'BZ', &
99 8x,
'BRv',7x,
'BPHIv',5x,
'BZv',/)
100 DO l = 1, nzeta, nzskip
101 zeta = (360.0_dp*(l - 1))/nzeta
103 lk = l + nzeta*(k - 1)
104 WRITE (nthreed, 780) zeta, rb(lk), zb(lk), &
107780
FORMAT(1p,e10.2,2e12.4,6e10.2)
111 if (dbgout_active)
then
113 call add_real_2d(
"rb", nzeta, ntheta3, rb)
114 call add_real_2d(
"phib", nzeta, ntheta3, phib)
115 call add_real_2d(
"zb", nzeta, ntheta3, zb)
117 call add_real_2d(
"bsqmhdi", nzeta, ntheta3,
bsqsav(:,1))
118 call add_real_2d(
"bsqvaci", nzeta, ntheta3,
bsqsav(:,2))
119 call add_real_2d(
"bsqmhdf", nzeta, ntheta3,
bsqsav(:,3))
120 call add_real_2d(
"bsqvacf", nzeta, ntheta3,
bsqvac)
122 call add_real_2d(
"bredge", nzeta, ntheta3,
bredge)
123 call add_real_2d(
"bpedge", nzeta, ntheta3,
bpedge)
124 call add_real_2d(
"bzedge", nzeta, ntheta3,
bzedge)
126 call add_real_2d(
"brv", nzeta, ntheta2,
brv)
127 call add_real_2d(
"bphiv", nzeta, ntheta2,
bphiv)
128 call add_real_2d(
"bzv", nzeta, ntheta2,
bzv)
138900
FORMAT(//,3x,
'nb',2x,
'mb',&
139 6x,
'rbc',9x,
'zbs',9x,
'rbs',9x,
'zbc', &
140 6x,
'vacpot_s', 4x,
'vacpot_c', &
141 2x,
'|B|_c(s=.5)',1x,
'|B|_c(s=1.)'/)
146 IF ( (nint(xnpot(mn0)).eq.nint(xn(mn))) .and. &
147 (nint(xmpot(mn0)).eq.nint(xm(mn))) )
THEN
153 WRITE (nthreed, 910) nint(xn(mn)/nfp), nint(xm(mn)), &
154 rmnc(mn), zmns(mn), rmns(mn), zmnc(mn), &
156 bmodmn(mn), bmodmn1(mn)
157910
FORMAT(i5,i4,1p,10e12.4)
162800
FORMAT(//,3x,
'nb',2x,
'mb', &
165 2x,
'|B|_c(s=.5)',1x,
'|B|_c(s=1.)'/)
169 IF ( (nint(xnpot(mn0)).eq.nint(xn(mn))) .and. &
170 (nint(xmpot(mn0)).eq.nint(xm(mn))) )
THEN
175 WRITE (nthreed, 810) nint(xn(mn)/nfp), nint(xm(mn)), &
176 rmnc(mn), zmns(mn), &
178 bmodmn(mn), bmodmn1(mn)
179810
FORMAT(i5,i4,1p,7e12.4)
185 if (dbgout_active)
then
subroutine freeb_data(rmnc, zmns, rmns, zmnc, bmodmn, bmodmn1)
Write out edge values of fields.
logical function open_dbg_context(context_name, repetition, id)
check if any output is desired for the current iteration check if the given context should be openend...
real(rprec), dimension(:), allocatable bredge
integer ivac
counts number of free-boundary iterations
real(rprec), dimension(:,:), allocatable bsqsav
real(rprec), dimension(:), allocatable bpedge
real(rprec), dimension(:), allocatable bzedge