18 type (type_equilibrium
) :: equilibrium_out
19 character(len = 132) :: path
21 character (len=30),
parameter :: file_old_map_out =
'old_equilibrium'
23 real(r8) :: rmag, bmag
24 integer(itm_i4) :: i, j
26 rmag = equilibrium_out%global_param%mag_axis%position%r
27 bmag = equilibrium_out%global_param%mag_axis%bphi
30 open (unit = out_map, file = trim(adjustl(path)) // file_old_map_out, &
31 status =
'replace', form =
'formatted', action =
'write', iostat = i_error)
33 write(out_map, 3) nr - 1, nchi
34 write(out_map, 1) (cs(i), i = 1, nr)
35 write(out_map, 1) (equilibrium_out%profiles_1d%q(i), i = 1, nr)
36 write(out_map, 2) 0._r8, dqs(nr)
37 write(out_map, 1) (dqs(i), i = 2, nr)
38 write(out_map, 1) (0._r8, i = 1, nr)
39 write(out_map, 2) 0._r8, 0._r8
40 write(out_map, 1) (chi(i), i = 1, nchi)
41 write(out_map, 1) ((equilibrium_out%coord_sys%g_11(i, j) &
42 / (twopi * rmag * bmag)**2, j = 1, nchi), i = 2, nr)
43 write(out_map, 1) ((equilibrium_out%coord_sys%g_12(i, j) &
44 / (twopi * bmag), j = 1, nchi), i = 2, nr)
45 write(out_map, 2) equilibrium_out%profiles_1d%psi(nr) / (twopi &
46 * bmag * rmag**2), equilibrium_out%eqgeometry%a_minor / rmag
47 write(out_map, 1) ((1._r8 / equilibrium_out%coord_sys%g_33(i, j) &
48 / rmag**2, j = 1, nchi), i = 2, nr)
49 write(out_map, 4) 1._r8
50 write(out_map, 1) (equilibrium_out%profiles_1d%pressure(i) &
51 / bmag**2 * mu0, i = 1, nr)
52 write(out_map, 2) 0._r8, dp0(nr)
53 write(out_map, 1) (equilibrium_out%profiles_1d%F_dia(i) / (rmag &
55 write(out_map, 2) 0._r8, 0._r8
57 write(out_map, 1) ((equilibrium_out%eqgeometry%boundary(1)%r(j) &
58 - equilibrium_out%eqgeometry%geom_axis%r) &
59 / equilibrium_out%eqgeometry%a_minor, j = 1, nchi)
60 write(out_map, 1) ((equilibrium_out%eqgeometry%boundary(1)%z(j) &
61 - zgeo) / equilibrium_out%eqgeometry%a_minor, j = 1, nchi)
62 write(out_map, 4) equilibrium_out%eqgeometry%a_minor &
63 / equilibrium_out%eqgeometry%geom_axis%r
64 write(out_map, 1) (((equilibrium_out%coord_sys%position%r(i, j) &
65 - equilibrium_out%eqgeometry%geom_axis%r) &
66 / equilibrium_out%eqgeometry%a_minor, j = 1, nchi), i = 2, nr)
67 write(out_map, 1) (((equilibrium_out%coord_sys%position%z(i, j) &
68 - zgeo) / equilibrium_out%eqgeometry%a_minor, j = 1, nchi), &
subroutine write_old_equilibrium(path, equilibrium_out)