44 integer :: in_file(3), out_file(3), ref_file, eq_axes, nspin, &
45 lmax, time_steps, ierr
46 logical :: calculate_tensor, reference_multipoles
47 type(spectrum_t) :: spectrum
48 type(unit_system_t) :: file_units
49 character(len=80) :: refmultipoles
70 select case (spectrum%spectype)
81 write(
message(1),
'(a)')
'No PropagationSpectrumType defined,'
82 write(
message(2),
'(a)')
'cannot calculate the spectrum.'
97 character(len=*),
intent(inout) :: str
99 character(kind=c_char) :: cstr(len(str)+1)
101 interface getopt_propagation_spectrum_low
102 subroutine getopt_propagation_spectrum_low(str) bind(c, name='getopt_propagation_spectrum')
104 character(kind=c_char) :: str(*)
105 end subroutine getopt_propagation_spectrum_low
106 end interface getopt_propagation_spectrum_low
109 call getopt_propagation_spectrum_low(cstr)
146 character(len=*),
intent(in) :: fname
147 character(len=*),
intent(in) :: reffname
156 action=
'read', status=
'old', die=.false.)
157 if (in_file(1) /= -1)
then
158 write(
message(1),
'(3a)')
'File "', trim(fname),
'" found. This will be the only file to be processed.'
159 write(
message(2),
'(a)')
'(If more than one file is to be used, the files should be called'
160 write(
message(3),
'(5a)')
'"', trim(fname),
'.1", "', trim(fname),
'.2", etc.)'
166 eq_axes = kick%pol_equiv_axes
167 if (eq_axes == 3)
then
169 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has three equivalent axes.'
170 write(
message(2),
'(a)')
'I will calculate the full tensor, written in file "XXXX_tensor".'
172 else if (eq_axes == 2)
then
173 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has two equivalent axes.'
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.
179 write(
message(1),
'(3a)')
'The file "', trim(fname),
'" tells me that the system has no usable symmetry. '
180 write(
message(2),
'(a)')
'However, I am only using this file; cannot calculate the full tensor.'
181 write(
message(3),
'(a)')
'A file "XXXX_vector" will be generated instead.'
183 calculate_tensor = .false.
189 calculate_tensor = .
true.
192 status=
'old', die=.false.)
194 action=
'read', status=
'old', die=.false.)
195 if (in_file(1) == -1)
then
196 write(
message(1),
'(5a)')
'No "', trim(fname),
'" or "', trim(fname),
'.1" file found. At least one of those'
197 write(
message(2),
'(a)')
'should be visible.'
202 eq_axes = kick%pol_equiv_axes
204 if (eq_axes == 3)
then
205 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three equivalent axes.'
206 write(
message(2),
'(a)')
'I will calculate the full tensor, written in file "cross_section_tensor".'
209 else if (eq_axes == 2)
then
212 action=
'read', status=
'old', die=.false.)
213 if (in_file(2) == -1)
then
214 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has two equivalent axes,'
215 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.2".'
218 write(
message(1),
'(5a)')
'Found two files, "', trim(fname),
'.1" and "', trim(fname),
'.2".'
219 write(
message(2),
'(a)')
'Two polarization axes are equivalent. I will generate the full tensor.'
224 status=
'old', die=.false.)
226 action=
'read', status=
'old', die=.false.)
227 if (in_file(2) == -1)
then
228 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three inequivalent axes,'
229 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.2".'
233 status=
'old', die=.false.)
235 action=
'read', status=
'old', die=.false.)
236 if (in_file(3) == -1)
then
237 write(
message(1),
'(3a)')
'The file "', trim(fname),
'.1" tells me that the system has three inequivalent axes,'
238 write(
message(2),
'(3a)')
'but I cannot find a "', trim(fname),
'.3".'
241 write(
message(1),
'(7a)')
'Found three files, "', trim(fname),
'.1", "', trim(fname),
'.2" and "', trim(fname),
'.3".'
242 write(
message(2),
'(a)')
'No symmetry information will be used.'
248 if (reffname ==
"")
then
249 reference_multipoles = .false.
251 reference_multipoles = .
true.
261 character(len=*),
intent(in) :: fname
265 character(len=150),
allocatable :: filename(:)
269 if (.not. calculate_tensor)
then
272 if (.not. reference_multipoles)
then
281 select case (eq_axes)
290 safe_allocate(filename(1:jj))
292 write(filename(ii),
'(2a,i1)') trim(fname),
'_vector.',ii
294 if (.not. reference_multipoles)
then
318 character(len=*),
intent(in) :: fname_in, fname_out
324 action=
'read', status=
'old', die=.false.)
325 if (in_file(1) >= 0)
then
326 write(
message(1),
'(3a)')
'File "', trim(fname_in),
'" found.'
342 character(len=*),
intent(in) :: fname_in, fname_out
348 action=
'read', status=
'old', die=.false.)
349 if (in_file(1) >= 0)
then
350 write(
message(1),
'(3a)')
'File "', trim(fname_in),
'" found.'
367 character(len=*),
intent(in) :: fname_in, fname_out
void getopt_propagation_spectrum(char *fname)
This module provides an interface to the getopt C library, so that the command line arguments can be ...
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.
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
subroutine, public profiling_end(namespace)
subroutine, public profiling_init(namespace)
Create profiling subdirectory.
subroutine, public propagation_spectrum_main()
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_ftchd(fname_in, fname_out)
subroutine read_files(fname, reffname)
subroutine calculate_absorption(fname, namespace)
subroutine calculate_dipole_power(fname_in, fname_out)
subroutine calculate_rotatory_strength(fname_in, fname_out)