VMEC 8.52
3D Equilibrium solver with nested flux surfaces.
Loading...
Searching...
No Matches
allocate_funct3d.f90
Go to the documentation of this file.
1
3
7 USE vmec_main
8 USE realspace
9 USE vforces
10 IMPLICIT NONE
11
12 INTEGER :: istat1, ndim, ndim2
13
14 ndim = 1+nrzt ! TODO: why +1? some hidden scalar variable stored in the last entry?
15 ndim2 = 2*ndim
16
18
19 ALLOCATE (armn(ndim2), azmn(ndim2), brmn(ndim2), bzmn(ndim2), &
20 crmn(ndim2), czmn(ndim2), blmn(ndim2), clmn(ndim2), &
21 r1(nrzt,0:1), ru(nrzt,0:1), rv(nrzt,0:1), &
22 z1(nrzt,0:1), zu(nrzt,0:1), zv(nrzt,0:1), &
23 rcon(nrzt,0:1), zcon(nrzt,0:1), ru0(ndim), zu0(ndim), &
24 rcon0(ndim), zcon0(ndim), guu(ndim), guv(ndim), gvv(ndim), &
25 brmn_con(ndim2), bzmn_con(ndim2), &
26 gcon(ndim), stat=istat1)
27 IF (istat1.ne.0) stop 'allocation error #1 in allocate_funct3d'
28 armn=0; azmn=0; brmn=0; bzmn=0; crmn=0; czmn=0; blmn=0; clmn=0
29 r1=0; ru=0; rv=0; z1=0; zu=0; zv=0; rcon=0; zcon=0
30 ru0=0; zu0=0; guu=0; guv=0; gvv=0
32
33 ALLOCATE (extra1(ndim,0:1), stat=istat1)
34 IF (istat1.ne.0) stop 'allocation error #3 in allocate_funct3d'
35
36 extra1=0
37
38 IF (lasym) THEN
39 ALLOCATE (extra2(ndim,0:1), extra3(ndim,0:1), extra4(ndim,0:1),stat=istat1)
40 ELSE
41 ALLOCATE (extra2(ndim, 1), extra3(ndim, 1), extra4(ndim, 1), stat=istat1)
42 END IF
43 IF (istat1.ne.0) stop 'allocation error #3 in allocate_funct3d'
44
45 extra2=0
46 extra3=0
47 extra4=0
48
49 ! Pointer alias assignments
50 ! NOTE: In FORCES, X_e(nrzt+1) overlaps X_o(1), which should never be used...
51 armn_e => armn(:ndim)
52 armn_o => armn(ndim:)
53 armn(:ndim2) = zero
54
55 brmn_e => brmn(:ndim)
56 brmn_o => brmn(ndim:)
57 brmn(:ndim2) = zero
58
59 azmn_e => azmn(:ndim)
60 azmn_o => azmn(ndim:)
61 azmn(:ndim2) = zero
62
63 bzmn_e => bzmn(:ndim)
64 bzmn_o => bzmn(ndim:)
65 bzmn(:ndim2) = zero
66
67 crmn_e => crmn(:ndim)
68 crmn_o => crmn(ndim:)
69 crmn(:ndim2) = zero
70
71 czmn_e => czmn(:ndim)
72 czmn_o => czmn(ndim:)
73 czmn(:ndim2) = zero
74
75 blmn_e => blmn(:ndim)
76 blmn_o => blmn(ndim:)
77 blmn(:ndim2) = zero
78
79 clmn_e => clmn(:ndim)
80 clmn_o => clmn(ndim:)
81 clmn(:ndim2) = zero
82
83 rcon0(:ndim) = zero
84 zcon0(:ndim) = zero
85
86 brmn_e_con => brmn_con(:ndim)
87 brmn_o_con => brmn_con(ndim:)
88 brmn_con(:ndim2) = zero
89
90 bzmn_e_con => bzmn_con(:ndim)
91 bzmn_o_con => bzmn_con(ndim:)
92 bzmn_con(:ndim2) = zero
93
94END SUBROUTINE allocate_funct3d
subroutine allocate_funct3d
allocate arrays required in funct3d()
subroutine free_mem_funct3d
Free memory required by funct3d()
real(rprec), dimension(:,:), allocatable rv
Definition realspace.f90:10
real(rprec), dimension(:), allocatable zu0
, even-m and odd-m added together appropriately
Definition realspace.f90:25
real(rprec), dimension(:,:), allocatable zv
Definition realspace.f90:13
real(rprec), dimension(:,:), allocatable zcon
spectral condensation term in
Definition realspace.f90:16
real(rprec), dimension(:,:), allocatable ru
Definition realspace.f90:9
real(rprec), dimension(:), allocatable gvv
metric element
Definition realspace.f90:22
real(rprec), dimension(:,:), allocatable, target extra3
Definition realspace.f90:38
real(rprec), dimension(:), allocatable guv
metric element
Definition realspace.f90:21
real(rprec), dimension(:,:), allocatable, target extra4
Definition realspace.f90:39
real(rprec), dimension(:,:), allocatable, target extra1
Definition realspace.f90:36
real(rprec), dimension(:), allocatable ru0
, even-m and odd-m added together appropriately
Definition realspace.f90:24
real(rprec), dimension(:), allocatable gcon
spectral condensation force; "alias force"
Definition realspace.f90:27
real(rprec), dimension(:,:), allocatable, target z1
Definition realspace.f90:11
real(rprec), dimension(:,:), allocatable rcon
spectral condensation term in
Definition realspace.f90:15
real(rprec), dimension(:), allocatable rcon0
spectral condensation term in at start of current multi-grid iteration
Definition realspace.f90:17
real(rprec), dimension(:,:), allocatable r1
Definition realspace.f90:8
real(rprec), dimension(:), allocatable guu
metric element
Definition realspace.f90:20
real(rprec), dimension(:,:), allocatable, target extra2
Definition realspace.f90:37
real(rprec), dimension(:), allocatable zcon0
spectral condensation term in at start of current multi-grid iteration
Definition realspace.f90:18
real(rprec), dimension(:,:), allocatable zu
Definition realspace.f90:12
real(rprec), dimension(:), pointer bzmn_e_con
Definition vforces.f90:43
real(rprec), dimension(:), allocatable, target clmn
Definition vforces.f90:17
real(rprec), dimension(:), allocatable, target azmn
Definition vforces.f90:12
real(rprec), dimension(:), pointer azmn_o
Definition vforces.f90:27
real(rprec), dimension(:), allocatable, target brmn_con
Definition vforces.f90:39
real(rprec), dimension(:), allocatable, target brmn
Definition vforces.f90:9
real(rprec), dimension(:), pointer bzmn_e
Definition vforces.f90:28
real(rprec), dimension(:), allocatable, target bzmn_con
Definition vforces.f90:40
real(rprec), dimension(:), pointer bzmn_o_con
Definition vforces.f90:44
real(rprec), dimension(:), pointer clmn_o
Definition vforces.f90:36
real(rprec), dimension(:), allocatable, target blmn
Definition vforces.f90:16
real(rprec), dimension(:), allocatable, target armn
Definition vforces.f90:8
real(rprec), dimension(:), pointer brmn_e
Definition vforces.f90:21
real(rprec), dimension(:), pointer brmn_e_con
Definition vforces.f90:41
real(rprec), dimension(:), pointer azmn_e
Definition vforces.f90:26
real(rprec), dimension(:), pointer czmn_e
Definition vforces.f90:30
real(rprec), dimension(:), pointer brmn_o_con
Definition vforces.f90:42
real(rprec), dimension(:), pointer brmn_o
Definition vforces.f90:22
real(rprec), dimension(:), pointer clmn_e
Definition vforces.f90:35
real(rprec), dimension(:), pointer bzmn_o
Definition vforces.f90:29
real(rprec), dimension(:), pointer blmn_e
Definition vforces.f90:33
real(rprec), dimension(:), pointer crmn_e
Definition vforces.f90:23
real(rprec), dimension(:), pointer czmn_o
Definition vforces.f90:31
real(rprec), dimension(:), allocatable, target crmn
Definition vforces.f90:10
real(rprec), dimension(:), allocatable, target czmn
Definition vforces.f90:14
real(rprec), dimension(:), pointer armn_o
Definition vforces.f90:20
real(rprec), dimension(:), pointer crmn_o
Definition vforces.f90:24
real(rprec), dimension(:), pointer armn_e
Definition vforces.f90:19
real(rprec), dimension(:), allocatable, target bzmn
Definition vforces.f90:13
real(rprec), dimension(:), pointer blmn_o
Definition vforces.f90:34