14 use,
intrinsic :: iso_fortran_env
56 type(wannier_opts_t) :: options
57 complex(real64),
allocatable :: u_matrix(:,:,:)
58 complex(real64),
allocatable :: u_dis_matrix(:,:,:)
59 real(real64),
allocatable :: centers(:,:)
61 type(lib_common_type) :: w90main
80 class(wannier_t),
intent(inout) :: this
81 type(namespace_t),
intent(in) :: namespace
82 type(kpoints_t),
intent(in) :: kpoints
87 call this%options%parse_oct(namespace)
89 call this%options%parse_win()
92 safe_allocate(this%u_matrix(1:this%options%num_wann, 1:this%options%num_wann, 1:product(kpoints%nik_axis)))
93 safe_allocate(this%u_dis_matrix(1:this%options%num_bands, 1:this%options%num_wann, 1:product(kpoints%nik_axis)))
94 safe_allocate(this%centers(1:3, 1:this%options%num_wann))
108 class(wannier_t),
intent(inout) :: this
109 type(namespace_t),
intent(in) :: namespace
110 type(states_elec_t),
intent(in) :: st
111 type(ions_t),
intent(in) :: ions
112 type(kpoints_t),
intent(in) :: kpoints
122 this%options, this%w90main, stdout, stderr, ierr)
124 write(
message(1),
'(a,i0)')
'Error initializing wannier90 library object: ', ierr
139 class(wannier_t),
intent(inout) :: this
140 type(kpoints_t),
intent(in) :: kpoints
141 type(electron_space_t),
intent(in) :: space
146 if (space%dim /= 3)
then
153 call w90_set_u_matrix(this%w90main, this%u_matrix)
154 call w90_set_u_opt(this%w90main, this%u_dis_matrix)
155 this%w90main%wannier_data%centres = this%centers
169 class(
mesh_t),
intent(in) :: gr
178 message(1) =
'Unable to initialize TD restart for Wannier write.'
182 call restart%write_binary(
'wannier_u_matrix',
size(this%u_matrix), this%u_matrix, ierr)
184 message(1) =
'Unable to write Wannier restart data (u_matrix).'
188 call restart%write_binary(
'wannier_u_dis_matrix',
size(this%u_dis_matrix), this%u_dis_matrix, ierr)
190 message(1) =
'Unable to write Wannier restart data (u_dis_matrix).'
194 call restart%write_binary(
'wannier_centers',
size(this%centers), this%centers, ierr)
196 message(1) =
'Unable to write Wannier restart data (centers).'
213 class(
mesh_t),
intent(in) :: gr
222 message(1) =
'Unable to initialize TD restart for Wannier read.'
226 call restart%read_binary(
'wannier_u_matrix',
size(this%u_matrix), this%u_matrix, ierr)
228 message(1) =
'Unable to read Wannier restart data (u_matrix).'
232 call restart%read_binary(
'wannier_u_dis_matrix',
size(this%u_dis_matrix), this%u_dis_matrix, ierr)
234 message(1) =
'Unable to read Wannier restart data (u_dis_matrix).'
238 call restart%read_binary(
'wannier_centers',
size(this%centers), this%centers, ierr)
240 message(1) =
'Unable to read Wannier restart data (centers).'
245 call w90_set_u_matrix(this%w90main, this%u_matrix)
246 call w90_set_u_opt(this%w90main, this%u_dis_matrix)
247 this%w90main%wannier_data%centres = this%centers
259 type(
output_t),
intent(inout) :: outp
260 integer,
intent(in) :: iter
261 class(
ions_t),
intent(in) :: ions
264 character(len=MAX_PATH_LEN) :: dir, raw_dir
269 if (mod(iter, this%options%td_output_interval) == 0)
then
270 write(dir,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
290 safe_deallocate_a(wan%u_matrix)
291 safe_deallocate_a(wan%u_dis_matrix)
292 safe_deallocate_a(wan%centers)
real(real64), parameter, public m_zero
character(len=max_path_len) function, public io_workpath(path, namespace)
construct path name from given name and namespace
subroutine, public io_mkdir(fname, namespace, parents)
This module defines the meshes, which are used in Octopus.
subroutine, public messages_not_implemented(feature, 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)
This module handles the communicators for the various parallelization strategies.
this module contains the low-level part of the output system
integer, parameter, public restart_type_dump
integer, parameter, public restart_td
integer, parameter, public restart_type_load
This module handles reading and writing restart information for the states_elec_t.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
Interface module to Wannier 90 library.
subroutine, public wannier90lib_init_w90main(namespace, ions, kpoints, st, inp_options, w90main, stdout, stderr, ierr)
Initialize wannier90 library data.
Wannier90 related calculations.
subroutine, public wannier_calc_write_centers(dir, prefix, centers, ions)
Write wannier centers to file.
subroutine, public wannier_calc_read_centers(wan_opts, centers)
Read wannier centers.
subroutine, public wannier_calc_write_u_matrices(dir, prefix, kpoints, u_matrix, u_dis_matrix)
Write U and U_dis matrices to file.
subroutine, public wannier_calc_read_u_matrices(wan_opts, kpoints, u_matrix, u_dis_matrix)
Read wannier transformation matrix.
subroutine wannier_finalize(wan)
Clean up wannier object data.
subroutine wannier_restart_write_data(this, namespace, mc, gr)
Write TD Wannier restart data.
subroutine wannier_write_iter(this, namespace, outp, iter, ions, kpoints)
Write TD Wannier data every n time steps.
subroutine wannier_init_data_from_file(this, kpoints, space)
Initialize wannier object data for TD run.
subroutine wannier_restart_read_data(this, namespace, mc, gr)
Read TD Wannier restart data.
subroutine wannier_init_from_input(this, namespace, kpoints)
Initialize wannier object options from input files.
subroutine wannier_init_parallelization(this, namespace, st, ions, kpoints)
Initialize parallelization for wannier object.
integer, parameter, public td_wannier_method_none
Describes mesh distribution to nodes.
Stores all communicators and groups.
Main object containing all Wannier-related data and methods.