VMEC
8.52
3D Equilibrium solver with nested flux surfaces.
Toggle main menu visibility
Loading...
Searching...
No Matches
getfsq.f90
Go to the documentation of this file.
1
!> \file
2
!> \brief Compute total force residual on flux surfaces.
3
4
!> \brief Compute total force residual on flux surfaces.
5
!>
6
!> @param gcr \f$R\f$-component of force
7
!> @param gcz \f$Z\f$-component of force
8
!> @param gnormr normalized total force residual in \f$R\f$
9
!> @param gnormz normalized total force residual in \f$Z\f$
10
!> @param gnorm normalization factor for forces
11
!> @param medge =0: exclude contribution from LCFS; =1: include LCFS contribution
12
SUBROUTINE
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
31
END SUBROUTINE
getfsq
getfsq
subroutine getfsq(gcr, gcz, gnormr, gnormz, gnorm, medge)
Compute total force residual on flux surfaces.
Definition
getfsq.f90:13
vmec_main
Definition
vmec_main.f90:2
vmec_params
Definition
vmec_params.f90:2
vmec_params::ntmax
integer ntmax
number of contributing Fourier basis function (can be 1, 2 or 4); assigned in read_indata()
Definition
vmec_params.f90:43
src
getfsq.f90
Generated on
for VMEC by
1.17.0