19 use deallocate_structures
22 use size_of_structures
37 subroutine helena(equilibrium_in, equilibrium_out, path, code_parameters)
40 type (type_equilibrium
),
pointer :: equilibrium_in(:)
41 type (type_equilibrium
),
pointer :: equilibrium_out(:)
42 character(len = 132),
optional :: path
43 type (type_param
) :: code_parameters
46 subroutine progen(equilibrium_in, equilibrium_out, active, path, &
47 path_tag, code_parameters)
51 type (type_equilibrium
),
pointer :: equilibrium_in(:)
52 type (type_equilibrium
),
pointer :: equilibrium_out(:)
53 integer(itm_i4),
intent(in) :: active
54 character(len = 132),
optional :: path
55 character(len = 132),
optional :: path_tag
56 type (type_param
) :: code_parameters
62 type (type_equilibrium
),
pointer :: equilibrium_in(:)
63 type (type_equilibrium
),
pointer :: equilibrium_out(:)
64 integer(itm_i4) :: active = 1
65 character(len = 132) :: filename_progen_xml
66 character(len = 132) :: filename_helena_xml
67 character(len = 132) :: path, path_tag
68 type (type_param
) :: code_parameters
71 integer(itm_i8) :: total_size = 0
72 logical,
parameter :: human_readable = .true.
74 integer(itm_i4) :: iargc
78 filename_progen_xml =
'progen.xml'
79 filename_helena_xml =
'helena.xml'
82 if (iargc() >= 2)
then
83 call getarg(1, filename_progen_xml)
84 call getarg(2, filename_helena_xml)
85 if (iargc() >= 3)
then
88 if (index(filename_helena_xml,
'helena') /= -1)
then
89 path_tag = filename_helena_xml(index(filename_helena_xml,
'helena') &
90 + 6 : index(filename_helena_xml,
'.xml') - 1)
95 allocate(equilibrium_in(1))
98 call fill_param(code_parameters, trim(adjustl(path)) &
99 // trim(adjustl(filename_progen_xml)),
'', trim(adjustl(path)) &
102 call progen(equilibrium_in = equilibrium_in, &
103 equilibrium_out = equilibrium_out, active = active, path = path, &
104 path_tag = path_tag, code_parameters = code_parameters)
107 call set_write_verbosity(0)
108 call open_write_file(12, trim(adjustl(path)) //
'progen_equilibrium.cpo')
109 call write_cpo(equilibrium_out,
'equilibrium')
110 call close_write_file
113 call set_deallocate_verbosity(1)
114 call deallocate_cpo(equilibrium_in)
117 call is_set_cpo(equilibrium_out(1),
'equilibrium_out')
120 allocate(equilibrium_in(
size(equilibrium_out)))
123 call set_copy_verbosity(1)
124 do i = 1,
size(equilibrium_out)
125 call copy_cpo(equilibrium_out(i), equilibrium_in(i))
129 call deallocate_cpo(equilibrium_out)
132 call fill_param(code_parameters, trim(adjustl(path)) &
133 // trim(adjustl(filename_helena_xml)),
'', trim(adjustl(path)) &
137 if (path_tag /=
'')
then
138 path = trim(adjustl(path)) //
'helena' // trim(adjustl(path_tag)) //
'/'
139 write(iu6, *)
'HELENA output redirected to ', trim(adjustl(path))
143 call
helena(equilibrium_in = equilibrium_in, &
144 equilibrium_out = equilibrium_out, path = path, &
145 code_parameters = code_parameters)
148 call is_set_cpo(equilibrium_out(1),
'equilibrium_out')
151 call set_size_of_verbosity(0)
152 call set_size_of_maxlevel(1)
160 call set_write_verbosity(0)
161 call open_write_file(12, trim(adjustl(path)) //
'equilibrium.cpo')
162 call write_cpo(equilibrium_out(1),
'equilibrium')
163 call close_write_file
166 call set_deallocate_verbosity(0)
167 call deallocate_cpo(equilibrium_in)
168 call deallocate_cpo(equilibrium_out)
170 allocate(equilibrium_out(1))
173 call set_read_verbosity(0)
174 call open_read_file(12, trim(adjustl(path)) //
'equilibrium.cpo')
175 call read_cpo(equilibrium_out(1),
'equilibrium')
179 call deallocate_cpo(equilibrium_out)
181 stop
'finished wrapper'
subroutine helena(equilibrium_in, equilibrium_out, in_path, code_parameters)
subroutine write_equilibrium(path, equilibrium_out)
subroutine, public equilibrium_destructor(equilibrium)