17 use deallocate_structures
20 use size_of_structures
33 subroutine helena(equilibrium_in, equilibrium_out, path, code_parameters)
35 type (type_equilibrium
),
pointer :: equilibrium_in(:)
36 type (type_equilibrium
),
pointer :: equilibrium_out(:)
37 character(len = 132),
optional :: path
38 type (type_param
) :: code_parameters
41 subroutine jalpha(equilibrium_in, equilibrium_out, path, scale_p, &
42 scale_j, code_parameters)
45 type (type_equilibrium
),
pointer :: equilibrium_in(:)
46 type (type_equilibrium
),
pointer :: equilibrium_out(:)
47 character(len = 132),
optional :: path
48 real(r8) :: scale_p, scale_j
49 type (type_param
) :: code_parameters
56 type (type_equilibrium
),
pointer :: equilibrium_in(:)
57 type (type_equilibrium
),
pointer :: equilibrium_out(:)
58 character(len = 132) :: filename_equilibrium_in
59 character(len = 132) :: filename_jalpha_xml
60 character(len = 132) :: filename_helena_xml
61 character(len = 132) :: path, path_tag
62 type (type_param
) :: code_parameters
65 integer(itm_i8) :: total_size = 0
66 logical,
parameter :: human_readable = .true.
68 integer(itm_i4) :: iargc
72 filename_equilibrium_in =
'equilibrium.cpo'
73 filename_jalpha_xml =
'jalpha.xml'
74 filename_helena_xml =
'helena.xml'
77 if (iargc() >= 1)
then
78 call getarg(1, filename_equilibrium_in)
79 if (iargc() >= 2)
then
80 call getarg(2, filename_jalpha_xml)
81 call getarg(3, filename_helena_xml)
82 if (iargc() >= 4)
then
85 if (index(filename_jalpha_xml,
'jalpha') /= -1)
then
86 path_tag = filename_jalpha_xml(index(filename_jalpha_xml,
'jalpha') &
87 + 6 : index(filename_jalpha_xml,
'.xml') - 1)
93 allocate(equilibrium_in(1))
96 call set_read_verbosity(0)
97 call open_read_file(12, trim(adjustl(path)) &
98 // trim(adjustl(filename_equilibrium_in)))
99 call read_cpo(equilibrium_in(1),
'equilibrium')
103 call is_set_cpo(equilibrium_in(1),
'equilibrium_in')
106 call set_size_of_verbosity(0)
107 call set_size_of_maxlevel(1)
112 call fill_param(code_parameters, trim(adjustl(path)) &
113 // trim(adjustl(filename_jalpha_xml)),
'', trim(adjustl(path)) &
116 call jalpha(equilibrium_in = equilibrium_in, &
117 equilibrium_out = equilibrium_out, path = path, &
118 scale_p = 0._r8, scale_j = 0._r8, code_parameters = code_parameters)
121 call set_deallocate_verbosity(0)
122 call deallocate_cpo(equilibrium_in)
125 allocate(equilibrium_in(
size(equilibrium_out)))
128 call set_copy_verbosity(0)
129 do i = 1,
size(equilibrium_out)
130 call copy_cpo(equilibrium_out(i), equilibrium_in(i))
134 call deallocate_cpo(equilibrium_out)
137 call fill_param(code_parameters, trim(adjustl(path)) &
138 // trim(adjustl(filename_helena_xml)),
'', trim(adjustl(path)) &
142 if (path_tag /=
'')
then
143 path = trim(adjustl(path)) //
'jalpha' // trim(adjustl(path_tag)) //
'/'
144 write(*, *)
'JALPHA output redirected to ', trim(adjustl(path))
148 call
helena(equilibrium_in = equilibrium_in, &
149 equilibrium_out = equilibrium_out, path = path, &
150 code_parameters = code_parameters)
156 call set_write_verbosity(0)
157 call open_write_file(12, trim(adjustl(path)) //
'equilibrium.cpo')
158 call write_cpo(equilibrium_out(1),
'equilibrium')
159 call close_write_file
162 call deallocate_cpo(equilibrium_in)
163 call deallocate_cpo(equilibrium_out)
165 stop
'finished wrapper'
subroutine helena(equilibrium_in, equilibrium_out, in_path, code_parameters)
subroutine write_equilibrium(path, equilibrium_out)