src/equilibrium.f90: pol_curr return derivative wrt ψ_n

This commit is contained in:
Michele Guerini Rocco 2023-10-27 00:58:34 +02:00
parent 31a7b95fe1
commit 8d86d70e91
Signed by: rnhmjoj
GPG Key ID: BFBAF4C975F76450
2 changed files with 8 additions and 8 deletions

View File

@ -864,7 +864,7 @@ contains
subroutine pol_curr(psi_n, fpol, dfpol)
! Computes the poloidal current function F(ψ_n)
! and (optionally) its derivative dF/ given ψ_n.
! and (optionally) its derivative dF/_n given ψ_n.
use gray_params, only : iequil
implicit none
@ -883,7 +883,7 @@ contains
! Numerical data
if(psi_n <= 1 .and. psi_n >= 0) then
fpol = fpol_spline%eval(psi_n)
if (present(dfpol)) dfpol = fpol_spline%deriv(psi_n) / psia
if (present(dfpol)) dfpol = fpol_spline%deriv(psi_n)
else
fpol = fpolas
if (present(dfpol)) dfpol = 0

View File

@ -1355,12 +1355,12 @@ contains
bv(3)=bvc(3)
! dbvcdc(iv,jv) = d Bcil(iv) / dxvcil(jv)
dbvcdc(1,1) = -ddpsidrz*psia/rrm - brr/rrm
dbvcdc(2,1) = dfpv*dpsidr*psia/rrm - bphi/rrm
dbvcdc(3,1) = ddpsidrr*psia/rrm - bzz/rrm
dbvcdc(1,3) = -ddpsidzz*psia/rrm
dbvcdc(2,3) = dfpv*dpsidz*psia/rrm
dbvcdc(3,3) = ddpsidrz*psia/rrm
dbvcdc(1,1) = -ddpsidrz*psia/rrm - brr/rrm
dbvcdc(1,3) = -ddpsidzz*psia/rrm
dbvcdc(2,1) = dfpv*dpsidr/rrm - bphi/rrm
dbvcdc(2,3) = dfpv*dpsidz/rrm
dbvcdc(3,1) = +ddpsidrr*psia/rrm - bzz/rrm
dbvcdc(3,3) = +ddpsidrz*psia/rrm
! dbvdc(iv,jv) = d Bcart(iv) / dxvcil(jv)
dbvdc(1,1) = dbvcdc(1,1)*csphi - dbvcdc(2,1)*snphi