7 use mod_dat, only : errit, amix, niter, verbosity
9 use mod_mesh, only : psi, psiold, nr, np
18 logical,
intent(inout) :: first
20 real(r8),
intent(inout) :: a
21 real(r8),
intent(inout) :: xaxis
22 real(r8),
intent(inout) :: yaxis
23 real(r8),
intent(inout) :: rax, sax
25 real(r8),
intent(out) :: psaxis
26 integer(itm_i4),
intent(out) :: nax
29 integer(itm_i4) :: i, j
49 if (first) first = .false.
52 call
find_axis(psaxis, xaxis, yaxis, nax, rax, sax)
56 a = a / (1._r8 - psaxis)
59 write(iu6, *)
'iteration ', i
60 if (verbosity > 2)
then
61 write(iu6, 1) xaxis, yaxis
62 write(iu6, *)
'new A = ', a,
' psaxis = ', psaxis
65 1
format(
'magnetic axis : x = ', e14.6,
' y = ', e14.6)
69 if (amix /= 0._r8)
then
70 psi = (1._r8 - amix) * psi + amix * psiold
71 call
find_axis(psaxis, xaxis, yaxis, nax, rax, sax)
72 a = a / (1._r8 - psaxis)
79 residual = residual + abs(psi(j) - psiold(j))
81 residual = residual / dble(nr * np)
82 write(iu6, *)
'helena: residual = ', residual
83 if (residual < errit)
exit
85 if (verbosity > 0)
then
87 write(iu6, *)
'WARNING: inner loop not fully converged!'
89 stop
'not converging in fp_fdf_iteration'
95 write(*, *)
'iteration ', i,
' end'
100 if (standard_output)
write(out_he, 2) i, residual
102 2
format(
' residual after ', i3,
'iterations = ', es10.3)
subroutine dp_fdf_iteration(first, a, psaxis, xaxis, yaxis, nax, rax, sax)
subroutine normalize_psi(psaxis)
subroutine build_matrix(a, first)
subroutine find_axis(psaxis, xaxis, yaxis, nax, rax, sax)
subroutine gaussian_elimination(first)