VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
getfsq.f90
Go to the documentation of this file.
1
3
12SUBROUTINE getfsq(gcr, gcz, gnormr, gnormz, gnorm, medge)
13 USE vmec_main, ONLY: rprec, ns, ns1, mnsize, dp
14 USE vmec_params, ONLY: ntmax
15 IMPLICIT NONE
16
17 INTEGER, INTENT(in) :: medge
18 REAL(rprec), INTENT(out) :: gnormr, gnormz
19 REAL(rprec), INTENT(in) :: gnorm
20 REAL(rprec), DIMENSION(ns,mnsize*ntmax), INTENT(in) :: gcr, gcz
21
22 INTEGER :: jsmax
23
24 ! ns1 is ns-1
25 ! so if medge==0, exclude contribution from LCFS
26 ! and if medge==1, also take contribution from LCFS into account
27 jsmax = ns1 + medge
28 gnormr = gnorm * sum(gcr(:jsmax,:)**2.0_dp)
29 gnormz = gnorm * sum(gcz(:jsmax,:)**2.0_dp)
30
31END SUBROUTINE getfsq
subroutine getfsq(gcr, gcz, gnormr, gnormz, gnorm, medge)
Compute total force residual on flux surfaces.
Definition getfsq.f90:13
integer ntmax
number of contributing Fourier basis function (can be 1, 2 or 4); assigned in read_indata()