Multidip 1.0
Multi-photon matrix elements
Loading...
Searching...
No Matches
multidip_io Module Reference

I/O routines used by MULTIDIP. More...

Data Types

type  KMatrix
 K-matrix file. More...
type  MappedMatrix
 Auxiliary data structure for matrix (potentially memory-mapped, or distributed) More...
type  MolecularData
 RMT molecular data file. More...
type  ScatAkCoeffs
 Photoionization wave function coefficients. More...

Functions/Subroutines

subroutine load_mapped_matrix (this, filename, u, offset, rows, cols)
 Read or map a matrix from file.
subroutine destruct_mapped_matrix (this)
 Finalize a (potentially mapped) matrix object.
subroutine read_kmatrices (km, lukmt, nkset)
 Read K-matrix files.
subroutine read_kmatrix_file (km)
 Read K-matrix file.
subroutine reset_kmatrix_position (km, skip)
 Reset I/O pointer to start of K-matrices.
subroutine get_kmatrix (km, kmat, skip)
 Read single K-matrix from the K-matrix file.
subroutine read_wfncoeffs (ak, lusct)
 Read wave function coefficients from files.
subroutine read_bndcoeffs (bnd, ei, lubnd, mgvn0, stot0)
 Read inner bound wave function coefficients.
subroutine read_wfncoeffs_file (ak)
 Read wave function coefficients for a single symmetry from a file.
subroutine reset_wfncoeffs_position (ak, skip)
 Reset I/O pointer to start of Ak-coeffs.
subroutine get_wfncoeffs (ak, e, re_ak, im_ak, skip)
 Read single Ak-matrix from the Ak-coeffs file.
subroutine read_molecular_data (moldat, filename, mpiio, read_wmat2)
 Read RMT molecular_data file.
subroutine read_target_properties (lutarg, prop, etarg)
 Read ion transition dipoles.
subroutine setup_angular_integrals (moldat)
 Store the angular integrals in a more convenient shape.
subroutine get_diptrans (moldat, i, iidip, ifdip)
 Return dipole transition descriptors.
subroutine apply_dipole_matrix (moldat, component, irrpair, transp, nf, nn, x, y)
 Multiply by dipole matrix.
subroutine assert_status (message, errcode)
 Check for error code.
integer function clip (x, a, b)
 Clamp value in range.
subroutine apply_boundary_amplitudes (moldat, irr, transp, x, y)
 Multiply by boundary amplitudes.
subroutine scale_boundary_amplitudes (moldat, irr, v, vw)
 Scale boundary amplitudes matrix by a diagonal matrix.
subroutine write_energy_grid (escat)
 Write photoelectron energies to file.
subroutine write_partial_wave_moments (moldat, m, nesc, suffix)
 Write partial wave moments.
subroutine write_raw_dipoles (m, chains, nesc, stem)
 Write raw transition dipole moments.
subroutine write_rsolve_dipoles (moldat, m, chains, escat, lu_pw_dipoles)
 Write transition dipole moments in RSOLVE format.
subroutine write_cross_section (cs, nesc, erange, filename)
 Write cross sections to a file.

Variables

integer myproc = 1
integer nprocs = 1

Detailed Description

I/O routines used by MULTIDIP.

Author
J Benda
Date
2020 - 2022

This module contains routines that read the necessary input files (K-matrices, scattering coefficients, molecular_data files) and return the needed subset of data.

Function/Subroutine Documentation

◆ apply_boundary_amplitudes()

subroutine multidip_io::apply_boundary_amplitudes ( type(moleculardata), intent(in) moldat,
integer, intent(in) irr,
character(len=1), intent(in) transp,
real(wp), dimension(:,:), intent(inout) x,
real(wp), dimension(:,:), intent(inout) y )

Multiply by boundary amplitudes.

Author
J Benda
Date
2020 - 2023

Multiply real matrix X by the matrix of boundary amplitudes and store the result into the real matrix Y. When transp is 'T', then the elements of the matrix X are expected to correspond to outer region channels, while the elements of the matrix Y to the inner region states. Otherwise, the opposite is assumed.

Definition at line 1193 of file multidip_io.F90.

Here is the caller graph for this function:

◆ apply_dipole_matrix()

subroutine multidip_io::apply_dipole_matrix ( type(moleculardata), intent(in) moldat,
integer, intent(in) component,
integer, intent(in) irrpair,
character(len=1), intent(in) transp,
integer, intent(in) nf,
integer, intent(in) nn,
real(wp), dimension(:, :, :), intent(inout) x,
real(wp), dimension(:, :, :), intent(inout) y )

Multiply by dipole matrix.

Author
J Benda
Date
2020 - 2022

Multiply matrix 'X' by the dipole matrix corresponding to dipole component 'I' and transition index 's'. Store the result in matrix 'Y'. Use 'nn' rows of 'X', and 'nf' rows of 'Y'.

The matrix argument X and Y have the following one-dimensional distribution among processes:

   !>            +---+---+---+---+
   !>            |   |   |   |   |
   !>            |   |   |   |   |
   !>            | 0 | 1 | 2 | 3 |
   !>            |   |   |   |   |
   !>            |   |   |   |   |
   !>            +---+---+---+---+
   !> 

However, when ScaLAPACK multiplication is desired, the arrays need to be redistributed into the standard two-dimensional block-cyclic form

   !>            +-+-+-+-+-+-+-+-+
   !>            |0|1|2|3|0|1|2|3|
   !>            +-+-+-+-+-+-+-+-+
   !>            |1|2|3|0|1|2|3|0|
   !>            +-+-+-+-+-+-+-+-+
   !>            |2|3|0|1|2|3|0|1|
   !>            +-+-+-+-+-+-+-+-+
   !>            |3|0|1|2|3|0|1|2|
   !>            +-+-+-+-+-+-+-+-+
   !> 

and back. This is accomplished by the subroutine pdgemr2d. Note however, that this subroutine is prone to failure when the matrices exceed 4-byte addressable number of elements. Working with such matrices then requires patched version of ScaLAPACK that use long integers internally.

Definition at line 1051 of file multidip_io.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assert_status()

subroutine multidip_io::assert_status ( character(len=*), intent(in) message,
integer, intent(in) errcode )

Check for error code.

Author
J Benda
Date
2022 - 2024

If the provided error code is non-zero, print the error message and abort.

Definition at line 1157 of file multidip_io.F90.

Here is the caller graph for this function:

◆ clip()

integer function multidip_io::clip ( integer x,
integer a,
integer b )

Clamp value in range.

Author
J Benda
Date
2022

Definition at line 1175 of file multidip_io.F90.

Here is the caller graph for this function:

◆ destruct_mapped_matrix()

subroutine multidip_io::destruct_mapped_matrix ( type(mappedmatrix), intent(inout) this)

Finalize a (potentially mapped) matrix object.

Author
J Benda
Date
2021 - 2022

Safely deallocates the matrix. If it has been mapped, the pointer is only nullified; unmapping happens automatically in the desctructor of the file_mapping type.

Definition at line 280 of file multidip_io.F90.

Here is the caller graph for this function:

◆ get_diptrans()

subroutine multidip_io::get_diptrans ( type(moleculardata), intent(in) moldat,
integer, intent(in) i,
integer, dimension(:), intent(inout), allocatable iidip,
integer, dimension(:), intent(inout), allocatable ifdip )

Return dipole transition descriptors.

Author
J Benda
Date
2020

Based on the Cartesian component index I = 1, 2, 3, (re)allocate the arrays 'iidip' and 'ifdip' and fill them with initial/final irreducible representations pairs for dipole matrices present in the molecular_data file structure 'moldat'.

Definition at line 993 of file multidip_io.F90.

Here is the caller graph for this function:

◆ get_kmatrix()

subroutine multidip_io::get_kmatrix ( class(kmatrix), intent(in) km,
real(wp), dimension(:, :), intent(inout), allocatable kmat,
integer, intent(in), optional skip )

Read single K-matrix from the K-matrix file.

Author
J Benda
Date
2021 - 2024

Assuming that the K-matrix file associated with this object is correctly positioned, read the next K-matrix record. Symmetrize the K-matrix and store it into the allocatable two-dimensional array kmat (re/allocate as necessary).

Definition at line 466 of file multidip_io.F90.

◆ get_wfncoeffs()

subroutine multidip_io::get_wfncoeffs ( class(scatakcoeffs), intent(in) ak,
real(wp), intent(inout) e,
real(wp), dimension(:, :), intent(inout), allocatable re_ak,
real(wp), dimension(:, :), intent(inout), allocatable im_ak,
integer, intent(in), optional skip )

Read single Ak-matrix from the Ak-coeffs file.

Author
J Benda
Date
2021 - 2024

Assuming that the Ak-coeffs file associated with this object is correctly positioned, read the next Ak-matrix record. Also returns the scattering energy in atomic units.

Definition at line 684 of file multidip_io.F90.

◆ load_mapped_matrix()

subroutine multidip_io::load_mapped_matrix ( class(mappedmatrix), intent(inout) this,
character(len=*), intent(in) filename,
integer(int32), intent(in) u,
integer(int64), intent(in) offset,
integer(int32), intent(in) rows,
integer(int32), intent(in) cols )

Read or map a matrix from file.

Author
J Benda
Date
2021 - 2024

Depending on the compilation settings, either map the given section of the file to memory, or simply allocate and read the chunk. Optionally, read and distribute the matrix in the block-cyclic way.

Definition at line 158 of file multidip_io.F90.

Here is the call graph for this function:

◆ read_bndcoeffs()

subroutine multidip_io::read_bndcoeffs ( real(wp), dimension(:), intent(out) bnd,
real(wp), intent(out) ei,
integer, intent(in) lubnd,
integer, intent(in) mgvn0,
integer, intent(in) stot0 )

Read inner bound wave function coefficients.

Authors
J Benda
Date
2023

Read the inner region expansion coefficients of the bound state as calculated by BOUND.

Parameters
[out]bndVector of inner region expansion coefficients to fill.
[out]EiBound state energy as calculated by BOUND.
[in]lubndFile unit number with the (unformatted) BOUND output.
[in]mgvn0Expected MGVN (to check).
[in]stot0Expected total spin (to check).

Definition at line 554 of file multidip_io.F90.

Here is the caller graph for this function:

◆ read_kmatrices()

subroutine multidip_io::read_kmatrices ( type(kmatrix), dimension(:), intent(inout), allocatable km,
integer, dimension(:), intent(in) lukmt,
integer, dimension(:), intent(in) nkset )

Read K-matrix files.

Author
J Benda
Date
2020 - 2024

Read all needed K-matrix files. These are needed to calculate photionization coefficients (Ak) during the calculation. Also perform consistency check between the energy samples in individual files.

Definition at line 310 of file multidip_io.F90.

Here is the caller graph for this function:

◆ read_kmatrix_file()

subroutine multidip_io::read_kmatrix_file ( class(kmatrix), intent(inout) km)

Read K-matrix file.

Author
J Benda
Date
2021 - 2024

Read metadata from a K-matrix file, count K-matrices and store the unit and dataset for later use in retrieval of the K-matrices themselves. The K-matrices are not being read into memory here to avoid exhausting RAM (particularly in parallel mode) if the K-matrices are large.

Definition at line 353 of file multidip_io.F90.

◆ read_molecular_data()

subroutine multidip_io::read_molecular_data ( type(moleculardata), intent(inout) moldat,
character(*), intent(in) filename,
logical, intent(in) mpiio,
logical, intent(in) read_wmat2 )

Read RMT molecular_data file.

Author
J Benda
Date
2020 - 2023

Read data from the RMT molecular_data file. This includes in particular both the inner and outer region transition dipole elements, as well as for instance Gaunt angular integrals for all partial waves used.

Definition at line 728 of file multidip_io.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_target_properties()

subroutine multidip_io::read_target_properties ( integer, intent(in) lutarg,
real(wp), dimension(:,:,:), intent(inout), allocatable prop,
real(wp), dimension(:), intent(inout), allocatable etarg )

Read ion transition dipoles.

Author
J Benda
Date
2021

Read ion target transition dipoles from a DENPROP file.

Definition at line 892 of file multidip_io.F90.

Here is the caller graph for this function:

◆ read_wfncoeffs()

subroutine multidip_io::read_wfncoeffs ( type(scatakcoeffs), dimension(:), intent(inout), allocatable ak,
integer, dimension(:), intent(in) lusct )

Read wave function coefficients from files.

Author
J Benda
Date
2020

Read wave function (Ak) coefficients from an unformatted file written by RSOLVE. This is an optional functionality meant for dabugging. It is recommended that the Ak coefficients are calculated by the present program instead to avoid storing large datasets on disk or in memory.

Definition at line 528 of file multidip_io.F90.

Here is the caller graph for this function:

◆ read_wfncoeffs_file()

subroutine multidip_io::read_wfncoeffs_file ( class(scatakcoeffs), intent(inout) ak)

Read wave function coefficients for a single symmetry from a file.

Author
J Benda
Date
2021

Definition at line 595 of file multidip_io.F90.

◆ reset_kmatrix_position()

subroutine multidip_io::reset_kmatrix_position ( class(kmatrix), intent(in) km,
integer, intent(in), optional skip )

Reset I/O pointer to start of K-matrices.

Author
J Benda
Date
2021

Rewind the unit to the start of the associated dataset and read through to the very beginning of the actual K-matrix data. Also skip the given number of leading K-matrices. This prepares the file for the subsequent calls to get_kmatrix.

Definition at line 431 of file multidip_io.F90.

◆ reset_wfncoeffs_position()

subroutine multidip_io::reset_wfncoeffs_position ( class(scatakcoeffs), intent(in) ak,
integer, intent(in), optional skip )

Reset I/O pointer to start of Ak-coeffs.

Author
J Benda
Date
2021

Rewind the unit to the start of the associated dataset and read through to the very beginning of the actual Ak-coeffs data. Also skip the given number of leading Ak-coeffs. This prepares the file for the subsequent calls to get_wfncoeffs.

Definition at line 649 of file multidip_io.F90.

◆ scale_boundary_amplitudes()

subroutine multidip_io::scale_boundary_amplitudes ( type(moleculardata), intent(in) moldat,
integer, intent(in) irr,
real(wp), dimension(:), intent(in) v,
real(wp), dimension(:, :), intent(inout) vw )

Scale boundary amplitudes matrix by a diagonal matrix.

Authors
J Benda
Date
2020 - 2024

Multiply boundary amplitudes for each inner region state by an element of the provided vector 'v'. Writes the result into 'vw'.

Definition at line 1240 of file multidip_io.F90.

Here is the caller graph for this function:

◆ setup_angular_integrals()

subroutine multidip_io::setup_angular_integrals ( type(moleculardata), intent(inout) moldat)

Store the angular integrals in a more convenient shape.

Author
J Benda
Date
2020 - 2024

Convert the Gaunt integral storage from a list to an easily addressable matrix.

Definition at line 957 of file multidip_io.F90.

Here is the caller graph for this function:

◆ write_cross_section()

subroutine multidip_io::write_cross_section ( real(wp), dimension(:, :), intent(in) cs,
integer, intent(in) nesc,
integer, dimension(2), intent(in) erange,
character(len=*), intent(in) filename )

Write cross sections to a file.

Author
J Benda
Date
2020 - 2024

Write cross sections to a file. The first column of the array is expected to be the photon energy.

Definition at line 1553 of file multidip_io.F90.

Here is the caller graph for this function:

◆ write_energy_grid()

subroutine multidip_io::write_energy_grid ( real(wp), dimension(:), intent(in) escat)

Write photoelectron energies to file.

Author
J Benda
Date
2023

Write the column list of photoelectron scattering energies to file. Atomic units are used.

Definition at line 1271 of file multidip_io.F90.

Here is the caller graph for this function:

◆ write_partial_wave_moments()

subroutine multidip_io::write_partial_wave_moments ( type(moleculardata), intent(in) moldat,
complex(wp), dimension(:, :, :), intent(in), allocatable m,
integer, intent(in) nesc,
character(len=*), intent(in) suffix )

Write partial wave moments.

Author
J Benda
Date
2020 - 2024

Produce tables with the multi-photon ionisation matrix elements per partial wave.

Definition at line 1290 of file multidip_io.F90.

Here is the caller graph for this function:

◆ write_raw_dipoles()

subroutine multidip_io::write_raw_dipoles ( complex(wp), dimension(:, :, :, :), intent(in), allocatable m,
integer, dimension(:, :), intent(in), allocatable chains,
integer, intent(in) nesc,
character(len=*), intent(in) stem )

Write raw transition dipole moments.

Author
J Benda
Date
2021 - 2024

Produce tables with the multi-photon ionisation matrix elements per partial wave and per ionisation chain.

Definition at line 1347 of file multidip_io.F90.

Here is the caller graph for this function:

◆ write_rsolve_dipoles()

subroutine multidip_io::write_rsolve_dipoles ( type(moleculardata), intent(in) moldat,
complex(wp), dimension(:, :, :, :), intent(in), allocatable m,
integer, dimension(:, :), intent(in), allocatable chains,
real(wp), dimension(:), intent(in) escat,
integer, intent(in) lu_pw_dipoles )

Write transition dipole moments in RSOLVE format.

Author
J Benda, Z Masin
Date
2021 - 2024

Produce tables with 1-photon ionisation matrix elements in the format of RSOLVE.

Definition at line 1420 of file multidip_io.F90.

Here is the caller graph for this function:

Variable Documentation

◆ myproc

integer multidip_io::myproc = 1

Definition at line 48 of file multidip_io.F90.

◆ nprocs

integer multidip_io::nprocs = 1

Definition at line 49 of file multidip_io.F90.