36 integer :: in_file(3), out_file(3), ref_file, eq_axes, nspin, &
37 lmax, time_steps, ierr
38 logical :: calculate_tensor, reference_multipoles
39 type(spectrum_t) :: spectrum
40 type(unit_system_t) :: file_units
41 character(len=80) :: refmultipoles
62 select case (spectrum%spectype)
73 write(
message(1),
'(a)')
'No PropagationSpectrumType defined,'
74 write(
message(2),
'(a)')
'cannot calculate the spectrum.'
121 character(len=*),
intent(in) :: fname
122 character(len=*),
intent(in) :: reffname
131 action=
'read', status=
'old', die=.false.)
132 if (in_file(1) >= 0)
then
133 write(
message(1),
'(3a)')
'File "', trim(fname),
'" found. This will be the only file to be processed.'
134 write(
message(2),
'(a)')
'(If more than one file is to be used, the files should be called'
135 write(
message(3),
'(5a)')
'"', trim(fname),
'.1", "', trim(fname),
'.2", etc.)'
141 eq_axes = kick%pol_equiv_axes
142 if (eq_axes == 3)
then
143 calculate_tensor = .
true.
144 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has three equivalent axes.'
145 write(
message(2),
'(a)')
'I will calculate the full tensor, written in file "XXXX_tensor".'
147 else if (eq_axes == 2)
then
148 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has two equivalent axes.'
149 write(
message(2),
'(a)')
'However, I am only using this file; cannot calculate the full tensor.'
150 write(
message(3),
'(a)')
'A file "XXXX_vector" will be generated instead.'
152 calculate_tensor = .false.
154 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has no usable symmetry. '
155 write(
message(2),
'(a)')
'However, I am only using this file; cannot calculate the full tensor.'
156 write(
message(3),
'(a)')
'A file "XXXX_vector" will be generated instead.'
158 calculate_tensor = .false.
164 calculate_tensor = .
true.
167 status=
'old', die=.false.)
169 action=
'read', status=
'old', die=.false.)
170 if (in_file(1) < 0)
then
171 write(
message(1),
'(5a)')
'No "', trim(fname),
'" or "', trim(fname),
'.1" file found. At least one of those'
172 write(
message(2),
'(a)')
'should be visible.'
177 eq_axes = kick%pol_equiv_axes
179 if (eq_axes == 3)
then
180 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three equivalent axes.'
181 write(
message(2),
'(a)')
'I will calculate the full tensor, written in file "cross_section_tensor".'
184 else if (eq_axes == 2)
then
187 action=
'read', status=
'old', die=.false.)
188 if (in_file(2) < 0)
then
189 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has two equivalent axes,'
190 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.2".'
193 write(
message(1),
'(5a)')
'Found two files, "', trim(fname),
'.1" and "', trim(fname),
'.2".'
194 write(
message(2),
'(a)')
'Two polarization axes are equivalent. I will generate the full tensor.'
199 status=
'old', die=.false.)
201 action=
'read', status=
'old', die=.false.)
202 if (in_file(2) < 0)
then
203 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three inequivalent axes,'
204 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.2".'
208 status=
'old', die=.false.)
210 action=
'read', status=
'old', die=.false.)
211 if (in_file(3) < 0)
then
212 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three inequivalent axes,'
213 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.3".'
216 write(
message(1),
'(7a)')
'Found three files, "', trim(fname),
'.1", "', trim(fname),
'.2" and "', trim(fname),
'.3".'
217 write(
message(2),
'(a)')
'No symmetry information will be used.'
223 if (reffname ==
"")
then
224 reference_multipoles = .false.
226 reference_multipoles = .
true.
228 if (ref_file < 0)
then
229 write(
message(1),
'(3a)')
'No "',trim(reffname),
'" file found.'
240 character(len=*),
intent(in) :: fname
244 character(len=150),
allocatable :: filename(:)
248 if (.not. calculate_tensor)
then
251 if (.not. reference_multipoles)
then
260 select case (eq_axes)
269 safe_allocate(filename(1:jj))
271 write(filename(ii),
'(2a,i1)') trim(fname),
'_vector.',ii
273 if (.not. reference_multipoles)
then
297 character(len=*),
intent(in) :: fname_in, fname_out
303 action=
'read', status=
'old', die=.false.)
304 if (in_file(1) >= 0)
then
305 write(
message(1),
'(3a)')
'File "', trim(fname_in),
'" found.'
321 character(len=*),
intent(in) :: fname_in, fname_out
327 action=
'read', status=
'old', die=.false.)
328 if (in_file(1) >= 0)
then
329 write(
message(1),
'(3a)')
'File "', trim(fname_in),
'" found.'
346 character(len=*),
intent(in) :: fname_in, fname_out
subroutine, public getopt_init(ierr)
Initializes the getopt machinery. Must be called before attempting to parse the options....
subroutine, public getopt_end
subroutine, public global_end()
Finalise parser varinfo file, and MPI.
type(mpi_comm), parameter, public serial_dummy_comm
Alias MPI_COMM_UNDEFINED for the specific use case of initialising Octopus utilities with no MPI supp...
subroutine, public init_octopus_globals(comm)
Initialise Octopus-specific global constants and files. This routine performs no initialisation calls...
subroutine, public io_init(defaults)
If the argument defaults is present and set to true, then the routine will not try to read anything f...
subroutine, public io_close(iunit, grp)
subroutine, public io_end()
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
subroutine, public messages_end()
subroutine, public messages_init(output_dir)
subroutine, public messages_warning(no_lines, all_nodes, namespace)
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
type(namespace_t), public global_namespace
subroutine, public parser_init()
Initialise the Octopus parser.
subroutine, public parser_end()
End the Octopus parser.
subroutine, public profiling_end(namespace)
subroutine, public profiling_init(namespace)
Create profiling subdirectory.
subroutine, public spectrum_cross_section(spectrum, namespace, in_file, out_file, ref_file)
subroutine, public spectrum_cross_section_tensor(spectrum, namespace, out_file, in_file)
subroutine, public spectrum_dyn_structure_factor(spectrum, namespace, in_file_sin, in_file_cos, out_file)
subroutine, public spectrum_init(spectrum, namespace, default_energy_step, default_max_energy)
subroutine, public spectrum_mult_info(namespace, iunit, nspin, kick, time_steps, dt, file_units, lmax)
subroutine, public spectrum_dipole_power(spectrum, namespace, in_file, out_file)
integer, parameter, public spectrum_energyloss
integer, parameter, public spectrum_rotatory
subroutine, public spectrum_rotatory_strength(spectrum, namespace, in_file, out_file)
integer, parameter, public spectrum_absorption
integer, parameter, public spectrum_p_power
This module defines the unit system, used for input and output.
subroutine, public unit_system_init(namespace)
subroutine calculate_rotatory_strength(fname_in, fname_out)
subroutine read_files(fname, reffname)
subroutine calculate_ftchd(fname_in, fname_out)
subroutine calculate_absorption(fname, namespace)
subroutine calculate_dipole_power(fname_in, fname_out)
program propagation_spectrum