19 use deallocate_structures
22 use size_of_structures
35 subroutine helena(equilibrium_in, equilibrium_out, path, code_parameters)
38 type (type_equilibrium
),
pointer :: equilibrium_in(:)
39 type (type_equilibrium
),
pointer :: equilibrium_out(:)
40 character(len = 132),
optional :: path
41 type (type_param
) :: code_parameters
44 subroutine progen(equilibrium_in, equilibrium_out, active, path, &
45 path_tag, code_parameters)
49 type (type_equilibrium
),
pointer :: equilibrium_in(:)
50 type (type_equilibrium
),
pointer :: equilibrium_out(:)
51 integer(itm_i4),
intent(in) :: active
52 character(len = 132),
optional :: path
53 character(len = 132),
optional :: path_tag
54 type (type_param
) :: code_parameters
60 type (type_equilibrium
),
pointer :: equilibrium_in(:)
61 type (type_equilibrium
),
pointer :: equilibrium_out(:)
62 integer(itm_i4) :: active = 1
63 character(len = 132) :: filename_progen_xml
64 character(len = 132) :: filename_helena_xml
65 character(len = 132) :: path, path_tag
66 type (type_param
) :: code_parameters
69 integer(itm_i8) :: total_size = 0
70 logical,
parameter :: human_readable = .true.
73 integer(itm_i4) :: idxout, shot, runout, refshot, refrun
74 character(len = 5) :: treename
76 integer(itm_i4) :: iargc
80 filename_progen_xml =
'progen.xml'
81 filename_helena_xml =
'helena.xml'
84 if (iargc() >= 2)
then
85 call getarg(1, filename_progen_xml)
86 call getarg(2, filename_helena_xml)
87 if (iargc() >= 3)
then
90 if (index(filename_helena_xml,
'helena') /= -1)
then
91 path_tag = filename_helena_xml(index(filename_helena_xml,
'helena') &
92 + 6 : index(filename_helena_xml,
'.xml') - 1)
104 allocate(equilibrium_in(1))
107 call fill_param(code_parameters, trim(adjustl(path)) &
108 // trim(adjustl(filename_progen_xml)),
'', trim(adjustl(path)) &
111 call progen(equilibrium_in = equilibrium_in, &
112 equilibrium_out = equilibrium_out, active = active, path = path, &
113 path_tag = path_tag, code_parameters = code_parameters)
116 call set_deallocate_verbosity(1)
117 do i = 1,
size(equilibrium_in)
118 call deallocate_cpo(equilibrium_in(i))
120 deallocate(equilibrium_in)
123 call is_set_cpo(equilibrium_out(1),
'equilibrium_out')
126 allocate(equilibrium_in(
size(equilibrium_out)))
129 call set_copy_verbosity(1)
130 do i = 1,
size(equilibrium_out)
131 call copy_cpo(equilibrium_out(i), equilibrium_in(i))
135 do i = 1,
size(equilibrium_out)
136 call deallocate_cpo(equilibrium_out(i))
138 deallocate(equilibrium_out)
141 call fill_param(code_parameters, trim(adjustl(path)) &
142 // trim(adjustl(filename_helena_xml)),
'', trim(adjustl(path)) &
146 if (path_tag /=
'')
then
147 path = trim(adjustl(path)) //
'helena' // trim(adjustl(path_tag)) //
'/'
148 write(iu6, *)
'HELENA output redirected to ', trim(adjustl(path))
152 call
helena(equilibrium_in = equilibrium_in, &
153 equilibrium_out = equilibrium_out, path = path, &
154 code_parameters = code_parameters)
157 call is_set_cpo(equilibrium_out(1),
'equilibrium_out')
160 call set_size_of_verbosity(0)
161 call set_size_of_maxlevel(1)
166 write(*, *)
'Creating output run :'
168 call euitm_create(treename, shot, runout, refshot, refrun, idxout)
170 write(*, *)
'Put result'
171 call euitm_put(idxout,
"equilibrium", equilibrium_out)
173 write(*, *)
'Closing Database :'
180 call set_deallocate_verbosity(0)
181 do i = 1,
size(equilibrium_in)
182 call deallocate_cpo(equilibrium_in(i))
184 deallocate(equilibrium_in)
185 do i = 1,
size(equilibrium_out)
186 call deallocate_cpo(equilibrium_out(i))
188 deallocate(equilibrium_out)
190 stop
'finished wrapper'
subroutine helena(equilibrium_in, equilibrium_out, in_path, code_parameters)
subroutine write_equilibrium(path, equilibrium_out)
subroutine, public equilibrium_destructor(equilibrium)
subroutine euitm_close(idx)