14 use,
intrinsic :: iso_fortran_env
57 type(wannier_opts_t) :: options
58 complex(real64),
allocatable :: u_matrix(:,:,:)
59 complex(real64),
allocatable :: u_dis_matrix(:,:,:)
60 real(real64),
allocatable :: centers(:,:)
62 type(lib_common_type) :: w90main
81 class(wannier_t),
intent(inout) :: this
82 type(namespace_t),
intent(in) :: namespace
83 type(kpoints_t),
intent(in) :: kpoints
88 call this%options%parse_oct(namespace)
90 call this%options%parse_win()
93 safe_allocate(this%u_matrix(1:this%options%num_wann, 1:this%options%num_wann, 1:product(kpoints%nik_axis)))
94 safe_allocate(this%u_dis_matrix(1:this%options%num_bands, 1:this%options%num_wann, 1:product(kpoints%nik_axis)))
95 safe_allocate(this%centers(1:3, 1:this%options%num_wann))
109 class(wannier_t),
intent(inout) :: this
110 type(namespace_t),
intent(in) :: namespace
111 type(states_elec_t),
intent(in) :: st
112 type(ions_t),
intent(in) :: ions
113 type(kpoints_t),
intent(in) :: kpoints
123 this%options, this%w90main, stdout, stderr, ierr)
125 write(
message(1),
'(a,i0)')
'Error initializing wannier90 library object: ', ierr
140 class(wannier_t),
intent(inout) :: this
141 type(kpoints_t),
intent(in) :: kpoints
142 type(electron_space_t),
intent(in) :: space
147 if (space%dim /= 3)
then
154 call w90_set_u_matrix(this%w90main, this%u_matrix)
155 call w90_set_u_opt(this%w90main, this%u_dis_matrix)
156 this%w90main%wannier_data%centres = this%centers
170 class(
mesh_t),
intent(in) :: gr
179 message(1) =
'Unable to initialize TD restart for Wannier write.'
183 call restart%write_binary(
'wannier_u_matrix',
size(this%u_matrix), this%u_matrix, ierr)
185 message(1) =
'Unable to write Wannier restart data (u_matrix).'
189 call restart%write_binary(
'wannier_u_dis_matrix',
size(this%u_dis_matrix), this%u_dis_matrix, ierr)
191 message(1) =
'Unable to write Wannier restart data (u_dis_matrix).'
195 call restart%write_binary(
'wannier_centers',
size(this%centers), this%centers, ierr)
197 message(1) =
'Unable to write Wannier restart data (centers).'
214 class(
mesh_t),
intent(in) :: gr
223 message(1) =
'Unable to initialize TD restart for Wannier read.'
227 call restart%read_binary(
'wannier_u_matrix',
size(this%u_matrix), this%u_matrix, ierr)
229 message(1) =
'Unable to read Wannier restart data (u_matrix).'
233 call restart%read_binary(
'wannier_u_dis_matrix',
size(this%u_dis_matrix), this%u_dis_matrix, ierr)
235 message(1) =
'Unable to read Wannier restart data (u_dis_matrix).'
239 call restart%read_binary(
'wannier_centers',
size(this%centers), this%centers, ierr)
241 message(1) =
'Unable to read Wannier restart data (centers).'
246 call w90_set_u_matrix(this%w90main, this%u_matrix)
247 call w90_set_u_opt(this%w90main, this%u_dis_matrix)
248 this%w90main%wannier_data%centres = this%centers
260 type(
output_t),
intent(inout) :: outp
261 integer,
intent(in) :: iter
262 class(
ions_t),
intent(in) :: ions
265 character(len=MAX_PATH_LEN) :: dir, raw_dir
270 if (mod(iter, this%options%td_output_interval) == 0)
then
271 write(dir,
'(a,a,i7.7)') trim(outp%iter_dir),
"td.", iter
291 safe_deallocate_a(wan%u_matrix)
292 safe_deallocate_a(wan%u_dis_matrix)
293 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.
batches of electronic states