47#include "./base/base_uses.f90"
53 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'tip_scan_methods'
73 CHARACTER(LEN=*),
PARAMETER :: routinen =
'tip_scanning'
75 CHARACTER(LEN=default_string_length) :: cname
76 INTEGER :: handle, iounit, iscan, iset, nscan, &
78 LOGICAL :: do_tip_scan, expot, scf_converged
79 REAL(kind=
dp),
DIMENSION(3) :: rpos
82 TYPE(
mo_set_type),
ALLOCATABLE,
DIMENSION(:) :: mos_ref
91 CALL timeset(routinen, handle)
99 cname = logger%iter_info%project_name
100 logger%iter_info%project_name = logger%iter_info%project_name//
"+TIP_SCAN"
101 plevel = logger%iter_info%print_level
105 WRITE (iounit,
"(T2,A)")
"TIP SCAN| Perform a Tip Scanning Calculation"
111 CALL read_tip_file(qs_env, scan_env)
113 CALL get_qs_env(qs_env, ks_env=ks_env, pw_env=pw_env, &
114 dft_control=dft_control)
115 expot = dft_control%apply_external_potential
116 dft_control%apply_external_potential = .true.
123 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
126 CALL auxbas_pw_pool%create_pw(vtip)
128 CALL auxbas_pw_pool%create_pw(vref)
130 CALL auxbas_pw_pool%create_pw(sf)
138 ALLOCATE (mos_ref(nset))
143 nscan = scan_env%num_scan_points
145 WRITE (iounit,
"(T2,A,T74,I7)")
"TIP SCAN| Number of scanning points ", nscan
146 WRITE (iounit,
"(T2,A)")
"TIP SCAN| Start scanning ..."
151 WRITE (iounit,
"(T2,A,I7)", advance=
"NO")
"TIP SCAN| Scan point ", iscan
155 rpos(1:3) = scan_env%tip_pos(1:3, iscan) - scan_env%ref_point(1:3)
156 CALL shift_tip_potential(vref, sf, vtip, rpos)
158 IF (
ASSOCIATED(vee))
THEN
159 CALL pw_axpy(vee, vtip, alpha=1.0_dp)
170 CALL scf(qs_env, has_converged=scf_converged, total_scf_steps=tsteps)
173 IF (scf_converged)
THEN
174 WRITE (iounit,
"(T25,A,I4,A)")
"SCF converged in ", tsteps,
" steps"
176 WRITE (iounit,
"(T31,A)")
"SCF did not converge!"
183 WRITE (iounit,
"(T2,A)")
"TIP SCAN| ... end scanning"
185 dft_control%apply_external_potential = expot
193 CALL auxbas_pw_pool%give_back_pw(vtip)
194 CALL auxbas_pw_pool%give_back_pw(vref)
195 CALL auxbas_pw_pool%give_back_pw(sf)
198 logger%iter_info%print_level = plevel
199 logger%iter_info%project_name = cname
210 CALL timestop(handle)
223 SUBROUTINE shift_tip_potential(vref, sf, vtip, rpos)
227 REAL(kind=
dp),
DIMENSION(3),
INTENT(IN) :: rpos
229 CHARACTER(LEN=*),
PARAMETER :: routinen =
'shift_tip_potential'
233 CALL timeset(routinen, handle)
239 CALL timestop(handle)
241 END SUBROUTINE shift_tip_potential
250 SUBROUTINE read_tip_file(qs_env, scan_env)
254 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_tip_file'
256 INTEGER :: extunit, handle, i, nat
257 INTEGER,
DIMENSION(3) :: npts
258 REAL(kind=
dp) :: scaling
259 REAL(kind=
dp),
DIMENSION(3) :: rdum
260 REAL(kind=
dp),
DIMENSION(3, 3) :: dcell
264 CALL timeset(routinen, handle)
268 IF (para_env%is_source())
THEN
269 CALL open_file(file_name=scan_env%tip_cube_file, &
271 file_form=
"FORMATTED", &
272 file_action=
"READ", &
278 READ (extunit, *) nat, rdum
280 READ (extunit, *) npts(i), dcell(i, 1:3)
281 dcell(i, 1:3) = npts(i)*dcell(i, 1:3)
286 CALL para_env%bcast(npts)
287 CALL para_env%bcast(dcell)
291 CALL scan_env%tip_pw_r%create(pw_grid)
295 CALL cp_cube_to_pw(scan_env%tip_pw_r, scan_env%tip_cube_file, scaling, silent=.true.)
296 CALL scan_env%tip_pw_g%create(pw_grid)
297 CALL pw_transfer(scan_env%tip_pw_r, scan_env%tip_pw_g)
300 CALL timestop(handle)
302 END SUBROUTINE read_tip_file
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
Utility routines to open and close files. Tracking of preconnections.
subroutine, public open_file(file_name, file_status, file_form, file_action, file_position, file_pad, unit_number, debug, skip_get_unit_number, file_access)
Opens the requested file using a free unit number.
subroutine, public close_file(unit_number, file_status, keep_preconnection)
Close an open file given by its logical unit number. Optionally, keep the file and unit preconnected.
various routines to log and control the output. The idea is that decisions about where to log should ...
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer, parameter, public silent_print_level
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_cube_to_pw(grid, filename, scaling, silent)
Thin wrapper around routine cube_to_pw.
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
Interface to the message passing library MPI.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
This module defines the grid data type and some basic operations on it.
subroutine, public pw_grid_release(pw_grid)
releases the given pw grid
subroutine, public pw_structure_factor(sf, r)
Calculate the structure factor for point r.
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, harris_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, wanniercentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, eeq, rhs)
Get the QUICKSTEP environment.
subroutine, public set_ks_env(ks_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, complex_ks, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, kinetic, matrix_s, matrix_s_ri_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_ri_aux_kp, matrix_ks_im_kp, vppl, rho_core, rho_nlcc, rho_nlcc_g, vee, neighbor_list_id, kpoints, sab_orb, sab_all, sac_ae, sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_pp, sab_xtb_nonbond, sab_vdw, sab_scp, sab_almo, sab_kp, sab_kp_nosym, task_list, task_list_soft, subsys, dft_control, dbcsr_dist, distribution_2d, pw_env, para_env, blacs_env)
...
Definition and initialisation of the mo data type.
subroutine, public duplicate_mo_set(mo_set_new, mo_set_old)
allocate a new mo_set, and copy the old data
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
subroutine, public reassign_allocated_mos(mo_set_new, mo_set_old)
reassign an already allocated mo_set
Routines for the Quickstep SCF run.
subroutine, public scf(qs_env, has_converged, total_scf_steps)
perform an scf procedure in the given qs_env
subroutine, public tip_scanning(qs_env, input_section)
Perform tip scanning calculation.
subroutine, public release_scanning_type(scan_info)
...
subroutine, public read_scanning_section(scan_info, input_section)
...
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
calculation environment to calculate the ks matrix, holds all the needed vars. assumes that the core ...