ETS  \$Id: Doxyfile 2162 2020-02-26 14:16:09Z g2dpc $
 All Classes Files Functions Variables Pages
write_equilibrium.f90
Go to the documentation of this file.
1 subroutine write_equilibrium(path, equilibrium_out)
2 !----------------------------------------------------------------------------
3 ! This subroutine writes out the resulting HELENA equilibrium for use
4 ! by ILSA.
5 !----------------------------------------------------------------------------
6 
7  use itm_types
8  use mod_map
9  use mod_mesh, only : nr
10 
11  use euitm_schemas
12  use mod_helena_io
13 
14  implicit none
15 
16  type (type_equilibrium) :: equilibrium_out
17  character(len = 132) :: path
18 
19  integer(itm_i4) :: i, j
20 
21 !-------------------- write output for ILSA ---------------------------
22  open (unit = out_map, file = trim(adjustl(path)) // file_map_out, &
23  status = 'replace', form = 'formatted', action = 'write', iostat = i_error)
24 
25 !-- dimensions
26  write(out_map, 1) nr, nchi
27 
28 !-- global parameters
29  write(out_map, 2) equilibrium_out%eqgeometry%geom_axis%r
30  write(out_map, 2) equilibrium_out%eqgeometry%a_minor
31  write(out_map, 2) equilibrium_out%global_param%mag_axis%position%r
32  write(out_map, 2) equilibrium_out%global_param%mag_axis%bphi
33 
34 !-- 1d profiles
35  write(out_map, 3) (equilibrium_out%profiles_1d%psi(i), i = 1, nr)
36  write(out_map, 3) (equilibrium_out%profiles_1d%pressure(i), i = 1, nr)
37  write(out_map, 3) (equilibrium_out%profiles_1d%F_dia(i), i = 1, nr)
38  write(out_map, 3) (equilibrium_out%profiles_1d%q(i), i = 1, nr)
39  write(out_map, 3) (equilibrium_out%profiles_1d%pprime(i), i = 1, nr)
40 
41 !-- boundary
42  write(out_map, 3) (equilibrium_out%eqgeometry%boundary(1)%r(i), i = 1, &
43  nchi)
44  write(out_map, 3) (equilibrium_out%eqgeometry%boundary(1)%z(i), i = 1, &
45  nchi)
46 
47 !-- grid
48  write(out_map, 3) ((equilibrium_out%coord_sys%position%r(i, j), &
49  i = 1, nr), j = 1, nchi)
50  write(out_map, 3) ((equilibrium_out%coord_sys%position%z(i, j), &
51  i = 1, nr), j = 1, nchi)
52  write(out_map, 3) ((equilibrium_out%coord_sys%g_11(i, j), &
53  i = 1, nr), j = 1, nchi)
54  write(out_map, 3) ((equilibrium_out%coord_sys%g_12(i, j), &
55  i = 1, nr), j = 1, nchi)
56  write(out_map, 3) ((equilibrium_out%coord_sys%g_33(i, j), &
57  i = 1, nr), j = 1, nchi)
58 
59  close(out_map)
60 
61 1 format(2i6)
62 2 format(e16.8)
63 3 format(4e16.8)
64 
65 end subroutine write_equilibrium
subroutine write_equilibrium(path, equilibrium_out)