VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
free_mem_ns.f90
Go to the documentation of this file.
1
3
6SUBROUTINE free_mem_ns
7 USE vmec_main
8 USE realspace
9 USE vforces
10 USE xstuff
11
12 IMPLICIT NONE
13
14 INTEGER :: istat1 = 0, istat2 = 0, istat3 = 0, istat4 = 0, &
15 istat5 = 0, istat6 = 0, istat7 = 0, istat8 = 0, &
16 istat9 = 0, istat10 = 0
17
18 IF (ALLOCATED(phip)) &
19 DEALLOCATE (phip, chip, shalf, sqrts, wint, stat=istat3)
20
21 IF (ALLOCATED(ireflect)) &
22 DEALLOCATE (ireflect, stat=istat4)
23
24 IF (ALLOCATED(ard)) &
25 DEALLOCATE (ard,arm,brd,brm,crd,azd,azm,bzd,bzm, sm,sp, bmin, bmax,stat=istat7)
26
27 IF (ALLOCATED(iotaf)) &
28 DEALLOCATE (iotaf,mass,phi,presf,jcuru,jcurv,jdotb,buco,bvco, &
29 bucof, bvcof, chi, &
33 chipf, icurv, vpphi, presgrad, bdamp, stat=istat8)
34
35 IF (ALLOCATED(gc)) then
36 DEALLOCATE (gc, gc_con, gc_mhd, xsave, xstore, xcdot, stat=istat10)
37 end if
38
39 IF (ALLOCATED(xc)) then
40 DEALLOCATE (xc, scalxc)
41 end if
42
43 IF (istat1.ne.0 .or. istat2.ne.0 .or. istat3.ne.0 .or. &
44 istat4.ne.0 .or. istat5.ne.0 .or. istat6.ne.0 .or. &
45 istat7.ne.0 .or. istat8.ne.0 .or. istat9.ne.0 .or. istat10.ne.0) THEN
46
47 print *,' deallocation problem in free_mem_ns'
48 print *,' istat1 = ',istat1,' istat2 = ',istat2
49 print *,' istat3 = ',istat3,' istat4 = ',istat4
50 print *,' istat5 = ',istat5,' istat6 = ',istat6
51 print *,' istat7 = ',istat7,' istat8 = ',istat8
52 print *,' istat9 = ',istat9,' istat10= ',istat10
53 ENDIF
54
55END SUBROUTINE free_mem_ns
subroutine free_mem_ns
Free memory depending on the number of flux surfaces ns.
real(rprec), dimension(:), allocatable wint
two-dimensional array for normalizing angle integrations
Definition realspace.f90:34
real(rprec), dimension(:), allocatable sqrts
sqrt(s), two-dimensional array on full-grid
Definition realspace.f90:32
real(rprec), dimension(:), allocatable chip
radial derivative of chi/(2*pi) on half-grid
Definition realspace.f90:30
real(rprec), dimension(:), allocatable shalf
sqrt(s) ,two-dimensional array on half-grid
Definition realspace.f90:31
real(rprec), dimension(:), allocatable phip
radial derivative of phi/(2*pi) on half-grid
Definition realspace.f90:29
real(rprec), dimension(:), allocatable dlam
Definition vmec_main.f90:15
real(rprec), dimension(:), allocatable equif
radial force balance error: grad(p) - <j x B>
Definition vmec_main.f90:45
real(rprec), dimension(:,:), allocatable ygeo
Definition vmec_main.f90:53
real(rprec), dimension(:), allocatable vp
radial derivative of enclosed volume
Definition vmec_main.f90:56
real(rprec), dimension(:), allocatable bvco
enclosed poloidal current profile
Definition vmec_main.f90:43
real(rprec), dimension(:), allocatable buco
enclosed toroidal current profile
Definition vmec_main.f90:42
real(rprec), dimension(:), allocatable crd
Definition vmec_main.f90:24
real(rprec), dimension(:), allocatable sp
shalf(i+1)/sfull(i)
Definition vmec_main.f90:26
real(rprec), dimension(:,:), allocatable brd
Definition vmec_main.f90:18
real(rprec), dimension(:), allocatable jcuru
poloidal current density
Definition vmec_main.f90:39
real(rprec), dimension(:,:), allocatable azd
Definition vmec_main.f90:20
real(rprec), dimension(:,:), allocatable ytrian
Definition vmec_main.f90:51
real(rprec), dimension(:,:,:,:), allocatable faclam
Definition vmec_main.f90:28
real(rprec), dimension(:,:), allocatable bmax
Definition vmec_main.f90:32
real(rprec), dimension(:), allocatable chips
poloidal flux (same as chip), one-dimensional array
Definition vmec_main.f90:67
real(rprec), dimension(:), allocatable presf
pressure profile on full-grid, mass/phip**gamma
Definition vmec_main.f90:66
real(rprec), dimension(:), allocatable bdamp
radial mesh-blending factor
Definition vmec_main.f90:27
real(rprec), dimension(:), allocatable phi
toroidal magnetic flux
Definition vmec_main.f90:37
real(rprec), dimension(:), allocatable overr
Definition vmec_main.f90:54
real(rprec), dimension(:), allocatable sm
shalf(i)/sfull(i)
Definition vmec_main.f90:25
real(rprec), dimension(:,:), allocatable bmin
Definition vmec_main.f90:31
real(rprec), dimension(:,:), allocatable brm
Definition vmec_main.f90:19
real(rprec), dimension(:), allocatable jdotb
Definition vmec_main.f90:41
real(rprec), dimension(:,:), allocatable bzd
Definition vmec_main.f90:22
real(rprec), dimension(:,:), allocatable bzm
Definition vmec_main.f90:23
real(rprec), dimension(:,:), allocatable yinden
Definition vmec_main.f90:50
real(rprec), dimension(:), allocatable bdotgradv
Definition vmec_main.f90:44
real(rprec), dimension(:), allocatable clam
Definition vmec_main.f90:14
real(rprec), dimension(:), allocatable specw
spectral width (diagnostic)
Definition vmec_main.f90:46
real(rprec), dimension(:), allocatable iotaf
rotational transform (full grid)
Definition vmec_main.f90:34
real(rprec), dimension(:,:), allocatable yshift
Definition vmec_main.f90:52
real(rprec), dimension(:), allocatable psi
Definition vmec_main.f90:48
real(rprec), dimension(:,:), allocatable ard
Definition vmec_main.f90:16
real(rprec), dimension(:), allocatable pres
pressure profile
Definition vmec_main.f90:55
real(rprec), dimension(:), allocatable chipf
radial derivative of poloidal magnetic flux (full grid)
Definition vmec_main.f90:36
real(rprec), dimension(:), allocatable jpar2
Definition vmec_main.f90:57
real(rprec), dimension(:), allocatable presgrad
pressure gradient: dp/ds
Definition vmec_main.f90:61
integer, dimension(:), allocatable ireflect
two-dimensional array for computing 2pi-v angle
real(rprec), dimension(:,:), allocatable arm
Definition vmec_main.f90:17
real(rprec), dimension(:), allocatable bvcof
Definition vmec_main.f90:63
real(rprec), dimension(:), allocatable blam
Definition vmec_main.f90:13
real(rprec), dimension(:), allocatable chi
poloidal magnetic flux
Definition vmec_main.f90:64
real(rprec), dimension(:), allocatable phips
toroidal flux (same as phip), one-dimensional array
Definition vmec_main.f90:68
real(rprec), dimension(:), allocatable mass
mass profile on half-grid
Definition vmec_main.f90:71
real(rprec), dimension(:), allocatable bdotb
Definition vmec_main.f90:59
real(rprec), dimension(:), allocatable bucof
Definition vmec_main.f90:62
real(rprec), dimension(:), allocatable beta_vol
Definition vmec_main.f90:38
real(rprec), dimension(:), allocatable iotas
rotational transform , on half radial mesh
Definition vmec_main.f90:69
real(rprec), dimension(:,:), allocatable azm
Definition vmec_main.f90:21
real(rprec), dimension(:), allocatable jperp2
Definition vmec_main.f90:58
real(rprec), dimension(:), allocatable phipf
radial derivative of toroidal magnetic flux (full grid)
Definition vmec_main.f90:35
real(rprec), dimension(:), allocatable tcon
constraint-force multiplier
Definition vmec_main.f90:47
real(rprec), dimension(:,:), allocatable yellip
Definition vmec_main.f90:49
real(rprec), dimension(:), allocatable icurv
(-)toroidal current inside flux surface (vanishes like s)
Definition vmec_main.f90:70
real(rprec), dimension(:), allocatable vpphi
Definition vmec_main.f90:60
real(rprec), dimension(:), allocatable jcurv
toroidal current density
Definition vmec_main.f90:40
real(rprec), dimension(:), allocatable gc_mhd
Definition xstuff.f90:37
real(rprec), dimension(:), allocatable gc_con
Definition xstuff.f90:37
real(rprec), dimension(:), allocatable gc
stacked array of R, Z, Lambda Spectral force coefficients (see above for stack order)
Definition xstuff.f90:37
real(rprec), dimension(:), allocatable, target xc
stacked array of scaled R, Z, Lambda Fourier coefficients (see above for stack order)
Definition xstuff.f90:40
real(rprec), dimension(:), allocatable xsave
Definition xstuff.f90:45
real(rprec), dimension(:), allocatable scalxc
Definition xstuff.f90:50
real(rprec), dimension(:), allocatable xcdot
"velocity": change of Fourier coefficients per time step
Definition xstuff.f90:43
real(rprec), dimension(:), allocatable xstore
backup copy of last-known-good xc
Definition xstuff.f90:48