ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
helena21itm.f90
Go to the documentation of this file.
1 subroutine helena21itm(equil_in,equil_out)
2 !------------------------------------------------------------------------
3 ! helena wrapper for HELENA2 (version helena21.f90)
4 !
5 ! uses ITM data structures, using an ITM standard equilibrium
6 ! for the input and output.
7 !
8 ! G. Huysmans, CEA Cadarache
9 ! Date : 24/6/2008
10 ! Status : in progress
11 !------------------------------------------------------------------------
12 
13 use euitm_schemas ! module containing the equilibrium type definitions
14 use itm_constants
15 use helena21_mod
16 implicit none
17 
18 type (type_equilibrium),pointer :: equil_in(:), equil_out(:)
19 
20 character*131 :: helena_par
21 integer :: nr_grid, np_grid, n_psi_out, n_tht_out, n_bnd, n_prof_in, iopt_p, iopt_f, i, j, nchi, node
22 real (r8) :: quad_u_in, quad_l_in, bgeo_in
23 real (r8), allocatable :: fraction_circ(:), surface_powers(:,:), surface_integrals(:,:)
24 real (r8), allocatable :: volume_powers(:,:), volume_integrals(:,:), moments(:,:), vprime(:), dpsi_drho(:)
25 integer :: n_var_surfaces, n_int_surfaces, n_var_volumes, n_int_volumes, n_moments
26 real (r8), allocatable :: rrflux(:,:),zzflux(:,:),psflux(:,:)
27 real (r8) :: amin_out, rgeo_out, zgeo_out, area_out, volume_out, betap_out, xip_out, xli_out, betat_out
28 real (r8) :: r_axis_out, z_axis_out, b_axis_out, psi_axis_out, psi_bnd_out, pi
29 integer :: ileft, iright
30 
31 write(*,*) '**********************************************'
32 write(*,*) '* HELENA_ITM (ALFA) *'
33 write(*,*) '**********************************************'
34 
35 pi = 2.e0_r8 * asin(1.e0_r8)
36 
37 if (.not. associated(equil_in)) then
38  write(*,*) equil_in%eqgeometry%a_minor
39  write(*,*) ' equil_in not defined'
40  return
41 endif
42 
43 nr_grid = nint(size(equil_in(1)%profiles_1d%psi)/2.0)
44 !nr_grid = 41
45 nr_grid = 101
46 np_grid = 33
47 !np_grid = 65
48 n_psi_out = size(equil_in(1)%profiles_1d%psi)
49 n_tht_out = size(equil_in(1)%eqgeometry%boundary(1)%r)
50 !n_psi_out = 41
51 !n_tht_out = 33
52 n_var_surfaces = 3 ! the number of variables with a power appearing in the integralsHELENA2
53 n_int_surfaces = 8 ! the number of different integrals
54 n_moments = 7
55 
56 n_bnd = 0
57 !if (associated(equil_in(1)%eqgeometry%boundary(1)%r)) then
58  n_bnd = size(equil_in(1)%eqgeometry%boundary(1)%r,1)
59  write(*,*) ' n_bnd : ',n_bnd
60 !endif
61 
62 
63 allocate(surface_powers(n_var_surfaces,n_int_surfaces), surface_integrals(n_psi_out,n_int_surfaces))
64 allocate(vprime(n_psi_out),dpsi_drho(n_psi_out))
65 
66 surface_powers(1:3,1) = (/ -2, 0, 0 /) ! R, B^2, grad(psi)
67 surface_powers(1:3,2) = (/ -2, 0, 2 /)
68 surface_powers(1:3,3) = (/ 0, 0, 2 /)
69 surface_powers(1:3,4) = (/ 0,-1, 0 /)
70 surface_powers(1:3,5) = (/ 0, 1, 0 /)
71 surface_powers(1:3,6) = (/ 0,-1, 2 /)
72 surface_powers(1:3,7) = (/ 0, 0, 1 /)
73 surface_powers(1:3,8) = (/ 0, 0, 0 /)
74 
75 n_var_volumes = 2 ! the number of variables with a power appearing in the integrals
76 n_int_volumes = 3 ! the number of different integrals
77 
78 allocate(volume_powers(n_var_volumes,n_int_volumes), volume_integrals(n_psi_out,n_int_volumes))
79 
80 volume_powers(1:2,1) = (/ 0, 0 /) ! Volume = Int(dV) = Int(R dA)
81 volume_powers(1:2,2) = (/ -1, 1 /) ! Toroidal_flux = Int(B / R dV)
82 volume_powers(1:2,3) = (/ -1, 0 /) ! Area = Int( 1/R dV)
83 
84 allocate(rrflux(4,n_psi_out*n_tht_out),zzflux(4,n_psi_out*n_tht_out),psflux(4,n_psi_out*n_tht_out))
85 allocate(moments(n_moments,n_psi_out),fraction_circ(n_psi_out))
86 
87 if (associated(equil_in(1)%profiles_1d%pressure)) then
88  n_prof_in = size(equil_in(1)%profiles_1d%pressure,1)
89  if (.not. associated(equil_in(1)%profiles_1d%pprime)) allocate(equil_in(1)%profiles_1d%pprime(n_prof_in))
90 elseif (associated(equil_in(1)%profiles_1d%pprime)) then
91  n_prof_in = size(equil_in(1)%profiles_1d%pprime,1)
92 endif
93 iopt_p = 1
94 iopt_f = 4
95 
96 if (.not. associated(equil_in(1)%profiles_1d%jphi)) then
97  write(*,*) ' jphi not associated '
98  allocate(equil_in(1)%profiles_1d%jphi(n_prof_in))
99  equil_in(1)%profiles_1d%jphi = 0.e0_r8
100 endif
101 np_grid = 33
102 if (.not. associated(equil_in(1)%profiles_1d%ffprime)) allocate(equil_in(1)%profiles_1d%ffprime(n_prof_in))
103 
104 if (.not. associated(equil_out)) allocate(equil_out(1))
105 
106 allocate(equil_out(1)%profiles_1d%psi(n_psi_out))
107 allocate(equil_out(1)%profiles_1d%pressure(n_psi_out))
108 allocate(equil_out(1)%profiles_1d%pprime(n_psi_out))
109 allocate(equil_out(1)%profiles_1d%f_dia(n_psi_out))
110 allocate(equil_out(1)%profiles_1d%ffprime(n_psi_out))
111 allocate(equil_out(1)%profiles_1d%q(n_psi_out))
112 allocate(equil_out(1)%profiles_1d%jphi(n_psi_out))
113 allocate(equil_out(1)%profiles_1d%vprime(n_psi_out))
114 
115 bgeo_in = equil_in(1)%eqconstraint%bvac_r%measured / equil_in(1)%eqgeometry%geom_axis%r
116 write(*,*) 'Bgeo_in ',bgeo_in
117 
118 !write(*,*) ' using equil_in(1)%eqconstraint%bvac_r%measured !!! WARNING : USING BVAC_R as if BVAC'
119 !Bgeo_in = equil_in(1)%eqconstraint%bvac_r%measured !/ equil_in(1)%eqgeometry%geom_axis%r
120 
121 call helena21(equil_in(1)%eqgeometry%boundary(1)%r(1:n_bnd),equil_in(1)%eqgeometry%boundary(1)%z(1:n_bnd),n_bnd, &
122  equil_in(1)%eqgeometry%geom_axis%r, equil_in(1)%eqgeometry%geom_axis%z, equil_in(1)%eqgeometry%a_minor, &
123  equil_in(1)%eqgeometry%elongation,equil_in(1)%eqgeometry%tria_upper, equil_in(1)%eqgeometry%tria_lower, &
124  quad_u_in, quad_l_in, &
125  bgeo_in, &
126  equil_in(1)%profiles_1d%psi, equil_in(1)%profiles_1d%pprime, equil_in(1)%profiles_1d%ffprime, &
127  equil_in(1)%profiles_1d%pressure, equil_in(1)%profiles_1d%f_dia, equil_in(1)%profiles_1d%jphi, &
128  n_prof_in, iopt_p, iopt_f, &
129  nr_grid, np_grid, &
130  equil_out(1)%profiles_1d%psi, equil_out(1)%profiles_1d%pprime, equil_out(1)%profiles_1d%ffprime, &
131  equil_out(1)%profiles_1d%pressure, equil_out(1)%profiles_1d%f_dia, equil_out(1)%profiles_1d%jphi, &
132  equil_out(1)%profiles_1d%q, equil_out(1)%profiles_1d%vprime, &
133  fraction_circ, moments, n_moments, &
134  surface_powers, surface_integrals, n_var_surfaces, n_int_surfaces, &
135  volume_powers, volume_integrals, n_var_volumes, n_int_volumes, n_psi_out, n_tht_out, &
136  amin_out, rgeo_out, zgeo_out, &
137  area_out, volume_out, betap_out, xip_out, xli_out, betat_out, &
138  r_axis_out, z_axis_out, b_axis_out, psi_axis_out, psi_bnd_out, &
139  rrflux,zzflux,psflux)
140 
141 write(*,*) ' helena21 done'
142 
143 write(*,*) n_psi_out, n_tht_out
144 write(*,*) ' magnetic axis : ',r_axis_out,z_axis_out
145 
146 allocate(equil_out(1)%datainfo%dataprovider(1))
147 equil_out(1)%datainfo%dataprovider(1) = ' HELENA2 '
148 equil_out(1)%time = equil_in(1)%time
149 
150 equil_out(1)%global_param%area = area_out
151 equil_out(1)%global_param%volume = volume_out
152 
153 equil_out(1)%global_param%psi_ax = psi_axis_out
154 equil_out(1)%global_param%psi_bound = psi_bnd_out
155 equil_out(1)%global_param%beta_pol = betap_out
156 equil_out(1)%global_param%I_plasma = xip_out
157 equil_out(1)%global_param%li = xli_out
158 equil_out(1)%global_param%beta_tor = betat_out
159 equil_out(1)%global_param%beta_normal = 1.256637061*betat_out / xip_out
160 !equil_out(1)%global_param%q_min = minval(QS(1:npsi))
161 
162 equil_out(1)%global_param%mag_axis%position%r = r_axis_out
163 equil_out(1)%global_param%mag_axis%position%z = z_axis_out
164 equil_out(1)%global_param%mag_axis%bphi = b_axis_out
165 !equil_out(1)%global_param%mag_axis%q = QS(1)
166 
167 
168 equil_out(1)%eqgeometry%a_minor = amin_out
169 equil_out(1)%eqgeometry%geom_axis%r = rgeo_out
170 equil_out(1)%eqgeometry%geom_axis%z = zgeo_out
171 
172 nchi = n_tht_out
173 
174 allocate(equil_out(1)%eqgeometry%boundary(1),equil_out(1)%eqgeometry%boundary(1)%r(nchi),equil_out(1)%eqgeometry%boundary(1)%z(nchi))
175 
176 do j=1, nchi
177  node = nchi*(n_psi_out-1) + j
178  equil_out(1)%eqgeometry%boundary(1)%r(j) = rrflux(1,node)
179  equil_out(1)%eqgeometry%boundary(1)%z(j) = zzflux(1,node)
180 enddo
181 
182 allocate(equil_out(1)%profiles_1d%volume(n_psi_out))
183 allocate(equil_out(1)%profiles_1d%rho_vol(n_psi_out))
184 allocate(equil_out(1)%profiles_1d%area(n_psi_out))
185 allocate(equil_out(1)%profiles_1d%phi(n_psi_out))
186 allocate(equil_out(1)%profiles_1d%gm1(n_psi_out))
187 allocate(equil_out(1)%profiles_1d%gm2(n_psi_out))
188 allocate(equil_out(1)%profiles_1d%gm3(n_psi_out))
189 allocate(equil_out(1)%profiles_1d%gm4(n_psi_out))
190 allocate(equil_out(1)%profiles_1d%gm5(n_psi_out))
191 allocate(equil_out(1)%profiles_1d%gm6(n_psi_out))
192 allocate(equil_out(1)%profiles_1d%gm7(n_psi_out))
193 
194 
195 equil_out(1)%profiles_1d%volume(1:n_psi_out) = volume_integrals(1:n_psi_out,1)
196 equil_out(1)%profiles_1d%area(1:n_psi_out) = volume_integrals(1:n_psi_out,3)
197 equil_out(1)%profiles_1d%phi(1:n_psi_out) = volume_integrals(1:n_psi_out,2) / &
198  (2.e0_r8 * pi)
199 
200 !DPC added abs()
201 equil_out(1)%profiles_1d%rho_vol=sqrt(abs(equil_out(1)%profiles_1d%volume/equil_out(1)%profiles_1d%volume(n_psi_out)))
202 
203 !--------------should not be normalised psi!
204 dpsi_drho = 2.e0_r8 * sqrt(equil_out(1)%profiles_1d%phi/(pi * bgeo_in)) / &
205  equil_out(1)%profiles_1d%q / abs(psi_axis_out - psi_bnd_out)
206 dpsi_drho = 2.e0_r8 * sqrt(equil_out(1)%profiles_1d%phi/(pi * bgeo_in)) / equil_out(1)%profiles_1d%q
207 
208 call cos_zconversion(dpsi_drho,n_psi_out)
209 equil_out(1)%profiles_1d%vprime = equil_out(1)%profiles_1d%vprime * dpsi_drho
210 call cos_zconversion(equil_out(1)%profiles_1d%vprime,n_psi_out)
211 
212 
213 equil_out(1)%profiles_1d%gm1 = surface_integrals(1:n_psi_out,1)
214 equil_out(1)%profiles_1d%gm2 = surface_integrals(1:n_psi_out,2) / dpsi_drho**2
215 equil_out(1)%profiles_1d%gm3 = surface_integrals(1:n_psi_out,3) / dpsi_drho**2
216 equil_out(1)%profiles_1d%gm4 = surface_integrals(1:n_psi_out,4)
217 equil_out(1)%profiles_1d%gm5 = surface_integrals(1:n_psi_out,5)
218 equil_out(1)%profiles_1d%gm6 = surface_integrals(1:n_psi_out,6) / dpsi_drho**2
219 equil_out(1)%profiles_1d%gm7 = surface_integrals(1:n_psi_out,7) / dpsi_drho
220 
221 call cos_zconversion(equil_out(1)%profiles_1d%gm6,n_psi_out)
222 call cos_zconversion(equil_out(1)%profiles_1d%gm7,n_psi_out)
223 
224 !--temporary bugfix cronos_test
225 !equil_in(1)%profiles_1d%gm6 = equil_in(1)%profiles_1d%gm6 * equil_in(1)%profiles_1d%vprime
226 
227 
228 !write(*,*) ' equi_out profiles : '
229 
230 !write(*,'(A,6e12.4)') ' GM1 : ',equil_out(1)%profiles_1d%gm1(n_psi_out),equil_in(1)%profiles_1d%gm1(size(equil_in(1)%profiles_1d%gm1)), &
231 ! equil_out(1)%profiles_1d%gm1(n_psi_out)/equil_in(1)%profiles_1d%gm1(size(equil_in(1)%profiles_1d%gm1))
232 !write(*,'(A,6e12.4)') ' GM2 : ',equil_out(1)%profiles_1d%gm2(n_psi_out),equil_in(1)%profiles_1d%gm2(size(equil_in(1)%profiles_1d%gm2)), &
233 ! equil_out(1)%profiles_1d%gm2(n_psi_out)/equil_in(1)%profiles_1d%gm2(size(equil_in(1)%profiles_1d%gm2))
234 !write(*,'(A,6e12.4)') ' GM3 : ',equil_out(1)%profiles_1d%gm3(n_psi_out),equil_in(1)%profiles_1d%gm3(size(equil_in(1)%profiles_1d%gm3)), &
235 ! equil_out(1)%profiles_1d%gm3(n_psi_out)/equil_in(1)%profiles_1d%gm3(size(equil_in(1)%profiles_1d%gm3))
236 !write(*,'(A,6e12.4)') ' GM4 : ',equil_out(1)%profiles_1d%gm4(n_psi_out),equil_in(1)%profiles_1d%gm4(size(equil_in(1)%profiles_1d%gm4)), &
237 ! equil_out(1)%profiles_1d%gm4(n_psi_out)/equil_in(1)%profiles_1d%gm4(size(equil_in(1)%profiles_1d%gm4))
238 !write(*,'(A,6e12.4)') ' GM5 : ',equil_out(1)%profiles_1d%gm5(n_psi_out),equil_in(1)%profiles_1d%gm5(size(equil_in(1)%profiles_1d%gm5)), &
239 ! equil_out(1)%profiles_1d%gm5(n_psi_out)/equil_in(1)%profiles_1d%gm5(size(equil_in(1)%profiles_1d%gm5))
240 !write(*,'(A,6e12.4)') ' GM6 : ',equil_out(1)%profiles_1d%gm6(n_psi_out),equil_in(1)%profiles_1d%gm6(size(equil_in(1)%profiles_1d%gm6)), &
241 ! equil_out(1)%profiles_1d%gm6(n_psi_out)/equil_in(1)%profiles_1d%gm6(size(equil_in(1)%profiles_1d%gm6))
242 !write(*,'(A,6e12.4)') ' GM7 : ',equil_out(1)%profiles_1d%gm7(n_psi_out),equil_in(1)%profiles_1d%gm7(size(equil_in(1)%profiles_1d%gm7)), &
243 ! equil_out(1)%profiles_1d%gm7(n_psi_out)/equil_in(1)%profiles_1d%gm7(size(equil_in(1)%profiles_1d%gm7))
244 !write(*,'(A,2e12.4)') ' q : ',equil_out(1)%profiles_1d%q(n_psi_out),equil_in(1)%profiles_1d%q(size(equil_in(1)%profiles_1d%q))
245 !write(*,'(A,2e12.4)') ' vp : ',equil_out(1)%profiles_1d%vprime(n_psi_out),equil_in(1)%profiles_1d%vprime(size(equil_in(1)%profiles_1d%vprime))
246 !write(*,'(A,2e12.4)') ' phi : ',equil_out(1)%profiles_1d%phi(n_psi_out)!,equil_in(1)%profiles_1d%phi(size(equil_in(1)%profiles_1d%phi))
247 !write(*,'(A,2e12.4)') ' psi : ',equil_out(1)%profiles_1d%psi(n_psi_out)-equil_out(1)%profiles_1d%psi(1)
248 
249 !call begplt('check.ps')
250 
251 !call lincol(1)
252 !call lplot6(2,2,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm1(2),size(equil_in(1)%profiles_1d%psi)-1,'gm1')
253 !call lincol(0)
254 !call lplot6(2,2,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm1(2),-n_psi_out+1,'gm1')
255 !call lincol(0)
256 
257 !call lplot6(2,3,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm2(2),n_psi_out-1,'gm2')
258 !call lincol(1)
259 !call lplot6(2,3,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm2(2),-size(equil_in(1)%profiles_1d%psi)+1,' ')
260 !call lincol(0)
261 
262 !call lplot6(3,2,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm3(2),n_psi_out-1,'gm3')
263 !call lincol(1)
264 !call lplot6(3,2,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm3(2),-size(equil_in(1)%profiles_1d%psi)+1,' ')
265 !call lincol(0)
266 
267 !call lplot6(3,3,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm4(2),n_psi_out-1,'gm4')
268 !call lincol(1)
269 !call lplot6(3,3,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm4(2),-size(equil_in(1)%profiles_1d%psi)+1,' ')
270 !call lincol(0)
271 
272 !call lplot6(2,2,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm5(2),n_psi_out-1,'gm5')
273 !call lincol(1)
274 !call lplot6(2,2,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm5(2),-size(equil_in(1)%profiles_1d%psi)+1,' ')
275 !call lincol(0)
276 
277 !call lplot6(3,2,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm6(2),n_psi_out-1,'gm6')
278 !call lincol(1)
279 !call lplot6(3,2,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm6(2),-size(equil_in(1)%profiles_1d%psi)+1,' ')
280 !call lincol(0)
281 
282 !call lplot6(2,3,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%gm7(2),n_psi_out-1,'gm7')
283 !call lincol(1)
284 !call lplot6(2,3,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%gm7(2),-size(equil_in(1)%profiles_1d%psi)+1,' ')
285 !call lincol(0)
286 
287 !call lincol(1)
288 !call lplot6(3,3,equil_in(1)%profiles_1d%psi(2) ,equil_in(1)%profiles_1d%vprime(2),+size(equil_in(1)%profiles_1d%psi)-1,'Vprime')
289 !call lincol(0)
290 !call lplot6(3,3,equil_out(1)%profiles_1d%psi(2),equil_out(1)%profiles_1d%vprime(2),-(n_psi_out-1),'Vprime')
291 
292 
293 call lincol(0)
294 call lincol(0)
295 call lincol(0)
296 call lincol(0)
297 call finplt
298 
299 
300 allocate(equil_out(1)%profiles_1d%r_inboard(n_psi_out))
301 allocate(equil_out(1)%profiles_1d%r_outboard(n_psi_out))
302 do i=1,n_psi_out
303  ileft = (i-1)*n_tht_out + n_tht_out /2.e0_r8 + 1
304  iright = (i-1)*n_tht_out + 1
305  equil_out(1)%profiles_1d%r_inboard(i) = rrflux(1,ileft)
306  equil_out(1)%profiles_1d%r_outboard(i) = rrflux(1,iright)
307 enddo
308 
309 allocate(equil_out(1)%profiles_1d%ftrap(n_psi_out))
310 equil_out(1)%profiles_1d%ftrap = 1.e0_r8 - fraction_circ
311 
312 
313 WRITE(*,*) ' COORD_SYS : ',n_psi_out,nchi
314 
315 !allocate(equil_out(1)%coord_sys%grid%dim1(npsi))
316 !allocate(equil_out(1)%coord_sys%grid%dim2(nchi))
317 
318 allocate(equil_out(1)%coord_sys%position%R(n_psi_out,nchi))
319 allocate(equil_out(1)%coord_sys%position%Z(n_psi_out,nchi))
320 
321 !allocate(equil_out(1)%coord_sys%g_11(npsi,nchi))
322 !allocate(equil_out(1)%coord_sys%g_12(npsi,nchi))
323 !allocate(equil_out(1)%coord_sys%g_22(npsi,nchi))
324 !allocate(equil_out(1)%coord_sys%g_33(npsi,nchi))
325 !allocate(equil_out(1)%coord_sys%jacobian(npsi,nchi))
326 
327 !equil_out(1)%coord_sys%grid%dim1(1:npsi) = cs(1:npsi)**2
328 !equil_out(1)%coord_sys%grid%dim2(1:nchi) = chi(1:nchi)
329 
330 do i=1,n_psi_out
331  do j=1,nchi
332  node = (i-1)*nchi + j
333 
334  equil_out(1)%coord_sys%position%R(i,j) = rrflux(1,node)
335  equil_out(1)%coord_sys%position%Z(i,j) = zzflux(1,node)
336 
337 ! equil_out(1)%coord_sys%g_11(i,j) = gem11(index) * (R_mag * B_mag)**2
338 ! equil_out(1)%coord_sys%g_12(i,j) = gem12(index) * B_mag
339 ! equil_out(1)%coord_sys%g_22(i,j) = gem22(index) / R_mag**2
340 ! equil_out(1)%coord_sys%g_33(i,j) = 1./gem33(index) / R_mag**2
341  enddo
342 enddo
343 
344 !equil_out(1)%coord_sys%g_11(1,1:nchi) = 0.
345 !equil_out(1)%coord_sys%g_33(1,1:nchi) = 1. / R_mag**2
346 !equil_out(1)%coord_sys%R(1,1:nchi) = R_mag
347 !equil_out(1)%coord_sys%Z(1,1:nchi) = Z_mag
348 
349 !DPC
350 equil_out(1)%profiles_1d%psi=-2.0_r8*itm_pi*equil_out(1)%profiles_1d%psi
351 equil_out(1)%profiles_1d%psi=equil_out(1)%profiles_1d%psi-equil_out(1)%profiles_1d%psi(1)
352 
353 return
354 end
355 
subroutine helena21itm(equil_in, equil_out)
Definition: helena21itm.f90:1
subroutine finplt
Definition: ppplib.f:5552
subroutine cos_zconversion(e, nbrho)
subroutine lincol(ICOL)
Definition: ppplib.f:5977
subroutine helena21(R_bnd_in, Z_bnd_in, n_bnd_in, Rgeo_in, Zgeo_in, amin_in, ellip_in, tria_u_in, tria_l_in, quad_u_in, quad_l_in, Bgeo_in, psi_in, pprime_in, ffprime_in, pressure_in, fdia_in, current_in, n_prof_in, iopt_p, iopt_f, nr_grid, np_grid, psi_out, pprime_out, ffprime_out, pressure_out, fdia_out, current_out, qprof_out, vprime, fraction_circ, moments, n_moments, surface_powers, surface_integrals, n_var_surfaces, n_int_surfaces, volume_powers, volume_integrals, n_var_volumes, n_int_volumes, n_psi_out, n_tht_out, amin_out, Rgeo_out, Zgeo_out, area_out, volume_out, betap_out, xip_out, xli_out, beta_out, R_axis_out, Z_axis_out, B_axis_out, psi_axis_out, psi_bnd_out, RRflux, ZZflux, PSflux)