Skip to content

Commit

Permalink
add dbgout for analyt
Browse files Browse the repository at this point in the history
  • Loading branch information
jons-pf committed Oct 21, 2024
1 parent 90ed3c3 commit 8384b72
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 11 deletions.
38 changes: 28 additions & 10 deletions Sources/NESTOR_vacuum/analyt.f
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ SUBROUTINE analyt (grpmn, bvec, ivacskip, ndim)
USE vacmod
USE parallel_include_module
USE timer_sub
USE dbgout
USE vmec_main, ONLY: num_eqsolve_retries

IMPLICIT NONE
C-----------------------------------------------
C D u m m y A r g u m e n t s
Expand Down Expand Up @@ -74,9 +77,9 @@ SUBROUTINE analyt (grpmn, bvec, ivacskip, ndim)
! RA1P(M):Coefficient of Tl+(-) in eq (A17)
!
DO k = nuv3min, nuv3max
adp(k) = guu_b(k) + guv_b(k) + gvv_b(k)
adm(k) = guu_b(k) - guv_b(k) + gvv_b(k)
cma(k) = gvv_b(k) - guu_b(k)
adp(k) = guu_b(k) + guv_b(k) + gvv_b(k)
adm(k) = guu_b(k) - guv_b(k) + gvv_b(k)
cma(k) = gvv_b(k) - guu_b(k)
sqrtc(k) = two*SQRT(gvv_b(k))
sqrta(k) = two*SQRT(guu_b(k))
END DO
Expand Down Expand Up @@ -119,11 +122,11 @@ SUBROUTINE analyt (grpmn, bvec, ivacskip, ndim)
sqad2u(k) = SQRT(adm(k))
tlp1(k) = 0
tlm1(k) = 0
tlp(k) = one/sqad1u(k)*log((sqad1u(k)*sqrtc(k)
1 + adp(k) + cma(k))/(sqad1u(k)*sqrta(k)
tlp(k) = one/sqad1u(k)*log((sqad1u(k)*sqrtc(k)
1 + adp(k) + cma(k))/(sqad1u(k)*sqrta(k)
2 - adp(k) + cma(k)))
tlm(k) = one/sqad2u(k)*log((sqad2u(k)*sqrtc(k)
1 + adm(k) + cma(k))/(sqad2u(k)*sqrta(k)
tlm(k) = one/sqad2u(k)*log((sqad2u(k)*sqrtc(k)
1 + adm(k) + cma(k))/(sqad2u(k)*sqrta(k)
2 - adm(k) + cma(k)))
tlpm(k) = tlp(k) + tlm(k)
END DO
Expand All @@ -144,10 +147,10 @@ SUBROUTINE analyt (grpmn, bvec, ivacskip, ndim)
IF (ivacskip .eq. 0) THEN
DO k = nuv3min,nuv3max
slp(k) = (r1p(k)*fl + ra1p(k))*tlp(k) + r0p(k)*fl*tlp1(k)
1 - (r1p(k) + r0p(k))/sqrtc(k)
1 - (r1p(k) + r0p(k))/sqrtc(k)
2 + sign1*(r0p(k) - r1p(k))/sqrta(k)
slm(k) = (r1m(k)*fl + ra1m(k))*tlm(k) + r0m(k)*fl*tlm1(k)
1 - (r1m(k) + r0m(k))/sqrtc(k)
1 - (r1m(k) + r0m(k))/sqrtc(k)
2 + sign1*(r0m(k) - r1m(k))/sqrta(k)
slpm(k) = slp(k) + slm(k)
END DO
Expand All @@ -166,7 +169,7 @@ SUBROUTINE analyt (grpmn, bvec, ivacskip, ndim)
END IF

IF (cmns(l,m,n) .eq. zero) CYCLE

IF (n.eq.0 .or. m.eq.0) THEN
!
! 1. n = 0 and m >= 0 OR n > 0 and m = 0
Expand Down Expand Up @@ -205,6 +208,21 @@ SUBROUTINE analyt (grpmn, bvec, ivacskip, ndim)

END DO LLOOP

if (open_dbg_context("vac1n_analyt", num_eqsolve_retries)) then

! (mf+1)x(2*nf+1)x(ndim: 1 or 2)
call add_real_2d("bvec", mf1, nf1, bvec)

if (ivacskip .eq. 0) then
! missing dim: (ndim: 1 or 2)
call add_real_4d("grpmn", mf1, nf1, nv, nu3, grpmn)
else
call add_null("grpmn")
end if

call close_dbg_out()
end if

DEALLOCATE (r0p, r1p, r0m, r1m, sqrtc, sqrta, tlp2, tlp1,
1 tlp, tlm2, tlm1, tlm, adp, adm, cma, ra1p, ra1m, slm,
2 slp, tlpm, slpm, delt1u, azp1u, azm1u, cma11u, sqad1u,
Expand Down
1 change: 0 additions & 1 deletion Sources/NESTOR_vacuum/precal.f
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ SUBROUTINE precal (wint)
call close_dbg_out()
end if


numjs_vac=nuv3max-nuv3min+1
! blksize_scp=mnpd2

Expand Down

0 comments on commit 8384b72

Please sign in to comment.