38 integer :: in_file(3), out_file(3), ref_file, eq_axes, nspin, &
39 lmax, time_steps, ierr
40 logical :: calculate_tensor, reference_multipoles
41 type(spectrum_t) :: spectrum
42 type(unit_system_t) :: file_units
43 character(len=80) :: refmultipoles
64 select case (spectrum%spectype)
75 write(
message(1),
'(a)')
'No PropagationSpectrumType defined,'
76 write(
message(2),
'(a)')
'cannot calculate the spectrum.'
91 character(len=*),
intent(inout) :: str
93 character(kind=c_char) :: cstr(len(str)+1)
95 interface getopt_propagation_spectrum_low
96 subroutine getopt_propagation_spectrum_low(str) bind(c, name='getopt_propagation_spectrum')
98 character(kind=c_char) :: str(*)
99 end subroutine getopt_propagation_spectrum_low
100 end interface getopt_propagation_spectrum_low
103 call getopt_propagation_spectrum_low(cstr)
140 character(len=*),
intent(in) :: fname
141 character(len=*),
intent(in) :: reffname
150 action=
'read', status=
'old', die=.false.)
151 if (in_file(1) /= -1)
then
152 write(
message(1),
'(3a)')
'File "', trim(fname),
'" found. This will be the only file to be processed.'
153 write(
message(2),
'(a)')
'(If more than one file is to be used, the files should be called'
154 write(
message(3),
'(5a)')
'"', trim(fname),
'.1", "', trim(fname),
'.2", etc.)'
160 eq_axes = kick%pol_equiv_axes
161 if (eq_axes == 3)
then
162 calculate_tensor = .
true.
163 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has three equivalent axes.'
164 write(
message(2),
'(a)')
'I will calculate the full tensor, written in file "XXXX_tensor".'
166 else if (eq_axes == 2)
then
167 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has two equivalent axes.'
168 write(
message(2),
'(a)')
'However, I am only using this file; cannot calculate the full tensor.'
169 write(
message(3),
'(a)')
'A file "XXXX_vector" will be generated instead.'
171 calculate_tensor = .false.
173 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has no usable symmetry. '
174 write(
message(2),
'(a)')
'However, I am only using this file; cannot calculate the full tensor.'
175 write(
message(3),
'(a)')
'A file "XXXX_vector" will be generated instead.'
177 calculate_tensor = .false.
183 calculate_tensor = .
true.
186 status=
'old', die=.false.)
188 action=
'read', status=
'old', die=.false.)
189 if (in_file(1) == -1)
then
190 write(
message(1),
'(5a)')
'No "', trim(fname),
'" or "', trim(fname),
'.1" file found. At least one of those'
191 write(
message(2),
'(a)')
'should be visible.'
196 eq_axes = kick%pol_equiv_axes
198 if (eq_axes == 3)
then
199 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three equivalent axes.'
200 write(
message(2),
'(a)')
'I will calculate the full tensor, written in file "cross_section_tensor".'
203 else if (eq_axes == 2)
then
206 action=
'read', status=
'old', die=.false.)
207 if (in_file(2) == -1)
then
208 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has two equivalent axes,'
209 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.2".'
212 write(
message(1),
'(5a)')
'Found two files, "', trim(fname),
'.1" and "', trim(fname),
'.2".'
213 write(
message(2),
'(a)')
'Two polarization axes are equivalent. I will generate the full tensor.'
218 status=
'old', die=.false.)
220 action=
'read', status=
'old', die=.false.)
221 if (in_file(2) == -1)
then
222 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three inequivalent axes,'
223 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.2".'
227 status=
'old', die=.false.)
229 action=
'read', status=
'old', die=.false.)
230 if (in_file(3) == -1)
then
231 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three inequivalent axes,'
232 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.3".'
235 write(
message(1),
'(7a)')
'Found three files, "', trim(fname),
'.1", "', trim(fname),
'.2" and "', trim(fname),
'.3".'
236 write(
message(2),
'(a)')
'No symmetry information will be used.'
242 if (reffname ==
"")
then
243 reference_multipoles = .false.
245 reference_multipoles = .
true.
255 character(len=*),
intent(in) :: fname
259 character(len=150),
allocatable :: filename(:)
263 if (.not. calculate_tensor)
then
266 if (.not. reference_multipoles)
then
275 select case (eq_axes)
284 safe_allocate(filename(1:jj))
286 write(filename(ii),
'(2a,i1)') trim(fname),
'_vector.',ii
288 if (.not. reference_multipoles)
then
312 character(len=*),
intent(in) :: fname_in, fname_out
318 action=
'read', status=
'old', die=.false.)
319 if (in_file(1) >= 0)
then
320 write(
message(1),
'(3a)')
'File "', trim(fname_in),
'" found.'
336 character(len=*),
intent(in) :: fname_in, fname_out
342 action=
'read', status=
'old', die=.false.)
343 if (in_file(1) >= 0)
then
344 write(
message(1),
'(3a)')
'File "', trim(fname_in),
'" found.'
361 character(len=*),
intent(in) :: fname_in, fname_out
void getopt_propagation_spectrum(char *fname)
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)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, 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
subroutine, public string_c_to_f(c_string, f_string)
convert a C string to a Fortran string
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