Skip to content

Commit

Permalink
add dbgout for multigrid result
Browse files Browse the repository at this point in the history
  • Loading branch information
jons-pf committed Oct 21, 2024
1 parent 524759b commit a0c70f0
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions Sources/TimeStep/runvmec.f
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,28 @@ END SUBROUTINE initialize_radial
& ier_flag .ne. more_iter_flag) EXIT
IF (numsteps .GT. 0 .or. ns_index .GT. 0) EXIT

! If this point is reached, the current multi-grid step should have properly converged.
! Now dump the current state vector for debugging.
if (open_dbg_context("multigrid_result", jacob_off)) then

call add_int("ns", nsval)
call add_int("iter2", iter2)
call add_int("ncurr", ncurr)
call add_real("phiedge", phiedge)
call add_int("ntmax", ntmax)

call add_real_1d("pres", ns-1, pres(2:ns))
call add_real_1d("iotas", ns-1, iotas(2:ns))
call add_real_1d("chips", ns-1, chips(2:ns))

call add_real_5d("xc", 3, ntmax, ns, ntor1, mpol, &
& pxc, order=(/ 3, 4, 5, 2, 1 /) )
call add_real_5d("scalxc", 3, ntmax, ns, ntor1, mpol, &
& pscalxc, order=(/ 3, 4, 5, 2, 1 /) )

call close_dbg_out()
end if

!
! give up if it refuses to converge, M.Drevlak
! it may help to end a vmec run in an optimization environment, if it
Expand Down

0 comments on commit a0c70f0

Please sign in to comment.