diff --git a/src/admm_dm_methods.F b/src/admm_dm_methods.F index 4b59a1af90..4d7fe80855 100644 --- a/src/admm_dm_methods.F +++ b/src/admm_dm_methods.F @@ -27,8 +27,8 @@ MODULE admm_dm_methods do_admm_blocked_projection USE iterate_matrix, ONLY: invert_Hotelling USE kinds, ONLY: dp - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -238,8 +238,8 @@ SUBROUTINE update_rho_aux(qs_env) TYPE(admm_dm_type), POINTER :: admm_dm TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao_aux TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_aux + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_aux TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_aux TYPE(task_list_type), POINTER :: task_list_aux_fit diff --git a/src/admm_methods.F b/src/admm_methods.F index 54796e028b..810593186a 100644 --- a/src/admm_methods.F +++ b/src/admm_methods.F @@ -13,7 +13,7 @@ !> \author Manuel Guidon ! ************************************************************************************************** MODULE admm_methods - USE admm_types, ONLY: admm_gapw_r3d_type,& + USE admm_types, ONLY: admm_gapw_r3d_rs_type,& admm_type,& get_admm_env USE atomic_kind_types, ONLY: atomic_kind_type @@ -90,8 +90,8 @@ MODULE admm_methods z_zero USE message_passing, ONLY: mp_para_env_type USE parallel_gemm_api, ONLY: parallel_gemm - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& @@ -161,8 +161,8 @@ SUBROUTINE admm_mo_calc_rho_aux(qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(mo_set_type), DIMENSION(:), POINTER :: mos, mos_aux_fit TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_aux + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_aux TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit TYPE(task_list_type), POINTER :: task_list @@ -322,8 +322,8 @@ SUBROUTINE admm_mo_calc_rho_aux_kp(qs_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_aux_fit, sab_kp - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_aux + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_aux TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_aux_fit, rho_orb TYPE(qs_scf_env_type), POINTER :: scf_env @@ -2393,7 +2393,7 @@ SUBROUTINE calc_spin_dep_aux_exch_ener(qs_env, admm_env, ener_k_ispin, ener_x_is LOGICAL :: gapw REAL(dp) :: tmp REAL(KIND=dp), DIMENSION(:), POINTER :: tot_rho_r - TYPE(admm_gapw_r3d_type), POINTER :: admm_gapw_env + TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_ks_aux_fit_hfx, rho_ao_aux, & @@ -2401,8 +2401,8 @@ SUBROUTINE calc_spin_dep_aux_exch_ener(qs_env, admm_env, ener_k_ispin, ener_x_is TYPE(dft_control_type), POINTER :: dft_control TYPE(local_rho_type), POINTER :: local_rho_buffer TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, v_rspace_dummy, v_tau_rspace_dummy + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, v_rspace_dummy, v_tau_rspace_dummy TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_aux_fit, rho_aux_fit_buffer TYPE(section_vals_type), POINTER :: xc_section_aux diff --git a/src/admm_types.F b/src/admm_types.F index 213ebe1c88..161a8543ea 100644 --- a/src/admm_types.F +++ b/src/admm_types.F @@ -63,7 +63,7 @@ MODULE admm_types IMPLICIT NONE PRIVATE - PUBLIC :: admm_env_create, admm_env_release, admm_type, admm_gapw_r3d_type, set_admm_env, get_admm_env + PUBLIC :: admm_env_create, admm_env_release, admm_type, admm_gapw_r3d_rs_type, set_admm_env, get_admm_env CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'admm_types' @@ -82,12 +82,12 @@ MODULE admm_types !> \param task_list the task list used for all soft density pw operations !> \param oce stores the precomputed oce integrals ! ************************************************************************************************** - TYPE admm_gapw_r3d_type + TYPE admm_gapw_r3d_rs_type TYPE(qs_kind_type), DIMENSION(:), POINTER :: admm_kind_set => Null() TYPE(local_rho_type), POINTER :: local_rho_set => Null() TYPE(task_list_type), POINTER :: task_list => Null() TYPE(oce_matrix_type), POINTER :: oce => Null() - END TYPE admm_gapw_r3d_type + END TYPE admm_gapw_r3d_rs_type ! ************************************************************************************************** !> \brief stores some data used in wavefunction fitting @@ -178,7 +178,7 @@ MODULE admm_types LOGICAL :: block_dm = .FALSE. LOGICAL :: block_fit = .FALSE. INTEGER, DIMENSION(:, :), POINTER :: block_map => Null() - TYPE(admm_gapw_r3d_type), POINTER :: admm_gapw_env => NULL() + TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env => NULL() LOGICAL :: do_gapw = .FALSE. TYPE(admm_dm_type), POINTER :: admm_dm => Null() @@ -539,7 +539,7 @@ END SUBROUTINE admm_env_release ! ************************************************************************************************** SUBROUTINE admm_gapw_env_release(admm_gapw_env) - TYPE(admm_gapw_r3d_type), POINTER :: admm_gapw_env + TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env IF (ASSOCIATED(admm_gapw_env%admm_kind_set)) THEN CALL deallocate_qs_kind_set(admm_gapw_env%admm_kind_set) diff --git a/src/aobasis/soft_basis_set.F b/src/aobasis/soft_basis_set.F index 9ea09632aa..5475f4ecb4 100644 --- a/src/aobasis/soft_basis_set.F +++ b/src/aobasis/soft_basis_set.F @@ -53,16 +53,16 @@ MODULE soft_basis_set !> \param rc ... !> \param paw_atom ... !> \param paw_type_forced ... -!> \param gpw_r3d_type_forced ... +!> \param gpw_r3d_rs_type_forced ... !> \version 1.0 ! ************************************************************************************************** SUBROUTINE create_soft_basis(orb_basis, soft_basis, eps_fit, rc, paw_atom, & - paw_type_forced, gpw_r3d_type_forced) + paw_type_forced, gpw_r3d_rs_type_forced) TYPE(gto_basis_set_type), POINTER :: orb_basis, soft_basis REAL(dp), INTENT(IN) :: eps_fit, rc LOGICAL, INTENT(OUT) :: paw_atom - LOGICAL, INTENT(IN) :: paw_type_forced, gpw_r3d_type_forced + LOGICAL, INTENT(IN) :: paw_type_forced, gpw_r3d_rs_type_forced CHARACTER(LEN=default_string_length) :: bsname INTEGER :: ico, ipgf, ipgf_s, iset, iset_s, ishell, lshell, lshell_old, m, maxco, maxpgf, & @@ -70,19 +70,19 @@ SUBROUTINE create_soft_basis(orb_basis, soft_basis, eps_fit, rc, paw_atom, & INTEGER, ALLOCATABLE, DIMENSION(:) :: iset_s2h INTEGER, DIMENSION(:), POINTER :: lmax, lmin, npgf, nshell INTEGER, DIMENSION(:, :), POINTER :: l, n - LOGICAL :: my_gpw_r3d_type_forced + LOGICAL :: my_gpw_r3d_rs_type_forced REAL(KIND=dp) :: minzet, radius REAL(KIND=dp), DIMENSION(:, :), POINTER :: zet REAL(KIND=dp), DIMENSION(:, :, :), POINTER :: gcc NULLIFY (gcc, l, lmax, lmin, n, npgf, nshell, zet) paw_atom = .FALSE. - my_gpw_r3d_type_forced = gpw_r3d_type_forced + my_gpw_r3d_rs_type_forced = gpw_r3d_rs_type_forced IF (paw_type_forced) THEN paw_atom = .TRUE. - my_gpw_r3d_type_forced = .FALSE. + my_gpw_r3d_rs_type_forced = .FALSE. END IF - IF (.NOT. my_gpw_r3d_type_forced) THEN + IF (.NOT. my_gpw_r3d_rs_type_forced) THEN CALL get_gto_basis_set(gto_basis_set=orb_basis, name=bsname, & maxpgf=maxpgf, maxshell=maxshell, nset=nset) diff --git a/src/cp_ddapc.F b/src/cp_ddapc.F index 4246a85671..3a38eb54e4 100644 --- a/src/cp_ddapc.F +++ b/src/cp_ddapc.F @@ -42,10 +42,8 @@ MODULE cp_ddapc pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -83,8 +81,8 @@ SUBROUTINE qs_ks_ddapc(qs_env, auxbas_pw_pool, rho_tot_gspace, v_hartree_gspace, TYPE(qs_environment_type), POINTER :: qs_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_r3d_type), POINTER :: v_spin_ddapc_rest_r + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_r3d_rs_type), POINTER :: v_spin_ddapc_rest_r TYPE(qs_energy_type), POINTER :: energy LOGICAL, INTENT(in) :: calculate_forces TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: ks_matrix @@ -98,8 +96,8 @@ SUBROUTINE qs_ks_ddapc(qs_env, auxbas_pw_pool, rho_tot_gspace, v_hartree_gspace, TYPE(cp_logger_type), POINTER :: logger TYPE(ddapc_restraint_type), POINTER :: ddapc_restraint_control TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: v_spin_ddapc_rest_g - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_c1d_gs_type) :: v_spin_ddapc_rest_g + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace NULLIFY (v_hartree_rspace, dft_control) @@ -136,13 +134,11 @@ SUBROUTINE qs_ks_ddapc(qs_env, auxbas_pw_pool, rho_tot_gspace, v_hartree_gspace, dft_control%qs_control%ddapc_explicit_potential = explicit_potential dft_control%qs_control%ddapc_restraint_is_spin = ddapc_restraint_is_spin IF (explicit_potential) THEN - CALL auxbas_pw_pool%create_pw(v_spin_ddapc_rest_g, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_spin_ddapc_rest_g) CALL pw_zero(v_spin_ddapc_rest_g) NULLIFY (v_spin_ddapc_rest_r) ALLOCATE (v_spin_ddapc_rest_r) - CALL auxbas_pw_pool%create_pw(v_spin_ddapc_rest_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_spin_ddapc_rest_r) END IF IF (calculate_forces) CALL reset_ch_pulay(qs_env) @@ -228,9 +224,9 @@ END SUBROUTINE qs_ks_ddapc SUBROUTINE cp_ddapc_apply_CD(qs_env, rho_tot_gspace, energy, v_hartree_gspace, & calculate_forces, Itype_of_density) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_gspace REAL(KIND=dp), INTENT(INOUT) :: energy - TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: v_hartree_gspace LOGICAL, INTENT(IN), OPTIONAL :: calculate_forces CHARACTER(LEN=*) :: Itype_of_density @@ -363,7 +359,7 @@ SUBROUTINE cp_ddapc_apply_RS(qs_env, energy_res, v_hartree_gspace, & v_spin_ddapc_rest_g, ddapc_restraint_control, calculate_forces) TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), INTENT(INOUT), OPTIONAL :: energy_res - TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace, v_spin_ddapc_rest_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: v_hartree_gspace, v_spin_ddapc_rest_g TYPE(ddapc_restraint_type), POINTER :: ddapc_restraint_control LOGICAL, INTENT(IN), OPTIONAL :: calculate_forces @@ -466,9 +462,9 @@ END SUBROUTINE cp_ddapc_apply_RS SUBROUTINE cp_ddapc_apply_RF(qs_env, rho_tot_gspace, energy, & v_hartree_gspace, calculate_forces, Itype_of_density) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_gspace REAL(KIND=dp), INTENT(INOUT) :: energy - TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: v_hartree_gspace LOGICAL, INTENT(IN), OPTIONAL :: calculate_forces CHARACTER(LEN=*) :: Itype_of_density diff --git a/src/cp_ddapc_forces.F b/src/cp_ddapc_forces.F index 97452eaf35..c1d4537f94 100644 --- a/src/cp_ddapc_forces.F +++ b/src/cp_ddapc_forces.F @@ -32,7 +32,7 @@ MODULE cp_ddapc_forces USE message_passing, ONLY: mp_para_env_type USE particle_types, ONLY: particle_type USE pw_spline_utils, ONLY: Eval_d_Interp_Spl3_pbc - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_force_types, ONLY: qs_force_type @@ -74,7 +74,7 @@ MODULE cp_ddapc_forces RECURSIVE SUBROUTINE ewald_ddapc_force(qs_env, coeff, apply_qmmm_periodic, & factor, multipole_section, cell, particle_set, radii, dq, charges) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(IN), POINTER :: coeff + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: coeff LOGICAL, INTENT(IN) :: apply_qmmm_periodic REAL(KIND=dp), INTENT(IN) :: factor TYPE(section_vals_type), POINTER :: multipole_section diff --git a/src/cp_ddapc_methods.F b/src/cp_ddapc_methods.F index 98567baf93..71d6ec285f 100644 --- a/src/cp_ddapc_methods.F +++ b/src/cp_ddapc_methods.F @@ -28,8 +28,8 @@ MODULE cp_ddapc_methods USE message_passing, ONLY: mp_para_env_type USE particle_types, ONLY: particle_type USE pw_spline_utils, ONLY: Eval_Interp_Spl3_pbc - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE spherical_harmonics, ONLY: legendre #include "./base/base_uses.f90" @@ -62,7 +62,7 @@ SUBROUTINE ddapc_eval_gfunc(gfunc, w, gcut, rho_tot_g, radii) REAL(KIND=dp), DIMENSION(:, :), POINTER :: gfunc REAL(kind=dp), DIMENSION(:), POINTER :: w REAL(KIND=dp), INTENT(IN) :: gcut - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(kind=dp), DIMENSION(:), POINTER :: radii CHARACTER(len=*), PARAMETER :: routineN = 'ddapc_eval_gfunc' @@ -115,7 +115,7 @@ SUBROUTINE build_b_vector(bv, gfunc, w, particle_set, radii, rho_tot_g, gcut) REAL(KIND=dp), DIMENSION(:), POINTER :: w TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), POINTER :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut CHARACTER(len=*), PARAMETER :: routineN = 'build_b_vector' @@ -193,7 +193,7 @@ SUBROUTINE build_A_matrix(Am, gfunc, w, particle_set, radii, rho_tot_g, gcut, g_ REAL(KIND=dp), DIMENSION(:), POINTER :: w TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), POINTER :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut REAL(KIND=dp), DIMENSION(:, :), INTENT(IN) :: g_dot_rvec_sin, g_dot_rvec_cos @@ -279,7 +279,7 @@ SUBROUTINE build_der_b_vector(dbv, gfunc, w, particle_set, radii, rho_tot_g, gcu REAL(KIND=dp), DIMENSION(:), POINTER :: w TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut INTEGER, INTENT(IN) :: iparticle0 @@ -371,7 +371,7 @@ SUBROUTINE build_der_A_matrix_rows(dAm, gfunc, w, particle_set, radii, & REAL(KIND=dp), DIMENSION(:), POINTER :: w TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), POINTER :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut INTEGER, INTENT(IN) :: iparticle0, nparticles REAL(KIND=dp), DIMENSION(:, :), INTENT(IN) :: g_dot_rvec_sin, g_dot_rvec_cos @@ -489,7 +489,7 @@ END SUBROUTINE cleanup_g_dot_rvec_sin_cos !> \param g_dot_rvec_cos ... ! ************************************************************************************************** SUBROUTINE prep_g_dot_rvec_sin_cos(rho_tot_g, particle_set, gcut, g_dot_rvec_sin, g_dot_rvec_cos) - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), INTENT(IN) :: gcut REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: g_dot_rvec_sin, g_dot_rvec_cos @@ -547,7 +547,7 @@ SUBROUTINE ddapc_eval_AmI(GAmI, c0, gfunc, w, particle_set, gcut, & REAL(KIND=dp), DIMENSION(:), POINTER :: w TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), INTENT(IN) :: gcut - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), DIMENSION(:), POINTER :: radii INTEGER, INTENT(IN) :: iw REAL(KIND=dp), INTENT(IN) :: Vol @@ -625,7 +625,7 @@ END SUBROUTINE ddapc_eval_AmI RECURSIVE SUBROUTINE ewald_ddapc_pot(cp_para_env, coeff, factor, cell, multipole_section, & particle_set, M, radii) TYPE(mp_para_env_type), INTENT(IN) :: cp_para_env - TYPE(pw_r3d_type), INTENT(IN), POINTER :: coeff + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: coeff REAL(KIND=dp), INTENT(IN) :: factor TYPE(cell_type), POINTER :: cell TYPE(section_vals_type), POINTER :: multipole_section diff --git a/src/cp_ddapc_types.F b/src/cp_ddapc_types.F index 85759a3f31..79099bd352 100644 --- a/src/cp_ddapc_types.F +++ b/src/cp_ddapc_types.F @@ -35,8 +35,8 @@ MODULE cp_ddapc_types USE pw_poisson_types, ONLY: pw_poisson_multipole USE pw_pool_types, ONLY: pw_pool_release,& pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -71,7 +71,7 @@ MODULE cp_ddapc_types TYPE(section_vals_type), POINTER :: ewald_section => NULL() TYPE(pw_pool_type), POINTER :: pw_pool_qm => NULL(), pw_pool_mm => NULL() TYPE(pw_grid_type), POINTER :: pw_grid_qm => NULL(), pw_grid_mm => NULL() - TYPE(pw_r3d_type), POINTER :: coeff_qm => NULL(), coeff_mm => NULL() + TYPE(pw_r3d_rs_type), POINTER :: coeff_qm => NULL(), coeff_mm => NULL() END TYPE cp_ddapc_ewald_type CONTAINS @@ -102,7 +102,7 @@ SUBROUTINE cp_ddapc_create(cp_para_env, cp_ddapc_env, cp_ddapc_ewald, & TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(kind=dp), DIMENSION(:), POINTER :: radii TYPE(cell_type), POINTER :: cell, super_cell - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut INTEGER, INTENT(IN) :: iw2 REAL(KIND=dp), INTENT(IN) :: Vol diff --git a/src/cp_ddapc_util.F b/src/cp_ddapc_util.F index 073fc79d44..2d413dd948 100644 --- a/src/cp_ddapc_util.F +++ b/src/cp_ddapc_util.F @@ -47,9 +47,8 @@ MODULE cp_ddapc_util pw_copy,& pw_transfer USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_charges_types, ONLY: qs_charges_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -91,7 +90,7 @@ SUBROUTINE cp_ddapc_init(qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_g + TYPE(pw_c1d_gs_type) :: rho_tot_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pool TYPE(qs_charges_type), POINTER :: qs_charges @@ -134,7 +133,7 @@ SUBROUTINE cp_ddapc_init(qs_env) WRITE (iw, '(/,A)') " Initializing the DDAPC Environment" END IF CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pool) - CALL auxbas_pool%create_pw(rho_tot_g, in_space=RECIPROCALSPACE) + CALL auxbas_pool%create_pw(rho_tot_g) Vol = rho_tot_g%pw_grid%vol ! ! Get Input Parameters @@ -208,7 +207,7 @@ RECURSIVE SUBROUTINE get_ddapc(qs_env, calc_force, density_fit_section, & REAL(KIND=dp), DIMENSION(:), OPTIONAL, POINTER :: qout1, qout2, out_radii REAL(KIND=dp), DIMENSION(:, :, :), OPTIONAL, & POINTER :: dq_out - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: ext_rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: ext_rho_tot_g CHARACTER(LEN=*), OPTIONAL :: Itype_of_density INTEGER, INTENT(IN), OPTIONAL :: iwc @@ -231,12 +230,12 @@ RECURSIVE SUBROUTINE get_ddapc(qs_env, calc_force, density_fit_section, & TYPE(cp_logger_type), POINTER :: logger TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_g - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_c1d_type), POINTER :: rho0_s_gs, rho_core + TYPE(pw_c1d_gs_type) :: rho_tot_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs, rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_charges_type), POINTER :: qs_charges TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_type), POINTER :: rho @@ -275,7 +274,7 @@ RECURSIVE SUBROUTINE get_ddapc(qs_env, calc_force, density_fit_section, & END IF CALL pw_env_get(pw_env=pw_env, & auxbas_pw_pool=auxbas_pool) - CALL auxbas_pool%create_pw(rho_tot_g, in_space=RECIPROCALSPACE) + CALL auxbas_pool%create_pw(rho_tot_g) IF (PRESENT(ext_rho_tot_g)) THEN ! If provided use the input density in g-space CALL pw_transfer(ext_rho_tot_g, rho_tot_g) @@ -533,7 +532,7 @@ END SUBROUTINE get_ddapc SUBROUTINE restraint_functional_potential(v_hartree_gspace, & density_fit_section, particle_set, AmI, radii, charges, & ddapc_restraint_control, energy_res) - TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: v_hartree_gspace TYPE(section_vals_type), POINTER :: density_fit_section TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:, :), POINTER :: AmI @@ -610,7 +609,7 @@ END SUBROUTINE restraint_functional_potential ! ************************************************************************************************** SUBROUTINE modify_hartree_pot(v_hartree_gspace, density_fit_section, & particle_set, M, AmI, radii, charges) - TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: v_hartree_gspace TYPE(section_vals_type), POINTER :: density_fit_section TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:, :), POINTER :: M, AmI @@ -685,7 +684,7 @@ SUBROUTINE debug_der_b_vector(dbv, particle_set, radii, & REAL(KIND=dp), DIMENSION(:, :), INTENT(IN) :: dbv TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), POINTER :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut INTEGER, INTENT(in) :: iparticle REAL(KIND=dp), INTENT(IN) :: Vol @@ -758,7 +757,7 @@ SUBROUTINE debug_der_A_matrix(dAm, particle_set, radii, & REAL(KIND=dp), DIMENSION(:, :, :), INTENT(IN) :: dAm TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), POINTER :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g REAL(KIND=dp), INTENT(IN) :: gcut INTEGER, INTENT(in) :: iparticle REAL(KIND=dp), INTENT(IN) :: Vol @@ -840,7 +839,7 @@ SUBROUTINE debug_charge(dqv, qs_env, density_fit_section, & TYPE(section_vals_type), POINTER :: density_fit_section TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), DIMENSION(:), POINTER :: radii - TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_tot_g CHARACTER(LEN=*) :: type_of_density CHARACTER(len=*), PARAMETER :: routineN = 'debug_charge' diff --git a/src/cp_realspace_grid_cube.F b/src/cp_realspace_grid_cube.F index 45ff997141..abf48f340c 100644 --- a/src/cp_realspace_grid_cube.F +++ b/src/cp_realspace_grid_cube.F @@ -14,7 +14,7 @@ MODULE cp_realspace_grid_cube USE cp_output_handling, ONLY: cp_mpi_io_get USE kinds, ONLY: dp USE particle_list_types, ONLY: particle_list_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE realspace_grid_cube, ONLY: cube_to_pw,& pw_to_cube,& pw_to_simple_volumetric @@ -42,7 +42,7 @@ MODULE cp_realspace_grid_cube !> \param mpi_io True if cube should be written in parallel using MPI ! ************************************************************************************************** SUBROUTINE cp_pw_to_cube(pw, unit_nr, title, particles, stride, zero_tails, silent, mpi_io) - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw INTEGER, INTENT(IN) :: unit_nr CHARACTER(*), INTENT(IN), OPTIONAL :: title TYPE(particle_list_type), POINTER :: particles @@ -87,10 +87,10 @@ END SUBROUTINE cp_pw_to_cube !> Created [Vladimir Rybkin] (08.2017) ! ************************************************************************************************** SUBROUTINE cp_pw_to_simple_volumetric(pw, unit_nr, stride, pw2) - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw INTEGER, INTENT(IN) :: unit_nr INTEGER, DIMENSION(:), OPTIONAL, POINTER :: stride - TYPE(pw_r3d_type), INTENT(IN), OPTIONAL :: pw2 + TYPE(pw_r3d_rs_type), INTENT(IN), OPTIONAL :: pw2 IF (.NOT. PRESENT(pw2)) THEN CALL pw_to_simple_volumetric(pw, unit_nr, stride) @@ -110,7 +110,7 @@ END SUBROUTINE cp_pw_to_simple_volumetric !> Created [Nico Holmberg] (09.2018) ! ************************************************************************************************** SUBROUTINE cp_cube_to_pw(grid, filename, scaling, silent) - TYPE(pw_r3d_type), INTENT(IN) :: grid + TYPE(pw_r3d_rs_type), INTENT(IN) :: grid CHARACTER(len=*), INTENT(in) :: filename REAL(kind=dp), INTENT(in) :: scaling LOGICAL, INTENT(in), OPTIONAL :: silent diff --git a/src/dm_ls_scf_qs.F b/src/dm_ls_scf_qs.F index 84a1f91101..da90275a05 100644 --- a/src/dm_ls_scf_qs.F +++ b/src/dm_ls_scf_qs.F @@ -43,10 +43,8 @@ MODULE dm_ls_scf_qs USE pw_methods, ONLY: pw_zero USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_atomic_block, ONLY: calculate_atomic_block_dm USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_density_mixing_types, ONLY: direct_mixing_nr,& @@ -637,11 +635,11 @@ SUBROUTINE write_matrix_to_cube(qs_env, ls_scf_env, matrix_p_ls, unit_nr, title, TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_ks TYPE(dbcsr_type), TARGET :: matrix_p_qs TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_subsys_type), POINTER :: subsys @@ -666,9 +664,9 @@ SUBROUTINE write_matrix_to_cube(qs_env, ls_scf_env, matrix_p_ls, unit_nr, title, CALL pw_env_get(pw_env=pw_env, & auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(pw=wf_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=wf_r) CALL pw_zero(wf_r) - CALL auxbas_pw_pool%create_pw(pw=wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw=wf_g) CALL pw_zero(wf_g) CALL calculate_rho_elec(matrix_p=matrix_p_qs, & rho=wf_r, & diff --git a/src/ec_env_types.F b/src/ec_env_types.F index 3304db08b0..9680139c9d 100644 --- a/src/ec_env_types.F +++ b/src/ec_env_types.F @@ -21,7 +21,7 @@ MODULE ec_env_types USE input_section_types, ONLY: section_vals_release,& section_vals_type USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_dispersion_types, ONLY: qs_dispersion_release,& qs_dispersion_type USE qs_force_types, ONLY: deallocate_qs_force,& @@ -106,10 +106,10 @@ MODULE ec_env_types TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_hz => Null(), matrix_wz => Null(), & matrix_z => Null(), z_admm => Null() ! Harris (rhoout), and response density (rhoz) on grid - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rhoout_r => Null(), rhoz_r => Null() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rhoout_r => Null(), rhoz_r => Null() ! potentials from input density - TYPE(pw_r3d_type) :: vh_rspace = pw_r3d_type() - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rspace => Null(), vtau_rspace => Null(), vadmm_rspace => Null() + TYPE(pw_r3d_rs_type) :: vh_rspace = pw_r3d_rs_type() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rspace => Null(), vtau_rspace => Null(), vadmm_rspace => Null() ! efield TYPE(efield_berry_type), POINTER :: efield => NULL() ! LS matrices and types diff --git a/src/ec_methods.F b/src/ec_methods.F index 63b2058ccc..3900464ce3 100644 --- a/src/ec_methods.F +++ b/src/ec_methods.F @@ -31,8 +31,8 @@ MODULE ec_methods USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& set_qs_env @@ -87,13 +87,13 @@ MODULE ec_methods SUBROUTINE create_kernel(qs_env, vxc, vxc_tau, rho, rho1_r, rho1_g, tau1_r, xc_section, compute_virial, virial_xc) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc, vxc_tau TYPE(qs_rho_type), INTENT(IN), POINTER :: rho - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN), & + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN), & POINTER :: rho1_r - TYPE(pw_c1d_type), DIMENSION(:), INTENT(IN), & + TYPE(pw_c1d_gs_type), DIMENSION(:), INTENT(IN), & POINTER :: rho1_g - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN), & + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN), & POINTER :: tau1_r TYPE(section_vals_type), INTENT(IN), POINTER :: xc_section LOGICAL, INTENT(IN), OPTIONAL :: compute_virial @@ -105,7 +105,7 @@ SUBROUTINE create_kernel(qs_env, vxc, vxc_tau, rho, rho1_r, rho1_g, tau1_r, xc_s INTEGER :: handle TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau_r TYPE(xc_derivative_set_type) :: deriv_set TYPE(xc_rho_set_type) :: rho_set diff --git a/src/ec_orth_solver.F b/src/ec_orth_solver.F index 34a6ca1880..5e0b9e87bb 100644 --- a/src/ec_orth_solver.F +++ b/src/ec_orth_solver.F @@ -52,10 +52,8 @@ MODULE ec_orth_solver USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_integrate_potential, ONLY: integrate_v_rspace @@ -1133,14 +1131,14 @@ SUBROUTINE hessian_op2(qs_env, p_env, matrix_Ax, matrix_p, matrix_s_sqrt_inv, ep TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_G, matrix_s, rho1_ao, rho_ao TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, v_xc, v_xc_tau + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, v_xc, v_xc_tau TYPE(qs_kpp1_env_type), POINTER :: kpp1_env TYPE(qs_rho_type), POINTER :: rho, rho_aux TYPE(section_vals_type), POINTER :: input, xc_section, xc_section_aux @@ -1179,9 +1177,9 @@ SUBROUTINE hessian_op2(qs_env, p_env, matrix_Ax, matrix_p, matrix_s_sqrt_inv, ep poisson_env=poisson_env) ! Calculate the NSC Hartree potential - CALL auxbas_pw_pool%create_pw(pw=v_hartree_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(pw=rho_tot_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(pw=v_hartree_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(pw=rho_tot_gspace) + CALL auxbas_pw_pool%create_pw(pw=v_hartree_rspace) ! XC-Kernel NULLIFY (v_xc, v_xc_tau, xc_section) diff --git a/src/ed_analysis.F b/src/ed_analysis.F index ef19dc7079..112f1cc929 100644 --- a/src/ed_analysis.F +++ b/src/ed_analysis.F @@ -65,10 +65,8 @@ MODULE ed_analysis USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_core USE qs_core_energies, ONLY: calculate_ecore_alpha,& calculate_ecore_overlap,& @@ -762,9 +760,9 @@ SUBROUTINE vhxc_correction(qs_env, vhxc_mat, exc_mat, atecc, ate1xc, ate1h) TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: xc_den - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: vtau, vxc - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: xc_den + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: vtau, vxc + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_dispersion_type), POINTER :: dispersion_env TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_ks_env_type), POINTER :: ks_env @@ -794,18 +792,15 @@ SUBROUTINE vhxc_correction(qs_env, vhxc_mat, exc_mat, atecc, ate1xc, ate1h) needs = xc_functionals_get_needs(xc_fun_section, (nspins == 2), .TRUE.) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(xc_den, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(xc_den) ALLOCATE (vxc(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(vxc(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vxc(ispin)) END DO IF (needs%tau .OR. needs%tau_spin) THEN ALLOCATE (vtau(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(vtau(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vtau(ispin)) END DO END IF @@ -915,13 +910,13 @@ SUBROUTINE vh_ewald_correction(qs_env, ealpha, vh_mat, atewd) TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb, sac_ae TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_ewd_g, v_hewd_gspace + TYPE(pw_c1d_gs_type) :: rho_tot_ewd_g, v_hewd_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rho_tot_ewd_r, v_hewd_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: rho_tot_ewd_r, v_hewd_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_type), POINTER :: rho @@ -942,14 +937,10 @@ SUBROUTINE vh_ewald_correction(qs_env, ealpha, vh_mat, atewd) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) ! - CALL auxbas_pw_pool%create_pw(v_hewd_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hewd_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_ewd_g, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_ewd_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hewd_gspace) + CALL auxbas_pw_pool%create_pw(v_hewd_rspace) + CALL auxbas_pw_pool%create_pw(rho_tot_ewd_g) + CALL auxbas_pw_pool%create_pw(rho_tot_ewd_r) rhotot = 0.0_dp CALL calculate_rho_core(rho_tot_ewd_r, rhotot, qs_env, calpha=alpha, ccore=ccore) ! Get the total density in g-space [ions + electrons] diff --git a/src/embed_types.F b/src/embed_types.F index a48d448a81..e39cd47007 100644 --- a/src/embed_types.F +++ b/src/embed_types.F @@ -42,7 +42,7 @@ MODULE embed_types particle_list_release,& particle_list_type USE particle_types, ONLY: particle_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -77,10 +77,10 @@ MODULE embed_types max_trad = 0.0_dp, min_trad = 0.0_dp, & grad_norm = 0.0_dp, vw_cutoff = 0.0_dp, & vw_smooth_cutoff_range = 0.0_dp, eta = 0.0_dp - TYPE(pw_r3d_type), POINTER :: const_pot => NULL(), prev_embed_pot => NULL(), & - prev_spin_embed_pot => NULL(), pot_diff => NULL() - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: prev_grid_grad => NULL(), prev_grid_pot => NULL(), & - prev_subsys_dens => NULL(), v_w => NULL() + TYPE(pw_r3d_rs_type), POINTER :: const_pot => NULL(), prev_embed_pot => NULL(), & + prev_spin_embed_pot => NULL(), pot_diff => NULL() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: prev_grid_grad => NULL(), prev_grid_pot => NULL(), & + prev_subsys_dens => NULL(), v_w => NULL() REAL(KIND=dp) :: reg_term = 0.0_dp, trust_rad = 0.0_dp, & conv_max = 0.0_dp, conv_int = 0.0_dp, & conv_max_spin = 0.0_dp, conv_int_spin = 0.0_dp, step_len = 0.0_dp diff --git a/src/emd/rt_propagation_output.F b/src/emd/rt_propagation_output.F index 1529f5809c..845e824b6f 100644 --- a/src/emd/rt_propagation_output.F +++ b/src/emd/rt_propagation_output.F @@ -61,10 +61,8 @@ MODULE rt_propagation_output pw_env_type USE pw_methods, ONLY: pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -703,10 +701,10 @@ SUBROUTINE rt_current(qs_env, P_im, dft_section, spin, nspin) TYPE(current_env_type) :: current_env TYPE(dbcsr_type), POINTER :: tmp, zero TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type) :: gs + TYPE(pw_c1d_gs_type) :: gs TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rs + TYPE(pw_r3d_rs_type) :: rs TYPE(qs_subsys_type), POINTER :: subsys CALL timeset(routineN, handle) @@ -728,8 +726,8 @@ SUBROUTINE rt_current(qs_env, P_im, dft_section, spin, nspin) END IF current_env%gauge = -1 current_env%gauge_init = .FALSE. - CALL auxbas_pw_pool%create_pw(rs, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(gs, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rs) + CALL auxbas_pw_pool%create_pw(gs) NULLIFY (stride) ALLOCATE (stride(3)) diff --git a/src/emd/rt_propagation_utils.F b/src/emd/rt_propagation_utils.F index d8bbbf5531..3fe6d5f792 100644 --- a/src/emd/rt_propagation_utils.F +++ b/src/emd/rt_propagation_utils.F @@ -63,10 +63,8 @@ MODULE rt_propagation_utils pw_zero USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_density_matrices, ONLY: calculate_density_matrix USE qs_dftb_matrices, ONLY: build_dftb_overlap @@ -742,11 +740,11 @@ SUBROUTINE write_rtp_mo_cubes(qs_env, rtp) TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: density_r, wf_r + TYPE(pw_r3d_rs_type) :: density_r, wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: dft_section, input @@ -791,9 +789,9 @@ SUBROUTINE write_rtp_mo_cubes(qs_env, rtp) ! Setup the grids needed to compute a wavefunction given a vector CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(density_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) + CALL auxbas_pw_pool%create_pw(density_r) CALL get_rtp(rtp=rtp, mos_new=mos_new) DO ispin = 1, nspins diff --git a/src/energy_corrections.F b/src/energy_corrections.F index 2f94f2d1fb..5acc0723b1 100644 --- a/src/energy_corrections.F +++ b/src/energy_corrections.F @@ -127,10 +127,8 @@ MODULE energy_corrections USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_atomic_block, ONLY: calculate_atomic_block_dm USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_core_energies, ONLY: calculate_ecore_overlap,& @@ -425,8 +423,7 @@ SUBROUTINE energy_correction_low(qs_env, ec_env, calculate_forces, unit_nr) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) ALLOCATE (ec_env%rhoz_r(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(ec_env%rhoz_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(ec_env%rhoz_r(ispin)) END DO CALL response_force(qs_env, & @@ -626,13 +623,13 @@ SUBROUTINE ec_dc_build_ks_matrix_force(qs_env, ec_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb - TYPE(pw_c1d_type) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, v_rspace, v_rspace_in, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, v_rspace, v_rspace_in, & v_tau_rspace TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_ks_env_type), POINTER :: ks_env @@ -685,12 +682,9 @@ SUBROUTINE ec_dc_build_ks_matrix_force(qs_env, ec_env) poisson_env=poisson_env) ! Calculate the Hartree potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) ! Get the total input density in g-space [ions + electrons] CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) @@ -728,8 +722,7 @@ SUBROUTINE ec_dc_build_ks_matrix_force(qs_env, ec_env) CALL qs_rho_get(rho, rho_r=rho_r) ALLOCATE (ec_env%rhoout_r(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(ec_env%rhoout_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(ec_env%rhoout_r(ispin)) CALL pw_copy(rho_r(ispin), ec_env%rhoout_r(ispin)) END DO @@ -764,8 +757,7 @@ SUBROUTINE ec_dc_build_ks_matrix_force(qs_env, ec_env) IF (.NOT. ASSOCIATED(v_rspace)) THEN ALLOCATE (v_rspace(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(v_rspace(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_rspace(ispin)) CALL pw_zero(v_rspace(ispin)) END DO END IF @@ -789,8 +781,7 @@ SUBROUTINE ec_dc_build_ks_matrix_force(qs_env, ec_env) pw_grid => v_hartree_rspace%pw_grid ALLOCATE (v_rspace_in(nspins)) DO ispin = 1, nspins - CALL v_rspace_in(ispin)%create(pw_grid, & - in_space=REALSPACE) + CALL v_rspace_in(ispin)%create(pw_grid) END DO ! v_rspace_in = v_H[n_in] + v_xc[n_in] calculated in ks_ref_potential @@ -965,8 +956,7 @@ SUBROUTINE ec_dc_build_ks_matrix_force(qs_env, ec_env) IF (.NOT. ASSOCIATED(v_tau_rspace)) THEN ALLOCATE (v_tau_rspace(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(v_tau_rspace(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_tau_rspace(ispin)) CALL pw_zero(v_tau_rspace(ispin)) END DO END IF @@ -1273,7 +1263,7 @@ SUBROUTINE ec_build_ks_matrix(qs_env, ec_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau_r, v_rspace, v_tau_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau_r, v_rspace, v_tau_rspace TYPE(qs_energy_type), POINTER :: energy TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho @@ -1396,8 +1386,7 @@ SUBROUTINE ec_build_ks_matrix(qs_env, ec_env) IF (.NOT. ASSOCIATED(v_rspace)) THEN ALLOCATE (v_rspace(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(v_rspace(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_rspace(ispin)) CALL pw_zero(v_rspace(ispin)) END DO END IF @@ -1715,16 +1704,16 @@ SUBROUTINE ec_build_ks_matrix_force(qs_env, ec_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb - TYPE(pw_c1d_type) :: rho_tot_gspace, rhodn_tot_gspace, & + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, rhodn_tot_gspace, & v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g, rhoout_g - TYPE(pw_c1d_type), POINTER :: rho_core + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g, rhoout_g + TYPE(pw_c1d_gs_type), POINTER :: rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: dv_hartree_rspace, v_hartree_rspace, & + TYPE(pw_r3d_rs_type) :: dv_hartree_rspace, v_hartree_rspace, & vtot_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, rhoout_r, tau_r, tauout_r, & + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, rhoout_r, tau_r, tauout_r, & v_rspace, v_tau_rspace, v_xc, v_xc_tau TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_ks_env_type), POINTER :: ks_env @@ -1777,12 +1766,9 @@ SUBROUTINE ec_build_ks_matrix_force(qs_env, ec_env) poisson_env=poisson_env) ! Calculate the Hartree potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rhodn_tot_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(rhodn_tot_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) CALL pw_transfer(ec_env%vh_rspace, v_hartree_rspace) @@ -1793,15 +1779,11 @@ SUBROUTINE ec_build_ks_matrix_force(qs_env, ec_env) NULLIFY (rhoout_r, rhoout_g) ALLOCATE (rhoout_r(nspins), rhoout_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoout_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoout_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoout_r(ispin)) + CALL auxbas_pw_pool%create_pw(rhoout_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(dv_hartree_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(vtot_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dv_hartree_rspace) + CALL auxbas_pw_pool%create_pw(vtot_rspace) CALL pw_zero(rhodn_tot_gspace) DO ispin = 1, nspins @@ -1815,22 +1797,19 @@ SUBROUTINE ec_build_ks_matrix_force(qs_env, ec_env) ! Save Harris on real space grid for use in properties ALLOCATE (ec_env%rhoout_r(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(ec_env%rhoout_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(ec_env%rhoout_r(ispin)) CALL pw_copy(rhoout_r(ispin), ec_env%rhoout_r(ispin)) END DO NULLIFY (tauout_r) IF (dft_control%use_kinetic_energy_density) THEN BLOCK - TYPE(pw_c1d_type) :: tauout_g + TYPE(pw_c1d_gs_type) :: tauout_g ALLOCATE (tauout_r(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(tauout_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tauout_r(ispin)) END DO - CALL auxbas_pw_pool%create_pw(tauout_g, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tauout_g) DO ispin = 1, nspins CALL calculate_rho_elec(ks_env=ks_env, matrix_p=ec_env%matrix_p(ispin, 1)%matrix, & @@ -1848,8 +1827,7 @@ SUBROUTINE ec_build_ks_matrix_force(qs_env, ec_env) IF (use_virial) THEN ! Calculate the Hartree potential - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) ! Get the total input density in g-space [ions + electrons] CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) @@ -2110,8 +2088,7 @@ SUBROUTINE ec_build_ks_matrix_force(qs_env, ec_env) IF (.NOT. ASSOCIATED(v_rspace)) THEN ALLOCATE (v_rspace(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(v_rspace(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_rspace(ispin)) CALL pw_zero(v_rspace(ispin)) END DO END IF @@ -3018,7 +2995,7 @@ SUBROUTINE ec_properties(qs_env, ec_env) TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rho_elec_rspace + TYPE(pw_r3d_rs_type) :: rho_elec_rspace TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(section_vals_type), POINTER :: ec_section, print_key, print_key_bqb, & print_key_voro @@ -3171,7 +3148,7 @@ SUBROUTINE ec_properties(qs_env, ec_env) CALL pw_env_get(pw_env=pw_env, & auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace) IF (dft_control%nspins > 1) THEN diff --git a/src/et_coupling_proj.F b/src/et_coupling_proj.F index faf3cf64ba..53b251fe55 100644 --- a/src/et_coupling_proj.F +++ b/src/et_coupling_proj.F @@ -62,10 +62,8 @@ MODULE et_coupling_proj pw_env_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -1307,11 +1305,11 @@ SUBROUTINE save_mo_cube(qs_env, logger, input, mo, ib, im, is) TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys @@ -1346,10 +1344,8 @@ SUBROUTINE save_mo_cube(qs_env, logger, input, mo, ib, im, is) ! Grids for wavefunction CALL get_qs_env(qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) ! Calculate the grid values CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, qs_kind_set=qs_kind_set, & diff --git a/src/ewald_methods_tb.F b/src/ewald_methods_tb.F index ba6a454ca2..5f1dbba66e 100644 --- a/src/ewald_methods_tb.F +++ b/src/ewald_methods_tb.F @@ -18,7 +18,7 @@ MODULE ewald_methods_tb USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: fourpi,& oorootpi @@ -41,10 +41,8 @@ MODULE ewald_methods_tb USE pw_poisson_types, ONLY: greens_fn_type,& pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_neighbor_list_types, ONLY: get_iterator_info,& neighbor_list_iterate,& neighbor_list_iterator_create,& @@ -91,7 +89,7 @@ SUBROUTINE tb_spme_evaluate(ewald_env, ewald_pw, particle_set, box, & gmcharge, mcharge, calculate_forces, virial, use_virial, atprop) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set TYPE(cell_type), POINTER :: box REAL(KIND=dp), DIMENSION(:, :), INTENT(inout) :: gmcharge @@ -114,12 +112,12 @@ SUBROUTINE tb_spme_evaluate(ewald_env, ewald_pw, particle_set, box, & TYPE(greens_fn_type), POINTER :: green TYPE(mp_comm_type) :: group TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(3) :: dphi_g - TYPE(pw_c1d_type), POINTER :: phi_g, phib_g, rhob_g + TYPE(pw_c1d_gs_type), DIMENSION(3) :: dphi_g + TYPE(pw_c1d_gs_type), POINTER :: phi_g, phib_g, rhob_g TYPE(pw_grid_type), POINTER :: grid_spme TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: rhob_r + TYPE(pw_r3d_rs_type), POINTER :: rhob_r TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_type) :: rden, rpot TYPE(realspace_grid_type), ALLOCATABLE, & @@ -167,16 +165,14 @@ SUBROUTINE tb_spme_evaluate(ewald_env, ewald_pw, particle_set, box, & NULLIFY (rhob_r) ALLOCATE (rhob_r) - CALL pw_pool%create_pw(rhob_r, & - in_space=REALSPACE) + CALL pw_pool%create_pw(rhob_r) CALL transfer_rs2pw(rden, rhob_r) ! transform density to G space and add charge function NULLIFY (rhob_g) ALLOCATE (rhob_g) - CALL pw_pool%create_pw(rhob_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhob_g) CALL pw_transfer(rhob_r, rhob_g) ! update charge function CALL pw_multiply_with(rhob_g, green%p3m_charge) @@ -185,13 +181,11 @@ SUBROUTINE tb_spme_evaluate(ewald_env, ewald_pw, particle_set, box, & ! allocate intermediate arrays DO i = 1, 3 - CALL pw_pool%create_pw(dphi_g(i), & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(dphi_g(i)) END DO NULLIFY (phi_g) ALLOCATE (phi_g) - CALL pw_pool%create_pw(phi_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(phi_g) IF (use_virial) THEN CALL pw_poisson_solve(poisson_env, rhob_g, vgc, phi_g, dphi_g, h_stress=h_stress) ELSE @@ -226,8 +220,7 @@ SUBROUTINE tb_spme_evaluate(ewald_env, ewald_pw, particle_set, box, & NULLIFY (phib_g) ALLOCATE (phib_g) - CALL pw_pool%create_pw(phib_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(phib_g) ffa = (0.5_dp/alpha)**2 ffb = 1.0_dp/fourpi DO i = 1, 3 @@ -443,7 +436,7 @@ END SUBROUTINE tb_ewald_overlap SUBROUTINE tb_spme_zforce(ewald_env, ewald_pw, particle_set, box, gmcharge, mcharge) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set TYPE(cell_type), POINTER :: box REAL(KIND=dp), DIMENSION(:, :), INTENT(inout) :: gmcharge @@ -460,12 +453,12 @@ SUBROUTINE tb_spme_zforce(ewald_env, ewald_pw, particle_set, box, gmcharge, mcha TYPE(greens_fn_type), POINTER :: green TYPE(mp_comm_type) :: group TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(3) :: dphi_g - TYPE(pw_c1d_type), POINTER :: phi_g, rhob_g + TYPE(pw_c1d_gs_type), DIMENSION(3) :: dphi_g + TYPE(pw_c1d_gs_type), POINTER :: phi_g, rhob_g TYPE(pw_grid_type), POINTER :: grid_spme TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: rhob_r + TYPE(pw_r3d_rs_type), POINTER :: rhob_r TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_type) :: rden, rpot TYPE(realspace_grid_type), DIMENSION(3) :: drpot @@ -512,16 +505,14 @@ SUBROUTINE tb_spme_zforce(ewald_env, ewald_pw, particle_set, box, gmcharge, mcha NULLIFY (rhob_r) ALLOCATE (rhob_r) - CALL pw_pool%create_pw(rhob_r, & - in_space=REALSPACE) + CALL pw_pool%create_pw(rhob_r) CALL transfer_rs2pw(rden, rhob_r) ! transform density to G space and add charge function NULLIFY (rhob_g) ALLOCATE (rhob_g) - CALL pw_pool%create_pw(rhob_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhob_g) CALL pw_transfer(rhob_r, rhob_g) ! update charge function CALL pw_multiply_with(rhob_g, green%p3m_charge) @@ -530,13 +521,11 @@ SUBROUTINE tb_spme_zforce(ewald_env, ewald_pw, particle_set, box, gmcharge, mcha ! allocate intermediate arrays DO i = 1, 3 - CALL pw_pool%create_pw(dphi_g(i), & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(dphi_g(i)) END DO NULLIFY (phi_g) ALLOCATE (phi_g) - CALL pw_pool%create_pw(phi_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(phi_g) CALL pw_poisson_solve(poisson_env, rhob_g, vgc, phi_g, dphi_g) CALL rs_grid_create(rpot, rs_desc) diff --git a/src/ewald_pw_methods.F b/src/ewald_pw_methods.F index dc851a525d..6779ec635b 100644 --- a/src/ewald_pw_methods.F +++ b/src/ewald_pw_methods.F @@ -21,7 +21,7 @@ MODULE ewald_pw_methods ewald_env_set,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type,& + ewald_pw_r3d_rs_type,& ewald_pw_set USE input_section_types, ONLY: section_vals_type USE kinds, ONLY: dp @@ -59,7 +59,7 @@ MODULE ewald_pw_methods !> \author JGH (15-Mar-2001) ! ************************************************************************************************** SUBROUTINE ewald_pw_grid_update(ewald_pw, ewald_env, cell_hmat) - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(ewald_environment_type), POINTER :: ewald_env REAL(KIND=dp), DIMENSION(3, 3) :: cell_hmat diff --git a/src/ewald_pw_types.F b/src/ewald_pw_types.F index cb0f00905d..99b317909d 100644 --- a/src/ewald_pw_types.F +++ b/src/ewald_pw_types.F @@ -56,24 +56,24 @@ MODULE ewald_pw_types PRIVATE CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'ewald_pw_types' - PUBLIC :: ewald_pw_r3d_type, ewald_pw_release, & + PUBLIC :: ewald_pw_r3d_rs_type, ewald_pw_release, & ewald_pw_create, & ewald_pw_get, ewald_pw_set ! ************************************************************************************************** - TYPE ewald_pw_r3d_type + TYPE ewald_pw_r3d_rs_type PRIVATE TYPE(pw_pool_type), POINTER :: pw_small_pool TYPE(pw_pool_type), POINTER :: pw_big_pool TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(dg_type), POINTER :: dg - END TYPE ewald_pw_r3d_type + END TYPE ewald_pw_r3d_rs_type CONTAINS ! ************************************************************************************************** -!> \brief creates the structure ewald_pw_r3d_type +!> \brief creates the structure ewald_pw_r3d_rs_type !> \param ewald_pw ... !> \param ewald_env ... !> \param cell ... @@ -81,7 +81,7 @@ MODULE ewald_pw_types !> \param print_section ... ! ************************************************************************************************** SUBROUTINE ewald_pw_create(ewald_pw, ewald_env, cell, cell_ref, print_section) - TYPE(ewald_pw_r3d_type), INTENT(OUT) :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), INTENT(OUT) :: ewald_pw TYPE(ewald_environment_type), POINTER :: ewald_env TYPE(cell_type), POINTER :: cell, cell_ref TYPE(section_vals_type), POINTER :: print_section @@ -100,7 +100,7 @@ END SUBROUTINE ewald_pw_create !> \param ewald_pw ... ! ************************************************************************************************** SUBROUTINE ewald_pw_release(ewald_pw) - TYPE(ewald_pw_r3d_type), INTENT(INOUT) :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), INTENT(INOUT) :: ewald_pw CALL pw_pool_release(ewald_pw%pw_small_pool) CALL pw_pool_release(ewald_pw%pw_big_pool) @@ -128,7 +128,7 @@ END SUBROUTINE ewald_pw_release !> \author CJM ! ************************************************************************************************** SUBROUTINE ewald_pw_init(ewald_pw, ewald_env, cell, cell_ref, print_section) - TYPE(ewald_pw_r3d_type), INTENT(INOUT) :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), INTENT(INOUT) :: ewald_pw TYPE(ewald_environment_type), POINTER :: ewald_env TYPE(cell_type), POINTER :: cell, cell_ref TYPE(section_vals_type), POINTER :: print_section @@ -323,7 +323,7 @@ END SUBROUTINE ewald_pw_init ! ************************************************************************************************** SUBROUTINE ewald_pw_get(ewald_pw, pw_big_pool, pw_small_pool, rs_desc, poisson_env, dg) - TYPE(ewald_pw_r3d_type), INTENT(IN) :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), INTENT(IN) :: ewald_pw TYPE(pw_pool_type), OPTIONAL, POINTER :: pw_big_pool, pw_small_pool TYPE(realspace_grid_desc_type), OPTIONAL, POINTER :: rs_desc TYPE(pw_poisson_type), OPTIONAL, POINTER :: poisson_env @@ -350,7 +350,7 @@ END SUBROUTINE ewald_pw_get SUBROUTINE ewald_pw_set(ewald_pw, pw_big_pool, pw_small_pool, rs_desc, dg, & poisson_env) - TYPE(ewald_pw_r3d_type), INTENT(INOUT) :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), INTENT(INOUT) :: ewald_pw TYPE(pw_pool_type), OPTIONAL, POINTER :: pw_big_pool, pw_small_pool TYPE(realspace_grid_desc_type), OPTIONAL, POINTER :: rs_desc TYPE(dg_type), OPTIONAL, POINTER :: dg diff --git a/src/ewald_spline_util.F b/src/ewald_spline_util.F index 343cc17c86..36a94c076e 100644 --- a/src/ewald_spline_util.F +++ b/src/ewald_spline_util.F @@ -36,8 +36,7 @@ MODULE ewald_spline_util Eval_Interp_Spl3_pbc, Eval_d_Interp_Spl3_pbc, find_coeffs, pw_spline_do_precond, & pw_spline_precond_create, pw_spline_precond_release, pw_spline_precond_set_kind, & pw_spline_precond_type, spl3_pbc - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type !NB parallelization #include "./base/base_uses.f90" @@ -73,7 +72,7 @@ SUBROUTINE Setup_Ewald_Spline(pw_grid, pw_pool, coeff, LG, gx, gy, gz, hmat, npt param_section, tag, print_section, para_env) TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: coeff + TYPE(pw_r3d_rs_type), POINTER :: coeff REAL(KIND=dp), DIMENSION(:), POINTER :: LG, gx, gy, gz REAL(KIND=dp), INTENT(IN) :: hmat(3, 3) INTEGER, INTENT(IN) :: npts(3) @@ -85,7 +84,7 @@ SUBROUTINE Setup_Ewald_Spline(pw_grid, pw_pool, coeff, LG, gx, gy, gz, hmat, npt INTEGER :: bo(2, 3), iounit TYPE(cell_type), POINTER :: cell TYPE(cp_logger_type), POINTER :: logger - TYPE(pw_r3d_type) :: pw + TYPE(pw_r3d_rs_type) :: pw ! ! Setting Up Fit Procedure @@ -110,8 +109,8 @@ SUBROUTINE Setup_Ewald_Spline(pw_grid, pw_pool, coeff, LG, gx, gy, gz, hmat, npt ! pw_pool initialized CALL pw_pool_create(pw_pool, pw_grid=pw_grid) ALLOCATE (coeff) - CALL pw_pool%create_pw(pw, in_space=REALSPACE) - CALL pw_pool%create_pw(coeff, in_space=REALSPACE) + CALL pw_pool%create_pw(pw) + CALL pw_pool%create_pw(coeff) ! Evaluate function on grid CALL eval_pw_TabLR(pw, pw_pool, coeff, Lg, gx, gy, gz, hmat_mm=hmat, & param_section=param_section, tag=tag) @@ -139,9 +138,9 @@ END SUBROUTINE Setup_Ewald_Spline ! ************************************************************************************************** SUBROUTINE eval_pw_TabLR(grid, pw_pool, TabLR, Lg, gx, gy, gz, hmat_mm, & param_section, tag) - TYPE(pw_r3d_type), INTENT(INOUT) :: grid + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: TabLR + TYPE(pw_r3d_rs_type), POINTER :: TabLR REAL(KIND=dp), DIMENSION(:), POINTER :: Lg, gx, gy, gz REAL(KIND=dp), DIMENSION(3, 3) :: hmat_mm TYPE(section_vals_type), POINTER :: param_section @@ -355,7 +354,7 @@ SUBROUTINE check_spline_interp_TabLR(hmat_mm, Lg, gx, gy, gz, TabLR, & param_section, tag) REAL(KIND=dp), DIMENSION(3, 3) :: hmat_mm REAL(KIND=dp), DIMENSION(:), POINTER :: Lg, gx, gy, gz - TYPE(pw_r3d_type), POINTER :: TabLR + TYPE(pw_r3d_rs_type), POINTER :: TabLR TYPE(section_vals_type), POINTER :: param_section CHARACTER(LEN=*), INTENT(IN) :: tag diff --git a/src/ewalds.F b/src/ewalds.F index 90d9929ef4..0452fa1ca0 100644 --- a/src/ewalds.F +++ b/src/ewalds.F @@ -24,7 +24,7 @@ MODULE ewalds USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: fourpi,& oorootpi,& @@ -77,7 +77,7 @@ SUBROUTINE ewald_evaluate(ewald_env, ewald_pw, cell, atomic_kind_set, particle_s local_particles, fg_coulomb, vg_coulomb, pv_g, use_virial, charges, e_coulomb, & pv_coulomb) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(cell_type), POINTER :: cell TYPE(atomic_kind_type), POINTER :: atomic_kind_set(:) TYPE(particle_type), POINTER :: particle_set(:) diff --git a/src/ewalds_multipole.F b/src/ewalds_multipole.F index 5fa60a8094..7cb240f10f 100644 --- a/src/ewalds_multipole.F +++ b/src/ewalds_multipole.F @@ -30,7 +30,7 @@ MODULE ewalds_multipole USE ewald_environment_types, ONLY: ewald_env_get, & ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get, & - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE fist_neighbor_list_control, ONLY: list_control USE fist_neighbor_list_types, ONLY: fist_neighbor_type, & neighbor_kind_pairs_type @@ -121,7 +121,7 @@ RECURSIVE SUBROUTINE ewald_multipole_evaluate(ewald_env, ewald_pw, nonbond_env, quadrupoles, forces_local, forces_glob, pv_local, pv_glob, efield0, efield1, & efield2, iw, do_debug, atomic_kind_set, mm_section) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), POINTER :: particle_set(:) @@ -643,7 +643,7 @@ SUBROUTINE ewald_multipole_LR(ewald_env, ewald_pw, cell, particle_set, & local_particles, energy, task, do_forces, do_efield, do_stress, & charges, dipoles, quadrupoles, forces, pv, efield0, efield1, efield2) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(cell_type), POINTER :: cell TYPE(particle_type), POINTER :: particle_set(:) TYPE(distribution_1d_type), POINTER :: local_particles @@ -1286,7 +1286,7 @@ SUBROUTINE debug_ewald_multipoles(ewald_env, ewald_pw, nonbond_env, cell, & POINTER :: charge_typ END TYPE multi_charge_type TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), DIMENSION(:), & @@ -1880,7 +1880,7 @@ SUBROUTINE debug_ewald_multipoles_fields(ewald_env, ewald_pw, nonbond_env, cell, particle_set, local_particles, radii, charges, dipoles, quadrupoles, task, iw, & atomic_kind_set, mm_section) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), POINTER :: particle_set(:) @@ -2065,7 +2065,7 @@ END SUBROUTINE debug_ewald_multipoles_fields SUBROUTINE debug_ewald_multipoles_fields2(ewald_env, ewald_pw, nonbond_env, cell, & particle_set, local_particles, radii, charges, dipoles, quadrupoles, task, iw) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), POINTER :: particle_set(:) diff --git a/src/exstates_types.F b/src/exstates_types.F index 99b1d6eb64..c5fb2406a5 100644 --- a/src/exstates_types.F +++ b/src/exstates_types.F @@ -20,7 +20,7 @@ MODULE exstates_types USE input_section_types, ONLY: section_vals_type,& section_vals_val_get USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_local_rho_types, ONLY: local_rho_set_release,& local_rho_type #include "./base/base_uses.f90" @@ -68,10 +68,10 @@ MODULE exstates_types TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_px1_asymm => NULL() TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_px1_admm_asymm => NULL() TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_wx1 => NULL() - TYPE(pw_r3d_type) :: vh_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rspace => NULL() - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vtau_rspace => NULL() - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vadmm_rspace => NULL() + TYPE(pw_r3d_rs_type) :: vh_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rspace => NULL() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vtau_rspace => NULL() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vadmm_rspace => NULL() TYPE(local_rho_type), POINTER :: local_rho_set => NULL() TYPE(local_rho_type), POINTER :: local_rho_set_admm => NULL() TYPE(wfn_history_type) :: wfn_history diff --git a/src/fist_environment.F b/src/fist_environment.F index 5712c0a5fb..079319c672 100644 --- a/src/fist_environment.F +++ b/src/fist_environment.F @@ -39,7 +39,7 @@ MODULE fist_environment read_ewald_section USE ewald_pw_methods, ONLY: ewald_pw_grid_update USE ewald_pw_types, ONLY: ewald_pw_create,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE exclusion_types, ONLY: exclusion_type USE fist_efield_types, ONLY: fist_efield_type,& read_efield_section @@ -239,7 +239,7 @@ SUBROUTINE fist_init_subsys(fist_env, subsys, cell, cell_ref, fist_nonbond_env, TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(distribution_1d_type), POINTER :: local_molecules, local_particles, & prev_local_molecules - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_energy_type), POINTER :: thermo TYPE(molecule_kind_type), DIMENSION(:), POINTER :: molecule_kind_set, prev_molecule_kind_set TYPE(molecule_type), DIMENSION(:), POINTER :: molecule_set diff --git a/src/fist_environment_types.F b/src/fist_environment_types.F index 732904871c..bc51a21e56 100644 --- a/src/fist_environment_types.F +++ b/src/fist_environment_types.F @@ -28,7 +28,7 @@ MODULE fist_environment_types USE distribution_1d_types, ONLY: distribution_1d_type USE ewald_environment_types, ONLY: ewald_env_release,& ewald_environment_type - USE ewald_pw_types, ONLY: ewald_pw_r3d_type,& + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type,& ewald_pw_release USE exclusion_types, ONLY: exclusion_release,& exclusion_type @@ -75,7 +75,7 @@ MODULE fist_environment_types TYPE(qmmm_env_mm_type), POINTER :: qmmm_env TYPE(cell_type), POINTER :: cell_ref TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_energy_type), POINTER :: thermo TYPE(mp_para_env_type), POINTER :: para_env TYPE(cp_subsys_type), POINTER :: subsys @@ -141,7 +141,7 @@ SUBROUTINE fist_env_get(fist_env, atomic_kind_set, particle_set, ewald_pw, & TYPE(fist_environment_type), INTENT(IN) :: fist_env TYPE(atomic_kind_type), OPTIONAL, POINTER :: atomic_kind_set(:) TYPE(particle_type), OPTIONAL, POINTER :: particle_set(:) - TYPE(ewald_pw_r3d_type), OPTIONAL, POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), OPTIONAL, POINTER :: ewald_pw TYPE(distribution_1d_type), OPTIONAL, POINTER :: local_particles, local_molecules TYPE(molecule_kind_type), OPTIONAL, POINTER :: molecule_kind_set(:) TYPE(molecule_type), OPTIONAL, POINTER :: molecule_set(:) @@ -278,7 +278,7 @@ SUBROUTINE fist_env_set(fist_env, atomic_kind_set, particle_set, ewald_pw, & TYPE(fist_environment_type), INTENT(INOUT) :: fist_env TYPE(atomic_kind_type), OPTIONAL, POINTER :: atomic_kind_set(:) TYPE(particle_type), OPTIONAL, POINTER :: particle_set(:) - TYPE(ewald_pw_r3d_type), OPTIONAL, POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), OPTIONAL, POINTER :: ewald_pw TYPE(distribution_1d_type), OPTIONAL, POINTER :: local_particles, local_molecules TYPE(molecule_kind_type), OPTIONAL, POINTER :: molecule_kind_set(:) TYPE(molecule_type), OPTIONAL, POINTER :: molecule_set(:) diff --git a/src/fist_force.F b/src/fist_force.F index e2c5b5f3b9..345dd13b91 100644 --- a/src/fist_force.F +++ b/src/fist_force.F @@ -32,7 +32,7 @@ MODULE fist_force USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_methods, ONLY: ewald_pw_grid_update - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE ewalds, ONLY: ewald_evaluate,& ewald_print,& ewald_self,& @@ -139,7 +139,7 @@ SUBROUTINE fist_calc_energy_force(fist_env, debug) TYPE(cp_subsys_type), POINTER :: subsys TYPE(distribution_1d_type), POINTER :: local_molecules, local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(exclusion_type), DIMENSION(:), POINTER :: exclusions TYPE(fist_efield_type), POINTER :: efield TYPE(fist_energy_type), POINTER :: thermo diff --git a/src/fist_pol_scf.F b/src/fist_pol_scf.F index 29574845da..3ba7f91b28 100644 --- a/src/fist_pol_scf.F +++ b/src/fist_pol_scf.F @@ -24,7 +24,7 @@ MODULE fist_pol_scf USE distribution_1d_types, ONLY: distribution_1d_type USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE ewalds_multipole, ONLY: ewald_multipole_evaluate USE fist_energy_types, ONLY: fist_energy_type USE fist_nonbond_env_types, ONLY: fist_nonbond_env_type @@ -78,7 +78,7 @@ SUBROUTINE fist_pol_evaluate(atomic_kind_set, multipoles, ewald_env, & TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(multipole_type), POINTER :: multipoles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), DIMENSION(:), POINTER :: particle_set @@ -141,7 +141,7 @@ SUBROUTINE fist_pol_evaluate_sc(atomic_kind_set, multipoles, ewald_env, ewald_pw TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(multipole_type), POINTER :: multipoles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), DIMENSION(:), POINTER :: particle_set @@ -355,7 +355,7 @@ SUBROUTINE fist_pol_evaluate_cg(atomic_kind_set, multipoles, ewald_env, ewald_pw TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(multipole_type), POINTER :: multipoles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), DIMENSION(:), POINTER :: particle_set @@ -680,7 +680,7 @@ SUBROUTINE eval_pol_ewald(ewald_type, ewald_env, ewald_pw, fist_nonbond_env, & INTEGER, INTENT(IN) :: ewald_type TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: fist_nonbond_env TYPE(cell_type), POINTER :: cell TYPE(particle_type), DIMENSION(:), POINTER :: particle_set diff --git a/src/force_env_methods.F b/src/force_env_methods.F index 676fcf78a9..b96f581ac2 100644 --- a/src/force_env_methods.F +++ b/src/force_env_methods.F @@ -132,8 +132,7 @@ MODULE force_env_methods pw_integral_ab,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE pwdft_environment, ONLY: pwdft_calc_energy_force USE pwdft_environment_types, ONLY: pwdft_environment_type USE qmmm_force, ONLY: qmmm_calc_energy_force @@ -1399,7 +1398,7 @@ SUBROUTINE embed_energy(force_env) TYPE(particle_list_type), POINTER :: particles_embed TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: embed_pot, spin_embed_pot + TYPE(pw_r3d_rs_type), POINTER :: embed_pot, spin_embed_pot TYPE(section_vals_type), POINTER :: embed_section, force_env_section, & mapping_section, root_section @@ -1610,9 +1609,9 @@ SUBROUTINE dfet_embedding(force_env, ref_subsys_number, energies, converged_embe TYPE(opt_embed_pot_type) :: opt_embed TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: diff_rho_r, diff_rho_spin - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_ref, rho_r_subsys - TYPE(pw_r3d_type), POINTER :: embed_pot, embed_pot_subsys, & + TYPE(pw_r3d_rs_type) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_ref, rho_r_subsys + TYPE(pw_r3d_rs_type), POINTER :: embed_pot, embed_pot_subsys, & spin_embed_pot, spin_embed_pot_subsys TYPE(qs_energy_type), POINTER :: energy TYPE(qs_rho_type), POINTER :: rho, subsys_rho @@ -1668,10 +1667,10 @@ SUBROUTINE dfet_embedding(force_env, ref_subsys_number, energies, converged_embe ! Prepare the pw object to store density differences CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(diff_rho_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(diff_rho_r) CALL pw_zero(diff_rho_r) IF (opt_embed%open_shell_embed) THEN - CALL auxbas_pw_pool%create_pw(diff_rho_spin, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(diff_rho_spin) CALL pw_zero(diff_rho_spin) END IF diff --git a/src/hfx_admm_utils.F b/src/hfx_admm_utils.F index d4cc9034c1..2d6518a888 100644 --- a/src/hfx_admm_utils.F +++ b/src/hfx_admm_utils.F @@ -19,7 +19,7 @@ MODULE hfx_admm_utils USE admm_methods, ONLY: kpoint_calc_admm_matrices,& scale_dm USE admm_types, ONLY: admm_env_create,& - admm_gapw_r3d_type,& + admm_gapw_r3d_rs_type,& admm_type,& get_admm_env,& set_admm_env @@ -99,7 +99,7 @@ MODULE hfx_admm_utils pw_env_type USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& @@ -389,7 +389,7 @@ SUBROUTINE init_admm_gapw(qs_env) TYPE(qs_environment_type), POINTER :: qs_env INTEGER :: ikind, nkind - TYPE(admm_gapw_r3d_type), POINTER :: admm_gapw_env + TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env TYPE(admm_type), POINTER :: admm_env TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(dft_control_type), POINTER :: dft_control @@ -429,7 +429,7 @@ SUBROUTINE init_admm_gapw(qs_env) admm_kind_set(ikind)%natom = qs_kind_set(ikind)%natom admm_kind_set(ikind)%hard_radius = qs_kind_set(ikind)%hard_radius admm_kind_set(ikind)%max_rad_local = qs_kind_set(ikind)%max_rad_local - admm_kind_set(ikind)%gpw_r3d_type_forced = qs_kind_set(ikind)%gpw_r3d_type_forced + admm_kind_set(ikind)%gpw_r3d_rs_type_forced = qs_kind_set(ikind)%gpw_r3d_rs_type_forced admm_kind_set(ikind)%ngrid_rad = qs_kind_set(ikind)%ngrid_rad admm_kind_set(ikind)%ngrid_ang = qs_kind_set(ikind)%ngrid_ang @@ -685,7 +685,7 @@ SUBROUTINE update_admm_gapw(qs_env) REAL(dp) :: subcells REAL(dp), ALLOCATABLE, DIMENSION(:) :: aux_radius, oce_radius REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: pair_radius - TYPE(admm_gapw_r3d_type), POINTER :: admm_gapw_env + TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env TYPE(admm_type), POINTER :: admm_env TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(cell_type), POINTER :: cell @@ -1033,7 +1033,7 @@ SUBROUTINE hfx_ks_matrix(qs_env, matrix_ks, rho, energy, calculate_forces, & TYPE(qs_rho_type), POINTER :: rho TYPE(qs_energy_type), POINTER :: energy LOGICAL, INTENT(in) :: calculate_forces, just_energy - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace_new, v_tau_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace_new, v_tau_rspace CHARACTER(LEN=*), PARAMETER :: routineN = 'hfx_ks_matrix' diff --git a/src/hfx_exx.F b/src/hfx_exx.F index 25689a962f..703fc55e32 100644 --- a/src/hfx_exx.F +++ b/src/hfx_exx.F @@ -59,7 +59,7 @@ MODULE hfx_exx pw_env_type USE pw_methods, ONLY: pw_scale USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -345,8 +345,8 @@ SUBROUTINE add_exx_to_rhs(rhs, qs_env, ext_hfx_section, x_data, & TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: vh_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vadmm_rspace, vtau_rspace, vxc_rspace + TYPE(pw_r3d_rs_type) :: vh_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vadmm_rspace, vtau_rspace, vxc_rspace TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit TYPE(section_vals_type), POINTER :: hfx_section TYPE(task_list_type), POINTER :: task_list_aux_fit @@ -639,7 +639,7 @@ SUBROUTINE calc_exx_admm_xc_contributions(qs_env, matrix_prim, matrix_aux, x_dat TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_dummy, v_rspace, v_rspace_aux_fit + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_dummy, v_rspace, v_rspace_aux_fit TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit TYPE(section_vals_type), POINTER :: xc_section_aux, xc_section_primary TYPE(virial_type), POINTER :: virial diff --git a/src/hfx_pw_methods.F b/src/hfx_pw_methods.F index ee0e1ff66a..4fcb73f27b 100644 --- a/src/hfx_pw_methods.F +++ b/src/hfx_pw_methods.F @@ -46,10 +46,8 @@ MODULE hfx_pw_methods USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -106,11 +104,11 @@ SUBROUTINE pw_hfx(qs_env, ehfx, hfx_section, poisson_env, auxbas_pw_pool, irep) TYPE(dft_control_type), POINTER :: dft_control TYPE(mo_set_type), DIMENSION(:), POINTER :: mo_array TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: greenfn, pot_g, rho_g + TYPE(pw_c1d_gs_type) :: greenfn, pot_g, rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_grid_type), POINTER :: grid - TYPE(pw_r3d_type) :: rho_r - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: rho_i, rho_j + TYPE(pw_r3d_rs_type) :: rho_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: rho_i, rho_j TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(section_vals_type), POINTER :: ip_section @@ -133,14 +131,14 @@ SUBROUTINE pw_hfx(qs_env, ehfx, hfx_section, poisson_env, auxbas_pw_pool, irep) CALL cp_fm_get_info(mo_coeff, ncol_global=norb) blocksize = MAX(1, MIN(blocksize, norb)) - CALL auxbas_pw_pool%create_pw(rho_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(pot_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r) + CALL auxbas_pw_pool%create_pw(rho_g) + CALL auxbas_pw_pool%create_pw(pot_g) ALLOCATE (rho_i(blocksize)) ALLOCATE (rho_j(blocksize)) - CALL auxbas_pw_pool%create_pw(greenfn, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(greenfn) ip_section => section_vals_get_subs_vals(hfx_section, "INTERACTION_POTENTIAL") CALL section_vals_get(ip_section, explicit=explicit) potential_type = do_potential_coulomb @@ -176,8 +174,8 @@ SUBROUTINE pw_hfx(qs_env, ehfx, hfx_section, poisson_env, auxbas_pw_pool, irep) END IF DO iorb_block = 1, blocksize - CALL rho_i(iorb_block)%create(rho_r%pw_grid, in_space=REALSPACE) - CALL rho_j(iorb_block)%create(rho_r%pw_grid, in_space=REALSPACE) + CALL rho_i(iorb_block)%create(rho_r%pw_grid) + CALL rho_j(iorb_block)%create(rho_r%pw_grid) END DO exchange_energy = 0.0_dp diff --git a/src/hirshfeld_methods.F b/src/hirshfeld_methods.F index 19b63a1de6..ec30669341 100644 --- a/src/hirshfeld_methods.F +++ b/src/hirshfeld_methods.F @@ -46,8 +46,7 @@ MODULE hirshfeld_methods pw_env_type USE pw_methods, ONLY: pw_integrate_function USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kind_types, ONLY: get_qs_kind,& @@ -277,8 +276,8 @@ SUBROUTINE comp_hirshfeld_charges(qs_env, hirshfeld_env, charges) REAL(KIND=dp) :: tnfun TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhonorm - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type) :: rhonorm + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho NULLIFY (rho_r) @@ -291,7 +290,7 @@ SUBROUTINE comp_hirshfeld_charges(qs_env, hirshfeld_env, charges) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, rho=rho) CALL qs_rho_get(rho, rho_r=rho_r, rho_r_valid=rho_r_valid) CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rhonorm, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhonorm) ! loop over spins DO is = 1, SIZE(rho_r) IF (rho_r_valid) THEN @@ -366,8 +365,8 @@ SUBROUTINE comp_hirshfeld_i_charges(qs_env, hirshfeld_env, charges, ounit) REAL(KIND=dp) :: res, tnfun TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhonorm - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type) :: rhonorm + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho NULLIFY (rho_r) @@ -379,7 +378,7 @@ SUBROUTINE comp_hirshfeld_i_charges(qs_env, hirshfeld_env, charges, ounit) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, rho=rho) CALL qs_rho_get(rho, rho_r=rho_r, rho_r_valid=rho_r_valid) CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rhonorm, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhonorm) ! DO iloop = 1, maxloop @@ -447,7 +446,7 @@ SUBROUTINE calculate_hirshfeld_normalization(qs_env, hirshfeld_env) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: fnorm + TYPE(pw_r3d_rs_type), POINTER :: fnorm TYPE(realspace_grid_desc_type), POINTER :: auxbas_rs_desc TYPE(realspace_grid_type), POINTER :: rs_rho @@ -520,7 +519,7 @@ SUBROUTINE calculate_hirshfeld_normalization(qs_env, hirshfeld_env) DEALLOCATE (fnorm) END IF ALLOCATE (fnorm) - CALL auxbas_pw_pool%create_pw(fnorm, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(fnorm) CALL set_hirshfeld_info(hirshfeld_env, fnorm=fnorm) CALL transfer_rs2pw(rs_rho, fnorm) @@ -541,7 +540,7 @@ SUBROUTINE hirshfeld_integration(qs_env, hirshfeld_env, rfun, fval, fderiv) TYPE(qs_environment_type), POINTER :: qs_env TYPE(hirshfeld_type), POINTER :: hirshfeld_env - TYPE(pw_r3d_type) :: rfun + TYPE(pw_r3d_rs_type) :: rfun REAL(KIND=dp), DIMENSION(:), INTENT(inout) :: fval REAL(KIND=dp), DIMENSION(:, :), INTENT(inout), & OPTIONAL :: fderiv diff --git a/src/hirshfeld_types.F b/src/hirshfeld_types.F index c3ec3d28a0..ba244ee6be 100644 --- a/src/hirshfeld_types.F +++ b/src/hirshfeld_types.F @@ -17,7 +17,7 @@ MODULE hirshfeld_types USE input_constants, ONLY: radius_default,& shape_function_gaussian USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -43,7 +43,7 @@ MODULE hirshfeld_types POINTER :: kind_shape_fn REAL(KIND=dp), DIMENSION(:), & POINTER :: charges - TYPE(pw_r3d_type), POINTER :: fnorm + TYPE(pw_r3d_rs_type), POINTER :: fnorm END TYPE hirshfeld_type TYPE shape_fn @@ -138,7 +138,7 @@ SUBROUTINE get_hirshfeld_info(hirshfeld_env, shape_function_type, iterative, & INTEGER, INTENT(OUT), OPTIONAL :: shape_function_type LOGICAL, INTENT(OUT), OPTIONAL :: iterative INTEGER, INTENT(OUT), OPTIONAL :: ref_charge - TYPE(pw_r3d_type), OPTIONAL, POINTER :: fnorm + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: fnorm INTEGER, INTENT(OUT), OPTIONAL :: radius_type LOGICAL, INTENT(OUT), OPTIONAL :: use_bohr @@ -182,7 +182,7 @@ SUBROUTINE set_hirshfeld_info(hirshfeld_env, shape_function_type, iterative, & INTEGER, INTENT(IN), OPTIONAL :: shape_function_type LOGICAL, INTENT(IN), OPTIONAL :: iterative INTEGER, INTENT(IN), OPTIONAL :: ref_charge - TYPE(pw_r3d_type), OPTIONAL, POINTER :: fnorm + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: fnorm INTEGER, INTENT(IN), OPTIONAL :: radius_type LOGICAL, INTENT(IN), OPTIONAL :: use_bohr diff --git a/src/iao_analysis.F b/src/iao_analysis.F index 48ab821728..864a24e929 100644 --- a/src/iao_analysis.F +++ b/src/iao_analysis.F @@ -87,10 +87,8 @@ MODULE iao_analysis USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -995,10 +993,10 @@ SUBROUTINE print_iao_cubes(qs_env, print_section, iao_coef, basis_set_list) TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys @@ -1019,8 +1017,8 @@ SUBROUTINE print_iao_cubes(qs_env, print_section, iao_coef, basis_set_list) END DO CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) nspins = SIZE(iao_coef) nstart = MIN(1, n_rep) @@ -1084,10 +1082,10 @@ SUBROUTINE print_ibo_cubes(qs_env, print_section, ibo_coef) TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys @@ -1102,8 +1100,8 @@ SUBROUTINE print_ibo_cubes(qs_env, print_section, ibo_coef) CALL qs_subsys_get(subsys, particles=particles) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) nspins = SIZE(ibo_coef) nstart = MIN(1, n_rep) diff --git a/src/kg_correction.F b/src/kg_correction.F index 2314576a29..7cc604563f 100644 --- a/src/kg_correction.F +++ b/src/kg_correction.F @@ -41,8 +41,8 @@ MODULE kg_correction USE pw_methods, ONLY: pw_integral_ab,& pw_scale USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_integrate_potential, ONLY: integrate_v_rspace,& @@ -147,10 +147,10 @@ SUBROUTINE kg_ekin_embed(qs_env, kg_env, ks_matrix, ekin_mol, calc_force, do_ker TYPE(cp_logger_type), POINTER :: logger TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: density_matrix TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, vxc_rho, vxc_tau TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: old_rho, rho1, rho_struct TYPE(section_vals_type), POINTER :: xc_section @@ -412,7 +412,7 @@ SUBROUTINE kg_ekin_embed_lri(qs_env, kg_env, ks_matrix, ekin_mol, calc_force) TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: old_rho, rho_struct TYPE(virial_type), POINTER :: virial @@ -585,10 +585,10 @@ SUBROUTINE kg_ekin_ri_embed(qs_env, kg_env, ks_matrix, ekin_mol, calc_force, & TYPE(lri_environment_type), POINTER :: lri_env, lri_env1 TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_v_int TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, tau1_r, vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, tau1_r, vxc_rho, vxc_tau TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho, rho1, rho_struct TYPE(section_vals_type), POINTER :: xc_section diff --git a/src/library_tests.F b/src/library_tests.F index f2fd038000..9bff07de2e 100644 --- a/src/library_tests.F +++ b/src/library_tests.F @@ -88,11 +88,9 @@ MODULE library_tests pw_grid_setup USE pw_methods, ONLY: pw_transfer,& pw_zero - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_c3d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_c3d_rs_type,& + pw_r3d_rs_type USE realspace_grid_types, ONLY: & realspace_grid_desc_type, realspace_grid_input_type, realspace_grid_type, rs_grid_create, & rs_grid_create_descriptor, rs_grid_print, rs_grid_release, rs_grid_release_descriptor, & @@ -712,7 +710,7 @@ SUBROUTINE rs_pw_transfer_test(para_env, iw, globenv, rs_pw_transfer_section) REAL(KIND=dp) :: tend, tstart TYPE(cell_type), POINTER :: box TYPE(pw_grid_type), POINTER :: grid - TYPE(pw_r3d_type) :: ca + TYPE(pw_r3d_rs_type) :: ca TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_input_type) :: input_settings TYPE(realspace_grid_type) :: rs_grid @@ -741,7 +739,7 @@ SUBROUTINE rs_pw_transfer_test(para_env, iw, globenv, rs_pw_transfer_section) CALL pw_grid_setup(box%hmat, grid, grid_span=FULLSPACE, npts=np, fft_usage=.TRUE., iounit=iw) no = grid%npts - CALL ca%create(grid, REALSPACE) + CALL ca%create(grid) CALL pw_zero(ca) ! .. rs input setting type @@ -829,8 +827,8 @@ SUBROUTINE pw_fft_test(para_env, iw, globenv, pw_transfer_section) t_min, tend, tstart REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: t_end, t_start TYPE(cell_type), POINTER :: box - TYPE(pw_c1d_type) :: ca, cc - TYPE(pw_c3d_type) :: cb + TYPE(pw_c1d_gs_type) :: ca, cc + TYPE(pw_c3d_rs_type) :: cb TYPE(pw_grid_type), POINTER :: grid !..set fft lib @@ -938,9 +936,9 @@ SUBROUTINE pw_fft_test(para_env, iw, globenv, pw_transfer_section) ! note that the number of grid points might be different from what the user requested (fft-able needed) no = grid%npts - CALL ca%create(grid, RECIPROCALSPACE) - CALL cb%create(grid, REALSPACE) - CALL cc%create(grid, RECIPROCALSPACE) + CALL ca%create(grid) + CALL cb%create(grid) + CALL cc%create(grid) ! initialize data CALL pw_zero(ca) diff --git a/src/localization_tb.F b/src/localization_tb.F index 70b939325f..5a5845b2a6 100644 --- a/src/localization_tb.F +++ b/src/localization_tb.F @@ -32,10 +32,8 @@ MODULE localization_tb pw_env_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& set_qs_env @@ -95,11 +93,11 @@ SUBROUTINE wfn_localization_tb(qs_env, tb_type) TYPE(mo_set_type), DIMENSION(:), POINTER :: mos TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_loc_env_type), POINTER :: qs_loc_env_homo TYPE(qs_subsys_type), POINTER :: subsys @@ -178,8 +176,8 @@ SUBROUTINE wfn_localization_tb(qs_env, tb_type) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) NULLIFY (marked_states, qs_loc_env_homo) ALLOCATE (qs_loc_env_homo) diff --git a/src/lri_environment_methods.F b/src/lri_environment_methods.F index 5851891b8e..49b1a74dd0 100644 --- a/src/lri_environment_methods.F +++ b/src/lri_environment_methods.F @@ -59,8 +59,8 @@ MODULE lri_environment_methods invmat_symm USE message_passing, ONLY: mp_para_env_type USE particle_types, ONLY: particle_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_lri_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -351,8 +351,8 @@ SUBROUTINE lri_kg_rho_update(rho_struct, qs_env, lri_env, lri_density, atomlist) TYPE(dbcsr_type) :: pmat_diag TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r CALL timeset(routineN, handle) @@ -847,8 +847,8 @@ SUBROUTINE distribute_lri_density_on_the_grid(lri_env, lri_density, qs_env, & DIMENSION(:), POINTER :: nl_iterator TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: soo_list - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho CALL timeset(routineN, handle) diff --git a/src/maxwell_solver_interface.F b/src/maxwell_solver_interface.F index 96af058cdb..0faf527e70 100644 --- a/src/maxwell_solver_interface.F +++ b/src/maxwell_solver_interface.F @@ -17,7 +17,7 @@ MODULE maxwell_solver_interface cp_logger_get_default_io_unit, & cp_logger_type USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE ISO_C_BINDING, ONLY: C_INT, C_DOUBLE #include "./base/base_uses.f90" @@ -74,7 +74,7 @@ END FUNCTION libcp2kmw_getzrow ! ************************************************************************************************** SUBROUTINE maxwell_solver(maxwell_control, v_ee, sim_step, sim_time, scaling_factor) TYPE(maxwell_control_type), INTENT(IN) :: maxwell_control - TYPE(pw_r3d_type), POINTER :: v_ee + TYPE(pw_r3d_rs_type), POINTER :: v_ee INTEGER, INTENT(IN) :: sim_step REAL(KIND=dp), INTENT(IN) :: sim_time REAL(KIND=dp), INTENT(IN) :: scaling_factor diff --git a/src/minbas_wfn_analysis.F b/src/minbas_wfn_analysis.F index 4d3c29814e..14e80dc11b 100644 --- a/src/minbas_wfn_analysis.F +++ b/src/minbas_wfn_analysis.F @@ -65,10 +65,8 @@ MODULE minbas_wfn_analysis USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -492,10 +490,10 @@ SUBROUTINE post_minbas_cubes(qs_env, print_section, minbas_coeff, ispin) TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: minbas_section @@ -520,8 +518,8 @@ SUBROUTINE post_minbas_cubes(qs_env, print_section, minbas_coeff, ispin) END DO CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) ! loop over list of atoms CALL section_vals_val_get(minbas_section, "ATOM_LIST", n_rep_val=n_rep) diff --git a/src/mixed_cdft_methods.F b/src/mixed_cdft_methods.F index a9351a0d5c..4ebf76d103 100644 --- a/src/mixed_cdft_methods.F +++ b/src/mixed_cdft_methods.F @@ -96,7 +96,6 @@ MODULE mixed_cdft_methods pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE USE qs_cdft_types, ONLY: cdft_control_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& @@ -650,8 +649,7 @@ SUBROUTINE mixed_cdft_build_weight_parallel(force_env, calculate_forces) ! In principle, we could reduce the memory footprint of becke_pot by only transferring the nonzero portion ! of the potential, but this would require a custom integrate_v_rspace ALLOCATE (cdft_control_target%group(1)%weight) - CALL auxbas_pw_pool%create_pw(cdft_control_target%group(1)%weight, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control_target%group(1)%weight) CALL pw_zero(cdft_control_target%group(1)%weight) ! Assemble the recved slices DO j = 1, SIZE(mixed_cdft%source_list) @@ -944,8 +942,7 @@ SUBROUTINE mixed_cdft_transfer_weight(force_env, calculate_forces, iforce_eval) ! Weight function DO igroup = 1, SIZE(cdft_control_target%group) ALLOCATE (cdft_control_target%group(igroup)%weight) - CALL auxbas_pw_pool_target%create_pw(cdft_control_target%group(igroup)%weight, & - in_space=REALSPACE) + CALL auxbas_pw_pool_target%create_pw(cdft_control_target%group(igroup)%weight) ! We have ensured that the grids are consistent => no danger in using explicit copy CALL pw_copy(cdft_control_source%group(igroup)%weight, cdft_control_target%group(igroup)%weight) CALL auxbas_pw_pool_source%give_back_pw(cdft_control_source%group(igroup)%weight) @@ -954,8 +951,7 @@ SUBROUTINE mixed_cdft_transfer_weight(force_env, calculate_forces, iforce_eval) ! Cavity IF (cdft_control_source%type == outer_scf_becke_constraint) THEN IF (cdft_control_source%becke_control%cavity_confine) THEN - CALL auxbas_pw_pool_target%create_pw(cdft_control_target%becke_control%cavity, & - in_space=REALSPACE) + CALL auxbas_pw_pool_target%create_pw(cdft_control_target%becke_control%cavity) CALL pw_copy(cdft_control_source%becke_control%cavity, cdft_control_target%becke_control%cavity) CALL auxbas_pw_pool_source%give_back_pw(cdft_control_source%becke_control%cavity) END IF @@ -983,8 +979,7 @@ SUBROUTINE mixed_cdft_transfer_weight(force_env, calculate_forces, iforce_eval) IF (.NOT. ASSOCIATED(cdft_control_target%charge)) & ALLOCATE (cdft_control_target%charge(cdft_control_target%natoms)) DO iatom = 1, cdft_control_target%natoms - CALL auxbas_pw_pool_target%create_pw(cdft_control_target%charge(iatom), & - in_space=REALSPACE) + CALL auxbas_pw_pool_target%create_pw(cdft_control_target%charge(iatom)) CALL pw_copy(cdft_control_source%charge(iatom), cdft_control_target%charge(iatom)) CALL auxbas_pw_pool_source%give_back_pw(cdft_control_source%charge(iatom)) END DO @@ -2580,8 +2575,7 @@ SUBROUTINE mixed_becke_constraint_init(force_env, mixed_cdft, calculate_forces, DEALLOCATE (cores) END DO DEALLOCATE (pab) - CALL auxbas_pw_pool%create_pw(cdft_control%becke_control%cavity, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%becke_control%cavity) CALL transfer_rs2pw(rs_cavity, cdft_control%becke_control%cavity) CALL hfun_zero(cdft_control%becke_control%cavity%array, & cdft_control%becke_control%eps_cavity, & diff --git a/src/mm_collocate_potential.F b/src/mm_collocate_potential.F index d8b0e175dd..8d47cd7744 100644 --- a/src/mm_collocate_potential.F +++ b/src/mm_collocate_potential.F @@ -18,7 +18,7 @@ MODULE mm_collocate_potential USE cube_utils, ONLY: cube_info_type,& return_cube USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -173,7 +173,7 @@ SUBROUTINE collocate_gf_rspace_NoPBC(zetp, rp, scale, W, pwgrid, cube_info, & REAL(KIND=dp), INTENT(IN) :: zetp REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rp REAL(KIND=dp), INTENT(IN) :: scale, W - TYPE(pw_r3d_type), INTENT(IN) :: pwgrid + TYPE(pw_r3d_rs_type), INTENT(IN) :: pwgrid TYPE(cube_info_type), INTENT(IN) :: cube_info REAL(KIND=dp), INTENT(IN) :: eps_mm_rspace REAL(KIND=dp), DIMENSION(:), POINTER :: xdat, ydat, zdat @@ -296,7 +296,7 @@ SUBROUTINE integrate_gf_rspace_NoPBC(zetp, rp, scale, W, pwgrid, cube_info, & REAL(KIND=dp), INTENT(IN) :: zetp REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rp REAL(KIND=dp), INTENT(IN) :: scale, W - TYPE(pw_r3d_type), INTENT(IN) :: pwgrid + TYPE(pw_r3d_rs_type), INTENT(IN) :: pwgrid TYPE(cube_info_type), INTENT(IN) :: cube_info REAL(KIND=dp), INTENT(IN) :: eps_mm_rspace INTEGER, DIMENSION(2, 3), INTENT(IN) :: bo diff --git a/src/molecular_states.F b/src/molecular_states.F index f5e0ba2037..16e2de5cdc 100644 --- a/src/molecular_states.F +++ b/src/molecular_states.F @@ -47,8 +47,8 @@ MODULE molecular_states USE particle_list_types, ONLY: particle_list_type USE particle_types, ONLY: particle_type USE pw_env_types, ONLY: pw_env_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -97,8 +97,8 @@ SUBROUTINE construct_molecular_states(molecule_set, mo_localized, & REAL(KIND=dp), DIMENSION(:), POINTER :: mo_eigenvalues TYPE(dbcsr_type), POINTER :: Hks, matrix_S TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(INOUT) :: wf_r - TYPE(pw_c1d_type), INTENT(INOUT) :: wf_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: wf_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: wf_g TYPE(section_vals_type), POINTER :: loc_print_section TYPE(particle_list_type), POINTER :: particles CHARACTER(LEN=*), INTENT(IN) :: tag diff --git a/src/mp2_cphf.F b/src/mp2_cphf.F index 369fcdd387..c9e5f2330f 100644 --- a/src/mp2_cphf.F +++ b/src/mp2_cphf.F @@ -87,10 +87,8 @@ MODULE mp2_cphf USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_2nd_kernel_ao, ONLY: apply_2nd_order_kernel USE qs_density_matrices, ONLY: calculate_whz_matrix USE qs_dispersion_pairpot, ONLY: calculate_dispersion_pairpot @@ -1330,15 +1328,15 @@ SUBROUTINE update_mp2_forces(qs_env) TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb, sac_ae, sac_ppl, sap_ppnl TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: pot_g, rho_tot_g, temp_pw_g - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: dvg - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g, rho_mp2_g - TYPE(pw_c1d_type), POINTER :: rho_core + TYPE(pw_c1d_gs_type) :: pot_g, rho_tot_g, temp_pw_g + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: dvg + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g, rho_mp2_g + TYPE(pw_c1d_gs_type), POINTER :: rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: pot_r, vh_rspace, vhxc_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_mp2_r, rho_mp2_r_aux, rho_r, & + TYPE(pw_r3d_rs_type) :: pot_r, vh_rspace, vhxc_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_mp2_r, rho_mp2_r_aux, rho_r, & tau_mp2_r, vadmm_rspace, vtau_rspace, & vxc_rspace TYPE(qs_dispersion_type), POINTER :: dispersion_env @@ -1530,8 +1528,7 @@ SUBROUTINE update_mp2_forces(qs_env) CALL get_qs_env(qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(vhxc_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vhxc_rspace) IF (use_virial) h_stress = virial%pv_virial IF (debug_forces) THEN deb(1:3) = force(1)%rho_elec(1:3, 1) @@ -1618,9 +1615,9 @@ SUBROUTINE update_mp2_forces(qs_env) poisson_env=poisson_env) ! get some of the grids ready - CALL auxbas_pw_pool%create_pw(pot_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(pot_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pot_r) + CALL auxbas_pw_pool%create_pw(pot_g) + CALL auxbas_pw_pool%create_pw(rho_tot_g) CALL pw_zero(rho_tot_g) @@ -1632,7 +1629,7 @@ SUBROUTINE update_mp2_forces(qs_env) IF (use_virial) THEN ALLOCATE (dvg(3)) DO idir = 1, 3 - CALL auxbas_pw_pool%create_pw(dvg(idir), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(dvg(idir)) END DO CALL pw_poisson_solve(poisson_env, rho_tot_g, vhartree=pot_g, dvhartree=dvg) ELSE @@ -1660,8 +1657,7 @@ SUBROUTINE update_mp2_forces(qs_env) IF (use_virial) THEN ! update virial if necessary with the volume term ! first create pw auxiliary stuff - CALL auxbas_pw_pool%create_pw(temp_pw_g, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(temp_pw_g) ! make a copy of the MP2 density in G space CALL pw_copy(rho_tot_g, temp_pw_g) diff --git a/src/mp2_eri_gpw.F b/src/mp2_eri_gpw.F index 017aadfecc..920e1304d1 100644 --- a/src/mp2_eri_gpw.F +++ b/src/mp2_eri_gpw.F @@ -11,65 +11,63 @@ !> 07.2019 separated from mp2_integrals.F [Frederick Stein] ! ************************************************************************************************** MODULE mp2_eri_gpw - USE ao_util, ONLY: exp_radius_very_extended - USE atomic_kind_types, ONLY: atomic_kind_type - USE basis_set_types, ONLY: gto_basis_set_type - USE cell_types, ONLY: cell_type, & - pbc - USE cp_control_types, ONLY: dft_control_type - USE cp_fm_types, ONLY: cp_fm_type - USE dbcsr_api, ONLY: dbcsr_p_type, & - dbcsr_set - USE gaussian_gridlevels, ONLY: gaussian_gridlevel - USE input_constants, ONLY: do_potential_coulomb, & - do_potential_id, & - do_potential_long, & - do_potential_mix_cl, & - do_potential_short, & - do_potential_truncated - USE kinds, ONLY: dp - USE libint_2c_3c, ONLY: libint_potential_type - USE mathconstants, ONLY: fourpi - USE message_passing, ONLY: mp_para_env_type - USE orbital_pointers, ONLY: ncoset - USE particle_types, ONLY: particle_type - USE pw_env_methods, ONLY: pw_env_create, & - pw_env_rebuild - USE pw_env_types, ONLY: pw_env_get, & - pw_env_release, & - pw_env_type - USE pw_methods, ONLY: & - pw_compl_gauss_damp, pw_copy, pw_derive, pw_gauss_damp, pw_gauss_damp_mix, pw_integral_ab, & - pw_log_deriv_compl_gauss, pw_log_deriv_gauss, pw_log_deriv_mix_cl, pw_log_deriv_trunc, & - pw_scale, pw_transfer, pw_truncated, pw_zero - USE pw_poisson_methods, ONLY: pw_poisson_solve - USE pw_poisson_types, ONLY: pw_poisson_type - USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: & - REALSPACE, & - RECIPROCALSPACE, & - pw_c1d_type, pw_r3d_type - USE qs_collocate_density, ONLY: calculate_rho_elec, & - calculate_wavefunction, & - collocate_single_gaussian - USE qs_environment_types, ONLY: get_qs_env, & - qs_environment_type - USE qs_force_types, ONLY: qs_force_type - USE qs_integrate_potential, ONLY: integrate_pgf_product, & - integrate_v_rspace - USE qs_kind_types, ONLY: get_qs_kind, & - get_qs_kind_set, & - qs_kind_type - USE qs_ks_types, ONLY: qs_ks_env_type - USE qs_neighbor_list_types, ONLY: neighbor_list_set_p_type - USE realspace_grid_types, ONLY: map_gaussian_here, & - realspace_grid_desc_p_type, & - realspace_grid_type - USE rs_pw_interface, ONLY: potential_pw2rs - USE task_list_methods, ONLY: generate_qs_task_list - USE task_list_types, ONLY: allocate_task_list, & - deallocate_task_list, & - task_list_type + USE ao_util, ONLY: exp_radius_very_extended + USE atomic_kind_types, ONLY: atomic_kind_type + USE basis_set_types, ONLY: gto_basis_set_type + USE cell_types, ONLY: cell_type,& + pbc + USE cp_control_types, ONLY: dft_control_type + USE cp_fm_types, ONLY: cp_fm_type + USE dbcsr_api, ONLY: dbcsr_p_type,& + dbcsr_set + USE gaussian_gridlevels, ONLY: gaussian_gridlevel + USE input_constants, ONLY: do_potential_coulomb,& + do_potential_id,& + do_potential_long,& + do_potential_mix_cl,& + do_potential_short,& + do_potential_truncated + USE kinds, ONLY: dp + USE libint_2c_3c, ONLY: libint_potential_type + USE mathconstants, ONLY: fourpi + USE message_passing, ONLY: mp_para_env_type + USE orbital_pointers, ONLY: ncoset + USE particle_types, ONLY: particle_type + USE pw_env_methods, ONLY: pw_env_create,& + pw_env_rebuild + USE pw_env_types, ONLY: pw_env_get,& + pw_env_release,& + pw_env_type + USE pw_methods, ONLY: & + pw_compl_gauss_damp, pw_copy, pw_derive, pw_gauss_damp, pw_gauss_damp_mix, pw_integral_ab, & + pw_log_deriv_compl_gauss, pw_log_deriv_gauss, pw_log_deriv_mix_cl, pw_log_deriv_trunc, & + pw_scale, pw_transfer, pw_truncated, pw_zero + USE pw_poisson_methods, ONLY: pw_poisson_solve + USE pw_poisson_types, ONLY: pw_poisson_type + USE pw_pool_types, ONLY: pw_pool_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type + USE qs_collocate_density, ONLY: calculate_rho_elec,& + calculate_wavefunction,& + collocate_single_gaussian + USE qs_environment_types, ONLY: get_qs_env,& + qs_environment_type + USE qs_force_types, ONLY: qs_force_type + USE qs_integrate_potential, ONLY: integrate_pgf_product,& + integrate_v_rspace + USE qs_kind_types, ONLY: get_qs_kind,& + get_qs_kind_set,& + qs_kind_type + USE qs_ks_types, ONLY: qs_ks_env_type + USE qs_neighbor_list_types, ONLY: neighbor_list_set_p_type + USE realspace_grid_types, ONLY: map_gaussian_here,& + realspace_grid_desc_p_type,& + realspace_grid_type + USE rs_pw_interface, ONLY: potential_pw2rs + USE task_list_methods, ONLY: generate_qs_task_list + USE task_list_types, ONLY: allocate_task_list,& + deallocate_task_list,& + task_list_type !$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num #include "./base/base_uses.f90" @@ -111,8 +109,8 @@ SUBROUTINE mp2_eri_3c_integrate_gpw(mo_coeff, psi_L, rho_g, atomic_kind_set, qs_ potential_parameter, mat_munu, qs_env, task_list_sub) TYPE(cp_fm_type), INTENT(IN) :: mo_coeff - TYPE(pw_r3d_type), INTENT(INOUT) :: psi_L - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: psi_L + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g TYPE(atomic_kind_type), DIMENSION(:), INTENT(IN), & POINTER :: atomic_kind_set TYPE(qs_kind_type), DIMENSION(:), INTENT(IN), & @@ -124,8 +122,8 @@ SUBROUTINE mp2_eri_3c_integrate_gpw(mo_coeff, psi_L, rho_g, atomic_kind_set, qs_ TYPE(pw_env_type), INTENT(IN), POINTER :: pw_env_sub REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: external_vector TYPE(pw_poisson_type), INTENT(IN), POINTER :: poisson_env - TYPE(pw_r3d_type), INTENT(INOUT) :: rho_r - TYPE(pw_c1d_type), INTENT(INOUT) :: pot_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pot_g TYPE(libint_potential_type), INTENT(IN) :: potential_parameter TYPE(dbcsr_p_type), INTENT(INOUT) :: mat_munu TYPE(qs_environment_type), INTENT(IN), POINTER :: qs_env @@ -182,7 +180,7 @@ SUBROUTINE mp2_eri_2c_integrate_gpw(qs_env, para_env_sub, my_group_L_start, my_g CHARACTER(LEN=*), PARAMETER :: routineN = 'mp2_eri_2c_integrate_gpw' INTEGER :: dir, handle, handle2, i_counter, iatom, igrid_level, ikind, ipgf, iset, lb(3), & - LLL, location(3), max_nseta, na1, na2, ncoa, nseta, offset, sgfa, tp(3), ub(3) + LLL, location(3), max_nseta, na1, na2, ncoa, nseta, offset, sgfa, tp(3), ub(3) INTEGER, ALLOCATABLE, DIMENSION(:, :) :: offset_2d INTEGER, DIMENSION(:), POINTER :: la_max, la_min, npgfa, nsgfa INTEGER, DIMENSION(:, :), POINTER :: first_sgfa @@ -198,11 +196,11 @@ SUBROUTINE mp2_eri_2c_integrate_gpw(qs_env, para_env_sub, my_group_L_start, my_g TYPE(dft_control_type), POINTER :: dft_control TYPE(gto_basis_set_type), POINTER :: basis_set_a TYPE(particle_type), DIMENSION(:), POINTER :: particle_set + TYPE(pw_c1d_gs_type) :: pot_g, rho_g TYPE(pw_env_type), POINTER :: pw_env_sub TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: psi_L, rho_r - TYPE(pw_c1d_type) :: pot_g, rho_g + TYPE(pw_r3d_rs_type) :: psi_L, rho_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_desc_p_type), DIMENSION(:), & POINTER :: rs_descs @@ -383,10 +381,10 @@ SUBROUTINE integrate_potential_forces_2c(rho_r, LLL, matrix, rho_g, atomic_kind_ kind_of, atom_of_kind, G_PQ_local, force, h_stress, para_env_sub, & dft_control, psi_L, factor) - TYPE(pw_r3d_type), INTENT(INOUT) :: rho_r + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho_r INTEGER, INTENT(IN) :: LLL TYPE(cp_fm_type), INTENT(IN) :: matrix - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g TYPE(atomic_kind_type), DIMENSION(:), INTENT(IN), & POINTER :: atomic_kind_set TYPE(qs_kind_type), DIMENSION(:), INTENT(IN), & @@ -396,10 +394,10 @@ SUBROUTINE integrate_potential_forces_2c(rho_r, LLL, matrix, rho_g, atomic_kind_ TYPE(cell_type), INTENT(IN), POINTER :: cell TYPE(pw_env_type), INTENT(IN), POINTER :: pw_env_sub TYPE(pw_poisson_type), INTENT(IN), POINTER :: poisson_env - TYPE(pw_c1d_type), INTENT(INOUT) :: pot_g + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pot_g TYPE(libint_potential_type), INTENT(IN) :: potential_parameter LOGICAL, INTENT(IN) :: use_virial - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g_copy, dvg(3) + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g_copy, dvg(3) INTEGER, DIMENSION(:), INTENT(IN) :: kind_of, atom_of_kind REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: G_PQ_local TYPE(qs_force_type), DIMENSION(:), INTENT(IN), & @@ -407,7 +405,7 @@ SUBROUTINE integrate_potential_forces_2c(rho_r, LLL, matrix, rho_g, atomic_kind_ REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: h_stress TYPE(mp_para_env_type), INTENT(IN) :: para_env_sub TYPE(dft_control_type), INTENT(IN), POINTER :: dft_control - TYPE(pw_r3d_type), INTENT(INOUT) :: psi_L + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: psi_L REAL(KIND=dp), INTENT(IN) :: factor CHARACTER(LEN=*), PARAMETER :: routineN = 'integrate_potential_forces_2c' @@ -473,7 +471,7 @@ SUBROUTINE integrate_potential_forces_3c_1c(mat_munu, rho_r, matrix_P_munu, qs_e task_list_sub) TYPE(dbcsr_p_type), INTENT(INOUT) :: mat_munu - TYPE(pw_r3d_type), INTENT(IN) :: rho_r + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_r TYPE(dbcsr_p_type), INTENT(IN) :: matrix_P_munu TYPE(qs_environment_type), INTENT(IN), POINTER :: qs_env TYPE(pw_env_type), INTENT(IN), POINTER :: pw_env_sub @@ -528,17 +526,17 @@ SUBROUTINE integrate_potential_forces_3c_2c(matrix_P_munu, rho_r, rho_g, task_li qs_kind_set, particle_set, cell, LLL, force, dft_control) TYPE(dbcsr_p_type), INTENT(IN) :: matrix_P_munu - TYPE(pw_r3d_type), INTENT(INOUT) :: rho_r - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g TYPE(task_list_type), INTENT(IN), POINTER :: task_list_sub TYPE(pw_env_type), INTENT(IN), POINTER :: pw_env_sub TYPE(libint_potential_type), INTENT(IN) :: potential_parameter TYPE(qs_ks_env_type), INTENT(IN), POINTER :: ks_env TYPE(pw_poisson_type), INTENT(IN), POINTER :: poisson_env - TYPE(pw_c1d_type), INTENT(INOUT) :: pot_g + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pot_g LOGICAL, INTENT(IN) :: use_virial - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g_copy - TYPE(pw_c1d_type), INTENT(IN) :: dvg(3) + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g_copy + TYPE(pw_c1d_gs_type), INTENT(IN) :: dvg(3) REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: h_stress TYPE(mp_para_env_type), INTENT(IN) :: para_env_sub INTEGER, DIMENSION(:), INTENT(IN) :: kind_of, atom_of_kind @@ -721,9 +719,9 @@ END SUBROUTINE integrate_potential_forces_3c_2c ! ************************************************************************************************** SUBROUTINE virial_gpw_potential(rho_g_copy, pot_g, rho_g, dvg, h_stress, potential_parameter, para_env_sub) - TYPE(pw_c1d_type), INTENT(IN) :: rho_g_copy, pot_g - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g - TYPE(pw_c1d_type), INTENT(IN) :: dvg(3) + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_g_copy, pot_g + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: dvg(3) REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: h_stress TYPE(libint_potential_type), INTENT(IN) :: potential_parameter TYPE(mp_para_env_type), INTENT(IN) :: para_env_sub @@ -763,13 +761,9 @@ END SUBROUTINE virial_gpw_potential !> \param potential_parameter parameters of potential V(g) ! ************************************************************************************************** SUBROUTINE factor_virial_gpw(pw, potential_parameter) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw TYPE(libint_potential_type), INTENT(IN) :: potential_parameter - IF (.NOT. (pw%in_space == RECIPROCALSPACE)) THEN - CPABORT("pw in wrong space or wrong data type") - END IF - SELECT CASE (potential_parameter%potential_type) CASE (do_potential_coulomb) RETURN @@ -810,7 +804,7 @@ SUBROUTINE integrate_potential(pw_env_sub, pot_r, kind_of, atom_of_kind, particl G_PQ_local, cell, force, use_virial, h_stress, para_env_sub, dft_control) TYPE(pw_env_type), INTENT(IN), POINTER :: pw_env_sub - TYPE(pw_r3d_type), INTENT(IN) :: pot_r + TYPE(pw_r3d_rs_type), INTENT(IN) :: pot_r INTEGER, DIMENSION(:), INTENT(IN) :: kind_of, atom_of_kind TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -980,8 +974,9 @@ SUBROUTINE prepare_gpw(qs_env, dft_control, e_cutoff_old, cutoff_old, relative_c TYPE(pw_pool_type), INTENT(IN), POINTER :: auxbas_pw_pool TYPE(pw_poisson_type), INTENT(IN), POINTER :: poisson_env TYPE(task_list_type), POINTER :: task_list_sub - TYPE(pw_r3d_type), INTENT(OUT) :: rho_r, psi_L - TYPE(pw_c1d_type), INTENT(OUT) :: rho_g, pot_g + TYPE(pw_r3d_rs_type), INTENT(OUT) :: rho_r + TYPE(pw_c1d_gs_type), INTENT(OUT) :: rho_g, pot_g + TYPE(pw_r3d_rs_type), INTENT(OUT) :: psi_L TYPE(neighbor_list_set_p_type), DIMENSION(:), & INTENT(IN), POINTER :: sab_orb_sub @@ -1032,10 +1027,10 @@ SUBROUTINE prepare_gpw(qs_env, dft_control, e_cutoff_old, cutoff_old, relative_c pw_env_external=pw_env_sub, sab_orb_external=sab_orb_sub) ! get some of the grids ready - CALL auxbas_pw_pool%create_pw(rho_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(pot_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(psi_L, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r) + CALL auxbas_pw_pool%create_pw(rho_g) + CALL auxbas_pw_pool%create_pw(pot_g) + CALL auxbas_pw_pool%create_pw(psi_L) ! run the FFT once, to set up buffers and to take into account the memory CALL pw_zero(rho_r) @@ -1070,8 +1065,9 @@ SUBROUTINE cleanup_gpw(qs_env, e_cutoff_old, cutoff_old, relative_cutoff_old, pa TYPE(pw_env_type), POINTER :: pw_env_sub TYPE(task_list_type), POINTER :: task_list_sub TYPE(pw_pool_type), INTENT(IN), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), INTENT(INOUT) :: rho_r, psi_L - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_g, pot_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_g, pot_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: psi_L CHARACTER(LEN=*), PARAMETER :: routineN = 'cleanup_gpw' @@ -1111,36 +1107,22 @@ END SUBROUTINE cleanup_gpw !> \param no_transfer whether NOT to transform potential from g-space to r-space (default: do it) ! ************************************************************************************************** SUBROUTINE calc_potential_gpw(pot_r, rho_g, poisson_env, pot_g, potential_parameter, dvg, no_transfer) - TYPE(pw_r3d_type), INTENT(INOUT) :: pot_r - TYPE(pw_c1d_type), INTENT(IN) :: rho_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pot_r + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_g TYPE(pw_poisson_type), INTENT(IN), POINTER :: poisson_env - TYPE(pw_c1d_type), INTENT(INOUT) :: pot_g + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pot_g TYPE(libint_potential_type), INTENT(IN), OPTIONAL :: potential_parameter - TYPE(pw_c1d_type), DIMENSION(3), INTENT(INOUT), & - OPTIONAL :: dvg + TYPE(pw_c1d_gs_type), DIMENSION(3), & + INTENT(INOUT), OPTIONAL :: dvg LOGICAL, INTENT(IN), OPTIONAL :: no_transfer CHARACTER(LEN=*), PARAMETER :: routineN = 'calc_potential_gpw' INTEGER :: comp(3), handle, idir, my_potential_type LOGICAL :: my_transfer - TYPE(pw_c1d_type) :: my_rho_g, my_pot_g, my_dvg(3) CALL timeset(routineN, handle) - #:for grid in ["rho_g", "pot_g"] - my_${grid}$%pw_grid => ${grid}$%pw_grid - my_${grid}$%in_space = ${grid}$%in_space - my_${grid}$%array => ${grid}$%array - #:endfor - IF (PRESENT(dvg)) THEN - #:for grid in ["dvg(1)", "dvg(2)", "dvg(3)"] - my_${grid}$%pw_grid => ${grid}$%pw_grid - my_${grid}$%in_space = ${grid}$%in_space - my_${grid}$%array => ${grid}$%array - #:endfor - END IF - my_potential_type = do_potential_coulomb IF (PRESENT(potential_parameter)) THEN my_potential_type = potential_parameter%potential_type @@ -1157,25 +1139,25 @@ SUBROUTINE calc_potential_gpw(pot_r, rho_g, poisson_env, pot_g, potential_parame ELSE CALL pw_poisson_solve(poisson_env, rho_g, vhartree=pot_g) END IF - IF (my_potential_type == do_potential_long) CALL pw_gauss_damp(my_pot_g, potential_parameter%omega) - IF (my_potential_type == do_potential_short) CALL pw_compl_gauss_damp(my_pot_g, potential_parameter%omega) - IF (my_potential_type == do_potential_truncated) CALL pw_truncated(my_pot_g, potential_parameter%cutoff_radius) - IF (my_potential_type == do_potential_mix_cl) CALL pw_gauss_damp_mix(my_pot_g, potential_parameter%omega, & + IF (my_potential_type == do_potential_long) CALL pw_gauss_damp(pot_g, potential_parameter%omega) + IF (my_potential_type == do_potential_short) CALL pw_compl_gauss_damp(pot_g, potential_parameter%omega) + IF (my_potential_type == do_potential_truncated) CALL pw_truncated(pot_g, potential_parameter%cutoff_radius) + IF (my_potential_type == do_potential_mix_cl) CALL pw_gauss_damp_mix(pot_g, potential_parameter%omega, & potential_parameter%scale_coulomb, & potential_parameter%scale_longrange) - IF (my_transfer) CALL pw_transfer(my_pot_g, pot_r) + IF (my_transfer) CALL pw_transfer(pot_g, pot_r) ELSE ! If we use an overlap metric, make sure to use the correct potential=density on output - CALL pw_copy(my_rho_g, my_pot_g) + CALL pw_copy(rho_g, pot_g) IF (PRESENT(dvg)) THEN DO idir = 1, 3 - CALL pw_copy(my_pot_g, my_dvg(idir)) + CALL pw_copy(pot_g, dvg(idir)) comp = 0 comp(idir) = 1 - CALL pw_derive(my_dvg(idir), comp) + CALL pw_derive(dvg(idir), comp) END DO END IF - IF (my_transfer) CALL pw_transfer(my_rho_g, pot_r) + IF (my_transfer) CALL pw_transfer(rho_g, pot_r) END IF IF (my_transfer) CALL pw_scale(pot_r, pot_r%pw_grid%dvol) diff --git a/src/mp2_gpw_method.F b/src/mp2_gpw_method.F index c50f2e861e..5dc66c8cfc 100644 --- a/src/mp2_gpw_method.F +++ b/src/mp2_gpw_method.F @@ -47,9 +47,8 @@ MODULE mp2_gpw_method pw_zero USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: qs_environment_type USE qs_integrate_potential, ONLY: integrate_v_rspace @@ -156,12 +155,12 @@ SUBROUTINE mp2_gpw_compute(Emp2, Emp2_Cou, Emp2_EX, qs_env, para_env, para_env_s TYPE(dft_control_type), POINTER :: dft_control TYPE(group_dist_d1_type) :: gd_exchange TYPE(mp_comm_type) :: comm_exchange - TYPE(pw_c1d_type) :: pot_g, rho_g + TYPE(pw_c1d_gs_type) :: pot_g, rho_g TYPE(pw_env_type), POINTER :: pw_env_sub TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: psi_a, rho_r - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: psi_i + TYPE(pw_r3d_rs_type) :: psi_a, rho_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: psi_i TYPE(task_list_type), POINTER :: task_list_sub CALL timeset(routineN, handle) @@ -361,7 +360,7 @@ SUBROUTINE mp2_gpw_compute(Emp2, Emp2_Cou, Emp2_EX, qs_env, para_env, para_env_s ALLOCATE (psi_i(my_I_occupied_start:my_I_occupied_end)) DO i = my_I_occupied_start, my_I_occupied_end - CALL auxbas_pw_pool%create_pw(psi_i(i), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(psi_i(i)) CALL calculate_wavefunction(mo_coeff, i, psi_i(i), rho_g, atomic_kind_set, & qs_kind_set, cell, dft_control, particle_set, & pw_env_sub, external_vector=my_Cocc(:, i - my_I_occupied_start + 1)) diff --git a/src/mp2_integrals.F b/src/mp2_integrals.F index e5a6617d82..9d4b44a73a 100644 --- a/src/mp2_integrals.F +++ b/src/mp2_integrals.F @@ -79,8 +79,8 @@ MODULE mp2_integrals USE pw_env_types, ONLY: pw_env_type USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& set_qs_env @@ -283,11 +283,11 @@ SUBROUTINE mp2_ri_gpw_compute_in(BIb_C, BIb_C_gw, BIb_C_bse_ij, BIb_C_bse_ab, gd DIMENSION(:) :: intermed_mat, intermed_mat_gw TYPE(mp_cart_type) :: mp_comm_t3c_2 TYPE(neighbor_list_3c_type) :: nl_3c - TYPE(pw_c1d_type) :: pot_g, rho_g + TYPE(pw_c1d_gs_type) :: pot_g, rho_g TYPE(pw_env_type), POINTER :: pw_env_sub TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: psi_L, rho_r + TYPE(pw_r3d_rs_type) :: psi_L, rho_r TYPE(section_vals_type), POINTER :: qs_section TYPE(task_list_type), POINTER :: task_list_sub diff --git a/src/mp2_ri_grad.F b/src/mp2_ri_grad.F index 64145be601..76431f19ce 100644 --- a/src/mp2_ri_grad.F +++ b/src/mp2_ri_grad.F @@ -58,9 +58,8 @@ MODULE mp2_ri_grad USE pw_env_types, ONLY: pw_env_type USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_force_types, ONLY: allocate_qs_force,& @@ -157,11 +156,11 @@ SUBROUTINE calc_ri_mp2_nonsep(qs_env, mp2_env, para_env, para_env_sub, cell, par TYPE(dft_control_type), POINTER :: dft_control TYPE(mp2_eri_force), ALLOCATABLE, DIMENSION(:) :: force_2c, force_2c_RI, force_3c_aux, & force_3c_orb_mu, force_3c_orb_nu - TYPE(pw_c1d_type) :: dvg(3), pot_g, rho_g, rho_g_copy + TYPE(pw_c1d_gs_type) :: dvg(3), pot_g, rho_g, rho_g_copy TYPE(pw_env_type), POINTER :: pw_env_sub TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: psi_L, rho_r + TYPE(pw_r3d_rs_type) :: psi_L, rho_r TYPE(qs_force_type), DIMENSION(:), POINTER :: force, mp2_force TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(task_list_type), POINTER :: task_list_sub @@ -341,11 +340,9 @@ SUBROUTINE calc_ri_mp2_nonsep(qs_env, mp2_env, para_env, para_env_sub, cell, par ! for calculate the MP2-volume contribution to the virial ! (hartree potential derivatives) IF (use_virial) THEN - CALL auxbas_pw_pool%create_pw(rho_g_copy, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g_copy) DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(dvg(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(dvg(i)) END DO END IF diff --git a/src/mp2_types.F b/src/mp2_types.F index b07ca89b08..32a1fb9e61 100644 --- a/src/mp2_types.F +++ b/src/mp2_types.F @@ -105,7 +105,7 @@ MODULE mp2_types LOGICAL :: big_send = .FALSE. END TYPE - TYPE mp2_gpw_r3d_type + TYPE mp2_gpw_r3d_rs_type REAL(KIND=dp) :: eps_grid = 0.0_dp, & eps_filter = 0.0_dp, & eps_pgf_orb_S = 0.0_dp @@ -113,7 +113,7 @@ MODULE mp2_types REAL(KIND=dp) :: cutoff = 0.0_dp, & relative_cutoff = 0.0_dp INTEGER :: size_lattice_sum = 0 - END TYPE mp2_gpw_r3d_type + END TYPE mp2_gpw_r3d_rs_type TYPE ri_mp2_type INTEGER :: block_size = 0, & @@ -303,7 +303,7 @@ MODULE mp2_types TYPE(mp2_laplace_type) :: ri_laplace = mp2_laplace_type() TYPE(mp2_direct_type) :: direct_canonical = mp2_direct_type() TYPE(libint_potential_type) :: potential_parameter = libint_potential_type() - TYPE(mp2_gpw_r3d_type) :: mp2_gpw = mp2_gpw_r3d_type() + TYPE(mp2_gpw_r3d_rs_type) :: mp2_gpw = mp2_gpw_r3d_rs_type() TYPE(ri_mp2_type) :: ri_mp2 = ri_mp2_type() TYPE(ri_rpa_type) :: ri_rpa = ri_rpa_type() ! There is a bug with some older compilers preventing requiring an explicit initialization of allocatable components diff --git a/src/negf_env_types.F b/src/negf_env_types.F index 2557090276..6305e1cf7d 100644 --- a/src/negf_env_types.F +++ b/src/negf_env_types.F @@ -54,8 +54,7 @@ MODULE negf_env_types USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_density_mixing_types, ONLY: mixing_storage_create,& mixing_storage_release,& mixing_storage_type @@ -175,7 +174,7 @@ SUBROUTINE negf_env_create(negf_env, sub_env, negf_control, force_env, negf_mixi TYPE(force_env_p_type), DIMENSION(:), POINTER :: sub_force_env TYPE(negf_atom_map_contact_type), ALLOCATABLE, & DIMENSION(:) :: map_contact - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_environment_type), POINTER :: qs_env, qs_env_contact TYPE(qs_subsys_type), POINTER :: subsys, subsys_contact @@ -715,7 +714,7 @@ SUBROUTINE negf_env_device_init_matrices(negf_env, negf_control, sub_env, qs_env TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: v_hartree + TYPE(pw_r3d_rs_type) :: v_hartree TYPE(qs_subsys_type), POINTER :: subsys CALL timeset(routineN, handle) @@ -794,7 +793,7 @@ SUBROUTINE negf_env_device_init_matrices(negf_env, negf_control, sub_env, qs_env CALL dbcsr_copy(matrix_b=hmat%matrix, matrix_a=matrix_s_kp(1, 1)%matrix) CALL dbcsr_set(hmat%matrix, 0.0_dp) - CALL pw_pool%create_pw(v_hartree, in_space=REALSPACE) + CALL pw_pool%create_pw(v_hartree) CALL negf_env_init_v_hartree(v_hartree, negf_env%contacts, negf_control%contacts) CALL integrate_v_rspace(v_rspace=v_hartree, hmat=hmat, qs_env=qs_env, & @@ -842,7 +841,7 @@ END SUBROUTINE negf_env_device_init_matrices !> \author Sergey Chulkov ! ************************************************************************************************** SUBROUTINE negf_env_init_v_hartree(v_hartree, contact_env, contact_control) - TYPE(pw_r3d_type), INTENT(IN) :: v_hartree + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree TYPE(negf_env_contact_type), DIMENSION(:), & INTENT(in) :: contact_env TYPE(negf_control_contact_type), DIMENSION(:), & diff --git a/src/optimize_embedding_potential.F b/src/optimize_embedding_potential.F index d51b0bdac4..197d4a4a7b 100644 --- a/src/optimize_embedding_potential.F +++ b/src/optimize_embedding_potential.F @@ -68,10 +68,8 @@ MODULE optimize_embedding_potential USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_resp_all,& calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& @@ -206,11 +204,11 @@ END SUBROUTINE understand_spin_states SUBROUTINE init_embed_pot(qs_env, embed_pot, add_const_pot, Fermi_Amaldi, const_pot, open_shell_embed, & spin_embed_pot, pot_diff, Coulomb_guess, grid_opt) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), POINTER :: embed_pot + TYPE(pw_r3d_rs_type), POINTER :: embed_pot LOGICAL :: add_const_pot, Fermi_Amaldi - TYPE(pw_r3d_type), POINTER :: const_pot + TYPE(pw_r3d_rs_type), POINTER :: const_pot LOGICAL :: open_shell_embed - TYPE(pw_r3d_type), POINTER :: spin_embed_pot, pot_diff + TYPE(pw_r3d_rs_type), POINTER :: spin_embed_pot, pot_diff LOGICAL :: Coulomb_guess, grid_opt INTEGER :: nelectrons @@ -218,7 +216,7 @@ SUBROUTINE init_embed_pot(qs_env, embed_pot, add_const_pot, Fermi_Amaldi, const_ REAL(KIND=dp) :: factor TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: v_hartree_r_space + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_r_space ! Extract plane waves environment CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, & @@ -231,14 +229,14 @@ SUBROUTINE init_embed_pot(qs_env, embed_pot, add_const_pot, Fermi_Amaldi, const_ ! Create embedding potential and set to zero NULLIFY (embed_pot) ALLOCATE (embed_pot) - CALL auxbas_pw_pool%create_pw(embed_pot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(embed_pot) CALL pw_zero(embed_pot) ! Spin embedding potential if asked IF (open_shell_embed) THEN NULLIFY (spin_embed_pot) ALLOCATE (spin_embed_pot) - CALL auxbas_pw_pool%create_pw(spin_embed_pot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(spin_embed_pot) CALL pw_zero(spin_embed_pot) END IF @@ -246,7 +244,7 @@ SUBROUTINE init_embed_pot(qs_env, embed_pot, add_const_pot, Fermi_Amaldi, const_ IF (Coulomb_guess) THEN NULLIFY (pot_diff) ALLOCATE (pot_diff) - CALL auxbas_pw_pool%create_pw(pot_diff, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pot_diff) CALL pw_zero(pot_diff) END IF @@ -255,7 +253,7 @@ SUBROUTINE init_embed_pot(qs_env, embed_pot, add_const_pot, Fermi_Amaldi, const_ ! Now the constant potential is the Coulomb one NULLIFY (const_pot) ALLOCATE (const_pot) - CALL auxbas_pw_pool%create_pw(const_pot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(const_pot) CALL pw_zero(const_pot) END IF @@ -388,7 +386,7 @@ SUBROUTINE prepare_embed_opt(qs_env, opt_embed, opt_embed_section) size_prev_dens = SUM(opt_embed%all_nspins(1:(SIZE(opt_embed%all_nspins) - 1))) ALLOCATE (opt_embed%prev_subsys_dens(size_prev_dens)) DO i_dens = 1, size_prev_dens - CALL auxbas_pw_pool%create_pw(opt_embed%prev_subsys_dens(i_dens), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(opt_embed%prev_subsys_dens(i_dens)) CALL pw_zero(opt_embed%prev_subsys_dens(i_dens)) END DO ALLOCATE (opt_embed%max_subsys_dens_diff(size_prev_dens)) @@ -408,12 +406,12 @@ SUBROUTINE prepare_embed_opt(qs_env, opt_embed, opt_embed_section) IF (opt_embed%fab) THEN NULLIFY (opt_embed%prev_embed_pot) ALLOCATE (opt_embed%prev_embed_pot) - CALL auxbas_pw_pool%create_pw(opt_embed%prev_embed_pot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(opt_embed%prev_embed_pot) CALL pw_zero(opt_embed%prev_embed_pot) IF (opt_embed%open_shell_embed) THEN NULLIFY (opt_embed%prev_spin_embed_pot) ALLOCATE (opt_embed%prev_spin_embed_pot) - CALL auxbas_pw_pool%create_pw(opt_embed%prev_spin_embed_pot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(opt_embed%prev_spin_embed_pot) CALL pw_zero(opt_embed%prev_spin_embed_pot) END IF END IF @@ -615,7 +613,7 @@ SUBROUTINE given_embed_pot(qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool_subsys - TYPE(pw_r3d_type), POINTER :: embed_pot, spin_embed_pot + TYPE(pw_r3d_rs_type), POINTER :: embed_pot, spin_embed_pot TYPE(section_vals_type), POINTER :: input, qs_section qs_env%given_embed_pot = .TRUE. @@ -636,11 +634,11 @@ SUBROUTINE given_embed_pot(qs_env) !CALL get_qs_env(qs_env=qs_env, & ! embed_pot=embed_pot) ALLOCATE (embed_pot) - CALL auxbas_pw_pool_subsys%create_pw(embed_pot, in_space=REALSPACE) + CALL auxbas_pw_pool_subsys%create_pw(embed_pot) IF (open_shell_embed) THEN ! Create spin embedding potential ALLOCATE (spin_embed_pot) - CALL auxbas_pw_pool_subsys%create_pw(spin_embed_pot, in_space=REALSPACE) + CALL auxbas_pw_pool_subsys%create_pw(spin_embed_pot) END IF ! Read the cubes CALL read_embed_pot_cube(embed_pot, spin_embed_pot, qs_section, open_shell_embed) @@ -663,7 +661,7 @@ END SUBROUTINE given_embed_pot ! ************************************************************************************************** SUBROUTINE read_embed_pot(qs_env, embed_pot, spin_embed_pot, section, opt_embed) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), POINTER :: embed_pot, spin_embed_pot + TYPE(pw_r3d_rs_type), POINTER :: embed_pot, spin_embed_pot TYPE(section_vals_type), POINTER :: section TYPE(opt_embed_pot_type) :: opt_embed @@ -685,7 +683,7 @@ END SUBROUTINE read_embed_pot !> \param open_shell_embed ... ! ************************************************************************************************** SUBROUTINE read_embed_pot_cube(embed_pot, spin_embed_pot, section, open_shell_embed) - TYPE(pw_r3d_type), INTENT(IN) :: embed_pot, spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN) :: embed_pot, spin_embed_pot TYPE(section_vals_type), POINTER :: section LOGICAL :: open_shell_embed @@ -727,8 +725,8 @@ END SUBROUTINE read_embed_pot_cube ! ************************************************************************************************** SUBROUTINE read_embed_pot_vector(qs_env, embed_pot, spin_embed_pot, section, embed_pot_coef, open_shell_embed) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(INOUT) :: embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: spin_embed_pot TYPE(section_vals_type), POINTER :: section TYPE(cp_fm_type), INTENT(IN) :: embed_pot_coef LOGICAL, INTENT(IN) :: open_shell_embed @@ -932,7 +930,7 @@ END SUBROUTINE release_opt_embed !> \param eta ... ! ************************************************************************************************** SUBROUTINE Coulomb_guess(v_rspace, rhs, mapping_section, qs_env, nforce_eval, iforce_eval, eta) - TYPE(pw_r3d_type) :: v_rspace + TYPE(pw_r3d_rs_type) :: v_rspace REAL(KIND=dp), DIMENSION(:), POINTER :: rhs TYPE(section_vals_type), POINTER :: mapping_section TYPE(qs_environment_type), POINTER :: qs_env @@ -944,11 +942,11 @@ SUBROUTINE Coulomb_guess(v_rspace, rhs, mapping_section, qs_env, nforce_eval, if REAL(KIND=dp) :: dvol, normalize_factor REAL(KIND=dp), DIMENSION(:), POINTER :: rhs_subsys TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type) :: v_resp_gspace + TYPE(pw_c1d_gs_type) :: v_resp_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rho_resp, v_resp_rspace + TYPE(pw_r3d_rs_type) :: rho_resp, v_resp_rspace TYPE(qs_subsys_type), POINTER :: subsys ! Get available particles @@ -975,11 +973,11 @@ SUBROUTINE Coulomb_guess(v_rspace, rhs, mapping_section, qs_env, nforce_eval, if CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(v_resp_gspace, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_resp_gspace) - CALL auxbas_pw_pool%create_pw(v_resp_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_resp_rspace) - CALL auxbas_pw_pool%create_pw(rho_resp, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_resp) ! Calculate charge density CALL pw_zero(rho_resp) @@ -1024,10 +1022,10 @@ SUBROUTINE make_subsys_embed_pot(qs_env, embed_pot, embed_pot_subsys, & spin_embed_pot, spin_embed_pot_subsys, open_shell_embed, & change_spin_sign) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(IN) :: embed_pot - TYPE(pw_r3d_type), POINTER :: embed_pot_subsys - TYPE(pw_r3d_type), INTENT(IN), POINTER :: spin_embed_pot - TYPE(pw_r3d_type), POINTER :: spin_embed_pot_subsys + TYPE(pw_r3d_rs_type), INTENT(IN) :: embed_pot + TYPE(pw_r3d_rs_type), POINTER :: embed_pot_subsys + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), POINTER :: spin_embed_pot_subsys LOGICAL :: open_shell_embed, change_spin_sign TYPE(pw_env_type), POINTER :: pw_env @@ -1042,7 +1040,7 @@ SUBROUTINE make_subsys_embed_pot(qs_env, embed_pot, embed_pot_subsys, & ! Create embedding potential and set to zero NULLIFY (embed_pot_subsys) ALLOCATE (embed_pot_subsys) - CALL auxbas_pw_pool_subsys%create_pw(embed_pot_subsys, in_space=REALSPACE) + CALL auxbas_pw_pool_subsys%create_pw(embed_pot_subsys) ! Hard copy the grid CALL pw_copy(embed_pot, embed_pot_subsys) @@ -1050,7 +1048,7 @@ SUBROUTINE make_subsys_embed_pot(qs_env, embed_pot, embed_pot_subsys, & IF (open_shell_embed) THEN NULLIFY (spin_embed_pot_subsys) ALLOCATE (spin_embed_pot_subsys) - CALL auxbas_pw_pool_subsys%create_pw(spin_embed_pot_subsys, in_space=REALSPACE) + CALL auxbas_pw_pool_subsys%create_pw(spin_embed_pot_subsys) ! Hard copy the grid IF (change_spin_sign) THEN CALL pw_axpy(spin_embed_pot, spin_embed_pot_subsys, -1.0_dp, 0.0_dp, allow_noncompatible_grids=.TRUE.) @@ -1072,7 +1070,7 @@ END SUBROUTINE make_subsys_embed_pot SUBROUTINE calculate_embed_pot_grad(qs_env, diff_rho_r, diff_rho_spin, opt_embed) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(IN) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), INTENT(IN) :: diff_rho_r, diff_rho_spin TYPE(opt_embed_pot_type) :: opt_embed CHARACTER(LEN=*), PARAMETER :: routineN = 'calculate_embed_pot_grad' @@ -1210,7 +1208,7 @@ SUBROUTINE calculate_embed_pot_grad_inner(qs_env, dimen_aux, rho_r, rho_spin, em open_shell_embed, lri) TYPE(qs_environment_type), POINTER :: qs_env INTEGER :: dimen_aux - TYPE(pw_r3d_type), INTENT(IN) :: rho_r, rho_spin + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_r, rho_spin TYPE(cp_fm_type), INTENT(IN) :: embed_pot_grad LOGICAL :: open_shell_embed TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri @@ -1360,17 +1358,17 @@ END SUBROUTINE compute_kinetic_mat ! ************************************************************************************************** SUBROUTINE grid_regularize(potential, pw_env, lambda, reg_term) - TYPE(pw_r3d_type), INTENT(INOUT) :: potential + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: potential TYPE(pw_env_type), POINTER :: pw_env REAL(KIND=dp) :: lambda, reg_term INTEGER :: i, j, k INTEGER, DIMENSION(3) :: lb, n, ub - TYPE(pw_c1d_type) :: dr2_pot, grid_reg_g, potential_g - TYPE(pw_c1d_type), DIMENSION(3) :: dpot_g + TYPE(pw_c1d_gs_type) :: dr2_pot, grid_reg_g, potential_g + TYPE(pw_c1d_gs_type), DIMENSION(3) :: dpot_g TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: grid_reg, square_norm_dpot - TYPE(pw_r3d_type), DIMENSION(3) :: dpot + TYPE(pw_r3d_rs_type) :: grid_reg, square_norm_dpot + TYPE(pw_r3d_rs_type), DIMENSION(3) :: dpot ! ! First, the contribution to the gradient @@ -1379,13 +1377,13 @@ SUBROUTINE grid_regularize(potential, pw_env, lambda, reg_term) ! Get some of the grids ready CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(potential_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(potential_g) - CALL auxbas_pw_pool%create_pw(dr2_pot, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(dr2_pot) - CALL auxbas_pw_pool%create_pw(grid_reg, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(grid_reg) - CALL auxbas_pw_pool%create_pw(grid_reg_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(grid_reg_g) CALL pw_zero(grid_reg_g) ! Transfer potential to the reciprocal space @@ -1406,11 +1404,11 @@ SUBROUTINE grid_regularize(potential, pw_env, lambda, reg_term) ! Second, the contribution to the functional ! DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(dpot(i), in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(dpot_g(i), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(dpot(i)) + CALL auxbas_pw_pool%create_pw(dpot_g(i)) END DO - CALL auxbas_pw_pool%create_pw(square_norm_dpot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(square_norm_dpot) DO i = 1, 3 n(:) = 0 @@ -1467,11 +1465,11 @@ END SUBROUTINE grid_regularize ! ************************************************************************************************** SUBROUTINE opt_embed_step(diff_rho_r, diff_rho_spin, opt_embed, embed_pot, spin_embed_pot, rho_r_ref, qs_env) - TYPE(pw_r3d_type), INTENT(INOUT) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: diff_rho_r, diff_rho_spin TYPE(opt_embed_pot_type) :: opt_embed - TYPE(pw_r3d_type), INTENT(INOUT) :: embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: spin_embed_pot - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_ref + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_ref TYPE(qs_environment_type), POINTER :: qs_env CHARACTER(LEN=*), PARAMETER :: routineN = 'opt_embed_step' @@ -1659,11 +1657,11 @@ END SUBROUTINE opt_embed_step ! ************************************************************************************************** SUBROUTINE grid_based_step(diff_rho_r, diff_rho_spin, pw_env, opt_embed, embed_pot, spin_embed_pot) - TYPE(pw_r3d_type), INTENT(INOUT) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: diff_rho_r, diff_rho_spin TYPE(pw_env_type), POINTER :: pw_env TYPE(opt_embed_pot_type) :: opt_embed - TYPE(pw_r3d_type), INTENT(INOUT) :: embed_pot - TYPE(pw_r3d_type), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: embed_pot + TYPE(pw_r3d_rs_type), POINTER :: spin_embed_pot CHARACTER(LEN=*), PARAMETER :: routineN = 'grid_based_step' @@ -1705,11 +1703,11 @@ SUBROUTINE update_embed_pot(embed_pot_coef, dimen_aux, embed_pot, spin_embed_pot qs_env, add_const_pot, open_shell_embed, const_pot) TYPE(cp_fm_type), INTENT(IN) :: embed_pot_coef INTEGER :: dimen_aux - TYPE(pw_r3d_type), INTENT(INOUT) :: embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: spin_embed_pot TYPE(qs_environment_type), POINTER :: qs_env LOGICAL :: add_const_pot, open_shell_embed - TYPE(pw_r3d_type), INTENT(IN), OPTIONAL :: const_pot + TYPE(pw_r3d_rs_type), INTENT(IN), OPTIONAL :: const_pot CHARACTER(LEN=*), PARAMETER :: routineN = 'update_embed_pot' @@ -1727,10 +1725,10 @@ SUBROUTINE update_embed_pot(embed_pot_coef, dimen_aux, embed_pot, spin_embed_pot TYPE(mo_set_type), DIMENSION(:), POINTER :: mos TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_g + TYPE(pw_c1d_gs_type) :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: psi_L + TYPE(pw_r3d_rs_type) :: psi_L TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set CALL timeset(routineN, handle) @@ -1748,9 +1746,9 @@ SUBROUTINE update_embed_pot(embed_pot_coef, dimen_aux, embed_pot, spin_embed_pot CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) ! get some of the grids ready - CALL auxbas_pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g) - CALL auxbas_pw_pool%create_pw(psi_L, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(psi_L) ! Create wf_vector and auxiliary wave functions ALLOCATE (wf_vector(dimen_aux)) @@ -2469,10 +2467,10 @@ END FUNCTION Barzilai_Borwein SUBROUTINE Leeuwen_Baerends_potential_update(pw_env, embed_pot, spin_embed_pot, diff_rho_r, diff_rho_spin, & rho_r_ref, open_shell_embed, step_len) TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), INTENT(INOUT) :: embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: spin_embed_pot - TYPE(pw_r3d_type), INTENT(IN) :: diff_rho_r, diff_rho_spin - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_ref + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_ref LOGICAL, INTENT(IN) :: open_shell_embed REAL(KIND=dp), INTENT(IN) :: step_len @@ -2482,7 +2480,7 @@ SUBROUTINE Leeuwen_Baerends_potential_update(pw_env, embed_pot, spin_embed_pot, INTEGER, DIMENSION(3) :: lb, ub REAL(KIND=dp) :: my_rho, rho_cutoff TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: new_embed_pot, rho_n_1, temp_embed_pot + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: new_embed_pot, rho_n_1, temp_embed_pot CALL timeset(routineN, handle) @@ -2497,7 +2495,7 @@ SUBROUTINE Leeuwen_Baerends_potential_update(pw_env, embed_pot, spin_embed_pot, NULLIFY (new_embed_pot) ALLOCATE (new_embed_pot(nspins)) DO i_spin = 1, nspins - CALL auxbas_pw_pool%create_pw(new_embed_pot(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(new_embed_pot(i_spin)) CALL pw_zero(new_embed_pot(i_spin)) END DO @@ -2531,9 +2529,9 @@ SUBROUTINE Leeuwen_Baerends_potential_update(pw_env, embed_pot, spin_embed_pot, NULLIFY (temp_embed_pot) ALLOCATE (temp_embed_pot(nspins)) DO i_spin = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_n_1(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_n_1(i_spin)) CALL pw_zero(rho_n_1(i_spin)) - CALL auxbas_pw_pool%create_pw(temp_embed_pot(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(temp_embed_pot(i_spin)) CALL pw_zero(temp_embed_pot(i_spin)) END DO CALL pw_copy(diff_rho_r, rho_n_1(1)) @@ -2648,13 +2646,13 @@ SUBROUTINE FAB_update(qs_env, rho_r_ref, prev_embed_pot, prev_spin_embed_pot, em diff_rho_r, diff_rho_spin, v_w_ref, i_iter, step_len, open_shell_embed, & vw_cutoff, vw_smooth_cutoff_range) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_ref - TYPE(pw_r3d_type), INTENT(INOUT) :: prev_embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: prev_spin_embed_pot - TYPE(pw_r3d_type), INTENT(INOUT) :: embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: spin_embed_pot - TYPE(pw_r3d_type), INTENT(IN) :: diff_rho_r, diff_rho_spin - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_w_ref + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_ref + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: prev_embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: prev_spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_w_ref INTEGER, INTENT(IN) :: i_iter REAL(KIND=dp) :: step_len LOGICAL :: open_shell_embed @@ -2665,8 +2663,8 @@ SUBROUTINE FAB_update(qs_env, rho_r_ref, prev_embed_pot, prev_spin_embed_pot, em INTEGER :: handle, i_spin, nspins TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: new_embed_pot, temp_embed_pot, v_w - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: curr_rho + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: new_embed_pot, temp_embed_pot, v_w + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: curr_rho CALL timeset(routineN, handle) @@ -2684,7 +2682,7 @@ SUBROUTINE FAB_update(qs_env, rho_r_ref, prev_embed_pot, prev_spin_embed_pot, em NULLIFY (v_w_ref) ALLOCATE (v_w_ref(nspins)) DO i_spin = 1, nspins - CALL auxbas_pw_pool%create_pw(v_w_ref(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_w_ref(i_spin)) END DO CALL Von_Weizsacker(rho_r_ref, v_w_ref, qs_env, vw_cutoff, vw_smooth_cutoff_range) ! For the first step previous are set to current @@ -2706,13 +2704,13 @@ SUBROUTINE FAB_update(qs_env, rho_r_ref, prev_embed_pot, prev_spin_embed_pot, em NULLIFY (curr_rho) ALLOCATE (curr_rho(nspins)) DO i_spin = 1, nspins - CALL auxbas_pw_pool%create_pw(new_embed_pot(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(new_embed_pot(i_spin)) CALL pw_zero(new_embed_pot(i_spin)) - CALL auxbas_pw_pool%create_pw(v_w(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_w(i_spin)) CALL pw_zero(v_w(i_spin)) - CALL auxbas_pw_pool%create_pw(curr_rho(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(curr_rho(i_spin)) CALL pw_zero(curr_rho(i_spin)) END DO @@ -2756,7 +2754,7 @@ SUBROUTINE FAB_update(qs_env, rho_r_ref, prev_embed_pot, prev_spin_embed_pot, em ! Reconstruct corrent spin components of the potential ALLOCATE (temp_embed_pot(nspins)) DO i_spin = 1, nspins - CALL auxbas_pw_pool%create_pw(temp_embed_pot(i_spin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(temp_embed_pot(i_spin)) CALL pw_zero(temp_embed_pot(i_spin)) END DO CALL pw_copy(embed_pot, temp_embed_pot(1)) @@ -2826,8 +2824,8 @@ END SUBROUTINE FAB_update !> \param vw_smooth_cutoff_range ... ! ************************************************************************************************** SUBROUTINE Von_Weizsacker(rho_r, v_w, qs_env, vw_cutoff, vw_smooth_cutoff_range) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: v_w + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: v_w TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), INTENT(IN) :: vw_cutoff, vw_smooth_cutoff_range @@ -2838,10 +2836,10 @@ SUBROUTINE Von_Weizsacker(rho_r, v_w, qs_env, vw_cutoff, vw_smooth_cutoff_range) REAL(KIND=dp) :: density_smooth_cut_range, my_rho, & rho_cutoff REAL(kind=dp), DIMENSION(:, :, :), POINTER :: rhoa, rhob - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: tau TYPE(section_vals_type), POINTER :: input, xc_section TYPE(xc_rho_cflags_type) :: needs TYPE(xc_rho_set_type) :: rho_set @@ -2863,8 +2861,7 @@ SUBROUTINE Von_Weizsacker(rho_r, v_w, qs_env, vw_cutoff, vw_smooth_cutoff_range) NULLIFY (rho_g) ALLOCATE (rho_g(nspins)) DO i_spin = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_g(i_spin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g(i_spin)) CALL pw_transfer(rho_r(i_spin), rho_g(i_spin)) END DO @@ -2974,7 +2971,7 @@ END SUBROUTINE Von_Weizsacker !> \return ... ! ************************************************************************************************** FUNCTION max_dens_diff(diff_rho_r) RESULT(total_max_diff) - TYPE(pw_r3d_type), INTENT(IN) :: diff_rho_r + TYPE(pw_r3d_rs_type), INTENT(IN) :: diff_rho_r REAL(KIND=dp) :: total_max_diff INTEGER :: size_x, size_y, size_z @@ -3013,7 +3010,7 @@ END FUNCTION max_dens_diff !> \author Vladimir Rybkin ! ************************************************************************************************** SUBROUTINE print_rho_diff(diff_rho_r, i_iter, qs_env, final_one) - TYPE(pw_r3d_type), INTENT(IN) :: diff_rho_r + TYPE(pw_r3d_rs_type), INTENT(IN) :: diff_rho_r INTEGER, INTENT(IN) :: i_iter TYPE(qs_environment_type), INTENT(IN), POINTER :: qs_env LOGICAL, INTENT(IN) :: final_one @@ -3064,7 +3061,7 @@ END SUBROUTINE print_rho_diff !> \author Vladimir Rybkin ! ************************************************************************************************** SUBROUTINE print_rho_spin_diff(spin_diff_rho_r, i_iter, qs_env, final_one) - TYPE(pw_r3d_type), INTENT(IN) :: spin_diff_rho_r + TYPE(pw_r3d_rs_type), INTENT(IN) :: spin_diff_rho_r INTEGER, INTENT(IN) :: i_iter TYPE(qs_environment_type), INTENT(IN), POINTER :: qs_env LOGICAL, INTENT(IN) :: final_one @@ -3122,9 +3119,9 @@ SUBROUTINE print_embed_restart(qs_env, dimen_aux, embed_pot_coef, embed_pot, i_i TYPE(qs_environment_type), POINTER :: qs_env INTEGER :: dimen_aux TYPE(cp_fm_type), INTENT(IN), POINTER :: embed_pot_coef - TYPE(pw_r3d_type), INTENT(IN) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN) :: embed_pot INTEGER :: i_iter - TYPE(pw_r3d_type), INTENT(IN), POINTER :: embed_pot_spin + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: embed_pot_spin LOGICAL :: open_shell_embed, grid_opt, final_one CHARACTER(LEN=default_path_length) :: filename, my_pos_cube, title @@ -3218,8 +3215,8 @@ END SUBROUTINE print_embed_restart SUBROUTINE print_pot_simple_grid(qs_env, embed_pot, embed_pot_spin, i_iter, open_shell_embed, & final_one, qs_env_cluster) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(IN) :: embed_pot - TYPE(pw_r3d_type), INTENT(IN), POINTER :: embed_pot_spin + TYPE(pw_r3d_rs_type), INTENT(IN) :: embed_pot + TYPE(pw_r3d_rs_type), INTENT(IN), POINTER :: embed_pot_spin INTEGER :: i_iter LOGICAL :: open_shell_embed, final_one TYPE(qs_environment_type), POINTER :: qs_env_cluster @@ -3230,7 +3227,7 @@ SUBROUTINE print_pot_simple_grid(qs_env, embed_pot, embed_pot_spin, i_iter, open TYPE(cp_logger_type), POINTER :: logger TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: pot_alpha, pot_beta + TYPE(pw_r3d_rs_type) :: pot_alpha, pot_beta TYPE(section_vals_type), POINTER :: dft_section, input NULLIFY (input) @@ -3265,13 +3262,13 @@ SUBROUTINE print_pot_simple_grid(qs_env, embed_pot, embed_pot_spin, i_iter, open CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) ! Create embedding potential and set to zero - CALL auxbas_pw_pool%create_pw(pot_alpha, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pot_alpha) CALL pw_zero(pot_alpha) CALL pw_copy(embed_pot, pot_alpha) IF (open_shell_embed) THEN - CALL auxbas_pw_pool%create_pw(pot_beta, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pot_beta) CALL pw_copy(embed_pot, pot_beta) ! Add spin potential to the alpha, and subtract from the beta part CALL pw_axpy(embed_pot_spin, pot_alpha, 1.0_dp) @@ -3421,7 +3418,7 @@ SUBROUTINE get_prev_density(opt_embed, force_env, subsys_num) INTEGER :: subsys_num INTEGER :: i_dens_start, i_spin, nspins - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho NULLIFY (rho_r, rho) @@ -3451,7 +3448,7 @@ SUBROUTINE get_max_subsys_diff(opt_embed, force_env, subsys_num) INTEGER :: subsys_num INTEGER :: i_dens_start, i_spin, nspins - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho NULLIFY (rho_r, rho) @@ -3480,7 +3477,7 @@ END SUBROUTINE get_max_subsys_diff ! ************************************************************************************************** SUBROUTINE conv_check_embed(opt_embed, diff_rho_r, diff_rho_spin, output_unit) TYPE(opt_embed_pot_type) :: opt_embed - TYPE(pw_r3d_type), INTENT(IN) :: diff_rho_r, diff_rho_spin + TYPE(pw_r3d_rs_type), INTENT(IN) :: diff_rho_r, diff_rho_spin INTEGER :: output_unit INTEGER :: i_dens, i_dens_start, i_spin diff --git a/src/pme.F b/src/pme.F index 75cd488625..0dac2d5a22 100644 --- a/src/pme.F +++ b/src/pme.F @@ -29,7 +29,7 @@ MODULE pme USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: fourpi USE message_passing, ONLY: mp_comm_type @@ -44,10 +44,8 @@ MODULE pme USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE realspace_grid_types, ONLY: realspace_grid_desc_type,& realspace_grid_type,& rs_grid_create,& @@ -98,7 +96,7 @@ SUBROUTINE pme_evaluate(ewald_env, ewald_pw, box, particle_set, vg_coulomb, & fg_coulomb, pv_g, shell_particle_set, core_particle_set, & fgshell_coulomb, fgcore_coulomb, use_virial, charges, atprop) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(cell_type), POINTER :: box TYPE(particle_type), DIMENSION(:), POINTER :: particle_set REAL(KIND=dp), INTENT(OUT) :: vg_coulomb @@ -123,12 +121,12 @@ SUBROUTINE pme_evaluate(ewald_env, ewald_pw, box, particle_set, vg_coulomb, & TYPE(dg_rho0_type), POINTER :: dg_rho0 TYPE(dg_type), POINTER :: dg TYPE(mp_comm_type) :: group - TYPE(pw_c1d_type) :: phi_g, rhob_g - TYPE(pw_c1d_type), DIMENSION(3) :: dphi_g + TYPE(pw_c1d_gs_type) :: phi_g, rhob_g + TYPE(pw_c1d_gs_type), DIMENSION(3) :: dphi_g TYPE(pw_grid_type), POINTER :: grid_b, grid_s TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: pw_big_pool, pw_small_pool - TYPE(pw_r3d_type) :: phi_r, rhob_r, rhos1, rhos2 + TYPE(pw_r3d_rs_type) :: phi_r, rhob_r, rhos1, rhos2 TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_type), DIMENSION(3) :: drpot TYPE(realspace_grid_type), POINTER :: rden, rpot @@ -164,10 +162,8 @@ SUBROUTINE pme_evaluate(ewald_env, ewald_pw, box, particle_set, vg_coulomb, & allocate_centre=.TRUE.) END IF - CALL pw_small_pool%create_pw(rhos1, & - in_space=REALSPACE) - CALL pw_small_pool%create_pw(rhos2, & - in_space=REALSPACE) + CALL pw_small_pool%create_pw(rhos1) + CALL pw_small_pool%create_pw(rhos2) ALLOCATE (rden) CALL rs_grid_create(rden, rs_desc) @@ -241,16 +237,16 @@ SUBROUTINE pme_evaluate(ewald_env, ewald_pw, box, particle_set, vg_coulomb, & END DO END IF - CALL pw_big_pool%create_pw(rhob_r, in_space=REALSPACE) + CALL pw_big_pool%create_pw(rhob_r) CALL transfer_rs2pw(rden, rhob_r) !-------------- ELECTROSTATIC CALCULATION ----------- ! allocate intermediate arrays DO i = 1, 3 - CALL pw_big_pool%create_pw(dphi_g(i), in_space=RECIPROCALSPACE) + CALL pw_big_pool%create_pw(dphi_g(i)) END DO - CALL pw_big_pool%create_pw(phi_r, in_space=REALSPACE) + CALL pw_big_pool%create_pw(phi_r) CALL pw_poisson_solve(poisson_env, rhob_r, vg_coulomb, phi_r, dphi_g, h_stress) @@ -291,10 +287,8 @@ SUBROUTINE pme_evaluate(ewald_env, ewald_pw, box, particle_set, vg_coulomb, & END IF END DO IF (atprop%stress) THEN - CALL pw_big_pool%create_pw(phi_g, & - in_space=RECIPROCALSPACE) - CALL pw_big_pool%create_pw(rhob_g, & - in_space=RECIPROCALSPACE) + CALL pw_big_pool%create_pw(phi_g) + CALL pw_big_pool%create_pw(rhob_g) ffa = (0.5_dp/dg_rho0%zet(1))**2 ffb = 1.0_dp/fourpi DO i = 1, 3 @@ -506,7 +500,7 @@ SUBROUTINE get_patch(dg, particle_set, exp_igr, box, p1, p2, & TYPE(cell_type), POINTER :: box INTEGER, INTENT(IN) :: p1, p2 TYPE(pw_grid_type), INTENT(IN) :: grid_b, grid_s - TYPE(pw_r3d_type), INTENT(INOUT) :: rhos1, rhos2 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rhos1, rhos2 LOGICAL, OPTIONAL :: is1_core, is2_core, is1_shell, is2_shell TYPE(particle_type), DIMENSION(:), OPTIONAL, & POINTER :: core_particle_set @@ -520,7 +514,7 @@ SUBROUTINE get_patch(dg, particle_set, exp_igr, box, p1, p2, & REAL(KIND=dp), DIMENSION(3) :: r1, r2 TYPE(atomic_kind_type), POINTER :: atomic_kind TYPE(dg_rho0_type), POINTER :: dg_rho0 - TYPE(pw_r3d_type), POINTER :: rho0 + TYPE(pw_r3d_rs_type), POINTER :: rho0 TYPE(shell_kind_type), POINTER :: shell NULLIFY (shell) @@ -651,7 +645,7 @@ SUBROUTINE get_patch_again(dg, particle_set, exp_igr, p1, p2, rhos1, rhos2, is1_ TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(structure_factor_type) :: exp_igr INTEGER, INTENT(IN) :: p1, p2 - TYPE(pw_r3d_type), INTENT(INOUT) :: rhos1, rhos2 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rhos1, rhos2 LOGICAL, OPTIONAL :: is1_core, is2_core, is1_shell, is2_shell REAL(KIND=dp), DIMENSION(:), OPTIONAL, POINTER :: charges @@ -661,7 +655,7 @@ SUBROUTINE get_patch_again(dg, particle_set, exp_igr, p1, p2, rhos1, rhos2, is1_ REAL(KIND=dp) :: q1, q2 TYPE(atomic_kind_type), POINTER :: atomic_kind TYPE(dg_rho0_type), POINTER :: dg_rho0 - TYPE(pw_r3d_type), POINTER :: rho0 + TYPE(pw_r3d_rs_type), POINTER :: rho0 TYPE(shell_kind_type), POINTER :: shell NULLIFY (shell) diff --git a/src/post_scf_bandstructure_utils.F b/src/post_scf_bandstructure_utils.F index 71e2af5692..5e4970714c 100644 --- a/src/post_scf_bandstructure_utils.F +++ b/src/post_scf_bandstructure_utils.F @@ -82,10 +82,8 @@ MODULE post_scf_bandstructure_utils USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -2083,10 +2081,10 @@ SUBROUTINE add_to_LDOS_2d(LDOS_2d, qs_env, ikp, bs_env, cfm_mos_ikp, eigenval, & TYPE(cp_fm_type) :: fm_non_spinor, fm_weighted_dm_MIC TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: weighted_dm_MIC TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: rho_g + TYPE(pw_c1d_gs_type) :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: LDOS_3d + TYPE(pw_r3d_rs_type) :: LDOS_3d TYPE(qs_ks_env_type), POINTER :: ks_env CALL timeset(routineN, handle) @@ -2112,8 +2110,8 @@ SUBROUTINE add_to_LDOS_2d(LDOS_2d, qs_env, ikp, bs_env, cfm_mos_ikp, eigenval, & CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(LDOS_3d, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(LDOS_3d) + CALL auxbas_pw_pool%create_pw(rho_g) i_x_start = LBOUND(LDOS_3d%array, 1) i_x_end = UBOUND(LDOS_3d%array, 1) diff --git a/src/pw/dct.F b/src/pw/dct.F index 7eb3760bac..6a52b8ef6e 100644 --- a/src/pw/dct.F +++ b/src/pw/dct.F @@ -23,8 +23,7 @@ MODULE dct USE pw_grid_types, ONLY: pw_grid_type USE pw_grids, ONLY: pw_grid_create,& pw_grid_setup - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -245,7 +244,7 @@ END SUBROUTINE setup_dct_pw_grids ! ************************************************************************************************** !> \brief Finds the process ids for mpi_isend destiations and mpi_irecv sources -!> for expanding and shrinking a pw_r3d_type data +!> for expanding and shrinking a pw_r3d_rs_type data !> \param pw_grid the original plane wave grid !> \param neumann_directions directions in which dct should be performed !> \param dests_expand list of the destination processes (pw_expand) @@ -496,7 +495,7 @@ SUBROUTINE set_dests_srcs_pid(pw_grid, neumann_directions, dests_expand, srcs_ex END SUBROUTINE set_dests_srcs_pid ! ************************************************************************************************** -!> \brief expands a pw_r3d_type data to an evenly symmetric pw_r3d_type data that is 8 times +!> \brief expands a pw_r3d_rs_type data to an evenly symmetric pw_r3d_rs_type data that is 8 times !> larger than the original one: !> the even symmetry for a 1D sequence of length n is defined as: !> 1 2 3 ... n-2 n-1 n --> 1 2 3 ... n-2 n-1 n n-1 n-2 ... 3 2 @@ -521,8 +520,8 @@ SUBROUTINE pw_expand(neumann_directions, recv_msgs_bnds, dests_expand, srcs_expa INTEGER, DIMENSION(:, :, :), INTENT(IN), POINTER :: recv_msgs_bnds INTEGER, DIMENSION(:), INTENT(IN), POINTER :: dests_expand, srcs_expand, flipg_stat INTEGER, DIMENSION(2, 3), INTENT(IN) :: bounds_shftd - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_expanded + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_expanded CHARACTER(LEN=*), PARAMETER :: routineN = 'pw_expand' @@ -685,7 +684,7 @@ SUBROUTINE pw_expand(neumann_directions, recv_msgs_bnds, dests_expand, srcs_expa END SUBROUTINE pw_expand ! ************************************************************************************************** -!> \brief shrinks an evenly symmetric pw_r3d_type data to a pw_r3d_type data that is 8 +!> \brief shrinks an evenly symmetric pw_r3d_rs_type data to a pw_r3d_rs_type data that is 8 !> times smaller (the reverse procedure of pw_expand). !> !> \param neumann_directions directions in which dct should be performed @@ -705,14 +704,14 @@ SUBROUTINE pw_shrink(neumann_directions, dests_shrink, srcs_shrink, bounds_local INTEGER, DIMENSION(:), INTENT(IN), POINTER :: dests_shrink INTEGER, INTENT(INOUT) :: srcs_shrink INTEGER, DIMENSION(2, 3), INTENT(IN) :: bounds_local_shftd - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_shrinked + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_shrinked CHARACTER(LEN=*), PARAMETER :: routineN = 'pw_shrink' - INTEGER :: group_size, handle, i, in_space, lb1_orig, lb1_xpnd, lb2_orig, lb2_xpnd, & - lb3_orig, lb3_xpnd, maxn_sendrecv, rs_mpo, send_lb1, send_lb2, send_lb3, send_ub1, & - send_ub2, send_ub3, tag, ub1_orig, ub1_xpnd, ub2_orig, ub2_xpnd, ub3_orig, ub3_xpnd + INTEGER :: group_size, handle, i, lb1_orig, lb1_xpnd, lb2_orig, lb2_xpnd, lb3_orig, & + lb3_xpnd, maxn_sendrecv, rs_mpo, send_lb1, send_lb2, send_lb3, send_ub1, send_ub2, & + send_ub3, tag, ub1_orig, ub1_xpnd, ub2_orig, ub2_xpnd, ub3_orig, ub3_xpnd INTEGER, ALLOCATABLE, DIMENSION(:, :, :) :: bounds_local_all INTEGER, DIMENSION(2, 3) :: bounds_local_xpnd REAL(dp), ALLOCATABLE, DIMENSION(:, :, :) :: cr3d, send_crmsg @@ -726,8 +725,6 @@ SUBROUTINE pw_shrink(neumann_directions, dests_shrink, srcs_shrink, bounds_local rs_mpo = pw_grid_orig%para%my_pos group_size = pw_grid_orig%para%group_size bounds_local_xpnd = pw_in%pw_grid%bounds_local - in_space = pw_in%in_space - CPASSERT(in_space == REALSPACE) tag = 1 SELECT CASE (neumann_directions) diff --git a/src/pw/dg_rho0_types.F b/src/pw/dg_rho0_types.F index df6a3731d9..224a93cf87 100644 --- a/src/pw/dg_rho0_types.F +++ b/src/pw/dg_rho0_types.F @@ -18,8 +18,7 @@ MODULE dg_rho0_types do_ewald_none,& do_ewald_pme,& do_ewald_spme - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -44,7 +43,7 @@ MODULE dg_rho0_types REAL(KIND=dp) :: cutoff_radius = 0.0_dp REAL(KIND=dp), DIMENSION(:), POINTER :: gcc => NULL() REAL(KIND=dp), DIMENSION(:), POINTER :: zet => NULL() - TYPE(pw_r3d_type), POINTER :: density => NULL() + TYPE(pw_r3d_rs_type), POINTER :: density => NULL() END TYPE dg_rho0_type CONTAINS @@ -68,7 +67,7 @@ SUBROUTINE dg_rho0_set(dg_rho0, TYPE, grid, kind, cutoff_radius, & INTEGER, OPTIONAL :: grid, kind REAL(KIND=dp), OPTIONAL :: cutoff_radius REAL(KIND=dp), OPTIONAL, POINTER :: gcc(:), zet(:) - TYPE(pw_r3d_type), OPTIONAL, POINTER :: density + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: density IF (PRESENT(grid)) dg_rho0%grid = grid IF (PRESENT(kind)) dg_rho0%kind = kind @@ -98,7 +97,7 @@ SUBROUTINE dg_rho0_get(dg_rho0, cutoff_radius, TYPE, grid, kind, gcc, zet, densi TYPE(dg_rho0_type), POINTER :: dg_rho0 INTEGER, OPTIONAL :: grid, kind REAL(KIND=dp), OPTIONAL, POINTER :: gcc(:), zet(:) - TYPE(pw_r3d_type), OPTIONAL, POINTER :: density + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: density IF (PRESENT(grid)) grid = dg_rho0%grid IF (PRESENT(kind)) kind = dg_rho0%kind @@ -168,10 +167,10 @@ SUBROUTINE dg_rho0_init(dg_rho0, pw_grid) END IF SELECT CASE (dg_rho0%type) CASE (do_ewald_ewald) - CALL dg_rho0%density%create(pw_grid, REALSPACE) + CALL dg_rho0%density%create(pw_grid) CALL dg_rho0_pme_gauss(dg_rho0%density, dg_rho0%zet(1)) CASE (do_ewald_pme) - CALL dg_rho0%density%create(pw_grid, REALSPACE) + CALL dg_rho0%density%create(pw_grid) CALL dg_rho0_pme_gauss(dg_rho0%density, dg_rho0%zet(1)) CASE (do_ewald_spme) CPABORT('SPME type not implemented') @@ -186,7 +185,7 @@ END SUBROUTINE dg_rho0_init ! ************************************************************************************************** SUBROUTINE dg_rho0_pme_gauss(dg_rho0, alpha) - TYPE(pw_r3d_type), INTENT(INOUT) :: dg_rho0 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: dg_rho0 REAL(KIND=dp), INTENT(IN) :: alpha INTEGER, PARAMETER :: IMPOSSIBLE = 10000 diff --git a/src/pw/dgs.F b/src/pw/dgs.F index d84a492f7c..df5c5ea906 100644 --- a/src/pw/dgs.F +++ b/src/pw/dgs.F @@ -30,8 +30,8 @@ MODULE dgs USE pw_methods, ONLY: pw_copy,& pw_multiply_with,& pw_zero - USE pw_types, ONLY: pw_c3d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c3d_rs_type,& + pw_r3d_rs_type USE realspace_grid_types, ONLY: realspace_grid_type USE structure_factors, ONLY: structure_factor_evaluate #include "../base/base_uses.f90" @@ -403,7 +403,7 @@ END SUBROUTINE dg_get_delta PURE SUBROUTINE dg_sum_patch_coef(rs, rhos, center) TYPE(realspace_grid_type), INTENT(INOUT) :: rs - TYPE(pw_r3d_type), INTENT(IN) :: rhos + TYPE(pw_r3d_rs_type), INTENT(IN) :: rhos INTEGER, DIMENSION(3), INTENT(IN) :: center INTEGER :: i, ia, ii @@ -706,7 +706,7 @@ PURE SUBROUTINE dg_sum_patch_force_coef_3d(drpot, rhos, center, force) TYPE(realspace_grid_type), DIMENSION(:), & INTENT(INOUT) :: drpot - TYPE(pw_r3d_type), INTENT(IN) :: rhos + TYPE(pw_r3d_rs_type), INTENT(IN) :: rhos INTEGER, DIMENSION(3), INTENT(IN) :: center REAL(KIND=dp), DIMENSION(3), INTENT(OUT) :: force @@ -780,7 +780,7 @@ END SUBROUTINE dg_sum_patch_force_coef_3d PURE SUBROUTINE dg_sum_patch_force_coef_1d(drpot, rhos, center, force) TYPE(realspace_grid_type), INTENT(INOUT) :: drpot - TYPE(pw_r3d_type), INTENT(IN) :: rhos + TYPE(pw_r3d_rs_type), INTENT(IN) :: rhos INTEGER, DIMENSION(3), INTENT(IN) :: center REAL(KIND=dp), INTENT(OUT) :: force @@ -853,21 +853,21 @@ END SUBROUTINE dg_sum_patch_force_coef_1d ! ************************************************************************************************** SUBROUTINE dg_get_patch_1(rho0, rhos1, charge1, ex1, ey1, ez1) - TYPE(pw_r3d_type), INTENT(IN) :: rho0 - TYPE(pw_r3d_type), INTENT(INOUT) :: rhos1 + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho0 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rhos1 REAL(KIND=dp), INTENT(IN) :: charge1 COMPLEX(KIND=dp), DIMENSION(:), INTENT(IN) :: ex1, ey1, ez1 COMPLEX(KIND=dp) :: za, zb COMPLEX(KIND=dp), ALLOCATABLE, DIMENSION(:) :: zs INTEGER :: nd(3) - TYPE(pw_c3d_type) :: cd + TYPE(pw_c3d_rs_type) :: cd nd = rhos1%pw_grid%npts ALLOCATE (zs(nd(1)*nd(2))) zs = 0.0_dp - CALL cd%create(rho0%pw_grid, rho0%in_space) + CALL cd%create(rho0%pw_grid) CALL pw_zero(cd) za = CMPLX(0.0_dp, 0.0_dp, KIND=dp) @@ -899,21 +899,21 @@ END SUBROUTINE dg_get_patch_1 SUBROUTINE dg_get_patch_2(rho0, rhos1, rhos2, charge1, charge2, & ex1, ey1, ez1, ex2, ey2, ez2) - TYPE(pw_r3d_type), INTENT(IN) :: rho0 - TYPE(pw_r3d_type), INTENT(INOUT) :: rhos1, rhos2 + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho0 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rhos1, rhos2 REAL(KIND=dp), INTENT(IN) :: charge1, charge2 COMPLEX(KIND=dp), DIMENSION(:), INTENT(IN) :: ex1, ey1, ez1, ex2, ey2, ez2 COMPLEX(KIND=dp) :: za, zb COMPLEX(KIND=dp), ALLOCATABLE, DIMENSION(:) :: zs INTEGER :: nd(3) - TYPE(pw_c3d_type) :: cd + TYPE(pw_c3d_rs_type) :: cd nd = rhos1%pw_grid%npts ALLOCATE (zs(nd(1)*nd(2))) zs = 0.0_dp - CALL cd%create(rhos1%pw_grid, rho0%in_space) + CALL cd%create(rhos1%pw_grid) CALL pw_zero(cd) za = CMPLX(0.0_dp, 0.0_dp, KIND=dp) diff --git a/src/pw/dielectric_methods.F b/src/pw/dielectric_methods.F index d27e76cd81..d052c0528e 100644 --- a/src/pw/dielectric_methods.F +++ b/src/pw/dielectric_methods.F @@ -30,10 +30,8 @@ MODULE dielectric_methods pw_pool_release, & pw_pool_type USE pw_types, ONLY: & - REALSPACE, & - RECIPROCALSPACE, & - pw_c1d_type, & - pw_r3d_type + pw_c1d_gs_type, & + pw_r3d_rs_type USE realspace_grid_types, ONLY: realspace_grid_type USE rs_methods, ONLY: derive_fdm_cd3, & derive_fdm_cd5, & @@ -49,10 +47,10 @@ MODULE dielectric_methods PUBLIC :: dielectric_create, dielectric_compute, derive_fft INTERFACE dielectric_compute - MODULE PROCEDURE dielectric_compute_periodic_r3d, & - dielectric_compute_neumann_r3d - MODULE PROCEDURE dielectric_compute_periodic_c1d, & - dielectric_compute_neumann_c1d + MODULE PROCEDURE dielectric_compute_periodic_r3d_rs, & + dielectric_compute_neumann_r3d_rs + MODULE PROCEDURE dielectric_compute_periodic_c1d_gs, & + dielectric_compute_neumann_c1d_gs END INTERFACE dielectric_compute CONTAINS @@ -82,12 +80,12 @@ SUBROUTINE dielectric_create(dielectric, pw_pool, dielectric_params) NULLIFY (dielectric%eps) NULLIFY (dielectric%deps_drho) ALLOCATE (dielectric%eps, dielectric%deps_drho) - CALL pw_pool%create_pw(dielectric%eps, in_space=REALSPACE) - CALL pw_pool%create_pw(dielectric%deps_drho, in_space=REALSPACE) + CALL pw_pool%create_pw(dielectric%eps) + CALL pw_pool%create_pw(dielectric%deps_drho) CALL pw_set(dielectric%eps, 1.0_dp) CALL pw_zero(dielectric%deps_drho) DO i = 1, 3 - CALL pw_pool%create_pw(dielectric%dln_eps(i), in_space=REALSPACE) + CALL pw_pool%create_pw(dielectric%dln_eps(i)) CALL pw_zero(dielectric%dln_eps(i)) END DO dielectric%params = dielectric_params @@ -98,7 +96,7 @@ SUBROUTINE dielectric_create(dielectric, pw_pool, dielectric_params) END SUBROUTINE dielectric_create - #:for kind in ["c1d", "r3d"] + #:for kind in ["c1d_gs", "r3d_rs"] ! ************************************************************************************************** !> \brief evaluates the dielectric constant !> \param dielectric the dielectric data type to be initialized @@ -118,7 +116,7 @@ SUBROUTINE dielectric_compute_periodic_${kind}$ (dielectric, diel_rs_grid, pw_po TYPE(realspace_grid_type), POINTER :: diel_rs_grid TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(pw_${kind}$_type), INTENT(IN) :: rho - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_core + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_core CHARACTER(LEN=*), PARAMETER :: routineN = 'dielectric_compute_periodic' REAL(dp), PARAMETER :: small_value = EPSILON(1.0_dp) @@ -127,9 +125,9 @@ SUBROUTINE dielectric_compute_periodic_${kind}$ (dielectric, diel_rs_grid, pw_po handle, i, idir, j, k, times_called INTEGER, DIMENSION(3) :: lb, ub REAL(dp) :: eps0, rho_max, rho_min - TYPE(pw_r3d_type) :: ln_eps, rho_elec_rs - TYPE(pw_r3d_type) :: rho_core_rs - TYPE(pw_r3d_type), DIMENSION(3) :: deps, drho + TYPE(pw_r3d_rs_type) :: ln_eps, rho_elec_rs + TYPE(pw_r3d_rs_type) :: rho_core_rs + TYPE(pw_r3d_rs_type), DIMENSION(3) :: deps, drho CALL timeset(routineN, handle) @@ -148,14 +146,14 @@ SUBROUTINE dielectric_compute_periodic_${kind}$ (dielectric, diel_rs_grid, pw_po "the dielectric constant function.") END IF - CALL pw_pool%create_pw(rho_elec_rs, in_space=REALSPACE) + CALL pw_pool%create_pw(rho_elec_rs) ! for evaluating epsilon make sure rho is in the real space CALL pw_transfer(rho, rho_elec_rs) IF (PRESENT(rho_core)) THEN ! make sure rho_core is in the real space - CALL pw_pool%create_pw(rho_core_rs, in_space=REALSPACE) + CALL pw_pool%create_pw(rho_core_rs) CALL pw_transfer(rho_core, rho_core_rs) IF (dielectric%params%dielec_core_correction) THEN ! use (rho_elec - rho_core) to compute dielectric to avoid obtaining spurious @@ -189,17 +187,17 @@ SUBROUTINE dielectric_compute_periodic_${kind}$ (dielectric, diel_rs_grid, pw_po ((dielec_functiontype .EQ. spatially_dependent) .AND. times_called .EQ. 0)) THEN SELECT CASE (derivative_method) CASE (derivative_cd3, derivative_cd5, derivative_cd7, derivative_fft) - CALL pw_pool%create_pw(ln_eps, in_space=REALSPACE) + CALL pw_pool%create_pw(ln_eps) ln_eps%array = LOG(dielectric%eps%array) CASE (derivative_fft_use_deps) DO i = 1, 3 - CALL pw_pool%create_pw(deps(i), in_space=REALSPACE) + CALL pw_pool%create_pw(deps(i)) CALL pw_zero(deps(i)) END DO CASE (derivative_fft_use_drho) DO i = 1, 3 - CALL pw_pool%create_pw(deps(i), in_space=REALSPACE) - CALL pw_pool%create_pw(drho(i), in_space=REALSPACE) + CALL pw_pool%create_pw(deps(i)) + CALL pw_pool%create_pw(drho(i)) CALL pw_zero(deps(i)) CALL pw_zero(drho(i)) END DO @@ -266,9 +264,7 @@ SUBROUTINE dielectric_compute_periodic_${kind}$ (dielectric, diel_rs_grid, pw_po CALL timestop(handle) END SUBROUTINE dielectric_compute_periodic_${kind}$ - #:endfor - #:for kind in ["c1d", "r3d"] ! ************************************************************************************************** !> \brief evaluates the dielectric constant for non-periodic (Neumann-type) !> boundaries @@ -302,7 +298,7 @@ SUBROUTINE dielectric_compute_neumann_${kind}$ (dielectric, diel_rs_grid, pw_poo INTEGER, DIMENSION(:), INTENT(IN), POINTER :: dests_expand, srcs_expand, flipg_stat INTEGER, DIMENSION(2, 3), INTENT(IN) :: bounds_shftd TYPE(pw_${kind}$_type), INTENT(IN) :: rho - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_core + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_core CHARACTER(LEN=*), PARAMETER :: routineN = 'dielectric_compute_neumann' REAL(dp), PARAMETER :: small_value = EPSILON(1.0_dp) @@ -312,9 +308,9 @@ SUBROUTINE dielectric_compute_neumann_${kind}$ (dielectric, diel_rs_grid, pw_poo INTEGER, DIMENSION(3) :: lb, ub REAL(dp) :: eps0, rho_max, rho_min TYPE(pw_pool_type), POINTER :: pw_pool_xpndd - TYPE(pw_r3d_type) :: ln_eps, rho_core_rs, rho_core_rs_xpndd, & - rho_elec_rs, rho_elec_rs_xpndd - TYPE(pw_r3d_type), DIMENSION(3) :: deps, drho + TYPE(pw_r3d_rs_type) :: ln_eps, rho_core_rs, rho_core_rs_xpndd, & + rho_elec_rs, rho_elec_rs_xpndd + TYPE(pw_r3d_rs_type), DIMENSION(3) :: deps, drho CALL timeset(routineN, handle) @@ -336,19 +332,19 @@ SUBROUTINE dielectric_compute_neumann_${kind}$ (dielectric, diel_rs_grid, pw_poo CALL pw_pool_create(pw_pool_xpndd, pw_grid=dct_pw_grid) ! make sure rho is in the real space - CALL pw_pool_orig%create_pw(rho_elec_rs, in_space=REALSPACE) + CALL pw_pool_orig%create_pw(rho_elec_rs) CALL pw_transfer(rho, rho_elec_rs) ! expand rho_elec - CALL pw_pool_xpndd%create_pw(rho_elec_rs_xpndd, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(rho_elec_rs_xpndd) CALL pw_expand(neumann_directions, recv_msgs_bnds, dests_expand, srcs_expand, flipg_stat, bounds_shftd, & rho_elec_rs, rho_elec_rs_xpndd) IF (PRESENT(rho_core)) THEN ! make sure rho_core is in the real space - CALL pw_pool_orig%create_pw(rho_core_rs, in_space=REALSPACE) + CALL pw_pool_orig%create_pw(rho_core_rs) CALL pw_transfer(rho_core, rho_core_rs) ! expand rho_core - CALL pw_pool_xpndd%create_pw(rho_core_rs_xpndd, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(rho_core_rs_xpndd) CALL pw_expand(neumann_directions, recv_msgs_bnds, dests_expand, srcs_expand, flipg_stat, bounds_shftd, & rho_core_rs, rho_core_rs_xpndd) @@ -384,17 +380,17 @@ SUBROUTINE dielectric_compute_neumann_${kind}$ (dielectric, diel_rs_grid, pw_poo ((dielec_functiontype .EQ. spatially_dependent) .AND. times_called .EQ. 0)) THEN SELECT CASE (derivative_method) CASE (derivative_cd3, derivative_cd5, derivative_cd7, derivative_fft) - CALL pw_pool_xpndd%create_pw(ln_eps, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(ln_eps) ln_eps%array = LOG(dielectric%eps%array) CASE (derivative_fft_use_deps) DO i = 1, 3 - CALL pw_pool_xpndd%create_pw(deps(i), in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(deps(i)) CALL pw_zero(deps(i)) END DO CASE (derivative_fft_use_drho) DO i = 1, 3 - CALL pw_pool_xpndd%create_pw(deps(i), in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(drho(i), in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(deps(i)) + CALL pw_pool_xpndd%create_pw(drho(i)) CALL pw_zero(deps(i)) CALL pw_zero(drho(i)) END DO @@ -480,7 +476,7 @@ END SUBROUTINE dielectric_compute_neumann_${kind}$ ! ************************************************************************************************** SUBROUTINE dielectric_constant_sccs(rho, eps, deps_drho, eps0, rho_max, rho_min) - TYPE(pw_r3d_type), INTENT(IN) :: rho, eps, deps_drho + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho, eps, deps_drho REAL(KIND=dp), INTENT(IN) :: eps0, rho_max, rho_min CHARACTER(LEN=*), PARAMETER :: routineN = 'dielectric_constant_sccs' @@ -548,7 +544,7 @@ SUBROUTINE dielectric_constant_aa_cuboidal(eps, dielec_const, pw_pool, zeta, & x_glbl, y_glbl, z_glbl, & x_locl, y_locl, z_locl) - TYPE(pw_r3d_type), INTENT(INOUT) :: eps + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: eps REAL(KIND=dp), INTENT(IN) :: dielec_const TYPE(pw_pool_type), POINTER :: pw_pool REAL(KIND=dp), INTENT(IN) :: zeta @@ -566,7 +562,7 @@ SUBROUTINE dielectric_constant_aa_cuboidal(eps, dielec_const, pw_pool, zeta, & forb_xtnt4, forb_xtnt5, forb_xtnt6 REAL(KIND=dp) :: dx, dy, dz TYPE(pw_grid_type), POINTER :: pw_grid - TYPE(pw_r3d_type) :: eps_tmp + TYPE(pw_r3d_rs_type) :: eps_tmp CALL timeset(routineN, handle) @@ -592,7 +588,7 @@ SUBROUTINE dielectric_constant_aa_cuboidal(eps, dielec_const, pw_pool, zeta, & "the simulation cell.") END IF - CALL pw_pool%create_pw(eps_tmp, in_space=REALSPACE) + CALL pw_pool%create_pw(eps_tmp) CALL pw_copy(eps, eps_tmp) bounds_local = pw_grid%bounds_local @@ -643,7 +639,7 @@ SUBROUTINE dielectric_constant_xaa_annular(eps, dielec_const, pw_pool, zeta, & x_glbl, y_glbl, z_glbl, & x_locl, y_locl, z_locl) - TYPE(pw_r3d_type), INTENT(INOUT) :: eps + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: eps REAL(KIND=dp), INTENT(IN) :: dielec_const TYPE(pw_pool_type), POINTER :: pw_pool REAL(dp), INTENT(IN) :: zeta @@ -661,7 +657,7 @@ SUBROUTINE dielectric_constant_xaa_annular(eps, dielec_const, pw_pool, zeta, & forb_xtnt4, forb_xtnt5, forb_xtnt6 REAL(KIND=dp) :: bctry, bctrz, distsq, dx, dy, dz TYPE(pw_grid_type), POINTER :: pw_grid - TYPE(pw_r3d_type) :: eps_tmp + TYPE(pw_r3d_rs_type) :: eps_tmp CALL timeset(routineN, handle) @@ -688,7 +684,7 @@ SUBROUTINE dielectric_constant_xaa_annular(eps, dielec_const, pw_pool, zeta, & "the simulation cell.") END IF - CALL pw_pool%create_pw(eps_tmp, in_space=REALSPACE) + CALL pw_pool%create_pw(eps_tmp) CALL pw_copy(eps, eps_tmp) bounds_local = pw_grid%bounds_local @@ -726,7 +722,7 @@ END SUBROUTINE dielectric_constant_xaa_annular ! ************************************************************************************************** SUBROUTINE dielectric_constant_spatially_dependent(eps, pw_pool, dielectric_params) - TYPE(pw_r3d_type), INTENT(INOUT) :: eps + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: eps TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(dielectric_parameters), INTENT(IN) :: dielectric_params @@ -799,14 +795,14 @@ END SUBROUTINE dielectric_constant_spatially_dependent SUBROUTINE dielectric_constant_spatially_rho_dependent(rho, eps, deps_drho, & pw_pool, dielectric_params) - TYPE(pw_r3d_type), INTENT(IN) :: rho, eps, deps_drho + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho, eps, deps_drho TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(dielectric_parameters), INTENT(IN) :: dielectric_params CHARACTER(LEN=*), PARAMETER :: routineN = 'dielectric_constant_spatially_rho_dependent' INTEGER :: handle - TYPE(pw_r3d_type) :: dswch_func_drho, eps_sptldep, swch_func + TYPE(pw_r3d_rs_type) :: dswch_func_drho, eps_sptldep, swch_func CALL timeset(routineN, handle) @@ -814,9 +810,9 @@ SUBROUTINE dielectric_constant_spatially_rho_dependent(rho, eps, deps_drho, & CPABORT("The dielectric constant has to be greater than or equal to 1.") END IF - CALL pw_pool%create_pw(eps_sptldep, in_space=REALSPACE) - CALL pw_pool%create_pw(swch_func, in_space=REALSPACE) - CALL pw_pool%create_pw(dswch_func_drho, in_space=REALSPACE) + CALL pw_pool%create_pw(eps_sptldep) + CALL pw_pool%create_pw(swch_func) + CALL pw_pool%create_pw(dswch_func_drho) CALL pw_zero(eps_sptldep) CALL pw_zero(swch_func) CALL pw_zero(dswch_func_drho) @@ -844,20 +840,20 @@ END SUBROUTINE dielectric_constant_spatially_rho_dependent ! ************************************************************************************************** SUBROUTINE derive_fft(f, df, pw_pool) - TYPE(pw_r3d_type), INTENT(IN) :: f - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: df + TYPE(pw_r3d_rs_type), INTENT(IN) :: f + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: df TYPE(pw_pool_type), POINTER :: pw_pool CHARACTER(LEN=*), PARAMETER :: routineN = 'derive_fft_r3d' INTEGER :: handle, i INTEGER, DIMENSION(3) :: nd - TYPE(pw_c1d_type), DIMENSION(2) :: work_gs + TYPE(pw_c1d_gs_type), DIMENSION(2) :: work_gs CALL timeset(routineN, handle) DO i = 1, 2 - CALL pw_pool%create_pw(work_gs(i), in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(work_gs(i)) END DO CALL pw_transfer(f, work_gs(1)) diff --git a/src/pw/dielectric_types.F b/src/pw/dielectric_types.F index 10d4494042..0670404d41 100644 --- a/src/pw/dielectric_types.F +++ b/src/pw/dielectric_types.F @@ -15,7 +15,7 @@ MODULE dielectric_types USE kinds, ONLY: dp USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -61,9 +61,9 @@ MODULE dielectric_types TYPE dielectric_type TYPE(dielectric_parameters) :: params = dielectric_parameters() - TYPE(pw_r3d_type), POINTER :: eps => NULL() - TYPE(pw_r3d_type), POINTER :: deps_drho => NULL() - TYPE(pw_r3d_type), DIMENSION(3) :: dln_eps = pw_r3d_type() + TYPE(pw_r3d_rs_type), POINTER :: eps => NULL() + TYPE(pw_r3d_rs_type), POINTER :: deps_drho => NULL() + TYPE(pw_r3d_rs_type), DIMENSION(3) :: dln_eps = pw_r3d_rs_type() END TYPE dielectric_type PUBLIC :: dielectric_type, dielectric_parameters diff --git a/src/pw/dirichlet_bc_methods.F b/src/pw/dirichlet_bc_methods.F index d232be2f10..fb8d5b1e58 100644 --- a/src/pw/dirichlet_bc_methods.F +++ b/src/pw/dirichlet_bc_methods.F @@ -36,8 +36,7 @@ MODULE dirichlet_bc_methods pw_zero USE pw_poisson_types, ONLY: pw_poisson_parameter_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE rs_methods, ONLY: setup_grid_axes #include "../base/base_uses.f90" @@ -292,7 +291,7 @@ SUBROUTINE dirichlet_bc_partition(sigma, n_prtn, pw_pool, cell_xtnts, & REAL(dp) :: cyl_maxval, tile_volume REAL(dp), ALLOCATABLE, DIMENSION(:) :: tile_maxvals TYPE(cp_logger_type), POINTER :: logger - TYPE(pw_r3d_type), POINTER :: cylinder_pw + TYPE(pw_r3d_rs_type), POINTER :: cylinder_pw TYPE(tile_p_type), DIMENSION(:), POINTER :: tiles CALL timeset(routineN, handle) @@ -318,7 +317,7 @@ SUBROUTINE dirichlet_bc_partition(sigma, n_prtn, pw_pool, cell_xtnts, & tile_maxvals = 0.0_dp DO k = 1, n_tiles ALLOCATE (dirichlet_bc%tiles(k)%tile%tile_pw) - CALL pw_pool%create_pw(dirichlet_bc%tiles(k)%tile%tile_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(dirichlet_bc%tiles(k)%tile%tile_pw) CALL pw_zero(dirichlet_bc%tiles(k)%tile%tile_pw) IF ((unit_nr .GT. 0) .AND. verbose) THEN @@ -351,12 +350,12 @@ SUBROUTINE dirichlet_bc_partition(sigma, n_prtn, pw_pool, cell_xtnts, & NULLIFY (cylinder_pw) ALLOCATE (cylinder_pw) - CALL pw_pool%create_pw(cylinder_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(cylinder_pw) CALL pw_zero(cylinder_pw) DO k = 1, n_tiles ALLOCATE (dirichlet_bc%tiles(k)%tile%tile_pw) - CALL pw_pool%create_pw(dirichlet_bc%tiles(k)%tile%tile_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(dirichlet_bc%tiles(k)%tile%tile_pw) CALL pw_zero(dirichlet_bc%tiles(k)%tile%tile_pw) IF ((unit_nr .GT. 0) .AND. verbose) THEN @@ -402,7 +401,7 @@ SUBROUTINE dirichlet_bc_partition(sigma, n_prtn, pw_pool, cell_xtnts, & DO k = 1, n_tiles ALLOCATE (dirichlet_bc%tiles(k)%tile%tile_pw) - CALL pw_pool%create_pw(dirichlet_bc%tiles(k)%tile%tile_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(dirichlet_bc%tiles(k)%tile%tile_pw) CALL pw_zero(dirichlet_bc%tiles(k)%tile%tile_pw) IF ((unit_nr .GT. 0) .AND. verbose) THEN @@ -1395,7 +1394,7 @@ SUBROUTINE aa_tile_pw_compute(cell_xtnts, x_locl, y_locl, z_locl, tile_vertices, REAL(dp), DIMENSION(3, 8), INTENT(IN) :: tile_vertices REAL(dp), INTENT(IN) :: sigma LOGICAL, INTENT(IN) :: is_periodic - TYPE(pw_r3d_type), INTENT(INOUT) :: tile_pw + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: tile_pw CHARACTER(LEN=*), PARAMETER :: routineN = 'aa_tile_pw_compute' @@ -1497,7 +1496,7 @@ SUBROUTINE arbitrary_tile_pw_compute(cell_xtnts, x_locl, y_locl, z_locl, tile_ve REAL(dp), ALLOCATABLE, DIMENSION(:), INTENT(IN) :: x_locl, y_locl, z_locl REAL(dp), DIMENSION(3, 8), INTENT(IN) :: tile_vertices REAL(dp), INTENT(IN) :: sigma - TYPE(pw_r3d_type), INTENT(INOUT) :: tile_pw + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: tile_pw CHARACTER(LEN=*), PARAMETER :: routineN = 'arbitrary_tile_pw_compute' diff --git a/src/pw/dirichlet_bc_types.F b/src/pw/dirichlet_bc_types.F index 5046aa28cc..c4a16db7f7 100644 --- a/src/pw/dirichlet_bc_types.F +++ b/src/pw/dirichlet_bc_types.F @@ -16,7 +16,7 @@ MODULE dirichlet_bc_types USE kinds, ONLY: dp USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -108,7 +108,7 @@ MODULE dirichlet_bc_types TYPE :: tile_type INTEGER :: tile_id = 0 REAL(dp), DIMENSION(3, 8) :: vertices = 0 - TYPE(pw_r3d_type), POINTER :: tile_pw => NULL() + TYPE(pw_r3d_rs_type), POINTER :: tile_pw => NULL() REAL(dp) :: volume = 0.0_dp END TYPE tile_type diff --git a/src/pw/mt_util.F b/src/pw/mt_util.F index 64586aa8f6..a0bd04e3ff 100644 --- a/src/pw/mt_util.F +++ b/src/pw/mt_util.F @@ -20,10 +20,8 @@ MODULE mt_util USE pw_pool_types, ONLY: pw_pool_create,& pw_pool_release,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -52,7 +50,7 @@ MODULE mt_util ! ************************************************************************************************** SUBROUTINE MTin_create_screen_fn(screen_function, pw_pool, method, alpha, & special_dimension, slab_size, super_ref_pw_grid) - TYPE(pw_c1d_type), POINTER :: screen_function + TYPE(pw_c1d_gs_type), POINTER :: screen_function TYPE(pw_pool_type), POINTER :: pw_pool INTEGER, INTENT(IN) :: method REAL(KIND=dp), INTENT(in) :: alpha @@ -64,9 +62,9 @@ SUBROUTINE MTin_create_screen_fn(screen_function, pw_pool, method, alpha, & INTEGER :: handle, ig, iz REAL(KIND=dp) :: alpha2, g2, g3d, gxy, gz, zlength - TYPE(pw_c1d_type), POINTER :: Vlocg + TYPE(pw_c1d_gs_type), POINTER :: Vlocg TYPE(pw_pool_type), POINTER :: pw_pool_aux - TYPE(pw_r3d_type), POINTER :: Vloc + TYPE(pw_r3d_rs_type), POINTER :: Vloc CALL timeset(routineN, handle) NULLIFY (Vloc, Vlocg, pw_pool_aux) @@ -79,18 +77,18 @@ SUBROUTINE MTin_create_screen_fn(screen_function, pw_pool, method, alpha, & END IF NULLIFY (screen_function) ALLOCATE (screen_function) - CALL pw_pool%create_pw(screen_function, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(screen_function) CALL pw_zero(screen_function) SELECT CASE (method) CASE (MT0D) NULLIFY (Vloc, Vlocg) ALLOCATE (Vloc, Vlocg) IF (ASSOCIATED(pw_pool_aux)) THEN - CALL pw_pool_aux%create_pw(Vloc, in_space=REALSPACE) - CALL pw_pool_aux%create_pw(Vlocg, in_space=RECIPROCALSPACE) + CALL pw_pool_aux%create_pw(Vloc) + CALL pw_pool_aux%create_pw(Vlocg) ELSE - CALL pw_pool%create_pw(Vloc, in_space=REALSPACE) - CALL pw_pool%create_pw(Vlocg, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(Vloc) + CALL pw_pool%create_pw(Vlocg) END IF CALL mt0din(Vloc, alpha) CALL pw_transfer(Vloc, Vlocg) @@ -143,7 +141,7 @@ END SUBROUTINE MTin_create_screen_fn !> \author Teodoro Laino (09.03.2005) ! ************************************************************************************************** SUBROUTINE mt0din(Vloc, alpha) - TYPE(pw_r3d_type), POINTER :: Vloc + TYPE(pw_r3d_rs_type), POINTER :: Vloc REAL(KIND=dp), INTENT(in) :: alpha CHARACTER(len=*), PARAMETER :: routineN = 'mt0din' @@ -204,7 +202,7 @@ END SUBROUTINE Mt0din !> \author Teodoro Laino (11.2005) ! ************************************************************************************************** SUBROUTINE mt1din(screen_function) - TYPE(pw_c1d_type), POINTER :: screen_function + TYPE(pw_c1d_gs_type), POINTER :: screen_function CHARACTER(len=*), PARAMETER :: routineN = 'mt1din' diff --git a/src/pw/ps_implicit_methods.F b/src/pw/ps_implicit_methods.F index 5e4ba2cbbd..2a34d2682d 100644 --- a/src/pw/ps_implicit_methods.F +++ b/src/pw/ps_implicit_methods.F @@ -50,10 +50,8 @@ MODULE ps_implicit_methods USE pw_pool_types, ONLY: pw_pool_create,& pw_pool_release,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -128,7 +126,7 @@ SUBROUTINE ps_implicit_create(pw_pool, poisson_params, dct_pw_grid, green, ps_im ! v_eps NULLIFY (ps_implicit_env%v_eps) ALLOCATE (ps_implicit_env%v_eps) - CALL pw_pool%create_pw(ps_implicit_env%v_eps, in_space=REALSPACE) + CALL pw_pool%create_pw(ps_implicit_env%v_eps) CALL pw_zero(ps_implicit_env%v_eps) ! constraint charge @@ -136,12 +134,12 @@ SUBROUTINE ps_implicit_create(pw_pool, poisson_params, dct_pw_grid, green, ps_im SELECT CASE (boundary_condition) CASE (MIXED_PERIODIC_BC) ALLOCATE (ps_implicit_env%cstr_charge) - CALL pw_pool%create_pw(ps_implicit_env%cstr_charge, in_space=REALSPACE) + CALL pw_pool%create_pw(ps_implicit_env%cstr_charge) CALL pw_zero(ps_implicit_env%cstr_charge) CASE (MIXED_BC) CALL pw_pool_create(pw_pool_xpndd, pw_grid=dct_pw_grid) ALLOCATE (ps_implicit_env%cstr_charge) - CALL pw_pool_xpndd%create_pw(ps_implicit_env%cstr_charge, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(ps_implicit_env%cstr_charge) CALL pw_zero(ps_implicit_env%cstr_charge) CALL pw_pool_release(pw_pool_xpndd) END SELECT @@ -188,8 +186,8 @@ END SUBROUTINE ps_implicit_create SUBROUTINE implicit_poisson_solver_periodic(poisson_env, density, v_new, ehartree) TYPE(pw_poisson_type), INTENT(IN) :: poisson_env - TYPE(pw_r3d_type), INTENT(IN) :: density - TYPE(pw_r3d_type), INTENT(INOUT) :: v_new + TYPE(pw_r3d_rs_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_new REAL(dp), INTENT(OUT), OPTIONAL :: ehartree CHARACTER(LEN=*), PARAMETER :: routineN = 'implicit_poisson_solver_periodic' @@ -203,7 +201,7 @@ SUBROUTINE implicit_poisson_solver_periodic(poisson_env, density, v_new, ehartre TYPE(greens_fn_type), POINTER :: green TYPE(ps_implicit_type), POINTER :: ps_implicit_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: g, PxQAinvxres, QAinvxres, res_new, & + TYPE(pw_r3d_rs_type) :: g, PxQAinvxres, QAinvxres, res_new, & res_old, v_old CALL timeset(routineN, handle) @@ -222,12 +220,12 @@ SUBROUTINE implicit_poisson_solver_periodic(poisson_env, density, v_new, ehartre ! check if this is the first scf iteration IF (times_called .EQ. 0) CALL ps_implicit_initial_guess_create(ps_implicit_env, pw_pool) - CALL pw_pool%create_pw(g, in_space=REALSPACE) - CALL pw_pool%create_pw(v_old, in_space=REALSPACE) - CALL pw_pool%create_pw(res_old, in_space=REALSPACE) - CALL pw_pool%create_pw(res_new, in_space=REALSPACE) - CALL pw_pool%create_pw(QAinvxres, in_space=REALSPACE) - CALL pw_pool%create_pw(PxQAinvxres, in_space=REALSPACE) + CALL pw_pool%create_pw(g) + CALL pw_pool%create_pw(v_old) + CALL pw_pool%create_pw(res_old) + CALL pw_pool%create_pw(res_new) + CALL pw_pool%create_pw(QAinvxres) + CALL pw_pool%create_pw(PxQAinvxres) IF (use_zero_initial_guess) THEN CALL pw_zero(v_old) @@ -294,7 +292,7 @@ SUBROUTINE implicit_poisson_solver_periodic(poisson_env, density, v_new, ehartre IF (PRESENT(ehartree)) ehartree = ps_implicit_env%ehartree ! compute the extra contribution to the Hamiltonian due to the presence of dielectric BLOCK - TYPE(pw_r3d_type) :: v_eps + TYPE(pw_r3d_rs_type) :: v_eps v_eps%pw_grid => ps_implicit_env%v_eps%pw_grid v_eps%array => ps_implicit_env%v_eps%array CALL ps_implicit_compute_veps(pw_pool, dielectric, v_new, v_eps) @@ -326,8 +324,8 @@ END SUBROUTINE implicit_poisson_solver_periodic SUBROUTINE implicit_poisson_solver_neumann(poisson_env, density, v_new, ehartree) TYPE(pw_poisson_type), INTENT(IN) :: poisson_env - TYPE(pw_r3d_type), INTENT(IN) :: density - TYPE(pw_r3d_type), INTENT(INOUT) :: v_new + TYPE(pw_r3d_rs_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_new REAL(dp), INTENT(OUT), OPTIONAL :: ehartree CHARACTER(LEN=*), PARAMETER :: routineN = 'implicit_poisson_solver_neumann' @@ -344,7 +342,7 @@ SUBROUTINE implicit_poisson_solver_neumann(poisson_env, density, v_new, ehartree TYPE(greens_fn_type), POINTER :: green TYPE(ps_implicit_type), POINTER :: ps_implicit_env TYPE(pw_pool_type), POINTER :: pw_pool, pw_pool_xpndd - TYPE(pw_r3d_type) :: density_xpndd, g, PxQAinvxres, & + TYPE(pw_r3d_rs_type) :: density_xpndd, g, PxQAinvxres, & QAinvxres, res_new, res_old, & v_eps_xpndd, v_new_xpndd, v_old @@ -377,15 +375,15 @@ SUBROUTINE implicit_poisson_solver_neumann(poisson_env, density, v_new, ehartree ! check if this is the first scf iteration IF (times_called .EQ. 0) CALL ps_implicit_initial_guess_create(ps_implicit_env, pw_pool_xpndd) - CALL pw_pool_xpndd%create_pw(g, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(v_old, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(res_old, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(res_new, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(QAinvxres, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(PxQAinvxres, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(density_xpndd, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(v_new_xpndd, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(v_eps_xpndd, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(g) + CALL pw_pool_xpndd%create_pw(v_old) + CALL pw_pool_xpndd%create_pw(res_old) + CALL pw_pool_xpndd%create_pw(res_new) + CALL pw_pool_xpndd%create_pw(QAinvxres) + CALL pw_pool_xpndd%create_pw(PxQAinvxres) + CALL pw_pool_xpndd%create_pw(density_xpndd) + CALL pw_pool_xpndd%create_pw(v_new_xpndd) + CALL pw_pool_xpndd%create_pw(v_eps_xpndd) IF (use_zero_initial_guess) THEN CALL pw_zero(v_old) @@ -464,7 +462,7 @@ SUBROUTINE implicit_poisson_solver_neumann(poisson_env, density, v_new, ehartree ! veps has to be computed for the expanded data and then shrunk otherwise we loose accuracy CALL ps_implicit_compute_veps(pw_pool_xpndd, dielectric, v_new_xpndd, v_eps_xpndd) BLOCK - TYPE(pw_r3d_type) :: v_eps + TYPE(pw_r3d_rs_type) :: v_eps v_eps%pw_grid => ps_implicit_env%v_eps%pw_grid v_eps%array => ps_implicit_env%v_eps%array CALL pw_shrink(neumann_directions, dct_env%dests_shrink, dct_env%srcs_shrink, & @@ -499,8 +497,8 @@ END SUBROUTINE implicit_poisson_solver_neumann SUBROUTINE implicit_poisson_solver_mixed_periodic(poisson_env, density, v_new, electric_enthalpy) TYPE(pw_poisson_type), INTENT(IN) :: poisson_env - TYPE(pw_r3d_type), INTENT(IN) :: density - TYPE(pw_r3d_type), INTENT(INOUT) :: v_new + TYPE(pw_r3d_rs_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_new REAL(dp), INTENT(OUT), OPTIONAL :: electric_enthalpy CHARACTER(LEN=*), PARAMETER :: routineN = 'implicit_poisson_solver_mixed_periodic' @@ -524,7 +522,7 @@ SUBROUTINE implicit_poisson_solver_mixed_periodic(poisson_env, density, v_new, e TYPE(ps_implicit_type), POINTER :: ps_implicit_env TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: Axvbar, g, PxQAinvxres, QAinvxres, & + TYPE(pw_r3d_rs_type) :: Axvbar, g, PxQAinvxres, QAinvxres, & res_new, res_old, v_old CALL timeset(routineN, handle) @@ -590,13 +588,13 @@ SUBROUTINE implicit_poisson_solver_mixed_periodic(poisson_env, density, v_new, e ALLOCATE (v_new1D(data_size)) ALLOCATE (Bxv_new(n_tiles_tot)) - CALL pw_pool%create_pw(g, in_space=REALSPACE) - CALL pw_pool%create_pw(v_old, in_space=REALSPACE) - CALL pw_pool%create_pw(res_old, in_space=REALSPACE) - CALL pw_pool%create_pw(res_new, in_space=REALSPACE) - CALL pw_pool%create_pw(QAinvxres, in_space=REALSPACE) - CALL pw_pool%create_pw(PxQAinvxres, in_space=REALSPACE) - CALL pw_pool%create_pw(Axvbar, in_space=REALSPACE) + CALL pw_pool%create_pw(g) + CALL pw_pool%create_pw(v_old) + CALL pw_pool%create_pw(res_old) + CALL pw_pool%create_pw(res_new) + CALL pw_pool%create_pw(QAinvxres) + CALL pw_pool%create_pw(PxQAinvxres) + CALL pw_pool%create_pw(Axvbar) IF (use_zero_initial_guess) THEN CALL pw_zero(v_old) @@ -729,7 +727,7 @@ SUBROUTINE implicit_poisson_solver_mixed_periodic(poisson_env, density, v_new, e IF (PRESENT(electric_enthalpy)) electric_enthalpy = ps_implicit_env%electric_enthalpy ! compute the extra contribution to the Hamiltonian due to the presence of dielectric BLOCK - TYPE(pw_r3d_type) :: tmp + TYPE(pw_r3d_rs_type) :: tmp tmp%pw_grid => ps_implicit_env%v_eps%pw_grid tmp%array => ps_implicit_env%v_eps%array CALL ps_implicit_compute_veps(pw_pool, dielectric, v_new, tmp) @@ -761,8 +759,8 @@ END SUBROUTINE implicit_poisson_solver_mixed_periodic SUBROUTINE implicit_poisson_solver_mixed(poisson_env, density, v_new, electric_enthalpy) TYPE(pw_poisson_type), INTENT(IN) :: poisson_env - TYPE(pw_r3d_type), INTENT(IN) :: density - TYPE(pw_r3d_type), INTENT(INOUT) :: v_new + TYPE(pw_r3d_rs_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_new REAL(dp), INTENT(OUT), OPTIONAL :: electric_enthalpy CHARACTER(LEN=*), PARAMETER :: routineN = 'implicit_poisson_solver_mixed' @@ -787,7 +785,7 @@ SUBROUTINE implicit_poisson_solver_mixed(poisson_env, density, v_new, electric_e TYPE(ps_implicit_type), POINTER :: ps_implicit_env TYPE(pw_grid_type), POINTER :: dct_pw_grid, pw_grid TYPE(pw_pool_type), POINTER :: pw_pool, pw_pool_xpndd - TYPE(pw_r3d_type) :: Axvbar, density_xpndd, g, PxQAinvxres, & + TYPE(pw_r3d_rs_type) :: Axvbar, density_xpndd, g, PxQAinvxres, & QAinvxres, res_new, res_old, & v_eps_xpndd, v_new_xpndd, v_old @@ -868,16 +866,16 @@ SUBROUTINE implicit_poisson_solver_mixed(poisson_env, density, v_new, electric_e ALLOCATE (v_new1D(data_size)) ALLOCATE (Bxv_new(n_tiles_tot)) - CALL pw_pool_xpndd%create_pw(g, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(v_old, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(res_old, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(res_new, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(QAinvxres, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(PxQAinvxres, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(Axvbar, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(density_xpndd, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(v_new_xpndd, in_space=REALSPACE) - CALL pw_pool_xpndd%create_pw(v_eps_xpndd, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(g) + CALL pw_pool_xpndd%create_pw(v_old) + CALL pw_pool_xpndd%create_pw(res_old) + CALL pw_pool_xpndd%create_pw(res_new) + CALL pw_pool_xpndd%create_pw(QAinvxres) + CALL pw_pool_xpndd%create_pw(PxQAinvxres) + CALL pw_pool_xpndd%create_pw(Axvbar) + CALL pw_pool_xpndd%create_pw(density_xpndd) + CALL pw_pool_xpndd%create_pw(v_new_xpndd) + CALL pw_pool_xpndd%create_pw(v_eps_xpndd) IF (use_zero_initial_guess) THEN CALL pw_zero(v_old) @@ -1062,8 +1060,7 @@ SUBROUTINE ps_implicit_initial_guess_create(ps_implicit_env, pw_pool) n_tiles_tot = SIZE(ps_implicit_env%v_D) NULLIFY (ps_implicit_env%initial_guess) ALLOCATE (ps_implicit_env%initial_guess) - CALL pw_pool%create_pw(ps_implicit_env%initial_guess, & - in_space=REALSPACE) + CALL pw_pool%create_pw(ps_implicit_env%initial_guess) CALL pw_zero(ps_implicit_env%initial_guess) ALLOCATE (ps_implicit_env%initial_lambda(n_tiles_tot)) ps_implicit_env%initial_lambda = 0.0_dp @@ -1108,7 +1105,7 @@ SUBROUTINE ps_implicit_prepare_blocks(pw_pool_orig, dct_pw_grid, green, & TYPE(dct_type), POINTER :: dct_env TYPE(pw_grid_type), POINTER :: pw_grid_orig TYPE(pw_pool_type), POINTER :: pw_pool_xpndd - TYPE(pw_r3d_type) :: pw_in, pw_out + TYPE(pw_r3d_rs_type) :: pw_in, pw_out CALL timeset(routineN, handle) @@ -1207,7 +1204,7 @@ SUBROUTINE ps_implicit_prepare_blocks(pw_pool_orig, dct_pw_grid, green, & indx2 = indx1 + n_tiles - 1 DO i = 1, n_tiles - CALL pw_pool_xpndd%create_pw(pw_in, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(pw_in) CALL pw_expand(neumann_directions, & dct_env%recv_msgs_bnds, dct_env%dests_expand, dct_env%srcs_expand, & dct_env%flipg_stat, dct_env%bounds_shftd, & @@ -1217,7 +1214,7 @@ SUBROUTINE ps_implicit_prepare_blocks(pw_pool_orig, dct_pw_grid, green, & CALL pw_scale(pw_in, 1.0_dp/(vol_scfac*tile_volume)) ! normalize tile_pw ps_implicit_env%Bt(ps_implicit_env%idx_1dto3d, indx1 + i - 1) = RESHAPE(pw_in%array, (/data_size/)) - CALL pw_pool_xpndd%create_pw(pw_out, in_space=REALSPACE) + CALL pw_pool_xpndd%create_pw(pw_out) CALL apply_inv_laplace_operator_dct(pw_pool_xpndd, green, pw_in, pw_out) QAinvxBt(ps_implicit_env%idx_1dto3d, indx1 + i - 1) = RESHAPE(pw_out%array, (/data_size/)) ! the electrostatic potential has opposite sign by internal convention @@ -1339,14 +1336,14 @@ SUBROUTINE ps_implicit_prepare_blocks(pw_pool_orig, dct_pw_grid, green, & n_tiles = ps_implicit_env%contacts(j)%dirichlet_bc%n_tiles indx2 = indx1 + n_tiles - 1 DO i = 1, n_tiles - CALL pw_pool_orig%create_pw(pw_in, in_space=REALSPACE) + CALL pw_pool_orig%create_pw(pw_in) CALL pw_copy(ps_implicit_env%contacts(j)%dirichlet_bc%tiles(i)%tile%tile_pw, pw_in) tile_volume = ps_implicit_env%contacts(j)%dirichlet_bc%tiles(i)%tile%volume CALL pw_scale(pw_in, 1.0_dp/tile_volume) ! normalize tile_pw ps_implicit_env%Bt(ps_implicit_env%idx_1dto3d, indx1 + i - 1) = RESHAPE(pw_in%array, (/data_size/)) - CALL pw_pool_orig%create_pw(pw_out, in_space=REALSPACE) + CALL pw_pool_orig%create_pw(pw_out) CALL apply_inv_laplace_operator_fft(pw_pool_orig, green, pw_in, pw_out) QAinvxBt(ps_implicit_env%idx_1dto3d, indx1 + i - 1) = RESHAPE(pw_out%array, (/data_size/)) ! the electrostatic potential has opposite sign by internal convention @@ -1441,18 +1438,18 @@ SUBROUTINE apply_P_operator(pw_pool, dielectric, v, Pxv) TYPE(pw_pool_type), POINTER :: pw_pool TYPE(dielectric_type), INTENT(IN), POINTER :: dielectric - TYPE(pw_r3d_type), INTENT(IN) :: v - TYPE(pw_r3d_type), INTENT(INOUT) :: Pxv + TYPE(pw_r3d_rs_type), INTENT(IN) :: v + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: Pxv CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_P_operator' INTEGER :: handle, i - TYPE(pw_r3d_type), DIMENSION(3) :: dv + TYPE(pw_r3d_rs_type), DIMENSION(3) :: dv CALL timeset(routineN, handle) DO i = 1, 3 - CALL pw_pool%create_pw(dv(i), in_space=REALSPACE) + CALL pw_pool%create_pw(dv(i)) END DO CALL derive_fft(v, dv, pw_pool) @@ -1484,14 +1481,14 @@ SUBROUTINE apply_inv_laplace_operator_fft(pw_pool, green, pw_in, pw_out) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_inv_laplace_operator_fft' INTEGER :: handle, ig, ng REAL(dp) :: prefactor - TYPE(pw_c1d_type) :: pw_in_gs + TYPE(pw_c1d_gs_type) :: pw_in_gs TYPE(pw_grid_type), POINTER :: pw_grid CALL timeset(routineN, handle) @@ -1502,7 +1499,7 @@ SUBROUTINE apply_inv_laplace_operator_fft(pw_pool, green, pw_in, pw_out) pw_grid => pw_pool%pw_grid ng = SIZE(pw_grid%gsq) - CALL pw_pool%create_pw(pw_in_gs, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(pw_in_gs) CALL pw_transfer(pw_in, pw_in_gs) DO ig = 1, ng @@ -1532,14 +1529,14 @@ SUBROUTINE apply_inv_laplace_operator_dct(pw_pool, green, pw_in, pw_out) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_inv_laplace_operator_dct' INTEGER :: handle, ig, ng REAL(dp) :: prefactor - TYPE(pw_c1d_type) :: pw_in_gs + TYPE(pw_c1d_gs_type) :: pw_in_gs TYPE(pw_grid_type), POINTER :: pw_grid CALL timeset(routineN, handle) @@ -1550,7 +1547,7 @@ SUBROUTINE apply_inv_laplace_operator_dct(pw_pool, green, pw_in, pw_out) pw_grid => pw_pool%pw_grid ng = SIZE(pw_grid%gsq) - CALL pw_pool%create_pw(pw_in_gs, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(pw_in_gs) CALL pw_transfer(pw_in, pw_in_gs) DO ig = 1, ng @@ -1578,15 +1575,15 @@ SUBROUTINE apply_laplace_operator_fft(pw_pool, green, pw_in, pw_out) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_laplace_operator_fft' INTEGER :: g0_index, handle, ig, ng LOGICAL :: have_g0 REAL(dp) :: prefactor - TYPE(pw_c1d_type) :: pw_in_gs + TYPE(pw_c1d_gs_type) :: pw_in_gs TYPE(pw_grid_type), POINTER :: pw_grid CALL timeset(routineN, handle) @@ -1598,7 +1595,7 @@ SUBROUTINE apply_laplace_operator_fft(pw_pool, green, pw_in, pw_out) ng = SIZE(pw_in%pw_grid%gsq) have_g0 = green%influence_fn%pw_grid%have_g0 - CALL pw_pool%create_pw(pw_in_gs, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(pw_in_gs) CALL pw_transfer(pw_in, pw_in_gs) @@ -1633,15 +1630,15 @@ SUBROUTINE apply_laplace_operator_dct(pw_pool, green, pw_in, pw_out) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_laplace_operator_dct' INTEGER :: g0_index, handle, ig, ng LOGICAL :: have_g0 REAL(dp) :: prefactor - TYPE(pw_c1d_type) :: pw_in_gs + TYPE(pw_c1d_gs_type) :: pw_in_gs TYPE(pw_grid_type), POINTER :: pw_grid CALL timeset(routineN, handle) @@ -1653,7 +1650,7 @@ SUBROUTINE apply_laplace_operator_dct(pw_pool, green, pw_in, pw_out) ng = SIZE(pw_in%pw_grid%gsq) have_g0 = green%dct_influence_fn%pw_grid%have_g0 - CALL pw_pool%create_pw(pw_in_gs, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(pw_in_gs) CALL pw_transfer(pw_in, pw_in_gs) @@ -1689,17 +1686,17 @@ SUBROUTINE apply_poisson_operator_fft(pw_pool, green, dielectric, v, density) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green TYPE(dielectric_type), INTENT(IN), POINTER :: dielectric - TYPE(pw_r3d_type), INTENT(IN) :: v - TYPE(pw_r3d_type), INTENT(INOUT) :: density + TYPE(pw_r3d_rs_type), INTENT(IN) :: v + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: density CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_poisson_operator_fft' INTEGER :: handle - TYPE(pw_r3d_type) :: Pxv + TYPE(pw_r3d_rs_type) :: Pxv CALL timeset(routineN, handle) - CALL pw_pool%create_pw(Pxv, in_space=REALSPACE) + CALL pw_pool%create_pw(Pxv) CALL apply_P_operator(pw_pool, dielectric, v, Pxv) CALL apply_laplace_operator_fft(pw_pool, green, v, density) @@ -1729,17 +1726,17 @@ SUBROUTINE apply_poisson_operator_dct(pw_pool, green, dielectric, v, density) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green TYPE(dielectric_type), INTENT(IN), POINTER :: dielectric - TYPE(pw_r3d_type), INTENT(IN) :: v - TYPE(pw_r3d_type), INTENT(INOUT) :: density + TYPE(pw_r3d_rs_type), INTENT(IN) :: v + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: density CHARACTER(LEN=*), PARAMETER :: routineN = 'apply_poisson_operator_dct' INTEGER :: handle - TYPE(pw_r3d_type) :: Pxv + TYPE(pw_r3d_rs_type) :: Pxv CALL timeset(routineN, handle) - CALL pw_pool%create_pw(Pxv, in_space=REALSPACE) + CALL pw_pool%create_pw(Pxv) CALL apply_P_operator(pw_pool, dielectric, v, Pxv) CALL apply_laplace_operator_dct(pw_pool, green, v, density) @@ -1769,23 +1766,23 @@ SUBROUTINE ps_implicit_compute_veps(pw_pool, dielectric, v, v_eps) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(dielectric_type), INTENT(IN), POINTER :: dielectric - TYPE(pw_r3d_type), INTENT(IN) :: v - TYPE(pw_r3d_type), INTENT(INOUT) :: v_eps + TYPE(pw_r3d_rs_type), INTENT(IN) :: v + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_eps CHARACTER(LEN=*), PARAMETER :: routineN = 'ps_implicit_compute_veps' INTEGER :: handle, i REAL(dp) :: eightpi - TYPE(pw_r3d_type) :: dv2 - TYPE(pw_r3d_type), DIMENSION(3) :: dv + TYPE(pw_r3d_rs_type) :: dv2 + TYPE(pw_r3d_rs_type), DIMENSION(3) :: dv CALL timeset(routineN, handle) eightpi = 2*fourpi - CALL pw_pool%create_pw(dv2, in_space=REALSPACE) + CALL pw_pool%create_pw(dv2) DO i = 1, 3 - CALL pw_pool%create_pw(dv(i), in_space=REALSPACE) + CALL pw_pool%create_pw(dv(i)) END DO CALL derive_fft(v, dv, pw_pool) @@ -1815,7 +1812,7 @@ END SUBROUTINE ps_implicit_compute_veps ! ************************************************************************************************** SUBROUTINE compute_ehartree_periodic_bc(density, v, ehartree) - TYPE(pw_r3d_type), INTENT(IN) :: density, v + TYPE(pw_r3d_rs_type), INTENT(IN) :: density, v REAL(dp), INTENT(OUT) :: ehartree CHARACTER(LEN=*), PARAMETER :: routineN = 'compute_ehartree_periodic_bc' @@ -1847,10 +1844,10 @@ END SUBROUTINE compute_ehartree_periodic_bc SUBROUTINE compute_ehartree_mixed_bc(dielectric, density, Btxlambda, v, ehartree, electric_enthalpy) TYPE(dielectric_type), INTENT(IN), POINTER :: dielectric - TYPE(pw_r3d_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(IN) :: density REAL(dp), ALLOCATABLE, DIMENSION(:, :, :), & INTENT(IN) :: Btxlambda - TYPE(pw_r3d_type), INTENT(IN) :: v + TYPE(pw_r3d_rs_type), INTENT(IN) :: v REAL(dp), INTENT(OUT) :: ehartree, electric_enthalpy CHARACTER(LEN=*), PARAMETER :: routineN = 'compute_ehartree_mixed_bc' @@ -1901,8 +1898,8 @@ SUBROUTINE ps_implicit_compute_error_fft(pw_pool, green, res_new, v_old, v_new, TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green - TYPE(pw_r3d_type), INTENT(IN) :: res_new, v_old, v_new - TYPE(pw_r3d_type), INTENT(INOUT) :: QAinvxres_new + TYPE(pw_r3d_rs_type), INTENT(IN) :: res_new, v_old, v_new + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: QAinvxres_new REAL(dp), INTENT(OUT) :: pres_error, nabs_error CHARACTER(LEN=*), PARAMETER :: routineN = 'ps_implicit_compute_error_fft' @@ -1952,8 +1949,8 @@ SUBROUTINE ps_implicit_compute_error_dct(pw_pool, green, res_new, v_old, v_new, TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(greens_fn_type), INTENT(IN) :: green - TYPE(pw_r3d_type), INTENT(IN) :: res_new, v_old, v_new - TYPE(pw_r3d_type), INTENT(INOUT) :: QAinvxres_new + TYPE(pw_r3d_rs_type), INTENT(IN) :: res_new, v_old, v_new + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: QAinvxres_new REAL(dp), INTENT(OUT) :: pres_error, nabs_error CHARACTER(LEN=*), PARAMETER :: routineN = 'ps_implicit_compute_error_dct' diff --git a/src/pw/ps_implicit_types.F b/src/pw/ps_implicit_types.F index 09baed3186..de29b94359 100644 --- a/src/pw/ps_implicit_types.F +++ b/src/pw/ps_implicit_types.F @@ -22,7 +22,7 @@ MODULE ps_implicit_types dirichlet_bc_p_type USE kinds, ONLY: dp USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -47,9 +47,9 @@ MODULE ps_implicit_types LOGICAL :: do_dbc_cube = .FALSE. TYPE(dielectric_type), POINTER :: dielectric => NULL() TYPE(dct_type) :: dct_env = dct_type() - TYPE(pw_r3d_type), POINTER :: initial_guess => NULL() - TYPE(pw_r3d_type), POINTER :: v_eps => NULL() - TYPE(pw_r3d_type), POINTER :: cstr_charge => NULL() + TYPE(pw_r3d_rs_type), POINTER :: initial_guess => NULL() + TYPE(pw_r3d_rs_type), POINTER :: v_eps => NULL() + TYPE(pw_r3d_rs_type), POINTER :: cstr_charge => NULL() REAL(dp), DIMENSION(:), ALLOCATABLE :: initial_lambda REAL(dp) :: ehartree = 0.0_dp REAL(dp) :: electric_enthalpy = 0.0_dp diff --git a/src/pw/ps_wavelet_methods.F b/src/pw/ps_wavelet_methods.F index 85e97f6a9e..0601531ca5 100644 --- a/src/pw/ps_wavelet_methods.F +++ b/src/pw/ps_wavelet_methods.F @@ -26,7 +26,7 @@ MODULE ps_wavelet_methods S_FFT_dimensions USE pw_grid_types, ONLY: pw_grid_type USE pw_poisson_types, ONLY: pw_poisson_parameter_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE util, ONLY: get_limit #include "../base/base_uses.f90" @@ -167,7 +167,7 @@ END SUBROUTINE RS_z_slice_distribution ! ************************************************************************************************** SUBROUTINE cp2k_distribution_to_z_slices(density, wavelet, pw_grid) - TYPE(pw_r3d_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(IN) :: density TYPE(ps_wavelet_type), POINTER :: wavelet TYPE(pw_grid_type), POINTER :: pw_grid @@ -323,7 +323,7 @@ END SUBROUTINE cp2k_distribution_to_z_slices ! ************************************************************************************************** SUBROUTINE z_slices_to_cp2k_distribution(density, wavelet, pw_grid) - TYPE(pw_r3d_type), INTENT(IN) :: density + TYPE(pw_r3d_rs_type), INTENT(IN) :: density TYPE(ps_wavelet_type), POINTER :: wavelet TYPE(pw_grid_type), POINTER :: pw_grid diff --git a/src/pw/pw_copy_all.F b/src/pw/pw_copy_all.F index 68a7464422..f9e586a4ee 100644 --- a/src/pw/pw_copy_all.F +++ b/src/pw/pw_copy_all.F @@ -16,8 +16,7 @@ MODULE pw_copy_all USE kinds, ONLY: dp USE message_passing, ONLY: mp_comm_type USE pw_grid_types, ONLY: pw_grid_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type + USE pw_types, ONLY: pw_c1d_gs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -40,8 +39,8 @@ MODULE pw_copy_all !> \author JGH ! ************************************************************************************************** SUBROUTINE pw_copy_match(pw1, pw2) - TYPE(pw_c1d_type), INTENT(IN) :: pw1 - TYPE(pw_c1d_type), INTENT(INOUT) :: pw2 + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw1 + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw2 COMPLEX(KIND=dp), ALLOCATABLE, DIMENSION(:) :: cc INTEGER :: group_size, ig1, ig2, ip, jg2, me, ng1, & @@ -52,58 +51,52 @@ SUBROUTINE pw_copy_match(pw1, pw2) TYPE(mp_comm_type) :: group TYPE(pw_grid_type), POINTER :: pg1, pg2 - IF (pw1%in_space == RECIPROCALSPACE) THEN - - ng1 = SIZE(pw1%array) - ng2 = SIZE(pw2%array) - - pg1 => pw1%pw_grid - pg2 => pw2%pw_grid - - group = pg1%para%group - group_size = pg1%para%group_size - me = pg1%para%my_pos - ALLOCATE (ngr(group_size)) - ngr = 0 - ngr(me + 1) = pg1%ngpts_cut_local - CALL group%sum(ngr) - ngm = MAXVAL(ngr) - ALLOCATE (cc(ngm)) - cc(1:ng1) = pw1%array(1:ng1) - cc(ng1 + 1:ngm) = CMPLX(0.0_dp, 0.0_dp, KIND=dp) - - ALLOCATE (g_hat(3, ngm)) - g_hat = 0 - g_hat(1:3, 1:ng1) = pg1%g_hat(1:3, 1:ng1) - - DO ip = 1, group_size - penow = me - ip + 1 - IF (penow < 0) penow = penow + group_size - - DO ig1 = 1, ngr(penow + 1) - k1(1:3) = g_hat(1:3, ig1) - jg2 = 0 - DO ig2 = 1, ng2 - k2(1:3) = pg2%g_hat(1:3, ig2) - IF (SUM(ABS(k1 - k2)) == 0) THEN - jg2 = ig2 - EXIT - END IF - END DO - IF (jg2 /= 0) pw2%array(jg2) = cc(ig1) + ng1 = SIZE(pw1%array) + ng2 = SIZE(pw2%array) + + pg1 => pw1%pw_grid + pg2 => pw2%pw_grid + + group = pg1%para%group + group_size = pg1%para%group_size + me = pg1%para%my_pos + ALLOCATE (ngr(group_size)) + ngr = 0 + ngr(me + 1) = pg1%ngpts_cut_local + CALL group%sum(ngr) + ngm = MAXVAL(ngr) + ALLOCATE (cc(ngm)) + cc(1:ng1) = pw1%array(1:ng1) + cc(ng1 + 1:ngm) = CMPLX(0.0_dp, 0.0_dp, KIND=dp) + + ALLOCATE (g_hat(3, ngm)) + g_hat = 0 + g_hat(1:3, 1:ng1) = pg1%g_hat(1:3, 1:ng1) + + DO ip = 1, group_size + penow = me - ip + 1 + IF (penow < 0) penow = penow + group_size + + DO ig1 = 1, ngr(penow + 1) + k1(1:3) = g_hat(1:3, ig1) + jg2 = 0 + DO ig2 = 1, ng2 + k2(1:3) = pg2%g_hat(1:3, ig2) + IF (SUM(ABS(k1 - k2)) == 0) THEN + jg2 = ig2 + EXIT + END IF END DO - IF (ip /= group_size) THEN - CALL group%shift(cc) - CALL group%shift(g_hat) - END IF - + IF (jg2 /= 0) pw2%array(jg2) = cc(ig1) END DO + IF (ip /= group_size) THEN + CALL group%shift(cc) + CALL group%shift(g_hat) + END IF - DEALLOCATE (ngr, cc, g_hat) + END DO - ELSE - CPABORT("No suitable data field") - END IF + DEALLOCATE (ngr, cc, g_hat) END SUBROUTINE pw_copy_match diff --git a/src/pw/pw_gpu.F b/src/pw/pw_gpu.F index acf76b5e14..fa08cb7036 100644 --- a/src/pw/pw_gpu.F +++ b/src/pw/pw_gpu.F @@ -36,10 +36,8 @@ MODULE pw_gpu USE message_passing, ONLY: mp_cart_type,& mp_comm_type USE pw_grid_types, ONLY: FULLSPACE - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -103,8 +101,8 @@ END SUBROUTINE pw_gpu_finalize !> \author Benjamin G Levine ! ************************************************************************************************** SUBROUTINE pw_gpu_r3dc1d_3d(pw1, pw2, scale) - TYPE(pw_r3d_type), INTENT(IN) :: pw1 - TYPE(pw_c1d_type), INTENT(INOUT) :: pw2 + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw1 + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw2 REAL(KIND=dp), INTENT(IN) :: scale CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_r3dc1d_3d' @@ -129,9 +127,6 @@ END SUBROUTINE pw_gpu_cfffg_c CALL timeset(routineN, handle) - IF (pw2%in_space /= RECIPROCALSPACE) & - CPABORT("Grid 2 must be in reciprocal space!") - ngpts = SIZE(pw2%pw_grid%gsq) l1 = LBOUND(pw1%array, 1) l2 = LBOUND(pw1%array, 2) @@ -164,8 +159,8 @@ END SUBROUTINE pw_gpu_r3dc1d_3d !> \author Benjamin G Levine ! ************************************************************************************************** SUBROUTINE pw_gpu_c1dr3d_3d(pw1, pw2, scale) - TYPE(pw_c1d_type), INTENT(IN) :: pw1 - TYPE(pw_r3d_type), INTENT(INOUT) :: pw2 + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw1 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw2 REAL(KIND=dp), INTENT(IN) :: scale CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_c1dr3d_3d' @@ -189,9 +184,6 @@ END SUBROUTINE pw_gpu_sfffc_c CALL timeset(routineN, handle) - IF (pw2%in_space /= REALSPACE) & - CPABORT("Grid 2 must be in real space!") - ngpts = SIZE(pw1%pw_grid%gsq) l1 = LBOUND(pw2%array, 1) l2 = LBOUND(pw2%array, 2) @@ -225,8 +217,8 @@ END SUBROUTINE pw_gpu_c1dr3d_3d !> \author Andreas Gloess ! ************************************************************************************************** SUBROUTINE pw_gpu_r3dc1d_3d_ps(pw1, pw2, scale) - TYPE(pw_r3d_type), INTENT(IN) :: pw1 - TYPE(pw_c1d_type), INTENT(INOUT) :: pw2 + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw1 + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw2 REAL(KIND=dp), INTENT(IN) :: scale CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_r3dc1d_3d_ps' @@ -247,9 +239,6 @@ SUBROUTINE pw_gpu_r3dc1d_3d_ps(pw1, pw2, scale) CALL timeset(routineN, handle) - IF (pw2%in_space /= RECIPROCALSPACE) & - CPABORT("Grid 2 must be in reciprocal space!") - ! dimensions n => pw1%pw_grid%npts nloc => pw1%pw_grid%npts_local @@ -400,8 +389,8 @@ END SUBROUTINE pw_gpu_r3dc1d_3d_ps !> \author Andreas Gloess ! ************************************************************************************************** SUBROUTINE pw_gpu_c1dr3d_3d_ps(pw1, pw2, scale) - TYPE(pw_c1d_type), INTENT(IN) :: pw1 - TYPE(pw_r3d_type), INTENT(INOUT) :: pw2 + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw1 + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw2 REAL(KIND=dp), INTENT(IN) :: scale CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_c1dr3d_3d_ps' @@ -422,9 +411,6 @@ SUBROUTINE pw_gpu_c1dr3d_3d_ps(pw1, pw2, scale) CALL timeset(routineN, handle) - IF (pw2%in_space /= REALSPACE) & - CPABORT("Grid 2 must be in real space!") - ! dimensions n => pw1%pw_grid%npts nloc => pw1%pw_grid%npts_local @@ -578,7 +564,7 @@ END SUBROUTINE pw_gpu_c1dr3d_3d_ps !> \author Andreas Gloess ! ************************************************************************************************** SUBROUTINE pw_gpu_cff(pw1, pwbuf) - TYPE(pw_r3d_type), INTENT(IN) :: pw1 + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw1 COMPLEX(KIND=dp), DIMENSION(:, :, :), & INTENT(INOUT), TARGET :: pwbuf @@ -628,7 +614,7 @@ END SUBROUTINE pw_gpu_cff SUBROUTINE pw_gpu_ffc(pwbuf, pw2) COMPLEX(KIND=dp), DIMENSION(:, :, :), INTENT(IN), & TARGET :: pwbuf - TYPE(pw_r3d_type), INTENT(IN) :: pw2 + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw2 CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_ffc' @@ -674,7 +660,7 @@ END SUBROUTINE pw_gpu_ffc !> \author Andreas Gloess ! ************************************************************************************************** SUBROUTINE pw_gpu_cf(pw1, pwbuf) - TYPE(pw_r3d_type), INTENT(IN) :: pw1 + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw1 COMPLEX(KIND=dp), DIMENSION(:, :), INTENT(INOUT), & TARGET :: pwbuf @@ -723,7 +709,7 @@ END SUBROUTINE pw_gpu_cf SUBROUTINE pw_gpu_fc(pwbuf, pw2) COMPLEX(KIND=dp), DIMENSION(:, :), INTENT(IN), & TARGET :: pwbuf - TYPE(pw_r3d_type), INTENT(IN) :: pw2 + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw2 CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_fc' @@ -818,7 +804,7 @@ END SUBROUTINE pw_gpu_f SUBROUTINE pw_gpu_fg(pwbuf, pw2, scale) COMPLEX(KIND=dp), DIMENSION(:, :), INTENT(IN), & TARGET :: pwbuf - TYPE(pw_c1d_type), INTENT(IN) :: pw2 + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw2 REAL(KIND=dp), INTENT(IN) :: scale CHARACTER(len=*), PARAMETER :: routineN = 'pw_gpu_fg' @@ -876,7 +862,7 @@ END SUBROUTINE pw_gpu_fg !> \author Andreas Gloess ! ************************************************************************************************** SUBROUTINE pw_gpu_sf(pw1, pwbuf, scale) - TYPE(pw_c1d_type), INTENT(IN) :: pw1 + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw1 COMPLEX(KIND=dp), DIMENSION(:, :), INTENT(INOUT), & TARGET :: pwbuf REAL(KIND=dp), INTENT(IN) :: scale diff --git a/src/pw/pw_methods.F b/src/pw/pw_methods.F index 0cca52ed02..e7c285cc9e 100644 --- a/src/pw/pw_methods.F +++ b/src/pw/pw_methods.F @@ -23,7 +23,7 @@ !> \author apsi ! ************************************************************************************************** MODULE pw_methods - + #:include "pw_types.fypp" USE cp_log_handling, ONLY: cp_logger_get_default_io_unit, & cp_to_string USE fft_tools, ONLY: BWFFT, & @@ -48,14 +48,13 @@ MODULE pw_methods PW_MODE_DISTRIBUTED, & PW_MODE_LOCAL, & pw_grid_type - USE pw_types, ONLY: & - REALSPACE, & - RECIPROCALSPACE, & - pw_r3d_type, pw_r1d_type, pw_r3d_type, pw_c1d_type, pw_c3d_type + #:for space in pw_spaces + #:for kind in pw_kinds + USE pw_types, ONLY: pw_${kind}$_${space}$_type + #:endfor + #:endfor #include "../base/base_uses.f90" - #:include 'pw_types.fypp' - IMPLICIT NONE PRIVATE @@ -77,63 +76,83 @@ MODULE pw_methods do_standard_sum = 1 INTERFACE pw_zero - #:for kind in pw_kinds - MODULE PROCEDURE pw_zero_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_zero_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_scale - #:for kind in pw_kinds - MODULE PROCEDURE pw_scale_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_scale_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_write - #:for kind in pw_kinds - MODULE PROCEDURE pw_write_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_write_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_integrate_function - #:for kind in pw_kinds - MODULE PROCEDURE pw_integrate_function_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_integrate_function_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_set - #:for kind in pw_kinds - MODULE PROCEDURE pw_set_value_${kind}$ - MODULE PROCEDURE pw_zero_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_set_value_${kind}$_${space}$ + MODULE PROCEDURE pw_zero_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_copy - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_copy_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_copy_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_axpy - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_axpy_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_axpy_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_multiply - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_multiply_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_multiply_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_multiply_with - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_multiply_with_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_multiply_with_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_integral_ab - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_integral_ab_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_integral_ab_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE @@ -172,27 +191,36 @@ MODULE pw_methods END INTERFACE INTERFACE pw_copy_to_array - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_copy_to_array_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_copy_to_array_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_copy_from_array - #:for kind, kind2 in pw_kinds2_sameD - MODULE PROCEDURE pw_copy_from_array_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for kind, kind2 in pw_kinds2_sameD + MODULE PROCEDURE pw_copy_from_array_${kind}$_${kind2}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_transfer - #:for kind, kind2 in pw_kinds2 - MODULE PROCEDURE pw_transfer_${kind}$_${kind2}$ + #:for space in pw_spaces + #:for space2 in pw_spaces + #:for kind, kind2 in pw_kinds2 + #:if space==space2 or ((space=="rs" or kind[0]=="c") and (space2=="rs" or kind2[0]=="c") and (kind[1]=="3" or kind2[1]=="3")) + MODULE PROCEDURE pw_transfer_${kind}$_${kind2}$_${space}$_${space2}$ + #:endif + #:endfor + #:endfor #:endfor END INTERFACE CONTAINS - #:for kind, type in pw_list - + #:for space in pw_spaces ! ************************************************************************************************** !> \brief Set values of a pw type to zero !> \param pw ... @@ -200,23 +228,23 @@ MODULE pw_methods !> none !> \author apsi ! ************************************************************************************************** - SUBROUTINE pw_zero_${kind}$ (pw) + SUBROUTINE pw_zero_${kind}$_${space}$ (pw) - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw + TYPE(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw - CHARACTER(len=*), PARAMETER :: routineN = 'pw_zero' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_zero' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw) - pw%array = 0.0_dp + pw%array = 0.0_dp !$OMP END PARALLEL WORKSHARE - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_zero_${kind}$ + END SUBROUTINE pw_zero_${kind}$_${space}$ ! ************************************************************************************************** !> \brief multiplies pw coeffs with a number @@ -225,24 +253,24 @@ END SUBROUTINE pw_zero_${kind}$ !> \par History !> 11.2004 created [Joost VandeVondele] ! ************************************************************************************************** - SUBROUTINE pw_scale_${kind}$ (pw, a) + SUBROUTINE pw_scale_${kind}$_${space}$ (pw, a) - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw - REAL(KIND=dp), INTENT(IN) :: a + TYPE(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw + REAL(KIND=dp), INTENT(IN) :: a - CHARACTER(len=*), PARAMETER :: routineN = 'pw_scale' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_scale' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(A, pw) - pw%array = a*pw%array + pw%array = a*pw%array !$OMP END PARALLEL WORKSHARE - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_scale_${kind}$ + END SUBROUTINE pw_scale_${kind}$_${space}$ ! ************************************************************************************************** !> \brief writes a small description of the actual grid @@ -254,30 +282,30 @@ END SUBROUTINE pw_scale_${kind}$ !> 08.2002 created [fawzi] !> \author Fawzi Mohamed ! ************************************************************************************************** - SUBROUTINE pw_write_${kind}$ (pw, unit_nr) + SUBROUTINE pw_write_${kind}$_${space}$ (pw, unit_nr) - TYPE(pw_${kind}$_type), INTENT(in) :: pw - INTEGER, INTENT(in) :: unit_nr + TYPE(pw_${kind}$_${space}$_type), INTENT(in) :: pw + INTEGER, INTENT(in) :: unit_nr - INTEGER :: iostatus + INTEGER :: iostatus - WRITE (unit=unit_nr, fmt="(':{ ')", iostat=iostatus) + WRITE (unit=unit_nr, fmt="(':{ ')", iostat=iostatus) - WRITE (unit=unit_nr, fmt="(a)", iostat=iostatus) " in_use=${kind}$" - IF (ASSOCIATED(pw%array)) THEN - #:if kind[1]=='1' - WRITE (unit=unit_nr, fmt="(' array=<${kind[0]}$(',i8,':',i8,')>')") & - LBOUND(pw%array, 1), UBOUND(pw%array, 1) - #:else - WRITE (unit=unit_nr, fmt="(' array=<${kind[0]}$(',i8,':',i8,',',i8,':',i8,',',i8,':',i8,')>')") & - LBOUND(pw%array, 1), UBOUND(pw%array, 1), LBOUND(pw%array, 2), UBOUND(pw%array, 2), & - LBOUND(pw%array, 3), UBOUND(pw%array, 3) - #:endif - ELSE - WRITE (unit=unit_nr, fmt="(' array=*null*')") - END IF + WRITE (unit=unit_nr, fmt="(a)", iostat=iostatus) " in_use=${kind}$" + IF (ASSOCIATED(pw%array)) THEN + #:if kind[1]=='1' + WRITE (unit=unit_nr, fmt="(' array=<${kind[0]}$(',i8,':',i8,')>')") & + LBOUND(pw%array, 1), UBOUND(pw%array, 1) + #:else + WRITE (unit=unit_nr, fmt="(' array=<${kind[0]}$(',i8,':',i8,',',i8,':',i8,',',i8,':',i8,')>')") & + LBOUND(pw%array, 1), UBOUND(pw%array, 1), LBOUND(pw%array, 2), UBOUND(pw%array, 2), & + LBOUND(pw%array, 3), UBOUND(pw%array, 3) + #:endif + ELSE + WRITE (unit=unit_nr, fmt="(' array=*null*')") + END IF - END SUBROUTINE pw_write_${kind}$ + END SUBROUTINE pw_write_${kind}$_${space}$ ! ************************************************************************************************** !> \brief ... @@ -286,79 +314,80 @@ END SUBROUTINE pw_write_${kind}$ !> \param oprt ... !> \return ... ! ************************************************************************************************** - FUNCTION pw_integrate_function_${kind}$ (fun, isign, oprt) RESULT(total_fun) + FUNCTION pw_integrate_function_${kind}$_${space}$ (fun, isign, oprt) RESULT(total_fun) - TYPE(pw_${kind}$_type), INTENT(IN) :: fun - INTEGER, INTENT(IN), OPTIONAL :: isign - CHARACTER(len=*), INTENT(IN), OPTIONAL :: oprt - REAL(KIND=dp) :: total_fun + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: fun + INTEGER, INTENT(IN), OPTIONAL :: isign + CHARACTER(len=*), INTENT(IN), OPTIONAL :: oprt + REAL(KIND=dp) :: total_fun - INTEGER :: iop + INTEGER :: iop - iop = 0 + iop = 0 - IF (PRESENT(oprt)) THEN - SELECT CASE (oprt) - CASE ("ABS", "abs") - iop = 1 - CASE DEFAULT - CPABORT("Unknown operator") - END SELECT - END IF + IF (PRESENT(oprt)) THEN + SELECT CASE (oprt) + CASE ("ABS", "abs") + iop = 1 + CASE DEFAULT + CPABORT("Unknown operator") + END SELECT + END IF - total_fun = 0.0_dp + total_fun = 0.0_dp - IF (fun%in_space == REALSPACE) THEN - ! do reduction using maximum accuracy - IF (iop == 1) THEN - total_fun = fun%pw_grid%dvol*accurate_sum(ABS(fun%array)) - ELSE - total_fun = fun%pw_grid%dvol*accurate_sum(${type2type("fun%array", kind, "r1d")}$) - END IF - ELSE IF (fun%in_space == RECIPROCALSPACE) THEN - IF (iop == 1) & - CPABORT("Operator ABS not implemented") - #:if kind[1:]=="1d" - IF (fun%pw_grid%have_g0) total_fun = fun%pw_grid%vol*${type2type("fun%array(1)", kind, "r1d")}$ + #:if space == "rs" + ! do reduction using maximum accuracy + IF (iop == 1) THEN + total_fun = fun%pw_grid%dvol*accurate_sum(ABS(fun%array)) + ELSE + total_fun = fun%pw_grid%dvol*accurate_sum(${type2type("fun%array", kind, "r1d")}$) + END IF + #:elif space == "gs" + IF (iop == 1) & + CPABORT("Operator ABS not implemented") + #:if kind[1:]=="1d" + IF (fun%pw_grid%have_g0) total_fun = fun%pw_grid%vol*${type2type("fun%array(1)", kind, "r1d")}$ + #:else + CPABORT("Reciprocal space integration for 3D grids not implemented!") + #:endif #:else - CPABORT("Reciprocal space integration for 3D grids not implemented!") + CPABORT("No space defined") #:endif - ELSE - CPABORT("No space defined") - END IF - IF (fun%pw_grid%para%mode /= PW_MODE_LOCAL) THEN - CALL fun%pw_grid%para%group%sum(total_fun) - END IF + IF (fun%pw_grid%para%mode /= PW_MODE_LOCAL) THEN + CALL fun%pw_grid%para%group%sum(total_fun) + END IF - IF (PRESENT(isign)) THEN - total_fun = total_fun*SIGN(1._dp, REAL(isign, dp)) - END IF + IF (PRESENT(isign)) THEN + total_fun = total_fun*SIGN(1._dp, REAL(isign, dp)) + END IF - END FUNCTION pw_integrate_function_${kind}$ + END FUNCTION pw_integrate_function_${kind}$_${space}$ ! ************************************************************************************************** !> \brief ... !> \param pw ... !> \param value ... ! ************************************************************************************************** - SUBROUTINE pw_set_value_${kind}$ (pw, value) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw - REAL(KIND=dp), INTENT(IN) :: value + SUBROUTINE pw_set_value_${kind}$_${space}$ (pw, value) + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw + REAL(KIND=dp), INTENT(IN) :: value - CHARACTER(len=*), PARAMETER :: routineN = 'pw_set_value' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_set_value' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw,value) - pw%array = value + pw%array = value !$OMP END PARALLEL WORKSHARE - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_set_value_${kind}$ + END SUBROUTINE pw_set_value_${kind}$_${space}$ + #:endfor #:if kind[1]=="1" ! ************************************************************************************************** @@ -369,7 +398,7 @@ END SUBROUTINE pw_set_value_${kind}$ ! ************************************************************************************************** SUBROUTINE pw_gather_p_${kind}$ (pw, c, scale) - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw + TYPE(pw_${kind}$_gs_type), INTENT(INOUT) :: pw COMPLEX(KIND=dp), DIMENSION(:, :), CONTIGUOUS, INTENT(IN) :: c REAL(KIND=dp), INTENT(IN), OPTIONAL :: scale @@ -383,9 +412,6 @@ SUBROUTINE pw_gather_p_${kind}$ (pw, c, scale) CPABORT("This grid type is not distributed") END IF - IF (pw%in_space /= RECIPROCALSPACE) & - CPABORT("Grid mus be in reciprocal space!") - ASSOCIATE (mapl => pw%pw_grid%mapl%pos, mapm => pw%pw_grid%mapm%pos, mapn => pw%pw_grid%mapn%pos, & ngpts => SIZE(pw%pw_grid%gsq), ghat => pw%pw_grid%g_hat, yzq => pw%pw_grid%para%yzq) @@ -428,7 +454,7 @@ END SUBROUTINE pw_gather_p_${kind}$ !> \param scale ... ! ************************************************************************************************** SUBROUTINE pw_scatter_p_${kind}$ (pw, c, scale) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw + TYPE(pw_${kind}$_gs_type), INTENT(IN) :: pw COMPLEX(KIND=dp), DIMENSION(:, :), CONTIGUOUS, INTENT(INOUT) :: c REAL(KIND=dp), INTENT(IN), OPTIONAL :: scale @@ -438,10 +464,6 @@ SUBROUTINE pw_scatter_p_${kind}$ (pw, c, scale) CALL timeset(routineN, handle) - IF (pw%in_space /= RECIPROCALSPACE) THEN - CPABORT("Data has to be in RECIPROCALSPACE") - END IF - IF (pw%pw_grid%para%mode /= PW_MODE_DISTRIBUTED) THEN CPABORT("This grid type is not distributed") END IF @@ -519,6 +541,7 @@ END SUBROUTINE pw_scatter_p_${kind}$ #:endfor #:for kind, type, kind2, type2 in pw_list2_sameD + #:for space in pw_spaces ! ************************************************************************************************** !> \brief copy a pw type variable !> \param pw1 ... @@ -532,155 +555,155 @@ END SUBROUTINE pw_scatter_p_${kind}$ !> Currently only copying of respective types allowed, !> in order to avoid errors ! ************************************************************************************************** - SUBROUTINE pw_copy_${kind}$_${kind2}$ (pw1, pw2) + SUBROUTINE pw_copy_${kind}$_${kind2}$_${space}$ (pw1, pw2) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(INOUT) :: pw2 + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_${space}$_type), INTENT(INOUT) :: pw2 - CHARACTER(len=*), PARAMETER :: routineN = 'pw_copy' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_copy' - INTEGER :: handle - #:if kind[1:]=='1d' - INTEGER :: i, j, ng, ng1, ng2, ns - #:endif + INTEGER :: handle + #:if kind[1:]=='1d' + INTEGER :: i, j, ng, ng1, ng2, ns + #:endif - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - IF (pw1%in_space /= pw2%in_space) & - CPABORT("Both grids must be in the same space!") - IF (pw1%pw_grid%spherical .neqv. pw2%pw_grid%spherical) & - CPABORT("Both grids must be either spherical or non-spherical!") - IF (pw1%pw_grid%spherical .AND. .NOT. pw1%in_space == RECIPROCALSPACE) & - CPABORT("Spherical grids only exist in reciprocal space!") + IF (pw1%pw_grid%spherical .neqv. pw2%pw_grid%spherical) & + CPABORT("Both grids must be either spherical or non-spherical!") + #:if space != "gs" + IF (pw1%pw_grid%spherical) & + CPABORT("Spherical grids only exist in reciprocal space!") + #:endif - #:if kind[1]=='1' - IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN - IF (pw1%pw_grid%spherical .AND. pw2%pw_grid%spherical) THEN - IF (pw_compatible(pw1%pw_grid, pw2%pw_grid)) THEN - ng1 = SIZE(pw1%array) - ng2 = SIZE(pw2%array) - ng = MIN(ng1, ng2) + #:if kind[1]=='1' + IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN + IF (pw1%pw_grid%spherical .AND. pw2%pw_grid%spherical) THEN + IF (pw_compatible(pw1%pw_grid, pw2%pw_grid)) THEN + ng1 = SIZE(pw1%array) + ng2 = SIZE(pw2%array) + ng = MIN(ng1, ng2) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(ng, pw1, pw2) - pw2%array(1:ng) = ${type2type("pw1%array(1:ng)", kind, kind2)}$ + pw2%array(1:ng) = ${type2type("pw1%array(1:ng)", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - IF (ng2 > ng) THEN + IF (ng2 > ng) THEN !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(ng, ng2, pw2) - pw2%array(ng + 1:ng2) = CMPLX(0.0_dp, 0.0_dp, KIND=dp) + pw2%array(ng + 1:ng2) = CMPLX(0.0_dp, 0.0_dp, KIND=dp) !$OMP END PARALLEL WORKSHARE + END IF + ELSE + CPABORT("Copies between spherical grids require compatible grids!") END IF ELSE - CPABORT("Copies between spherical grids require compatible grids!") - END IF - ELSE - ng1 = SIZE(pw1%array) - ng2 = SIZE(pw2%array) - ns = 2*MAX(ng1, ng2) + ng1 = SIZE(pw1%array) + ng2 = SIZE(pw2%array) + ns = 2*MAX(ng1, ng2) - IF ((pw1%pw_grid%id_nr == pw2%pw_grid%reference)) THEN - IF (ng1 >= ng2) THEN + IF ((pw1%pw_grid%id_nr == pw2%pw_grid%reference)) THEN + IF (ng1 >= ng2) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng2, pw1, pw2) - DO i = 1, ng2 - j = pw2%pw_grid%gidx(i) - pw2%array(i) = ${type2type("pw1%array(j)", kind, kind2)}$ - END DO + DO i = 1, ng2 + j = pw2%pw_grid%gidx(i) + pw2%array(i) = ${type2type("pw1%array(j)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - ELSE - CALL pw_zero(pw2) + ELSE + CALL pw_zero(pw2) !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng1, pw1, pw2) - DO i = 1, ng1 - j = pw2%pw_grid%gidx(i) - pw2%array(j) = ${type2type("pw1%array(i)", kind, kind2)}$ - END DO + DO i = 1, ng1 + j = pw2%pw_grid%gidx(i) + pw2%array(j) = ${type2type("pw1%array(i)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - END IF - ELSE IF ((pw2%pw_grid%id_nr == pw1%pw_grid%reference)) THEN - IF (ng1 >= ng2) THEN + END IF + ELSE IF ((pw2%pw_grid%id_nr == pw1%pw_grid%reference)) THEN + IF (ng1 >= ng2) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng2, pw1, pw2) - DO i = 1, ng2 - j = pw1%pw_grid%gidx(i) - pw2%array(i) = ${type2type("pw1%array(j)", kind, kind2)}$ - END DO + DO i = 1, ng2 + j = pw1%pw_grid%gidx(i) + pw2%array(i) = ${type2type("pw1%array(j)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - ELSE - CALL pw_zero(pw2) + ELSE + CALL pw_zero(pw2) !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng1, pw1, pw2) - DO i = 1, ng1 - j = pw1%pw_grid%gidx(i) - pw2%array(j) = ${type2type("pw1%array(i)", kind, kind2)}$ - END DO + DO i = 1, ng1 + j = pw1%pw_grid%gidx(i) + pw2%array(j) = ${type2type("pw1%array(i)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO + END IF + ELSE + #:if kind=='c1d' and kind2=='c1d' and space=="gs" + CALL pw_copy_match(pw1, pw2) + #:else + CPABORT("Copy not implemented!") + #:endif END IF - ELSE - #:if kind=='c1d' and kind2=='c1d' - CALL pw_copy_match(pw1, pw2) - #:else - CPABORT("Copy not implemented!") - #:endif END IF - END IF - ELSE + ELSE !$OMP PARALLEL WORKSHARE PRIVATE(i) DEFAULT(NONE) SHARED(pw1, pw2) - pw2%array = ${type2type("pw1%array", kind, kind2)}$ + pw2%array = ${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - END IF - #:else - IF (ANY(SHAPE(pw2%array) /= SHAPE(pw1%array))) & - CPABORT("3D grids must be compatible!") - IF (pw1%pw_grid%spherical) & - CPABORT("3D grids must not be spherical!") + END IF + #:else + IF (ANY(SHAPE(pw2%array) /= SHAPE(pw1%array))) & + CPABORT("3D grids must be compatible!") + IF (pw1%pw_grid%spherical) & + CPABORT("3D grids must not be spherical!") !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw1,pw2) - pw2%array(:, :, :) = ${type2type("pw1%array(:, :, :)", kind, kind2)}$ + pw2%array(:, :, :) = ${type2type("pw1%array(:, :, :)", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - #:endif + #:endif - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_copy_${kind}$_${kind2}$ + END SUBROUTINE pw_copy_${kind}$_${kind2}$_${space}$ ! ************************************************************************************************** !> \brief ... !> \param pw ... !> \param array ... ! ************************************************************************************************** - SUBROUTINE pw_copy_to_array_${kind}$_${kind2}$ (pw, array) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw - ${type2}$, INTENT(INOUT) :: array + SUBROUTINE pw_copy_to_array_${kind}$_${kind2}$_${space}$ (pw, array) + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw + ${type2}$, INTENT(INOUT) :: array - CHARACTER(len=*), PARAMETER :: routineN = 'pw_copy_to_array' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_copy_to_array' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw, array) - array = ${type2type("pw%array", kind, kind2)}$ + array = ${type2type("pw%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - CALL timestop(handle) - END SUBROUTINE pw_copy_to_array_${kind}$_${kind2}$ + CALL timestop(handle) + END SUBROUTINE pw_copy_to_array_${kind}$_${kind2}$_${space}$ ! ************************************************************************************************** !> \brief ... !> \param pw ... !> \param array ... ! ************************************************************************************************** - SUBROUTINE pw_copy_from_array_${kind}$_${kind2}$ (pw, array) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw - ${type2}$, INTENT(IN) :: array + SUBROUTINE pw_copy_from_array_${kind}$_${kind2}$_${space}$ (pw, array) + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw + ${type2}$, INTENT(IN) :: array - CHARACTER(len=*), PARAMETER :: routineN = 'pw_copy_from_array' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_copy_from_array' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw, array) - pw%array = ${type2type("array", kind2, kind)}$ + pw%array = ${type2type("array", kind2, kind)}$ !$OMP END PARALLEL WORKSHARE - CALL timestop(handle) - END SUBROUTINE pw_copy_from_array_${kind}$_${kind2}$ + CALL timestop(handle) + END SUBROUTINE pw_copy_from_array_${kind}$_${kind2}$_${space}$ ! ************************************************************************************************** !> \brief pw2 = alpha*pw1 + beta*pw2 @@ -698,185 +721,185 @@ END SUBROUTINE pw_copy_from_array_${kind}$_${kind2}$ !> Currently only summing up of respective types allowed, !> in order to avoid errors ! ************************************************************************************************** - SUBROUTINE pw_axpy_${kind}$_${kind2}$ (pw1, pw2, alpha, beta, allow_noncompatible_grids) + SUBROUTINE pw_axpy_${kind}$_${kind2}$_${space}$ (pw1, pw2, alpha, beta, allow_noncompatible_grids) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(INOUT) :: pw2 - REAL(KIND=dp), INTENT(in), OPTIONAL :: alpha, beta - LOGICAL, INTENT(IN), OPTIONAL :: allow_noncompatible_grids + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_${space}$_type), INTENT(INOUT) :: pw2 + REAL(KIND=dp), INTENT(in), OPTIONAL :: alpha, beta + LOGICAL, INTENT(IN), OPTIONAL :: allow_noncompatible_grids - CHARACTER(len=*), PARAMETER :: routineN = 'pw_axpy' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_axpy' - INTEGER :: handle - LOGICAL :: my_allow_noncompatible_grids - REAL(KIND=dp) :: my_alpha, my_beta - #:if kind[1]=='1' - INTEGER :: i, j, ng, ng1, ng2 - #:endif + INTEGER :: handle + LOGICAL :: my_allow_noncompatible_grids + REAL(KIND=dp) :: my_alpha, my_beta + #:if kind[1]=='1' + INTEGER :: i, j, ng, ng1, ng2 + #:endif - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - my_alpha = 1.0_dp - IF (PRESENT(alpha)) my_alpha = alpha + my_alpha = 1.0_dp + IF (PRESENT(alpha)) my_alpha = alpha - my_beta = 1.0_dp - IF (PRESENT(beta)) my_beta = beta + my_beta = 1.0_dp + IF (PRESENT(beta)) my_beta = beta - my_allow_noncompatible_grids = .FALSE. - IF (PRESENT(allow_noncompatible_grids)) my_allow_noncompatible_grids = allow_noncompatible_grids + my_allow_noncompatible_grids = .FALSE. + IF (PRESENT(allow_noncompatible_grids)) my_allow_noncompatible_grids = allow_noncompatible_grids - IF (my_beta /= 1.0_dp) THEN - IF (my_beta == 0.0_dp) THEN - CALL pw_zero(pw2) - ELSE + IF (my_beta /= 1.0_dp) THEN + IF (my_beta == 0.0_dp) THEN + CALL pw_zero(pw2) + ELSE !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw2,my_beta) - pw2%array = pw2%array*my_beta + pw2%array = pw2%array*my_beta !$OMP END PARALLEL WORKSHARE + END IF END IF - END IF - #:if kind[1]=='1' - IF (ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN + #:if kind[1]=='1' + IF (ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN - IF (my_alpha == 1.0_dp) THEN + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL WORKSHARE PRIVATE(i) DEFAULT(NONE) SHARED(pw1, pw2) - pw2%array = pw2%array + ${type2type("pw1%array", kind, kind2)}$ + pw2%array = pw2%array + ${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - ELSE IF (my_alpha /= 0.0_dp) THEN + ELSE IF (my_alpha /= 0.0_dp) THEN !$OMP PARALLEL WORKSHARE PRIVATE(i) DEFAULT(NONE) SHARED(pw2,pw1,my_alpha) - pw2%array = pw2%array + my_alpha*${type2type("pw1%array", kind, kind2)}$ + pw2%array = pw2%array + my_alpha*${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - END IF - - ELSE IF (pw_compatible(pw1%pw_grid, pw2%pw_grid) .OR. my_allow_noncompatible_grids) THEN + END IF - ng1 = SIZE(pw1%array) - ng2 = SIZE(pw2%array) - ng = MIN(ng1, ng2) + ELSE IF (pw_compatible(pw1%pw_grid, pw2%pw_grid) .OR. my_allow_noncompatible_grids) THEN - IF (pw1%pw_grid%spherical) THEN - IF (my_alpha == 1.0_dp) THEN -!$OMP PARALLEL DO PRIVATE(i) DEFAULT(NONE) SHARED(ng, pw1, pw2) - DO i = 1, ng - pw2%array(i) = pw2%array(i) + ${type2type("pw1%array(i)", kind, kind2)}$ - END DO -!$OMP END PARALLEL DO - ELSE IF (my_alpha /= 0.0_dp) THEN -!$OMP PARALLEL DO PRIVATE(i) DEFAULT(NONE) SHARED(pw2,pw1,my_alpha,ng) - DO i = 1, ng - pw2%array(i) = pw2%array(i) + my_alpha*${type2type("pw1%array(i)", kind, kind2)}$ - END DO -!$OMP END PARALLEL DO - END IF + ng1 = SIZE(pw1%array) + ng2 = SIZE(pw2%array) + ng = MIN(ng1, ng2) - ELSE IF ((pw1%pw_grid%id_nr == pw2%pw_grid%reference)) THEN - IF (ng1 >= ng2) THEN + IF (pw1%pw_grid%spherical) THEN IF (my_alpha == 1.0_dp) THEN -!$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng, pw1, pw2) +!$OMP PARALLEL DO PRIVATE(i) DEFAULT(NONE) SHARED(ng, pw1, pw2) DO i = 1, ng - j = pw2%pw_grid%gidx(i) - pw2%array(i) = pw2%array(i) + ${type2type("pw1%array(j)", kind, kind2)}$ + pw2%array(i) = pw2%array(i) + ${type2type("pw1%array(i)", kind, kind2)}$ END DO !$OMP END PARALLEL DO ELSE IF (my_alpha /= 0.0_dp) THEN -!$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(my_alpha, ng, pw1, pw2) +!$OMP PARALLEL DO PRIVATE(i) DEFAULT(NONE) SHARED(pw2,pw1,my_alpha,ng) DO i = 1, ng - j = pw2%pw_grid%gidx(i) - pw2%array(i) = pw2%array(i) + my_alpha*${type2type("pw1%array(j)", kind, kind2)}$ + pw2%array(i) = pw2%array(i) + my_alpha*${type2type("pw1%array(i)", kind, kind2)}$ END DO !$OMP END PARALLEL DO END IF - ELSE - IF (my_alpha == 1.0_dp) THEN + + ELSE IF ((pw1%pw_grid%id_nr == pw2%pw_grid%reference)) THEN + IF (ng1 >= ng2) THEN + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng, pw1, pw2) - DO i = 1, ng - j = pw2%pw_grid%gidx(i) - pw2%array(j) = pw2%array(j) + ${type2type("pw1%array(i)", kind, kind2)}$ - END DO + DO i = 1, ng + j = pw2%pw_grid%gidx(i) + pw2%array(i) = pw2%array(i) + ${type2type("pw1%array(j)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - ELSE IF (my_alpha /= 0.0_dp) THEN + ELSE IF (my_alpha /= 0.0_dp) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(my_alpha, ng, pw1, pw2) - DO i = 1, ng - j = pw2%pw_grid%gidx(i) - pw2%array(j) = pw2%array(j) + my_alpha*${type2type("pw1%array(i)", kind, kind2)}$ - END DO + DO i = 1, ng + j = pw2%pw_grid%gidx(i) + pw2%array(i) = pw2%array(i) + my_alpha*${type2type("pw1%array(j)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - END IF - END IF - ELSE IF ((pw2%pw_grid%id_nr == pw1%pw_grid%reference)) THEN - IF (ng1 >= ng2) THEN - IF (my_alpha == 1.0_dp) THEN + END IF + ELSE + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng, pw1, pw2) - DO i = 1, ng - j = pw1%pw_grid%gidx(i) - pw2%array(i) = pw2%array(i) + ${type2type("pw1%array(j)", kind, kind2)}$ - END DO + DO i = 1, ng + j = pw2%pw_grid%gidx(i) + pw2%array(j) = pw2%array(j) + ${type2type("pw1%array(i)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - ELSE IF (my_alpha /= 0.0_dp) THEN + ELSE IF (my_alpha /= 0.0_dp) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(my_alpha, ng, pw1, pw2) - DO i = 1, ng - j = pw1%pw_grid%gidx(i) - pw2%array(i) = pw2%array(i) + my_alpha*${type2type("pw1%array(j)", kind, kind2)}$ - END DO + DO i = 1, ng + j = pw2%pw_grid%gidx(i) + pw2%array(j) = pw2%array(j) + my_alpha*${type2type("pw1%array(i)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO + END IF END IF - ELSE - IF (my_alpha == 1.0_dp) THEN + ELSE IF ((pw2%pw_grid%id_nr == pw1%pw_grid%reference)) THEN + IF (ng1 >= ng2) THEN + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng, pw1, pw2) - DO i = 1, ng - j = pw1%pw_grid%gidx(i) - pw2%array(j) = pw2%array(j) + ${type2type("pw1%array(i)", kind, kind2)}$ - END DO + DO i = 1, ng + j = pw1%pw_grid%gidx(i) + pw2%array(i) = pw2%array(i) + ${type2type("pw1%array(j)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO - ELSE IF (my_alpha /= 0.0_dp) THEN + ELSE IF (my_alpha /= 0.0_dp) THEN !$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(my_alpha, ng, pw1, pw2) - DO i = 1, ng - j = pw1%pw_grid%gidx(i) - pw2%array(j) = pw2%array(j) + my_alpha*${type2type("pw1%array(i)", kind, kind2)}$ - END DO + DO i = 1, ng + j = pw1%pw_grid%gidx(i) + pw2%array(i) = pw2%array(i) + my_alpha*${type2type("pw1%array(j)", kind, kind2)}$ + END DO +!$OMP END PARALLEL DO + END IF + ELSE + IF (my_alpha == 1.0_dp) THEN +!$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(ng, pw1, pw2) + DO i = 1, ng + j = pw1%pw_grid%gidx(i) + pw2%array(j) = pw2%array(j) + ${type2type("pw1%array(i)", kind, kind2)}$ + END DO +!$OMP END PARALLEL DO + ELSE IF (my_alpha /= 0.0_dp) THEN +!$OMP PARALLEL DO PRIVATE(i,j) DEFAULT(NONE) SHARED(my_alpha, ng, pw1, pw2) + DO i = 1, ng + j = pw1%pw_grid%gidx(i) + pw2%array(j) = pw2%array(j) + my_alpha*${type2type("pw1%array(i)", kind, kind2)}$ + END DO !$OMP END PARALLEL DO + END IF END IF + ELSE + CPABORT("Grids not compatible") END IF - ELSE - CPABORT("Grids not compatible") - END IF - #:else - IF (ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN - IF (my_alpha == 1.0_dp) THEN + #:else + IF (ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw1, pw2) - pw2%array = pw2%array + ${type2type("pw1%array", kind, kind2)}$ + pw2%array = pw2%array + ${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - ELSE IF (my_alpha /= 0.0_dp) THEN + ELSE IF (my_alpha /= 0.0_dp) THEN !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw1, pw2, my_alpha) - pw2%array = pw2%array + my_alpha*${type2type("pw1%array", kind, kind2)}$ + pw2%array = pw2%array + my_alpha*${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - END IF + END IF - ELSE IF (pw_compatible(pw1%pw_grid, pw2%pw_grid) .OR. my_allow_noncompatible_grids) THEN + ELSE IF (pw_compatible(pw1%pw_grid, pw2%pw_grid) .OR. my_allow_noncompatible_grids) THEN - IF (ANY(SHAPE(pw1%array) /= SHAPE(pw2%array))) & - CPABORT("Noncommensurate grids not implemented for 3D grids!") + IF (ANY(SHAPE(pw1%array) /= SHAPE(pw2%array))) & + CPABORT("Noncommensurate grids not implemented for 3D grids!") - IF (my_alpha == 1.0_dp) THEN + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw1,pw2) - pw2%array = pw2%array + ${type2type("pw1%array", kind, kind2)}$ + pw2%array = pw2%array + ${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - ELSE + ELSE !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw1,pw2,my_alpha) - pw2%array = pw2%array + my_alpha*${type2type("pw1%array", kind, kind2)}$ + pw2%array = pw2%array + my_alpha*${type2type("pw1%array", kind, kind2)}$ !$OMP END PARALLEL WORKSHARE - END IF - #:endif + END IF + #:endif - ELSE + ELSE - CPABORT("Grids not compatible") + CPABORT("Grids not compatible") - END IF + END IF - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_axpy_${kind}$_${kind2}$ + END SUBROUTINE pw_axpy_${kind}$_${kind2}$_${space}$ ! ************************************************************************************************** !> \brief pw_out = pw_out + alpha * pw1 * pw2 @@ -887,67 +910,65 @@ END SUBROUTINE pw_axpy_${kind}$_${kind2}$ !> \param alpha ... !> \author JGH ! ************************************************************************************************** - SUBROUTINE pw_multiply_${kind}$_${kind2}$ (pw_out, pw1, pw2, alpha) + SUBROUTINE pw_multiply_${kind}$_${kind2}$_${space}$ (pw_out, pw1, pw2, alpha) - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw_out - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(IN) :: pw2 - REAL(KIND=dp), INTENT(IN), OPTIONAL :: alpha + TYPE(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw_out + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_${space}$_type), INTENT(IN) :: pw2 + REAL(KIND=dp), INTENT(IN), OPTIONAL :: alpha - CHARACTER(len=*), PARAMETER :: routineN = 'pw_multiply' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_multiply' - INTEGER :: handle - REAL(KIND=dp) :: my_alpha + INTEGER :: handle + REAL(KIND=dp) :: my_alpha - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - my_alpha = 1.0_dp - IF (PRESENT(alpha)) my_alpha = alpha + my_alpha = 1.0_dp + IF (PRESENT(alpha)) my_alpha = alpha - IF (.NOT. ASSOCIATED(pw_out%pw_grid, pw1%pw_grid) .OR. .NOT. ASSOCIATED(pw_out%pw_grid, pw2%pw_grid)) & - CPABORT("pw_multiply not implemented for non-identical grids!") + IF (.NOT. ASSOCIATED(pw_out%pw_grid, pw1%pw_grid) .OR. .NOT. ASSOCIATED(pw_out%pw_grid, pw2%pw_grid)) & + CPABORT("pw_multiply not implemented for non-identical grids!") - IF (my_alpha == 1.0_dp) THEN + IF (my_alpha == 1.0_dp) THEN !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw_out, pw1, pw2) - pw_out%array = pw_out%array + pw1%array*${type2type("pw2%array", kind2, kind)}$ + pw_out%array = pw_out%array + pw1%array*${type2type("pw2%array", kind2, kind)}$ !$OMP END PARALLEL WORKSHARE - ELSE + ELSE !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(my_alpha, pw_out, pw1, pw2) - pw_out%array = pw_out%array + my_alpha*pw1%array*${type2type("pw2%array", kind2, kind)}$ + pw_out%array = pw_out%array + my_alpha*pw1%array*${type2type("pw2%array", kind2, kind)}$ !$OMP END PARALLEL WORKSHARE - END IF + END IF - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_multiply_${kind}$_${kind2}$ + END SUBROUTINE pw_multiply_${kind}$_${kind2}$_${space}$ ! ************************************************************************************************** !> \brief ... !> \param pw1 ... !> \param pw2 ... ! ************************************************************************************************** - SUBROUTINE pw_multiply_with_${kind}$_${kind2}$ (pw1, pw2) - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(IN) :: pw2 + SUBROUTINE pw_multiply_with_${kind}$_${kind2}$_${space}$ (pw1, pw2) + TYPE(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw1 + TYPE(pw_${kind2}$_${space}$_type), INTENT(IN) :: pw2 - CHARACTER(LEN=*), PARAMETER :: routineN = 'pw_multiply_with' + CHARACTER(LEN=*), PARAMETER :: routineN = 'pw_multiply_with' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - IF (pw1%in_space /= pw2%in_space) & - CPABORT("Invalid space combination!") - IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) & - CPABORT("Incompatible grids!") + IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) & + CPABORT("Incompatible grids!") !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw1,pw2) - pw1%array = pw1%array*${type2type("pw2%array", kind2, kind)}$ + pw1%array = pw1%array*${type2type("pw2%array", kind2, kind)}$ !$OMP END PARALLEL WORKSHARE - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_multiply_with_${kind}$_${kind2}$ + END SUBROUTINE pw_multiply_with_${kind}$_${kind2}$_${space}$ ! ************************************************************************************************** !> \brief Calculate integral over unit cell for functions in plane wave basis @@ -962,149 +983,153 @@ END SUBROUTINE pw_multiply_with_${kind}$_${kind2}$ !> JGH (14-Mar-2001) : Parallel sum and some tests, HALFSPACE case !> \author apsi ! ************************************************************************************************** - FUNCTION pw_integral_ab_${kind}$_${kind2}$ (pw1, pw2, sumtype, just_sum, local_only) RESULT(integral_value) + FUNCTION pw_integral_ab_${kind}$_${kind2}$_${space}$ (pw1, pw2, sumtype, just_sum, local_only) RESULT(integral_value) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(IN) :: pw2 - INTEGER, INTENT(IN), OPTIONAL :: sumtype - LOGICAL, INTENT(IN), OPTIONAL :: just_sum, local_only - REAL(KIND=dp) :: integral_value + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_${space}$_type), INTENT(IN) :: pw2 + INTEGER, INTENT(IN), OPTIONAL :: sumtype + LOGICAL, INTENT(IN), OPTIONAL :: just_sum, local_only + REAL(KIND=dp) :: integral_value - CHARACTER(len=*), PARAMETER :: routineN = 'pw_integral_ab' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_integral_ab' - INTEGER :: handle, loc_sumtype - LOGICAL :: my_just_sum, my_local_only + INTEGER :: handle, loc_sumtype + LOGICAL :: my_just_sum, my_local_only - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - loc_sumtype = do_accurate_sum - IF (PRESENT(sumtype)) loc_sumtype = sumtype + loc_sumtype = do_accurate_sum + IF (PRESENT(sumtype)) loc_sumtype = sumtype - my_local_only = .FALSE. - IF (PRESENT(local_only)) my_local_only = local_only + my_local_only = .FALSE. + IF (PRESENT(local_only)) my_local_only = local_only - IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN - CPABORT("Grids incompatible") - END IF + IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN + CPABORT("Grids incompatible") + END IF - my_just_sum = .FALSE. - IF (PRESENT(just_sum)) my_just_sum = just_sum - - ! do standard sum - IF (loc_sumtype == do_standard_sum) THEN - - ! Do standard sum - - #:if kind=="r1d" and kind2=="r1d" - integral_value = DOT_PRODUCT(pw1%array, pw2%array) - #:elif kind=="r3d" and kind2=="r3d" - integral_value = SUM(pw1%array*pw2%array) - #:elif kind[0]=="r" - integral_value = SUM(pw1%array*REAL(pw2%array, KIND=dp)) !? complex bit - #:elif kind2[0]=="r" - integral_value = SUM(REAL(pw1%array, KIND=dp)*pw2%array) !? complex bit - #:else - integral_value = SUM(REAL(CONJG(pw1%array) & - *pw2%array, KIND=dp)) !? complex bit - #:endif + my_just_sum = .FALSE. + IF (PRESENT(just_sum)) my_just_sum = just_sum - ELSE + ! do standard sum + IF (loc_sumtype == do_standard_sum) THEN - ! Do accurate sum - #:if kind[0]=="r" and kind2[0]=="r" - integral_value = accurate_dot_product(pw1%array, pw2%array) - #:elif kind=="r3d" and kind2=="r3d" - integral_value = accurate_sum(pw1%array*pw2%array) !? complex bit - #:elif kind[0]=="r" - integral_value = accurate_sum(pw1%array*REAL(pw2%array, KIND=dp)) !? complex bit - #:elif kind2[0]=="r" - integral_value = accurate_sum(REAL(pw1%array, KIND=dp)*pw2%array) !? complex bit - #:else - integral_value = accurate_sum(REAL(CONJG(pw1%array) & - *pw2%array, KIND=dp)) !? complex bit - #:endif + ! Do standard sum - END IF + #:if kind=="r1d" and kind2=="r1d" + integral_value = DOT_PRODUCT(pw1%array, pw2%array) + #:elif kind=="r3d" and kind2=="r3d" + integral_value = SUM(pw1%array*pw2%array) + #:elif kind[0]=="r" + integral_value = SUM(pw1%array*REAL(pw2%array, KIND=dp)) !? complex bit + #:elif kind2[0]=="r" + integral_value = SUM(REAL(pw1%array, KIND=dp)*pw2%array) !? complex bit + #:else + integral_value = SUM(REAL(CONJG(pw1%array) & + *pw2%array, KIND=dp)) !? complex bit + #:endif - IF (.NOT. my_just_sum) THEN - IF (pw1%in_space == REALSPACE) THEN - integral_value = integral_value*pw1%pw_grid%dvol ELSE - integral_value = integral_value*pw1%pw_grid%vol + + ! Do accurate sum + #:if kind[0]=="r" and kind2[0]=="r" + integral_value = accurate_dot_product(pw1%array, pw2%array) + #:elif kind=="r3d" and kind2=="r3d" + integral_value = accurate_sum(pw1%array*pw2%array) !? complex bit + #:elif kind[0]=="r" + integral_value = accurate_sum(pw1%array*REAL(pw2%array, KIND=dp)) !? complex bit + #:elif kind2[0]=="r" + integral_value = accurate_sum(REAL(pw1%array, KIND=dp)*pw2%array) !? complex bit + #:else + integral_value = accurate_sum(REAL(CONJG(pw1%array) & + *pw2%array, KIND=dp)) !? complex bit + #:endif + END IF - END IF - #:if kind[1]=="1" - IF (pw1%pw_grid%grid_span == HALFSPACE) THEN - integral_value = 2.0_dp*integral_value - IF (pw1%pw_grid%have_g0) integral_value = integral_value - & + IF (.NOT. my_just_sum) THEN + #:if space == "rs" + integral_value = integral_value*pw1%pw_grid%dvol + #:elif space == "gs" + integral_value = integral_value*pw1%pw_grid%vol + #:else + #:stop "Unknown space: "+space + #:endif + END IF + + #:if kind[1]=="1" + IF (pw1%pw_grid%grid_span == HALFSPACE) THEN + integral_value = 2.0_dp*integral_value + IF (pw1%pw_grid%have_g0) integral_value = integral_value - & #:if kind[0]=="c" - REAL(CONJG(pw1%array(1))*pw2%array(1), KIND=dp) - #:elif kind2[0]=="r" - pw1%array(1)*pw2%array(1) - #:else - pw1%array(1)*REAL(pw2%array(1), KIND=dp) - #:endif - END IF - #:endif + REAL(CONJG(pw1%array(1))*pw2%array(1), KIND=dp) + #:elif kind2[0]=="r" + pw1%array(1)*pw2%array(1) + #:else + pw1%array(1)*REAL(pw2%array(1), KIND=dp) + #:endif + END IF + #:endif - IF (.NOT. my_local_only .AND. pw1%pw_grid%para%mode == PW_MODE_DISTRIBUTED) & - CALL pw1%pw_grid%para%group%sum(integral_value) - CALL timestop(handle) + IF (.NOT. my_local_only .AND. pw1%pw_grid%para%mode == PW_MODE_DISTRIBUTED) & + CALL pw1%pw_grid%para%group%sum(integral_value) + CALL timestop(handle) - END FUNCTION pw_integral_ab_${kind}$_${kind2}$ + END FUNCTION pw_integral_ab_${kind}$_${kind2}$_${space}$ + #:endfor - #:if kind[1]=="1" + #:if kind[1]=="1" ! ************************************************************************************************** !> \brief ... !> \param pw1 ... !> \param pw2 ... !> \return ... ! ************************************************************************************************** - FUNCTION pw_integral_a2b_${kind}$_${kind2}$ (pw1, pw2) RESULT(integral_value) + FUNCTION pw_integral_a2b_${kind}$_${kind2}$ (pw1, pw2) RESULT(integral_value) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(IN) :: pw2 - REAL(KIND=dp) :: integral_value + TYPE(pw_${kind}$_gs_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_gs_type), INTENT(IN) :: pw2 + REAL(KIND=dp) :: integral_value - CHARACTER(len=*), PARAMETER :: routineN = 'pw_integral_a2b' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_integral_a2b' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN - CPABORT("Grids incompatible") - END IF - IF (pw1%in_space /= RECIPROCALSPACE .OR. pw2%in_space /= RECIPROCALSPACE) & - CPABORT("Grids must be in reciprocal space!") + IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN + CPABORT("Grids incompatible") + END IF - #:if kind[0]=="c" - #:if kind2[0]=="c" - integral_value = accurate_sum(REAL(CONJG(pw1%array)*pw2%array, KIND=dp)*pw1%pw_grid%gsq) + #:if kind[0]=="c" + #:if kind2[0]=="c" + integral_value = accurate_sum(REAL(CONJG(pw1%array)*pw2%array, KIND=dp)*pw1%pw_grid%gsq) + #:else + integral_value = accurate_sum(REAL(CONJG(pw1%array), KIND=dp)*pw2%array*pw1%pw_grid%gsq) + #:endif + #:elif kind2[0]=="c" + integral_value = accurate_sum(pw1%array*REAL(pw2%array, KIND=dp)*pw1%pw_grid%gsq) #:else - integral_value = accurate_sum(REAL(CONJG(pw1%array), KIND=dp)*pw2%array*pw1%pw_grid%gsq) + integral_value = accurate_sum(pw1%array*pw2%array*pw1%pw_grid%gsq) #:endif - #:elif kind2[0]=="c" - integral_value = accurate_sum(pw1%array*REAL(pw2%array, KIND=dp)*pw1%pw_grid%gsq) - #:else - integral_value = accurate_sum(pw1%array*pw2%array*pw1%pw_grid%gsq) - #:endif - IF (pw1%pw_grid%grid_span == HALFSPACE) THEN - integral_value = 2.0_dp*integral_value - END IF + IF (pw1%pw_grid%grid_span == HALFSPACE) THEN + integral_value = 2.0_dp*integral_value + END IF - integral_value = integral_value*pw1%pw_grid%vol + integral_value = integral_value*pw1%pw_grid%vol - IF (pw1%pw_grid%para%mode == PW_MODE_DISTRIBUTED) & - CALL pw1%pw_grid%para%group%sum(integral_value) - CALL timestop(handle) + IF (pw1%pw_grid%para%mode == PW_MODE_DISTRIBUTED) & + CALL pw1%pw_grid%para%group%sum(integral_value) + CALL timestop(handle) - END FUNCTION pw_integral_a2b_${kind}$_${kind2}$ - #:endif + END FUNCTION pw_integral_a2b_${kind}$_${kind2}$ + #:endif #:endfor #:for kind, type, kind2, type2 in pw_list2 + #:for space in pw_spaces + #:for space2 in pw_spaces + #:if space==space2 or ((space=="rs" or kind[0]=="c") and (space2=="rs" or kind2[0]=="c") and (kind[1]=="3" or kind2[1]=="3")) ! ************************************************************************************************** !> \brief Generalize copy of pw types !> \param pw1 ... @@ -1116,59 +1141,64 @@ END FUNCTION pw_integral_a2b_${kind}$_${kind2}$ !> \note !> Copy routine that allows for in_space changes ! ************************************************************************************************** - SUBROUTINE pw_transfer_${kind}$_${kind2}$ (pw1, pw2, debug) - - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(INOUT) :: pw2 - LOGICAL, INTENT(IN), OPTIONAL :: debug - - CHARACTER(len=*), PARAMETER :: routineN = 'pw_transfer' + SUBROUTINE pw_transfer_${kind}$_${kind2}$_${space}$_${space2}$ (pw1, pw2, debug) - INTEGER :: handle + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_${space2}$_type), INTENT(INOUT) :: pw2 + LOGICAL, INTENT(IN), OPTIONAL :: debug - CALL timeset(routineN, handle) - !sample peak memory - CALL m_memory() + CHARACTER(len=*), PARAMETER :: routineN = 'pw_transfer' - IF (pw1%in_space == REALSPACE .AND. pw2%in_space == REALSPACE) THEN + INTEGER :: handle - ! simple copy should do - #:if kind[1:]==kind2[1:] - CALL pw_copy_${kind}$_${kind2}$ (pw1, pw2) - #:else - CPABORT("Type combinatipn not supported!") - #:endif - - ELSE IF (pw1%in_space == RECIPROCALSPACE .AND. & - pw2%in_space == RECIPROCALSPACE) THEN - - #:if kind[1:]==kind2[1:] +! Some combinations are not implemented, so we mark them as used in any case (we are just lazy) + MARK_USED(pw1) + MARK_USED(pw2) - ! simple copy should do - CALL pw_copy_${kind}$_${kind2}$ (pw1, pw2) + CALL timeset(routineN, handle) + !sample peak memory + CALL m_memory() + + #:if space == "rs" and space2 == "rs" + MARK_USED(debug) + ! simple copy should do + #:if kind[1:]==kind2[1:] + CALL pw_copy_${kind}$_${kind2}$_rs(pw1, pw2) + #:else + CPABORT("Type combinatipn not supported!") + #:endif + #:elif space == "gs" and space2=="gs" + MARK_USED(debug) - #:elif kind[1]=="1" + #:if kind[1:]==kind2[1:] - CALL pw_scatter_s_${kind}$_${kind2}$ (pw1, pw2%array) - #:elif kind2[1]=="1" - CALL pw_gather_s_${kind2}$_${kind}$ (pw2, pw1%array) - #:else - CPABORT("Do not know what to do") - #:endif + ! simple copy should do + CALL pw_copy_${kind}$_${kind2}$_gs(pw1, pw2) - ELSE + #:elif kind[1]=="1" and kind2[1]=="3" + CALL pw_scatter_s_${kind}$_${kind2}$ (pw1, pw2%array) + #:elif kind2[1]=="1" and kind[1]=="3" + CALL pw_gather_s_${kind2}$_${kind}$ (pw2, pw1%array) + #:else + CPABORT("Do not know what to do") + #:endif - ! FFT needed, all further tests done in fft_wrap_pw1pw2 - CALL fft_wrap_pw1pw2_${kind}$_${kind2}$ (pw1, pw2, debug) + #:elif (space=="rs" or kind[0]=="c") and (space2=="rs" or kind2[0]=="c") and (kind[1]=="3" or kind2[1]=="3") - END IF + ! FFT needed, all further tests done in fft_wrap_pw1pw2 + CALL fft_wrap_pw1pw2_${kind}$_${kind2}$_${space}$_${space2}$ (pw1, pw2, debug) + #:else + CPABORT("NIY") + #:endif - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_transfer_${kind}$_${kind2}$ + END SUBROUTINE pw_transfer_${kind}$_${kind2}$_${space}$_${space2}$ + #:endif + #:if space != space2 and (space=="rs" or kind[0]=="c") and (space2=="rs" or kind2[0]=="c") and kind[1]=="3" or kind2[1]=="3" ! ************************************************************************************************** -!> \brief Generic function for 3d FFT of a coefficient_type or pw_r3d_type +!> \brief Generic function for 3d FFT of a coefficient_type or pw_r3d_rs_type !> \param pw1 ... !> \param pw2 ... !> \param debug ... @@ -1180,342 +1210,336 @@ END SUBROUTINE pw_transfer_${kind}$_${kind2}$ !> \note !> fft_wrap_pw1pw2 ! ************************************************************************************************** - SUBROUTINE fft_wrap_pw1pw2_${kind}$_${kind2}$ (pw1, pw2, debug) + SUBROUTINE fft_wrap_pw1pw2_${kind}$_${kind2}$_${space}$_${space2}$ (pw1, pw2, debug) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw1 - TYPE(pw_${kind2}$_type), INTENT(INOUT) :: pw2 - LOGICAL, INTENT(IN), OPTIONAL :: debug + TYPE(pw_${kind}$_${space}$_type), INTENT(IN) :: pw1 + TYPE(pw_${kind2}$_${space2}$_type), INTENT(INOUT) :: pw2 + LOGICAL, INTENT(IN), OPTIONAL :: debug - CHARACTER(len=*), PARAMETER :: routineN = 'fft_wrap_pw1pw2' + CHARACTER(len=*), PARAMETER :: routineN = 'fft_wrap_pw1pw2' - COMPLEX(KIND=dp), DIMENSION(:, :), CONTIGUOUS, POINTER :: grays - COMPLEX(KIND=dp), DIMENSION(:, :, :), CONTIGUOUS, POINTER :: c_in, c_out - INTEGER :: dir, handle, handle2, my_pos, nrays, & - out_space, out_unit - #:if (kind=="r3d" and kind2=="c1d") or (kind=="c1d" and kind2=="r3d") - INTEGER, DIMENSION(3) :: nloc - #:endif - INTEGER, DIMENSION(:), POINTER :: n - LOGICAL :: test + COMPLEX(KIND=dp), DIMENSION(:, :), CONTIGUOUS, POINTER :: grays + COMPLEX(KIND=dp), DIMENSION(:, :, :), CONTIGUOUS, POINTER :: c_in, c_out + INTEGER :: handle, handle2, my_pos, nrays, & + out_unit + #:if (space=="rs" and kind=="r3d" and kind2=="c1d") or (space=="gs" and kind=="c1d" and kind2=="r3d") + INTEGER, DIMENSION(3) :: nloc + #:endif + INTEGER, DIMENSION(:), POINTER :: n + LOGICAL :: test #if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) - LOGICAL :: use_pw_gpu + LOGICAL :: use_pw_gpu #endif - REAL(KIND=dp) :: norm - - CALL timeset(routineN, handle2) - out_unit = cp_logger_get_default_io_unit() - CALL timeset(routineN//"_"//TRIM(ADJUSTL(cp_to_string( & - CEILING(pw1%pw_grid%cutoff/10)*10))), handle) + REAL(KIND=dp) :: norm - NULLIFY (c_in) - NULLIFY (c_out) + CALL timeset(routineN, handle2) + out_unit = cp_logger_get_default_io_unit() + CALL timeset(routineN//"_"//TRIM(ADJUSTL(cp_to_string( & + CEILING(pw1%pw_grid%cutoff/10)*10))), handle) - IF (PRESENT(debug)) THEN - test = debug - ELSE - test = .FALSE. - END IF + NULLIFY (c_in) + NULLIFY (c_out) - !..check if grids are compatible - IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN - IF (pw1%pw_grid%dvol /= pw2%pw_grid%dvol) THEN - CPABORT("PW grids not compatible") - END IF - IF (pw1%pw_grid%para%group /= pw2%pw_grid%para%group) THEN - CPABORT("PW grids have not compatible MPI groups") - END IF - END IF + IF (PRESENT(debug)) THEN + test = debug + ELSE + test = .FALSE. + END IF - !..prepare input - IF (pw1%in_space == REALSPACE) THEN - dir = FWFFT - norm = 1.0_dp/pw1%pw_grid%ngpts - out_space = RECIPROCALSPACE - ELSE IF (pw1%in_space == RECIPROCALSPACE) THEN - dir = BWFFT - norm = 1.0_dp - out_space = REALSPACE - ELSE - CPABORT("Error in space tag") - END IF + !..check if grids are compatible + IF (.NOT. ASSOCIATED(pw1%pw_grid, pw2%pw_grid)) THEN + IF (pw1%pw_grid%dvol /= pw2%pw_grid%dvol) THEN + CPABORT("PW grids not compatible") + END IF + IF (pw1%pw_grid%para%group /= pw2%pw_grid%para%group) THEN + CPABORT("PW grids have not compatible MPI groups") + END IF + END IF - n => pw1%pw_grid%npts - - IF (pw1%pw_grid%para%mode == PW_MODE_LOCAL) THEN - - ! - !..replicated data, use local FFT - ! - - IF (test .AND. out_unit > 0) THEN - WRITE (out_unit, '(A)') " FFT Protocol " - IF (dir == FWFFT) WRITE (out_unit, '(A,T76,A)') " Transform direction ", "FWFFT" - IF (dir == BWFFT) WRITE (out_unit, '(A,T76,A)') " Transform direction ", "BWFFT" - IF (pw1%in_space == REALSPACE) & - WRITE (out_unit, '(A,T72,A)') " in space ", "REALSPACE" - IF (pw1%in_space == RECIPROCALSPACE) & - WRITE (out_unit, '(A,T66,A)') " in space ", "RECIPROCALSPACE" - IF (out_space == REALSPACE) & - WRITE (out_unit, '(A,T72,A)') " out space ", "REALSPACE" - IF (out_space == RECIPROCALSPACE) & - WRITE (out_unit, '(A,T66,A)') " out space ", "RECIPROCALSPACE" - WRITE (out_unit, '(A,T66,E15.6)') " scale factor", norm - END IF + !..prepare input + #:if space == "rs" + norm = 1.0_dp/pw1%pw_grid%ngpts + #:elif space == "gs" + norm = 1.0_dp + #:else + #:stop "Unknown space tag: "+space + #:endif + + n => pw1%pw_grid%npts + + IF (pw1%pw_grid%para%mode == PW_MODE_LOCAL) THEN + + ! + !..replicated data, use local FFT + ! + + IF (test .AND. out_unit > 0) THEN + WRITE (out_unit, '(A)') " FFT Protocol " + #:if space=="rs" + WRITE (out_unit, '(A,T76,A)') " Transform direction ", "FWFFT" + WRITE (out_unit, '(A,T72,A)') " in space ", "REALSPACE" + WRITE (out_unit, '(A,T72,A)') " out space ", "REALSPACE" + #:else + WRITE (out_unit, '(A,T76,A)') " Transform direction ", "BWFFT" + WRITE (out_unit, '(A,T66,A)') " in space ", "RECIPROCALSPACE" + WRITE (out_unit, '(A,T66,A)') " out space ", "RECIPROCALSPACE" + #:endif + WRITE (out_unit, '(A,T66,E15.6)') " scale factor", norm + END IF - IF (dir == FWFFT) THEN - #:if kind==kind2=="c3d" - c_in => pw1%array - c_out => pw2%array - CALL fft3d(dir, n, c_in, c_out, scale=norm, debug=test) - #:elif kind=="r3d" and kind2=="c3d" - pw2%array = CMPLX(pw1%array, 0.0_dp, KIND=dp) - c_out => pw2%array - CALL fft3d(dir, n, c_out, scale=norm, debug=test) - #:elif kind=="c3d" and kind2=="c1d" - c_in => pw1%array - ALLOCATE (c_out(n(1), n(2), n(3))) - ! transform - CALL fft3d(dir, n, c_in, c_out, scale=norm, debug=test) - ! gather results - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_GATHER : 3d -> 1d " - CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) - DEALLOCATE (c_out) - #:elif kind=="r3d" and kind2=="c1d" + #:if space=="rs" + #:if kind==kind2=="c3d" + c_in => pw1%array + c_out => pw2%array + CALL fft3d(FWFFT, n, c_in, c_out, scale=norm, debug=test) + #:elif kind=="r3d" and kind2=="c3d" + pw2%array = CMPLX(pw1%array, 0.0_dp, KIND=dp) + c_out => pw2%array + CALL fft3d(FWFFT, n, c_out, scale=norm, debug=test) + #:elif kind=="c3d" and kind2=="c1d" + c_in => pw1%array + ALLOCATE (c_out(n(1), n(2), n(3))) + ! transform + CALL fft3d(FWFFT, n, c_in, c_out, scale=norm, debug=test) + ! gather results + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_GATHER : 3d -> 1d " + CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) + DEALLOCATE (c_out) + #:elif kind=="r3d" and kind2=="c1d" #if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) - CALL pw_gpu_r3dc1d_3d(pw1, pw2, scale=norm) + CALL pw_gpu_r3dc1d_3d(pw1, pw2, scale=norm) #elif defined (__PW_FPGA) - ALLOCATE (c_out(n(1), n(2), n(3))) - ! check if bitstream for the fft size is present - ! if not, perform fft3d in CPU - IF (pw_fpga_init_bitstream(n) == 1) THEN - CALL pw_copy_to_array(pw1, c_out) + ALLOCATE (c_out(n(1), n(2), n(3))) + ! check if bitstream for the fft size is present + ! if not, perform fft3d in CPU + IF (pw_fpga_init_bitstream(n) == 1) THEN + CALL pw_copy_to_array(pw1, c_out) #if (__PW_FPGA_SP && __PW_FPGA) - CALL pw_fpga_r3dc1d_3d_sp(n, c_out) + CALL pw_fpga_r3dc1d_3d_sp(n, c_out) #else - CALL pw_fpga_r3dc1d_3d_dp(n, c_out) + CALL pw_fpga_r3dc1d_3d_dp(n, c_out) #endif - CALL zdscal(n(1)*n(2)*n(3), norm, c_out, 1) - CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) - ELSE - CALL pw_copy_to_array(pw1, c_out) - CALL fft3d(dir, n, c_out, scale=norm, debug=test) - CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) - END IF - DEALLOCATE (c_out) + CALL zdscal(n(1)*n(2)*n(3), norm, c_out, 1) + CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) + ELSE + CALL pw_copy_to_array(pw1, c_out) + CALL fft3d(FWFFT, n, c_out, scale=norm, debug=test) + CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) + END IF + DEALLOCATE (c_out) #else - ALLOCATE (c_out(n(1), n(2), n(3))) - CALL pw_copy_to_array(pw1, c_out) - CALL fft3d(dir, n, c_out, scale=norm, debug=test) - CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) - DEALLOCATE (c_out) + ALLOCATE (c_out(n(1), n(2), n(3))) + CALL pw_copy_to_array(pw1, c_out) + CALL fft3d(FWFFT, n, c_out, scale=norm, debug=test) + CALL pw_gather_s_${kind2}$_c3d(pw2, c_out) + DEALLOCATE (c_out) #endif - #:endif - ELSE - #:if kind=="c3d" and kind2=="c3d" - c_in => pw1%array - c_out => pw2%array - CALL fft3d(dir, n, c_in, c_out, scale=norm, debug=test) - #:elif kind=="c3d" and kind2=="r3d" - c_in => pw1%array - ALLOCATE (c_out(n(1), n(2), n(3))) - CALL fft3d(dir, n, c_in, c_out, scale=norm, debug=test) - ! use real part only - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " REAL part " - pw2%array = REAL(c_out, KIND=dp) - DEALLOCATE (c_out) - #:elif kind=="c1d" and kind2=="c3d" - c_out => pw2%array - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_SCATTER : 3d -> 1d " - CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) - CALL fft3d(dir, n, c_out, scale=norm, debug=test) - #:elif kind=="c1d" and kind2=="r3d" + #:endif + #:else + #:if kind=="c3d" and kind2=="c3d" + c_in => pw1%array + c_out => pw2%array + CALL fft3d(BWFFT, n, c_in, c_out, scale=norm, debug=test) + #:elif kind=="c3d" and kind2=="r3d" + c_in => pw1%array + ALLOCATE (c_out(n(1), n(2), n(3))) + CALL fft3d(BWFFT, n, c_in, c_out, scale=norm, debug=test) + ! use real part only + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " REAL part " + pw2%array = REAL(c_out, KIND=dp) + DEALLOCATE (c_out) + #:elif kind=="c1d" and kind2=="c3d" + c_out => pw2%array + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_SCATTER : 3d -> 1d " + CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) + CALL fft3d(BWFFT, n, c_out, scale=norm, debug=test) + #:elif kind=="c1d" and kind2=="r3d" #if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) - CALL pw_gpu_c1dr3d_3d(pw1, pw2, scale=norm) + CALL pw_gpu_c1dr3d_3d(pw1, pw2, scale=norm) #elif defined (__PW_FPGA) - ALLOCATE (c_out(n(1), n(2), n(3))) - ! check if bitstream for the fft size is present - ! if not, perform fft3d in CPU - IF (pw_fpga_init_bitstream(n) == 1) THEN - CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) - ! transform using FPGA + ALLOCATE (c_out(n(1), n(2), n(3))) + ! check if bitstream for the fft size is present + ! if not, perform fft3d in CPU + IF (pw_fpga_init_bitstream(n) == 1) THEN + CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) + ! transform using FPGA #if (__PW_FPGA_SP && __PW_FPGA) - CALL pw_fpga_c1dr3d_3d_sp(n, c_out) + CALL pw_fpga_c1dr3d_3d_sp(n, c_out) #else - CALL pw_fpga_c1dr3d_3d_dp(n, c_out) + CALL pw_fpga_c1dr3d_3d_dp(n, c_out) #endif - CALL zdscal(n(1)*n(2)*n(3), norm, c_out, 1) - ! use real part only - CALL pw_copy_from_array(pw2, c_out) - ELSE - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_SCATTER : 3d -> 1d " - CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) - ! transform - CALL fft3d(dir, n, c_out, scale=norm, debug=test) - ! use real part only - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " REAL part " - CALL pw_copy_from_array(pw2, c_out) - END IF - DEALLOCATE (c_out) + CALL zdscal(n(1)*n(2)*n(3), norm, c_out, 1) + ! use real part only + CALL pw_copy_from_array(pw2, c_out) + ELSE + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_SCATTER : 3d -> 1d " + CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) + ! transform + CALL fft3d(BWFFT, n, c_out, scale=norm, debug=test) + ! use real part only + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " REAL part " + CALL pw_copy_from_array(pw2, c_out) + END IF + DEALLOCATE (c_out) #else - ALLOCATE (c_out(n(1), n(2), n(3))) - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_SCATTER : 3d -> 1d " - CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) - ! transform - CALL fft3d(dir, n, c_out, scale=norm, debug=test) - ! use real part only - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " REAL part " - CALL pw_copy_from_array(pw2, c_out) - DEALLOCATE (c_out) + ALLOCATE (c_out(n(1), n(2), n(3))) + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " PW_SCATTER : 3d -> 1d " + CALL pw_scatter_s_${kind}$_c3d(pw1, c_out) + ! transform + CALL fft3d(BWFFT, n, c_out, scale=norm, debug=test) + ! use real part only + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " REAL part " + CALL pw_copy_from_array(pw2, c_out) + DEALLOCATE (c_out) #endif - #:endif - END IF - - IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " End of FFT Protocol " - - ELSE - - ! - !..parallel FFT - ! - - IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) THEN - WRITE (out_unit, '(A)') " FFT Protocol " - IF (dir == FWFFT) WRITE (out_unit, '(A,T76,A)') " Transform direction ", "FWFFT" - IF (dir == BWFFT) WRITE (out_unit, '(A,T76,A)') " Transform direction ", "BWFFT" - IF (pw1%in_space == REALSPACE) & - WRITE (out_unit, '(A,T72,A)') " in space ", "REALSPACE" - IF (pw1%in_space == RECIPROCALSPACE) & - WRITE (out_unit, '(A,T66,A)') " in space ", "RECIPROCALSPACE" - IF (out_space == REALSPACE) & - WRITE (out_unit, '(A,T72,A)') " out space ", "REALSPACE" - IF (out_space == RECIPROCALSPACE) & - WRITE (out_unit, '(A,T66,A)') " out space ", "RECIPROCALSPACE" - WRITE (out_unit, '(A,T66,E15.6)') " scale factor", norm - END IF + #:endif + #:endif - my_pos = pw1%pw_grid%para%my_pos - nrays = pw1%pw_grid%para%nyzray(my_pos) - grays => pw1%pw_grid%grays - !CPASSERT(SIZE(grays, 1) == n(1)) - !CPASSERT(SIZE(grays, 2) == nrays) + IF (test .AND. out_unit > 0) WRITE (out_unit, '(A)') " End of FFT Protocol " - IF (dir == FWFFT) THEN - #:if kind=="c3d" and kind2=="c1d" - !..prepare input - c_in => pw1%array - grays = z_zero - !..transform - IF (pw1%pw_grid%para%ray_distribution) THEN - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%group, & - pw1%pw_grid%para%rs_group, & - pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & - pw1%pw_grid%para%bo, scale=norm, debug=test) - ELSE - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%rs_group, & - pw1%pw_grid%para%bo, scale=norm, debug=test) - END IF - !..prepare output - IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & - WRITE (out_unit, '(A)') " PW_GATHER : 2d -> 1d " - CALL pw_gather_p_${kind2}$ (pw2, grays) - #:elif kind=="r3d" and kind2=="c1d" -#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) - ! (no ray dist. is not efficient in CUDA) - use_pw_gpu = pw1%pw_grid%para%ray_distribution - IF (use_pw_gpu) THEN - CALL pw_gpu_r3dc1d_3d_ps(pw1, pw2, scale=norm) ELSE -#endif -!.. prepare input - nloc = pw1%pw_grid%npts_local - ALLOCATE (c_in(nloc(1), nloc(2), nloc(3))) - CALL pw_copy_to_array(pw1, c_in) - grays = z_zero - !..transform - IF (pw1%pw_grid%para%ray_distribution) THEN - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%group, & - pw1%pw_grid%para%rs_group, & - pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & - pw1%pw_grid%para%bo, scale=norm, debug=test) - ELSE - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%rs_group, & - pw1%pw_grid%para%bo, scale=norm, debug=test) - END IF - !..prepare output - IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & - WRITE (out_unit, '(A)') " PW_GATHER : 2d -> 1d " - CALL pw_gather_p_${kind2}$ (pw2, grays) - DEALLOCATE (c_in) - #:endif -#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) + ! + !..parallel FFT + ! + + IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) THEN + WRITE (out_unit, '(A)') " FFT Protocol " + #:if space=="rs" + WRITE (out_unit, '(A,T76,A)') " Transform direction ", "FWFFT" + WRITE (out_unit, '(A,T72,A)') " in space ", "REALSPACE" + WRITE (out_unit, '(A,T72,A)') " out space ", "REALSPACE" + #:else + WRITE (out_unit, '(A,T76,A)') " Transform direction ", "BWFFT" + WRITE (out_unit, '(A,T66,A)') " in space ", "RECIPROCALSPACE" + WRITE (out_unit, '(A,T66,A)') " out space ", "RECIPROCALSPACE" + #:endif + WRITE (out_unit, '(A,T66,E15.6)') " scale factor", norm END IF -#endif - ELSE - #:if kind=="c1d" and kind2=="c3d" - !..prepare input - IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & - WRITE (out_unit, '(A)') " PW_SCATTER : 2d -> 1d " - grays = z_zero - CALL pw_scatter_p_${kind}$ (pw1, grays) - c_in => pw2%array - !..transform - IF (pw1%pw_grid%para%ray_distribution) THEN - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%group, & - pw1%pw_grid%para%rs_group, & - pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & - pw1%pw_grid%para%bo, scale=norm, debug=test) - ELSE - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%rs_group, & - pw1%pw_grid%para%bo, scale=norm, debug=test) - END IF - !..prepare output (nothing to do) - #:elif kind=="c1d" and kind2=="r3d" -#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) - ! (no ray dist. is not efficient in CUDA) - use_pw_gpu = pw1%pw_grid%para%ray_distribution - IF (use_pw_gpu) THEN - CALL pw_gpu_c1dr3d_3d_ps(pw1, pw2, scale=norm) - ELSE -#endif -!.. prepare input - IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & - WRITE (out_unit, '(A)') " PW_SCATTER : 2d -> 1d " + + my_pos = pw1%pw_grid%para%my_pos + nrays = pw1%pw_grid%para%nyzray(my_pos) + grays => pw1%pw_grid%grays + + #:if space=="rs" + #:if kind=="c3d" and kind2=="c1d" + !..prepare input + c_in => pw1%array grays = z_zero - CALL pw_scatter_p_${kind}$ (pw1, grays) - nloc = pw2%pw_grid%npts_local - ALLOCATE (c_in(nloc(1), nloc(2), nloc(3))) !..transform IF (pw1%pw_grid%para%ray_distribution) THEN - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%group, & + CALL fft3d(FWFFT, n, c_in, grays, pw1%pw_grid%para%group, & pw1%pw_grid%para%rs_group, & pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & pw1%pw_grid%para%bo, scale=norm, debug=test) ELSE - CALL fft3d(dir, n, c_in, grays, pw1%pw_grid%para%rs_group, & + CALL fft3d(FWFFT, n, c_in, grays, pw1%pw_grid%para%rs_group, & pw1%pw_grid%para%bo, scale=norm, debug=test) END IF !..prepare output IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & - WRITE (out_unit, '(A)') " Real part " - CALL pw_copy_from_array(pw2, c_in) - DEALLOCATE (c_in) + WRITE (out_unit, '(A)') " PW_GATHER : 2d -> 1d " + CALL pw_gather_p_${kind2}$ (pw2, grays) + #:elif kind=="r3d" and kind2=="c1d" #if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) - END IF + ! (no ray dist. is not efficient in CUDA) + use_pw_gpu = pw1%pw_grid%para%ray_distribution + IF (use_pw_gpu) THEN + CALL pw_gpu_r3dc1d_3d_ps(pw1, pw2, scale=norm) + ELSE #endif - #:endif - END IF +!.. prepare input + nloc = pw1%pw_grid%npts_local + ALLOCATE (c_in(nloc(1), nloc(2), nloc(3))) + CALL pw_copy_to_array(pw1, c_in) + grays = z_zero + !..transform + IF (pw1%pw_grid%para%ray_distribution) THEN + CALL fft3d(FWFFT, n, c_in, grays, pw1%pw_grid%para%group, & + pw1%pw_grid%para%rs_group, & + pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & + pw1%pw_grid%para%bo, scale=norm, debug=test) + ELSE + CALL fft3d(FWFFT, n, c_in, grays, pw1%pw_grid%para%rs_group, & + pw1%pw_grid%para%bo, scale=norm, debug=test) + END IF + !..prepare output + IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & + WRITE (out_unit, '(A)') " PW_GATHER : 2d -> 1d " + CALL pw_gather_p_${kind2}$ (pw2, grays) + DEALLOCATE (c_in) + #:endif - END IF +#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) + END IF +#endif + #:else + #:if kind=="c1d" and kind2=="c3d" + !..prepare input + IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & + WRITE (out_unit, '(A)') " PW_SCATTER : 2d -> 1d " + grays = z_zero + CALL pw_scatter_p_${kind}$ (pw1, grays) + c_in => pw2%array + !..transform + IF (pw1%pw_grid%para%ray_distribution) THEN + CALL fft3d(BWFFT, n, c_in, grays, pw1%pw_grid%para%group, & + pw1%pw_grid%para%rs_group, & + pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & + pw1%pw_grid%para%bo, scale=norm, debug=test) + ELSE + CALL fft3d(BWFFT, n, c_in, grays, pw1%pw_grid%para%rs_group, & + pw1%pw_grid%para%bo, scale=norm, debug=test) + END IF + !..prepare output (nothing to do) + #:elif kind=="c1d" and kind2=="r3d" +#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) + ! (no ray dist. is not efficient in CUDA) + use_pw_gpu = pw1%pw_grid%para%ray_distribution + IF (use_pw_gpu) THEN + CALL pw_gpu_c1dr3d_3d_ps(pw1, pw2, scale=norm) + ELSE +#endif +!.. prepare input + IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & + WRITE (out_unit, '(A)') " PW_SCATTER : 2d -> 1d " + grays = z_zero + CALL pw_scatter_p_${kind}$ (pw1, grays) + nloc = pw2%pw_grid%npts_local + ALLOCATE (c_in(nloc(1), nloc(2), nloc(3))) + !..transform + IF (pw1%pw_grid%para%ray_distribution) THEN + CALL fft3d(BWFFT, n, c_in, grays, pw1%pw_grid%para%group, & + pw1%pw_grid%para%rs_group, & + pw1%pw_grid%para%yzp, pw1%pw_grid%para%nyzray, & + pw1%pw_grid%para%bo, scale=norm, debug=test) + ELSE + CALL fft3d(BWFFT, n, c_in, grays, pw1%pw_grid%para%rs_group, & + pw1%pw_grid%para%bo, scale=norm, debug=test) + END IF + !..prepare output + IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) & + WRITE (out_unit, '(A)') " Real part " + CALL pw_copy_from_array(pw2, c_in) + DEALLOCATE (c_in) +#if defined(__OFFLOAD) && !defined(__NO_OFFLOAD_PW) + END IF +#endif + #:endif + #:endif + END IF - IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) THEN - WRITE (out_unit, '(A)') " End of FFT Protocol " - END IF + IF (test .AND. pw1%pw_grid%para%group_head .AND. out_unit > 0) THEN + WRITE (out_unit, '(A)') " End of FFT Protocol " + END IF - CALL timestop(handle) - CALL timestop(handle2) + CALL timestop(handle) + CALL timestop(handle2) - END SUBROUTINE fft_wrap_pw1pw2_${kind}$_${kind2}$ + END SUBROUTINE fft_wrap_pw1pw2_${kind}$_${kind2}$_${space}$_${space2}$ + #:endif + #:endfor + #:endfor #:if kind[1]=='1' and kind2[1]=='3' ! ************************************************************************************************** @@ -1529,7 +1553,7 @@ END SUBROUTINE fft_wrap_pw1pw2_${kind}$_${kind2}$ ! ************************************************************************************************** SUBROUTINE pw_gather_s_${kind}$_${kind2}$ (pw, c, scale) - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw + TYPE(pw_${kind}$_gs_type), INTENT(INOUT) :: pw ${type2}$, CONTIGUOUS, INTENT(IN) :: c REAL(KIND=dp), INTENT(IN), OPTIONAL :: scale @@ -1539,9 +1563,6 @@ SUBROUTINE pw_gather_s_${kind}$_${kind2}$ (pw, c, scale) CALL timeset(routineN, handle) - IF (pw%in_space /= RECIPROCALSPACE) & - CPABORT("Grid has to be in reciprocal space!") - ASSOCIATE (mapl => pw%pw_grid%mapl%pos, mapm => pw%pw_grid%mapm%pos, mapn => pw%pw_grid%mapn%pos, & ngpts => SIZE(pw%pw_grid%gsq), ghat => pw%pw_grid%g_hat) @@ -1582,7 +1603,7 @@ END SUBROUTINE pw_gather_s_${kind}$_${kind2}$ ! ************************************************************************************************** SUBROUTINE pw_scatter_s_${kind}$_${kind2}$ (pw, c, scale) - TYPE(pw_${kind}$_type), INTENT(IN) :: pw + TYPE(pw_${kind}$_gs_type), INTENT(IN) :: pw ${type2}$, CONTIGUOUS, INTENT(INOUT) :: c REAL(KIND=dp), INTENT(IN), OPTIONAL :: scale @@ -1592,10 +1613,6 @@ SUBROUTINE pw_scatter_s_${kind}$_${kind2}$ (pw, c, scale) CALL timeset(routineN, handle) - IF (pw%in_space /= RECIPROCALSPACE) THEN - CPABORT("Data has to be in RECIPROCALSPACE") - END IF - ASSOCIATE (mapl => pw%pw_grid%mapl%pos, mapm => pw%pw_grid%mapm%pos, mapn => pw%pw_grid%mapn%pos, & ghat => pw%pw_grid%g_hat, ngpts => SIZE(pw%pw_grid%gsq)) @@ -1671,11 +1688,10 @@ END SUBROUTINE pw_scatter_s_${kind}$_${kind2}$ !> \author Frederick Stein (12-Apr-2019) !> \note !> Performs a Gaussian damping -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_gauss_damp(pw, omega) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw REAL(KIND=dp), INTENT(IN) :: omega CHARACTER(len=*), PARAMETER :: routineN = 'pw_gauss_damp' @@ -1689,14 +1705,9 @@ SUBROUTINE pw_gauss_damp(pw, omega) omega_2 = omega*omega omega_2 = 0.25_dp/omega_2 - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw,omega_2) - pw%array = pw%array*EXP(-pw%pw_grid%gsq*omega_2) + pw%array = pw%array*EXP(-pw%pw_grid%gsq*omega_2) !$OMP END PARALLEL WORKSHARE - ELSE - CPABORT("No suitable data field") - END IF CALL timestop(handle) @@ -1708,11 +1719,10 @@ END SUBROUTINE pw_gauss_damp !> \param omega ... !> \note !> Performs a Gaussian damping -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_log_deriv_gauss(pw, omega) - TYPE(pw_c1d_type), INTENT(IN) :: pw + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw REAL(KIND=dp), INTENT(IN) :: omega CHARACTER(len=*), PARAMETER :: routineN = 'pw_log_deriv_gauss' @@ -1726,18 +1736,10 @@ SUBROUTINE pw_log_deriv_gauss(pw, omega) omega_2 = omega*omega omega_2 = 0.25_dp/omega_2 - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw,omega_2) - pw%array = pw%array*(1.0_dp + omega_2*pw%pw_grid%gsq) + pw%array = pw%array*(1.0_dp + omega_2*pw%pw_grid%gsq) !$OMP END PARALLEL WORKSHARE - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_log_deriv_gauss @@ -1753,11 +1755,10 @@ END SUBROUTINE pw_log_deriv_gauss !> \author Frederick Stein (12-Apr-2019) !> \note !> Performs a Gaussian damping -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_compl_gauss_damp(pw, omega) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw REAL(KIND=dp), INTENT(IN) :: omega CHARACTER(len=*), PARAMETER :: routineN = 'pw_compl_gauss_damp' @@ -1770,27 +1771,19 @@ SUBROUTINE pw_compl_gauss_damp(pw, omega) omega_2 = omega*omega omega_2 = 0.25_dp/omega_2 - IF (pw%in_space == RECIPROCALSPACE) THEN - - cnt = SIZE(pw%array) + cnt = SIZE(pw%array) !$OMP PARALLEL DO PRIVATE(i, tmp) DEFAULT(NONE) SHARED(cnt, pw,omega_2) - DO i = 1, cnt - tmp = -omega_2*pw%pw_grid%gsq(i) - IF (ABS(tmp) > 1.0E-5_dp) THEN - pw%array(i) = pw%array(i)*(1.0_dp - EXP(tmp)) - ELSE - pw%array(i) = pw%array(i)*(tmp + 0.5_dp*tmp*(tmp + (1.0_dp/3.0_dp)*tmp**2)) - END IF - END DO + DO i = 1, cnt + tmp = -omega_2*pw%pw_grid%gsq(i) + IF (ABS(tmp) > 1.0E-5_dp) THEN + pw%array(i) = pw%array(i)*(1.0_dp - EXP(tmp)) + ELSE + pw%array(i) = pw%array(i)*(tmp + 0.5_dp*tmp*(tmp + (1.0_dp/3.0_dp)*tmp**2)) + END IF + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_compl_gauss_damp @@ -1800,11 +1793,10 @@ END SUBROUTINE pw_compl_gauss_damp !> \param pw ... !> \param omega ... !> \note -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_log_deriv_compl_gauss(pw, omega) - TYPE(pw_c1d_type), INTENT(IN) :: pw + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw REAL(KIND=dp), INTENT(IN) :: omega CHARACTER(len=*), PARAMETER :: routineN = 'pw_log_deriv_compl_gauss' @@ -1817,27 +1809,19 @@ SUBROUTINE pw_log_deriv_compl_gauss(pw, omega) omega_2 = omega*omega omega_2 = 0.25_dp/omega_2 - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(i,tmp) & !$OMP SHARED(pw,omega_2) - DO i = 1, SIZE(pw%array) - tmp = omega_2*pw%pw_grid%gsq(i) - ! For too small arguments, use the Taylor polynomial to prevent division by zero - IF (ABS(tmp) >= 0.003_dp) THEN - pw%array(i) = pw%array(i)*(1.0_dp - tmp*EXP(-tmp)/(1.0_dp - EXP(-tmp))) - ELSE - pw%array(i) = pw%array(i)*(0.5_dp*tmp - tmp**2/12.0_dp) - END IF - END DO + DO i = 1, SIZE(pw%array) + tmp = omega_2*pw%pw_grid%gsq(i) + ! For too small arguments, use the Taylor polynomial to prevent division by zero + IF (ABS(tmp) >= 0.003_dp) THEN + pw%array(i) = pw%array(i)*(1.0_dp - tmp*EXP(-tmp)/(1.0_dp - EXP(-tmp))) + ELSE + pw%array(i) = pw%array(i)*(0.5_dp*tmp - tmp**2/12.0_dp) + END IF + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_log_deriv_compl_gauss @@ -1856,11 +1840,10 @@ END SUBROUTINE pw_log_deriv_compl_gauss !> \author Frederick Stein (16-Dec-2021) !> \note !> Performs a Gaussian damping -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_gauss_damp_mix(pw, omega, scale_coul, scale_long) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw REAL(KIND=dp), INTENT(IN) :: omega, scale_coul, scale_long CHARACTER(len=*), PARAMETER :: routineN = 'pw_gauss_damp_mix' @@ -1873,18 +1856,10 @@ SUBROUTINE pw_gauss_damp_mix(pw, omega, scale_coul, scale_long) omega_2 = omega*omega omega_2 = 0.25_dp/omega_2 - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw, omega_2, scale_coul, scale_long) - pw%array = pw%array*(scale_coul + scale_long*EXP(-pw%pw_grid%gsq*omega_2)) + pw%array = pw%array*(scale_coul + scale_long*EXP(-pw%pw_grid%gsq*omega_2)) !$OMP END PARALLEL WORKSHARE - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_gauss_damp_mix @@ -1897,11 +1872,10 @@ END SUBROUTINE pw_gauss_damp_mix !> \param scale_coul ... !> \param scale_long ... !> \note -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_log_deriv_mix_cl(pw, omega, scale_coul, scale_long) - TYPE(pw_c1d_type), INTENT(IN) :: pw + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw REAL(KIND=dp), INTENT(IN) :: omega, scale_coul, scale_long CHARACTER(len=*), PARAMETER :: routineN = 'pw_log_deriv_mix_cl' @@ -1914,22 +1888,14 @@ SUBROUTINE pw_log_deriv_mix_cl(pw, omega, scale_coul, scale_long) omega_2 = omega*omega omega_2 = 0.25_dp/omega_2 - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(i,tmp) & !$OMP SHARED(pw,omega_2,scale_long,scale_coul) - DO i = 1, SIZE(pw%array) - tmp = omega_2*pw%pw_grid%gsq(i) - pw%array(i) = pw%array(i)*(1.0_dp + scale_long*tmp*EXP(-tmp)/(scale_coul + scale_long*EXP(-tmp))) - END DO + DO i = 1, SIZE(pw%array) + tmp = omega_2*pw%pw_grid%gsq(i) + pw%array(i) = pw%array(i)*(1.0_dp + scale_long*tmp*EXP(-tmp)/(scale_coul + scale_long*EXP(-tmp))) + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_log_deriv_mix_cl @@ -1946,11 +1912,10 @@ END SUBROUTINE pw_log_deriv_mix_cl !> \author Frederick Stein (07-Jun-2021) !> \note !> Multiplies by complementary cosine -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_truncated(pw, rcutoff) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw REAL(KIND=dp), INTENT(IN) :: rcutoff CHARACTER(len=*), PARAMETER :: routineN = 'pw_truncated' @@ -1961,25 +1926,17 @@ SUBROUTINE pw_truncated(pw, rcutoff) CALL timeset(routineN, handle) CPASSERT(rcutoff >= 0) - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL DO PRIVATE(i,tmp) DEFAULT(NONE) SHARED(pw, rcutoff) - DO i = 1, SIZE(pw%array) - tmp = SQRT(pw%pw_grid%gsq(i))*rcutoff - IF (tmp >= 0.005_dp) THEN - pw%array(i) = pw%array(i)*(1.0_dp - COS(tmp)) - ELSE - pw%array(i) = pw%array(i)*tmp**2/2.0_dp*(1.0 - tmp**2/12.0_dp) - END IF - END DO + DO i = 1, SIZE(pw%array) + tmp = SQRT(pw%pw_grid%gsq(i))*rcutoff + IF (tmp >= 0.005_dp) THEN + pw%array(i) = pw%array(i)*(1.0_dp - COS(tmp)) + ELSE + pw%array(i) = pw%array(i)*tmp**2/2.0_dp*(1.0 - tmp**2/12.0_dp) + END IF + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_truncated @@ -1990,11 +1947,10 @@ END SUBROUTINE pw_truncated !> \param pw ... !> \param rcutoff ... !> \note -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_log_deriv_trunc(pw, rcutoff) - TYPE(pw_c1d_type), INTENT(IN) :: pw + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw REAL(KIND=dp), INTENT(IN) :: rcutoff CHARACTER(len=*), PARAMETER :: routineN = 'pw_log_deriv_trunc' @@ -2005,28 +1961,20 @@ SUBROUTINE pw_log_deriv_trunc(pw, rcutoff) CALL timeset(routineN, handle) CPASSERT(rcutoff >= 0) - IF (pw%in_space == RECIPROCALSPACE) THEN - - rchalf = 0.5_dp*rcutoff + rchalf = 0.5_dp*rcutoff !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(i,tmp) & !$OMP SHARED(pw,rchalf) - DO i = 1, SIZE(pw%array) - tmp = rchalf*SQRT(pw%pw_grid%gsq(i)) - ! For too small arguments, use the Taylor polynomial to prevent division by zero - IF (ABS(tmp) >= 0.0001_dp) THEN - pw%array(i) = pw%array(i)*(1.0_dp - tmp/TAN(tmp)) - ELSE - pw%array(i) = pw%array(i)*tmp**2*(1.0_dp + tmp**2/15.0_dp)/3.0_dp - END IF - END DO + DO i = 1, SIZE(pw%array) + tmp = rchalf*SQRT(pw%pw_grid%gsq(i)) + ! For too small arguments, use the Taylor polynomial to prevent division by zero + IF (ABS(tmp) >= 0.0001_dp) THEN + pw%array(i) = pw%array(i)*(1.0_dp - tmp/TAN(tmp)) + ELSE + pw%array(i) = pw%array(i)*tmp**2*(1.0_dp + tmp**2/15.0_dp)/3.0_dp + END IF + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_log_deriv_trunc @@ -2040,11 +1988,10 @@ END SUBROUTINE pw_log_deriv_trunc !> \author JGH (25-Feb-2001) !> \note !> Calculate the derivative dx^n(1) dy^n(2) dz^n(3) PW -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_derive(pw, n) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw INTEGER, DIMENSION(3), INTENT(IN) :: n CHARACTER(len=*), PARAMETER :: routineN = 'pw_derive' @@ -2057,9 +2004,6 @@ SUBROUTINE pw_derive(pw, n) IF (ANY(n < 0)) & CPABORT("Nonnegative exponents are not supported!") - IF (pw%in_space /= RECIPROCALSPACE) & - CPABORT("Grid must be in reciprocal space!") - m = SUM(n) im = CMPLX(0.0_dp, 1.0_dp, KIND=dp)**m @@ -2113,11 +2057,10 @@ END SUBROUTINE pw_derive !> \author JGH (25-Feb-2001) !> \note !> Calculate the derivative DELTA PW -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_laplace(pw) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw CHARACTER(len=*), PARAMETER :: routineN = 'pw_laplace' @@ -2125,18 +2068,10 @@ SUBROUTINE pw_laplace(pw) CALL timeset(routineN, handle) - IF (pw%in_space == RECIPROCALSPACE) THEN - !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(pw) - pw%array(:) = -pw%array(:)*pw%pw_grid%gsq(:) + pw%array(:) = -pw%array(:)*pw%pw_grid%gsq(:) !$OMP END PARALLEL WORKSHARE - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_laplace @@ -2151,11 +2086,10 @@ END SUBROUTINE pw_laplace !> none !> \author JGH (05-May-2006) !> \note -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_dr2(pw, pwdr2, i, j) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw, pwdr2 + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw, pwdr2 INTEGER, INTENT(IN) :: i, j CHARACTER(len=*), PARAMETER :: routineN = 'pw_dr2' @@ -2167,29 +2101,21 @@ SUBROUTINE pw_dr2(pw, pwdr2, i, j) o3 = 1.0_dp/3.0_dp - IF (pw%in_space == RECIPROCALSPACE) THEN - - cnt = SIZE(pw%array) + cnt = SIZE(pw%array) - IF (i == j) THEN + IF (i == j) THEN !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(ig,gg) SHARED(cnt, i, o3, pw, pwdr2) - DO ig = 1, cnt - gg = pw%pw_grid%g(i, ig)**2 - o3*pw%pw_grid%gsq(ig) - pwdr2%array(ig) = gg*pw%array(ig) - END DO + DO ig = 1, cnt + gg = pw%pw_grid%g(i, ig)**2 - o3*pw%pw_grid%gsq(ig) + pwdr2%array(ig) = gg*pw%array(ig) + END DO !$OMP END PARALLEL DO - ELSE + ELSE !$OMP PARALLEL DO PRIVATE (ig) DEFAULT(NONE) SHARED(cnt, i, j, pw, pwdr2) - DO ig = 1, cnt - pwdr2%array(ig) = pw%array(ig)*(pw%pw_grid%g(i, ig)*pw%pw_grid%g(j, ig)) - END DO + DO ig = 1, cnt + pwdr2%array(ig) = pw%array(ig)*(pw%pw_grid%g(i, ig)*pw%pw_grid%g(j, ig)) + END DO !$OMP END PARALLEL DO - END IF - - ELSE - - CPABORT("No suitable data field") - END IF CALL timestop(handle) @@ -2207,12 +2133,11 @@ END SUBROUTINE pw_dr2 !> none !> \author RD (20-Nov-2006) !> \note -!> PW has to be in RECIPROCALSPACE !> Adapted from pw_dr2 ! ************************************************************************************************** SUBROUTINE pw_dr2_gg(pw, pwdr2_gg, i, j) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw, pwdr2_gg + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw, pwdr2_gg INTEGER, INTENT(IN) :: i, j INTEGER :: cnt, handle, ig @@ -2223,34 +2148,26 @@ SUBROUTINE pw_dr2_gg(pw, pwdr2_gg, i, j) o3 = 1.0_dp/3.0_dp - IF (pw%in_space == RECIPROCALSPACE) THEN - - cnt = SIZE(pw%array) + cnt = SIZE(pw%array) - IF (i == j) THEN + IF (i == j) THEN !$OMP PARALLEL DO PRIVATE (ig) DEFAULT(NONE) PRIVATE(gg) SHARED(cnt, i, o3, pw, pwdr2_gg) - DO ig = pw%pw_grid%first_gne0, cnt - gg = pw%pw_grid%g(i, ig)**2 - o3*pw%pw_grid%gsq(ig) - pwdr2_gg%array(ig) = gg*pw%array(ig)/pw%pw_grid%gsq(ig) - END DO + DO ig = pw%pw_grid%first_gne0, cnt + gg = pw%pw_grid%g(i, ig)**2 - o3*pw%pw_grid%gsq(ig) + pwdr2_gg%array(ig) = gg*pw%array(ig)/pw%pw_grid%gsq(ig) + END DO !$OMP END PARALLEL DO - ELSE + ELSE !$OMP PARALLEL DO PRIVATE (ig) DEFAULT(NONE) SHARED(cnt, i, j, pw, pwdr2_gg) - DO ig = pw%pw_grid%first_gne0, cnt - pwdr2_gg%array(ig) = pw%array(ig)*(pw%pw_grid%g(i, ig)*pw%pw_grid%g(j, ig)) & - /pw%pw_grid%gsq(ig) - END DO + DO ig = pw%pw_grid%first_gne0, cnt + pwdr2_gg%array(ig) = pw%array(ig)*(pw%pw_grid%g(i, ig)*pw%pw_grid%g(j, ig)) & + /pw%pw_grid%gsq(ig) + END DO !$OMP END PARALLEL DO - END IF - - IF (pw%pw_grid%have_g0) pwdr2_gg%array(1) = 0.0_dp - - ELSE - - CPABORT("No suitable data field") - END IF + IF (pw%pw_grid%have_g0) pwdr2_gg%array(1) = 0.0_dp + CALL timestop(handle) END SUBROUTINE pw_dr2_gg @@ -2265,11 +2182,10 @@ END SUBROUTINE pw_dr2_gg !> none !> \author JGH (09-June-2006) !> \note -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_smoothing(pw, ecut, sigma) - TYPE(pw_c1d_type), INTENT(INOUT) :: pw + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw REAL(KIND=dp), INTENT(IN) :: ecut, sigma CHARACTER(len=*), PARAMETER :: routineN = 'pw_smoothing' @@ -2279,24 +2195,16 @@ SUBROUTINE pw_smoothing(pw, ecut, sigma) CALL timeset(routineN, handle) - IF (pw%in_space == RECIPROCALSPACE) THEN - - cnt = SIZE(pw%array) + cnt = SIZE(pw%array) !$OMP PARALLEL DO DEFAULT(NONE) PRIVATE(ig, arg, f) SHARED(cnt, ecut, pw, sigma) - DO ig = 1, cnt - arg = (ecut - pw%pw_grid%gsq(ig))/sigma - f = EXP(arg)/(1 + EXP(arg)) - pw%array(ig) = f*pw%array(ig) - END DO + DO ig = 1, cnt + arg = (ecut - pw%pw_grid%gsq(ig))/sigma + f = EXP(arg)/(1 + EXP(arg)) + pw%array(ig) = f*pw%array(ig) + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_smoothing @@ -2332,11 +2240,10 @@ END FUNCTION pw_compatible !> none !> \author JGH (05-May-2006) !> \note -!> PW has to be in RECIPROCALSPACE ! ************************************************************************************************** SUBROUTINE pw_structure_factor(sf, r) - TYPE(pw_c1d_type), INTENT(INOUT) :: sf + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: sf REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: r CHARACTER(len=*), PARAMETER :: routineN = 'pw_structure_factor' @@ -2346,23 +2253,15 @@ SUBROUTINE pw_structure_factor(sf, r) CALL timeset(routineN, handle) - IF (sf%in_space == RECIPROCALSPACE) THEN - - cnt = SIZE(sf%array) + cnt = SIZE(sf%array) !$OMP PARALLEL DO PRIVATE (ig, arg) DEFAULT(NONE) SHARED(cnt, r, sf) - DO ig = 1, cnt - arg = DOT_PRODUCT(sf%pw_grid%g(:, ig), r) - sf%array(ig) = CMPLX(COS(arg), -SIN(arg), KIND=dp) - END DO + DO ig = 1, cnt + arg = DOT_PRODUCT(sf%pw_grid%g(:, ig), r) + sf%array(ig) = CMPLX(COS(arg), -SIN(arg), KIND=dp) + END DO !$OMP END PARALLEL DO - ELSE - - CPABORT("No suitable data field") - - END IF - CALL timestop(handle) END SUBROUTINE pw_structure_factor diff --git a/src/pw/pw_poisson_methods.F b/src/pw/pw_poisson_methods.F index 154214cd45..87c1608ca5 100644 --- a/src/pw/pw_poisson_methods.F +++ b/src/pw/pw_poisson_methods.F @@ -55,9 +55,7 @@ MODULE pw_poisson_methods pw_pools_copy, & pw_pools_dealloc USE pw_types, ONLY: & - REALSPACE, & - RECIPROCALSPACE, & - pw_r3d_type, pw_c1d_type, pw_r3d_type + pw_r3d_rs_type, pw_c1d_gs_type, pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -74,18 +72,18 @@ MODULE pw_poisson_methods INTERFACE pw_poisson_rebuild MODULE PROCEDURE pw_poisson_rebuild_nodens - MODULE PROCEDURE pw_poisson_rebuild_c1d, pw_poisson_rebuild_r3d + MODULE PROCEDURE pw_poisson_rebuild_c1d_gs, pw_poisson_rebuild_r3d_rs END INTERFACE INTERFACE pw_poisson_solve - #:for kindd in ['r3d', 'c1d'] + #:for kindd in ['r3d_rs', 'c1d_gs'] MODULE PROCEDURE pw_poisson_solve_nov_nodv_${kindd}$ - #:for kindv in ['r3d', 'c1d'] + #:for kindv in ['r3d_rs', 'c1d_gs'] MODULE PROCEDURE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ #:endfor - #:for kindg in ['r3d', 'c1d'] + #:for kindg in ['r3d_rs', 'c1d_gs'] MODULE PROCEDURE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ - #:for kindv in ['r3d', 'c1d'] + #:for kindv in ['r3d_rs', 'c1d_gs'] MODULE PROCEDURE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ #:endfor #:endfor @@ -230,7 +228,7 @@ SUBROUTINE pw_poisson_rebuild_nodens(poisson_env) END SUBROUTINE pw_poisson_rebuild_nodens - #:for kindd in ["r3d", "c1d"] + #:for kindd in ["r3d_rs", "c1d_gs"] ! ************************************************************************************************** !> \brief rebuilds all the internal values needed to use the poisson solver !> \param poisson_env the environment to rebuild @@ -288,7 +286,7 @@ SUBROUTINE pw_poisson_rebuild_${kindd}$ (poisson_env, density) END SUBROUTINE pw_poisson_rebuild_${kindd}$ #:endfor - #:for kindd in ['r3d', 'c1d'] + #:for kindd in ['r3d_rs', 'c1d_gs'] ! ************************************************************************************************** !> \brief Solve Poisson equation in a plane wave basis set !> Obtains electrostatic potential and its derivatives with respect to r @@ -312,7 +310,7 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, REAL(kind=dp), INTENT(out), OPTIONAL :: ehartree REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT), & OPTIONAL :: h_stress - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_core, greenfn + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_core, greenfn TYPE(pw_${kindd}$_type), INTENT(IN), OPTIONAL :: aux_density CHARACTER(len=*), PARAMETER :: routineN = 'pw_poisson_solve' @@ -321,8 +319,8 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, LOGICAL :: has_dielectric TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: rhor, vhartree_rs - TYPE(pw_c1d_type) :: influence_fn, rhog, rhog_aux, tmpg + TYPE(pw_r3d_rs_type) :: rhor, vhartree_rs + TYPE(pw_c1d_gs_type) :: influence_fn, rhog, rhog_aux, tmpg CALL timeset(routineN, handle) @@ -334,9 +332,9 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, pw_pool => poisson_env%pw_pools(poisson_env%pw_level)%pool pw_grid => pw_pool%pw_grid ! density in G space - CALL pw_pool%create_pw(rhog, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog) IF (PRESENT(aux_density)) THEN - CALL pw_pool%create_pw(rhog_aux, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog_aux) END IF SELECT CASE (poisson_env%used_grid) @@ -350,7 +348,7 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, CALL pw_transfer(aux_density, rhog_aux) END IF IF (PRESENT(ehartree)) THEN - CALL pw_pool%create_pw(tmpg, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(tmpg) CALL pw_copy(rhog, tmpg) END IF IF (PRESENT(greenfn)) THEN @@ -391,8 +389,8 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, END SELECT END IF - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) - CALL pw_pool%create_pw(vhartree_rs, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) + CALL pw_pool%create_pw(vhartree_rs) CALL pw_transfer(density, rhor) SELECT CASE (poisson_env%parameters%ps_implicit_params%boundary_condition) @@ -425,7 +423,7 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, CASE (use_rs_grid) - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) CALL pw_transfer(density, rhor) CALL cp2k_distribution_to_z_slices(rhor, poisson_env%wavelet, rhor%pw_grid) CALL ps_wavelet_solve(poisson_env%wavelet, rhor%pw_grid) @@ -433,10 +431,10 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, IF (PRESENT(ehartree)) THEN #! This is actually not consequent but to keep it working, I leave it that way #! Correctly, one checks the spaces but in CP2K, there is a separation in r-space/3D and g-space/1D in most cases - #:if kindd=="r3d" + #:if kindd=="r3d_rs" ehartree = 0.5_dp*pw_integral_ab(density, rhor) #:else - IF (.NOT. PRESENT(h_stress)) CALL pw_pool%create_pw(rhog, in_space=RECIPROCALSPACE) + IF (.NOT. PRESENT(h_stress)) CALL pw_pool%create_pw(rhog) CALL pw_transfer(rhor, rhog) ehartree = 0.5_dp*pw_integral_ab(density, rhog) IF (.NOT. PRESENT(h_stress)) CALL pw_pool%give_back_pw(rhog) @@ -450,9 +448,9 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, END SELECT IF (PRESENT(aux_density)) THEN - CALL calc_stress_and_gradient_r3d(poisson_env, rhog, ehartree, rhog_aux, h_stress) + CALL calc_stress_and_gradient_${kindd}$ (poisson_env, rhog, ehartree, rhog_aux, h_stress) ELSE - CALL calc_stress_and_gradient_r3d(poisson_env, rhog, ehartree, h_stress=h_stress) + CALL calc_stress_and_gradient_${kindd}$ (poisson_env, rhog, ehartree, h_stress=h_stress) END IF CALL pw_pool%give_back_pw(rhog) @@ -465,8 +463,8 @@ SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ (poisson_env, density, ehartree, END SUBROUTINE pw_poisson_solve_nov_nodv_${kindd}$ #:endfor - #:for kindd in ['r3d', 'c1d'] - #:for kindv in ['r3d', 'c1d'] + #:for kindd in ['r3d_rs', 'c1d_gs'] + #:for kindv in ['r3d_rs', 'c1d_gs'] ! ************************************************************************************************** !> \brief Solve Poisson equation in a plane wave basis set !> Obtains electrostatic potential and its derivatives with respect to r @@ -492,7 +490,7 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh TYPE(pw_${kindv}$_type), INTENT(INOUT) :: vhartree REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT), & OPTIONAL :: h_stress - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_core, greenfn + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_core, greenfn TYPE(pw_${kindd}$_type), INTENT(IN), OPTIONAL :: aux_density CHARACTER(len=*), PARAMETER :: routineN = 'pw_poisson_solve' @@ -501,9 +499,9 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh LOGICAL :: has_dielectric TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: & + TYPE(pw_r3d_rs_type) :: & rhor, vhartree_rs - TYPE(pw_c1d_type) :: influence_fn, rhog, rhog_aux + TYPE(pw_c1d_gs_type) :: influence_fn, rhog, rhog_aux CALL timeset(routineN, handle) @@ -517,9 +515,9 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh IF (.NOT. pw_grid_compare(pw_pool%pw_grid, vhartree%pw_grid)) & CPABORT("vhartree has a different grid than the poisson solver") ! density in G space - CALL pw_pool%create_pw(rhog, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog) IF (PRESENT(aux_density)) THEN - CALL pw_pool%create_pw(rhog_aux, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog_aux) END IF SELECT CASE (poisson_env%used_grid) @@ -546,7 +544,7 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh IF (PRESENT(aux_density)) THEN #:if kindd==kindv ehartree = 0.5_dp*pw_integral_ab(aux_density, vhartree) - #:elif kindd=="c1d" + #:elif kindd=="c1d_gs" ehartree = 0.5_dp*pw_integral_ab(aux_density, rhog) #:else CALL pw_transfer(aux_density, rhog) @@ -555,7 +553,7 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh ELSE #:if kindd==kindv ehartree = 0.5_dp*pw_integral_ab(density, vhartree) - #:elif kindd=="c1d" + #:elif kindd=="c1d_gs" ehartree = 0.5_dp*pw_integral_ab(density, rhog) #:else CALL pw_transfer(density, rhog) @@ -588,8 +586,8 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh END SELECT END IF - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) - CALL pw_pool%create_pw(vhartree_rs, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) + CALL pw_pool%create_pw(vhartree_rs) CALL pw_transfer(density, rhor) SELECT CASE (poisson_env%parameters%ps_implicit_params%boundary_condition) @@ -623,7 +621,7 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh CASE (use_rs_grid) - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) CALL pw_transfer(density, rhor) CALL cp2k_distribution_to_z_slices(rhor, poisson_env%wavelet, rhor%pw_grid) CALL ps_wavelet_solve(poisson_env%wavelet, rhor%pw_grid) @@ -634,7 +632,7 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh #! Correctly, one checks the spaces but in CP2K, there is a separation in r-space/3D and g-space/1D in most cases #:if kindd==kindv ehartree = 0.5_dp*pw_integral_ab(density, vhartree) - #:elif kindd=="r3d" + #:elif kindd=="r3d_rs" ehartree = 0.5_dp*pw_integral_ab(density, rhor) #:else CALL pw_transfer(vhartree, rhog) @@ -649,9 +647,9 @@ SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ (poisson_env, density, eh END SELECT IF (PRESENT(aux_density)) THEN - CALL calc_stress_and_gradient_r3d(poisson_env, rhog, ehartree, rhog_aux, h_stress) + CALL calc_stress_and_gradient_${kindd}$ (poisson_env, rhog, ehartree, rhog_aux, h_stress) ELSE - CALL calc_stress_and_gradient_r3d(poisson_env, rhog, ehartree, h_stress=h_stress) + CALL calc_stress_and_gradient_${kindd}$ (poisson_env, rhog, ehartree, h_stress=h_stress) END IF CALL pw_pool%give_back_pw(rhog) @@ -665,8 +663,8 @@ END SUBROUTINE pw_poisson_solve_v_nodv_${kindd}$_${kindv}$ #:endfor #:endfor - #:for kindd in ['r3d', 'c1d'] - #:for kindg in ['r3d', 'c1d'] + #:for kindd in ['r3d_rs', 'c1d_gs'] + #:for kindg in ['r3d_rs', 'c1d_gs'] ! ************************************************************************************************** !> \brief Solve Poisson equation in a plane wave basis set !> Obtains electrostatic potential and its derivatives with respect to r @@ -692,7 +690,7 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh TYPE(pw_${kindg}$_type), DIMENSION(3) :: dvhartree REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT), & OPTIONAL :: h_stress - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_core, greenfn + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_core, greenfn TYPE(pw_${kindd}$_type), INTENT(IN), OPTIONAL :: aux_density CHARACTER(len=*), PARAMETER :: routineN = 'pw_poisson_solve' @@ -701,9 +699,9 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh LOGICAL :: has_dielectric TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: & + TYPE(pw_r3d_rs_type) :: & rhor, vhartree_rs - TYPE(pw_c1d_type) :: influence_fn, rhog, rhog_aux, tmpg + TYPE(pw_c1d_gs_type) :: influence_fn, rhog, rhog_aux, tmpg CALL timeset(routineN, handle) @@ -715,9 +713,9 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh pw_pool => poisson_env%pw_pools(poisson_env%pw_level)%pool pw_grid => pw_pool%pw_grid ! density in G space - CALL pw_pool%create_pw(rhog, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog) IF (PRESENT(aux_density)) THEN - CALL pw_pool%create_pw(rhog_aux, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog_aux) END IF SELECT CASE (poisson_env%used_grid) @@ -731,7 +729,7 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh CALL pw_transfer(aux_density, rhog_aux) END IF IF (PRESENT(ehartree)) THEN - CALL pw_pool%create_pw(tmpg, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(tmpg) CALL pw_copy(rhog, tmpg) END IF IF (PRESENT(greenfn)) THEN @@ -773,8 +771,8 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh END SELECT END IF - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) - CALL pw_pool%create_pw(vhartree_rs, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) + CALL pw_pool%create_pw(vhartree_rs) CALL pw_transfer(density, rhor) SELECT CASE (poisson_env%parameters%ps_implicit_params%boundary_condition) @@ -808,7 +806,7 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh CASE (use_rs_grid) - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) CALL pw_transfer(density, rhor) CALL cp2k_distribution_to_z_slices(rhor, poisson_env%wavelet, rhor%pw_grid) CALL ps_wavelet_solve(poisson_env%wavelet, rhor%pw_grid) @@ -817,7 +815,7 @@ SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ (poisson_env, density, eh IF (PRESENT(ehartree)) THEN #! This is actually not consequent but to keep it working, I leave it that way #! Correctly, one checks the spaces but in CP2K, there is a separation in r-space/3D and g-space/1D in most cases - #:if kindd=="r3d" + #:if kindd=="r3d_rs" ehartree = 0.5_dp*pw_integral_ab(density, rhor) #:else ehartree = 0.5_dp*pw_integral_ab(density, rhog) @@ -844,9 +842,9 @@ END SUBROUTINE pw_poisson_solve_nov_dv_${kindd}$_${kindg}$ #:endfor #:endfor - #:for kindd in ['r3d', 'c1d'] - #:for kindg in ['r3d', 'c1d'] - #:for kindv in ['r3d', 'c1d'] + #:for kindd in ['r3d_rs', 'c1d_gs'] + #:for kindg in ['r3d_rs', 'c1d_gs'] + #:for kindv in ['r3d_rs', 'c1d_gs'] ! ************************************************************************************************** !> \brief Solve Poisson equation in a plane wave basis set !> Obtains electrostatic potential and its derivatives with respect to r @@ -874,7 +872,7 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den TYPE(pw_${kindg}$_type), DIMENSION(3) :: dvhartree REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT), & OPTIONAL :: h_stress - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_core, greenfn + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_core, greenfn TYPE(pw_${kindd}$_type), INTENT(IN), OPTIONAL :: aux_density CHARACTER(len=*), PARAMETER :: routineN = 'pw_poisson_solve' @@ -883,8 +881,8 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den LOGICAL :: has_dielectric TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: rhor, vhartree_rs - TYPE(pw_c1d_type) :: influence_fn, rhog, rhog_aux + TYPE(pw_r3d_rs_type) :: rhor, vhartree_rs + TYPE(pw_c1d_gs_type) :: influence_fn, rhog, rhog_aux CALL timeset(routineN, handle) @@ -898,9 +896,9 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den IF (.NOT. pw_grid_compare(pw_pool%pw_grid, vhartree%pw_grid)) & CPABORT("vhartree has a different grid than the poisson solver") ! density in G space - CALL pw_pool%create_pw(rhog, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog) IF (PRESENT(aux_density)) THEN - CALL pw_pool%create_pw(rhog_aux, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhog_aux) END IF SELECT CASE (poisson_env%used_grid) @@ -927,7 +925,7 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den IF (PRESENT(aux_density)) THEN #:if kindd==kindv ehartree = 0.5_dp*pw_integral_ab(aux_density, vhartree) - #:elif kindd=="c1d" + #:elif kindd=="c1d_gs" ehartree = 0.5_dp*pw_integral_ab(aux_density, rhog) #:else CALL pw_transfer(aux_density, rhog) @@ -936,7 +934,7 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den ELSE #:if kindd==kindv ehartree = 0.5_dp*pw_integral_ab(density, vhartree) - #:elif kindd=="c1d" + #:elif kindd=="c1d_gs" ehartree = 0.5_dp*pw_integral_ab(density, rhog) #:else CALL pw_transfer(density, rhog) @@ -969,8 +967,8 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den END SELECT END IF - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) - CALL pw_pool%create_pw(vhartree_rs, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) + CALL pw_pool%create_pw(vhartree_rs) CALL pw_transfer(density, rhor) SELECT CASE (poisson_env%parameters%ps_implicit_params%boundary_condition) @@ -1006,7 +1004,7 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den CASE (use_rs_grid) - CALL pw_pool%create_pw(rhor, in_space=REALSPACE) + CALL pw_pool%create_pw(rhor) CALL pw_transfer(density, rhor) CALL cp2k_distribution_to_z_slices(rhor, poisson_env%wavelet, rhor%pw_grid) CALL ps_wavelet_solve(poisson_env%wavelet, rhor%pw_grid) @@ -1018,7 +1016,7 @@ SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ (poisson_env, den #! Correctly, one checks the spaces but in CP2K, there is a separation in r-space/3D and g-space/1D in most cases #:if kindd==kindv ehartree = 0.5_dp*pw_integral_ab(density, vhartree) - #:elif kindd=="r3d" + #:elif kindd=="r3d_rs" ehartree = 0.5_dp*pw_integral_ab(density, rhor) #:else ehartree = 0.5_dp*pw_integral_ab(density, rhog) @@ -1047,12 +1045,12 @@ END SUBROUTINE pw_poisson_solve_v_dv_${kindd}$_${kindv}$_${kindg}$ #:endfor #:endfor - #:for kind in ["c1d", "r3d"] + #:for kind in ["c1d_gs", "r3d_rs"] SUBROUTINE calc_stress_and_gradient_${kind}$ (poisson_env, rhog, ehartree, rhog_aux, h_stress, dvhartree) TYPE(pw_poisson_type), INTENT(IN) :: poisson_env - TYPE(pw_c1d_type), INTENT(IN) :: rhog + TYPE(pw_c1d_gs_type), INTENT(IN) :: rhog REAL(KIND=dp) :: ehartree - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rhog_aux + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rhog_aux REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT), OPTIONAL :: h_stress TYPE(pw_${kind}$_type), DIMENSION(3), INTENT(INOUT), OPTIONAL :: dvhartree @@ -1060,7 +1058,7 @@ SUBROUTINE calc_stress_and_gradient_${kind}$ (poisson_env, rhog, ehartree, rhog_ REAL(KIND=dp) :: ffa INTEGER :: alpha, beta, n(3), handle, i - TYPE(pw_c1d_type) :: dvg(3), dvg_aux(3) + TYPE(pw_c1d_gs_type) :: dvg(3), dvg_aux(3) TYPE(pw_pool_type), POINTER :: pw_pool CALL timeset(routineN, handle) @@ -1068,13 +1066,13 @@ SUBROUTINE calc_stress_and_gradient_${kind}$ (poisson_env, rhog, ehartree, rhog_ pw_pool => poisson_env%pw_pools(poisson_env%pw_level)%pool DO i = 1, 3 - CALL pw_pool%create_pw(dvg(i), in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(dvg(i)) n = 0 n(i) = 1 CALL pw_copy(rhog, dvg(i)) CALL pw_derive(dvg(i), n) IF (PRESENT(rhog_aux)) THEN - CALL pw_pool%create_pw(dvg_aux(i), in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(dvg_aux(i)) CALL pw_copy(rhog_aux, dvg_aux(i)) CALL pw_derive(dvg_aux(i), n) END IF diff --git a/src/pw/pw_poisson_types.F b/src/pw/pw_poisson_types.F index df473fd9e2..dd9d972302 100644 --- a/src/pw/pw_poisson_types.F +++ b/src/pw/pw_poisson_types.F @@ -46,9 +46,8 @@ MODULE pw_poisson_types pw_pool_release,& pw_pool_type,& pw_pools_dealloc - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type,& - pw_r1d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r1d_gs_type USE realspace_grid_types, ONLY: realspace_grid_type,& rs_grid_release #include "../base/base_uses.f90" @@ -159,10 +158,10 @@ MODULE pw_poisson_types LOGICAL :: sr_screening = .FALSE. REAL(KIND=dp) :: sr_alpha = 1.0_dp REAL(KIND=dp) :: sr_rc = 0.0_dp - TYPE(pw_c1d_type) :: influence_fn = pw_c1d_type() - TYPE(pw_c1d_type), POINTER :: dct_influence_fn => NULL() - TYPE(pw_c1d_type), POINTER :: screen_fn => NULL() - TYPE(pw_r1d_type), POINTER :: p3m_charge => NULL() + TYPE(pw_c1d_gs_type) :: influence_fn = pw_c1d_gs_type() + TYPE(pw_c1d_gs_type), POINTER :: dct_influence_fn => NULL() + TYPE(pw_c1d_gs_type), POINTER :: screen_fn => NULL() + TYPE(pw_r1d_gs_type), POINTER :: p3m_charge => NULL() END TYPE greens_fn_type CONTAINS @@ -190,7 +189,7 @@ SUBROUTINE pw_green_create(green, poisson_params, cell_hmat, pw_pool, & REAL(KIND=dp) :: g2, g3d, gg, gxy, gz, j0g, j1g, k0g, & k1g, rlength, zlength REAL(KIND=dp), DIMENSION(3) :: abc - TYPE(pw_c1d_type), POINTER :: dct_gf + TYPE(pw_c1d_gs_type), POINTER :: dct_gf TYPE(pw_grid_type), POINTER :: dct_grid TYPE(pw_pool_type), POINTER :: pw_pool_xpndd @@ -269,7 +268,7 @@ SUBROUTINE pw_green_create(green, poisson_params, cell_hmat, pw_pool, & ! allocate influence function,... SELECT CASE (green%method) CASE (PERIODIC3D, ANALYTIC2D, ANALYTIC1D, ANALYTIC0D, MT2D, MT1D, MT0D, MULTIPOLE0D, PS_IMPLICIT) - CALL pw_pool%create_pw(green%influence_fn, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(green%influence_fn) IF (poisson_params%ewald_type == do_ewald_spme) THEN green%p3m = .TRUE. @@ -280,8 +279,7 @@ SUBROUTINE pw_green_create(green, poisson_params, cell_hmat, pw_pool, & CALL spme_coeff_calculate(n, green%p3m_coeff) NULLIFY (green%p3m_charge) ALLOCATE (green%p3m_charge) - CALL pw_pool%create_pw(green%p3m_charge, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(green%p3m_charge) CALL influence_factor(green) CALL calc_p3m_charge(green) ELSE @@ -300,8 +298,7 @@ SUBROUTINE pw_green_create(green, poisson_params, cell_hmat, pw_pool, & CALL pw_pool_create(pw_pool_xpndd, pw_grid=dct_pw_grid) NULLIFY (green%dct_influence_fn) ALLOCATE (green%dct_influence_fn) - CALL pw_pool_xpndd%create_pw(green%dct_influence_fn, & - in_space=RECIPROCALSPACE) + CALL pw_pool_xpndd%create_pw(green%dct_influence_fn) CALL pw_pool_release(pw_pool_xpndd) END IF END SELECT diff --git a/src/pw/pw_pool_types.F b/src/pw/pw_pool_types.F index 45f9f14b92..2e2256d15f 100644 --- a/src/pw/pw_pool_types.F +++ b/src/pw/pw_pool_types.F @@ -34,12 +34,11 @@ MODULE pw_pool_types USE pw_grids, ONLY: pw_grid_compare, & pw_grid_release, & pw_grid_retain - USE pw_types, ONLY: & -#:for kind in pw_kinds - pw_${kind}$_type, & -#:endfor - REALSPACE, & - RECIPROCALSPACE + #:for space in pw_spaces + #:for kind in pw_kinds + USE pw_types, ONLY: pw_${kind}$_${space}$_type + #:endfor + #:endfor #include "../base/base_uses.f90" IMPLICIT NONE @@ -75,11 +74,13 @@ MODULE pw_pool_types #:endfor CONTAINS PROCEDURE, PUBLIC, NON_OVERRIDABLE :: retain => pw_pool_retain - #:for i, kind in enumerate(pw_kinds) - PROCEDURE, PUBLIC, NON_OVERRIDABLE :: pw_pool_create_pw_${kind}$ - GENERIC, PUBLIC :: create_pw => pw_pool_create_pw_${kind}$ - PROCEDURE, PUBLIC, NON_OVERRIDABLE :: pw_pool_give_back_pw_${kind}$ - GENERIC, PUBLIC :: give_back_pw => pw_pool_give_back_pw_${kind}$ + #:for space in pw_spaces + #:for i, kind in enumerate(pw_kinds) + PROCEDURE, PUBLIC, NON_OVERRIDABLE :: pw_pool_create_pw_${kind}$_${space}$ + GENERIC, PUBLIC :: create_pw => pw_pool_create_pw_${kind}$_${space}$ + PROCEDURE, PUBLIC, NON_OVERRIDABLE :: pw_pool_give_back_pw_${kind}$_${space}$ + GENERIC, PUBLIC :: give_back_pw => pw_pool_give_back_pw_${kind}$_${space}$ + #:endfor #:endfor PROCEDURE, PUBLIC, NON_OVERRIDABLE :: create_cr3d => pw_pool_create_cr3d PROCEDURE, PUBLIC, NON_OVERRIDABLE :: give_back_cr3d => pw_pool_give_back_cr3d @@ -97,14 +98,18 @@ MODULE pw_pool_types END TYPE pw_pool_p_type INTERFACE pw_pools_create_pws - #:for kind in pw_kinds - MODULE PROCEDURE pw_pools_create_pws_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_pools_create_pws_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE INTERFACE pw_pools_give_back_pws - #:for kind in pw_kinds - MODULE PROCEDURE pw_pools_give_back_pws_${kind}$ + #:for space in pw_spaces + #:for kind in pw_kinds + MODULE PROCEDURE pw_pools_give_back_pws_${kind}$_${space}$ + #:endfor #:endfor END INTERFACE @@ -221,37 +226,33 @@ FUNCTION try_pop_${kind}$ (list) RESULT(res) END IF END FUNCTION try_pop_${kind}$ + #:for space in pw_spaces ! ************************************************************************************************** !> \brief returns a pw, allocating it if none is in the pool !> \param pool the pool from where you get the pw !> \param pw will contain the new pw -!> \param use_data which data it uses: -!> REALDATA3D -!> \param in_space in which space it is: REALSPACE, RECIPROCALSPACE !> \par History !> 08.2002 created [fawzi] !> \author Fawzi Mohamed ! ************************************************************************************************** - SUBROUTINE pw_pool_create_pw_${kind}$ (pool, pw, in_space) - CLASS(pw_pool_type), INTENT(IN) :: pool - TYPE(pw_${kind}$_type), INTENT(OUT) :: pw - INTEGER, INTENT(in) :: in_space + SUBROUTINE pw_pool_create_pw_${kind}$_${space}$ (pool, pw) + CLASS(pw_pool_type), INTENT(IN) :: pool + TYPE(pw_${kind}$_${space}$_type), INTENT(OUT) :: pw - CHARACTER(len=*), PARAMETER :: routineN = 'pw_pool_create_pw' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_pool_create_pw' - INTEGER :: handle - ${type}$, CONTIGUOUS, POINTER :: array_ptr + INTEGER :: handle + ${type}$, CONTIGUOUS, POINTER :: array_ptr - CALL timeset(routineN, handle) - NULLIFY (array_ptr) + CALL timeset(routineN, handle) + NULLIFY (array_ptr) - array_ptr => try_pop_${kind}$ (pool%${kind}$_array) - CALL pw%create(pool%pw_grid, & - in_space=in_space, array_ptr=array_ptr) + array_ptr => try_pop_${kind}$ (pool%${kind}$_array) + CALL pw%create(pool%pw_grid, array_ptr=array_ptr) - CALL timestop(handle) + CALL timestop(handle) - END SUBROUTINE pw_pool_create_pw_${kind}$ + END SUBROUTINE pw_pool_create_pw_${kind}$_${space}$ ! ************************************************************************************************** !> \brief returns the pw to the pool @@ -261,56 +262,51 @@ END SUBROUTINE pw_pool_create_pw_${kind}$ !> 08.2002 created [fawzi] !> \author Fawzi Mohamed ! ************************************************************************************************** - SUBROUTINE pw_pool_give_back_pw_${kind}$ (pool, pw) - CLASS(pw_pool_type), INTENT(IN) :: pool - TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw + SUBROUTINE pw_pool_give_back_pw_${kind}$_${space}$ (pool, pw) + CLASS(pw_pool_type), INTENT(IN) :: pool + TYPE(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw - CHARACTER(len=*), PARAMETER :: routineN = 'pw_pool_give_back_pw' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_pool_give_back_pw' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) - IF (ASSOCIATED(pw%pw_grid)) THEN - IF (pw_grid_compare(pw%pw_grid, pool%pw_grid)) THEN - IF (ASSOCIATED(pw%array)) THEN - IF (cp_sll_${kind[1:]}$_${kind[0]}$_get_length(pool%${kind}$_array) < pool%max_cache) THEN - CALL cp_sll_${kind[1:]}$_${kind[0]}$_insert_el(pool%${kind}$_array, el=pw%array) - NULLIFY (pw%array) - ELSE IF (max_max_cache >= 0) THEN - CPWARN("hit max_cache") + CALL timeset(routineN, handle) + IF (ASSOCIATED(pw%pw_grid)) THEN + IF (pw_grid_compare(pw%pw_grid, pool%pw_grid)) THEN + IF (ASSOCIATED(pw%array)) THEN + IF (cp_sll_${kind[1:]}$_${kind[0]}$_get_length(pool%${kind}$_array) < pool%max_cache) THEN + CALL cp_sll_${kind[1:]}$_${kind[0]}$_insert_el(pool%${kind}$_array, el=pw%array) + NULLIFY (pw%array) + ELSE IF (max_max_cache >= 0) THEN + CPWARN("hit max_cache") + END IF END IF END IF END IF - END IF - CALL pw%release() - CALL timestop(handle) - END SUBROUTINE pw_pool_give_back_pw_${kind}$ + CALL pw%release() + CALL timestop(handle) + END SUBROUTINE pw_pool_give_back_pw_${kind}$_${space}$ ! ************************************************************************************************** !> \brief creates a multigrid structure !> \param pools the multigrid pool (i.e. an array of pw_pool) !> \param pws the multigrid of coefficent you want to initialize -!> \param use_data which data it uses: -!> REALDATA3D -!> \param in_space ... !> \par History !> 07.2004 created [fawzi] !> \author Fawzi Mohamed ! ************************************************************************************************** - SUBROUTINE pw_pools_create_pws_${kind}$ (pools, pws, in_space) - TYPE(pw_pool_p_type), DIMENSION(:), INTENT(IN) :: pools - TYPE(pw_${kind}$_type), ALLOCATABLE, DIMENSION(:), & - INTENT(OUT) :: pws - INTEGER, INTENT(in), OPTIONAL :: in_space + SUBROUTINE pw_pools_create_pws_${kind}$_${space}$ (pools, pws) + TYPE(pw_pool_p_type), DIMENSION(:), INTENT(IN) :: pools + TYPE(pw_${kind}$_${space}$_type), ALLOCATABLE, DIMENSION(:), & + INTENT(OUT) :: pws - INTEGER :: i + INTEGER :: i - ALLOCATE (pws(SIZE(pools))) - DO i = 1, SIZE(pools) - CALL pw_pool_create_pw_${kind}$ (pools(i)%pool, pws(i), & - in_space=in_space) - END DO - END SUBROUTINE pw_pools_create_pws_${kind}$ + ALLOCATE (pws(SIZE(pools))) + DO i = 1, SIZE(pools) + CALL pw_pool_create_pw_${kind}$_${space}$ (pools(i)%pool, pws(i)) + END DO + END SUBROUTINE pw_pools_create_pws_${kind}$_${space}$ ! ************************************************************************************************** !> \brief returns the pw part of the coefficients into the pools @@ -320,19 +316,20 @@ END SUBROUTINE pw_pools_create_pws_${kind}$ !> 08.2002 created [fawzi] !> \author Fawzi Mohamed ! ************************************************************************************************** - SUBROUTINE pw_pools_give_back_pws_${kind}$ (pools, pws) - TYPE(pw_pool_p_type), DIMENSION(:), INTENT(IN) :: pools - TYPE(pw_${kind}$_type), ALLOCATABLE, DIMENSION(:), & - INTENT(INOUT) :: pws + SUBROUTINE pw_pools_give_back_pws_${kind}$_${space}$ (pools, pws) + TYPE(pw_pool_p_type), DIMENSION(:), INTENT(IN) :: pools + TYPE(pw_${kind}$_${space}$_type), ALLOCATABLE, DIMENSION(:), & + INTENT(INOUT) :: pws - INTEGER :: i + INTEGER :: i - CPASSERT(SIZE(pws) == SIZE(pools)) - DO i = 1, SIZE(pools) - CALL pw_pool_give_back_pw_${kind}$ (pools(i)%pool, pws(i)) - END DO - DEALLOCATE (pws) - END SUBROUTINE pw_pools_give_back_pws_${kind}$ + CPASSERT(SIZE(pws) == SIZE(pools)) + DO i = 1, SIZE(pools) + CALL pw_pool_give_back_pw_${kind}$_${space}$ (pools(i)%pool, pws(i)) + END DO + DEALLOCATE (pws) + END SUBROUTINE pw_pools_give_back_pws_${kind}$_${space}$ + #:endfor #:endfor ! ************************************************************************************************** diff --git a/src/pw/pw_spline_utils.F b/src/pw/pw_spline_utils.F index 8dc7cfb1a6..68bababb1f 100644 --- a/src/pw/pw_spline_utils.F +++ b/src/pw/pw_spline_utils.F @@ -31,10 +31,8 @@ MODULE pw_spline_utils pw_zero USE pw_pool_types, ONLY: pw_pool_release,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -128,7 +126,7 @@ MODULE pw_spline_utils !> does not work with spherical cutoff ! ************************************************************************************************** SUBROUTINE pw_spline2_interpolate_values_g(spline_g) - TYPE(pw_c1d_type), INTENT(IN) :: spline_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: spline_g CHARACTER(len=*), PARAMETER :: routineN = 'pw_spline2_interpolate_values_g' @@ -143,7 +141,6 @@ SUBROUTINE pw_spline2_interpolate_values_g(spline_g) n_tot(1:3) = spline_g%pw_grid%npts(1:3) gbo = spline_g%pw_grid%bounds - CPASSERT(spline_g%in_space == RECIPROCALSPACE) CPASSERT(.NOT. spline_g%pw_grid%spherical) CPASSERT(spline_g%pw_grid%grid_span == FULLSPACE) @@ -200,7 +197,7 @@ END SUBROUTINE pw_spline2_interpolate_values_g !> needed cos, and avoid the mpi_allreduce ! ************************************************************************************************** SUBROUTINE pw_spline3_interpolate_values_g(spline_g) - TYPE(pw_c1d_type), INTENT(IN) :: spline_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: spline_g CHARACTER(len=*), PARAMETER :: routineN = 'pw_spline3_interpolate_values_g' @@ -215,7 +212,6 @@ SUBROUTINE pw_spline3_interpolate_values_g(spline_g) n_tot(1:3) = spline_g%pw_grid%npts(1:3) gbo = spline_g%pw_grid%bounds - CPASSERT(spline_g%in_space == RECIPROCALSPACE) CPASSERT(.NOT. spline_g%pw_grid%spherical) CPASSERT(spline_g%pw_grid%grid_span == FULLSPACE) @@ -276,7 +272,7 @@ END SUBROUTINE pw_spline3_interpolate_values_g !> \author Fawzi Mohamed ! ************************************************************************************************** SUBROUTINE pw_spline_scale_deriv(deriv_vals_r, transpose, scale) - TYPE(pw_r3d_type), DIMENSION(3), INTENT(IN) :: deriv_vals_r + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(IN) :: deriv_vals_r LOGICAL, INTENT(in), OPTIONAL :: transpose REAL(KIND=dp), INTENT(in), OPTIONAL :: scale @@ -367,7 +363,7 @@ END SUBROUTINE pw_spline_scale_deriv !> the distance between gridpoints is assumed to be 1 ! ************************************************************************************************** SUBROUTINE pw_spline3_deriv_g(spline_g, idir) - TYPE(pw_c1d_type), INTENT(IN) :: spline_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: spline_g INTEGER, INTENT(in) :: idir CHARACTER(len=*), PARAMETER :: routineN = 'pw_spline3_deriv_g' @@ -386,7 +382,6 @@ SUBROUTINE pw_spline3_deriv_g(spline_g, idir) bo = spline_g%pw_grid%bounds_local gbo = spline_g%pw_grid%bounds - CPASSERT(spline_g%in_space == RECIPROCALSPACE) CPASSERT(.NOT. spline_g%pw_grid%spherical) CPASSERT(spline_g%pw_grid%grid_span == FULLSPACE) @@ -503,7 +498,7 @@ END SUBROUTINE pw_spline3_deriv_g !> the distance between gridpoints is assumed to be 1 ! ************************************************************************************************** SUBROUTINE pw_spline2_deriv_g(spline_g, idir) - TYPE(pw_c1d_type), INTENT(IN) :: spline_g + TYPE(pw_c1d_gs_type), INTENT(IN) :: spline_g INTEGER, INTENT(in) :: idir CHARACTER(len=*), PARAMETER :: routineN = 'pw_spline2_deriv_g' @@ -521,7 +516,6 @@ SUBROUTINE pw_spline2_deriv_g(spline_g, idir) n_tot(1:3) = spline_g%pw_grid%npts(1:3) bo = spline_g%pw_grid%bounds - CPASSERT(spline_g%in_space == RECIPROCALSPACE) CPASSERT(.NOT. spline_g%pw_grid%spherical) CPASSERT(spline_g%pw_grid%grid_span == FULLSPACE) @@ -745,7 +739,7 @@ END SUBROUTINE pw_compose_stripe SUBROUTINE pw_nn_compose_r_work(weights, in_val, out_val, pw_in, bo) REAL(kind=dp), DIMENSION(0:2, 0:2, 0:2) :: weights INTEGER, DIMENSION(2, 3) :: bo - TYPE(pw_r3d_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in REAL(kind=dp), DIMENSION(bo(1, 1):bo(2, 1), bo(1, & 2):bo(2, 2), bo(1, 3):bo(2, 3)), INTENT(inout) :: out_val REAL(kind=dp), DIMENSION(bo(1, 1):bo(2, 1), bo(1, & @@ -827,15 +821,13 @@ END SUBROUTINE pw_nn_compose_r_work ! ************************************************************************************************** SUBROUTINE pw_nn_compose_r(weights, pw_in, pw_out) REAL(kind=dp), DIMENSION(0:2, 0:2, 0:2) :: weights - TYPE(pw_r3d_type), INTENT(IN) :: pw_in, pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in, pw_out CHARACTER(len=*), PARAMETER :: routineN = 'pw_nn_compose_r' INTEGER :: handle CALL timeset(routineN, handle) - CPASSERT(pw_in%in_space == REALSPACE) - CPASSERT(pw_out%in_space == REALSPACE) IF (.NOT. ALL(pw_in%pw_grid%bounds_local(:, 2:3) == pw_in%pw_grid%bounds(:, 2:3))) THEN CPABORT("wrong pw distribution") END IF @@ -861,7 +853,7 @@ END SUBROUTINE pw_nn_compose_r !> coeff=(/ 27._dp/64._dp, 9._dp/128._dp, 3._dp/256._dp, 1._dp/512._dp /) ! ************************************************************************************************** SUBROUTINE pw_nn_smear_r(pw_in, pw_out, coeffs) - TYPE(pw_r3d_type), INTENT(IN) :: pw_in, pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in, pw_out REAL(KIND=dp), DIMENSION(4), INTENT(in) :: coeffs INTEGER :: i, j, k @@ -904,7 +896,7 @@ END SUBROUTINE pw_nn_smear_r !> coeff=(/ 25._dp/72._dp, 5._dp/144, 1._dp/288._dp /) ! ************************************************************************************************** SUBROUTINE pw_nn_deriv_r(pw_in, pw_out, coeffs, idir) - TYPE(pw_r3d_type), INTENT(IN) :: pw_in, pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in, pw_out REAL(KIND=dp), DIMENSION(3), INTENT(in) :: coeffs INTEGER :: idir @@ -982,7 +974,7 @@ END SUBROUTINE pw_nn_deriv_r ! ************************************************************************************************** SUBROUTINE add_coarse2fine(coarse_coeffs_pw, fine_values_pw, & weights_1d, w_border0, w_border1, pbc, safe_computation) - TYPE(pw_r3d_type), INTENT(IN) :: coarse_coeffs_pw, fine_values_pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: coarse_coeffs_pw, fine_values_pw REAL(kind=dp), DIMENSION(4), INTENT(in) :: weights_1d REAL(kind=dp), INTENT(in) :: w_border0 REAL(kind=dp), DIMENSION(3), INTENT(in) :: w_border1 @@ -1777,7 +1769,7 @@ END SUBROUTINE add_coarse2fine ! ************************************************************************************************** SUBROUTINE add_fine2coarse(fine_values_pw, coarse_coeffs_pw, & weights_1d, w_border0, w_border1, pbc, safe_computation) - TYPE(pw_r3d_type), INTENT(IN) :: fine_values_pw, coarse_coeffs_pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: fine_values_pw, coarse_coeffs_pw REAL(kind=dp), DIMENSION(4), INTENT(in) :: weights_1d REAL(kind=dp), INTENT(in) :: w_border0 REAL(kind=dp), DIMENSION(3), INTENT(in) :: w_border1 @@ -2601,8 +2593,8 @@ END SUBROUTINE pw_spline_precond_release ! ************************************************************************************************** SUBROUTINE pw_spline_do_precond(preconditioner, in_v, out_v) TYPE(pw_spline_precond_type), INTENT(IN) :: preconditioner - TYPE(pw_r3d_type), INTENT(IN) :: in_v - TYPE(pw_r3d_type), INTENT(INOUT) :: out_v + TYPE(pw_r3d_rs_type), INTENT(IN) :: in_v + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: out_v SELECT CASE (preconditioner%kind) CASE (no_precond) @@ -2655,13 +2647,13 @@ END SUBROUTINE pw_spline_do_precond FUNCTION find_coeffs(values, coeffs, linOp, preconditioner, pool, & eps_r, eps_x, max_iter, sumtype) RESULT(res) - TYPE(pw_r3d_type), INTENT(IN) :: values - TYPE(pw_r3d_type), INTENT(INOUT) :: coeffs + TYPE(pw_r3d_rs_type), INTENT(IN) :: values + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: coeffs INTERFACE SUBROUTINE linOp(pw_in, pw_out) - USE pw_types, ONLY: pw_r3d_type - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + USE pw_types, ONLY: pw_r3d_rs_type + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out END SUBROUTINE linOp END INTERFACE TYPE(pw_spline_precond_type), INTENT(IN) :: preconditioner @@ -2677,16 +2669,16 @@ END SUBROUTINE linOp REAL(kind=dp) :: alpha, beta, eps_r_att, eps_x_att, r_z, & r_z_new TYPE(cp_logger_type), POINTER :: logger - TYPE(pw_r3d_type) :: Ap, p, r, z + TYPE(pw_r3d_rs_type) :: Ap, p, r, z last = .FALSE. res = .FALSE. logger => cp_get_default_logger() - CALL pool%create_pw(r, in_space=REALSPACE) - CALL pool%create_pw(z, in_space=REALSPACE) - CALL pool%create_pw(p, in_space=REALSPACE) - CALL pool%create_pw(Ap, in_space=REALSPACE) + CALL pool%create_pw(r) + CALL pool%create_pw(z) + CALL pool%create_pw(p) + CALL pool%create_pw(Ap) !CALL cp_add_iter_level(logger%iter_info,level_name="SPLINE_FIND_COEFFS") ext_do: DO iiter = 1, max_iter, 10 @@ -2764,7 +2756,7 @@ END FUNCTION find_coeffs SUBROUTINE pw_nn_compose_r_no_pbc(weights_1d, pw_in, pw_out, & sharpen, normalize, transpose, smooth_boundary) REAL(kind=dp), DIMENSION(-1:1) :: weights_1d - TYPE(pw_r3d_type), INTENT(IN) :: pw_in, pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in, pw_out LOGICAL, INTENT(in), OPTIONAL :: sharpen, normalize, transpose, & smooth_boundary @@ -3103,8 +3095,8 @@ END SUBROUTINE pw_nn_compose_r_no_pbc ! ************************************************************************************************** SUBROUTINE spl3_nopbc(pw_in, pw_out) - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CALL pw_zero(pw_out) CALL pw_nn_compose_r_no_pbc(weights_1d=spl3_1d_coeffs0, pw_in=pw_in, & @@ -3119,8 +3111,8 @@ END SUBROUTINE spl3_nopbc ! ************************************************************************************************** SUBROUTINE spl3_nopbct(pw_in, pw_out) - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CALL pw_zero(pw_out) CALL pw_nn_compose_r_no_pbc(weights_1d=spl3_1d_coeffs0, pw_in=pw_in, & @@ -3135,8 +3127,8 @@ END SUBROUTINE spl3_nopbct ! ************************************************************************************************** SUBROUTINE spl3_pbc(pw_in, pw_out) - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CALL pw_zero(pw_out) CALL pw_nn_smear_r(pw_in, pw_out, coeffs=spline3_coeffs) @@ -3157,7 +3149,7 @@ END SUBROUTINE spl3_pbc ! ************************************************************************************************** FUNCTION Eval_Interp_Spl3_pbc(vec, pw) RESULT(val) REAL(KIND=dp), DIMENSION(3), INTENT(in) :: vec - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw REAL(KIND=dp) :: val INTEGER :: i, ivec(3), j, k, npts(3) @@ -3306,7 +3298,7 @@ END FUNCTION Eval_Interp_Spl3_pbc ! ************************************************************************************************** FUNCTION Eval_d_Interp_Spl3_pbc(vec, pw) RESULT(val) REAL(KIND=dp), DIMENSION(3), INTENT(in) :: vec - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw REAL(KIND=dp) :: val(3) INTEGER :: i, ivec(3), j, k, npts(3) diff --git a/src/pw/pw_types.F b/src/pw/pw_types.F index 7fb9aea0fb..a6031862d9 100644 --- a/src/pw/pw_types.F +++ b/src/pw/pw_types.F @@ -35,38 +35,36 @@ MODULE pw_types #:include 'pw_types.fypp' PRIVATE - #:for kind in pw_kinds - PUBLIC :: pw_${kind}$_type, pw_${kind}$_p_type + #:for space in pw_spaces + #:for kind in pw_kinds + PUBLIC :: pw_${kind}$_${space}$_type, pw_${kind}$_${space}$_p_type + #:endfor #:endfor - ! Flags for the structure member 'in_space' - ! NOSPACE only for internal usage, we enforce the choice of a proper space - INTEGER, PARAMETER, PUBLIC :: NOSPACE = 371 - INTEGER, PARAMETER, PUBLIC :: REALSPACE = 372, RECIPROCALSPACE = 373 - - #:for kind, type in zip(pw_kinds, pw_types) + #:for space in pw_spaces + #:for kind, type in zip(pw_kinds, pw_types) ! ************************************************************************************************** - TYPE pw_${kind}$_type - ${type}$, CONTIGUOUS, POINTER :: array => NULL() - TYPE(pw_grid_type), POINTER :: pw_grid => NULL() - INTEGER :: in_space = NOSPACE - CONTAINS - PROCEDURE, PUBLIC, NON_OVERRIDABLE :: create => pw_create_${kind}$ - PROCEDURE, PUBLIC, NON_OVERRIDABLE :: release => pw_release_${kind}$ - END TYPE pw_${kind}$_type + TYPE pw_${kind}$_${space}$_type + ${type}$, CONTIGUOUS, POINTER :: array => NULL() + TYPE(pw_grid_type), POINTER :: pw_grid => NULL() + CONTAINS + PROCEDURE, PUBLIC, NON_OVERRIDABLE :: create => pw_create_${kind}$_${space}$ + PROCEDURE, PUBLIC, NON_OVERRIDABLE :: release => pw_release_${kind}$_${space}$ + END TYPE pw_${kind}$_${space}$_type ! ************************************************************************************************** - TYPE pw_${kind}$_p_type - TYPE(pw_${kind}$_type), POINTER :: pw => NULL() - END TYPE pw_${kind}$_p_type + TYPE pw_${kind}$_${space}$_p_type + TYPE(pw_${kind}$_${space}$_type), POINTER :: pw => NULL() + END TYPE pw_${kind}$_${space}$_p_type + #:endfor #:endfor CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'pw_types' LOGICAL, PARAMETER, PRIVATE :: debug_this_module = .FALSE. CONTAINS - - #:for kind, type in zip(pw_kinds, pw_types) + #:for space in pw_spaces + #:for kind, type in zip(pw_kinds, pw_types) ! ************************************************************************************************** !> \brief releases the given pw !> \param pw the pw to release @@ -76,75 +74,69 @@ MODULE pw_types !> \note !> see doc/ReferenceCounting.html ! ************************************************************************************************** - SUBROUTINE pw_release_${kind}$ (pw) - CLASS(pw_${kind}$_type), INTENT(INOUT) :: pw + SUBROUTINE pw_release_${kind}$_${space}$ (pw) + CLASS(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw - IF (ASSOCIATED(pw%array)) DEALLOCATE (pw%array) - CALL pw_grid_release(pw%pw_grid) - END SUBROUTINE pw_release_${kind}$ + IF (ASSOCIATED(pw%array)) DEALLOCATE (pw%array) + CALL pw_grid_release(pw%pw_grid) + END SUBROUTINE pw_release_${kind}$_${space}$ ! ************************************************************************************************** -!> \brief allocates and initializes pw_r3d_type +!> \brief allocates and initializes pw_r3d_rs_type !> \param pw the type that will bw allocated and initialized !> \param pw_grid ... -!> \param use_data which kind of data will be used -!> \param in_space in which space the pw is (real or reciprocal) !> \param array_ptr pointer with to data !> \par History !> 11.2003 created [fawzi] !> \author fawzi ! ************************************************************************************************** - SUBROUTINE pw_create_${kind}$ (pw, pw_grid, in_space, array_ptr) - CLASS(pw_${kind}$_type), INTENT(INOUT) :: pw - TYPE(pw_grid_type), INTENT(IN), POINTER :: pw_grid - INTEGER, INTENT(in) :: in_space - ${type}$, CONTIGUOUS, INTENT(IN), OPTIONAL, POINTER :: array_ptr + SUBROUTINE pw_create_${kind}$_${space}$ (pw, pw_grid, array_ptr) + CLASS(pw_${kind}$_${space}$_type), INTENT(INOUT) :: pw + TYPE(pw_grid_type), INTENT(IN), POINTER :: pw_grid + ${type}$, CONTIGUOUS, INTENT(IN), OPTIONAL, POINTER :: array_ptr - CHARACTER(len=*), PARAMETER :: routineN = 'pw_create_${kind}$' + CHARACTER(len=*), PARAMETER :: routineN = 'pw_create_${kind}$' - INTEGER :: handle + INTEGER :: handle - CALL timeset(routineN, handle) + CALL timeset(routineN, handle) - IF (in_space /= REALSPACE .AND. in_space /= RECIPROCALSPACE) & - CPABORT("Choose a proper space in which the grid lives!") + ! Ensure a clean grid to prevent memory leaks + CALL pw%release() - ! Ensure a clean grid to prevent memory leaks - CALL pw%release() + pw%pw_grid => pw_grid + CALL pw_grid_retain(pw%pw_grid) - pw%pw_grid => pw_grid - CALL pw_grid_retain(pw%pw_grid) - - #:if kind[1]=="1" - IF (PRESENT(array_ptr)) THEN - IF (ASSOCIATED(array_ptr)) THEN - CPASSERT(SIZE(array_ptr) == pw%pw_grid%ngpts_cut_local) - pw%array(1:pw%pw_grid%ngpts_cut_local) => array_ptr - END IF - END IF - IF (.NOT. ASSOCIATED(pw%array)) ALLOCATE (pw%array(pw%pw_grid%ngpts_cut_local)) - #:elif kind[1]=="3" - ASSOCIATE (bounds => pw%pw_grid%bounds_local) + #:if kind[1]=="1" IF (PRESENT(array_ptr)) THEN - IF (ASSOCIATED(array_ptr)) THEN - IF (ALL(bounds(1, :) <= bounds(2, :))) THEN - CPASSERT(ALL(LBOUND(array_ptr) == bounds(1, :))) - CPASSERT(ALL(UBOUND(array_ptr) == bounds(2, :))) - END IF - pw%array => array_ptr - END IF + IF (ASSOCIATED(array_ptr)) THEN + CPASSERT(SIZE(array_ptr) == pw%pw_grid%ngpts_cut_local) + pw%array(1:pw%pw_grid%ngpts_cut_local) => array_ptr END IF - IF (.NOT. ASSOCIATED(pw%array)) THEN - ALLOCATE (pw%array( & - bounds(1, 1):bounds(2, 1), & - bounds(1, 2):bounds(2, 2), & - bounds(1, 3):bounds(2, 3))) END IF - END ASSOCIATE - #:endif - pw%in_space = in_space - CALL timestop(handle) - END SUBROUTINE pw_create_${kind}$ + IF (.NOT. ASSOCIATED(pw%array)) ALLOCATE (pw%array(pw%pw_grid%ngpts_cut_local)) + #:elif kind[1]=="3" + ASSOCIATE (bounds => pw%pw_grid%bounds_local) + IF (PRESENT(array_ptr)) THEN + IF (ASSOCIATED(array_ptr)) THEN + IF (ALL(bounds(1, :) <= bounds(2, :))) THEN + CPASSERT(ALL(LBOUND(array_ptr) == bounds(1, :))) + CPASSERT(ALL(UBOUND(array_ptr) == bounds(2, :))) + END IF + pw%array => array_ptr + END IF + END IF + IF (.NOT. ASSOCIATED(pw%array)) THEN + ALLOCATE (pw%array( & + bounds(1, 1):bounds(2, 1), & + bounds(1, 2):bounds(2, 2), & + bounds(1, 3):bounds(2, 3))) + END IF + END ASSOCIATE + #:endif + CALL timestop(handle) + END SUBROUTINE pw_create_${kind}$_${space}$ + #:endfor #:endfor END MODULE pw_types diff --git a/src/pw/realspace_grid_cube.F b/src/pw/realspace_grid_cube.F index 00c363cf96..11c333a622 100644 --- a/src/pw/realspace_grid_cube.F +++ b/src/pw/realspace_grid_cube.F @@ -18,7 +18,7 @@ MODULE realspace_grid_cube mp_file_type_free, mp_file_type_hindexed_make_chv, mp_file_type_set_view_chv, & mpi_character_size USE pw_grid_types, ONLY: PW_MODE_LOCAL - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -48,7 +48,7 @@ MODULE realspace_grid_cube ! ************************************************************************************************** SUBROUTINE pw_to_cube(pw, unit_nr, title, particles_r, particles_z, stride, zero_tails, & silent, mpi_io) - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw INTEGER, INTENT(IN) :: unit_nr CHARACTER(*), INTENT(IN), OPTIONAL :: title REAL(KIND=dp), DIMENSION(:, :), INTENT(IN), & @@ -236,7 +236,7 @@ END SUBROUTINE pw_to_cube ! ************************************************************************************************** SUBROUTINE cube_to_pw(grid, filename, scaling, parallel_read, silent) - TYPE(pw_r3d_type), INTENT(IN) :: grid + TYPE(pw_r3d_rs_type), INTENT(IN) :: grid CHARACTER(len=*), INTENT(in) :: filename REAL(kind=dp), INTENT(in) :: scaling LOGICAL, INTENT(in) :: parallel_read @@ -368,7 +368,7 @@ END SUBROUTINE cube_to_pw ! ************************************************************************************************** SUBROUTINE cube_to_pw_parallel(grid, filename, scaling, msglen, silent) - TYPE(pw_r3d_type), INTENT(IN) :: grid + TYPE(pw_r3d_rs_type), INTENT(IN) :: grid CHARACTER(len=*), INTENT(in) :: filename REAL(kind=dp), INTENT(in) :: scaling INTEGER, INTENT(in) :: msglen @@ -623,7 +623,7 @@ END SUBROUTINE cube_to_pw_parallel SUBROUTINE pw_to_cube_parallel(grid, unit_nr, title, particles_r, particles_z, stride, zero_tails, & msglen) - TYPE(pw_r3d_type), INTENT(IN) :: grid + TYPE(pw_r3d_rs_type), INTENT(IN) :: grid TYPE(mp_file_type), INTENT(IN) :: unit_nr CHARACTER(*), INTENT(IN), OPTIONAL :: title REAL(KIND=dp), DIMENSION(:, :), INTENT(IN), & @@ -816,10 +816,10 @@ END SUBROUTINE pw_to_cube_parallel !> \author Vladimir Rybkin ! ************************************************************************************************** SUBROUTINE pw_to_simple_volumetric(pw, unit_nr, stride, pw2) - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw INTEGER, INTENT(IN) :: unit_nr INTEGER, DIMENSION(:), INTENT(IN), OPTIONAL :: stride - TYPE(pw_r3d_type), INTENT(IN), OPTIONAL :: pw2 + TYPE(pw_r3d_rs_type), INTENT(IN), OPTIONAL :: pw2 CHARACTER(len=*), PARAMETER :: routineN = 'pw_to_simple_volumetric' diff --git a/src/pw/realspace_grid_types.F b/src/pw/realspace_grid_types.F index 2b109352e4..fc21f14b46 100644 --- a/src/pw/realspace_grid_types.F +++ b/src/pw/realspace_grid_types.F @@ -37,7 +37,7 @@ MODULE realspace_grid_types USE pw_grids, ONLY: pw_grid_release,& pw_grid_retain USE pw_methods, ONLY: pw_integrate_function - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE util, ONLY: get_limit !$ USE OMP_LIB, ONLY: omp_get_max_threads, omp_get_thread_num, omp_get_num_threads @@ -654,7 +654,7 @@ END SUBROUTINE rs_grid_print ! ************************************************************************************************** SUBROUTINE transfer_rs2pw(rs, pw) TYPE(realspace_grid_type), INTENT(IN) :: rs - TYPE(pw_r3d_type), INTENT(INOUT) :: pw + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw CHARACTER(len=*), PARAMETER :: routineN = 'transfer_rs2pw' @@ -697,7 +697,7 @@ END SUBROUTINE transfer_rs2pw SUBROUTINE transfer_pw2rs(rs, pw) TYPE(realspace_grid_type), INTENT(IN) :: rs - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw CHARACTER(len=*), PARAMETER :: routineN = 'transfer_pw2rs' @@ -764,7 +764,7 @@ END SUBROUTINE transfer_pw2rs ! ************************************************************************************************** SUBROUTINE transfer_rs2pw_replicated(rs, pw) TYPE(realspace_grid_type), INTENT(IN) :: rs - TYPE(pw_r3d_type), INTENT(INOUT) :: pw + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw INTEGER :: dest, ii, ip, ix, iy, iz, nma, nn, s(3), & source @@ -833,7 +833,7 @@ END SUBROUTINE transfer_rs2pw_replicated ! ************************************************************************************************** SUBROUTINE transfer_pw2rs_replicated(rs, pw) TYPE(realspace_grid_type), INTENT(IN) :: rs - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw INTEGER :: dest, i, ii, im, ip, ix, iy, iz, j, jm, & k, km, nma, nn, source @@ -954,7 +954,7 @@ END SUBROUTINE transfer_pw2rs_replicated ! ************************************************************************************************** SUBROUTINE transfer_rs2pw_distributed(rs, pw) TYPE(realspace_grid_type), INTENT(IN) :: rs - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw CHARACTER(LEN=200) :: error_string INTEGER :: completed, dest_down, dest_up, i, idir, j, k, lb, my_id, my_pw_rank, my_rs_rank, & @@ -1441,7 +1441,7 @@ END SUBROUTINE transfer_rs2pw_distributed ! ************************************************************************************************** SUBROUTINE transfer_pw2rs_distributed(rs, pw) TYPE(realspace_grid_type), INTENT(IN) :: rs - TYPE(pw_r3d_type), INTENT(IN) :: pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw INTEGER :: completed, dest_down, dest_up, i, idir, j, k, lb, my_id, my_pw_rank, my_rs_rank, & n_shifts, nn, num_threads, position, source_down, source_up, ub, x, y, z diff --git a/src/pw/rs_methods.F b/src/pw/rs_methods.F index a127cb47be..4736d2b54c 100644 --- a/src/pw/rs_methods.F +++ b/src/pw/rs_methods.F @@ -20,10 +20,8 @@ MODULE rs_methods pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE realspace_grid_types, ONLY: realspace_grid_desc_type,& realspace_grid_type,& rs_grid_create,& @@ -60,8 +58,8 @@ MODULE rs_methods ! ************************************************************************************************** SUBROUTINE derive_fdm_cd3(f, df, rs_grid) - TYPE(pw_r3d_type), INTENT(IN) :: f - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: df + TYPE(pw_r3d_rs_type), INTENT(IN) :: f + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: df TYPE(realspace_grid_type), INTENT(IN) :: rs_grid CHARACTER(LEN=*), PARAMETER :: routineN = 'derive_fdm_cd3' @@ -129,8 +127,8 @@ END SUBROUTINE derive_fdm_cd3 ! ************************************************************************************************** SUBROUTINE derive_fdm_cd5(f, df, rs_grid) - TYPE(pw_r3d_type), INTENT(IN) :: f - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: df + TYPE(pw_r3d_rs_type), INTENT(IN) :: f + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: df TYPE(realspace_grid_type), INTENT(IN) :: rs_grid CHARACTER(LEN=*), PARAMETER :: routineN = 'derive_fdm_cd5' @@ -198,8 +196,8 @@ END SUBROUTINE derive_fdm_cd5 ! ************************************************************************************************** SUBROUTINE derive_fdm_cd7(f, df, rs_grid) - TYPE(pw_r3d_type), INTENT(IN) :: f - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: df + TYPE(pw_r3d_rs_type), INTENT(IN) :: f + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: df TYPE(realspace_grid_type), INTENT(IN) :: rs_grid CHARACTER(LEN=*), PARAMETER :: routineN = 'derive_fdm_cd7' @@ -369,8 +367,8 @@ SUBROUTINE pw_mollifier(pw_pool, zeta, x_glbl, y_glbl, z_glbl, pw_in, pw_out) TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool REAL(dp), INTENT(IN) :: zeta REAL(dp), ALLOCATABLE, DIMENSION(:), INTENT(IN) :: x_glbl, y_glbl, z_glbl - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out CHARACTER(LEN=*), PARAMETER :: routineN = 'pw_mollifier' @@ -380,9 +378,9 @@ SUBROUTINE pw_mollifier(pw_pool, zeta, x_glbl, y_glbl, z_glbl, pw_in, pw_out) REAL(dp) :: normfact, xi, xmax, xmin, yj, ymax, & ymin, zk, zmax, zmin REAL(dp), DIMENSION(3, 3) :: dh - TYPE(pw_c1d_type) :: G_gs, pw_in_gs, pw_out_gs + TYPE(pw_c1d_gs_type) :: G_gs, pw_in_gs, pw_out_gs TYPE(pw_grid_type), POINTER :: pw_grid - TYPE(pw_r3d_type) :: G + TYPE(pw_r3d_rs_type) :: G CALL timeset(routineN, handle) @@ -395,10 +393,10 @@ SUBROUTINE pw_mollifier(pw_pool, zeta, x_glbl, y_glbl, z_glbl, pw_in, pw_out) lb2 = bounds_local(1, 2); ub2 = bounds_local(2, 2) lb3 = bounds_local(1, 3); ub3 = bounds_local(2, 3) - CALL pw_pool%create_pw(G, in_space=REALSPACE) - CALL pw_pool%create_pw(G_gs, in_space=RECIPROCALSPACE) - CALL pw_pool%create_pw(pw_in_gs, in_space=RECIPROCALSPACE) - CALL pw_pool%create_pw(pw_out_gs, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(G) + CALL pw_pool%create_pw(G_gs) + CALL pw_pool%create_pw(pw_in_gs) + CALL pw_pool%create_pw(pw_out_gs) CALL pw_zero(G) xmin = x_glbl(bounds(1, 1)); xmax = x_glbl(bounds(2, 1)) diff --git a/src/pw_env/cp_spline_utils.F b/src/pw_env/cp_spline_utils.F index 04d6e10e39..9ce7ab01eb 100644 --- a/src/pw_env/cp_spline_utils.F +++ b/src/pw_env/cp_spline_utils.F @@ -24,8 +24,7 @@ MODULE cp_spline_utils pw_spline_precond_create, pw_spline_precond_release, pw_spline_precond_set_kind, & pw_spline_precond_type, spl3_1d_transf_border1, spl3_1d_transf_coeffs, spl3_nopbc, & spl3_nopbct, spl3_pbc - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -54,8 +53,8 @@ MODULE cp_spline_utils ! ************************************************************************************************** SUBROUTINE pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section) - TYPE(pw_r3d_type), INTENT(IN) :: pw_fine_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_coarse_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_fine_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_coarse_out TYPE(pw_pool_type), POINTER :: coarse_pool TYPE(section_vals_type), POINTER :: param_section @@ -67,7 +66,7 @@ SUBROUTINE pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section) INTEGER, SAVE :: ifile = 0 LOGICAL :: pbc, safe_computation, success REAL(kind=dp) :: eps_r, eps_x - TYPE(pw_r3d_type) :: coeffs, values + TYPE(pw_r3d_rs_type) :: coeffs, values TYPE(pw_spline_precond_type) :: precond ifile = ifile + 1 @@ -90,8 +89,7 @@ SUBROUTINE pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section) pbc = (interp_kind == spline3_pbc_interp) CPASSERT(pbc .OR. interp_kind == spline3_nopbc_interp) bo = pw_coarse_out%pw_grid%bounds_local - CALL coarse_pool%create_pw(values, & - in_space=REALSPACE) + CALL coarse_pool%create_pw(values) CALL pw_zero(values) CALL add_fine2coarse(fine_values_pw=pw_fine_in, & @@ -100,8 +98,7 @@ SUBROUTINE pw_restrict_s3(pw_fine_in, pw_coarse_out, coarse_pool, param_section) w_border1=spl3_1d_transf_border1/2._dp, pbc=pbc, & safe_computation=safe_computation) - CALL coarse_pool%create_pw(coeffs, & - in_space=REALSPACE) + CALL coarse_pool%create_pw(coeffs) CALL pw_spline_precond_create(precond, precond_kind=aint_precond, & pool=coarse_pool, pbc=pbc, transpose=.TRUE.) CALL pw_spline_do_precond(precond, values, coeffs) @@ -138,7 +135,7 @@ END SUBROUTINE pw_restrict_s3 ! ************************************************************************************************** SUBROUTINE pw_prolongate_s3(pw_coarse_in, pw_fine_out, coarse_pool, & param_section) - TYPE(pw_r3d_type), INTENT(IN) :: pw_coarse_in, pw_fine_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_coarse_in, pw_fine_out TYPE(pw_pool_type), POINTER :: coarse_pool TYPE(section_vals_type), POINTER :: param_section @@ -150,13 +147,12 @@ SUBROUTINE pw_prolongate_s3(pw_coarse_in, pw_fine_out, coarse_pool, & INTEGER, SAVE :: ifile = 0 LOGICAL :: pbc, safe_computation, success REAL(kind=dp) :: eps_r, eps_x - TYPE(pw_r3d_type) :: coeffs + TYPE(pw_r3d_rs_type) :: coeffs TYPE(pw_spline_precond_type) :: precond ifile = ifile + 1 CALL timeset(routineN, handle) - CALL coarse_pool%create_pw(coeffs, & - in_space=REALSPACE) + CALL coarse_pool%create_pw(coeffs) bo = pw_coarse_in%pw_grid%bounds_local CALL section_vals_val_get(param_section, "safe_computation", & l_val=safe_computation) diff --git a/src/pw_env/rs_pw_interface.F b/src/pw_env/rs_pw_interface.F index d197963044..dffed52bf2 100644 --- a/src/pw_env/rs_pw_interface.F +++ b/src/pw_env/rs_pw_interface.F @@ -29,10 +29,8 @@ MODULE rs_pw_interface USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pools_create_pws,& pw_pools_give_back_pws - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE realspace_grid_types, ONLY: realspace_grid_desc_p_type,& realspace_grid_type,& transfer_pw2rs,& @@ -68,16 +66,16 @@ SUBROUTINE density_rs2pw(pw_env, rs_rho, rho, rho_gspace) TYPE(pw_env_type), INTENT(IN) :: pw_env TYPE(realspace_grid_type), DIMENSION(:), & INTENT(IN) :: rs_rho - TYPE(pw_r3d_type), INTENT(INOUT) :: rho - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_gspace CHARACTER(LEN=*), PARAMETER :: routineN = 'density_rs2pw' INTEGER :: handle, igrid_level, interp_kind TYPE(gridlevel_info_type), POINTER :: gridlevel_info - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace TYPE(realspace_grid_desc_p_type), DIMENSION(:), & POINTER :: rs_descs @@ -89,9 +87,9 @@ SUBROUTINE density_rs2pw(pw_env, rs_rho, rho, rho_gspace) CALL section_vals_val_get(pw_env%interp_section, "KIND", i_val=interp_kind) - CALL pw_pools_create_pws(pw_pools, mgrid_rspace, in_space=REALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_rspace) - CALL pw_pools_create_pws(pw_pools, mgrid_gspace, in_space=RECIPROCALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_gspace) IF (gridlevel_info%ngrid_levels == 1) THEN CALL transfer_rs2pw(rs_rho(1), rho) @@ -154,7 +152,7 @@ SUBROUTINE potential_pw2rs(rs_v, v_rspace, pw_env) TYPE(realspace_grid_type), DIMENSION(:), & INTENT(IN) :: rs_v - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(pw_env_type), INTENT(IN) :: pw_env CHARACTER(len=*), PARAMETER :: routineN = 'potential_pw2rs' @@ -163,9 +161,9 @@ SUBROUTINE potential_pw2rs(rs_v, v_rspace, pw_env) interp_kind REAL(KIND=dp) :: scale TYPE(gridlevel_info_type), POINTER :: gridlevel_info - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace CALL timeset(routineN, handle) @@ -173,13 +171,13 @@ SUBROUTINE potential_pw2rs(rs_v, v_rspace, pw_env) CALL pw_env_get(pw_env, pw_pools=pw_pools, gridlevel_info=gridlevel_info, & auxbas_grid=auxbas_grid) - CALL pw_pools_create_pws(pw_pools, mgrid_rspace, in_space=REALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_rspace) ! use either realspace or fft techniques to get the potential on the rs multigrids CALL section_vals_val_get(pw_env%interp_section, "KIND", i_val=interp_kind) SELECT CASE (interp_kind) CASE (pw_interp) - CALL pw_pools_create_pws(pw_pools, mgrid_gspace, in_space=RECIPROCALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_gspace) CALL pw_transfer(v_rspace, mgrid_gspace(auxbas_grid)) DO igrid_level = 1, gridlevel_info%ngrid_levels IF (igrid_level /= auxbas_grid) THEN diff --git a/src/qmmm_gpw_energy.F b/src/qmmm_gpw_energy.F index f33fe91aef..0349cdaf85 100644 --- a/src/qmmm_gpw_energy.F +++ b/src/qmmm_gpw_energy.F @@ -47,8 +47,7 @@ MODULE qmmm_gpw_energy USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pools_create_pws,& pw_pools_give_back_pws - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qmmm_gaussian_types, ONLY: qmmm_gaussian_p_type,& qmmm_gaussian_type USE qmmm_se_energy, ONLY: build_se_qmmm_matrix @@ -242,7 +241,7 @@ SUBROUTINE qmmm_elec_with_gaussian(qmmm_env, v_qmmm, mm_particles, & aug_pools, cube_info, para_env, eps_mm_rspace, pw_pools, & auxbas_grid, coarser_grid, interp_section, mm_cell) TYPE(qmmm_env_qm_type), POINTER :: qmmm_env - TYPE(pw_r3d_type), INTENT(IN) :: v_qmmm + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_qmmm TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: aug_pools TYPE(cube_info_type), DIMENSION(:), POINTER :: cube_info @@ -258,7 +257,7 @@ SUBROUTINE qmmm_elec_with_gaussian(qmmm_env, v_qmmm, mm_particles, & INTEGER :: handle, handle2, igrid, ilevel, & kind_interp, lb(3), ngrids, ub(3) LOGICAL :: shells - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: grids + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: grids CPASSERT(ASSOCIATED(mm_particles)) CPASSERT(ASSOCIATED(qmmm_env%mm_atom_chrg)) @@ -268,7 +267,7 @@ SUBROUTINE qmmm_elec_with_gaussian(qmmm_env, v_qmmm, mm_particles, & !Statements CALL timeset(routineN, handle) ngrids = SIZE(pw_pools) - CALL pw_pools_create_pws(aug_pools, grids, in_space=REALSPACE) + CALL pw_pools_create_pws(aug_pools, grids) DO igrid = 1, ngrids CALL pw_zero(grids(igrid)) END DO @@ -370,7 +369,7 @@ SUBROUTINE qmmm_elec_with_gaussian_low(tmp_grid, mm_particles, mm_charges, & eps_mm_rspace, pgfs, auxbas_grid, coarser_grid, & potentials, mm_cell, dOmmOqm, periodic, per_potentials, par_scheme, & qmmm_spherical_cutoff, shells) - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: tmp_grid + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: tmp_grid TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index @@ -531,7 +530,7 @@ SUBROUTINE qmmm_elec_with_gaussian_LG(pgfs, cgrid, mm_charges, mm_atom_index, & mm_particles, para_env, per_potentials, & mm_cell, dOmmOqm, par_scheme, qmmm_spherical_cutoff, shells) TYPE(qmmm_gaussian_p_type), DIMENSION(:), POINTER :: pgfs - TYPE(pw_r3d_type), INTENT(IN) :: cgrid + TYPE(pw_r3d_rs_type), INTENT(IN) :: cgrid REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles @@ -557,7 +556,7 @@ SUBROUTINE qmmm_elec_with_gaussian_LG(pgfs, cgrid, mm_charges, mm_atom_index, & xs2, xs3 REAL(KIND=dp), DIMENSION(3) :: ra, vec REAL(KIND=dp), DIMENSION(:, :, :), POINTER :: grid, grid2 - TYPE(pw_r3d_type), POINTER :: pw + TYPE(pw_r3d_rs_type), POINTER :: pw TYPE(qmmm_per_pot_type), POINTER :: per_pot CALL timeset(routineN, handle) @@ -756,7 +755,7 @@ SUBROUTINE qmmm_elec_with_gaussian_LR(pgfs, grid, mm_charges, mm_atom_index, & mm_particles, para_env, potentials, & mm_cell, dOmmOqm, par_scheme, qmmm_spherical_cutoff, shells) TYPE(qmmm_gaussian_p_type), DIMENSION(:), POINTER :: pgfs - TYPE(pw_r3d_type), INTENT(IN) :: grid + TYPE(pw_r3d_rs_type), INTENT(IN) :: grid REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles diff --git a/src/qmmm_gpw_forces.F b/src/qmmm_gpw_forces.F index dda3d89aec..2dd7dfe825 100644 --- a/src/qmmm_gpw_forces.F +++ b/src/qmmm_gpw_forces.F @@ -49,9 +49,8 @@ MODULE qmmm_gpw_forces pw_pool_type,& pw_pools_create_pws,& pw_pools_give_back_pws - USE pw_types, ONLY: REALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qmmm_gaussian_types, ONLY: qmmm_gaussian_p_type,& qmmm_gaussian_type USE qmmm_gpw_energy, ONLY: qmmm_elec_with_gaussian,& @@ -114,12 +113,12 @@ SUBROUTINE qmmm_forces(qs_env, qmmm_env, mm_particles, calc_force, mm_cell) TYPE(cp_logger_type), POINTER :: logger TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), POINTER :: rho0_s_gs, rho_core + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs, rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_r3d_type), POINTER :: rho_tot_r, rho_tot_r2 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), POINTER :: rho_tot_r, rho_tot_r2 TYPE(qs_energy_type), POINTER :: energy TYPE(qs_ks_qmmm_env_type), POINTER :: ks_qmmm_env_loc TYPE(qs_rho_type), POINTER :: rho @@ -206,7 +205,7 @@ SUBROUTINE qmmm_forces(qs_env, qmmm_env, mm_particles, calc_force, mm_cell) auxbas_pw_pool=auxbas_pool) NULLIFY (rho_tot_r) ALLOCATE (rho_tot_r) - CALL auxbas_pool%create_pw(rho_tot_r, in_space=REALSPACE) + CALL auxbas_pool%create_pw(rho_tot_r) ! IF GAPW the core charge is replaced by the compensation charge IF (gapw) THEN IF (dft_control%qs_control%gapw_control%nopaw_as_gpw) THEN @@ -214,7 +213,7 @@ SUBROUTINE qmmm_forces(qs_env, qmmm_env, mm_particles, calc_force, mm_cell) energy%qmmm_nu = pw_integral_ab(rho_tot_r, ks_qmmm_env_loc%v_qmmm_rspace) NULLIFY (rho_tot_r2) ALLOCATE (rho_tot_r2) - CALL auxbas_pool%create_pw(rho_tot_r2, in_space=REALSPACE) + CALL auxbas_pool%create_pw(rho_tot_r2) CALL pw_transfer(rho0_s_gs, rho_tot_r2) CALL pw_axpy(rho_tot_r2, rho_tot_r) CALL auxbas_pool%give_back_pw(rho_tot_r2) @@ -398,7 +397,7 @@ SUBROUTINE qmmm_forces_with_gaussian(rho, qmmm_env, mm_particles, & aug_pools, auxbas_grid, coarser_grid, cube_info, para_env, & eps_mm_rspace, pw_pools, Forces, Forces_added_charges, Forces_added_shells, & interp_section, iw, mm_cell) - TYPE(pw_r3d_type), POINTER :: rho + TYPE(pw_r3d_rs_type), POINTER :: rho TYPE(qmmm_env_qm_type), POINTER :: qmmm_env TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: aug_pools @@ -423,7 +422,7 @@ SUBROUTINE qmmm_forces_with_gaussian(rho, qmmm_env, mm_particles, & REAL(KIND=dp), DIMENSION(:, :), POINTER :: tmp TYPE(mp_comm_type) :: group TYPE(mp_request_type) :: request - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: grids + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: grids ! Statements @@ -435,7 +434,7 @@ SUBROUTINE qmmm_forces_with_gaussian(rho, qmmm_env, mm_particles, & CPASSERT(ASSOCIATED(Forces)) !Statements ngrids = SIZE(pw_pools) - CALL pw_pools_create_pws(aug_pools, grids, in_space=REALSPACE) + CALL pw_pools_create_pws(aug_pools, grids) DO igrid = 1, ngrids CALL pw_zero(grids(igrid)) END DO @@ -595,7 +594,7 @@ SUBROUTINE qmmm_force_with_gaussian_low(grids, mm_particles, mm_charges, & eps_mm_rspace, auxbas_grid, coarser_grid, pgfs, potentials, Forces, & aug_pools, mm_cell, dOmmOqm, periodic, per_potentials, iw, par_scheme, & qmmm_spherical_cutoff, shells) - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: grids + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: grids TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index @@ -792,7 +791,7 @@ SUBROUTINE qmmm_forces_with_gaussian_LG(pgfs, cgrid, num_mm_atoms, mm_charges, m mm_particles, para_env, coarser_grid_level, Forces, per_potentials, & aug_pools, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells) TYPE(qmmm_gaussian_p_type), DIMENSION(:), POINTER :: pgfs - TYPE(pw_r3d_type), INTENT(IN) :: cgrid + TYPE(pw_r3d_rs_type), INTENT(IN) :: cgrid INTEGER, INTENT(IN) :: num_mm_atoms REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index @@ -822,7 +821,7 @@ SUBROUTINE qmmm_forces_with_gaussian_LG(pgfs, cgrid, num_mm_atoms, mm_charges, m REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: LForces REAL(KIND=dp), DIMENSION(3) :: ra, val, vec REAL(KIND=dp), DIMENSION(:, :, :), POINTER :: grid, grid2 - TYPE(pw_r3d_type), POINTER :: pw + TYPE(pw_r3d_rs_type), POINTER :: pw TYPE(qmmm_per_pot_type), POINTER :: per_pot CALL timeset(routineN, handle) @@ -1148,7 +1147,7 @@ SUBROUTINE qmmm_forces_with_gaussian_LR(pgfs, cgrid, num_mm_atoms, mm_charges, m mm_particles, para_env, coarser_grid_level, Forces, potentials, & aug_pools, mm_cell, dOmmOqm, iw, par_scheme, qmmm_spherical_cutoff, shells) TYPE(qmmm_gaussian_p_type), DIMENSION(:), POINTER :: pgfs - TYPE(pw_r3d_type), INTENT(IN) :: cgrid + TYPE(pw_r3d_rs_type), INTENT(IN) :: cgrid INTEGER, INTENT(IN) :: num_mm_atoms REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index @@ -1325,7 +1324,7 @@ END SUBROUTINE qmmm_forces_with_gaussian_LR SUBROUTINE qmmm_debug_forces(rho, qs_env, qmmm_env, Analytical_Forces, & mm_particles, mm_atom_index, num_mm_atoms, & interp_section, mm_cell) - TYPE(pw_r3d_type), POINTER :: rho + TYPE(pw_r3d_rs_type), POINTER :: rho TYPE(qs_environment_type), POINTER :: qs_env TYPE(qmmm_env_qm_type), POINTER :: qmmm_env REAL(KIND=dp), DIMENSION(:, :), POINTER :: Analytical_Forces @@ -1346,7 +1345,7 @@ SUBROUTINE qmmm_debug_forces(rho, qs_env, qmmm_env, Analytical_Forces, & TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools - TYPE(pw_r3d_type) :: v_qmmm_rspace + TYPE(pw_r3d_rs_type) :: v_qmmm_rspace TYPE(qs_ks_qmmm_env_type), POINTER :: ks_qmmm_env_loc TYPE(section_vals_type), POINTER :: input_section, print_section @@ -1361,8 +1360,7 @@ SUBROUTINE qmmm_debug_forces(rho, qs_env, qmmm_env, Analytical_Forces, & logger => cp_get_default_logger() iw = cp_print_key_unit_nr(logger, print_section, "PROGRAM_RUN_INFO", extension=".qmmmLog") CALL pw_env_get(pw_env=pw_env, pw_pools=pw_pools) - CALL pw_pools(1)%pool%create_pw(v_qmmm_rspace, & - in_space=REALSPACE) + CALL pw_pools(1)%pool%create_pw(v_qmmm_rspace) ALLOCATE (Num_Forces(3, num_mm_atoms)) ks_qmmm_env_loc => qs_env%ks_qmmm_env IF (iw > 0) WRITE (iw, '(/A)') "DEBUG SECTION:" @@ -1472,7 +1470,7 @@ SUBROUTINE debug_integrate_gf_rspace_NoPBC(ilevel, zetp, rp, W, pwgrid, cube_inf REAL(KIND=dp), INTENT(IN) :: zetp REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rp REAL(KIND=dp), INTENT(IN) :: W - TYPE(pw_r3d_type), INTENT(IN) :: pwgrid + TYPE(pw_r3d_rs_type), INTENT(IN) :: pwgrid TYPE(cube_info_type), INTENT(IN) :: cube_info REAL(KIND=dp), INTENT(IN) :: eps_mm_rspace TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: aug_pools @@ -1490,14 +1488,14 @@ SUBROUTINE debug_integrate_gf_rspace_NoPBC(ilevel, zetp, rp, W, pwgrid, cube_inf REAL(KIND=dp), DIMENSION(2) :: energy REAL(KIND=dp), DIMENSION(3) :: Err, force, myrp REAL(KIND=dp), DIMENSION(:), POINTER :: xdat, ydat, zdat - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: grids + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: grids DATA Icount/0/ ! Statements CALL timeset(routineN, handle) !Statements ngrids = SIZE(aug_pools) - CALL pw_pools_create_pws(aug_pools, grids, in_space=REALSPACE) + CALL pw_pools_create_pws(aug_pools, grids) DO igrid = 1, ngrids CALL pw_zero(grids(igrid)) END DO @@ -1588,7 +1586,7 @@ SUBROUTINE debug_qmmm_forces_with_gauss_LG(pgfs, aug_pools, rho, mm_charges, mm_ TYPE(qmmm_gaussian_p_type), DIMENSION(:), POINTER :: pgfs TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: aug_pools - TYPE(pw_r3d_type), INTENT(IN) :: rho + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles @@ -1609,12 +1607,12 @@ SUBROUTINE debug_qmmm_forces_with_gauss_LG(pgfs, aug_pools, rho, mm_charges, mm_ REAL(KIND=dp), DIMENSION(2) :: energy REAL(KIND=dp), DIMENSION(3) :: Err REAL(KIND=dp), DIMENSION(:, :), POINTER :: Num_Forces - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: grids + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: grids ALLOCATE (Num_Forces(3, num_mm_atoms)) CALL timeset(routineN, handle) ngrids = SIZE(aug_pools) - CALL pw_pools_create_pws(aug_pools, grids, in_space=REALSPACE) + CALL pw_pools_create_pws(aug_pools, grids) DO igrid = 1, ngrids CALL pw_zero(grids(igrid)) END DO @@ -1702,7 +1700,7 @@ SUBROUTINE debug_qmmm_forces_with_gauss_LR(pgfs, aug_pools, rho, mm_charges, mm_ TYPE(qmmm_gaussian_p_type), DIMENSION(:), POINTER :: pgfs TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: aug_pools - TYPE(pw_r3d_type), INTENT(IN) :: rho + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho REAL(KIND=dp), DIMENSION(:), POINTER :: mm_charges INTEGER, DIMENSION(:), POINTER :: mm_atom_index TYPE(particle_type), DIMENSION(:), POINTER :: mm_particles @@ -1723,12 +1721,12 @@ SUBROUTINE debug_qmmm_forces_with_gauss_LR(pgfs, aug_pools, rho, mm_charges, mm_ REAL(KIND=dp), DIMENSION(2) :: energy REAL(KIND=dp), DIMENSION(3) :: Err REAL(KIND=dp), DIMENSION(:, :), POINTER :: Num_Forces - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: grids + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: grids ALLOCATE (Num_Forces(3, num_mm_atoms)) CALL timeset(routineN, handle) ngrids = SIZE(aug_pools) - CALL pw_pools_create_pws(aug_pools, grids, in_space=REALSPACE) + CALL pw_pools_create_pws(aug_pools, grids) DO igrid = 1, ngrids CALL pw_zero(grids(igrid)) END DO diff --git a/src/qmmm_image_charge.F b/src/qmmm_image_charge.F index ef2c3dbe04..75c14c558f 100644 --- a/src/qmmm_image_charge.F +++ b/src/qmmm_image_charge.F @@ -51,10 +51,8 @@ MODULE qmmm_image_charge USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qmmm_types_low, ONLY: qmmm_env_qm_type USE qs_collocate_density, ONLY: calculate_rho_metal,& calculate_rho_single_gaussian @@ -96,8 +94,8 @@ MODULE qmmm_image_charge SUBROUTINE calculate_image_pot(v_hartree_rspace, rho_hartree_gspace, energy, & qmmm_env, qs_env) - TYPE(pw_r3d_type), INTENT(IN) :: v_hartree_rspace - TYPE(pw_c1d_type), INTENT(IN) :: rho_hartree_gspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree_rspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_hartree_gspace TYPE(qs_energy_type), POINTER :: energy TYPE(qmmm_env_qm_type), POINTER :: qmmm_env TYPE(qs_environment_type), POINTER :: qs_env @@ -152,7 +150,7 @@ END SUBROUTINE calculate_image_pot SUBROUTINE calc_image_coeff_gaussalgorithm(v_hartree_rspace, coeff, qmmm_env, & qs_env) - TYPE(pw_r3d_type), INTENT(IN) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree_rspace REAL(KIND=dp), DIMENSION(:), POINTER :: coeff TYPE(qmmm_env_qm_type), POINTER :: qmmm_env TYPE(qs_environment_type), POINTER :: qs_env @@ -208,7 +206,7 @@ END SUBROUTINE calc_image_coeff_gaussalgorithm SUBROUTINE calc_image_coeff_iterative(v_hartree_rspace, coeff, qmmm_env, & qs_env) - TYPE(pw_r3d_type), INTENT(IN) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree_rspace REAL(KIND=dp), DIMENSION(:), POINTER :: coeff TYPE(qmmm_env_qm_type), POINTER :: qmmm_env TYPE(qs_environment_type), POINTER :: qs_env @@ -219,7 +217,7 @@ SUBROUTINE calc_image_coeff_iterative(v_hartree_rspace, coeff, qmmm_env, & REAL(KIND=dp) :: alpha, eta, rsnew, rsold, V0 REAL(KIND=dp), DIMENSION(:), POINTER :: Ad, d, pot_const, r, vmetal_const, z TYPE(cp_logger_type), POINTER :: logger - TYPE(pw_r3d_type) :: auxpot_Ad_rspace, v_metal_rspace_guess + TYPE(pw_r3d_rs_type) :: auxpot_Ad_rspace, v_metal_rspace_guess TYPE(section_vals_type), POINTER :: input CALL timeset(routineN, handle) @@ -336,7 +334,7 @@ END SUBROUTINE calc_image_coeff_iterative SUBROUTINE integrate_potential_ga_rspace(potential, qmmm_env, qs_env, int_res, & atom_num, atom_num_ref) - TYPE(pw_r3d_type), INTENT(IN) :: potential + TYPE(pw_r3d_rs_type), INTENT(IN) :: potential TYPE(qmmm_env_qm_type), POINTER :: qmmm_env TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), DIMENSION(:), POINTER :: int_res @@ -452,7 +450,7 @@ END SUBROUTINE integrate_potential_ga_rspace SUBROUTINE integrate_potential_devga_rspace(potential, coeff, forces, qmmm_env, & qs_env) - TYPE(pw_r3d_type), INTENT(IN) :: potential + TYPE(pw_r3d_rs_type), INTENT(IN) :: potential REAL(KIND=dp), DIMENSION(:), POINTER :: coeff REAL(KIND=dp), DIMENSION(:, :), POINTER :: forces TYPE(qmmm_env_qm_type), POINTER :: qmmm_env @@ -704,11 +702,11 @@ SUBROUTINE calculate_image_matrix_gpw(image_matrix, qs_env, qmmm_env) INTEGER :: handle, iatom, iatom_ref, natom REAL(KIND=dp), DIMENSION(:), POINTER :: int_res TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho_gb, vb_gspace + TYPE(pw_c1d_gs_type) :: rho_gb, vb_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: vb_rspace + TYPE(pw_r3d_rs_type) :: vb_rspace CALL timeset(routineN, handle) NULLIFY (pw_env, auxbas_pw_pool, poisson_env, para_env, int_res) @@ -722,9 +720,9 @@ SUBROUTINE calculate_image_matrix_gpw(image_matrix, qs_env, qmmm_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(rho_gb, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(vb_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(vb_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_gb) + CALL auxbas_pw_pool%create_pw(vb_gspace) + CALL auxbas_pw_pool%create_pw(vb_rspace) ! calculate vb only once for one reference atom iatom_ref = 1 ! @@ -859,9 +857,9 @@ END SUBROUTINE integrate_s_mme SUBROUTINE calculate_potential_metal(v_metal_rspace, coeff, rho_hartree_gspace, energy, & qs_env) - TYPE(pw_r3d_type), INTENT(OUT) :: v_metal_rspace + TYPE(pw_r3d_rs_type), INTENT(OUT) :: v_metal_rspace REAL(KIND=dp), DIMENSION(:), POINTER :: coeff - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: rho_hartree_gspace + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: rho_hartree_gspace TYPE(qs_energy_type), OPTIONAL, POINTER :: energy TYPE(qs_environment_type), POINTER :: qs_env @@ -870,7 +868,7 @@ SUBROUTINE calculate_potential_metal(v_metal_rspace, coeff, rho_hartree_gspace, INTEGER :: handle REAL(KIND=dp) :: en_external, en_vmetal_rhohartree, & total_rho_metal - TYPE(pw_c1d_type) :: rho_metal, v_metal_gspace + TYPE(pw_c1d_gs_type) :: rho_metal, v_metal_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool @@ -885,11 +883,11 @@ SUBROUTINE calculate_potential_metal(v_metal_rspace, coeff, rho_hartree_gspace, CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(rho_metal, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_metal) - CALL auxbas_pw_pool%create_pw(v_metal_gspace, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_metal_gspace) - CALL auxbas_pw_pool%create_pw(v_metal_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_metal_rspace) CALL pw_zero(rho_metal) CALL calculate_rho_metal(rho_metal, coeff, total_rho_metal=total_rho_metal, & @@ -926,8 +924,8 @@ END SUBROUTINE calculate_potential_metal ! ************************************************************************************************** SUBROUTINE add_image_pot_to_hartree_pot(v_hartree, v_metal, qs_env) - TYPE(pw_r3d_type), INTENT(INOUT) :: v_hartree - TYPE(pw_r3d_type), INTENT(IN) :: v_metal + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_hartree + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_metal TYPE(qs_environment_type), POINTER :: qs_env CHARACTER(len=*), PARAMETER :: routineN = 'add_image_pot_to_hartree_pot' diff --git a/src/qmmm_per_elpot.F b/src/qmmm_per_elpot.F index 0b8319b332..0f98a6c2a2 100644 --- a/src/qmmm_per_elpot.F +++ b/src/qmmm_per_elpot.F @@ -25,7 +25,7 @@ MODULE qmmm_per_elpot ewald_environment_type,& read_ewald_section USE ewald_pw_types, ONLY: ewald_pw_create,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE ewald_spline_util, ONLY: Setup_Ewald_Spline USE input_constants, ONLY: do_qmmm_coulomb,& do_qmmm_gauss,& @@ -334,7 +334,7 @@ END SUBROUTINE qmmm_per_pot_type_create SUBROUTINE qmmm_ewald_potential_init(ewald_env, ewald_pw, qmmm_coupl_type, mm_cell, para_env, & qmmm_periodic, print_section) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw INTEGER, INTENT(IN) :: qmmm_coupl_type TYPE(cell_type), POINTER :: mm_cell TYPE(mp_para_env_type), POINTER :: para_env diff --git a/src/qmmm_pw_grid.F b/src/qmmm_pw_grid.F index 502ff3b3de..d7031e8114 100644 --- a/src/qmmm_pw_grid.F +++ b/src/qmmm_pw_grid.F @@ -40,8 +40,8 @@ MODULE qmmm_pw_grid CONTAINS ! ************************************************************************************************** -!> \brief Initialize the qmmm pool of pw_r3d_type. -!> Then Main difference w.r.t. QS pw_r3d_type pools is that this pool +!> \brief Initialize the qmmm pool of pw_r3d_rs_type. +!> Then Main difference w.r.t. QS pw_r3d_rs_type pools is that this pool !> has [0,L] as boundaries. !> \param qmmm_env ... !> \param pw_env ... diff --git a/src/qmmm_tb_coulomb.F b/src/qmmm_tb_coulomb.F index cbf6469642..4ddfe722ce 100644 --- a/src/qmmm_tb_coulomb.F +++ b/src/qmmm_tb_coulomb.F @@ -28,7 +28,7 @@ MODULE qmmm_tb_coulomb USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_methods_tb, ONLY: tb_spme_evaluate - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: oorootpi,& pi @@ -98,7 +98,7 @@ SUBROUTINE build_tb_coulomb_qmqm(qs_env, ks_matrix, rho, mcharge, energy, & TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(qmmm_env_qm_type), POINTER :: qmmm_env_qm diff --git a/src/qmmm_tb_methods.F b/src/qmmm_tb_methods.F index 03398cb7da..7d45c5b546 100644 --- a/src/qmmm_tb_methods.F +++ b/src/qmmm_tb_methods.F @@ -30,7 +30,7 @@ MODULE qmmm_tb_methods ewald_environment_type,& read_ewald_section USE ewald_pw_types, ONLY: ewald_pw_create,& - ewald_pw_r3d_type,& + ewald_pw_r3d_rs_type,& ewald_pw_release USE input_constants, ONLY: do_fist_pol_none USE input_section_types, ONLY: section_vals_get_subs_vals,& @@ -333,7 +333,7 @@ SUBROUTINE build_tb_qmmm_matrix_pc(qs_env, qmmm_env, particles_mm, mm_cell, para TYPE(dft_control_type), POINTER :: dft_control TYPE(dftb_control_type), POINTER :: dftb_control TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_nl TYPE(particle_type), DIMENSION(:), POINTER :: atoms_mm, particles_qm @@ -855,7 +855,7 @@ SUBROUTINE deriv_tb_qmmm_matrix_pc(qs_env, qmmm_env, particles_mm, mm_cell, para TYPE(dft_control_type), POINTER :: dft_control TYPE(dftb_control_type), POINTER :: dftb_control TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_nl TYPE(particle_type), DIMENSION(:), POINTER :: atoms_mm, particles_qm diff --git a/src/qmmm_types_low.F b/src/qmmm_types_low.F index a33ee9f5e2..a325f99ed2 100644 --- a/src/qmmm_types_low.F +++ b/src/qmmm_types_low.F @@ -15,7 +15,7 @@ MODULE qmmm_types_low cp_eri_mme_param USE ewald_environment_types, ONLY: ewald_env_release,& ewald_environment_type - USE ewald_pw_types, ONLY: ewald_pw_r3d_type,& + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type,& ewald_pw_release USE force_field_types, ONLY: deallocate_inp_info,& init_inp_info,& @@ -32,7 +32,7 @@ MODULE qmmm_types_low pw_pool_release,& pw_pool_type,& pw_pools_dealloc - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qmmm_gaussian_types, ONLY: qmmm_gaussian_p_type #include "./base/base_uses.f90" @@ -94,7 +94,7 @@ MODULE qmmm_types_low INTEGER, DIMENSION(:), POINTER :: mm_atom_index TYPE(pw_pool_type), POINTER :: pw_pool TYPE(pw_grid_type), POINTER :: pw_grid - TYPE(pw_r3d_type), POINTER :: TabLR + TYPE(pw_r3d_rs_type), POINTER :: TabLR END TYPE qmmm_per_pot_type TYPE qmmm_per_pot_p_type @@ -229,7 +229,7 @@ MODULE qmmm_types_low TYPE(add_shell_type), POINTER :: added_shells TYPE(image_charge_type), POINTER :: image_charge_pot TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw END TYPE qmmm_env_qm_type ! ************************************************************************************************** diff --git a/src/qs_2nd_kernel_ao.F b/src/qs_2nd_kernel_ao.F index bfd81d7986..26cfb073c5 100644 --- a/src/qs_2nd_kernel_ao.F +++ b/src/qs_2nd_kernel_ao.F @@ -40,8 +40,8 @@ MODULE qs_2nd_kernel_ao pw_env_type USE pw_methods, ONLY: pw_scale USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_integrate_potential, ONLY: integrate_v_rspace @@ -281,10 +281,10 @@ SUBROUTINE apply_xc_admm_ao(qs_env, p_env, calc_forces, calc_virial, virial) TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao_aux TYPE(dft_control_type), POINTER :: dft_control TYPE(linres_control_type), POINTER :: linres_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_aux_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_aux_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_aux_r, tau1_aux_r, v_xc, v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_aux_r, tau1_aux_r, v_xc, v_xc_tau TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_aux TYPE(section_vals_type), POINTER :: xc_section diff --git a/src/qs_active_space_methods.F b/src/qs_active_space_methods.F index d3a3cbcbb5..24a62e6741 100644 --- a/src/qs_active_space_methods.F +++ b/src/qs_active_space_methods.F @@ -97,10 +97,8 @@ MODULE qs_active_space_methods USE pw_pool_types, ONLY: & pw_pool_type USE pw_types, ONLY: & - pw_c1d_type, & - REALSPACE, & - RECIPROCALSPACE, & - pw_r3d_type + pw_c1d_gs_type, & + pw_r3d_rs_type USE qcschema, ONLY: qcschema_env_create, & qcschema_env_release, & qcschema_to_hdf5, & @@ -1222,14 +1220,14 @@ SUBROUTINE calculate_eri_gpw(mos, orbitals, eri_env, qs_env, iw) TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb_sub TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: pot_g, rho_g + TYPE(pw_c1d_gs_type) :: pot_g, rho_g TYPE(pw_env_type), POINTER :: pw_env_sub TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rho_r, wfn_r - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:, :), & - TARGET :: wfn_a - TYPE(pw_r3d_type), POINTER :: wfn1, wfn2, wfn3, wfn4 + TYPE(pw_r3d_rs_type) :: rho_r, wfn_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, & + DIMENSION(:, :), TARGET :: wfn_a + TYPE(pw_r3d_rs_type), POINTER :: wfn1, wfn2, wfn3, wfn4 TYPE(qs_control_type), POINTER :: qs_control, qs_control_old TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_ks_env_type), POINTER :: ks_env @@ -1406,8 +1404,8 @@ SUBROUTINE calculate_eri_gpw(mos, orbitals, eri_env, qs_env, iw) ! Copy the active space of the MOs into DBCSR matrices END IF - CALL auxbas_pw_pool%create_pw(wfn_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wfn_r) + CALL auxbas_pw_pool%create_pw(rho_g) CALL get_qs_env(qs_env, qs_kind_set=qs_kind_set, cell=cell, & particle_set=particle_set, atomic_kind_set=atomic_kind_set) @@ -1429,7 +1427,7 @@ SUBROUTINE calculate_eri_gpw(mos, orbitals, eri_env, qs_env, iw) CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff, nmo=nmo) DO i1 = 1, SIZE(orbitals, 1) iwfn = orbitals(i1, ispin) - CALL auxbas_pw_pool%create_pw(wfn_a(iwfn, ispin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wfn_a(iwfn, ispin)) CALL calculate_wavefunction(mo_coeff, iwfn, wfn_a(iwfn, ispin), rho_g, atomic_kind_set, & qs_kind_set, cell, dft_control, particle_set, pw_env_sub) IF (print2 .AND. iw > 0) THEN @@ -1440,18 +1438,18 @@ SUBROUTINE calculate_eri_gpw(mos, orbitals, eri_env, qs_env, iw) ELSE ! Even if we do not store all WFNs, we still need containers for the functions to store ALLOCATE (wfn1, wfn2) - CALL auxbas_pw_pool%create_pw(wfn1, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wfn2, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wfn1) + CALL auxbas_pw_pool%create_pw(wfn2) IF (eri_env%method /= eri_method_gpw_ht) THEN ALLOCATE (wfn3, wfn4) - CALL auxbas_pw_pool%create_pw(wfn3, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wfn4, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wfn3) + CALL auxbas_pw_pool%create_pw(wfn4) END IF END IF ! get some of the grids ready - CALL auxbas_pw_pool%create_pw(rho_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(pot_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r) + CALL auxbas_pw_pool%create_pw(pot_g) ! run the FFT once, to set up buffers and to take into account the memory CALL pw_zero(rho_r) @@ -1864,10 +1862,10 @@ SUBROUTINE print_orbital_cubes(input, qs_env, mos) TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: dft_section, scf_input @@ -1898,8 +1896,8 @@ SUBROUTINE print_orbital_cubes(input, qs_env, mos) CALL qs_subsys_get(subsys, particles=particles) ! CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) ! dft_section => section_vals_get_subs_vals(scf_input, "DFT") ! diff --git a/src/qs_active_space_types.F b/src/qs_active_space_types.F index 52505510b5..005bd55907 100644 --- a/src/qs_active_space_types.F +++ b/src/qs_active_space_types.F @@ -40,7 +40,7 @@ MODULE qs_active_space_types !> \brief Quantities needed for AS determination !> \author JGH ! ************************************************************************************************** - TYPE eri_gpw_r3d_type + TYPE eri_gpw_r3d_rs_type LOGICAL :: redo_poisson = .FALSE. LOGICAL :: store_wfn = .FALSE. REAL(KIND=dp) :: cutoff = 0.0_dp @@ -49,7 +49,7 @@ MODULE qs_active_space_types REAL(KIND=dp) :: eps_filter = 0.0_dp INTEGER :: print_level = 0 INTEGER :: group_size = 0 - END TYPE eri_gpw_r3d_type + END TYPE eri_gpw_r3d_rs_type TYPE eri_type INTEGER :: method = 0 @@ -58,7 +58,7 @@ MODULE qs_active_space_types INTEGER, DIMENSION(3) :: periodicity = 0 REAL(KIND=dp) :: cutoff_radius = 0.0_dp REAL(KIND=dp) :: eps_integral = 0.0_dp - TYPE(eri_gpw_r3d_type) :: eri_gpw = eri_gpw_r3d_type() + TYPE(eri_gpw_r3d_rs_type) :: eri_gpw = eri_gpw_r3d_rs_type() TYPE(dbcsr_csr_p_type), & DIMENSION(:), POINTER :: eri => NULL() INTEGER :: norb = 0 diff --git a/src/qs_cdft_methods.F b/src/qs_cdft_methods.F index e42be7db16..44268105ed 100644 --- a/src/qs_cdft_methods.F +++ b/src/qs_cdft_methods.F @@ -48,8 +48,7 @@ MODULE qs_cdft_methods pw_set,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_cdft_types, ONLY: becke_constraint_type,& cdft_control_type,& cdft_group_type,& @@ -168,7 +167,7 @@ SUBROUTINE becke_constraint_low(qs_env, just_gradients) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: charge + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: charge NULLIFY (cutoffs, cell, dft_control, particle_set, group, charge, cdft_control) CALL timeset(routineN, handle) @@ -648,8 +647,8 @@ SUBROUTINE hirshfeld_constraint_low(qs_env, just_gradients) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: pw_single_dr - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: pw_single_dr + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho TYPE(realspace_grid_desc_type), POINTER :: auxbas_rs_desc TYPE(realspace_grid_type) :: rs_rho_all, rs_rho_constr @@ -753,19 +752,16 @@ SUBROUTINE hirshfeld_constraint_low(qs_env, just_gradients) ! Setup pw CALL pw_zero(cdft_control%group(igroup)%weight) - CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_total_constraint, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_total_constraint) CALL pw_set(cdft_control%group(igroup)%hw_rho_total_constraint, 1.0_dp) IF (igroup == 1) THEN - CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_total, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_total) CALL pw_set(cdft_control%group(igroup)%hw_rho_total, 1.0_dp) IF (hirshfeld_control%print_density) THEN DO iatom = 1, cdft_control%natoms - CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_atomic(iatom), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_atomic(iatom)) CALL pw_set(cdft_control%group(igroup)%hw_rho_atomic(iatom), 1.0_dp) END DO END IF @@ -784,8 +780,7 @@ SUBROUTINE hirshfeld_constraint_low(qs_env, just_gradients) END DO DO iatom = 1, cdft_control%natoms - CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_atomic_charge(iatom), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%hw_rho_atomic_charge(iatom)) CALL pw_set(cdft_control%group(igroup)%hw_rho_atomic_charge(iatom), 1.0_dp) END DO END IF @@ -972,8 +967,7 @@ SUBROUTINE hirshfeld_constraint_low(qs_env, just_gradients) ALLOCATE (rs_single_dr(num_species)) DO i = 1, num_species - CALL auxbas_pw_pool%create_pw(pw_single_dr(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw_single_dr(i)) CALL pw_zero(pw_single_dr(i)) END DO @@ -1162,7 +1156,7 @@ SUBROUTINE cdft_constraint_integrate(qs_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(mpole_rho_atom), DIMENSION(:), POINTER :: mp_rho TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: charge, rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: charge, rho_r TYPE(qs_energy_type), POINTER :: energy TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_type), POINTER :: rho @@ -1353,7 +1347,7 @@ SUBROUTINE cdft_constraint_force(qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_rho_type), POINTER :: rho @@ -1610,7 +1604,7 @@ SUBROUTINE prepare_fragment_constraint(qs_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: rho_frag + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: rho_frag TYPE(qs_subsys_type), POINTER :: subsys NULLIFY (para_env, dft_control, logger, subsys, pw_env, auxbas_pw_pool, group) @@ -1665,29 +1659,24 @@ SUBROUTINE prepare_fragment_constraint(qs_env) CALL get_qs_env(qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) ! Total density (rho_alpha + rho_beta) - CALL auxbas_pw_pool%create_pw(cdft_control%fragments(1, 1), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%fragments(1, 1)) CALL cp_cube_to_pw(cdft_control%fragments(1, 1), & cdft_control%fragment_a_fname, 1.0_dp) - CALL auxbas_pw_pool%create_pw(cdft_control%fragments(1, 2), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%fragments(1, 2)) CALL cp_cube_to_pw(cdft_control%fragments(1, 2), & cdft_control%fragment_b_fname, 1.0_dp) ! Spin difference density (rho_alpha - rho_beta) if needed IF (needs_spin_density) THEN - CALL auxbas_pw_pool%create_pw(cdft_control%fragments(2, 1), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%fragments(2, 1)) CALL cp_cube_to_pw(cdft_control%fragments(2, 1), & cdft_control%fragment_a_spin_fname, multiplier(1)) - CALL auxbas_pw_pool%create_pw(cdft_control%fragments(2, 2), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%fragments(2, 2)) CALL cp_cube_to_pw(cdft_control%fragments(2, 2), & cdft_control%fragment_b_spin_fname, multiplier(2)) END IF ! Sum up fragments DO i = 1, nfrag_spins - CALL auxbas_pw_pool%create_pw(rho_frag(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_frag(i)) CALL pw_copy(cdft_control%fragments(i, 1), rho_frag(i)) CALL pw_axpy(cdft_control%fragments(i, 2), rho_frag(i), 1.0_dp) CALL auxbas_pw_pool%give_back_pw(cdft_control%fragments(i, 1)) diff --git a/src/qs_cdft_types.F b/src/qs_cdft_types.F index 85eaeefc17..745de12e7a 100644 --- a/src/qs_cdft_types.F +++ b/src/qs_cdft_types.F @@ -27,7 +27,7 @@ MODULE qs_cdft_types dp USE outer_scf_control_types, ONLY: outer_scf_control_type,& qs_outer_scf_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_cdft_opt_types, ONLY: cdft_opt_type_release #include "./base/base_uses.f90" @@ -90,7 +90,7 @@ MODULE qs_cdft_types DIMENSION(:, :, :) :: cavity_mat TYPE(becke_vector_buffer) :: vector_buffer TYPE(hirshfeld_type), POINTER :: cavity_env - TYPE(pw_r3d_type) :: cavity + TYPE(pw_r3d_rs_type) :: cavity END TYPE becke_constraint_type ! ************************************************************************************************** @@ -209,12 +209,12 @@ MODULE qs_cdft_types REAL(KIND=dp), POINTER, & DIMENSION(:, :, :, :) :: gradients_z ! The weight function of this constraint group - TYPE(pw_r3d_type), POINTER :: weight - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: hw_rho_atomic - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: hw_rho_atomic_dr - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: hw_rho_atomic_charge - TYPE(pw_r3d_type) :: hw_rho_total_constraint - TYPE(pw_r3d_type) :: hw_rho_total + TYPE(pw_r3d_rs_type), POINTER :: weight + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: hw_rho_atomic + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: hw_rho_atomic_dr + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: hw_rho_atomic_charge + TYPE(pw_r3d_rs_type) :: hw_rho_total_constraint + TYPE(pw_r3d_rs_type) :: hw_rho_total END TYPE cdft_group_type TYPE cdft_control_type @@ -251,9 +251,9 @@ MODULE qs_cdft_types TYPE(hirshfeld_constraint_type), & POINTER :: hirshfeld_control TYPE(outer_scf_control_type) :: constraint_control, ot_control - TYPE(pw_r3d_type), POINTER, & + TYPE(pw_r3d_rs_type), POINTER, & DIMENSION(:) :: charge - TYPE(pw_r3d_type), POINTER, & + TYPE(pw_r3d_rs_type), POINTER, & DIMENSION(:, :) :: fragments TYPE(qs_outer_scf_type) :: constraint END TYPE cdft_control_type diff --git a/src/qs_cdft_utils.F b/src/qs_cdft_utils.F index eed8b0dca7..421355405f 100644 --- a/src/qs_cdft_utils.F +++ b/src/qs_cdft_utils.F @@ -56,7 +56,6 @@ MODULE qs_cdft_utils pw_env_type USE pw_methods, ONLY: pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE USE qs_cdft_types, ONLY: becke_constraint_type,& cdft_control_type,& cdft_group_type,& @@ -389,8 +388,7 @@ SUBROUTINE becke_constraint_init(qs_env) DEALLOCATE (cores) END DO DEALLOCATE (pab) - CALL auxbas_pw_pool%create_pw(becke_control%cavity, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(becke_control%cavity) CALL transfer_rs2pw(rs_cavity, becke_control%cavity) ! Grid points where the Gaussian density falls below eps_cavity are ignored ! We can calculate the smallest/largest values along z-direction outside diff --git a/src/qs_collocate_density.F b/src/qs_collocate_density.F index 2fe8ce21cd..b2c51d2c60 100644 --- a/src/qs_collocate_density.F +++ b/src/qs_collocate_density.F @@ -85,9 +85,8 @@ MODULE qs_collocate_density pw_pools_create_pws, & pw_pools_give_back_pws USE pw_types, ONLY: & - pw_r3d_type, REALSPACE, & - RECIPROCALSPACE, & - pw_c1d_type, pw_r3d_type + pw_r3d_rs_type, & + pw_c1d_gs_type, pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env, & qs_environment_type USE qs_kind_types, ONLY: get_qs_kind, & @@ -136,12 +135,12 @@ MODULE qs_collocate_density collocate_single_gaussian INTERFACE calculate_rho_core - MODULE PROCEDURE calculate_rho_core_r3d - MODULE PROCEDURE calculate_rho_core_c1d + MODULE PROCEDURE calculate_rho_core_r3d_rs + MODULE PROCEDURE calculate_rho_core_c1d_gs END INTERFACE INTERFACE calculate_rho_resp_all - MODULE PROCEDURE calculate_rho_resp_all_r3d, calculate_rho_resp_all_c1d + MODULE PROCEDURE calculate_rho_resp_all_r3d_rs, calculate_rho_resp_all_c1d_gs END INTERFACE CONTAINS @@ -153,7 +152,7 @@ MODULE qs_collocate_density ! ************************************************************************************************** SUBROUTINE calculate_rho_nlcc(rho_nlcc, qs_env) - TYPE(pw_r3d_type), INTENT(INOUT) :: rho_nlcc + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho_nlcc TYPE(qs_environment_type), POINTER :: qs_env CHARACTER(len=*), PARAMETER :: routineN = 'calculate_rho_nlcc' @@ -332,7 +331,7 @@ END SUBROUTINE calculate_rho_nlcc ! ************************************************************************************************** SUBROUTINE calculate_ppl_grid(vppl, qs_env) - TYPE(pw_r3d_type), INTENT(INOUT) :: vppl + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vppl TYPE(qs_environment_type), POINTER :: qs_env CHARACTER(len=*), PARAMETER :: routineN = 'calculate_ppl_grid' @@ -516,8 +515,8 @@ END SUBROUTINE calculate_ppl_grid SUBROUTINE calculate_lri_rho_elec(lri_rho_g, lri_rho_r, qs_env, & lri_coef, total_rho, basis_type, exact_1c_terms, pmat, atomlist) - TYPE(pw_c1d_type), INTENT(INOUT) :: lri_rho_g - TYPE(pw_r3d_type), INTENT(INOUT) :: lri_rho_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: lri_rho_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: lri_rho_r TYPE(qs_environment_type), POINTER :: qs_env TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_coef REAL(KIND=dp), INTENT(OUT) :: total_rho @@ -547,8 +546,8 @@ SUBROUTINE calculate_lri_rho_elec(lri_rho_g, lri_rho_r, qs_env, & TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_type), DIMENSION(:), POINTER :: rs_rho TYPE(realspace_grid_type), POINTER :: rs_grid @@ -578,9 +577,9 @@ SUBROUTINE calculate_lri_rho_elec(lri_rho_g, lri_rho_r, qs_env, & CPASSERT(ASSOCIATED(pw_env)) CALL pw_env_get(pw_env=pw_env, rs_grids=rs_rho, pw_pools=pw_pools) - CALL pw_pools_create_pws(pw_pools, mgrid_rspace, in_space=REALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_rspace) - CALL pw_pools_create_pws(pw_pools, mgrid_gspace, in_space=RECIPROCALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_gspace) ! *** set up the rs multi-grids *** ! DO igrid_level = 1, gridlevel_info%ngrid_levels @@ -783,7 +782,7 @@ SUBROUTINE calculate_lri_rho_elec(lri_rho_g, lri_rho_r, qs_env, & END SUBROUTINE calculate_lri_rho_elec - #:for kind in ["r3d", "c1d"] + #:for kind in ["r3d_rs", "c1d_gs"] ! ************************************************************************************************** !> \brief computes the density of the core charges on the grid !> \param rho_core ... @@ -817,7 +816,7 @@ SUBROUTINE calculate_rho_core_${kind}$ (rho_core, total_rho, qs_env, calpha, cco TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhoc_r + TYPE(pw_r3d_rs_type) :: rhoc_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_type), POINTER :: rs_rho @@ -908,8 +907,7 @@ SUBROUTINE calculate_rho_core_${kind}$ (rho_core, total_rho, qs_env, calpha, cco END IF DEALLOCATE (pab) - CALL auxbas_pw_pool%create_pw(rhoc_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhoc_r) CALL transfer_rs2pw(rs_rho, rhoc_r) @@ -935,7 +933,7 @@ END SUBROUTINE calculate_rho_core_${kind}$ ! ************************************************************************************************** SUBROUTINE calculate_drho_core(drho_core, qs_env, beta, lambda) - TYPE(pw_c1d_type), INTENT(INOUT) :: drho_core + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: drho_core TYPE(qs_environment_type), POINTER :: qs_env INTEGER, INTENT(IN) :: beta, lambda @@ -954,7 +952,7 @@ SUBROUTINE calculate_drho_core(drho_core, qs_env, beta, lambda) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhoc_r + TYPE(pw_r3d_rs_type) :: rhoc_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_type), POINTER :: rs_rho @@ -1044,8 +1042,7 @@ SUBROUTINE calculate_drho_core(drho_core, qs_env, beta, lambda) END IF DEALLOCATE (pab) - CALL auxbas_pw_pool%create_pw(rhoc_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhoc_r) CALL transfer_rs2pw(rs_rho, rhoc_r) @@ -1068,7 +1065,7 @@ END SUBROUTINE calculate_drho_core ! ************************************************************************************************** SUBROUTINE calculate_rho_single_gaussian(rho_gb, qs_env, iatom_in) - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_gb + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_gb TYPE(qs_environment_type), POINTER :: qs_env INTEGER, INTENT(IN) :: iatom_in @@ -1083,7 +1080,7 @@ SUBROUTINE calculate_rho_single_gaussian(rho_gb, qs_env, iatom_in) TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhoc_r + TYPE(pw_r3d_rs_type) :: rhoc_r TYPE(realspace_grid_type), POINTER :: rs_rho CALL timeset(routineN, handle) @@ -1133,8 +1130,7 @@ SUBROUTINE calculate_rho_single_gaussian(rho_gb, qs_env, iatom_in) DEALLOCATE (pab) - CALL auxbas_pw_pool%create_pw(rhoc_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhoc_r) CALL transfer_rs2pw(rs_rho, rhoc_r) @@ -1159,7 +1155,7 @@ END SUBROUTINE calculate_rho_single_gaussian ! ************************************************************************************************** SUBROUTINE calculate_rho_metal(rho_metal, coeff, total_rho_metal, qs_env) - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_metal + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_metal REAL(KIND=dp), DIMENSION(:), POINTER :: coeff REAL(KIND=dp), INTENT(OUT), OPTIONAL :: total_rho_metal TYPE(qs_environment_type), POINTER :: qs_env @@ -1176,7 +1172,7 @@ SUBROUTINE calculate_rho_metal(rho_metal, coeff, total_rho_metal, qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhoc_r + TYPE(pw_r3d_rs_type) :: rhoc_r TYPE(realspace_grid_type), POINTER :: rs_rho CALL timeset(routineN, handle) @@ -1238,8 +1234,7 @@ SUBROUTINE calculate_rho_metal(rho_metal, coeff, total_rho_metal, qs_env) DEALLOCATE (pab, cores) - CALL auxbas_pw_pool%create_pw(rhoc_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhoc_r) CALL transfer_rs2pw(rs_rho, rhoc_r) @@ -1266,7 +1261,7 @@ END SUBROUTINE calculate_rho_metal ! ************************************************************************************************** SUBROUTINE calculate_rho_resp_single(rho_gb, qs_env, eta, iatom_in) - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_gb + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_gb TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), INTENT(IN) :: eta INTEGER, INTENT(IN) :: iatom_in @@ -1282,7 +1277,7 @@ SUBROUTINE calculate_rho_resp_single(rho_gb, qs_env, eta, iatom_in) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhoc_r + TYPE(pw_r3d_rs_type) :: rhoc_r TYPE(realspace_grid_type), POINTER :: rs_rho CALL timeset(routineN, handle) @@ -1332,8 +1327,7 @@ SUBROUTINE calculate_rho_resp_single(rho_gb, qs_env, eta, iatom_in) DEALLOCATE (pab) - CALL auxbas_pw_pool%create_pw(rhoc_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhoc_r) CALL transfer_rs2pw(rs_rho, rhoc_r) @@ -1345,7 +1339,7 @@ SUBROUTINE calculate_rho_resp_single(rho_gb, qs_env, eta, iatom_in) END SUBROUTINE calculate_rho_resp_single - #:for kind in ["r3d", "c1d"] + #:for kind in ["r3d_rs", "c1d_gs"] ! ************************************************************************************************** !> \brief computes the RESP charge density on a grid based on the RESP charges !> \param rho_resp RESP charge density @@ -1378,7 +1372,7 @@ SUBROUTINE calculate_rho_resp_all_${kind}$ (rho_resp, coeff, natom, eta, qs_env) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rhoc_r + TYPE(pw_r3d_rs_type) :: rhoc_r TYPE(realspace_grid_type), POINTER :: rs_rho CALL timeset(routineN, handle) @@ -1438,8 +1432,7 @@ SUBROUTINE calculate_rho_resp_all_${kind}$ (rho_resp, coeff, natom, eta, qs_env) DEALLOCATE (pab, cores) - CALL auxbas_pw_pool%create_pw(rhoc_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rhoc_r) CALL transfer_rs2pw(rs_rho, rhoc_r) @@ -1483,8 +1476,8 @@ SUBROUTINE calculate_rho_elec(matrix_p, matrix_p_kp, rho, rho_gspace, total_rho, TYPE(dbcsr_type), OPTIONAL, TARGET :: matrix_p TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, & POINTER :: matrix_p_kp - TYPE(pw_r3d_type), INTENT(INOUT) :: rho - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_gspace REAL(KIND=dp), INTENT(OUT), OPTIONAL :: total_rho TYPE(qs_ks_env_type), POINTER :: ks_env LOGICAL, INTENT(IN), OPTIONAL :: soft_valid, compute_tau, compute_grad @@ -1649,8 +1642,8 @@ SUBROUTINE calculate_drho_elec(matrix_p, matrix_p_kp, drho, drho_gspace, qs_env, TYPE(dbcsr_type), OPTIONAL, TARGET :: matrix_p TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, & POINTER :: matrix_p_kp - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: drho - TYPE(pw_c1d_type), DIMENSION(3), INTENT(INOUT) :: drho_gspace + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: drho + TYPE(pw_c1d_gs_type), DIMENSION(3), INTENT(INOUT) :: drho_gspace TYPE(qs_environment_type), POINTER :: qs_env LOGICAL, INTENT(IN), OPTIONAL :: soft_valid CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: basis_type @@ -2036,8 +2029,8 @@ SUBROUTINE calculate_drho_elec_dR(matrix_p, matrix_p_kp, drho, drho_gspace, qs_e TYPE(dbcsr_type), OPTIONAL, TARGET :: matrix_p TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, & POINTER :: matrix_p_kp - TYPE(pw_r3d_type), INTENT(INOUT) :: drho - TYPE(pw_c1d_type), INTENT(INOUT) :: drho_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: drho + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: drho_gspace TYPE(qs_environment_type), POINTER :: qs_env LOGICAL, INTENT(IN), OPTIONAL :: soft_valid CHARACTER(LEN=*), INTENT(IN), OPTIONAL :: basis_type @@ -2440,8 +2433,8 @@ SUBROUTINE collocate_single_gaussian(rho, rho_gspace, & atomic_kind_set, qs_kind_set, cell, dft_control, particle_set, & pw_env, required_function, basis_type) - TYPE(pw_r3d_type), INTENT(INOUT) :: rho - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_gspace TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(cell_type), POINTER :: cell @@ -2467,8 +2460,8 @@ SUBROUTINE collocate_single_gaussian(rho, rho_gspace, & TYPE(gto_basis_set_type), POINTER :: orb_basis_set TYPE(mp_comm_type) :: group TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace TYPE(realspace_grid_type), DIMENSION(:), POINTER :: rs_rho IF (PRESENT(basis_type)) THEN @@ -2487,8 +2480,8 @@ SUBROUTINE collocate_single_gaussian(rho, rho_gspace, & CALL pw_env_get(pw_env, rs_grids=rs_rho, pw_pools=pw_pools, & gridlevel_info=gridlevel_info) - CALL pw_pools_create_pws(pw_pools, mgrid_gspace, in_space=RECIPROCALSPACE) - CALL pw_pools_create_pws(pw_pools, mgrid_rspace, in_space=REALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_gspace) + CALL pw_pools_create_pws(pw_pools, mgrid_rspace) ! *** set up rs multi-grids DO igrid_level = 1, gridlevel_info%ngrid_levels @@ -2632,8 +2625,8 @@ SUBROUTINE calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, & TYPE(cp_fm_type), INTENT(IN) :: mo_vectors INTEGER, INTENT(IN) :: ivector - TYPE(pw_r3d_type), INTENT(INOUT) :: rho - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: rho + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_gspace TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(cell_type), POINTER :: cell @@ -2660,8 +2653,8 @@ SUBROUTINE calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, & TYPE(gto_basis_set_type), POINTER :: orb_basis_set TYPE(mp_comm_type) :: group TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_gspace + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: mgrid_rspace TYPE(realspace_grid_type), DIMENSION(:), POINTER :: rs_rho IF (PRESENT(basis_type)) THEN @@ -2692,8 +2685,8 @@ SUBROUTINE calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, & CALL pw_env_get(pw_env, rs_grids=rs_rho, pw_pools=pw_pools, & gridlevel_info=gridlevel_info) - CALL pw_pools_create_pws(pw_pools, mgrid_gspace, in_space=RECIPROCALSPACE) - CALL pw_pools_create_pws(pw_pools, mgrid_rspace, in_space=REALSPACE) + CALL pw_pools_create_pws(pw_pools, mgrid_gspace) + CALL pw_pools_create_pws(pw_pools, mgrid_rspace) ! *** set up rs multi-grids DO igrid_level = 1, gridlevel_info%ngrid_levels diff --git a/src/qs_dcdr_ao.F b/src/qs_dcdr_ao.F index bdd434deb9..ddc62d927e 100644 --- a/src/qs_dcdr_ao.F +++ b/src/qs_dcdr_ao.F @@ -50,10 +50,8 @@ MODULE qs_dcdr_ao USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_drho_core,& calculate_drho_elec_dR USE qs_energy_types, ONLY: qs_energy_type @@ -127,13 +125,13 @@ SUBROUTINE apply_op_constant_term(qs_env, dcdr_env, overlap1) TYPE(cp_fm_type) :: rho_ao_fm, rho_ao_s1, rho_ao_s1_rho_ao, & s1_ao TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho1_ao, rho_ao - TYPE(pw_c1d_type) :: rho1_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g, rho1_g_pw + TYPE(pw_c1d_gs_type) :: rho1_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g, rho1_g_pw TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, v_rspace_new, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, v_rspace_new, & v_xc, v_xc_tau TYPE(qs_rho_type), POINTER :: perturbed_density, rho TYPE(section_vals_type), POINTER :: input, xc_section @@ -240,11 +238,11 @@ SUBROUTINE apply_op_constant_term(qs_env, dcdr_env, overlap1) ! Done with deriv_set and rho_set ALLOCATE (v_rspace_new(dcdr_env%nspins)) - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) ! Calculate the Hartree potential on the total density - CALL auxbas_pw_pool%create_pw(rho1_tot_gspace, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho1_tot_gspace) CALL qs_rho_get(perturbed_density, rho_g=rho1_g, rho_r=rho1_r, tau_r=tau1_r) CALL pw_copy(rho1_g(1), rho1_tot_gspace) @@ -337,12 +335,12 @@ SUBROUTINE d_core_charge_density_dR(qs_env, dcdr_env) INTEGER :: beta, handle TYPE(cp_logger_type), POINTER :: logger TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: drho_g, v_hartree_gspace + TYPE(pw_c1d_gs_type) :: drho_g, v_hartree_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: v_hartree_rspace TYPE(qs_rho_type), POINTER :: rho CALL timeset(routineN, handle) @@ -359,10 +357,10 @@ SUBROUTINE d_core_charge_density_dR(qs_env, dcdr_env) pw_pools=pw_pools) ! Create the Hartree potential grids in real and reciprocal space. - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) ! Create the grid for the derivative of the core potential - CALL auxbas_pw_pool%create_pw(drho_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(drho_g) DO beta = 1, 3 CALL pw_zero(v_hartree_gspace) @@ -510,14 +508,14 @@ SUBROUTINE d_vhxc_dR(qs_env, dcdr_env) INTEGER :: handle, idir, ispin TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao - TYPE(pw_c1d_type) :: drho_g_total, v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: drho_g + TYPE(pw_c1d_gs_type) :: drho_g_total, v_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: drho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: drho_r_total, v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: drho_r, dtau_r, rho_r, v_xc, v_xc_tau + TYPE(pw_r3d_rs_type) :: drho_r_total, v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: drho_r, dtau_r, rho_r, v_xc, v_xc_tau TYPE(qs_rho_type), POINTER :: rho TYPE(section_vals_type), POINTER :: input, xc_section TYPE(xc_derivative_set_type) :: my_deriv_set @@ -539,15 +537,15 @@ SUBROUTINE d_vhxc_dR(qs_env, dcdr_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools, poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) DO ispin = 1, dcdr_env%nspins - CALL auxbas_pw_pool%create_pw(drho_r(ispin), in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(drho_g(ispin), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(drho_r(ispin)) + CALL auxbas_pw_pool%create_pw(drho_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(drho_g_total, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(drho_r_total, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_g_total) + CALL auxbas_pw_pool%create_pw(drho_r_total) DO idir = 1, 3 CALL pw_zero(v_hartree_gspace) @@ -641,8 +639,8 @@ SUBROUTINE vhxc_R_perturbed_basis_functions(qs_env, dcdr_env) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_p TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_hxc_r, v_tau_rspace - TYPE(pw_r3d_type), POINTER :: v_hartree_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_hxc_r, v_tau_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_r TYPE(qs_energy_type), POINTER :: energy TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_struct diff --git a/src/qs_dftb_coulomb.F b/src/qs_dftb_coulomb.F index a1288db043..1abca5eda1 100644 --- a/src/qs_dftb_coulomb.F +++ b/src/qs_dftb_coulomb.F @@ -33,7 +33,7 @@ MODULE qs_dftb_coulomb ewald_environment_type USE ewald_methods_tb, ONLY: tb_ewald_overlap,& tb_spme_evaluate - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE kpoint_types, ONLY: get_kpoint_info,& kpoint_type @@ -132,7 +132,7 @@ SUBROUTINE build_dftb_coulomb(qs_env, ks_matrix, rho, mcharge, energy, & TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(kpoint_type), POINTER :: kpoints TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_iterator_p_type), & diff --git a/src/qs_dispersion_nonloc.F b/src/qs_dispersion_nonloc.F index 26080e28c2..2abc54a4b2 100644 --- a/src/qs_dispersion_nonloc.F +++ b/src/qs_dispersion_nonloc.F @@ -37,10 +37,8 @@ MODULE qs_dispersion_nonloc pw_derive,& pw_transfer USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_dispersion_types, ONLY: qs_dispersion_type USE virial_types, ONLY: virial_type #include "./base/base_uses.f90" @@ -163,8 +161,8 @@ END SUBROUTINE qs_dispersion_nonloc_init ! ************************************************************************************************** SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, & dispersion_env, energy_only, pw_pool, xc_pw_pool, para_env, virial) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, rho_r - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g REAL(KIND=dp), INTENT(OUT) :: edispersion TYPE(qs_dispersion_type), POINTER :: dispersion_env LOGICAL, INTENT(IN) :: energy_only @@ -183,11 +181,11 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, & REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: dq0_dgradrho, dq0_drho, hpot, potential, & q0, rho REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: drho, thetas - TYPE(pw_c1d_type) :: tmp_g, vxc_g - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:) :: thetas_g + TYPE(pw_c1d_gs_type) :: tmp_g, vxc_g + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:) :: thetas_g TYPE(pw_grid_type), POINTER :: grid - TYPE(pw_r3d_type) :: tmp_r, vxc_r - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:, :) :: drho_r + TYPE(pw_r3d_rs_type) :: tmp_r, vxc_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:, :) :: drho_r CALL timeset(routineN, handle) @@ -216,15 +214,14 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, & const = 1.0_dp/(3.0_dp*SQRT(pi)*b_value**1.5_dp)/(pi**0.75_dp) ! temporary arrays for FFT - CALL pw_pool%create_pw(tmp_g, in_space=RECIPROCALSPACE) - CALL pw_pool%create_pw(tmp_r, in_space=REALSPACE) + CALL pw_pool%create_pw(tmp_g) + CALL pw_pool%create_pw(tmp_r) ! get density derivatives ALLOCATE (drho_r(3, nspin)) DO ispin = 1, nspin DO idir = 1, 3 - CALL pw_pool%create_pw(drho_r(idir, ispin), & - in_space=REALSPACE) + CALL pw_pool%create_pw(drho_r(idir, ispin)) CALL pw_transfer(rho_g(ispin), tmp_g) CALL pw_derive(tmp_g, nd(:, idir)) CALL pw_transfer(tmp_g, drho_r(idir, ispin)) @@ -392,7 +389,7 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, & END DO END DO !$OMP END PARALLEL DO - CALL pw_pool%create_pw(thetas_g(i), in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(thetas_g(i)) CALL pw_transfer(tmp_r, thetas_g(i)) END DO grid => thetas_g(1)%pw_grid @@ -473,7 +470,7 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, & potential(:) = (0.5_dp*potential(:) + beta)*dispersion_env%scale_rvv10 hpot(:) = 0.5_dp*dispersion_env%scale_rvv10*hpot(:) END SELECT - CALL pw_pool%create_pw(vxc_r, in_space=REALSPACE) + CALL pw_pool%create_pw(vxc_r) DO i = 1, 3 lo(i) = LBOUND(vxc_r%array, i) hi(i) = UBOUND(vxc_r%array, i) @@ -529,8 +526,8 @@ SUBROUTINE calculate_dispersion_nonloc(vxc_rho, rho_r, rho_g, edispersion, & END DO CALL pw_transfer(vxc_r, tmp_g) CALL pw_pool%give_back_pw(vxc_r) - CALL xc_pw_pool%create_pw(vxc_r, in_space=REALSPACE) - CALL xc_pw_pool%create_pw(vxc_g, in_space=RECIPROCALSPACE) + CALL xc_pw_pool%create_pw(vxc_r) + CALL xc_pw_pool%create_pw(vxc_g) CALL pw_transfer(tmp_g, vxc_g) CALL pw_transfer(vxc_g, vxc_r) DO ispin = 1, nspin @@ -574,7 +571,7 @@ END SUBROUTINE calculate_dispersion_nonloc !> OpenMP added: Aug 2016 MTucker ! ************************************************************************************************** SUBROUTINE vdW_energy(thetas_g, dispersion_env, vdW_xc_energy, energy_only, virial) - TYPE(pw_c1d_type), DIMENSION(:), INTENT(IN) :: thetas_g + TYPE(pw_c1d_gs_type), DIMENSION(:), INTENT(IN) :: thetas_g TYPE(qs_dispersion_type), POINTER :: dispersion_env REAL(KIND=dp), INTENT(OUT) :: vdW_xc_energy LOGICAL, INTENT(IN) :: energy_only diff --git a/src/qs_electric_field_gradient.F b/src/qs_electric_field_gradient.F index 85a37e2077..a0e2eb72e1 100644 --- a/src/qs_electric_field_gradient.F +++ b/src/qs_electric_field_gradient.F @@ -51,10 +51,8 @@ MODULE qs_electric_field_gradient Eval_Interp_Spl3_pbc, Eval_d_Interp_Spl3_pbc, find_coeffs, pw_spline_do_precond, & pw_spline_precond_create, pw_spline_precond_release, pw_spline_precond_set_kind, & pw_spline_precond_type, spl3_pbc - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_gapw_densities, ONLY: prepare_gapw_den @@ -107,14 +105,14 @@ SUBROUTINE qs_efg_calc(qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_gspace, structure_factor, & + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, structure_factor, & v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(6) :: dvr2 + TYPE(pw_c1d_gs_type), DIMENSION(6) :: dvr2 TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: dvr2rs - TYPE(pw_r3d_type), DIMENSION(6) :: dvspl + TYPE(pw_r3d_rs_type) :: dvr2rs + TYPE(pw_r3d_rs_type), DIMENSION(6) :: dvspl TYPE(pw_spline_precond_type) :: precond TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_type), POINTER :: rho @@ -158,8 +156,7 @@ SUBROUTINE qs_efg_calc(qs_env) ELSEIF (ecut == -1._dp .AND. sigma == -1._dp) THEN smoothing = .TRUE. CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(dvr2rs, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dvr2rs) ecut = 2._dp*dvr2rs%pw_grid%cutoff*0.875_dp sigma = 2._dp*dvr2rs%pw_grid%cutoff*0.125_dp CALL auxbas_pw_pool%give_back_pw(dvr2rs) @@ -212,10 +209,8 @@ SUBROUTINE qs_efg_calc(qs_env) IF (gapw) CALL prepare_gapw_den(qs_env, do_rho0=.TRUE.) !calculate electrostatic potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) CALL pw_poisson_solve(poisson_env, rho_tot_gspace, ehartree, & @@ -228,15 +223,13 @@ SUBROUTINE qs_efg_calc(qs_env) DO i = 1, 3 DO j = 1, i ij = (i*(i - 1))/2 + j - CALL auxbas_pw_pool%create_pw(dvr2(ij), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(dvr2(ij)) CALL pw_dr2(v_hartree_gspace, dvr2(ij), i, j) END DO END DO IF (.NOT. efg_interpolation) THEN - CALL auxbas_pw_pool%create_pw(structure_factor, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(structure_factor) ELSE interp_section => section_vals_get_subs_vals(dft_section, & @@ -248,11 +241,9 @@ SUBROUTINE qs_efg_calc(qs_env) CALL section_vals_val_get(interp_section, "eps_r", r_val=eps_r) CALL section_vals_val_get(interp_section, "eps_x", r_val=eps_x) - CALL auxbas_pw_pool%create_pw(dvr2rs, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dvr2rs) DO i = 1, 6 - CALL auxbas_pw_pool%create_pw(dvspl(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dvspl(i)) CALL pw_transfer(dvr2(i), dvr2rs) ! calculate spline coefficients CALL pw_spline_precond_create(precond, precond_kind=aint_precond, & diff --git a/src/qs_elf_methods.F b/src/qs_elf_methods.F index 79bacc58a9..43b4f1679c 100644 --- a/src/qs_elf_methods.F +++ b/src/qs_elf_methods.F @@ -22,10 +22,8 @@ MODULE qs_elf_methods pw_zero USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -55,7 +53,7 @@ MODULE qs_elf_methods SUBROUTINE qs_elf_calc(qs_env, elf_r, rho_cutoff) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: elf_r + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: elf_r REAL(kind=dp), INTENT(IN) :: rho_cutoff CHARACTER(len=*), PARAMETER :: routineN = 'qs_elf_calc' @@ -72,14 +70,14 @@ SUBROUTINE qs_elf_calc(qs_env, elf_r, rho_cutoff) udvol TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_struct_ao - TYPE(pw_c1d_type) :: tmp_g + TYPE(pw_c1d_gs_type) :: tmp_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(3) :: drho_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_struct_r, tau_struct_r - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_struct_r - TYPE(pw_r3d_type), POINTER :: rho_r, tau_r + TYPE(pw_r3d_rs_type), DIMENSION(3) :: drho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_struct_r, tau_struct_r + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_struct_r + TYPE(pw_r3d_rs_type), POINTER :: rho_r, tau_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_struct @@ -108,17 +106,14 @@ SUBROUTINE qs_elf_calc(qs_env, elf_r, rho_cutoff) ! We will not have further use for it, so we will need only one IF (.NOT. tau_r_valid) THEN ALLOCATE (tau_r) - CALL auxbas_pw_pool%create_pw(tau_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tau_r) END IF IF (.NOT. tau_r_valid .OR. .NOT. drho_r_valid) THEN - CALL auxbas_pw_pool%create_pw(tmp_g, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tmp_g) END IF IF (.NOT. drho_r_valid) THEN DO idir = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_r(idir), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_r(idir)) END DO END IF diff --git a/src/qs_energy_utils.F b/src/qs_energy_utils.F index 2a788eff63..0cc355c06d 100644 --- a/src/qs_energy_utils.F +++ b/src/qs_energy_utils.F @@ -39,8 +39,7 @@ MODULE qs_energy_utils USE pw_methods, ONLY: pw_axpy,& pw_scale USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_dispersion_types, ONLY: qs_dispersion_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& @@ -104,7 +103,7 @@ SUBROUTINE qs_energies_properties(qs_env, calc_forces) TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_energy_type), POINTER :: energy TYPE(section_vals_type), POINTER :: input, post_scf_bands_section, & proj_section, rest_b_section, & @@ -273,9 +272,9 @@ SUBROUTINE ks_xc_correction(qs_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: xc_den - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: vtau, vxc - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: xc_den + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: vtau, vxc + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_dispersion_type), POINTER :: dispersion_env TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_ks_env_type), POINTER :: ks_env @@ -314,18 +313,15 @@ SUBROUTINE ks_xc_correction(qs_env) END IF CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(xc_den, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(xc_den) ALLOCATE (vxc(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(vxc(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vxc(ispin)) END DO IF (needs%tau .OR. needs%tau_spin) THEN ALLOCATE (vtau(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(vtau(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vtau(ispin)) END DO END IF diff --git a/src/qs_energy_window.F b/src/qs_energy_window.F index aaa8047096..6ed0b9e9c8 100644 --- a/src/qs_energy_window.F +++ b/src/qs_energy_window.F @@ -48,10 +48,8 @@ MODULE qs_energy_window pw_env_type USE pw_methods, ONLY: pw_integrate_function USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -106,10 +104,10 @@ SUBROUTINE energy_windows(qs_env) tmp TYPE(dbcsr_type), POINTER :: rho_ao_ortho, window TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type) :: rho_g + TYPE(pw_c1d_gs_type) :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rho_r + TYPE(pw_r3d_rs_type) :: rho_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(qs_subsys_type), POINTER :: subsys @@ -158,8 +156,8 @@ SUBROUTINE energy_windows(qs_env) CALL cp_fm_create(S_minus_half_fm, ao_ao_fmstruct) CALL cp_fm_create(eigenvectors, ao_ao_fmstruct) CALL cp_fm_create(eigenvectors_nonorth, ao_ao_fmstruct) - CALL auxbas_pw_pool%create_pw(rho_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r) + CALL auxbas_pw_pool%create_pw(rho_g) !calculate S_minus_half CALL matrix_sqrt_Newton_Schulz(S_half, S_minus_half, matrix_s(1)%matrix, filter_eps, & diff --git a/src/qs_environment.F b/src/qs_environment.F index a37cf040c5..a34c8da736 100644 --- a/src/qs_environment.F +++ b/src/qs_environment.F @@ -71,7 +71,7 @@ MODULE qs_environment read_ewald_section_tb USE ewald_pw_methods, ONLY: ewald_pw_grid_update USE ewald_pw_types, ONLY: ewald_pw_create,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE exstates_types, ONLY: excited_energy_type,& exstate_create USE external_potential_types, ONLY: get_potential,& @@ -572,7 +572,7 @@ SUBROUTINE qs_init_subsys(qs_env, para_env, subsys, cell, cell_ref, use_ref_cell TYPE(dftb_control_type), POINTER :: dftb_control TYPE(distribution_1d_type), POINTER :: local_molecules, local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: se_nonbond_env TYPE(gapw_control_type), POINTER :: gapw_control TYPE(gto_basis_set_type), POINTER :: aux_fit_basis, lri_aux_basis, & diff --git a/src/qs_environment_methods.F b/src/qs_environment_methods.F index d0bbf8dcb6..dd59f9d3b1 100644 --- a/src/qs_environment_methods.F +++ b/src/qs_environment_methods.F @@ -24,7 +24,7 @@ MODULE qs_environment_methods USE distribution_methods, ONLY: distribute_molecules_2d USE ewald_environment_types, ONLY: ewald_environment_type USE ewald_pw_methods, ONLY: ewald_pw_grid_update - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE input_constants, ONLY: do_ppl_grid USE kinds, ONLY: dp USE message_passing, ONLY: mp_para_env_type @@ -37,10 +37,8 @@ MODULE qs_environment_methods pw_env_release,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_charges_types, ONLY: qs_charges_create,& qs_charges_type USE qs_environment_types, ONLY: get_qs_env,& @@ -201,11 +199,11 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw - TYPE(pw_c1d_type), POINTER :: rho_core, rho_nlcc_g + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw + TYPE(pw_c1d_gs_type), POINTER :: rho_core, rho_nlcc_g TYPE(pw_env_type), POINTER :: new_pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: embed_pot, external_vxc, rho_nlcc, & + TYPE(pw_r3d_rs_type), POINTER :: embed_pot, external_vxc, rho_nlcc, & spin_embed_pot, v_hartree_rspace, vee, & vppl TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -245,8 +243,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) IF (dft_control%qs_control%gapw_control%nopaw_as_gpw) THEN ALLOCATE (rho_core) CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rho_core, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_core) CALL set_ks_env(ks_env, rho_core=rho_core) END IF CALL get_qs_env(qs_env=qs_env, rho0_mpole=rho0_mpole) @@ -277,8 +274,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) END IF ALLOCATE (rho_core) CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rho_core, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_core) CALL set_ks_env(ks_env, rho_core=rho_core) END IF @@ -292,7 +288,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) ALLOCATE (vppl) END IF CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(vppl, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vppl) CALL set_ks_env(ks_env, vppl=vppl) END IF @@ -309,7 +305,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) ALLOCATE (rho_nlcc) END IF CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rho_nlcc, REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_nlcc) CALL set_ks_env(ks_env, rho_nlcc=rho_nlcc) ! the g-space version NULLIFY (rho_nlcc_g) @@ -320,7 +316,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) ALLOCATE (rho_nlcc_g) END IF CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rho_nlcc_g, RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_nlcc_g) CALL set_ks_env(ks_env, rho_nlcc_g=rho_nlcc_g) END IF @@ -334,7 +330,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) END IF ALLOCATE (vee) CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(vee, REALSPACE) + CALL auxbas_pw_pool%create_pw(vee) CALL set_ks_env(ks_env, vee=vee) dft_control%eval_external_potential = .TRUE. END IF @@ -349,7 +345,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) ALLOCATE (external_vxc) END IF CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(external_vxc, REALSPACE) + CALL auxbas_pw_pool%create_pw(external_vxc) CALL set_qs_env(qs_env, external_vxc=external_vxc) dft_control%read_external_vxc = .TRUE. END IF @@ -364,7 +360,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) ALLOCATE (embed_pot) END IF CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(embed_pot, REALSPACE) + CALL auxbas_pw_pool%create_pw(embed_pot) CALL set_qs_env(qs_env, embed_pot=embed_pot) NULLIFY (spin_embed_pot) @@ -376,7 +372,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) ALLOCATE (spin_embed_pot) END IF CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(spin_embed_pot, REALSPACE) + CALL auxbas_pw_pool%create_pw(spin_embed_pot) CALL set_qs_env(qs_env, spin_embed_pot=spin_embed_pot) END IF @@ -388,8 +384,7 @@ SUBROUTINE qs_env_rebuild_pw_env(qs_env) CALL get_qs_env(qs_env, pw_env=new_pw_env) CALL pw_env_get(new_pw_env, auxbas_pw_pool=auxbas_pw_pool) ALLOCATE (v_hartree_rspace) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, & - REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) CALL set_ks_env(ks_env, v_hartree_rspace=v_hartree_rspace) END IF diff --git a/src/qs_environment_types.F b/src/qs_environment_types.F index 32abfc5773..edcb10599d 100644 --- a/src/qs_environment_types.F +++ b/src/qs_environment_types.F @@ -44,7 +44,7 @@ MODULE qs_environment_types et_coupling_type USE ewald_environment_types, ONLY: ewald_env_release,& ewald_environment_type - USE ewald_pw_types, ONLY: ewald_pw_r3d_type,& + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type,& ewald_pw_release USE exstates_types, ONLY: excited_energy_type,& exstate_release @@ -83,8 +83,8 @@ MODULE qs_environment_types USE post_scf_bandstructure_types, ONLY: bs_env_release,& post_scf_bandstructure_type USE pw_env_types, ONLY: pw_env_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qmmm_types_low, ONLY: qmmm_env_qm_type USE qs_active_space_types, ONLY: active_space_type,& release_active_space_type @@ -241,8 +241,8 @@ MODULE qs_environment_types TYPE(rel_control_type), POINTER :: rel_control ! ZMP adding variables TYPE(qs_rho_type), POINTER :: rho_external - TYPE(pw_r3d_type), POINTER :: external_vxc - TYPE(pw_r3d_type), POINTER :: mask + TYPE(pw_r3d_rs_type), POINTER :: external_vxc + TYPE(pw_r3d_rs_type), POINTER :: mask TYPE(qs_charges_type), POINTER :: qs_charges TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_ks_qmmm_env_type), POINTER :: ks_qmmm_env @@ -281,7 +281,7 @@ MODULE qs_environment_types TYPE(qs_gcp_type), POINTER :: gcp_env ! Semi-empirical and DFTB types TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw ! Semi-empirical types TYPE(se_taper_type), POINTER :: se_taper TYPE(semi_empirical_si_type), POINTER :: se_store_int_env @@ -299,8 +299,8 @@ MODULE qs_environment_types ! Subsystem densities TYPE(qs_rho_p_type), DIMENSION(:), POINTER :: subsys_dens ! Embedding potential - TYPE(pw_r3d_type), POINTER :: embed_pot - TYPE(pw_r3d_type), POINTER :: spin_embed_pot + TYPE(pw_r3d_rs_type), POINTER :: embed_pot + TYPE(pw_r3d_rs_type), POINTER :: spin_embed_pot ! Polarizability tensor TYPE(polar_env_type), POINTER :: polar_env ! Resp charges @@ -534,7 +534,7 @@ SUBROUTINE get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, ce TYPE(qs_rho_type), OPTIONAL, POINTER :: rho, rho_xc TYPE(pw_env_type), OPTIONAL, POINTER :: pw_env TYPE(ewald_environment_type), OPTIONAL, POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), OPTIONAL, POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), OPTIONAL, POINTER :: ewald_pw TYPE(active_space_type), OPTIONAL, POINTER :: active_space TYPE(qs_matrix_pools_type), OPTIONAL, POINTER :: mpools TYPE(section_vals_type), OPTIONAL, POINTER :: input @@ -545,10 +545,10 @@ SUBROUTINE get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, ce TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, & POINTER :: kinetic TYPE(qs_charges_type), OPTIONAL, POINTER :: qs_charges - TYPE(pw_r3d_type), OPTIONAL, POINTER :: vppl - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho_core - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho_nlcc - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho_nlcc_g + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: vppl + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho_core + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho_nlcc + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho_nlcc_g TYPE(qs_ks_env_type), OPTIONAL, POINTER :: ks_env TYPE(qs_ks_qmmm_env_type), OPTIONAL, POINTER :: ks_qmmm_env TYPE(qs_wf_history_type), OPTIONAL, POINTER :: wf_history @@ -573,8 +573,8 @@ SUBROUTINE get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, ce TYPE(rhoz_type), DIMENSION(:), OPTIONAL, POINTER :: rhoz_set TYPE(ecoul_1center_type), DIMENSION(:), OPTIONAL, & POINTER :: ecoul_1c - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho0_s_rs - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho0_s_gs + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho0_s_rs + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho0_s_gs LOGICAL, OPTIONAL :: do_kpoints, has_unit_metric, & requires_mo_derivs TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, & @@ -607,9 +607,9 @@ SUBROUTINE get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, ce TYPE(energy_correction_type), OPTIONAL, POINTER :: ec_env TYPE(qs_dispersion_type), OPTIONAL, POINTER :: dispersion_env TYPE(qs_gcp_type), OPTIONAL, POINTER :: gcp_env - TYPE(pw_r3d_type), OPTIONAL, POINTER :: vee + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: vee TYPE(qs_rho_type), OPTIONAL, POINTER :: rho_external - TYPE(pw_r3d_type), OPTIONAL, POINTER :: external_vxc, mask + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: external_vxc, mask TYPE(mp2_type), OPTIONAL, POINTER :: mp2_env TYPE(post_scf_bandstructure_type), OPTIONAL, & POINTER :: bs_env @@ -620,14 +620,14 @@ SUBROUTINE get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, ce TYPE(ls_scf_env_type), OPTIONAL, POINTER :: ls_scf_env LOGICAL, OPTIONAL :: do_transport TYPE(transport_env_type), OPTIONAL, POINTER :: transport_env - TYPE(pw_r3d_type), OPTIONAL, POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: v_hartree_rspace LOGICAL, OPTIONAL :: s_mstruct_changed, rho_changed, & potential_changed, forces_up_to_date TYPE(molecular_scf_guess_env_type), OPTIONAL, & POINTER :: mscfg_env TYPE(almo_scf_env_type), OPTIONAL, POINTER :: almo_scf_env REAL(KIND=dp), DIMENSION(:, :), OPTIONAL, POINTER :: gradient_history, variable_history - TYPE(pw_r3d_type), OPTIONAL, POINTER :: embed_pot, spin_embed_pot + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: embed_pot, spin_embed_pot TYPE(polar_env_type), OPTIONAL, POINTER :: polar_env TYPE(mo_set_type), DIMENSION(:), OPTIONAL, POINTER :: mos_last_converged REAL(KIND=dp), DIMENSION(:), OPTIONAL, POINTER :: rhs @@ -1038,10 +1038,10 @@ SUBROUTINE set_qs_env(qs_env, super_cell, & TYPE(mo_set_type), DIMENSION(:), OPTIONAL, POINTER :: mos LOGICAL, OPTIONAL :: qmmm, qmmm_periodic TYPE(ewald_environment_type), OPTIONAL, POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), OPTIONAL, POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), OPTIONAL, POINTER :: ewald_pw TYPE(qs_matrix_pools_type), OPTIONAL, POINTER :: mpools TYPE(qs_rho_type), OPTIONAL, POINTER :: rho_external - TYPE(pw_r3d_type), OPTIONAL, POINTER :: external_vxc, mask + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: external_vxc, mask TYPE(scf_control_type), OPTIONAL, POINTER :: scf_control TYPE(rel_control_type), OPTIONAL, POINTER :: rel_control TYPE(qs_charges_type), OPTIONAL, POINTER :: qs_charges @@ -1103,7 +1103,7 @@ SUBROUTINE set_qs_env(qs_env, super_cell, & OPTIONAL, POINTER :: WannierCentres TYPE(almo_scf_env_type), OPTIONAL, POINTER :: almo_scf_env REAL(KIND=dp), DIMENSION(:, :), OPTIONAL, POINTER :: gradient_history, variable_history - TYPE(pw_r3d_type), OPTIONAL, POINTER :: embed_pot, spin_embed_pot + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: embed_pot, spin_embed_pot TYPE(polar_env_type), OPTIONAL, POINTER :: polar_env TYPE(mo_set_type), DIMENSION(:), OPTIONAL, POINTER :: mos_last_converged REAL(KIND=dp), DIMENSION(:), OPTIONAL, POINTER :: rhs diff --git a/src/qs_epr_hyp.F b/src/qs_epr_hyp.F index 3176821b44..4642cab1d2 100644 --- a/src/qs_epr_hyp.F +++ b/src/qs_epr_hyp.F @@ -43,8 +43,7 @@ MODULE qs_epr_hyp pw_dr2_gg,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type + USE pw_types, ONLY: pw_c1d_gs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_grid_atom, ONLY: grid_atom_type @@ -96,8 +95,8 @@ SUBROUTINE qs_epr_hyp_calc(qs_env) TYPE(harmonics_atom_type), POINTER :: harmonics TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: hypaniso_gspace, rhototspin_elec_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type) :: hypaniso_gspace, rhototspin_elec_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_pool_type), POINTER :: auxbas_pw_pool @@ -281,8 +280,7 @@ SUBROUTINE qs_epr_hyp_calc(qs_env) CALL pw_env_get(pw_env=pw_env, & auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rhototspin_elec_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhototspin_elec_gspace) CALL pw_zero(rhototspin_elec_gspace) pw_grid => rhototspin_elec_gspace%pw_grid @@ -293,8 +291,7 @@ SUBROUTINE qs_epr_hyp_calc(qs_env) CALL pw_axpy(rho_g(1), rhototspin_elec_gspace) CALL pw_axpy(rho_g(2), rhototspin_elec_gspace, alpha=-1._dp) ! grid to assemble anisotropic hyperfine terms - CALL auxbas_pw_pool%create_pw(hypaniso_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(hypaniso_gspace) DO idir1 = 1, 3 DO idir2 = idir1, 3 ! tensor symmetry diff --git a/src/qs_external_density.F b/src/qs_external_density.F index e678a5a835..2fdbffd6f7 100644 --- a/src/qs_external_density.F +++ b/src/qs_external_density.F @@ -23,8 +23,8 @@ MODULE qs_external_density USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_methods, ONLY: pw_integrate_function - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_rho_types, ONLY: qs_rho_get,& @@ -70,9 +70,9 @@ SUBROUTINE external_read_density(qs_env) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(gridlevel_info_type), POINTER :: gridlevel_info - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_ext_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_ext_g TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_ext_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_ext_r TYPE(qs_rho_type), POINTER :: rho_external TYPE(realspace_grid_desc_p_type), DIMENSION(:), & POINTER :: rs_descs diff --git a/src/qs_external_potential.F b/src/qs_external_potential.F index 4990cd9ef1..67ad371ba8 100644 --- a/src/qs_external_potential.F +++ b/src/qs_external_potential.F @@ -35,7 +35,7 @@ MODULE qs_external_potential USE particle_types, ONLY: particle_type USE pw_grid_types, ONLY: PW_MODE_LOCAL USE pw_methods, ONLY: pw_zero - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -77,7 +77,7 @@ SUBROUTINE external_e_potential(qs_env) REAL(kind=dp), ALLOCATABLE, DIMENSION(:, :) :: grid_p REAL(kind=dp), DIMENSION(3) :: dr TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_r3d_type), POINTER :: v_ee + TYPE(pw_r3d_rs_type), POINTER :: v_ee TYPE(section_vals_type), POINTER :: ext_pot_section, input CALL timeset(routineN, handle) @@ -185,7 +185,7 @@ SUBROUTINE external_c_potential(qs_env, calculate_forces) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), POINTER :: v_ee + TYPE(pw_r3d_rs_type), POINTER :: v_ee TYPE(qs_energy_type), POINTER :: energy TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -373,7 +373,7 @@ END SUBROUTINE get_external_potential ! ************************************************************************************************** SUBROUTINE interpolate_external_potential(r, grid, func, dfunc, calc_derivatives) REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: r - TYPE(pw_r3d_type), POINTER :: grid + TYPE(pw_r3d_rs_type), POINTER :: grid REAL(KIND=dp), INTENT(OUT), OPTIONAL :: func, dfunc(3) LOGICAL, INTENT(IN), OPTIONAL :: calc_derivatives diff --git a/src/qs_fxc.F b/src/qs_fxc.F index 8a204b4c39..008614f0c8 100644 --- a/src/qs_fxc.F +++ b/src/qs_fxc.F @@ -36,9 +36,8 @@ MODULE qs_fxc pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_ks_types, ONLY: get_ks_env,& qs_ks_env_type USE qs_rho_methods, ONLY: qs_rho_copy,& @@ -85,11 +84,11 @@ MODULE qs_fxc SUBROUTINE qs_fxc_analytic(rho0, rho1_r, tau1_r, xc_section, auxbas_pw_pool, is_triplet, v_xc, v_xc_tau) TYPE(qs_rho_type), POINTER :: rho0 - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, tau1_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, tau1_r TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: auxbas_pw_pool LOGICAL, INTENT(IN) :: is_triplet - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_xc, v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_xc, v_xc_tau CHARACTER(len=*), PARAMETER :: routineN = 'qs_fxc_analytic' @@ -97,8 +96,8 @@ SUBROUTINE qs_fxc_analytic(rho0, rho1_r, tau1_r, xc_section, auxbas_pw_pool, is_ INTEGER, DIMENSION(2, 3) :: bo LOGICAL :: lsd REAL(KIND=dp) :: fac - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho0_g, rho1_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho0_r, tau0_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho0_g, rho1_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho0_r, tau0_r TYPE(section_vals_type), POINTER :: xc_fun_section TYPE(xc_derivative_set_type) :: deriv_set TYPE(xc_rho_cflags_type) :: needs @@ -150,7 +149,7 @@ SUBROUTINE qs_fxc_fdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, TYPE(section_vals_type), POINTER :: xc_section INTEGER, INTENT(IN) :: accuracy LOGICAL, INTENT(IN) :: is_triplet - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau CHARACTER(len=*), PARAMETER :: routineN = 'qs_fxc_fdiff' REAL(KIND=dp), PARAMETER :: epsrho = 5.e-4_dp @@ -161,7 +160,7 @@ SUBROUTINE qs_fxc_fdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_tau_rspace, vxc00 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_tau_rspace, vxc00 TYPE(qs_rho_type), POINTER :: rhoin CALL timeset(routineN, handle) @@ -221,8 +220,7 @@ SUBROUTINE qs_fxc_fdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, IF (.NOT. ASSOCIATED(fxc_rho)) THEN ALLOCATE (fxc_rho(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(fxc_rho(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(fxc_rho(ispin)) CALL pw_zero(fxc_rho(ispin)) END DO END IF @@ -237,8 +235,7 @@ SUBROUTINE qs_fxc_fdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, IF (.NOT. ASSOCIATED(fxc_tau)) THEN ALLOCATE (fxc_tau(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(fxc_tau(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(fxc_tau(ispin)) CALL pw_zero(fxc_tau(ispin)) END DO END IF @@ -291,7 +288,7 @@ SUBROUTINE qs_fgxc_gdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, INTEGER, INTENT(IN) :: accuracy REAL(KIND=dp), INTENT(IN) :: epsrho LOGICAL, INTENT(IN) :: is_triplet - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau CHARACTER(len=*), PARAMETER :: routineN = 'qs_fgxc_gdiff' @@ -301,7 +298,7 @@ SUBROUTINE qs_fgxc_gdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_tau_rspace, vxc00 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_tau_rspace, vxc00 TYPE(qs_rho_type), POINTER :: rhoin CALL timeset(routineN, handle) @@ -355,8 +352,7 @@ SUBROUTINE qs_fgxc_gdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, IF (.NOT. ASSOCIATED(gxc_rho)) THEN ALLOCATE (gxc_rho(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(gxc_rho(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(gxc_rho(ispin)) CALL pw_zero(gxc_rho(ispin)) END DO END IF @@ -371,8 +367,7 @@ SUBROUTINE qs_fgxc_gdiff(ks_env, rho0_struct, rho1_struct, xc_section, accuracy, IF (.NOT. ASSOCIATED(gxc_tau)) THEN ALLOCATE (gxc_tau(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(gxc_tau(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(gxc_tau(ispin)) CALL pw_zero(gxc_tau(ispin)) END DO END IF @@ -423,7 +418,7 @@ SUBROUTINE qs_fgxc_create(ks_env, rho0_struct, rho1_struct, xc_section, accuracy TYPE(section_vals_type), POINTER :: xc_section INTEGER, INTENT(IN) :: accuracy LOGICAL, INTENT(IN) :: is_triplet - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau CHARACTER(len=*), PARAMETER :: routineN = 'qs_fgxc_create' REAL(KIND=dp), PARAMETER :: epsrho = 5.e-4_dp @@ -434,7 +429,7 @@ SUBROUTINE qs_fgxc_create(ks_env, rho0_struct, rho1_struct, xc_section, accuracy TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_tau_rspace, vxc00 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_tau_rspace, vxc00 TYPE(qs_rho_type), POINTER :: rhoin CALL timeset(routineN, handle) @@ -499,16 +494,14 @@ SUBROUTINE qs_fgxc_create(ks_env, rho0_struct, rho1_struct, xc_section, accuracy IF (.NOT. ASSOCIATED(fxc_rho)) THEN ALLOCATE (fxc_rho(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(fxc_rho(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(fxc_rho(ispin)) CALL pw_zero(fxc_rho(ispin)) END DO END IF IF (.NOT. ASSOCIATED(gxc_rho)) THEN ALLOCATE (gxc_rho(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(gxc_rho(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(gxc_rho(ispin)) CALL pw_zero(gxc_rho(ispin)) END DO END IF @@ -550,7 +543,7 @@ END SUBROUTINE qs_fgxc_create SUBROUTINE qs_fgxc_release(ks_env, fxc_rho, fxc_tau, gxc_rho, gxc_tau) TYPE(qs_ks_env_type), POINTER :: ks_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau INTEGER :: ispin TYPE(pw_env_type), POINTER :: pw_env diff --git a/src/qs_gamma2kp.F b/src/qs_gamma2kp.F index d2dc18b77a..539909db1e 100644 --- a/src/qs_gamma2kp.F +++ b/src/qs_gamma2kp.F @@ -26,8 +26,8 @@ MODULE qs_gamma2kp kpoint_type USE message_passing, ONLY: mp_para_env_type USE pw_methods, ONLY: pw_copy - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_init, ONLY: qs_energies_init USE qs_environment, ONLY: qs_init USE qs_environment_types, ONLY: get_qs_env,& @@ -69,8 +69,8 @@ SUBROUTINE create_kp_from_gamma(qs_env, qs_env_kp, with_xc_terms) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp, rho_ao_kp_gamma TYPE(kpoint_type), POINTER :: kpoint TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_gamma, rho_g_kp - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_gamma, rho_r_kp + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_gamma, rho_g_kp + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_gamma, rho_r_kp TYPE(qs_rho_type), POINTER :: rho, rho_gamma TYPE(qs_scf_env_type), POINTER :: scf_env TYPE(scf_control_type), POINTER :: scf_control diff --git a/src/qs_gspace_mixing.F b/src/qs_gspace_mixing.F index fbb4696831..ef3705681e 100644 --- a/src/qs_gspace_mixing.F +++ b/src/qs_gspace_mixing.F @@ -21,9 +21,8 @@ MODULE qs_gspace_mixing pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_density_mixing_types, ONLY: broyden_mixing_new_nr,& broyden_mixing_nr,& cp_1d_z_p_type,& @@ -79,11 +78,11 @@ SUBROUTINE gspace_mixing(qs_env, mixing_method, mixing_store, rho, para_env, ite REAL(dp) :: alpha REAL(KIND=dp), DIMENSION(:), POINTER :: tot_rho_r TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: rho_tmp - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type) :: rho_tmp + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom CALL timeset(routineN, handle) @@ -106,8 +105,7 @@ SUBROUTINE gspace_mixing(qs_env, mixing_method, mixing_store, rho, para_env, ite IF (nspin == 2) THEN CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(rho_tmp, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tmp) CALL pw_zero(rho_tmp) CALL pw_copy(rho_g(1), rho_tmp) CALL pw_axpy(rho_g(2), rho_g(1), 1.0_dp) @@ -212,7 +210,7 @@ SUBROUTINE gmix_potential_only(qs_env, mixing_store, rho) LOGICAL :: gapw REAL(dp) :: alpha, f_mix TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom CPASSERT(ASSOCIATED(mixing_store%rhoin)) @@ -301,7 +299,7 @@ SUBROUTINE pulay_mixing(qs_env, mixing_store, rho, para_env) REAL(dp), ALLOCATABLE, DIMENSION(:) :: alpha_c, ev REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: a, b, c, c_inv, cpc_h_mix, cpc_s_mix TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom CPASSERT(ASSOCIATED(mixing_store%res_buffer)) @@ -580,7 +578,7 @@ SUBROUTINE broyden_mixing(qs_env, mixing_store, rho, para_env) REAL(dp), ALLOCATABLE, DIMENSION(:) :: c, g REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: a, b TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho_atom CPASSERT(ASSOCIATED(mixing_store%res_buffer)) @@ -899,7 +897,7 @@ SUBROUTINE broyden_mixing_new(mixing_store, rho, para_env) REAL(dp), DIMENSION(:, :), POINTER :: fmat, weight TYPE(cp_1d_z_p_type), DIMENSION(:), POINTER :: tmp_z TYPE(cp_1d_z_p_type), DIMENSION(:, :), POINTER :: delta_res, u_vec, z_vec - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g CPASSERT(ASSOCIATED(mixing_store%rhoin_buffer)) @@ -1213,7 +1211,7 @@ SUBROUTINE multisecant_mixing(mixing_store, rho, para_env) REAL(dp), ALLOCATABLE, DIMENSION(:, :) :: b_matrix, binv_matrix REAL(dp), DIMENSION(:), POINTER :: g2 REAL(dp), SAVE :: sigma_old = 1.0_dp - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g CPASSERT(ASSOCIATED(mixing_store)) diff --git a/src/qs_integrate_potential_product.F b/src/qs_integrate_potential_product.F index 13339517b1..b151eba1a9 100644 --- a/src/qs_integrate_potential_product.F +++ b/src/qs_integrate_potential_product.F @@ -54,7 +54,7 @@ MODULE qs_integrate_potential_product USE particle_types, ONLY: particle_type USE pw_env_types, ONLY: pw_env_get,& pw_env_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_force_types, ONLY: qs_force_type @@ -106,7 +106,7 @@ MODULE qs_integrate_potential_product !> \param lambda The atom index. ! ************************************************************************************************** SUBROUTINE integrate_v_dbasis(v_rspace, matrix_vhxc_dbasis, matrix_p, qs_env, lambda) - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_vhxc_dbasis TYPE(dbcsr_type), POINTER :: matrix_p TYPE(qs_environment_type), POINTER :: qs_env @@ -575,7 +575,7 @@ SUBROUTINE integrate_v_rspace(v_rspace, hmat, hmat_kp, pmat, pmat_kp, & qs_env, calculate_forces, force_adm, & compute_tau, gapw, basis_type, pw_env_external, task_list_external) - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(dbcsr_p_type), INTENT(INOUT), OPTIONAL :: hmat TYPE(dbcsr_p_type), DIMENSION(:), OPTIONAL, & POINTER :: hmat_kp diff --git a/src/qs_integrate_potential_single.F b/src/qs_integrate_potential_single.F index 10e1b1acbe..ac31cbb024 100644 --- a/src/qs_integrate_potential_single.F +++ b/src/qs_integrate_potential_single.F @@ -54,7 +54,7 @@ MODULE qs_integrate_potential_single USE particle_types, ONLY: particle_type USE pw_env_types, ONLY: pw_env_get,& pw_env_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_force_types, ONLY: qs_force_type @@ -95,7 +95,7 @@ MODULE qs_integrate_potential_single !> \param qs_env ... ! ************************************************************************************************** SUBROUTINE integrate_ppl_rspace(rho_rspace, qs_env) - TYPE(pw_r3d_type), INTENT(IN) :: rho_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_rspace TYPE(qs_environment_type), POINTER :: qs_env CHARACTER(len=*), PARAMETER :: routineN = 'integrate_ppl_rspace' @@ -280,7 +280,7 @@ END SUBROUTINE integrate_ppl_rspace !> \param qs_env ... ! ************************************************************************************************** SUBROUTINE integrate_rho_nlcc(rho_rspace, qs_env) - TYPE(pw_r3d_type), INTENT(IN) :: rho_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_rspace TYPE(qs_environment_type), POINTER :: qs_env CHARACTER(len=*), PARAMETER :: routineN = 'integrate_rho_nlcc' @@ -480,7 +480,7 @@ END SUBROUTINE integrate_rho_nlcc !> \param atecc ... ! ************************************************************************************************** SUBROUTINE integrate_v_core_rspace(v_rspace, qs_env, atecc) - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), DIMENSION(:), OPTIONAL :: atecc @@ -642,7 +642,7 @@ END SUBROUTINE integrate_v_core_rspace !> \param atecc ... ! ************************************************************************************************** SUBROUTINE integrate_v_gaussian_rspace(v_rspace, qs_env, alpha, ccore, atecc) - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: alpha, ccore REAL(KIND=dp), DIMENSION(:) :: atecc @@ -760,7 +760,7 @@ END SUBROUTINE integrate_v_gaussian_rspace ! ************************************************************************************************** SUBROUTINE integrate_v_rspace_one_center(v_rspace, qs_env, int_res, & calculate_forces, basis_type, atomlist) - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(qs_environment_type), POINTER :: qs_env TYPE(lri_kind_type), DIMENSION(:), POINTER :: int_res LOGICAL, INTENT(IN) :: calculate_forces @@ -970,7 +970,7 @@ END SUBROUTINE integrate_v_rspace_one_center !> \author JGH ! ************************************************************************************************** SUBROUTINE integrate_v_rspace_diagonal(v_rspace, ksmat, pmat, qs_env, calculate_forces, basis_type) - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(dbcsr_type), INTENT(INOUT) :: ksmat, pmat TYPE(qs_environment_type), POINTER :: qs_env LOGICAL, INTENT(IN) :: calculate_forces diff --git a/src/qs_kernel_methods.F b/src/qs_kernel_methods.F index f61c8bbdf9..fea240e3d2 100644 --- a/src/qs_kernel_methods.F +++ b/src/qs_kernel_methods.F @@ -22,8 +22,8 @@ MODULE qs_kernel_methods USE pw_methods, ONLY: pw_axpy,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kernel_types, ONLY: full_kernel_env_type @@ -91,7 +91,7 @@ SUBROUTINE create_kernel_env(kernel_env, xc_section, is_rks_triplets, rho_struct POINTER :: sab_orb TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_ij_r, rho_ij_r2, tau_ij_r, tau_ij_r2 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_ij_r, rho_ij_r2, tau_ij_r, tau_ij_r2 TYPE(section_vals_type), POINTER :: xc_fun_section CALL timeset(routineN, handle) @@ -227,7 +227,7 @@ END SUBROUTINE create_kernel_env ! ************************************************************************************************** SUBROUTINE create_fxc_kernel(rho_struct, fxc_rspace, xc_section, is_rks_triplets, sub_env, qs_env) TYPE(qs_rho_type), POINTER :: rho_struct - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rspace TYPE(section_vals_type), INTENT(IN), POINTER :: xc_section LOGICAL, INTENT(IN) :: is_rks_triplets TYPE(tddfpt_subgroup_env_type), INTENT(IN) :: sub_env @@ -238,12 +238,12 @@ SUBROUTINE create_fxc_kernel(rho_struct, fxc_rspace, xc_section, is_rks_triplets INTEGER :: handle, ispin, nspins LOGICAL :: rho_g_valid, tau_r_valid REAL(KIND=dp) :: factor - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_c1d_type), POINTER :: rho_nlcc_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), POINTER :: rho_nlcc_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau_r - TYPE(pw_r3d_type), POINTER :: rho_nlcc + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau_r + TYPE(pw_r3d_rs_type), POINTER :: rho_nlcc TYPE(section_vals_type), POINTER :: xc_kernel CALL timeset(routineN, handle) diff --git a/src/qs_kind_types.F b/src/qs_kind_types.F index d6f21c5ae3..6b9e27d2b9 100644 --- a/src/qs_kind_types.F +++ b/src/qs_kind_types.F @@ -193,7 +193,7 @@ MODULE qs_kind_types REAL(KIND=dp) :: hard0_radius = 0.8_dp*bohr ! for hard exp of rho0 REAL(KIND=dp) :: max_rad_local = 13.2_dp*bohr ! max GTO radius used in GAPW LOGICAL :: paw_atom = .FALSE. ! needs atomic rho1 - LOGICAL :: gpw_r3d_type_forced = .FALSE. ! gpw atom even if with hard exponents + LOGICAL :: gpw_r3d_rs_type_forced = .FALSE. ! gpw atom even if with hard exponents ! LOGICAL :: ghost = .FALSE. LOGICAL :: floating = .FALSE. @@ -388,7 +388,7 @@ END SUBROUTINE deallocate_qs_kind_set !> \param max_rad_local ... !> \param covalent_radius ... !> \param vdw_radius ... -!> \param gpw_r3d_type_forced ... +!> \param gpw_r3d_rs_type_forced ... !> \param harmonics ... !> \param max_iso_not0 ... !> \param max_s_harm ... @@ -439,7 +439,7 @@ SUBROUTINE get_qs_kind(qs_kind, & alpha_core_charge, ccore_charge, core_charge, core_charge_radius, & paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, & covalent_radius, vdw_radius, & - gpw_r3d_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, & + gpw_r3d_rs_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, & ngrid_ang, ngrid_rad, lmax_rho0, & dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, & u_minus_j, U_of_dft_plus_u, J_of_dft_plus_u, & @@ -471,7 +471,7 @@ SUBROUTINE get_qs_kind(qs_kind, & REAL(KIND=dp), INTENT(OUT), OPTIONAL :: hard_radius, hard0_radius, & max_rad_local, covalent_radius, & vdw_radius - LOGICAL, INTENT(OUT), OPTIONAL :: gpw_r3d_type_forced + LOGICAL, INTENT(OUT), OPTIONAL :: gpw_r3d_rs_type_forced TYPE(harmonics_atom_type), OPTIONAL, POINTER :: harmonics INTEGER, INTENT(OUT), OPTIONAL :: max_iso_not0, max_s_harm TYPE(grid_atom_type), OPTIONAL, POINTER :: grid_atom @@ -640,7 +640,7 @@ SUBROUTINE get_qs_kind(qs_kind, & IF (PRESENT(paw_proj_set)) paw_proj_set => qs_kind%paw_proj_set IF (PRESENT(paw_atom)) paw_atom = qs_kind%paw_atom - IF (PRESENT(gpw_r3d_type_forced)) gpw_r3d_type_forced = qs_kind%gpw_r3d_type_forced + IF (PRESENT(gpw_r3d_rs_type_forced)) gpw_r3d_rs_type_forced = qs_kind%gpw_r3d_rs_type_forced IF (PRESENT(hard_radius)) hard_radius = qs_kind%hard_radius IF (PRESENT(hard0_radius)) hard0_radius = qs_kind%hard0_radius IF (PRESENT(max_rad_local)) max_rad_local = qs_kind%max_rad_local @@ -1326,7 +1326,7 @@ SUBROUTINE init_gapw_basis_set(qs_kind_set, qs_control, force_env_section, modif CALL get_qs_kind(qs_kind=qs_kind, basis_set=orb_basis) CALL get_qs_kind(qs_kind=qs_kind, hard_radius=rc, & - max_rad_local=max_rad_local_type, gpw_r3d_type_forced=gpw) + max_rad_local=max_rad_local_type, gpw_r3d_rs_type_forced=gpw) NULLIFY (soft_basis) CALL allocate_gto_basis_set(soft_basis) @@ -1794,7 +1794,7 @@ SUBROUTINE read_qs_kind(qs_kind, kind_section, para_env, force_env_section, no_f IF (qs_kind%ngrid_rad <= 0) & CPABORT("# point radial grid < 0") CALL section_vals_val_get(kind_section, i_rep_section=k_rep, & - keyword_name="GPW_TYPE", l_val=qs_kind%gpw_r3d_type_forced) + keyword_name="GPW_TYPE", l_val=qs_kind%gpw_r3d_rs_type_forced) CALL section_vals_val_get(kind_section, i_rep_section=k_rep, & keyword_name="GHOST", l_val=qs_kind%ghost) CALL section_vals_val_get(kind_section, i_rep_section=k_rep, & diff --git a/src/qs_kpp1_env_methods.F b/src/qs_kpp1_env_methods.F index 350de460d9..2a759f7fa6 100644 --- a/src/qs_kpp1_env_methods.F +++ b/src/qs_kpp1_env_methods.F @@ -58,10 +58,8 @@ MODULE qs_kpp1_env_methods USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_types, ONLY: allocate_qs_energy,& deallocate_qs_energy,& qs_energy_type @@ -217,13 +215,13 @@ SUBROUTINE calc_kpp1(rho1_xc, rho1, xc_section, do_tddft, lsd_singlets, lrigpw, TYPE(lri_environment_type), POINTER :: lri_env TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_v_int TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho1_tot_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g, rho1_g_pw + TYPE(pw_c1d_gs_type) :: rho1_tot_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g, rho1_g_pw TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho1_r_pw, tau1_r, tau1_r_pw, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho1_r_pw, tau1_r, tau1_r_pw, & v_rspace_new, v_xc, v_xc_tau TYPE(qs_rho_type), POINTER :: rho TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho1_atom_set, rho_atom_set @@ -274,13 +272,13 @@ SUBROUTINE calc_kpp1(rho1_xc, rho1, xc_section, do_tddft, lsd_singlets, lrigpw, CPASSERT(ASSOCIATED(pw_env)) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) IF (gapw .OR. gapw_xc) & CALL prepare_gapw_den(qs_env, p_env%local_rho_set, do_rho0=(.NOT. gapw_xc)) ! *** calculate the hartree potential on the total density *** - CALL auxbas_pw_pool%create_pw(rho1_tot_gspace, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho1_tot_gspace) CALL pw_copy(rho1_g(1), rho1_tot_gspace) DO ispin = 2, nspins @@ -301,8 +299,8 @@ SUBROUTINE calc_kpp1(rho1_xc, rho1, xc_section, do_tddft, lsd_singlets, lrigpw, IF (.NOT. (nspins == 1 .AND. do_excitations .AND. do_triplet)) THEN BLOCK - TYPE(pw_c1d_type) :: v_hartree_gspace - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: v_hartree_gspace + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) CALL pw_poisson_solve(poisson_env, rho1_tot_gspace, & energy_hartree, & v_hartree_gspace) @@ -327,14 +325,14 @@ SUBROUTINE calc_kpp1(rho1_xc, rho1, xc_section, do_tddft, lsd_singlets, lrigpw, lsd = .TRUE. ALLOCATE (rho1_r_pw(2)) DO ispin = 1, 2 - CALL rho1_r_pw(ispin)%create(rho1_r(1)%pw_grid, REALSPACE) + CALL rho1_r_pw(ispin)%create(rho1_r(1)%pw_grid) CALL pw_transfer(rho1_r(1), rho1_r_pw(ispin)) END DO IF (ASSOCIATED(tau1_r)) THEN ALLOCATE (tau1_r_pw(2)) DO ispin = 1, 2 - CALL tau1_r_pw(ispin)%create(tau1_r(1)%pw_grid, REALSPACE) + CALL tau1_r_pw(ispin)%create(tau1_r(1)%pw_grid) CALL pw_transfer(tau1_r(1), tau1_r_pw(ispin)) END DO END IF @@ -577,8 +575,8 @@ SUBROUTINE kpp1_calc_k_p_p1_fdiff(qs_env, k_p_p1, rho, rho1, & INTEGER :: ispin, nspins REAL(KIND=dp) :: my_diff TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: ks_2, matrix_s, rho1_ao, rho_ao - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g, rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g, rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho_r TYPE(qs_energy_type), POINTER :: qs_energy NULLIFY (ks_2, matrix_s, qs_energy, rho_ao, rho1_ao, rho_r, rho1_r, rho_g, rho1_g) @@ -669,7 +667,7 @@ SUBROUTINE kpp1_check_i_alloc(kpp1_env, qs_env, do_excitations, lsd_singlets, do TYPE(dft_control_type), POINTER :: dft_control TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: my_rho_r, my_tau_r, rho_r, tau_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: my_rho_r, my_tau_r, rho_r, tau_r TYPE(qs_rho_type), POINTER :: rho TYPE(section_vals_type), POINTER :: admm_xc_section, input, xc_section @@ -701,13 +699,13 @@ SUBROUTINE kpp1_check_i_alloc(kpp1_env, qs_env, do_excitations, lsd_singlets, do (lsd_singlets .OR. do_triplet))) THEN ALLOCATE (my_rho_r(2)) DO ispin = 1, 2 - CALL auxbas_pw_pool%create_pw(my_rho_r(ispin), REALSPACE) + CALL auxbas_pw_pool%create_pw(my_rho_r(ispin)) CALL pw_axpy(rho_r(1), my_rho_r(ispin), 0.5_dp, 0.0_dp) END DO IF (dft_control%use_kinetic_energy_density) THEN ALLOCATE (my_tau_r(2)) DO ispin = 1, 2 - CALL auxbas_pw_pool%create_pw(my_tau_r(ispin), REALSPACE) + CALL auxbas_pw_pool%create_pw(my_tau_r(ispin)) CALL pw_axpy(tau_r(1), my_tau_r(ispin), 0.5_dp, 0.0_dp) END DO END IF @@ -793,7 +791,7 @@ END SUBROUTINE kpp1_did_change SUBROUTINE print_densities(rho1, rho1_tot_gspace, out_unit) TYPE(qs_rho_type), POINTER :: rho1 - TYPE(pw_c1d_type), INTENT(IN) :: rho1_tot_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho1_tot_gspace INTEGER :: out_unit REAL(KIND=dp) :: total_rho_gspace diff --git a/src/qs_ks_apply_restraints.F b/src/qs_ks_apply_restraints.F index ba9d4c3bc8..d4199eceed 100644 --- a/src/qs_ks_apply_restraints.F +++ b/src/qs_ks_apply_restraints.F @@ -23,7 +23,6 @@ MODULE qs_ks_apply_restraints USE mulliken, ONLY: mulliken_restraint USE pw_methods, ONLY: pw_scale USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE USE qs_cdft_methods, ONLY: becke_constraint,& hirshfeld_constraint USE qs_cdft_types, ONLY: cdft_control_type @@ -81,8 +80,7 @@ SUBROUTINE qs_ks_cdft_constraint(qs_env, auxbas_pw_pool, calculate_forces, cdft_ ! First SCF iteraration => allocate storage DO igroup = 1, SIZE(cdft_control%group) ALLOCATE (cdft_control%group(igroup)%weight) - CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%weight, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%group(igroup)%weight) ! Sanity check IF (cdft_control%group(igroup)%constraint_type /= cdft_charge_constraint & .AND. dft_control%nspins == 1) & @@ -93,8 +91,7 @@ SUBROUTINE qs_ks_cdft_constraint(qs_env, auxbas_pw_pool, calculate_forces, cdft_ IF (.NOT. ASSOCIATED(cdft_control%charge)) & ALLOCATE (cdft_control%charge(cdft_control%natoms)) DO iatom = 1, cdft_control%natoms - CALL auxbas_pw_pool%create_pw(cdft_control%charge(iatom), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(cdft_control%charge(iatom)) END DO END IF ! Another sanity check diff --git a/src/qs_ks_methods.F b/src/qs_ks_methods.F index ea62a83076..6f4b74d16b 100644 --- a/src/qs_ks_methods.F +++ b/src/qs_ks_methods.F @@ -84,10 +84,8 @@ MODULE qs_ks_methods USE pw_poisson_types, ONLY: pw_poisson_implicit,& pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qmmm_image_charge, ONLY: add_image_pot_to_hartree_pot,& calculate_image_pot,& integrate_potential_devga_rspace @@ -202,15 +200,15 @@ SUBROUTINE qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces, just_energy, & TYPE(lri_environment_type), POINTER :: lri_env TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_v_int TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), POINTER :: rho_core + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), POINTER :: rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, v_rspace_embed, v_rspace_new, & + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, v_rspace_embed, v_rspace_new, & v_rspace_new_aux_fit, v_tau_rspace, & v_tau_rspace_aux_fit - TYPE(pw_r3d_type), POINTER :: rho0_s_rs, rho_nlcc, v_hartree_rspace, & + TYPE(pw_r3d_rs_type), POINTER :: rho0_s_rs, rho_nlcc, v_hartree_rspace, & v_sccs_rspace, v_sic_rspace, & v_spin_ddapc_rest_r, vee, vppl_rspace TYPE(qs_energy_type), POINTER :: energy @@ -345,10 +343,8 @@ SUBROUTINE qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces, just_energy, & END IF ! Calculate the Hartree potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) scf_section => section_vals_get_subs_vals(input, "DFT%SCF") IF (BTEST(cp_print_key_should_output(logger%iter_info, scf_section, & @@ -375,7 +371,7 @@ SUBROUTINE qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces, just_energy, & ! Self-consistent continuum solvation (SCCS) model NULLIFY (v_sccs_rspace) ALLOCATE (v_sccs_rspace) - CALL auxbas_pw_pool%create_pw(v_sccs_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_sccs_rspace) IF (poisson_env%parameters%solver .EQ. pw_poisson_implicit) THEN CPABORT("The implicit Poisson solver cannot be used together with SCCS.") @@ -644,8 +640,8 @@ SUBROUTINE qs_ks_build_kohn_sham_matrix(qs_env, calculate_forces, just_energy, & IF ((poisson_env%parameters%solver .EQ. pw_poisson_implicit) .AND. & (poisson_env%parameters%dielectric_params%dielec_core_correction)) THEN BLOCK - TYPE(pw_r3d_type) :: v_minus_veps - CALL auxbas_pw_pool%create_pw(v_minus_veps, in_space=REALSPACE) + TYPE(pw_r3d_rs_type) :: v_minus_veps + CALL auxbas_pw_pool%create_pw(v_minus_veps) CALL pw_copy(v_hartree_rspace, v_minus_veps) CALL pw_axpy(poisson_env%implicit_env%v_eps, v_minus_veps, -v_hartree_rspace%pw_grid%dvol) CALL integrate_v_core_rspace(v_minus_veps, qs_env) @@ -917,7 +913,7 @@ END SUBROUTINE qs_ks_build_kohn_sham_matrix !> \param skip_nuclear_density ... ! ************************************************************************************************** SUBROUTINE calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho, skip_nuclear_density) - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_tot_gspace + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_tot_gspace TYPE(qs_environment_type), POINTER :: qs_env TYPE(qs_rho_type), POINTER :: rho LOGICAL, INTENT(IN), OPTIONAL :: skip_nuclear_density @@ -925,8 +921,8 @@ SUBROUTINE calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho, skip_nuclear_density INTEGER :: ispin LOGICAL :: my_skip TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_c1d_type), POINTER :: rho0_s_gs, rho_core + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs, rho_core TYPE(qs_charges_type), POINTER :: qs_charges my_skip = .FALSE. diff --git a/src/qs_ks_qmmm_methods.F b/src/qs_ks_qmmm_methods.F index e6465a1f1b..aa8b7665f7 100644 --- a/src/qs_ks_qmmm_methods.F +++ b/src/qs_ks_qmmm_methods.F @@ -27,8 +27,7 @@ MODULE qs_ks_qmmm_methods pw_integral_ab USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qmmm_types_low, ONLY: qmmm_env_qm_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& @@ -108,8 +107,7 @@ SUBROUTINE qs_ks_qmmm_create(ks_qmmm_env, qs_env, qmmm_env) ks_qmmm_env%pc_ener = 0.0_dp ks_qmmm_env%n_evals = 0 - CALL auxbas_pw_pool%create_pw(ks_qmmm_env%v_qmmm_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(ks_qmmm_env%v_qmmm_rspace) IF ((qmmm_env%qmmm_coupl_type == do_qmmm_gauss) .OR. (qmmm_env%qmmm_coupl_type == do_qmmm_swave)) THEN CALL init_d3_poly_module() ! a fairly arbitrary but sufficient spot to do this @@ -145,8 +143,8 @@ END SUBROUTINE qs_ks_qmmm_create ! ************************************************************************************************** SUBROUTINE qmmm_calculate_energy(qs_env, rho, v_qmmm, qmmm_energy) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: rho - TYPE(pw_r3d_type), INTENT(IN) :: v_qmmm + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: rho + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_qmmm REAL(KIND=dp), INTENT(INOUT) :: qmmm_energy CHARACTER(len=*), PARAMETER :: routineN = 'qmmm_calculate_energy' @@ -154,7 +152,7 @@ SUBROUTINE qmmm_calculate_energy(qs_env, rho, v_qmmm, qmmm_energy) INTEGER :: handle, ispin, output_unit TYPE(cp_logger_type), POINTER :: logger TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_r3d_type), POINTER :: rho0_s_rs + TYPE(pw_r3d_rs_type), POINTER :: rho0_s_rs TYPE(section_vals_type), POINTER :: input CALL timeset(routineN, handle) @@ -197,8 +195,8 @@ END SUBROUTINE qmmm_calculate_energy !> \author Teodoro Laino ! ************************************************************************************************** SUBROUTINE qmmm_modify_hartree_pot(v_hartree, v_qmmm, scale) - TYPE(pw_r3d_type), INTENT(INOUT) :: v_hartree - TYPE(pw_r3d_type), INTENT(IN) :: v_qmmm + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_hartree + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_qmmm REAL(KIND=dp), INTENT(IN) :: scale CALL pw_axpy(v_qmmm, v_hartree, v_qmmm%pw_grid%dvol*scale) diff --git a/src/qs_ks_qmmm_types.F b/src/qs_ks_qmmm_types.F index d0f327b33b..2e55e83d7b 100644 --- a/src/qs_ks_qmmm_types.F +++ b/src/qs_ks_qmmm_types.F @@ -20,7 +20,7 @@ MODULE qs_ks_qmmm_types pw_env_release,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -48,8 +48,8 @@ MODULE qs_ks_qmmm_types INTEGER :: n_evals REAL(KIND=dp) :: pc_ener TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type) :: v_qmmm_rspace - TYPE(pw_r3d_type), POINTER :: v_metal_rspace + TYPE(pw_r3d_rs_type) :: v_qmmm_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_metal_rspace TYPE(cube_info_type), DIMENSION(:), POINTER :: cube_info TYPE(dbcsr_p_type), DIMENSION(:), & POINTER :: matrix_h diff --git a/src/qs_ks_reference.F b/src/qs_ks_reference.F index bead702091..0875ba46b3 100644 --- a/src/qs_ks_reference.F +++ b/src/qs_ks_reference.F @@ -36,10 +36,8 @@ MODULE qs_ks_reference USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_core_energies, ONLY: calculate_ecore_overlap,& calculate_ecore_self USE qs_environment_types, ONLY: get_qs_env,& @@ -95,8 +93,8 @@ MODULE qs_ks_reference SUBROUTINE ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspace, & ehartree, exc, h_stress) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(INOUT) :: vh_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rspace, vtau_rspace, vadmm_rspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vh_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rspace, vtau_rspace, vadmm_rspace REAL(KIND=dp), INTENT(OUT) :: ehartree, exc REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT), & OPTIONAL :: h_stress @@ -109,14 +107,14 @@ SUBROUTINE ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rs TYPE(admm_type), POINTER :: admm_env TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), POINTER :: rho_core + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), POINTER :: rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_grid_type), POINTER :: pw_grid TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_admm_rspace, v_admm_tau_rspace, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_admm_rspace, v_admm_tau_rspace, & v_rspace, v_tau_rspace TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho, rho_xc @@ -142,12 +140,9 @@ SUBROUTINE ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rs poisson_env=poisson_env) ! Calculate the Hartree potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) ! Get the total density in g-space [ions + electrons] CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) @@ -232,17 +227,14 @@ SUBROUTINE ks_ref_potential(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rs END IF pw_grid => v_hartree_rspace%pw_grid - CALL vh_rspace%create(pw_grid, in_space=REALSPACE) + CALL vh_rspace%create(pw_grid) DO ispin = 1, nspins - CALL vxc_rspace(ispin)%create(pw_grid, & - in_space=REALSPACE) + CALL vxc_rspace(ispin)%create(pw_grid) IF (ASSOCIATED(vtau_rspace)) THEN - CALL vtau_rspace(ispin)%create(pw_grid, & - in_space=REALSPACE) + CALL vtau_rspace(ispin)%create(pw_grid) END IF IF (ASSOCIATED(vadmm_rspace)) THEN - CALL vadmm_rspace(ispin)%create(pw_grid, & - in_space=REALSPACE) + CALL vadmm_rspace(ispin)%create(pw_grid) END IF END DO ! @@ -304,7 +296,7 @@ END SUBROUTINE ks_ref_potential SUBROUTINE ks_ref_potential_atom(qs_env, local_rho_set, local_rho_set_admm, v_hartree_rspace) TYPE(qs_environment_type), POINTER :: qs_env TYPE(local_rho_type), POINTER :: local_rho_set, local_rho_set_admm - TYPE(pw_r3d_type), INTENT(IN) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_hartree_rspace CHARACTER(LEN=*), PARAMETER :: routineN = 'ks_ref_potential_atom' diff --git a/src/qs_ks_types.F b/src/qs_ks_types.F index f6b1d1746b..b1edb1ead9 100644 --- a/src/qs_ks_types.F +++ b/src/qs_ks_types.F @@ -46,8 +46,8 @@ MODULE qs_ks_types USE pw_env_types, ONLY: pw_env_release,& pw_env_retain,& pw_env_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_force_types, ONLY: qs_force_type USE qs_kind_types, ONLY: qs_kind_type @@ -143,7 +143,7 @@ MODULE qs_ks_types ! hartree is supposed to contain the hartree potential (for cube output) ! ugly to keep it always around only for a cube output... - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace => Null() + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace => Null() TYPE(kpoint_transitional_type) :: matrix_ks, & matrix_s, & @@ -161,12 +161,12 @@ MODULE qs_ks_types TYPE(qs_rho_type), POINTER :: rho => Null(), & rho_xc => Null() - TYPE(pw_r3d_type), POINTER :: vppl => Null(), & - rho_nlcc => Null() - TYPE(pw_c1d_type), POINTER :: rho_nlcc_g => Null() + TYPE(pw_r3d_rs_type), POINTER :: vppl => Null(), & + rho_nlcc => Null() + TYPE(pw_c1d_gs_type), POINTER :: rho_nlcc_g => Null() - TYPE(pw_c1d_type), POINTER :: rho_core => NULL() - TYPE(pw_r3d_type), POINTER :: vee => NULL() + TYPE(pw_c1d_gs_type), POINTER :: rho_core => NULL() + TYPE(pw_r3d_rs_type), POINTER :: vee => NULL() INTEGER :: neighbor_list_id = -1 TYPE(neighbor_list_set_p_type), DIMENSION(:), POINTER :: sab_orb => Null(), & @@ -329,7 +329,7 @@ SUBROUTINE get_ks_env(ks_env, v_hartree_rspace, & para_env, blacs_env, nelectron_total, nelectron_spin) TYPE(qs_ks_env_type), INTENT(IN) :: ks_env - TYPE(pw_r3d_type), OPTIONAL, POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: v_hartree_rspace LOGICAL, OPTIONAL :: s_mstruct_changed, rho_changed, & potential_changed, forces_up_to_date, & complex_ks @@ -340,11 +340,11 @@ SUBROUTINE get_ks_env(ks_env, v_hartree_rspace, & matrix_ks_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, & matrix_ks_im_kp TYPE(qs_rho_type), OPTIONAL, POINTER :: rho, rho_xc - TYPE(pw_r3d_type), OPTIONAL, POINTER :: vppl - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho_core - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho_nlcc - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho_nlcc_g - TYPE(pw_r3d_type), OPTIONAL, POINTER :: vee + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: vppl + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho_core + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho_nlcc + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho_nlcc_g + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: vee INTEGER, OPTIONAL :: neighbor_list_id TYPE(neighbor_list_set_p_type), DIMENSION(:), OPTIONAL, POINTER :: sab_orb, sab_all, sac_ae, & sac_ppl, sac_lri, sap_ppnl, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, & @@ -566,7 +566,7 @@ SUBROUTINE set_ks_env(ks_env, v_hartree_rspace, & para_env, blacs_env) TYPE(qs_ks_env_type), INTENT(INOUT) :: ks_env - TYPE(pw_r3d_type), OPTIONAL, POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: v_hartree_rspace LOGICAL, OPTIONAL :: s_mstruct_changed, rho_changed, & potential_changed, forces_up_to_date, & complex_ks @@ -576,11 +576,11 @@ SUBROUTINE set_ks_env(ks_env, v_hartree_rspace, & TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, POINTER :: 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 - TYPE(pw_r3d_type), OPTIONAL, POINTER :: vppl - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho_core - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho_nlcc - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho_nlcc_g - TYPE(pw_r3d_type), OPTIONAL, POINTER :: vee + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: vppl + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho_core + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho_nlcc + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho_nlcc_g + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: vee INTEGER, OPTIONAL :: neighbor_list_id TYPE(kpoint_type), OPTIONAL, POINTER :: kpoints TYPE(neighbor_list_set_p_type), DIMENSION(:), OPTIONAL, POINTER :: sab_orb, sab_all, sac_ae, & diff --git a/src/qs_ks_utils.F b/src/qs_ks_utils.F index f23139485a..9d187632a3 100644 --- a/src/qs_ks_utils.F +++ b/src/qs_ks_utils.F @@ -94,10 +94,8 @@ MODULE qs_ks_utils USE pw_poisson_types, ONLY: pw_poisson_implicit,& pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_cdft_types, ONLY: cdft_control_type USE qs_charges_types, ONLY: qs_charges_type USE qs_collocate_density, ONLY: calculate_rho_elec @@ -175,11 +173,11 @@ SUBROUTINE low_spin_roks(energy, qs_env, dft_control, do_hfx, just_energy, & TYPE(hfx_type), DIMENSION(:, :), POINTER :: x_data TYPE(mo_set_type), DIMENSION(:), POINTER :: mo_array TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: xc_pw_pool - TYPE(pw_r3d_type) :: work_v_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau, vxc, vxc_tau + TYPE(pw_r3d_rs_type) :: work_v_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau, vxc, vxc_tau TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(section_vals_type), POINTER :: hfx_section, input, & @@ -314,10 +312,10 @@ SUBROUTINE low_spin_roks(energy, qs_env, dft_control, do_hfx, just_energy, & ALLOCATE (rho_r(Nspin)) ALLOCATE (rho_g(Nspin)) DO ispin = 1, Nspin - CALL auxbas_pw_pool%create_pw(rho_r(ispin), in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g(ispin), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r(ispin)) + CALL auxbas_pw_pool%create_pw(rho_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(work_v_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(work_v_rspace) ! get mo matrices needed to construct the density matrices ! we will base all on the alpha spin matrix, obviously possible in ROKS @@ -488,14 +486,14 @@ SUBROUTINE sic_explicit_orbitals(energy, qs_env, dft_control, poisson_env, just_ TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: mo_derivs, rho_ao, tmp_dbcsr TYPE(dbcsr_type), POINTER :: orb_density_matrix, orb_h TYPE(mo_set_type), DIMENSION(:), POINTER :: mo_array - TYPE(pw_c1d_type) :: work_v_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_c1d_type), TARGET :: orb_rho_g, tmp_g + TYPE(pw_c1d_gs_type) :: work_v_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), TARGET :: orb_rho_g, tmp_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: xc_pw_pool - TYPE(pw_r3d_type) :: work_v_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau, vxc, vxc_tau - TYPE(pw_r3d_type), TARGET :: orb_rho_r, tmp_r + TYPE(pw_r3d_rs_type) :: work_v_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau, vxc, vxc_tau + TYPE(pw_r3d_rs_type), TARGET :: orb_rho_r, tmp_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(section_vals_type), POINTER :: input, xc_section @@ -613,12 +611,12 @@ SUBROUTINE sic_explicit_orbitals(energy, qs_env, dft_control, poisson_env, just_ END SELECT ! data needed for each of the orbs - CALL auxbas_pw_pool%create_pw(orb_rho_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(tmp_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(orb_rho_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(tmp_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(work_v_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(work_v_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(orb_rho_r) + CALL auxbas_pw_pool%create_pw(tmp_r) + CALL auxbas_pw_pool%create_pw(orb_rho_g) + CALL auxbas_pw_pool%create_pw(tmp_g) + CALL auxbas_pw_pool%create_pw(work_v_gspace) + CALL auxbas_pw_pool%create_pw(work_v_rspace) ALLOCATE (orb_density_matrix) CALL dbcsr_copy(orb_density_matrix, rho_ao(1)%matrix, & @@ -758,7 +756,7 @@ SUBROUTINE calc_v_sic_rspace(v_sic_rspace, energy, & qs_env, dft_control, rho, poisson_env, just_energy, & calculate_forces, auxbas_pw_pool) - TYPE(pw_r3d_type), POINTER :: v_sic_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_sic_rspace TYPE(qs_energy_type), POINTER :: energy TYPE(qs_environment_type), POINTER :: qs_env TYPE(dft_control_type), POINTER :: dft_control @@ -771,8 +769,8 @@ SUBROUTINE calc_v_sic_rspace(v_sic_rspace, energy, & REAL(kind=dp) :: ener, full_scaling, scaling REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: store_forces TYPE(mo_set_type), DIMENSION(:), POINTER :: mo_array - TYPE(pw_c1d_type) :: work_rho, work_v - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type) :: work_rho, work_v + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(qs_force_type), DIMENSION(:), POINTER :: force NULLIFY (mo_array, rho_g) @@ -786,10 +784,8 @@ SUBROUTINE calc_v_sic_rspace(v_sic_rspace, energy, & ! OK, right now we like two spins to do sic, could be relaxed for AD CPASSERT(dft_control%nspins == 2) - CALL auxbas_pw_pool%create_pw(work_rho, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(work_v, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(work_rho) + CALL auxbas_pw_pool%create_pw(work_v) CALL qs_rho_get(rho, rho_g=rho_g) @@ -860,8 +856,7 @@ SUBROUTINE calc_v_sic_rspace(v_sic_rspace, energy, & IF (.NOT. just_energy) THEN ALLOCATE (v_sic_rspace) - CALL auxbas_pw_pool%create_pw(v_sic_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_sic_rspace) CALL pw_transfer(work_v, v_sic_rspace) ! also take into account the scaling (in addition to the volume element) CALL pw_scale(v_sic_rspace, & @@ -1177,7 +1172,7 @@ END SUBROUTINE print_detailed_energy ! ************************************************************************************************** SUBROUTINE compute_matrix_vxc(qs_env, v_rspace, matrix_vxc) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: v_rspace TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_vxc CHARACTER(LEN=*), PARAMETER :: routineN = 'compute_matrix_vxc' @@ -1255,12 +1250,12 @@ SUBROUTINE sum_up_and_integrate(qs_env, ks_matrix, rho, my_rho, & TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: ks_matrix TYPE(qs_rho_type), POINTER :: rho TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: my_rho - TYPE(pw_r3d_type), POINTER :: vppl_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace_new, v_rspace_new_aux_fit, & + TYPE(pw_r3d_rs_type), POINTER :: vppl_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace_new, v_rspace_new_aux_fit, & v_tau_rspace, v_tau_rspace_aux_fit - TYPE(pw_r3d_type), POINTER :: v_sic_rspace, v_spin_ddapc_rest_r, & + TYPE(pw_r3d_rs_type), POINTER :: v_sic_rspace, v_spin_ddapc_rest_r, & v_sccs_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace_embed + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace_embed TYPE(cdft_control_type), POINTER :: cdft_control LOGICAL, INTENT(in) :: calculate_forces @@ -1287,7 +1282,7 @@ SUBROUTINE sum_up_and_integrate(qs_env, ks_matrix, rho, my_rho, & TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: v_rspace, vee + TYPE(pw_r3d_rs_type), POINTER :: v_rspace, vee TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_aux_fit TYPE(task_list_type), POINTER :: task_list @@ -1673,7 +1668,7 @@ END SUBROUTINE sum_up_and_integrate SUBROUTINE calculate_zmp_potential(qs_env, v_rspace_new, rho, exc) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace_new + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace_new TYPE(qs_rho_type), POINTER :: rho REAL(KIND=dp) :: exc @@ -1685,12 +1680,12 @@ SUBROUTINE calculate_zmp_potential(qs_env, v_rspace_new, rho, exc) REAL(KIND=dp) :: lambda REAL(KIND=dp), DIMENSION(:), POINTER :: tot_rho_ext_r TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_ext_g, rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_ext_g, rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_xc_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type) :: v_xc_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(section_vals_type), POINTER :: ext_den_section, input @@ -1716,10 +1711,8 @@ SUBROUTINE calculate_zmp_potential(qs_env, v_rspace_new, rho, exc) CALL qs_rho_get(rho, rho_r=rho_r, rho_g=rho_g) nspins = 1 ALLOCATE (v_rspace_new(nspins)) - CALL auxbas_pw_pool%create_pw(pw=v_rspace_new(1), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(pw=v_xc_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=v_rspace_new(1)) + CALL auxbas_pw_pool%create_pw(pw=v_xc_rspace) CALL pw_zero(v_rspace_new(1)) do_zmp_read = dft_control%apply_external_vxc @@ -1730,9 +1723,9 @@ SUBROUTINE calculate_zmp_potential(qs_env, v_rspace_new, rho, exc) ELSE BLOCK REAL(KIND=dp) :: factor - TYPE(pw_c1d_type) :: rho_eff_gspace, v_xc_gspace - CALL auxbas_pw_pool%create_pw(pw=rho_eff_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(pw=v_xc_gspace, in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: rho_eff_gspace, v_xc_gspace + CALL auxbas_pw_pool%create_pw(pw=rho_eff_gspace) + CALL auxbas_pw_pool%create_pw(pw=v_xc_gspace) CALL pw_zero(rho_eff_gspace) CALL pw_zero(v_xc_gspace) CALL pw_zero(v_xc_rspace) @@ -1788,7 +1781,7 @@ SUBROUTINE get_embed_potential_energy(qs_env, rho, v_rspace_embed, dft_control, just_energy) TYPE(qs_environment_type), POINTER :: qs_env TYPE(qs_rho_type), POINTER :: rho - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace_embed + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace_embed TYPE(dft_control_type), POINTER :: dft_control REAL(KIND=dp) :: embed_corr LOGICAL :: just_energy @@ -1799,7 +1792,7 @@ SUBROUTINE get_embed_potential_energy(qs_env, rho, v_rspace_embed, dft_control, REAL(KIND=dp) :: embed_corr_local TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r CALL timeset(routineN, handle) @@ -1817,8 +1810,7 @@ SUBROUTINE get_embed_potential_energy(qs_env, rho, v_rspace_embed, dft_control, embed_corr = 0.0_dp DO ispin = 1, dft_control%nspins - CALL auxbas_pw_pool%create_pw(pw=v_rspace_embed(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=v_rspace_embed(ispin)) CALL pw_zero(v_rspace_embed(ispin)) CALL pw_copy(qs_env%embed_pot, v_rspace_embed(ispin)) diff --git a/src/qs_linres_current.F b/src/qs_linres_current.F index 1f73e3b516..93bbc6535a 100644 --- a/src/qs_linres_current.F +++ b/src/qs_linres_current.F @@ -84,9 +84,8 @@ MODULE qs_linres_current pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kind_types, ONLY: get_qs_kind,& @@ -213,11 +212,11 @@ SUBROUTINE current_build_current(current_env, qs_env, iB) POINTER :: sab_all TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: jrho1_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: jrho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: jrho1_r + TYPE(pw_r3d_rs_type) :: wf_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: jrho1_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_matrix_pools_type), POINTER :: mpools TYPE(qs_subsys_type), POINTER :: subsys @@ -479,8 +478,7 @@ SUBROUTINE current_build_current(current_env, qs_env, iB) CALL pw_env_get(pw_env, auxbas_rs_desc=auxbas_rs_desc, & auxbas_pw_pool=auxbas_pw_pool) ! - CALL auxbas_pw_pool%create_pw(wf_r, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) ! DO idir = 1, 3 CALL pw_zero(wf_r) @@ -580,8 +578,8 @@ SUBROUTINE calculate_jrho_resp(mat_d0, mat_jp, mat_jp_rii, mat_jp_riii, iB, idir TYPE(dbcsr_type), POINTER :: mat_d0, mat_jp, mat_jp_rii, mat_jp_riii INTEGER, INTENT(IN) :: iB, idir - TYPE(pw_r3d_type), INTENT(INOUT) :: current_rs - TYPE(pw_c1d_type), INTENT(INOUT) :: current_gs + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: current_rs + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: current_gs TYPE(qs_environment_type), POINTER :: qs_env TYPE(current_env_type) :: current_env LOGICAL, INTENT(IN), OPTIONAL :: soft_valid, retain_rsgrid diff --git a/src/qs_linres_current_utils.F b/src/qs_linres_current_utils.F index d5cb4cd876..55f175939a 100644 --- a/src/qs_linres_current_utils.F +++ b/src/qs_linres_current_utils.F @@ -76,10 +76,8 @@ MODULE qs_linres_current_utils pw_env_type USE pw_methods, ONLY: pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kind_types, ONLY: qs_kind_type @@ -599,10 +597,10 @@ SUBROUTINE current_env_init(current_env, qs_env) TYPE(mo_set_type), DIMENSION(:), POINTER :: mos TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_loc_env_type), POINTER :: qs_loc_env TYPE(qs_matrix_pools_type), POINTER :: mpools @@ -1263,11 +1261,9 @@ SUBROUTINE current_env_init(current_env, qs_env) NULLIFY (rho_r, rho_g) ALLOCATE (rho_r(nspins), rho_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r(ispin)) CALL pw_zero(rho_r(ispin)) - CALL auxbas_pw_pool%create_pw(rho_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g(ispin)) CALL pw_zero(rho_g(ispin)) END DO NULLIFY (current_env%jrho1_set(idir)%rho) diff --git a/src/qs_linres_epr_nablavks.F b/src/qs_linres_epr_nablavks.F index 900fc01b1c..4778129f2f 100644 --- a/src/qs_linres_epr_nablavks.F +++ b/src/qs_linres_epr_nablavks.F @@ -50,10 +50,8 @@ MODULE qs_linres_epr_nablavks USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_gapw_densities, ONLY: prepare_gapw_den @@ -140,17 +138,17 @@ SUBROUTINE epr_nablavks(epr_env, qs_env) TYPE(oce_matrix_type), POINTER :: oce TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_gspace, v_coulomb_gspace, & + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_coulomb_gspace, & v_coulomb_gtemp, v_hartree_gspace, & v_hartree_gtemp, v_xc_gtemp TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_coulomb_rtemp, v_hartree_rtemp, & + TYPE(pw_r3d_rs_type) :: v_coulomb_rtemp, v_hartree_rtemp, & v_xc_rtemp, wf_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho2_r, rho_r, v_rspace_new, & + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho2_r, rho_r, v_rspace_new, & v_tau_rspace - TYPE(pw_r3d_type), POINTER :: pwx, pwy, pwz + TYPE(pw_r3d_rs_type), POINTER :: pwx, pwy, pwz TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_p_type), DIMENSION(:, :), POINTER :: nablavks_set @@ -282,14 +280,10 @@ SUBROUTINE epr_nablavks(epr_env, qs_env) ! Add Hartree potential ! ------------------------------------- - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_gtemp, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rtemp, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_gtemp) + CALL auxbas_pw_pool%create_pw(v_hartree_rtemp) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) IF (gapw) THEN ! need to rebuild the coeff ! @@ -504,12 +498,9 @@ SUBROUTINE epr_nablavks(epr_env, qs_env) IF (gth_gspace) THEN - CALL auxbas_pw_pool%create_pw(v_coulomb_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_coulomb_gtemp, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_coulomb_rtemp, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_coulomb_gspace) + CALL auxbas_pw_pool%create_pw(v_coulomb_gtemp) + CALL auxbas_pw_pool%create_pw(v_coulomb_rtemp) CALL pw_zero(v_coulomb_gspace) @@ -850,10 +841,8 @@ SUBROUTINE epr_nablavks(epr_env, qs_env) ! Add V_xc potential ! ------------------------------------- - CALL auxbas_pw_pool%create_pw(v_xc_gtemp, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_xc_rtemp, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_xc_gtemp) + CALL auxbas_pw_pool%create_pw(v_xc_rtemp) xc_section => section_vals_get_subs_vals(input, "PROPERTIES%LINRES%EPR%PRINT%G_TENSOR%XC") ! a possible vdW section in xc_section will be ignored @@ -938,7 +927,7 @@ SUBROUTINE epr_nablavks(epr_env, qs_env) IF (BTEST(cp_print_key_should_output(logger%iter_info, lr_section, & "EPR%PRINT%NABLAVKS_CUBES"), cp_p_file)) THEN - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) DO idir = 1, 3 CALL pw_zero(wf_r) CALL qs_rho_get(nablavks_set(idir, 1)%rho, rho_r=rho_r) diff --git a/src/qs_linres_epr_ownutils.F b/src/qs_linres_epr_ownutils.F index 06062ca7cb..b28db49dfd 100644 --- a/src/qs_linres_epr_ownutils.F +++ b/src/qs_linres_epr_ownutils.F @@ -47,10 +47,8 @@ MODULE qs_linres_epr_ownutils pw_spline_precond_set_kind,& pw_spline_precond_type,& spl3_pbc - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_core_energies, ONLY: calculate_ptrace USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -306,8 +304,8 @@ SUBROUTINE epr_g_so(epr_env, current_env, qs_env, iB) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:, :) :: vks_pw_spline - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: jrho2_r, jrho3_r, nrho1_r, nrho2_r, & + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:, :) :: vks_pw_spline + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: jrho2_r, jrho3_r, nrho1_r, nrho2_r, & nrho3_r TYPE(pw_spline_precond_type) :: precond TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -381,8 +379,7 @@ SUBROUTINE epr_g_so(epr_env, current_env, qs_env, iB) DO ispin = 1, nspins DO idir1 = 1, 3 - CALL auxbas_pw_pool%create_pw(vks_pw_spline(idir1, ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vks_pw_spline(idir1, ispin)) ! calculate spline coefficients CALL pw_spline_precond_create(precond, precond_kind=aint_precond, & pool=auxbas_pw_pool, pbc=.TRUE., transpose=.FALSE.) @@ -568,8 +565,8 @@ SUBROUTINE epr_g_soo(epr_env, current_env, qs_env, iB) TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:, :) :: bind_pw_spline - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: brho1_r, rho_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:, :) :: bind_pw_spline + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: brho1_r, rho_r TYPE(pw_spline_precond_type) :: precond TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_p_type), DIMENSION(:, :), POINTER :: bind_set @@ -650,8 +647,7 @@ SUBROUTINE epr_g_soo(epr_env, current_env, qs_env, iB) CALL section_vals_val_get(interp_section, "eps_x", r_val=eps_x) DO idir1 = 1, 3 - CALL auxbas_pw_pool%create_pw(bind_pw_spline(idir1, iB), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(bind_pw_spline(idir1, iB)) ! calculate spline coefficients CALL pw_spline_precond_create(precond, precond_kind=aint_precond, & pool=auxbas_pw_pool, pbc=.TRUE., transpose=.FALSE.) @@ -777,14 +773,14 @@ SUBROUTINE epr_ind_magnetic_field(epr_env, current_env, qs_env, iB) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: pw_gspace_work - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:, :) :: shift_pw_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: jrho1_g + TYPE(pw_c1d_gs_type) :: pw_gspace_work + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:, :) :: shift_pw_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: jrho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: shift_pw_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: epr_rho_r + TYPE(pw_r3d_rs_type) :: shift_pw_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: epr_rho_r TYPE(realspace_grid_desc_type), POINTER :: auxbas_rs_desc CALL timeset(routineN, handle) @@ -812,16 +808,13 @@ SUBROUTINE epr_ind_magnetic_field(epr_env, current_env, qs_env, iB) ALLOCATE (shift_pw_gspace(3, nspins)) DO ispin = 1, nspins DO idir = 1, 3 - CALL auxbas_pw_pool%create_pw(shift_pw_gspace(idir, ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(shift_pw_gspace(idir, ispin)) CALL pw_zero(shift_pw_gspace(idir, ispin)) END DO END DO - CALL auxbas_pw_pool%create_pw(shift_pw_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(shift_pw_rspace) CALL pw_zero(shift_pw_rspace) - CALL auxbas_pw_pool%create_pw(pw_gspace_work, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw_gspace_work) CALL pw_zero(pw_gspace_work) ! CALL set_vecp(iB, iiB, iiiB) diff --git a/src/qs_linres_epr_utils.F b/src/qs_linres_epr_utils.F index 890938e646..3a4a6f1b58 100644 --- a/src/qs_linres_epr_utils.F +++ b/src/qs_linres_epr_utils.F @@ -38,10 +38,8 @@ MODULE qs_linres_epr_utils USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kind_types, ONLY: qs_kind_type @@ -96,10 +94,10 @@ SUBROUTINE epr_env_init(epr_env, qs_env) TYPE(mo_set_type), DIMENSION(:), POINTER :: mos TYPE(nablavks_atom_type), DIMENSION(:), POINTER :: nablavks_atom_set TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_matrix_pools_type), POINTER :: mpools TYPE(scf_control_type), POINTER :: scf_control @@ -185,10 +183,8 @@ SUBROUTINE epr_env_init(epr_env, qs_env) ALLOCATE (epr_env%bind_set(idir, i_B)%rho) CALL qs_rho_create(epr_env%bind_set(idir, i_B)%rho) ALLOCATE (rho_r(1), rho_g(1)) - CALL auxbas_pw_pool%create_pw(rho_r(1), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g(1), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r(1)) + CALL auxbas_pw_pool%create_pw(rho_g(1)) CALL qs_rho_set(epr_env%bind_set(idir, i_B)%rho, rho_r=rho_r, rho_g=rho_g) END DO END DO @@ -201,10 +197,8 @@ SUBROUTINE epr_env_init(epr_env, qs_env) ALLOCATE (epr_env%nablavks_set(idir, ispin)%rho) CALL qs_rho_create(epr_env%nablavks_set(idir, ispin)%rho) ALLOCATE (rho_r(1), rho_g(1)) - CALL auxbas_pw_pool%create_pw(rho_r(1), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g(1), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r(1)) + CALL auxbas_pw_pool%create_pw(rho_g(1)) CALL qs_rho_set(epr_env%nablavks_set(idir, ispin)%rho, & rho_r=rho_r, rho_g=rho_g) END DO diff --git a/src/qs_linres_kernel.F b/src/qs_linres_kernel.F index 49d233a672..9704b3bb98 100644 --- a/src/qs_linres_kernel.F +++ b/src/qs_linres_kernel.F @@ -67,10 +67,8 @@ MODULE qs_linres_kernel USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_fxc, ONLY: qs_fxc_analytic,& @@ -192,13 +190,13 @@ SUBROUTINE apply_op_2_dft(qs_env, p_env) TYPE(lri_environment_type), POINTER :: lri_env TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_v_int TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho1_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g + TYPE(pw_c1d_gs_type) :: rho1_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, v_rspace_new, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, rho_r, tau1_r, v_rspace_new, & v_xc, v_xc_tau TYPE(qs_kpp1_env_type), POINTER :: kpp1_env TYPE(qs_ks_env_type), POINTER :: ks_env @@ -275,14 +273,14 @@ SUBROUTINE apply_op_2_dft(qs_env, p_env) CPASSERT(ASSOCIATED(pw_env)) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) IF (gapw .OR. gapw_xc) & CALL prepare_gapw_den(qs_env, p_env%local_rho_set, do_rho0=(.NOT. gapw_xc)) ! *** calculate the hartree potential on the total density *** - CALL auxbas_pw_pool%create_pw(rho1_tot_gspace, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho1_tot_gspace) CALL qs_rho_get(rho1, rho_g=rho1_g) CALL pw_copy(rho1_g(1), rho1_tot_gspace) @@ -841,10 +839,10 @@ SUBROUTINE apply_xc_admm(qs_env, p_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_aux_fit - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_aux_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_aux_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_aux_r, tau_pw, v_xc, v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_aux_r, tau_pw, v_xc, v_xc_tau TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho1_atom_set, rho_atom_set TYPE(section_vals_type), POINTER :: xc_fun_section, xc_section TYPE(task_list_type), POINTER :: task_list diff --git a/src/qs_linres_nmr_epr_common_utils.F b/src/qs_linres_nmr_epr_common_utils.F index 3174f93789..0fe3c43b6c 100644 --- a/src/qs_linres_nmr_epr_common_utils.F +++ b/src/qs_linres_nmr_epr_common_utils.F @@ -20,8 +20,7 @@ MODULE qs_linres_nmr_epr_common_utils USE pw_grid_types, ONLY: pw_grid_type USE pw_methods, ONLY: pw_transfer USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type + USE pw_types, ONLY: pw_c1d_gs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -57,20 +56,20 @@ MODULE qs_linres_nmr_epr_common_utils SUBROUTINE mult_G_ov_G2_grid(pw_pool, rho_gspace, funcG_times_rho, idir, my_chi) TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_c1d_type), INTENT(IN) :: rho_gspace - TYPE(pw_c1d_type), INTENT(INOUT) :: funcG_times_rho + TYPE(pw_c1d_gs_type), INTENT(IN) :: rho_gspace + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: funcG_times_rho INTEGER, INTENT(IN) :: idir REAL(dp), INTENT(IN) :: my_chi INTEGER :: handle, ig, ng REAL(dp) :: g2 - TYPE(pw_c1d_type) :: influence_fn + TYPE(pw_c1d_gs_type) :: influence_fn TYPE(pw_grid_type), POINTER :: grid CHARACTER(len=*), PARAMETER :: routineN = 'mult_G_ov_G2_grid' CALL timeset(routineN, handle) - CALL pw_pool%create_pw(influence_fn, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(influence_fn) grid => influence_fn%pw_grid DO ig = grid%first_gne0, grid%ngpts_cut_local diff --git a/src/qs_linres_nmr_shift.F b/src/qs_linres_nmr_shift.F index c0718a4c23..65f8b512f4 100644 --- a/src/qs_linres_nmr_shift.F +++ b/src/qs_linres_nmr_shift.F @@ -51,10 +51,8 @@ MODULE qs_linres_nmr_shift pw_spline_precond_set_kind,& pw_spline_precond_type,& spl3_pbc - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_grid_atom, ONLY: grid_atom_type @@ -115,13 +113,13 @@ SUBROUTINE nmr_shift(nmr_env, current_env, qs_env, iB) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: pw_gspace_work - TYPE(pw_c1d_type), ALLOCATABLE, DIMENSION(:, :) :: shift_pw_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: jrho1_g + TYPE(pw_c1d_gs_type) :: pw_gspace_work + TYPE(pw_c1d_gs_type), ALLOCATABLE, DIMENSION(:, :) :: shift_pw_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: jrho1_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: shift_pw_rspace + TYPE(pw_r3d_rs_type) :: shift_pw_rspace TYPE(realspace_grid_desc_type), POINTER :: auxbas_rs_desc TYPE(section_vals_type), POINTER :: nmr_section @@ -157,8 +155,7 @@ SUBROUTINE nmr_shift(nmr_env, current_env, qs_env, iB) ALLOCATE (shift_pw_gspace(3, nspins)) DO ispin = 1, nspins DO idir = 1, 3 - CALL auxbas_pw_pool%create_pw(shift_pw_gspace(idir, ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(shift_pw_gspace(idir, ispin)) CALL pw_zero(shift_pw_gspace(idir, ispin)) END DO END DO @@ -166,8 +163,7 @@ SUBROUTINE nmr_shift(nmr_env, current_env, qs_env, iB) ! CALL set_vecp(iB, iiB, iiiB) ! - CALL auxbas_pw_pool%create_pw(pw_gspace_work, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw_gspace_work) CALL pw_zero(pw_gspace_work) DO ispin = 1, nspins ! @@ -195,8 +191,7 @@ SUBROUTINE nmr_shift(nmr_env, current_env, qs_env, iB) ! ! compute shildings IF (interpolate_shift) THEN - CALL auxbas_pw_pool%create_pw(shift_pw_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(shift_pw_rspace) DO ispin = 1, nspins DO idir = 1, 3 ! Here first G->R and then interpolation to get the shifts. @@ -505,7 +500,7 @@ SUBROUTINE interpolate_shift_pwgrid(nmr_env, pw_env, particle_set, cell, shift_p TYPE(pw_env_type), POINTER :: pw_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(cell_type), POINTER :: cell - TYPE(pw_r3d_type), INTENT(IN) :: shift_pw_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: shift_pw_rspace INTEGER, INTENT(IN) :: i_B, idir TYPE(section_vals_type), POINTER :: nmr_section @@ -520,7 +515,7 @@ SUBROUTINE interpolate_shift_pwgrid(nmr_env, pw_env, particle_set, cell, shift_p REAL(dp), DIMENSION(:, :), POINTER :: r_nics REAL(dp), DIMENSION(:, :, :), POINTER :: chemical_shift, chemical_shift_nics TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: shiftspl + TYPE(pw_r3d_rs_type) :: shiftspl TYPE(pw_spline_precond_type) :: precond TYPE(section_vals_type), POINTER :: interp_section @@ -540,8 +535,7 @@ SUBROUTINE interpolate_shift_pwgrid(nmr_env, pw_env, particle_set, cell, shift_p ! calculate spline coefficients CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(shiftspl, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(shiftspl) CALL pw_spline_precond_create(precond, precond_kind=aint_precond, & pool=auxbas_pw_pool, pbc=.TRUE., transpose=.FALSE.) @@ -604,7 +598,7 @@ SUBROUTINE gsum_shift_pwgrid(nmr_env, particle_set, cell, shift_pw_gspace, & TYPE(nmr_env_type) :: nmr_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set TYPE(cell_type), POINTER :: cell - TYPE(pw_c1d_type), INTENT(IN) :: shift_pw_gspace + TYPE(pw_c1d_gs_type), INTENT(IN) :: shift_pw_gspace INTEGER, INTENT(IN) :: i_B, idir CHARACTER(LEN=*), PARAMETER :: routineN = 'gsum_shift_pwgrid' @@ -663,7 +657,7 @@ END SUBROUTINE gsum_shift_pwgrid ! ************************************************************************************************** SUBROUTINE gsumr(r, pw, cplx) REAL(dp), INTENT(IN) :: r(3) - TYPE(pw_c1d_type), INTENT(IN) :: pw + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw COMPLEX(dp) :: cplx COMPLEX(dp) :: rg diff --git a/src/qs_loc_methods.F b/src/qs_loc_methods.F index 62f62ec7b4..bf42014db2 100644 --- a/src/qs_loc_methods.F +++ b/src/qs_loc_methods.F @@ -86,10 +86,8 @@ MODULE qs_loc_methods USE pw_env_types, ONLY: pw_env_get,& pw_env_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -810,10 +808,10 @@ SUBROUTINE qs_print_cubes(qs_env, mo_coeff, nstates, state_list, centers, & TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys @@ -826,8 +824,8 @@ SUBROUTINE qs_print_cubes(qs_env, mo_coeff, nstates, state_list, centers, & CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) my_state0 = 0 IF (PRESENT(state0)) my_state0 = state0 diff --git a/src/qs_loc_states.F b/src/qs_loc_states.F index a7cd5ee71f..8ac23bab2a 100644 --- a/src/qs_loc_states.F +++ b/src/qs_loc_states.F @@ -27,8 +27,8 @@ MODULE qs_loc_states USE molecular_states, ONLY: construct_molecular_states USE molecule_types, ONLY: molecule_type USE particle_list_types, ONLY: particle_list_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& set_qs_env @@ -73,8 +73,8 @@ SUBROUTINE get_localization_info(qs_env, qs_loc_env, loc_section, mo_local, & TYPE(qs_loc_env_type), POINTER :: qs_loc_env TYPE(section_vals_type), POINTER :: loc_section TYPE(cp_fm_type), DIMENSION(:), INTENT(IN) :: mo_local - TYPE(pw_r3d_type), INTENT(INOUT) :: wf_r - TYPE(pw_c1d_type), INTENT(INOUT) :: wf_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: wf_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: wf_g TYPE(particle_list_type), POINTER :: particles TYPE(cp_fm_type), DIMENSION(:), INTENT(IN) :: coeff TYPE(cp_1d_r_p_type), DIMENSION(:), POINTER :: evals diff --git a/src/qs_local_properties.F b/src/qs_local_properties.F index a93e8f8910..5067aa7377 100644 --- a/src/qs_local_properties.F +++ b/src/qs_local_properties.F @@ -39,10 +39,8 @@ MODULE qs_local_properties pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_core_energies, ONLY: calculate_ptrace USE qs_energy_matrix_w, ONLY: qs_energies_compute_w @@ -80,7 +78,7 @@ MODULE qs_local_properties ! ************************************************************************************************** SUBROUTINE qs_local_energy(qs_env, energy_density) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(INOUT) :: energy_density + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: energy_density CHARACTER(LEN=*), PARAMETER :: routineN = 'qs_local_energy' @@ -93,14 +91,14 @@ SUBROUTINE qs_local_energy(qs_env, energy_density) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_ks, matrix_s, matrix_w, rho_ao_kp TYPE(dbcsr_type), POINTER :: matrix TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: edens_g - TYPE(pw_c1d_type), POINTER :: rho_core, rho_tot_gspace + TYPE(pw_c1d_gs_type) :: edens_g + TYPE(pw_c1d_gs_type), POINTER :: rho_core, rho_tot_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: band_density, edens_r, hartree_density, & + TYPE(pw_r3d_rs_type) :: band_density, edens_r, hartree_density, & xc_density - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_r3d_type), POINTER :: rho_tot_rspace, v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), POINTER :: rho_tot_rspace, v_hartree_rspace TYPE(qs_energy_type), POINTER :: energy TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho, rho_struct @@ -125,9 +123,9 @@ SUBROUTINE qs_local_energy(qs_env, energy_density) ! get working arrays CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(band_density, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(hartree_density, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(xc_density, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(band_density) + CALL auxbas_pw_pool%create_pw(hartree_density) + CALL auxbas_pw_pool%create_pw(xc_density) ! w matrix CALL get_qs_env(qs_env, matrix_w_kp=matrix_w) @@ -149,8 +147,8 @@ SUBROUTINE qs_local_energy(qs_env, energy_density) ! band structure energy density CALL qs_energies_compute_w(qs_env, .TRUE.) CALL get_qs_env(qs_env, ks_env=ks_env, matrix_w_kp=matrix_w) - CALL auxbas_pw_pool%create_pw(edens_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(edens_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(edens_r) + CALL auxbas_pw_pool%create_pw(edens_g) CALL pw_zero(band_density) DO ispin = 1, nspins rho_ao => matrix_w(ispin, :) @@ -165,8 +163,8 @@ SUBROUTINE qs_local_energy(qs_env, energy_density) ! Hartree energy density correction = -0.5 * V_H(r) * [rho(r) - rho_core(r)] ALLOCATE (rho_tot_gspace, rho_tot_rspace) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) + CALL auxbas_pw_pool%create_pw(rho_tot_rspace) NULLIFY (rho_core) CALL get_qs_env(qs_env, & v_hartree_rspace=v_hartree_rspace, & @@ -248,7 +246,7 @@ END SUBROUTINE qs_local_energy ! ************************************************************************************************** SUBROUTINE qs_local_stress(qs_env, stress_tensor, beta) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), DIMENSION(:, :), & + TYPE(pw_r3d_rs_type), DIMENSION(:, :), & INTENT(INOUT), OPTIONAL :: stress_tensor REAL(KIND=dp), INTENT(IN), OPTIONAL :: beta @@ -261,12 +259,12 @@ SUBROUTINE qs_local_stress(qs_env, stress_tensor, beta) REAL(KIND=dp), DIMENSION(3, 3) :: pv_loc TYPE(cp_logger_type), POINTER :: logger TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(3) :: efield + TYPE(pw_c1d_gs_type) :: v_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(3) :: efield TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: xc_density - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: xc_density + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_struct TYPE(section_vals_type), POINTER :: input, xc_section @@ -311,7 +309,7 @@ SUBROUTINE qs_local_stress(qs_env, stress_tensor, beta) ! get working arrays CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(xc_density, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(xc_density) ! init local stress tensor IF (do_stress) THEN @@ -336,12 +334,10 @@ SUBROUTINE qs_local_stress(qs_env, stress_tensor, beta) ! Electrical field terms CALL get_qs_env(qs_env, v_hartree_rspace=v_hartree_rspace) - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) CALL pw_transfer(v_hartree_rspace, v_hartree_gspace) DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(efield(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(efield(i)) CALL pw_copy(v_hartree_gspace, efield(i)) END DO CALL pw_derive(efield(1), (/1, 0, 0/)) diff --git a/src/qs_mixing_utils.F b/src/qs_mixing_utils.F index 4e2531f979..4897fe9f5a 100644 --- a/src/qs_mixing_utils.F +++ b/src/qs_mixing_utils.F @@ -19,7 +19,7 @@ MODULE qs_mixing_utils USE distribution_1d_types, ONLY: distribution_1d_type USE kinds, ONLY: dp USE message_passing, ONLY: mp_para_env_type - USE pw_types, ONLY: pw_c1d_type + USE pw_types, ONLY: pw_c1d_gs_type USE qs_density_mixing_types, ONLY: broyden_mixing_new_nr,& broyden_mixing_nr,& gspace_mixing_nr,& @@ -433,7 +433,7 @@ SUBROUTINE mixing_init(mixing_method, rho, mixing_store, para_env, rho_atom) REAL(dp), DIMENSION(:), POINTER :: g2 REAL(dp), DIMENSION(:, :), POINTER :: g_vec TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g CALL timeset(routineN, handle) diff --git a/src/qs_p_env_methods.F b/src/qs_p_env_methods.F index 81d793cee1..008ca0bf42 100644 --- a/src/qs_p_env_methods.F +++ b/src/qs_p_env_methods.F @@ -15,7 +15,7 @@ ! ************************************************************************************************** MODULE qs_p_env_methods USE admm_methods, ONLY: admm_aux_response_density - USE admm_types, ONLY: admm_gapw_r3d_type,& + USE admm_types, ONLY: admm_gapw_r3d_rs_type,& admm_type,& get_admm_env USE atomic_kind_types, ONLY: atomic_kind_type @@ -69,8 +69,8 @@ MODULE qs_p_env_methods USE parallel_gemm_api, ONLY: parallel_gemm USE preconditioner_types, ONLY: init_preconditioner USE pw_env_types, ONLY: pw_env_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& @@ -141,7 +141,7 @@ SUBROUTINE p_env_create(p_env, qs_env, p1_option, p1_admm_option, & CHARACTER(len=*), PARAMETER :: routineN = 'p_env_create' INTEGER :: handle, n_ao, n_mo, n_spins, natom, spin - TYPE(admm_gapw_r3d_type), POINTER :: admm_gapw_env + TYPE(admm_gapw_r3d_rs_type), POINTER :: admm_gapw_env TYPE(admm_type), POINTER :: admm_env TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(cp_blacs_env_type), POINTER :: blacs_env @@ -408,8 +408,8 @@ SUBROUTINE p_env_update_rho(p_env, qs_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_aux_fit - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_aux + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_aux TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(task_list_type), POINTER :: task_list diff --git a/src/qs_pdos.F b/src/qs_pdos.F index 0e5724eed8..bba2cb0516 100644 --- a/src/qs_pdos.F +++ b/src/qs_pdos.F @@ -61,10 +61,8 @@ MODULE qs_pdos pw_env_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -187,11 +185,11 @@ SUBROUTINE calculate_projected_dos(mo_set, atomic_kind_set, qs_kind_set, particl TYPE(gto_basis_set_type), POINTER :: orb_basis_set TYPE(ldos_p_type), DIMENSION(:), POINTER :: ldos_p TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(r_ldos_p_type), DIMENSION(:), POINTER :: r_ldos_p TYPE(section_vals_type), POINTER :: ldos_section @@ -359,8 +357,8 @@ SUBROUTINE calculate_projected_dos(mo_set, atomic_kind_set, qs_kind_set, particl CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) ALLOCATE (read_r(4, n_r_ldos)) DO ildos = 1, n_r_ldos WRITE (r_ldos_index(ildos), '(I0)') ildos diff --git a/src/qs_resp.F b/src/qs_resp.F index 9893518019..64778ce251 100644 --- a/src/qs_resp.F +++ b/src/qs_resp.F @@ -72,10 +72,8 @@ MODULE qs_resp USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_resp_all,& calculate_rho_resp_single USE qs_environment_types, ONLY: get_qs_env,& @@ -771,7 +769,7 @@ SUBROUTINE calc_resp_matrix_nonper(qs_env, resp_env, atomic_kind_set, particles, REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: dist REAL(KIND=dp), DIMENSION(3, 3) :: hmat, hmat_inv TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), POINTER :: v_hartree_pw + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_pw CALL timeset(routineN, handle) @@ -921,11 +919,11 @@ SUBROUTINE calc_resp_matrix_periodic(qs_env, resp_env, rep_sys, particles, cell, REAL(KIND=dp) :: normalize_factor REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :) :: vpot TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho_ga, va_gspace + TYPE(pw_c1d_gs_type) :: rho_ga, va_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: va_rspace + TYPE(pw_r3d_rs_type) :: va_rspace CALL timeset(routineN, handle) @@ -943,12 +941,9 @@ SUBROUTINE calc_resp_matrix_periodic(qs_env, resp_env, rep_sys, particles, cell, CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(rho_ga, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(va_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(va_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_ga) + CALL auxbas_pw_pool%create_pw(va_gspace) + CALL auxbas_pw_pool%create_pw(va_rspace) !get fitting points and store them in resp_env%fitpoints CALL get_fitting_points(qs_env, resp_env, rep_sys, particles=particles, & @@ -1038,7 +1033,7 @@ SUBROUTINE get_fitting_points(qs_env, resp_env, rep_sys, particles, cell) TYPE(atomic_kind_type), DIMENSION(:), POINTER :: atomic_kind_set TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), POINTER :: v_hartree_pw + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_pw CALL timeset(routineN, handle) @@ -1177,7 +1172,7 @@ SUBROUTINE calculate_rhs(qs_env, resp_env, rhs, vpot) INTEGER :: handle, ip, jx, jy, jz REAL(KIND=dp) :: dvol REAL(KIND=dp), ALLOCATABLE, DIMENSION(:) :: vhartree - TYPE(pw_r3d_type), POINTER :: v_hartree_pw + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_pw CALL timeset(routineN, handle) @@ -1236,7 +1231,7 @@ SUBROUTINE print_fitting_points(qs_env, resp_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(mp_request_type), DIMENSION(6) :: req TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_r3d_type), POINTER :: v_hartree_pw + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_pw TYPE(section_vals_type), POINTER :: input, print_key, resp_section CALL timeset(routineN, handle) @@ -1686,12 +1681,12 @@ SUBROUTINE print_pot_from_resp_charges(qs_env, resp_env, particles, natom, outpu sum_diff, sum_hartree, udvol TYPE(cp_logger_type), POINTER :: logger TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type) :: rho_resp, v_resp_gspace + TYPE(pw_c1d_gs_type) :: rho_resp, v_resp_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: aux_r, v_resp_rspace - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: aux_r, v_resp_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(section_vals_type), POINTER :: input, print_key, resp_section CALL timeset(routineN, handle) @@ -1713,9 +1708,9 @@ SUBROUTINE print_pot_from_resp_charges(qs_env, resp_env, particles, natom, outpu CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(rho_resp, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_resp_gspace, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_resp_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_resp) + CALL auxbas_pw_pool%create_pw(v_resp_gspace) + CALL auxbas_pw_pool%create_pw(v_resp_rspace) CALL pw_zero(rho_resp) CALL calculate_rho_resp_all(rho_resp, resp_env%rhs, natom, & @@ -1739,7 +1734,7 @@ SUBROUTINE print_pot_from_resp_charges(qs_env, resp_env, particles, natom, outpu !***now print the v_resp_rspace%pw to a cube file if requested IF (BTEST(cp_print_key_should_output(logger%iter_info, resp_section, & "PRINT%V_RESP_CUBE"), cp_p_file)) THEN - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) append_cube = section_get_lval(resp_section, "PRINT%V_RESP_CUBE%APPEND") my_pos_cube = "REWIND" IF (append_cube) THEN diff --git a/src/qs_rho0_ggrid.F b/src/qs_rho0_ggrid.F index 928940a6e1..4071e5b3e3 100644 --- a/src/qs_rho0_ggrid.F +++ b/src/qs_rho0_ggrid.F @@ -36,10 +36,8 @@ MODULE qs_rho0_ggrid pw_zero USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_force_types, ONLY: qs_force_type @@ -109,13 +107,13 @@ SUBROUTINE put_rho0_on_grid(qs_env, rho0, tot_rs_int) TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: coeff_gspace - TYPE(pw_c1d_type), POINTER :: rho0_s_gs + TYPE(pw_c1d_gs_type) :: coeff_gspace + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type) :: coeff_rspace, rho0_r_tmp - TYPE(pw_r3d_type), POINTER :: rho0_s_rs + TYPE(pw_r3d_rs_type) :: coeff_rspace, rho0_r_tmp + TYPE(pw_r3d_rs_type), POINTER :: rho0_s_rs TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_desc_p_type), DIMENSION(:), & POINTER :: descs @@ -156,10 +154,8 @@ SUBROUTINE put_rho0_on_grid(qs_env, rho0, tot_rs_int) CPASSERT(ASSOCIATED(pw_pool)) IF (igrid /= auxbas_grid) THEN - CALL pw_pool%create_pw(coeff_rspace, & - in_space=REALSPACE) - CALL pw_pool%create_pw(coeff_gspace, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(coeff_rspace) + CALL pw_pool%create_pw(coeff_gspace) END IF CALL rs_grid_zero(rs_grid) @@ -239,8 +235,7 @@ SUBROUTINE put_rho0_on_grid(qs_env, rho0, tot_rs_int) CALL pw_pool%give_back_pw(coeff_gspace) ELSE - CALL pw_pool%create_pw(rho0_r_tmp, & - in_space=REALSPACE) + CALL pw_pool%create_pw(rho0_r_tmp) CALL transfer_rs2pw(rs_grid, rho0_r_tmp) @@ -288,8 +283,7 @@ SUBROUTINE rho0_s_grid_create(pw_env, rho0_mpole) ELSE ALLOCATE (rho0_mpole%rho0_s_rs) END IF - CALL auxbas_pw_pool%create_pw(rho0_mpole%rho0_s_rs, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho0_mpole%rho0_s_rs) ! rho0 density in reciprocal space IF (ASSOCIATED(rho0_mpole%rho0_s_gs)) THEN @@ -297,8 +291,7 @@ SUBROUTINE rho0_s_grid_create(pw_env, rho0_mpole) ELSE ALLOCATE (rho0_mpole%rho0_s_gs) END IF - CALL auxbas_pw_pool%create_pw(rho0_mpole%rho0_s_gs, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho0_mpole%rho0_s_gs) ! Find the grid level suitable for rho0_soft rho0_mpole%igrid_zet0_s = gaussian_gridlevel(pw_env%gridlevel_info, 2.0_dp*rho0_mpole%zet0_h) @@ -322,7 +315,7 @@ SUBROUTINE integrate_vhg0_rspace(qs_env, v_rspace, para_env, calculate_forces, l local_rho_set_2nd, atener, kforce) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(IN) :: v_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_rspace TYPE(mp_para_env_type), POINTER :: para_env LOGICAL, INTENT(IN) :: calculate_forces TYPE(local_rho_type), OPTIONAL, POINTER :: local_rho_set, local_rho_set_2nd @@ -352,11 +345,11 @@ SUBROUTINE integrate_vhg0_rspace(qs_env, v_rspace, para_env, calculate_forces, l TYPE(gto_basis_set_type), POINTER :: basis_1c_set TYPE(harmonics_atom_type), POINTER :: harmonics TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: coeff_gaux, coeff_gspace + TYPE(pw_c1d_gs_type) :: coeff_gaux, coeff_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: pw_aux, pw_pool - TYPE(pw_r3d_type) :: coeff_raux, coeff_rspace + TYPE(pw_r3d_rs_type) :: coeff_raux, coeff_rspace TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_desc_p_type), DIMENSION(:), & @@ -436,22 +429,17 @@ SUBROUTINE integrate_vhg0_rspace(qs_env, v_rspace, para_env, calculate_forces, l rs_desc => rs_descs(igrid)%rs_desc pw_pool => pw_pools(igrid)%pool - CALL pw_pool%create_pw(coeff_gspace, & - in_space=RECIPROCALSPACE) - - CALL pw_pool%create_pw(coeff_rspace, & - in_space=REALSPACE) + CALL pw_pool%create_pw(coeff_gspace) + CALL pw_pool%create_pw(coeff_rspace) IF (igrid /= auxbas_grid) THEN pw_aux => pw_pools(auxbas_grid)%pool - CALL pw_aux%create_pw(coeff_gaux, & - in_space=RECIPROCALSPACE) + CALL pw_aux%create_pw(coeff_gaux) CALL pw_transfer(v_rspace, coeff_gaux) CALL pw_copy(coeff_gaux, coeff_gspace) CALL pw_transfer(coeff_gspace, coeff_rspace) CALL pw_aux%give_back_pw(coeff_gaux) - CALL pw_aux%create_pw(coeff_raux, & - in_space=REALSPACE) + CALL pw_aux%create_pw(coeff_raux) fscale = coeff_rspace%pw_grid%dvol/coeff_raux%pw_grid%dvol CALL pw_scale(coeff_rspace, fscale) CALL pw_aux%give_back_pw(coeff_raux) diff --git a/src/qs_rho0_types.F b/src/qs_rho0_types.F index b8ab70fc1e..72d697e7fc 100644 --- a/src/qs_rho0_types.F +++ b/src/qs_rho0_types.F @@ -13,8 +13,8 @@ MODULE qs_rho0_types pi,& rootpi USE memory_utilities, ONLY: reallocate - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_grid_atom, ONLY: grid_atom_type USE qs_rho_atom_types, ONLY: rho_atom_coeff USE whittaker, ONLY: whittaker_c0a,& @@ -59,8 +59,8 @@ MODULE qs_rho0_types REAL(dp), DIMENSION(:), POINTER :: norm_g0l_h INTEGER, DIMENSION(:), POINTER :: lmax0_kind INTEGER :: lmax_0, igrid_zet0_s - TYPE(pw_r3d_type), POINTER :: rho0_s_rs - TYPE(pw_c1d_type), POINTER :: rho0_s_gs + TYPE(pw_r3d_rs_type), POINTER :: rho0_s_rs + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs END TYPE rho0_mpole_type ! ************************************************************************************************** @@ -436,8 +436,8 @@ SUBROUTINE get_rho0_mpole(rho0_mpole, g0_h, vg0_h, iat, ikind, lmax_0, l0_ikind, REAL(dp), INTENT(OUT), OPTIONAL :: zet0_h INTEGER, INTENT(OUT), OPTIONAL :: igrid_zet0_s REAL(dp), INTENT(OUT), OPTIONAL :: rpgf0_h, rpgf0_s, max_rpgf0_s - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho0_s_rs - TYPE(pw_c1d_type), OPTIONAL, POINTER :: rho0_s_gs + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho0_s_rs + TYPE(pw_c1d_gs_type), OPTIONAL, POINTER :: rho0_s_gs IF (ASSOCIATED(rho0_mpole)) THEN diff --git a/src/qs_rho_methods.F b/src/qs_rho_methods.F index 7021a1ffe6..d7f745d7d8 100644 --- a/src/qs_rho_methods.F +++ b/src/qs_rho_methods.F @@ -38,10 +38,8 @@ MODULE qs_rho_methods pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_drho_elec,& calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& @@ -113,13 +111,13 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e TYPE(kpoint_type), POINTER :: kpoints TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g, tau_g - TYPE(pw_c1d_type), DIMENSION(:, :), POINTER :: drho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g, tau_g + TYPE(pw_c1d_gs_type), DIMENSION(:, :), POINTER :: drho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau_r - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_r - TYPE(pw_r3d_type), POINTER :: rho_r_sccs + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau_r + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_r + TYPE(pw_r3d_rs_type), POINTER :: rho_r_sccs CALL timeset(routineN, handle) @@ -244,8 +242,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e ALLOCATE (rho_r(nspins)) CALL qs_rho_set(rho, rho_r=rho_r) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_r(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r(i)) END DO END IF @@ -260,7 +257,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e ALLOCATE (rho_g(nspins)) CALL qs_rho_set(rho, rho_g=rho_g) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_g(i), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g(i)) END DO END IF @@ -273,7 +270,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e END IF ALLOCATE (rho_r_sccs) CALL qs_rho_set(rho, rho_r_sccs=rho_r_sccs) - CALL auxbas_pw_pool%create_pw(rho_r_sccs, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_sccs) CALL pw_zero(rho_r_sccs) END IF END IF @@ -294,7 +291,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e CALL qs_rho_set(rho, drho_r=drho_r) DO j = 1, nspins DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_r(i, j), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_r(i, j)) END DO END DO END IF @@ -312,7 +309,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e CALL qs_rho_set(rho, drho_g=drho_g) DO j = 1, nspins DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_g(i, j), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(drho_g(i, j)) END DO END DO END IF @@ -331,8 +328,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e ALLOCATE (tau_r(nspins)) CALL qs_rho_set(rho, tau_r=tau_r) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(tau_r(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tau_r(i)) END DO END IF @@ -347,8 +343,7 @@ SUBROUTINE qs_rho_rebuild(rho, qs_env, rebuild_ao, rebuild_grids, admm, pw_env_e ALLOCATE (tau_g(nspins)) CALL qs_rho_set(rho, tau_g=tau_g) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(tau_g(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tau_g(i)) END DO END IF END IF ! use_kinetic_energy_density @@ -490,11 +485,11 @@ SUBROUTINE qs_rho_update_rho_low(rho_struct, qs_env, rho_xc_external, & TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab TYPE(oce_matrix_type), POINTER :: oce - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g, rho_xc_g, tau_g, tau_xc_g - TYPE(pw_c1d_type), DIMENSION(:, :), POINTER :: drho_g, drho_xc_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g, rho_xc_g, tau_g, tau_xc_g + TYPE(pw_c1d_gs_type), DIMENSION(:, :), POINTER :: drho_g, drho_xc_g TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, rho_xc_r, tau_r, tau_xc_r - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_r, drho_xc_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, rho_xc_r, tau_r, tau_xc_r + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_r, drho_xc_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_xc @@ -692,9 +687,9 @@ SUBROUTINE qs_rho_update_tddfpt(rho_struct, qs_env, pw_env_external, task_list_e TYPE(dft_control_type), POINTER :: dft_control TYPE(kpoint_type), POINTER :: kpoints TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(task_list_type), POINTER :: task_list @@ -785,11 +780,11 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, & rho_ao_out TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp_in - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out - TYPE(pw_c1d_type), DIMENSION(:, :), POINTER :: drho_g_in, drho_g_out - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_r_in, drho_r_out - TYPE(pw_r3d_type), POINTER :: rho_r_sccs_in, rho_r_sccs_out + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out + TYPE(pw_c1d_gs_type), DIMENSION(:, :), POINTER :: drho_g_in, drho_g_out + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_r_in, drho_r_out + TYPE(pw_r3d_rs_type), POINTER :: rho_r_sccs_in, rho_r_sccs_out CALL timeset(routineN, handle) @@ -879,15 +874,13 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) CALL qs_rho_set(rho_output, rho_r=rho_r_out) IF (mspin > nspins) THEN DO i = 1, mspin - CALL auxbas_pw_pool%create_pw(rho_r_out(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_out(i)) CALL pw_copy(rho_r_in(1), rho_r_out(i)) CALL pw_scale(rho_r_out(i), ospin) END DO ELSE DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_r_out(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_out(i)) CALL pw_copy(rho_r_in(i), rho_r_out(i)) END DO END IF @@ -901,15 +894,13 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) CALL qs_rho_set(rho_output, rho_g=rho_g_out) IF (mspin > nspins) THEN DO i = 1, mspin - CALL auxbas_pw_pool%create_pw(rho_g_out(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g_out(i)) CALL pw_copy(rho_g_in(1), rho_g_out(i)) CALL pw_scale(rho_g_out(i), ospin) END DO ELSE DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_g_out(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g_out(i)) CALL pw_copy(rho_g_in(i), rho_g_out(i)) END DO END IF @@ -918,8 +909,7 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) ! SCCS IF (ASSOCIATED(rho_r_sccs_in)) THEN CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out) - CALL auxbas_pw_pool%create_pw(rho_r_sccs_out, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_sccs_out) CALL pw_copy(rho_r_sccs_in, rho_r_sccs_out) END IF @@ -932,8 +922,7 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) IF (mspin > nspins) THEN DO j = 1, mspin DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_r_out(i, j), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_r_out(i, j)) CALL pw_copy(drho_r_in(i, 1), drho_r_out(i, j)) CALL pw_scale(drho_r_out(i, j), ospin) END DO @@ -941,8 +930,7 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) ELSE DO j = 1, nspins DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_r_out(i, j), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_r_out(i, j)) CALL pw_copy(drho_r_in(i, j), drho_r_out(i, j)) END DO END DO @@ -958,8 +946,7 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) IF (mspin > nspins) THEN DO j = 1, mspin DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_g_out(i, j), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(drho_g_out(i, j)) CALL pw_copy(drho_g_in(i, 1), drho_g_out(i, j)) CALL pw_scale(drho_g_out(i, j), ospin) END DO @@ -967,8 +954,7 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) ELSE DO j = 1, nspins DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_g_out(i, j), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(drho_g_out(i, j)) CALL pw_copy(drho_g_in(i, j), drho_g_out(i, j)) END DO END DO @@ -983,15 +969,13 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) CALL qs_rho_set(rho_output, tau_r=tau_r_out) IF (mspin > nspins) THEN DO i = 1, mspin - CALL auxbas_pw_pool%create_pw(tau_r_out(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tau_r_out(i)) CALL pw_copy(tau_r_in(1), tau_r_out(i)) CALL pw_scale(tau_r_out(i), ospin) END DO ELSE DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(tau_r_out(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tau_r_out(i)) CALL pw_copy(tau_r_in(i), tau_r_out(i)) END DO END IF @@ -1005,15 +989,13 @@ SUBROUTINE qs_rho_copy(rho_input, rho_output, auxbas_pw_pool, mspin) CALL qs_rho_set(rho_output, tau_g=tau_g_out) IF (mspin > nspins) THEN DO i = 1, mspin - CALL auxbas_pw_pool%create_pw(tau_g_out(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tau_g_out(i)) CALL pw_copy(tau_g_in(1), tau_g_out(i)) CALL pw_scale(tau_g_out(i), ospin) END DO ELSE DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(tau_g_out(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tau_g_out(i)) CALL pw_copy(tau_g_in(i), tau_g_out(i)) END DO END IF @@ -1086,11 +1068,11 @@ SUBROUTINE qs_rho_scale_and_add(rhoa, rhob, alpha, beta) tot_rho_r_b TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao_a, rho_ao_b, rho_ao_im_a, & rho_ao_im_b - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_a, rho_g_b, tau_g_a, tau_g_b - TYPE(pw_c1d_type), DIMENSION(:, :), POINTER :: drho_g_a, drho_g_b - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_a, rho_r_b, tau_r_a, tau_r_b - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_r_a, drho_r_b - TYPE(pw_r3d_type), POINTER :: rho_r_sccs_a, rho_r_sccs_b + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_a, rho_g_b, tau_g_a, tau_g_b + TYPE(pw_c1d_gs_type), DIMENSION(:, :), POINTER :: drho_g_a, drho_g_b + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_a, rho_r_b, tau_r_a, tau_r_b + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_r_a, drho_r_b + TYPE(pw_r3d_rs_type), POINTER :: rho_r_sccs_a, rho_r_sccs_b CALL timeset(routineN, handle) @@ -1261,13 +1243,13 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao_im_in, rho_ao_im_out, rho_ao_in, & rho_ao_out TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out - TYPE(pw_c1d_type), DIMENSION(:, :), POINTER :: drho_g_in, drho_g_out + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_in, rho_g_out, tau_g_in, tau_g_out + TYPE(pw_c1d_gs_type), DIMENSION(:, :), POINTER :: drho_g_in, drho_g_out TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_r_in, drho_r_out - TYPE(pw_r3d_type), POINTER :: rho_r_sccs_in, rho_r_sccs_out + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_in, rho_r_out, tau_r_in, tau_r_out + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_r_in, drho_r_out + TYPE(pw_r3d_rs_type), POINTER :: rho_r_sccs_in, rho_r_sccs_out CALL timeset(routineN, handle) @@ -1336,7 +1318,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) ALLOCATE (rho_r_out(nspins)) CALL qs_rho_set(rho_output, rho_r=rho_r_out) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_r_out(i), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_out(i)) CALL pw_copy(rho_r_in(i), rho_r_out(i)) END DO END IF @@ -1346,7 +1328,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) ALLOCATE (rho_g_out(nspins)) CALL qs_rho_set(rho_output, rho_g=rho_g_out) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_g_out(i), in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g_out(i)) CALL pw_copy(rho_g_in(i), rho_g_out(i)) END DO END IF @@ -1354,7 +1336,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) ! SCCS IF (ASSOCIATED(rho_r_sccs_in)) THEN CALL qs_rho_set(rho_output, rho_r_sccs=rho_r_sccs_out) - CALL auxbas_pw_pool%create_pw(rho_r_sccs_out, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_sccs_out) CALL pw_copy(rho_r_sccs_in, rho_r_sccs_out) END IF @@ -1366,7 +1348,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) CALL qs_rho_set(rho_output, drho_r=drho_r_out) DO j = 1, nspins DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_r_out(i, j), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_r_out(i, j)) CALL pw_copy(drho_r_in(i, j), drho_r_out(i, j)) END DO END DO @@ -1378,8 +1360,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) CALL qs_rho_set(rho_output, drho_g=drho_g_out) DO j = 1, nspins DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_g_out(i, j), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(drho_g_out(i, j)) CALL pw_copy(drho_g_in(i, j), drho_g_out(i, j)) END DO END DO @@ -1395,8 +1376,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) ALLOCATE (tau_r_out(nspins)) CALL qs_rho_set(rho_output, tau_r=tau_r_out) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(tau_r_out(i), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tau_r_out(i)) CALL pw_copy(tau_r_in(i), tau_r_out(i)) END DO END IF @@ -1406,8 +1386,7 @@ SUBROUTINE duplicate_rho_type(rho_input, rho_output, qs_env) ALLOCATE (tau_g_out(nspins)) CALL qs_rho_set(rho_output, tau_g=tau_g_out) DO i = 1, nspins - CALL auxbas_pw_pool%create_pw(tau_g_out(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tau_g_out(i)) CALL pw_copy(tau_g_in(i), tau_g_out(i)) END DO END IF diff --git a/src/qs_rho_types.F b/src/qs_rho_types.F index c1d7fc08ac..b05f304882 100644 --- a/src/qs_rho_types.F +++ b/src/qs_rho_types.F @@ -25,8 +25,8 @@ MODULE qs_rho_types set_1d_pointer,& set_2d_pointer USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -63,14 +63,14 @@ MODULE qs_rho_types PRIVATE TYPE(kpoint_transitional_type) :: rho_ao TYPE(kpoint_transitional_type) :: rho_ao_im - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r => Null() - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g => Null() - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: tau_r => Null() - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: tau_g => Null() - TYPE(pw_r3d_type), DIMENSION(:, :), POINTER :: drho_r => NULL() - TYPE(pw_c1d_type), DIMENSION(:, :), POINTER :: drho_g => NULL() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r => Null() + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g => Null() + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: tau_r => Null() + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: tau_g => Null() + TYPE(pw_r3d_rs_type), DIMENSION(:, :), POINTER :: drho_r => NULL() + TYPE(pw_c1d_gs_type), DIMENSION(:, :), POINTER :: drho_g => NULL() ! Final rho_iter of last SCCS cycle (r-space) - TYPE(pw_r3d_type), POINTER :: rho_r_sccs => Null() + TYPE(pw_r3d_rs_type), POINTER :: rho_r_sccs => Null() LOGICAL :: rho_g_valid = .FALSE., & rho_r_valid = .FALSE., & drho_r_valid = .FALSE., & @@ -231,18 +231,22 @@ SUBROUTINE qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rh POINTER :: rho_ao, rho_ao_im TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, & POINTER :: rho_ao_kp, rho_ao_im_kp - TYPE(pw_r3d_type), DIMENSION(:), OPTIONAL, POINTER :: rho_r - TYPE(pw_r3d_type), DIMENSION(:, :), OPTIONAL, & + TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL, & + POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:, :), OPTIONAL, & POINTER :: drho_r - TYPE(pw_c1d_type), DIMENSION(:), OPTIONAL, POINTER :: rho_g - TYPE(pw_c1d_type), DIMENSION(:, :), OPTIONAL, & + TYPE(pw_c1d_gs_type), DIMENSION(:), OPTIONAL, & + POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:, :), OPTIONAL, & POINTER :: drho_g - TYPE(pw_r3d_type), DIMENSION(:), OPTIONAL, POINTER :: tau_r - TYPE(pw_c1d_type), DIMENSION(:), OPTIONAL, POINTER :: tau_g + TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL, & + POINTER :: tau_r + TYPE(pw_c1d_gs_type), DIMENSION(:), OPTIONAL, & + POINTER :: tau_g LOGICAL, INTENT(out), OPTIONAL :: rho_r_valid, drho_r_valid, rho_g_valid, & drho_g_valid, tau_r_valid, tau_g_valid REAL(KIND=dp), DIMENSION(:), OPTIONAL, POINTER :: tot_rho_r, tot_rho_g - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho_r_sccs + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho_r_sccs LOGICAL, INTENT(out), OPTIONAL :: soft_valid, complex_rho_ao IF (PRESENT(rho_ao)) rho_ao => get_1d_pointer(rho_struct%rho_ao) @@ -306,18 +310,22 @@ SUBROUTINE qs_rho_set(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rh POINTER :: rho_ao, rho_ao_im TYPE(dbcsr_p_type), DIMENSION(:, :), OPTIONAL, & POINTER :: rho_ao_kp, rho_ao_im_kp - TYPE(pw_r3d_type), DIMENSION(:), OPTIONAL, POINTER :: rho_r - TYPE(pw_r3d_type), DIMENSION(:, :), OPTIONAL, & + TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL, & + POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:, :), OPTIONAL, & POINTER :: drho_r - TYPE(pw_c1d_type), DIMENSION(:), OPTIONAL, POINTER :: rho_g - TYPE(pw_c1d_type), DIMENSION(:, :), OPTIONAL, & + TYPE(pw_c1d_gs_type), DIMENSION(:), OPTIONAL, & + POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:, :), OPTIONAL, & POINTER :: drho_g - TYPE(pw_r3d_type), DIMENSION(:), OPTIONAL, POINTER :: tau_r - TYPE(pw_c1d_type), DIMENSION(:), OPTIONAL, POINTER :: tau_g + TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL, & + POINTER :: tau_r + TYPE(pw_c1d_gs_type), DIMENSION(:), OPTIONAL, & + POINTER :: tau_g LOGICAL, INTENT(in), OPTIONAL :: rho_r_valid, drho_r_valid, rho_g_valid, & drho_g_valid, tau_r_valid, tau_g_valid REAL(KIND=dp), DIMENSION(:), OPTIONAL, POINTER :: tot_rho_r, tot_rho_g - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho_r_sccs + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho_r_sccs LOGICAL, INTENT(in), OPTIONAL :: soft_valid, complex_rho_ao IF (PRESENT(rho_ao)) CALL set_1d_pointer(rho_struct%rho_ao, rho_ao) diff --git a/src/qs_sccs.F b/src/qs_sccs.F index ef680a1fb9..0f71e3c971 100644 --- a/src/qs_sccs.F +++ b/src/qs_sccs.F @@ -75,10 +75,8 @@ MODULE qs_sccs pw_poisson_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -123,8 +121,8 @@ MODULE qs_sccs SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_r3d_type), INTENT(INOUT) :: v_sccs + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: v_sccs REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT), & OPTIONAL :: h_stress @@ -154,10 +152,10 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: deps_elec, eps_elec - TYPE(pw_r3d_type), DIMENSION(3) :: dln_eps_elec, dphi_tot - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_pw_r - TYPE(pw_r3d_type), POINTER :: rho_pw_r_sccs + TYPE(pw_r3d_rs_type) :: deps_elec, eps_elec + TYPE(pw_r3d_rs_type), DIMENSION(3) :: dln_eps_elec, dphi_tot + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_pw_r + TYPE(pw_r3d_rs_type), POINTER :: rho_pw_r_sccs TYPE(qs_energy_type), POINTER :: energy TYPE(qs_rho_type), POINTER :: rho TYPE(qs_scf_env_type), POINTER :: scf_env @@ -268,8 +266,8 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) ! Retrieve the total electronic density in r-space BLOCK - TYPE(pw_r3d_type) :: rho_elec - CALL auxbas_pw_pool%create_pw(rho_elec, in_space=REALSPACE) + TYPE(pw_r3d_rs_type) :: rho_elec + CALL auxbas_pw_pool%create_pw(rho_elec) ! Retrieve grid parameters ngpts = rho_elec%pw_grid%ngpts @@ -286,8 +284,8 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) tot_rho_elec = pw_integrate_function(rho_elec) ! Calculate the dielectric (smoothed) function of rho_elec in r-space - CALL auxbas_pw_pool%create_pw(eps_elec, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(deps_elec, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(eps_elec) + CALL auxbas_pw_pool%create_pw(deps_elec) ! Relative permittivity or dielectric constant of the solvent (medium) epsilon_solvent = sccs_control%epsilon_solvent SELECT CASE (sccs_control%method_id) @@ -337,9 +335,9 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) IF (ABS(epsilon_solvent - 1.0_dp) > epstol) THEN BLOCK - TYPE(pw_r3d_type) :: theta, norm_drho_elec - TYPE(pw_r3d_type), DIMENSION(3) :: drho_elec - CALL auxbas_pw_pool%create_pw(theta, in_space=REALSPACE) + TYPE(pw_r3d_rs_type) :: theta, norm_drho_elec + TYPE(pw_r3d_rs_type), DIMENSION(3) :: drho_elec + CALL auxbas_pw_pool%create_pw(theta) CALL pw_zero(theta) ! Calculate the (quantum) volume of the solute cavity @@ -360,11 +358,11 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) ! Calculate the derivative of the electronic density in r-space ! TODO: Could be retrieved from the QS environment DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(drho_elec(i), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(drho_elec(i)) END DO CALL derive(rho_elec, drho_elec, sccs_derivative_fft, pw_env, input) - CALL auxbas_pw_pool%create_pw(norm_drho_elec, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(norm_drho_elec) ! Calculate the norm of the gradient of the electronic density in r-space !$OMP PARALLEL DO DEFAULT(NONE) & @@ -442,9 +440,9 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) END BLOCK BLOCK - TYPE(pw_r3d_type) :: rho_tot, phi_tot, rho_solute, rho_tot_zero + TYPE(pw_r3d_rs_type) :: rho_tot, phi_tot, rho_solute, rho_tot_zero ! Retrieve the total charge density (core + elec) of the solute in r-space - CALL auxbas_pw_pool%create_pw(rho_solute, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_solute) CALL pw_zero(rho_solute) CALL pw_transfer(rho_tot_gspace, rho_solute) tot_rho_solute = pw_integrate_function(rho_solute) @@ -462,7 +460,7 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) END IF ! Reassign work storage to rho_tot_zero, because rho_elec is no longer needed - CALL auxbas_pw_pool%create_pw(rho_tot_zero, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_zero) ! Build the initial (rho_iter = 0) total charge density (solute plus polarisation) in r-space ! eps_elec <- ln(eps_elec) @@ -488,7 +486,7 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) ! Build the derivative of LOG(eps_elec) DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(dln_eps_elec(i), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dln_eps_elec(i)) CALL pw_zero(dln_eps_elec(i)) END DO CALL derive(eps_elec, dln_eps_elec, sccs_control%derivative_method, pw_env, input) @@ -521,15 +519,15 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) ! Get storage for the derivative of the total potential (field) in r-space DO i = 1, 3 - CALL auxbas_pw_pool%create_pw(dphi_tot(i), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dphi_tot(i)) END DO ! Initialise the total charge density in r-space rho_tot with rho_tot_zero + rho_iter_zero - CALL auxbas_pw_pool%create_pw(rho_tot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot) CALL pw_copy(rho_tot_zero, rho_tot) CALL pw_axpy(rho_pw_r_sccs, rho_tot) - CALL auxbas_pw_pool%create_pw(phi_tot, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(phi_tot) CALL pw_zero(phi_tot) ! Main SCCS iteration loop @@ -674,8 +672,8 @@ SUBROUTINE sccs(qs_env, rho_tot_gspace, v_hartree_gspace, v_sccs, h_stress) ! Calculate the Hartree energy and potential of the solute only BLOCK - TYPE(pw_r3d_type) :: phi_solute - CALL auxbas_pw_pool%create_pw(phi_solute, in_space=REALSPACE) + TYPE(pw_r3d_rs_type) :: phi_solute + CALL auxbas_pw_pool%create_pw(phi_solute) CALL pw_zero(phi_solute) CALL pw_poisson_solve(poisson_env=poisson_env, & density=rho_solute, & @@ -822,7 +820,7 @@ END SUBROUTINE sccs SUBROUTINE andreussi(rho_elec, eps_elec, deps_elec, epsilon_solvent, rho_max, & rho_min) - TYPE(pw_r3d_type), INTENT(IN) :: rho_elec, eps_elec, deps_elec + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_elec, eps_elec, deps_elec REAL(KIND=dp), INTENT(IN) :: epsilon_solvent, rho_max, rho_min CHARACTER(LEN=*), PARAMETER :: routineN = 'andreussi' @@ -896,7 +894,7 @@ END SUBROUTINE andreussi SUBROUTINE fattebert_gygi(rho_elec, eps_elec, deps_elec, epsilon_solvent, beta, & rho_zero) - TYPE(pw_r3d_type), INTENT(IN) :: rho_elec, eps_elec, deps_elec + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_elec, eps_elec, deps_elec REAL(KIND=dp), INTENT(IN) :: epsilon_solvent, beta, rho_zero CHARACTER(LEN=*), PARAMETER :: routineN = 'fattebert_gygi' @@ -958,8 +956,8 @@ END SUBROUTINE fattebert_gygi ! ************************************************************************************************** SUBROUTINE derive(f, df, method, pw_env, input) - TYPE(pw_r3d_type), INTENT(IN) :: f - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: df + TYPE(pw_r3d_rs_type), INTENT(IN) :: f + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: df INTEGER, INTENT(IN) :: method TYPE(pw_env_type), POINTER :: pw_env TYPE(section_vals_type), POINTER :: input @@ -968,7 +966,7 @@ SUBROUTINE derive(f, df, method, pw_env, input) INTEGER :: border_points, handle, i INTEGER, DIMENSION(3) :: lb, n, ub - TYPE(pw_c1d_type), DIMENSION(2) :: work_g1d + TYPE(pw_c1d_gs_type), DIMENSION(2) :: work_g1d TYPE(pw_pool_type), POINTER :: auxbas_pw_pool TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_input_type) :: input_settings @@ -1006,8 +1004,7 @@ SUBROUTINE derive(f, df, method, pw_env, input) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) ! Get work storage for the 1d grids in g-space (derivative calculation) DO i = 1, SIZE(work_g1d) - CALL auxbas_pw_pool%create_pw(work_g1d(i), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(work_g1d(i)) END DO END SELECT @@ -1069,7 +1066,7 @@ END SUBROUTINE derive SUBROUTINE surface_andreussi(rho_elec, norm_drho_elec, dtheta, & epsilon_solvent, rho_max, rho_min, delta_rho) - TYPE(pw_r3d_type), INTENT(IN) :: rho_elec, norm_drho_elec, dtheta + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_elec, norm_drho_elec, dtheta REAL(KIND=dp), INTENT(IN) :: epsilon_solvent, rho_max, rho_min, & delta_rho @@ -1149,7 +1146,7 @@ END SUBROUTINE surface_andreussi SUBROUTINE surface_fattebert_gygi(rho_elec, norm_drho_elec, dtheta, & epsilon_solvent, beta, rho_zero, delta_rho) - TYPE(pw_r3d_type), INTENT(IN) :: rho_elec, norm_drho_elec, dtheta + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_elec, norm_drho_elec, dtheta REAL(KIND=dp), INTENT(IN) :: epsilon_solvent, beta, rho_zero, & delta_rho diff --git a/src/qs_scf_initialization.F b/src/qs_scf_initialization.F index afe56538e2..c7b1157513 100644 --- a/src/qs_scf_initialization.F +++ b/src/qs_scf_initialization.F @@ -54,7 +54,7 @@ MODULE qs_scf_initialization USE kinds, ONLY: dp USE kpoint_types, ONLY: kpoint_type USE message_passing, ONLY: mp_para_env_type - USE pw_types, ONLY: pw_c1d_type + USE pw_types, ONLY: pw_c1d_gs_type USE qmmm_image_charge, ONLY: conditional_calc_image_matrix USE qs_block_davidson_types, ONLY: block_davidson_allocate,& block_davidson_env_create @@ -228,7 +228,7 @@ SUBROUTINE qs_scf_ensure_scf_env(qs_env, scf_env) TYPE(qs_environment_type), POINTER :: qs_env TYPE(qs_scf_env_type), POINTER :: scf_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(qs_rho_type), POINTER :: rho NULLIFY (rho_g) diff --git a/src/qs_scf_post_gpw.F b/src/qs_scf_post_gpw.F index 66925961ea..a2f8cca3e4 100644 --- a/src/qs_scf_post_gpw.F +++ b/src/qs_scf_post_gpw.F @@ -119,10 +119,8 @@ MODULE qs_scf_post_gpw pw_poisson_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_chargemol, ONLY: write_wfx USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_commutators, ONLY: build_com_hr_matrix @@ -272,11 +270,11 @@ SUBROUTINE scf_post_calculation_gpw(qs_env, wf_type, do_mp2) TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_loc_env_type), POINTER :: qs_loc_env_homo, qs_loc_env_lumo, & qs_loc_env_mixed @@ -451,8 +449,8 @@ SUBROUTINE scf_post_calculation_gpw(qs_env, wf_type, do_mp2) IF (((do_mo_cubes .OR. do_wannier_cubes) .AND. (nlumo /= 0 .OR. nhomo /= 0)) .OR. p_loc) THEN CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) END IF !Some info about ROKS @@ -1024,8 +1022,8 @@ SUBROUTINE qs_scf_post_occ_cubes(input, dft_section, dft_control, logger, qs_env TYPE(cp_logger_type), POINTER :: logger TYPE(qs_environment_type), POINTER :: qs_env TYPE(cp_fm_type), INTENT(IN) :: mo_coeff - TYPE(pw_c1d_type), INTENT(INOUT) :: wf_g - TYPE(pw_r3d_type), INTENT(INOUT) :: wf_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: wf_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: wf_r TYPE(particle_list_type), POINTER :: particles INTEGER, INTENT(IN) :: homo, ispin @@ -1129,8 +1127,8 @@ SUBROUTINE qs_scf_post_unocc_cubes(input, dft_section, dft_control, logger, qs_e TYPE(cp_logger_type), POINTER :: logger TYPE(qs_environment_type), POINTER :: qs_env TYPE(cp_fm_type), INTENT(IN) :: unoccupied_orbs - TYPE(pw_c1d_type), INTENT(INOUT) :: wf_g - TYPE(pw_r3d_type), INTENT(INOUT) :: wf_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: wf_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: wf_r TYPE(particle_list_type), POINTER :: particles INTEGER, INTENT(IN) :: nlumos, homo, ispin INTEGER, INTENT(IN), OPTIONAL :: lumo @@ -1464,7 +1462,7 @@ SUBROUTINE qs_scf_post_elf(input, logger, qs_env) TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: elf_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: elf_r TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: elf_section @@ -1486,7 +1484,7 @@ SUBROUTINE qs_scf_post_elf(input, logger, qs_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) DO ispin = 1, dft_control%nspins - CALL auxbas_pw_pool%create_pw(elf_r(ispin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(elf_r(ispin)) CALL pw_zero(elf_r(ispin)) END DO @@ -1710,8 +1708,8 @@ SUBROUTINE write_mo_dependent_results(qs_env, scf_env) TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type) :: wf_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_energy_type), POINTER :: energy TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_type), POINTER :: rho @@ -1828,7 +1826,7 @@ SUBROUTINE write_mo_dependent_results(qs_env, scf_env) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) CALL pw_copy(rho_r(1), wf_r) CALL pw_axpy(rho_r(2), wf_r, alpha=-1._dp) total_abs_spin_dens = pw_integrate_function(wf_r, oprt="ABS") @@ -1913,14 +1911,14 @@ SUBROUTINE write_mo_free_results(qs_env) TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: aux_g, rho_elec_gspace - TYPE(pw_c1d_type), POINTER :: rho0_s_gs, rho_core + TYPE(pw_c1d_gs_type) :: aux_g, rho_elec_gspace + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs, rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: aux_r, rho_elec_rspace, wf_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_r3d_type), POINTER :: mb_rho, v_hartree_rspace, vee + TYPE(pw_r3d_rs_type) :: aux_r, rho_elec_rspace, wf_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), POINTER :: mb_rho, v_hartree_rspace, vee TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_kind_type), POINTER :: qs_kind TYPE(qs_rho_type), POINTER :: rho @@ -1969,7 +1967,7 @@ SUBROUTINE write_mo_free_results(qs_env) rho0_s_gs=rho0_s_gs) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) IF (dft_control%qs_control%gapw) THEN IF (dft_control%qs_control%gapw_control%nopaw_as_gpw) THEN CALL pw_axpy(rho_core, rho0_s_gs) @@ -2134,9 +2132,9 @@ SUBROUTINE write_mo_free_results(qs_env) CALL pw_env_get(pw_env=pw_env, & auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace) CALL pw_zero(rho_elec_rspace) - CALL auxbas_pw_pool%create_pw(pw=rho_elec_gspace, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_elec_gspace) CALL pw_zero(rho_elec_gspace) CALL get_pw_grid_info(pw_grid=rho_elec_gspace%pw_grid, & dr=dr, & @@ -2240,7 +2238,7 @@ SUBROUTINE write_mo_free_results(qs_env) CALL pw_env_get(pw_env=pw_env, & auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace) CALL pw_copy(rho_r(1), rho_elec_rspace) CALL pw_axpy(rho_r(2), rho_elec_rspace) filename = "ELECTRON_DENSITY" @@ -2327,7 +2325,7 @@ SUBROUTINE write_mo_free_results(qs_env) pw_env=pw_env, & v_hartree_rspace=v_hartree_rspace) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) append_cube = section_get_lval(input, "DFT%PRINT%V_HARTREE_CUBE%APPEND") my_pos_cube = "REWIND" @@ -2359,7 +2357,7 @@ SUBROUTINE write_mo_free_results(qs_env) IF (dft_control%apply_external_potential) THEN CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, vee=vee) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) append_cube = section_get_lval(input, "DFT%PRINT%EXTERNAL_POTENTIAL_CUBE%APPEND") my_pos_cube = "REWIND" @@ -2389,8 +2387,8 @@ SUBROUTINE write_mo_free_results(qs_env) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(aux_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) + CALL auxbas_pw_pool%create_pw(aux_g) append_cube = section_get_lval(input, "DFT%PRINT%EFIELD_CUBE%APPEND") my_pos_cube = "REWIND" @@ -2590,7 +2588,7 @@ SUBROUTINE write_mo_free_results(qs_env) pw_pools=pw_pools) NULLIFY (mb_rho) ALLOCATE (mb_rho) - CALL auxbas_pw_pool%create_pw(pw=mb_rho, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=mb_rho) CALL pw_copy(rho_r(1), mb_rho) CALL pw_axpy(rho_r(2), mb_rho) !CALL voronoi_analysis(qs_env, rho_elec_rspace, print_key, unit_nr) @@ -2892,7 +2890,7 @@ SUBROUTINE qs_scf_post_local_energy(input, logger, qs_env) TYPE(particle_list_type), POINTER :: particles TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: eden + TYPE(pw_r3d_rs_type) :: eden TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: dft_section @@ -2907,7 +2905,7 @@ SUBROUTINE qs_scf_post_local_energy(input, logger, qs_env) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, subsys=subsys) CALL qs_subsys_get(subsys, particles=particles) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(eden, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(eden) ! CALL qs_local_energy(qs_env, eden) ! @@ -2968,7 +2966,7 @@ SUBROUTINE qs_scf_post_local_stress(input, logger, qs_env) TYPE(particle_list_type), POINTER :: particles TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: stress + TYPE(pw_r3d_rs_type) :: stress TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: dft_section @@ -2983,7 +2981,7 @@ SUBROUTINE qs_scf_post_local_stress(input, logger, qs_env) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env, subsys=subsys) CALL qs_subsys_get(subsys, particles=particles) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(stress, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(stress) ! ! use beta=0: kinetic energy density in symmetric form beta = 0.0_dp @@ -3049,8 +3047,8 @@ SUBROUTINE qs_scf_post_ps_implicit(input, logger, qs_env) TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: aux_r - TYPE(pw_r3d_type), POINTER :: dirichlet_tile + TYPE(pw_r3d_rs_type) :: aux_r + TYPE(pw_r3d_rs_type), POINTER :: dirichlet_tile TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: dft_section @@ -3081,7 +3079,7 @@ SUBROUTINE qs_scf_post_ps_implicit(input, logger, qs_env) extension=".cube", middle_name="DIELECTRIC_CONSTANT", file_position=my_pos_cube, & mpi_io=mpi_io) CALL pw_env_get(pw_env, poisson_env=poisson_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) boundary_condition = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition SELECT CASE (boundary_condition) @@ -3129,7 +3127,7 @@ SUBROUTINE qs_scf_post_ps_implicit(input, logger, qs_env) extension=".cube", middle_name="dirichlet_cstr_charge", file_position=my_pos_cube, & mpi_io=mpi_io) CALL pw_env_get(pw_env, poisson_env=poisson_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) boundary_condition = pw_env%poisson_env%parameters%ps_implicit_params%boundary_condition SELECT CASE (boundary_condition) @@ -3172,7 +3170,7 @@ SUBROUTINE qs_scf_post_ps_implicit(input, logger, qs_env) tile_cubes = section_get_lval(input, "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE%TILE_CUBES") CALL pw_env_get(pw_env, poisson_env=poisson_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(aux_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(aux_r) CALL pw_zero(aux_r) IF (tile_cubes) THEN @@ -3201,7 +3199,7 @@ SUBROUTINE qs_scf_post_ps_implicit(input, logger, qs_env) ! a single cube file NULLIFY (dirichlet_tile) ALLOCATE (dirichlet_tile) - CALL auxbas_pw_pool%create_pw(dirichlet_tile, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(dirichlet_tile) CALL pw_zero(dirichlet_tile) mpi_io = .TRUE. unit_nr = cp_print_key_unit_nr(logger, input, "DFT%PRINT%IMPLICIT_PSOLVER%DIRICHLET_BC_CUBE", & @@ -3361,12 +3359,12 @@ SUBROUTINE update_hartree_with_mp2(rho, qs_env) TYPE(qs_environment_type), POINTER :: qs_env LOGICAL :: use_virial - TYPE(pw_c1d_type) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), POINTER :: rho_core + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), POINTER :: rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_energy_type), POINTER :: energy TYPE(virial_type), POINTER :: virial @@ -3381,10 +3379,8 @@ SUBROUTINE update_hartree_with_mp2(rho, qs_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) CALL pw_poisson_solve(poisson_env, rho_tot_gspace, energy%hartree, & diff --git a/src/qs_scf_post_tb.F b/src/qs_scf_post_tb.F index 1404e56196..532ec3a373 100644 --- a/src/qs_scf_post_tb.F +++ b/src/qs_scf_post_tb.F @@ -93,10 +93,8 @@ MODULE qs_scf_post_tb pw_poisson_parameter_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_core,& calculate_rho_elec,& calculate_wavefunction @@ -1049,11 +1047,11 @@ SUBROUTINE print_e_density(qs_env, cube_section) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(qs_subsys_type), POINTER :: subsys @@ -1093,8 +1091,8 @@ SUBROUTINE print_e_density(qs_env, cube_section) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) BLOCK - TYPE(pw_r3d_type) :: rho_elec_rspace - CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace, in_space=REALSPACE) + TYPE(pw_r3d_rs_type) :: rho_elec_rspace + CALL auxbas_pw_pool%create_pw(pw=rho_elec_rspace) CALL pw_copy(rho_r(1), rho_elec_rspace) CALL pw_axpy(rho_r(2), rho_elec_rspace) filename = "ELECTRON_DENSITY" @@ -1194,14 +1192,14 @@ SUBROUTINE print_density_cubes(qs_env, cube_section, total_density, v_hartree, e TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type) :: rho_core - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type) :: rho_core + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_parameter_type) :: poisson_params TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rho_tot_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type) :: rho_tot_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(qs_subsys_type), POINTER :: subsys @@ -1251,8 +1249,7 @@ SUBROUTINE print_density_cubes(qs_env, cube_section, total_density, v_hartree, e CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env=pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(pw=rho_core, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_core) CALL calculate_rho_core(rho_core, total_rho_core_rspace, qs_env) IF (iounit > 0) THEN @@ -1262,8 +1259,7 @@ SUBROUTINE print_density_cubes(qs_env, cube_section, total_density, v_hartree, e "Integrated core density:", total_rho_core_rspace END IF - CALL auxbas_pw_pool%create_pw(pw=rho_tot_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_tot_rspace) CALL pw_transfer(rho_core, rho_tot_rspace) DO ispin = 1, dft_control%nspins CALL pw_axpy(rho_r(ispin), rho_tot_rspace) @@ -1291,9 +1287,8 @@ SUBROUTINE print_density_cubes(qs_env, cube_section, total_density, v_hartree, e END IF IF (my_v_hartree .OR. my_efield) THEN BLOCK - TYPE(pw_c1d_type) :: rho_tot_gspace - CALL auxbas_pw_pool%create_pw(pw=rho_tot_gspace, & - in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: rho_tot_gspace + CALL auxbas_pw_pool%create_pw(pw=rho_tot_gspace) CALL pw_transfer(rho_tot_rspace, rho_tot_gspace) poisson_params%solver = pw_poisson_analytic poisson_params%periodic = cell%perd @@ -1308,9 +1303,8 @@ SUBROUTINE print_density_cubes(qs_env, cube_section, total_density, v_hartree, e END BLOCK IF (my_v_hartree) THEN BLOCK - TYPE(pw_r3d_type) :: vhartree - CALL auxbas_pw_pool%create_pw(pw=vhartree, & - in_space=REALSPACE) + TYPE(pw_r3d_rs_type) :: vhartree + CALL auxbas_pw_pool%create_pw(pw=vhartree) CALL pw_transfer(rho_tot_gspace, vhartree) filename = "V_HARTREE" mpi_io = .TRUE. @@ -1335,9 +1329,8 @@ SUBROUTINE print_density_cubes(qs_env, cube_section, total_density, v_hartree, e END IF IF (my_efield) THEN BLOCK - TYPE(pw_c1d_type) :: vhartree - CALL auxbas_pw_pool%create_pw(pw=vhartree, & - in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: vhartree + CALL auxbas_pw_pool%create_pw(pw=vhartree) udvol = 1.0_dp/rho_tot_rspace%pw_grid%dvol DO id = 1, 3 CALL pw_transfer(rho_tot_gspace, vhartree) @@ -1399,12 +1392,12 @@ SUBROUTINE print_elf(qs_env, elf_section) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: elf_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: elf_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(qs_subsys_type), POINTER :: subsys @@ -1434,7 +1427,7 @@ SUBROUTINE print_elf(qs_env, elf_section) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) DO ispin = 1, dft_control%nspins - CALL auxbas_pw_pool%create_pw(elf_r(ispin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(elf_r(ispin)) CALL pw_zero(elf_r(ispin)) END DO @@ -1503,11 +1496,11 @@ SUBROUTINE print_mo_cubes(qs_env, cube_section) TYPE(mo_set_type), DIMENSION(:), POINTER :: mos TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys TYPE(scf_control_type), POINTER :: scf_control @@ -1555,8 +1548,8 @@ SUBROUTINE print_mo_cubes(qs_env, cube_section) CALL get_qs_env(qs_env=qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) CALL get_qs_env(qs_env, subsys=subsys) CALL qs_subsys_get(subsys, particles=particles) diff --git a/src/qs_tddfpt2_densities.F b/src/qs_tddfpt2_densities.F index 7a04fa9669..3c8c47e0e7 100644 --- a/src/qs_tddfpt2_densities.F +++ b/src/qs_tddfpt2_densities.F @@ -20,8 +20,8 @@ MODULE qs_tddfpt2_densities USE parallel_gemm_api, ONLY: parallel_gemm USE pw_env_types, ONLY: pw_env_get USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -172,8 +172,8 @@ SUBROUTINE tddfpt_construct_aux_fit_density(rho_orb_struct, rho_aux_fit_struct, TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao_aux_fit, rho_ao_orb TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_aux_fit - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_aux_fit_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_aux_fit_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_aux_fit_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_aux_fit_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(task_list_type), POINTER :: task_list diff --git a/src/qs_tddfpt2_fhxc.F b/src/qs_tddfpt2_fhxc.F index e69709a52b..8d88c6daf1 100644 --- a/src/qs_tddfpt2_fhxc.F +++ b/src/qs_tddfpt2_fhxc.F @@ -31,9 +31,8 @@ MODULE qs_tddfpt2_fhxc pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_gapw_densities, ONLY: prepare_gapw_den @@ -120,10 +119,10 @@ SUBROUTINE fhxc_kernel(Aop_evects, evects, is_rks_triplets, & TYPE(dft_control_type), POINTER :: dft_control TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_v_int TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_ia_g, rho_ia_g_aux_fit + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_ia_g, rho_ia_g_aux_fit TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: V_rspace_sub - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_ia_r, rho_ia_r_aux_fit + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: V_rspace_sub + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_ia_r, rho_ia_r_aux_fit TYPE(rho_atom_type), DIMENSION(:), POINTER :: rho1_atom_set, rho_atom_set TYPE(task_list_type), POINTER :: task_list @@ -293,8 +292,7 @@ SUBROUTINE fhxc_kernel(Aop_evects, evects, is_rks_triplets, & CALL pw_env_get(sub_env%pw_env, auxbas_pw_pool=auxbas_pw_pool) ALLOCATE (V_rspace_sub(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(V_rspace_sub(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(V_rspace_sub(ispin)) CALL pw_zero(V_rspace_sub(ispin)) END DO diff --git a/src/qs_tddfpt2_fhxc_forces.F b/src/qs_tddfpt2_fhxc_forces.F index 4880029ddf..cccea575dd 100644 --- a/src/qs_tddfpt2_fhxc_forces.F +++ b/src/qs_tddfpt2_fhxc_forces.F @@ -49,7 +49,7 @@ MODULE qs_tddfpt2_fhxc_forces ewald_environment_type USE ewald_methods_tb, ONLY: tb_ewald_overlap,& tb_spme_evaluate - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE exstates_types, ONLY: excited_energy_type USE hartree_local_methods, ONLY: Vh_1c_gg_integrals,& init_coulomb_local @@ -87,10 +87,8 @@ MODULE qs_tddfpt2_fhxc_forces USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& @@ -202,13 +200,13 @@ SUBROUTINE fhxc_force(qs_env, ex_env, gs_mos, full_kernel, debug_forces) POINTER :: sab, sab_aux_fit, sab_orb, sap_oce TYPE(oce_matrix_type), POINTER :: oce TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rhox_tot_gspace, xv_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux, rhox_g, rhox_g_aux, rhoxx_g + TYPE(pw_c1d_gs_type) :: rhox_tot_gspace, xv_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux, rhox_g, rhox_g_aux, rhoxx_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: xv_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau, & + TYPE(pw_r3d_rs_type) :: xv_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rho, fxc_tau, gxc_rho, gxc_tau, & rho_r_aux, rhox_r, rhox_r_aux, rhoxx_r TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -393,13 +391,10 @@ SUBROUTINE fhxc_force(qs_env, ex_env, gs_mos, full_kernel, debug_forces) ALLOCATE (rhox_r(nspins), rhox_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhox_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhox_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhox_r(ispin)) + CALL auxbas_pw_pool%create_pw(rhox_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(rhox_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhox_tot_gspace) CALL pw_zero(rhox_tot_gspace) DO ispin = 1, nspins @@ -414,10 +409,8 @@ SUBROUTINE fhxc_force(qs_env, ex_env, gs_mos, full_kernel, debug_forces) IF (gapw_xc) THEN ALLOCATE (rhoxx_r(nspins), rhoxx_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoxx_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoxx_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoxx_r(ispin)) + CALL auxbas_pw_pool%create_pw(rhoxx_g(ispin)) END DO DO ispin = 1, nspins IF (nspins == 2) CALL dbcsr_scale(matrix_px1(ispin)%matrix, 2.0_dp) @@ -431,10 +424,8 @@ SUBROUTINE fhxc_force(qs_env, ex_env, gs_mos, full_kernel, debug_forces) CALL get_qs_env(qs_env, matrix_s=matrix_s, force=force) IF (.NOT. is_rks_triplets) THEN - CALL auxbas_pw_pool%create_pw(xv_hartree_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(xv_hartree_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(xv_hartree_rspace) + CALL auxbas_pw_pool%create_pw(xv_hartree_gspace) ! calculate associated hartree potential IF (gapw) THEN CALL pw_axpy(local_rho_set%rho0_mpole%rho0_s_gs, rhox_tot_gspace) @@ -680,10 +671,8 @@ SUBROUTINE fhxc_force(qs_env, ex_env, gs_mos, full_kernel, debug_forces) ! rhox_aux ALLOCATE (rhox_r_aux(nspins), rhox_g_aux(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhox_r_aux(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhox_g_aux(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhox_r_aux(ispin)) + CALL auxbas_pw_pool%create_pw(rhox_g_aux(ispin)) END DO DO ispin = 1, nspins CALL calculate_rho_elec(ks_env=ks_env, matrix_p=matrix_px1_admm(ispin)%matrix, & @@ -1313,7 +1302,7 @@ SUBROUTINE stda_force(qs_env, ex_env, gs_mos, stda_env, sub_env, work, debug_for TYPE(dbcsr_type), POINTER :: tempmat TYPE(dft_control_type), POINTER :: dft_control TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: n_list, sab_orb diff --git a/src/qs_tddfpt2_forces.F b/src/qs_tddfpt2_forces.F index cd272dab43..f54048ca84 100644 --- a/src/qs_tddfpt2_forces.F +++ b/src/qs_tddfpt2_forces.F @@ -70,10 +70,8 @@ MODULE qs_tddfpt2_forces USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_density_matrices, ONLY: calculate_wx_matrix,& calculate_xwx_matrix @@ -674,14 +672,14 @@ SUBROUTINE tddfpt_resvec2(qs_env, matrix_pe, matrix_pe_admm, gs_mos, matrix_hz, TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab, sab_aux_fit TYPE(oce_matrix_type), POINTER :: oce - TYPE(pw_c1d_type) :: rho_tot_gspace, v_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g, rho_g_aux, rhoz_g_aux, trho_g, & + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, v_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g, rho_g_aux, rhoz_g_aux, trho_g, & trho_xc_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, rho_r_aux, rhoz_r_aux, tau_r, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, rho_r_aux, rhoz_r_aux, tau_r, & trho_r, trho_xc_r, v_xc, v_xc_tau TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_ks_env_type), POINTER :: ks_env @@ -705,27 +703,20 @@ SUBROUTINE tddfpt_resvec2(qs_env, matrix_pe, matrix_pe_admm, gs_mos, matrix_hz, CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(v_hartree_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace) ALLOCATE (trho_r(nspins), trho_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(trho_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(trho_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(trho_r(ispin)) + CALL auxbas_pw_pool%create_pw(trho_g(ispin)) END DO IF (gapw_xc) THEN ALLOCATE (trho_xc_r(nspins), trho_xc_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(trho_xc_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(trho_xc_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(trho_xc_r(ispin)) + CALL auxbas_pw_pool%create_pw(trho_xc_g(ispin)) END DO END IF @@ -948,10 +939,8 @@ SUBROUTINE tddfpt_resvec2(qs_env, matrix_pe, matrix_pe_admm, gs_mos, matrix_hz, ! rhoz_aux ALLOCATE (rhoz_r_aux(nspins), rhoz_g_aux(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoz_r_aux(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoz_g_aux(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_r_aux(ispin)) + CALL auxbas_pw_pool%create_pw(rhoz_g_aux(ispin)) END DO DO ispin = 1, nspins CALL calculate_rho_elec(ks_env=ks_env, matrix_p=mpe(ispin, 1)%matrix, & diff --git a/src/qs_tddfpt2_operators.F b/src/qs_tddfpt2_operators.F index d5a2db6396..cd14bdc83b 100644 --- a/src/qs_tddfpt2_operators.F +++ b/src/qs_tddfpt2_operators.F @@ -37,8 +37,8 @@ MODULE qs_tddfpt2_operators USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kernel_types, ONLY: full_kernel_env_type @@ -159,15 +159,15 @@ END SUBROUTINE tddfpt_apply_energy_diff ! ************************************************************************************************** SUBROUTINE tddfpt_apply_coulomb(A_ia_rspace, rho_ia_g, local_rho_set, hartree_local, & qs_env, sub_env, gapw, work_v_gspace, work_v_rspace) - TYPE(pw_r3d_type), DIMENSION(:), INTENT(INOUT) :: A_ia_rspace - TYPE(pw_c1d_type), INTENT(INOUT) :: rho_ia_g + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(INOUT) :: A_ia_rspace + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rho_ia_g TYPE(local_rho_type), POINTER :: local_rho_set TYPE(hartree_local_type), POINTER :: hartree_local TYPE(qs_environment_type), POINTER :: qs_env TYPE(tddfpt_subgroup_env_type), INTENT(in) :: sub_env LOGICAL, INTENT(IN) :: gapw - TYPE(pw_c1d_type), INTENT(INOUT) :: work_v_gspace - TYPE(pw_r3d_type), INTENT(INOUT) :: work_v_rspace + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: work_v_gspace + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: work_v_rspace CHARACTER(LEN=*), PARAMETER :: routineN = 'tddfpt_apply_coulomb' @@ -236,12 +236,12 @@ END SUBROUTINE tddfpt_apply_coulomb SUBROUTINE tddfpt_apply_xc(A_ia_rspace, kernel_env, rho_ia_struct, is_rks_triplets, & pw_env, work_v_xc, work_v_xc_tau) - TYPE(pw_r3d_type), DIMENSION(:), INTENT(INOUT) :: A_ia_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(INOUT) :: A_ia_rspace TYPE(full_kernel_env_type), INTENT(IN) :: kernel_env TYPE(qs_rho_type), POINTER :: rho_ia_struct LOGICAL, INTENT(in) :: is_rks_triplets TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: work_v_xc, work_v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: work_v_xc, work_v_xc_tau INTEGER :: ispin, nspins @@ -272,14 +272,14 @@ END SUBROUTINE tddfpt_apply_xc ! ************************************************************************************************** SUBROUTINE tddfpt_apply_xc_potential(A_ia_rspace, fxc_rspace, rho_ia_struct, is_rks_triplets) - TYPE(pw_r3d_type), DIMENSION(:), INTENT(INOUT) :: A_ia_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(INOUT) :: A_ia_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rspace TYPE(qs_rho_type), POINTER :: rho_ia_struct LOGICAL, INTENT(in) :: is_rks_triplets INTEGER :: nspins REAL(KIND=dp) :: alpha - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r nspins = SIZE(A_ia_rspace) @@ -329,14 +329,14 @@ SUBROUTINE tddfpt_apply_xc_analytic(kernel_env, rho_ia_struct, is_rks_triplets, LOGICAL, INTENT(in) :: is_rks_triplets INTEGER, INTENT(in) :: nspins TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: work_v_xc, work_v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: work_v_xc, work_v_xc_tau CHARACTER(LEN=*), PARAMETER :: routineN = 'tddfpt_apply_xc_analytic' INTEGER :: handle, ispin - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_ia_g, rho_ia_g2 + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_ia_g, rho_ia_g2 TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_ia_r, rho_ia_r2, tau_ia_r, tau_ia_r2 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_ia_r, rho_ia_r2, tau_ia_r, tau_ia_r2 CALL timeset(routineN, handle) @@ -414,15 +414,15 @@ SUBROUTINE tddfpt_apply_xc_fd(kernel_env, rho_ia_struct, is_rks_triplets, nspins LOGICAL, INTENT(in) :: is_rks_triplets INTEGER, INTENT(in) :: nspins TYPE(pw_env_type), POINTER :: pw_env - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: work_v_xc, work_v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: work_v_xc, work_v_xc_tau CHARACTER(LEN=*), PARAMETER :: routineN = 'tddfpt_apply_xc_fd' INTEGER :: handle, ispin LOGICAL :: lsd, singlet, triplet - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, tau1_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, tau1_r TYPE(xc_rho_set_type), POINTER :: rho_set CALL timeset(routineN, handle) diff --git a/src/qs_tddfpt2_properties.F b/src/qs_tddfpt2_properties.F index b2ea4129fc..8392ab36ca 100644 --- a/src/qs_tddfpt2_properties.F +++ b/src/qs_tddfpt2_properties.F @@ -79,10 +79,8 @@ MODULE qs_tddfpt2_properties USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_wavefunction USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -1262,11 +1260,11 @@ SUBROUTINE print_nto_cubes(qs_env, mos, istate, stride, append_cube, print_secti TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_subsys_type), POINTER :: subsys @@ -1274,8 +1272,8 @@ SUBROUTINE print_nto_cubes(qs_env, mos, istate, stride, append_cube, print_secti CALL get_qs_env(qs_env=qs_env, dft_control=dft_control, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) CALL get_qs_env(qs_env, subsys=subsys) CALL qs_subsys_get(subsys, particles=particles) diff --git a/src/qs_tddfpt2_stda_utils.F b/src/qs_tddfpt2_stda_utils.F index 855f5516fa..526258e366 100644 --- a/src/qs_tddfpt2_stda_utils.F +++ b/src/qs_tddfpt2_stda_utils.F @@ -53,7 +53,7 @@ MODULE qs_tddfpt2_stda_utils USE ewald_methods_tb, ONLY: tb_ewald_overlap,& tb_spme_evaluate USE ewald_pw_types, ONLY: ewald_pw_create,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE input_section_types, ONLY: section_vals_get_subs_vals,& section_vals_type USE iterate_matrix, ONLY: matrix_sqrt_Newton_Schulz @@ -112,7 +112,7 @@ SUBROUTINE stda_init_matrices(qs_env, stda_kernel, sub_env, work, tddfpt_control LOGICAL :: do_coulomb TYPE(cell_type), POINTER :: cell, cell_ref TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(section_vals_type), POINTER :: ewald_section, poisson_section, & print_section @@ -538,7 +538,7 @@ SUBROUTINE stda_calculate_kernel(qs_env, stda_control, stda_env, sub_env, & TYPE(dbcsr_type) :: pdens TYPE(dbcsr_type), POINTER :: tempmat TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: n_list diff --git a/src/qs_tddfpt2_types.F b/src/qs_tddfpt2_types.F index 24d0328081..bcd3eacc93 100644 --- a/src/qs_tddfpt2_types.F +++ b/src/qs_tddfpt2_types.F @@ -31,7 +31,7 @@ MODULE qs_tddfpt2_types dbcsr_type, dbcsr_type_antisymmetric USE ewald_environment_types, ONLY: ewald_env_release,& ewald_environment_type - USE ewald_pw_types, ONLY: ewald_pw_r3d_type,& + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type,& ewald_pw_release USE hartree_local_methods, ONLY: init_coulomb_local USE hartree_local_types, ONLY: hartree_local_create,& @@ -42,10 +42,8 @@ MODULE qs_tddfpt2_types USE parallel_gemm_api, ONLY: parallel_gemm USE pw_env_types, ONLY: pw_env_get USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kind_types, ONLY: qs_kind_type @@ -156,17 +154,17 @@ MODULE qs_tddfpt2_types !> electron density in terms of auxiliary basis set TYPE(qs_rho_type), POINTER :: rho_aux_fit_struct_sub !> group-specific copy of a Coulomb/xc-potential on a real-space grid - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: A_ia_rspace_sub + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: A_ia_rspace_sub !> group-specific copy of a reciprocal-space grid - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: wpw_gspace_sub + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: wpw_gspace_sub !> group-specific copy of a real-space grid - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: wpw_rspace_sub + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: wpw_rspace_sub !> group-specific copy of a real-space grid for the kinetic energy density - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: wpw_tau_rspace_sub + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: wpw_tau_rspace_sub ! ! *** real space pw grid to hold fxc kernel <> A_ia_rspace_sub *** ! - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: fxc_rspace_sub + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: fxc_rspace_sub ! ! *** globally distributed matrices required to compute exact exchange terms *** ! @@ -192,7 +190,7 @@ MODULE qs_tddfpt2_types TYPE(cp_fm_type), POINTER :: slambda !Ewald environments TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw !> GAPW local atomic grids TYPE(hartree_local_type), POINTER :: hartree_local TYPE(local_rho_type), POINTER :: local_rho_set @@ -411,15 +409,10 @@ SUBROUTINE tddfpt_create_work_matrices(work_matrices, gs_mos, nstates, do_hfx, d ALLOCATE (work_matrices%wpw_gspace_sub(nspins), work_matrices%wpw_rspace_sub(nspins), & work_matrices%wpw_tau_rspace_sub(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(work_matrices%A_ia_rspace_sub(ispin), & - in_space=REALSPACE) - - CALL auxbas_pw_pool%create_pw(work_matrices%wpw_gspace_sub(ispin), & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(work_matrices%wpw_rspace_sub(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(work_matrices%wpw_tau_rspace_sub(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(work_matrices%A_ia_rspace_sub(ispin)) + CALL auxbas_pw_pool%create_pw(work_matrices%wpw_gspace_sub(ispin)) + CALL auxbas_pw_pool%create_pw(work_matrices%wpw_rspace_sub(ispin)) + CALL auxbas_pw_pool%create_pw(work_matrices%wpw_tau_rspace_sub(ispin)) END DO ! fxc kernel potential real space grid @@ -427,8 +420,7 @@ SUBROUTINE tddfpt_create_work_matrices(work_matrices, gs_mos, nstates, do_hfx, d ! we need spins: aa, ab, bb ALLOCATE (work_matrices%fxc_rspace_sub(3)) DO ispin = 1, 3 - CALL auxbas_pw_pool%create_pw(work_matrices%fxc_rspace_sub(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(work_matrices%fxc_rspace_sub(ispin)) END DO ELSE NULLIFY (work_matrices%fxc_rspace_sub) diff --git a/src/qs_update_s_mstruct.F b/src/qs_update_s_mstruct.F index 7abd9194a8..3c5a9baa8f 100644 --- a/src/qs_update_s_mstruct.F +++ b/src/qs_update_s_mstruct.F @@ -21,8 +21,8 @@ MODULE qs_update_s_mstruct kg_tnadd_embed,& kg_tnadd_embed_ri USE pw_methods, ONLY: pw_transfer - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_ppl_grid,& calculate_rho_core,& calculate_rho_nlcc @@ -69,8 +69,8 @@ SUBROUTINE qs_env_update_s_mstruct(qs_env) INTEGER :: handle LOGICAL :: do_ppl TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), POINTER :: rho_core, rho_nlcc_g - TYPE(pw_r3d_type), POINTER :: rho_nlcc, vppl + TYPE(pw_c1d_gs_type), POINTER :: rho_core, rho_nlcc_g + TYPE(pw_r3d_rs_type), POINTER :: rho_nlcc, vppl CALL timeset(routineN, handle) diff --git a/src/qs_vcd_ao.F b/src/qs_vcd_ao.F index 218d9dc824..bce8fd8191 100644 --- a/src/qs_vcd_ao.F +++ b/src/qs_vcd_ao.F @@ -45,8 +45,7 @@ MODULE qs_vcd_ao USE pw_methods, ONLY: pw_axpy,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -991,8 +990,8 @@ SUBROUTINE build_matrix_r_vhxc(matrix_rv, qs_env, rc) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: matrix_rvxc, matrix_rvxc_desymm TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace, v_tau_rspace - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace, v_tau_rspace + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_energy_type), POINTER :: energy TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_struct @@ -1043,8 +1042,7 @@ SUBROUTINE build_matrix_r_vhxc(matrix_rv, qs_env, rc) IF (.NOT. ASSOCIATED(v_rspace)) THEN ALLOCATE (v_rspace(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(v_rspace(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_rspace(ispin)) CALL pw_zero(v_rspace(ispin)) END DO END IF @@ -1087,7 +1085,7 @@ END SUBROUTINE build_matrix_r_vhxc ! ************************************************************************************************** SUBROUTINE integrate_rv_rspace(v_rspace, hmat, qs_env, rc) - TYPE(pw_r3d_type) :: v_rspace + TYPE(pw_r3d_rs_type) :: v_rspace TYPE(dbcsr_p_type), DIMENSION(:), INTENT(INOUT) :: hmat TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), DIMENSION(3) :: rc diff --git a/src/qs_vxc.F b/src/qs_vxc.F index 5ce4740a2d..d24d5aba63 100644 --- a/src/qs_vxc.F +++ b/src/qs_vxc.F @@ -38,10 +38,8 @@ MODULE qs_vxc pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_dispersion_nonloc, ONLY: calculate_dispersion_nonloc USE qs_dispersion_types, ONLY: qs_dispersion_type USE qs_ks_types, ONLY: get_ks_env,& @@ -101,7 +99,7 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_struct TYPE(section_vals_type), POINTER :: xc_section - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau REAL(KIND=dp), INTENT(out) :: exc LOGICAL, INTENT(in), OPTIONAL :: just_energy REAL(KIND=dp), INTENT(out), OPTIONAL :: edisp @@ -122,13 +120,13 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g, rho_m_gspace, rho_struct_g - TYPE(pw_c1d_type), POINTER :: rho_nlcc_g, tmp_g, tmp_g2 + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g, rho_m_gspace, rho_struct_g + TYPE(pw_c1d_gs_type), POINTER :: rho_nlcc_g, tmp_g, tmp_g2 TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool, vdw_pw_pool, xc_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: my_vxc_rho, my_vxc_tau, rho_m_rspace, & + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: my_vxc_rho, my_vxc_tau, rho_m_rspace, & rho_r, rho_struct_r, tau, tau_struct_r - TYPE(pw_r3d_type), POINTER :: rho_nlcc, tmp_pw + TYPE(pw_r3d_rs_type), POINTER :: rho_nlcc, tmp_pw TYPE(virial_type), POINTER :: virial CALL timeset(routineN, handle) @@ -245,11 +243,11 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, ALLOCATE (rho_r(mspin)) ALLOCATE (rho_g(mspin)) DO ispin = 1, mspin - CALL xc_pw_pool%create_pw(rho_g(ispin), in_space=RECIPROCALSPACE) + CALL xc_pw_pool%create_pw(rho_g(ispin)) CALL pw_transfer(rho_struct_g(ispin), rho_g(ispin)) END DO DO ispin = 1, mspin - CALL xc_pw_pool%create_pw(rho_r(ispin), in_space=REALSPACE) + CALL xc_pw_pool%create_pw(rho_r(ispin)) CALL pw_transfer(rho_g(ispin), rho_r(ispin)) END DO IF (tau_r_valid) THEN @@ -364,15 +362,15 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, ! compute again the xc but now for Exc(m,o) and the opposite sign IF (dft_control%sic_method_id .EQ. sic_mauri_spz .AND. .NOT. sic_scaling_b_zero) THEN ALLOCATE (rho_m_rspace(2), rho_m_gspace(2)) - CALL xc_pw_pool%create_pw(rho_m_gspace(1), in_space=RECIPROCALSPACE) - CALL xc_pw_pool%create_pw(rho_m_rspace(1), in_space=REALSPACE) + CALL xc_pw_pool%create_pw(rho_m_gspace(1)) + CALL xc_pw_pool%create_pw(rho_m_rspace(1)) CALL pw_copy(rho_struct_r(1), rho_m_rspace(1)) CALL pw_axpy(rho_struct_r(2), rho_m_rspace(1), alpha=-1._dp) CALL pw_copy(rho_struct_g(1), rho_m_gspace(1)) CALL pw_axpy(rho_struct_g(2), rho_m_gspace(1), alpha=-1._dp) ! bit sad, these will be just zero... - CALL xc_pw_pool%create_pw(rho_m_gspace(2), in_space=RECIPROCALSPACE) - CALL xc_pw_pool%create_pw(rho_m_rspace(2), in_space=REALSPACE) + CALL xc_pw_pool%create_pw(rho_m_gspace(2)) + CALL xc_pw_pool%create_pw(rho_m_rspace(2)) CALL pw_zero(rho_m_rspace(2)) CALL pw_zero(rho_m_gspace(2)) @@ -419,8 +417,8 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, ALLOCATE (rho_m_rspace(2), rho_m_gspace(2)) DO ispin = 1, 2 - CALL xc_pw_pool%create_pw(rho_m_gspace(ispin), in_space=RECIPROCALSPACE) - CALL xc_pw_pool%create_pw(rho_m_rspace(ispin), in_space=REALSPACE) + CALL xc_pw_pool%create_pw(rho_m_gspace(ispin)) + CALL xc_pw_pool%create_pw(rho_m_rspace(ispin)) END DO DO ispin = 1, 2 @@ -517,14 +515,13 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, ! IF (uf_grid .AND. (ASSOCIATED(vxc_rho) .OR. ASSOCIATED(vxc_tau))) THEN BLOCK - TYPE(pw_r3d_type) :: tmp_pw - TYPE(pw_c1d_type) :: tmp_g, tmp_g2 - CALL xc_pw_pool%create_pw(tmp_g, in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(tmp_g2, in_space=RECIPROCALSPACE) + TYPE(pw_r3d_rs_type) :: tmp_pw + TYPE(pw_c1d_gs_type) :: tmp_g, tmp_g2 + CALL xc_pw_pool%create_pw(tmp_g) + CALL auxbas_pw_pool%create_pw(tmp_g2) IF (ASSOCIATED(vxc_rho)) THEN DO ispin = 1, SIZE(vxc_rho) - CALL auxbas_pw_pool%create_pw(tmp_pw, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tmp_pw) CALL pw_transfer(vxc_rho(ispin), tmp_g) CALL pw_transfer(tmp_g, tmp_g2) CALL pw_transfer(tmp_g2, tmp_pw) @@ -534,8 +531,7 @@ SUBROUTINE qs_vxc_create(ks_env, rho_struct, xc_section, vxc_rho, vxc_tau, exc, END IF IF (ASSOCIATED(vxc_tau)) THEN DO ispin = 1, SIZE(vxc_tau) - CALL auxbas_pw_pool%create_pw(tmp_pw, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tmp_pw) CALL pw_transfer(vxc_tau(ispin), tmp_g) CALL pw_transfer(tmp_g, tmp_g2) CALL pw_transfer(tmp_g2, tmp_pw) @@ -579,8 +575,8 @@ SUBROUTINE qs_xc_density(ks_env, rho_struct, xc_section, dispersion_env, & TYPE(qs_rho_type), POINTER :: rho_struct TYPE(section_vals_type), POINTER :: xc_section TYPE(qs_dispersion_type), OPTIONAL, POINTER :: dispersion_env - TYPE(pw_r3d_type), INTENT(INOUT), OPTIONAL :: xc_ener, xc_den - TYPE(pw_r3d_type), DIMENSION(:), OPTIONAL :: vxc, vtau + TYPE(pw_r3d_rs_type), INTENT(INOUT), OPTIONAL :: xc_ener, xc_den + TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL :: vxc, vtau CHARACTER(len=*), PARAMETER :: routineN = 'qs_xc_density' @@ -591,13 +587,13 @@ SUBROUTINE qs_xc_density(ks_env, rho_struct, xc_section, dispersion_env, & TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_c1d_type), POINTER :: rho_nlcc_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), POINTER :: rho_nlcc_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool, vdw_pw_pool, xc_pw_pool - TYPE(pw_r3d_type) :: exc_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau_r, vxc_rho, vxc_tau - TYPE(pw_r3d_type), POINTER :: rho_nlcc + TYPE(pw_r3d_rs_type) :: exc_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau_r, vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), POINTER :: rho_nlcc CALL timeset(routineN, handle) diff --git a/src/qs_wf_history_methods.F b/src/qs_wf_history_methods.F index 5826ebad84..bd0e081fc3 100644 --- a/src/qs_wf_history_methods.F +++ b/src/qs_wf_history_methods.F @@ -62,10 +62,8 @@ MODULE qs_wf_history_methods pw_env_type USE pw_methods, ONLY: pw_copy USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_density_matrices, ONLY: calculate_density_matrix USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& @@ -147,10 +145,10 @@ SUBROUTINE wfs_update(snapshot, wf_history, qs_env, dt) TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp TYPE(dft_control_type), POINTER :: dft_control TYPE(mo_set_type), DIMENSION(:), POINTER :: mos - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho CALL timeset(routineN, handle) @@ -194,8 +192,7 @@ SUBROUTINE wfs_update(snapshot, wf_history, qs_env, dt) IF (.NOT. ASSOCIATED(snapshot%rho_r)) THEN ALLOCATE (snapshot%rho_r(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(snapshot%rho_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(snapshot%rho_r(ispin)) END DO END IF DO ispin = 1, nspins @@ -214,7 +211,7 @@ SUBROUTINE wfs_update(snapshot, wf_history, qs_env, dt) IF (.NOT. ASSOCIATED(snapshot%rho_g)) THEN ALLOCATE (snapshot%rho_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(snapshot%rho_g(ispin), RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(snapshot%rho_g(ispin)) END DO END IF DO ispin = 1, nspins diff --git a/src/qs_wf_history_types.F b/src/qs_wf_history_types.F index 17797b132b..6731ab1d24 100644 --- a/src/qs_wf_history_types.F +++ b/src/qs_wf_history_types.F @@ -21,8 +21,8 @@ MODULE qs_wf_history_types dbcsr_p_type,& dbcsr_type USE kinds, ONLY: dp - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_rho_types, ONLY: qs_rho_release,& qs_rho_type #include "./base/base_uses.f90" @@ -57,8 +57,8 @@ MODULE qs_wf_history_types ! ************************************************************************************************** TYPE qs_wf_snapshot_type TYPE(cp_fm_type), DIMENSION(:), POINTER :: wf - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: rho_ao_kp TYPE(dbcsr_type), POINTER :: overlap diff --git a/src/response_solver.F b/src/response_solver.F index 98b7ae7f1d..51f317e37d 100644 --- a/src/response_solver.F +++ b/src/response_solver.F @@ -94,10 +94,8 @@ MODULE response_solver USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_2nd_kernel_ao, ONLY: build_dm_response USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_density_matrices, ONLY: calculate_whz_matrix,& @@ -813,13 +811,13 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa matrix_hz, matrix_pz, matrix_pz_admm, matrix_wz, & zehartree, zexc, zexc_aux_fit, rhopz_r, p_env, ex_env, debug) TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type), INTENT(IN) :: vh_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rspace, vtau_rspace, vadmm_rspace + TYPE(pw_r3d_rs_type), INTENT(IN) :: vh_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rspace, vtau_rspace, vadmm_rspace TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_hz, matrix_pz, matrix_pz_admm, & matrix_wz REAL(KIND=dp), OPTIONAL :: zehartree, zexc, zexc_aux_fit - TYPE(pw_r3d_type), DIMENSION(:), INTENT(INOUT), & - OPTIONAL :: rhopz_r + TYPE(pw_r3d_rs_type), DIMENSION(:), & + INTENT(INOUT), OPTIONAL :: rhopz_r TYPE(qs_p_env_type), OPTIONAL :: p_env TYPE(excited_energy_type), OPTIONAL, POINTER :: ex_env LOGICAL, INTENT(IN), OPTIONAL :: debug @@ -864,17 +862,17 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa sap_ppnl TYPE(oce_matrix_type), POINTER :: oce TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_gspace, rho_tot_gspace_gs, rho_tot_gspace_t, rhoz_tot_gspace, & - v_hartree_gspace_gs, v_hartree_gspace_t, zv_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux, rho_g_gs, rho_g_t, rhoz_g, & + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, rho_tot_gspace_gs, rho_tot_gspace_t, & + rhoz_tot_gspace, v_hartree_gspace_gs, v_hartree_gspace_t, zv_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux, rho_g_gs, rho_g_t, rhoz_g, & rhoz_g_aux, rhoz_g_xc - TYPE(pw_c1d_type), POINTER :: rho_core + TYPE(pw_c1d_gs_type), POINTER :: rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: v_hartree_rspace_gs, v_hartree_rspace_t, & + TYPE(pw_r3d_rs_type) :: v_hartree_rspace_gs, v_hartree_rspace_t, & vhxc_rspace, zv_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_aux, rho_r_gs, rho_r_t, rhoz_r, & + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_aux, rho_r_gs, rho_r_t, rhoz_r, & rhoz_r_aux, rhoz_r_xc, tau_r_aux, & tauz_r, tauz_r_xc, v_xc, v_xc_tau TYPE(qs_force_type), DIMENSION(:), POINTER :: force @@ -1194,13 +1192,10 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa ! compute soft GS potential ALLOCATE (rho_r_gs(nspins), rho_g_gs(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_r_gs(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g_gs(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_gs(ispin)) + CALL auxbas_pw_pool%create_pw(rho_g_gs(ispin)) END DO - CALL auxbas_pw_pool%create_pw(rho_tot_gspace_gs, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace_gs) ! compute soft GS density total_rho_gs = 0.0_dp CALL pw_zero(rho_tot_gspace_gs) @@ -1221,10 +1216,8 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa CALL pw_axpy(rho_core, rho_tot_gspace_gs) END IF ! compute GS potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace_gs, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace_gs, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace_gs) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace_gs) NULLIFY (hartree_local_gs) CALL hartree_local_create(hartree_local_gs) CALL init_coulomb_local(hartree_local_gs, natom) @@ -1266,8 +1259,7 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa END IF ! myfun END IF ! gapw - CALL auxbas_pw_pool%create_pw(vhxc_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vhxc_rspace) ! ! Stress-tensor: integration contribution direct term ! int v_Hxc[n^in]*n^z @@ -1445,17 +1437,12 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa ! ALLOCATE (rhoz_r(nspins), rhoz_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoz_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoz_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_r(ispin)) + CALL auxbas_pw_pool%create_pw(rhoz_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(rhoz_tot_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(zv_hartree_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(zv_hartree_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_tot_gspace) + CALL auxbas_pw_pool%create_pw(zv_hartree_rspace) + CALL auxbas_pw_pool%create_pw(zv_hartree_gspace) CALL pw_zero(rhoz_tot_gspace) DO ispin = 1, nspins @@ -1468,10 +1455,8 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa NULLIFY (tauz_r_xc) ALLOCATE (rhoz_r_xc(nspins), rhoz_g_xc(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoz_r_xc(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoz_g_xc(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_r_xc(ispin)) + CALL auxbas_pw_pool%create_pw(rhoz_g_xc(ispin)) END DO DO ispin = 1, nspins CALL calculate_rho_elec(ks_env=ks_env, matrix_p=mpa(ispin)%matrix, & @@ -1483,12 +1468,11 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa IF (ASSOCIATED(vtau_rspace)) THEN CPASSERT(.NOT. (gapw .OR. gapw_xc)) BLOCK - TYPE(pw_c1d_type) :: work_g + TYPE(pw_c1d_gs_type) :: work_g ALLOCATE (tauz_r(nspins)) - CALL auxbas_pw_pool%create_pw(work_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(work_g) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(tauz_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tauz_r(ispin)) CALL calculate_rho_elec(ks_env=ks_env, matrix_p=mpa(ispin)%matrix, & rho=tauz_r(ispin), rho_gspace=work_g, & compute_tau=.TRUE.) @@ -1510,8 +1494,7 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa IF (use_virial) THEN CALL get_qs_env(qs_env, rho=rho) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) ! Get the total input density in g-space [ions + electrons] CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) @@ -1665,13 +1648,10 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa ! compute response potential ALLOCATE (rho_r_t(nspins), rho_g_t(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rho_r_t(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g_t(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_r_t(ispin)) + CALL auxbas_pw_pool%create_pw(rho_g_t(ispin)) END DO - CALL auxbas_pw_pool%create_pw(rho_tot_gspace_t, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace_t) total_rho_t = 0.0_dp CALL pw_zero(rho_tot_gspace_t) DO ispin = 1, nspins @@ -1686,10 +1666,8 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa IF (gapw) THEN CALL pw_axpy(local_rho_set_t%rho0_mpole%rho0_s_gs, rho_tot_gspace_t) ! compute response Coulomb potential - CALL auxbas_pw_pool%create_pw(v_hartree_gspace_t, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(v_hartree_rspace_t, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(v_hartree_gspace_t) + CALL auxbas_pw_pool%create_pw(v_hartree_rspace_t) NULLIFY (hartree_local_t) CALL hartree_local_create(hartree_local_t) CALL init_coulomb_local(hartree_local_t, natom) @@ -2070,10 +2048,8 @@ SUBROUTINE response_force(qs_env, vh_rspace, vxc_rspace, vtau_rspace, vadmm_rspa NULLIFY (rhoz_g_aux, rhoz_r_aux) ALLOCATE (rhoz_r_aux(nspins), rhoz_g_aux(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoz_r_aux(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoz_g_aux(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_r_aux(ispin)) + CALL auxbas_pw_pool%create_pw(rhoz_g_aux(ispin)) END DO DO ispin = 1, nspins CALL calculate_rho_elec(ks_env=ks_env, matrix_p=mpz(ispin, 1)%matrix, & diff --git a/src/ri_environment_methods.F b/src/ri_environment_methods.F index 4dfc8cb31e..e5077748a5 100644 --- a/src/ri_environment_methods.F +++ b/src/ri_environment_methods.F @@ -39,8 +39,8 @@ MODULE ri_environment_methods lri_kind_type USE message_passing, ONLY: mp_comm_type,& mp_para_env_type - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_lri_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& @@ -373,8 +373,8 @@ SUBROUTINE calculate_ri_densities(lri_env, qs_env, pmatrix, & REAL(KIND=dp), DIMENSION(:, :), POINTER :: avec TYPE(lri_density_type), POINTER :: lri_density TYPE(lri_kind_type), DIMENSION(:), POINTER :: lri_coef - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r CALL timeset(routineN, handle) diff --git a/src/rpa_gw.F b/src/rpa_gw.F index 2480011150..cb1c0fe3d2 100644 --- a/src/rpa_gw.F +++ b/src/rpa_gw.F @@ -111,10 +111,8 @@ MODULE rpa_gw pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_band_structure, ONLY: calculate_kp_orbitals USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& @@ -2204,10 +2202,10 @@ SUBROUTINE print_local_bandgap(qs_env, Eigenval, gw_corr_lev_occ, gw_corr_lev_vi CHARACTER(LEN=*), PARAMETER :: routineN = 'print_local_bandgap' INTEGER :: handle, i_E - TYPE(pw_c1d_type) :: rho_g_dummy + TYPE(pw_c1d_gs_type) :: rho_g_dummy TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: E_CBM_rspace, E_gap_rspace, E_VBM_rspace - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: LDOS + TYPE(pw_r3d_rs_type) :: E_CBM_rspace, E_gap_rspace, E_VBM_rspace + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: LDOS CALL timeset(routineN, handle) @@ -2245,9 +2243,9 @@ END SUBROUTINE print_local_bandgap ! ************************************************************************************************** SUBROUTINE calculate_E_gap_rspace(E_gap_rspace, E_VBM_rspace, E_CBM_rspace, rho_g_dummy, & LDOS, qs_env, Eigenval, gw_corr_lev_occ, gw_corr_lev_virt, homo, dft_gw_char) - TYPE(pw_r3d_type) :: E_gap_rspace, E_VBM_rspace, E_CBM_rspace - TYPE(pw_c1d_type) :: rho_g_dummy - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: LDOS + TYPE(pw_r3d_rs_type) :: E_gap_rspace, E_VBM_rspace, E_CBM_rspace + TYPE(pw_c1d_gs_type) :: rho_g_dummy + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: LDOS TYPE(qs_environment_type), POINTER :: qs_env REAL(KIND=dp), DIMENSION(:, :, :), INTENT(IN) :: Eigenval INTEGER :: gw_corr_lev_occ, gw_corr_lev_virt, homo @@ -2463,7 +2461,7 @@ END SUBROUTINE calculate_E_gap_rspace !> \param mp2_env ... ! ************************************************************************************************** SUBROUTINE print_file(pw_print, middle_name, gw_section, particles, mp2_env) - TYPE(pw_r3d_type) :: pw_print + TYPE(pw_r3d_rs_type) :: pw_print CHARACTER(len=*) :: middle_name TYPE(section_vals_type), POINTER :: gw_section TYPE(particle_list_type), POINTER :: particles @@ -2502,9 +2500,9 @@ END SUBROUTINE print_file !> \param qs_env ... ! ************************************************************************************************** SUBROUTINE create_real_space_grids(E_gap_rspace, E_VBM_rspace, E_CBM_rspace, rho_g_dummy, LDOS, auxbas_pw_pool, qs_env) - TYPE(pw_r3d_type) :: E_gap_rspace, E_VBM_rspace, E_CBM_rspace - TYPE(pw_c1d_type) :: rho_g_dummy - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: LDOS + TYPE(pw_r3d_rs_type) :: E_gap_rspace, E_VBM_rspace, E_CBM_rspace + TYPE(pw_c1d_gs_type) :: rho_g_dummy + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: LDOS TYPE(pw_pool_type), POINTER :: auxbas_pw_pool TYPE(qs_environment_type), POINTER :: qs_env @@ -2520,10 +2518,10 @@ SUBROUTINE create_real_space_grids(E_gap_rspace, E_VBM_rspace, E_CBM_rspace, rho CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) - CALL auxbas_pw_pool%create_pw(E_gap_rspace, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(E_VBM_rspace, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(E_CBM_rspace, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rho_g_dummy, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(E_gap_rspace) + CALL auxbas_pw_pool%create_pw(E_VBM_rspace) + CALL auxbas_pw_pool%create_pw(E_CBM_rspace) + CALL auxbas_pw_pool%create_pw(rho_g_dummy) n_E = INT(mp2_env%ri_g0w0%energy_window_print_loc_bandgap/ & mp2_env%ri_g0w0%energy_spacing_print_loc_bandgap) @@ -2531,7 +2529,7 @@ SUBROUTINE create_real_space_grids(E_gap_rspace, E_VBM_rspace, E_CBM_rspace, rho ALLOCATE (LDOS(n_E)) DO i_E = 1, n_E - CALL auxbas_pw_pool%create_pw(LDOS(i_E), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(LDOS(i_E)) END DO CALL timestop(handle) diff --git a/src/rpa_im_time_force_methods.F b/src/rpa_im_time_force_methods.F index ea2c588da4..458bd42c2e 100644 --- a/src/rpa_im_time_force_methods.F +++ b/src/rpa_im_time_force_methods.F @@ -112,10 +112,8 @@ MODULE rpa_im_time_force_methods USE pw_poisson_methods, ONLY: pw_poisson_solve USE pw_poisson_types, ONLY: pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec,& calculate_wavefunction USE qs_density_matrices, ONLY: calculate_whz_matrix @@ -2420,13 +2418,13 @@ SUBROUTINE prepare_for_response(force_data, qs_env) matrix_s_aux, work_admm TYPE(dbcsr_type) :: dbcsr_work TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type) :: rhoz_tot_gspace, zv_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rhoz_g + TYPE(pw_c1d_gs_type) :: rhoz_tot_gspace, zv_hartree_gspace + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rhoz_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: zv_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rhoz_r, tauz_r, v_xc, v_xc_tau + TYPE(pw_r3d_rs_type) :: zv_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rhoz_r, tauz_r, v_xc, v_xc_tau TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit TYPE(section_vals_type), POINTER :: hfx_section, xc_section TYPE(task_list_type), POINTER :: task_list_aux_fit @@ -2452,17 +2450,12 @@ SUBROUTINE prepare_for_response(force_data, qs_env) !Apply the kernel on the density saved in force_data%sum_YP_tau ALLOCATE (rhoz_r(nspins), rhoz_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoz_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoz_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_r(ispin)) + CALL auxbas_pw_pool%create_pw(rhoz_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(rhoz_tot_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(zv_hartree_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(zv_hartree_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_tot_gspace) + CALL auxbas_pw_pool%create_pw(zv_hartree_rspace) + CALL auxbas_pw_pool%create_pw(zv_hartree_gspace) CALL pw_zero(rhoz_tot_gspace) DO ispin = 1, nspins @@ -2480,12 +2473,11 @@ SUBROUTINE prepare_for_response(force_data, qs_env) CALL qs_rho_get(rho, tau_r_valid=do_tau) IF (do_tau) THEN BLOCK - TYPE(pw_c1d_type) :: tauz_g + TYPE(pw_c1d_gs_type) :: tauz_g ALLOCATE (tauz_r(nspins)) - CALL auxbas_pw_pool%create_pw(tauz_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(tauz_g) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(tauz_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tauz_r(ispin)) CALL calculate_rho_elec(ks_env=qs_env%ks_env, matrix_p=force_data%sum_YP_tau(ispin)%matrix, & rho=tauz_r(ispin), rho_gspace=tauz_g, compute_tau=.TRUE.) @@ -2578,8 +2570,8 @@ SUBROUTINE prepare_for_response(force_data, qs_env) IF (do_tau_admm) THEN BLOCK - TYPE(pw_c1d_type) :: tauz_g - CALL auxbas_pw_pool%create_pw(tauz_g, in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: tauz_g + CALL auxbas_pw_pool%create_pw(tauz_g) DO ispin = 1, nspins CALL pw_zero(tauz_r(ispin)) CALL calculate_rho_elec(ks_env=qs_env%ks_env, matrix_p=ker_tau_admm(ispin)%matrix, & @@ -2721,11 +2713,11 @@ SUBROUTINE get_2c_gpw_forces(G_PQ, force, h_stress, use_virial, mp2_env, qs_env) TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: dvg(3), pot_g, rho_g, rho_g_copy + TYPE(pw_c1d_gs_type) :: dvg(3), pot_g, rho_g, rho_g_copy TYPE(pw_env_type), POINTER :: pw_env_ext TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: psi_L, rho_r + TYPE(pw_r3d_rs_type) :: psi_L, rho_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(realspace_grid_type), DIMENSION(:), POINTER :: rs_v TYPE(task_list_type), POINTER :: task_list_ext @@ -2807,11 +2799,9 @@ SUBROUTINE get_2c_gpw_forces(G_PQ, force, h_stress, use_virial, mp2_env, qs_env) auxbas_pw_pool, poisson_env, task_list_ext, rho_r, rho_g, pot_g, psi_L, sab_orb) IF (use_virial) THEN - CALL auxbas_pw_pool%create_pw(rho_g_copy, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_g_copy) DO i_xyz = 1, 3 - CALL auxbas_pw_pool%create_pw(dvg(i_xyz), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(dvg(i_xyz)) END DO END IF @@ -3164,14 +3154,14 @@ SUBROUTINE update_im_time_forces(p_env, matrix_hz, matrix_p_F, matrix_p_F_admm, TYPE(neighbor_list_set_p_type), DIMENSION(:), & POINTER :: sab_orb, sac_ae, sac_ppl, sap_ppnl TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rho_tot_gspace, rhoz_tot_gspace, & + TYPE(pw_c1d_gs_type) :: rho_tot_gspace, rhoz_tot_gspace, & zv_hartree_gspace - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rhoz_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rhoz_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: vh_rspace, vhxc_rspace, zv_hartree_rspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rhoz_r, tauz_r, v_xc, v_xc_tau, & + TYPE(pw_r3d_rs_type) :: vh_rspace, vhxc_rspace, zv_hartree_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rhoz_r, tauz_r, v_xc, v_xc_tau, & vadmm_rspace, vtau_rspace, vxc_rspace TYPE(qs_force_type), DIMENSION(:), POINTER :: force TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set @@ -3291,8 +3281,7 @@ SUBROUTINE update_im_time_forces(p_env, matrix_hz, matrix_p_F, matrix_p_F_admm, CALL get_qs_env(qs_env, pw_env=pw_env) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & poisson_env=poisson_env) - CALL auxbas_pw_pool%create_pw(vhxc_rspace, & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vhxc_rspace) IF (use_virial) pv_loc = virial%pv_virial @@ -3489,17 +3478,12 @@ SUBROUTINE update_im_time_forces(p_env, matrix_hz, matrix_p_F, matrix_p_F_admm, !The core-denstiy derivative ALLOCATE (rhoz_r(nspins), rhoz_g(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(rhoz_r(ispin), & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(rhoz_g(ispin), & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_r(ispin)) + CALL auxbas_pw_pool%create_pw(rhoz_g(ispin)) END DO - CALL auxbas_pw_pool%create_pw(rhoz_tot_gspace, & - in_space=RECIPROCALSPACE) - CALL auxbas_pw_pool%create_pw(zv_hartree_rspace, & - in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(zv_hartree_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rhoz_tot_gspace) + CALL auxbas_pw_pool%create_pw(zv_hartree_rspace) + CALL auxbas_pw_pool%create_pw(zv_hartree_gspace) CALL pw_zero(rhoz_tot_gspace) DO ispin = 1, nspins @@ -3511,8 +3495,7 @@ SUBROUTINE update_im_time_forces(p_env, matrix_hz, matrix_p_F, matrix_p_F_admm, IF (use_virial) THEN CALL get_qs_env(qs_env, rho=rho) - CALL auxbas_pw_pool%create_pw(rho_tot_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rho_tot_gspace) CALL calc_rho_tot_gspace(rho_tot_gspace, qs_env, rho) @@ -3541,12 +3524,11 @@ SUBROUTINE update_im_time_forces(p_env, matrix_hz, matrix_p_F, matrix_p_F_admm, IF (do_tau) THEN BLOCK - TYPE(pw_c1d_type) :: tauz_g - CALL auxbas_pw_pool%create_pw(tauz_g, in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: tauz_g + CALL auxbas_pw_pool%create_pw(tauz_g) ALLOCATE (tauz_r(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(tauz_r(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(tauz_r(ispin)) CALL calculate_rho_elec(ks_env=qs_env%ks_env, matrix_p=current_density(ispin)%matrix, & rho=tauz_r(ispin), rho_gspace=tauz_g, compute_tau=.TRUE.) @@ -3656,8 +3638,8 @@ SUBROUTINE update_im_time_forces(p_env, matrix_hz, matrix_p_F, matrix_p_F_admm, IF (do_tau_admm) THEN BLOCK - TYPE(pw_c1d_type) :: tauz_g - CALL auxbas_pw_pool%create_pw(tauz_g, in_space=RECIPROCALSPACE) + TYPE(pw_c1d_gs_type) :: tauz_g + CALL auxbas_pw_pool%create_pw(tauz_g) DO ispin = 1, nspins CALL pw_zero(tauz_r(ispin)) CALL calculate_rho_elec(ks_env=qs_env%ks_env, matrix_p=current_density(ispin)%matrix, & diff --git a/src/rpa_rse.F b/src/rpa_rse.F index 783238e298..67016a44e4 100644 --- a/src/rpa_rse.F +++ b/src/rpa_rse.F @@ -51,7 +51,7 @@ MODULE rpa_rse USE message_passing, ONLY: mp_para_env_type USE mp2_types, ONLY: mp2_type USE parallel_gemm_api, ONLY: parallel_gemm - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -425,7 +425,7 @@ SUBROUTINE xc_contribution(qs_env, fm_XC_ao, fm_XC_ao_mo, fm_XC_mo, mo_coeff, di INTEGER :: handle, i REAL(KIND=dp) :: exc TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_vxc - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: tau_rspace, v_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: tau_rspace, v_rspace TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho TYPE(section_vals_type), POINTER :: input, xc_section diff --git a/src/rtp_admm_methods.F b/src/rtp_admm_methods.F index 11f7841c4a..369723044b 100644 --- a/src/rtp_admm_methods.F +++ b/src/rtp_admm_methods.F @@ -41,8 +41,8 @@ MODULE rtp_admm_methods zero USE message_passing, ONLY: mp_para_env_type USE parallel_gemm_api, ONLY: parallel_gemm - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& @@ -97,8 +97,8 @@ SUBROUTINE rtp_admm_calc_rho_aux(qs_env) TYPE(dft_control_type), POINTER :: dft_control TYPE(mo_set_type), DIMENSION(:), POINTER :: mos, mos_aux_fit TYPE(mp_para_env_type), POINTER :: para_env - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r_aux + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g_aux + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r_aux TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho, rho_aux_fit TYPE(rt_prop_type), POINTER :: rtp diff --git a/src/se_core_core.F b/src/se_core_core.F index c53cfb013a..2deb7dd398 100644 --- a/src/se_core_core.F +++ b/src/se_core_core.F @@ -22,7 +22,7 @@ MODULE se_core_core USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE input_constants, ONLY: & do_method_am1, do_method_mndo, do_method_mndod, do_method_pdg, do_method_pm3, & do_method_pm6, do_method_pm6fm, do_method_pnnl, do_method_rm1 @@ -95,7 +95,7 @@ SUBROUTINE se_core_core_interaction(qs_env, para_env, calculate_forces) TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(neighbor_list_iterator_p_type), & DIMENSION(:), POINTER :: nl_iterator TYPE(neighbor_list_set_p_type), DIMENSION(:), & diff --git a/src/se_fock_matrix_coulomb.F b/src/se_fock_matrix_coulomb.F index 8afb09e7b6..24eda7b402 100644 --- a/src/se_fock_matrix_coulomb.F +++ b/src/se_fock_matrix_coulomb.F @@ -41,7 +41,7 @@ MODULE se_fock_matrix_coulomb USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE ewalds_multipole, ONLY: ewald_multipole_evaluate USE fist_neighbor_list_control, ONLY: list_control USE fist_nonbond_env_types, ONLY: fist_nonbond_env_type @@ -146,7 +146,7 @@ SUBROUTINE build_fock_matrix_coulomb(qs_env, ks_matrix, matrix_p, energy, calcul TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: diagmat_ks, diagmat_p TYPE(dft_control_type), POINTER :: dft_control TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_iterator_p_type), & DIMENSION(:), POINTER :: nl_iterator @@ -503,7 +503,7 @@ SUBROUTINE build_fock_matrix_coulomb_lr(qs_env, ks_matrix, matrix_p, energy, & TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: se_nonbond_env TYPE(mp_para_env_type), POINTER :: para_env TYPE(nddo_mpole_type), POINTER :: se_nddo_mpole @@ -1223,7 +1223,7 @@ SUBROUTINE build_fock_matrix_coul_lr_r3(qs_env, ks_matrix, matrix_p, energy, cal TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(fist_nonbond_env_type), POINTER :: se_nonbond_env TYPE(mp_para_env_type), POINTER :: para_env TYPE(nddo_mpole_type), POINTER :: se_nddo_mpole diff --git a/src/spme.F b/src/spme.F index c4202563e0..eff066ff3b 100644 --- a/src/spme.F +++ b/src/spme.F @@ -24,7 +24,7 @@ MODULE spme USE ewald_environment_types, ONLY: ewald_env_get,& ewald_environment_type USE ewald_pw_types, ONLY: ewald_pw_get,& - ewald_pw_r3d_type + ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: fourpi USE message_passing, ONLY: mp_comm_type @@ -43,10 +43,8 @@ MODULE spme USE pw_poisson_types, ONLY: greens_fn_type,& pw_poisson_type USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE realspace_grid_types, ONLY: realspace_grid_desc_type,& realspace_grid_type,& rs_grid_create,& @@ -96,7 +94,7 @@ SUBROUTINE spme_evaluate(ewald_env, ewald_pw, box, particle_set, & fgshell_coulomb, fgcore_coulomb, use_virial, charges, atprop) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(cell_type), POINTER :: box TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set REAL(KIND=dp), DIMENSION(:, :), INTENT(OUT) :: fg_coulomb @@ -124,12 +122,12 @@ SUBROUTINE spme_evaluate(ewald_env, ewald_pw, box, particle_set, & REAL(KIND=dp), DIMENSION(3, 3) :: f_stress, h_stress TYPE(greens_fn_type), POINTER :: green TYPE(mp_comm_type) :: group - TYPE(pw_c1d_type), DIMENSION(3) :: dphi_g - TYPE(pw_c1d_type), POINTER :: phi_g, rhob_g + TYPE(pw_c1d_gs_type), DIMENSION(3) :: dphi_g + TYPE(pw_c1d_gs_type), POINTER :: phi_g, rhob_g TYPE(pw_grid_type), POINTER :: grid_spme TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: rhob_r + TYPE(pw_r3d_rs_type), POINTER :: rhob_r TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_type), DIMENSION(3) :: drpot TYPE(realspace_grid_type), POINTER :: rden, rpot @@ -220,14 +218,12 @@ SUBROUTINE spme_evaluate(ewald_env, ewald_pw, box, particle_set, & NULLIFY (rhob_r) ALLOCATE (rhob_r) - CALL pw_pool%create_pw(rhob_r, & - in_space=REALSPACE) + CALL pw_pool%create_pw(rhob_r) CALL transfer_rs2pw(rden, rhob_r) ! transform density to G space and add charge function NULLIFY (rhob_g) ALLOCATE (rhob_g) - CALL pw_pool%create_pw(rhob_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhob_g) CALL pw_transfer(rhob_r, rhob_g) ! update charge function CALL pw_multiply_with(rhob_g, green%p3m_charge) @@ -235,13 +231,11 @@ SUBROUTINE spme_evaluate(ewald_env, ewald_pw, box, particle_set, & !-------------- ELECTROSTATIC CALCULATION ----------- ! allocate intermediate arrays DO i = 1, 3 - CALL pw_pool%create_pw(dphi_g(i), & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(dphi_g(i)) END DO NULLIFY (phi_g) ALLOCATE (phi_g) - CALL pw_pool%create_pw(phi_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(phi_g) CALL pw_poisson_solve(poisson_env, rhob_g, vg_coulomb, phi_g, dphi_g, & h_stress) !---------- END OF ELECTROSTATIC CALCULATION -------- @@ -472,7 +466,7 @@ SUBROUTINE spme_potential(ewald_env, ewald_pw, box, particle_set_a, charges_a, & particle_set_b, potential) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(cell_type), POINTER :: box TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set_a REAL(KIND=dp), DIMENSION(:), POINTER :: charges_a @@ -490,11 +484,11 @@ SUBROUTINE spme_potential(ewald_env, ewald_pw, box, particle_set_a, charges_a, & REAL(KIND=dp), ALLOCATABLE, DIMENSION(:, :, :) :: rhos TYPE(greens_fn_type), POINTER :: green TYPE(mp_comm_type) :: group - TYPE(pw_c1d_type), POINTER :: phi_g, rhob_g + TYPE(pw_c1d_gs_type), POINTER :: phi_g, rhob_g TYPE(pw_grid_type), POINTER :: grid_spme TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: rhob_r + TYPE(pw_r3d_rs_type), POINTER :: rhob_r TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_type), POINTER :: rden, rpot @@ -543,14 +537,12 @@ SUBROUTINE spme_potential(ewald_env, ewald_pw, box, particle_set_a, charges_a, & NULLIFY (rhob_r) ALLOCATE (rhob_r) - CALL pw_pool%create_pw(rhob_r, & - in_space=REALSPACE) + CALL pw_pool%create_pw(rhob_r) CALL transfer_rs2pw(rden, rhob_r) ! transform density to G space and add charge function NULLIFY (rhob_g) ALLOCATE (rhob_g) - CALL pw_pool%create_pw(rhob_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhob_g) CALL pw_transfer(rhob_r, rhob_g) ! update charge function CALL pw_multiply_with(rhob_g, green%p3m_charge) @@ -559,8 +551,7 @@ SUBROUTINE spme_potential(ewald_env, ewald_pw, box, particle_set_a, charges_a, & ! allocate intermediate arrays NULLIFY (phi_g) ALLOCATE (phi_g) - CALL pw_pool%create_pw(phi_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(phi_g) CALL pw_poisson_solve(poisson_env, density=rhob_g, vhartree=phi_g) !---------- END OF ELECTROSTATIC CALCULATION -------- @@ -616,7 +607,7 @@ SUBROUTINE spme_forces(ewald_env, ewald_pw, box, particle_set_a, charges_a, & particle_set_b, charges_b, forces_b) TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(cell_type), POINTER :: box TYPE(particle_type), DIMENSION(:), INTENT(IN) :: particle_set_a REAL(KIND=dp), DIMENSION(:), POINTER :: charges_a @@ -636,12 +627,12 @@ SUBROUTINE spme_forces(ewald_env, ewald_pw, box, particle_set_a, charges_a, & REAL(KIND=dp), DIMENSION(3) :: fat TYPE(greens_fn_type), POINTER :: green TYPE(mp_comm_type) :: group - TYPE(pw_c1d_type), DIMENSION(3) :: dphi_g - TYPE(pw_c1d_type), POINTER :: phi_g, rhob_g + TYPE(pw_c1d_gs_type), DIMENSION(3) :: dphi_g + TYPE(pw_c1d_gs_type), POINTER :: phi_g, rhob_g TYPE(pw_grid_type), POINTER :: grid_spme TYPE(pw_poisson_type), POINTER :: poisson_env TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), POINTER :: rhob_r + TYPE(pw_r3d_rs_type), POINTER :: rhob_r TYPE(realspace_grid_desc_type), POINTER :: rs_desc TYPE(realspace_grid_type), DIMENSION(3) :: drpot TYPE(realspace_grid_type), POINTER :: rden @@ -691,14 +682,12 @@ SUBROUTINE spme_forces(ewald_env, ewald_pw, box, particle_set_a, charges_a, & NULLIFY (rhob_r) ALLOCATE (rhob_r) - CALL pw_pool%create_pw(rhob_r, & - in_space=REALSPACE) + CALL pw_pool%create_pw(rhob_r) CALL transfer_rs2pw(rden, rhob_r) ! transform density to G space and add charge function NULLIFY (rhob_g) ALLOCATE (rhob_g) - CALL pw_pool%create_pw(rhob_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(rhob_g) CALL pw_transfer(rhob_r, rhob_g) ! update charge function CALL pw_multiply_with(rhob_g, green%p3m_charge) @@ -706,13 +695,11 @@ SUBROUTINE spme_forces(ewald_env, ewald_pw, box, particle_set_a, charges_a, & !-------------- ELECTROSTATIC CALCULATION ----------- ! allocate intermediate arrays DO i = 1, 3 - CALL pw_pool%create_pw(dphi_g(i), & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(dphi_g(i)) END DO NULLIFY (phi_g) ALLOCATE (phi_g) - CALL pw_pool%create_pw(phi_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(phi_g) CALL pw_poisson_solve(poisson_env, density=rhob_g, vhartree=phi_g, & dvhartree=dphi_g) !---------- END OF ELECTROSTATIC CALCULATION -------- diff --git a/src/stm_images.F b/src/stm_images.F index 9b0034657e..65ae1996dc 100644 --- a/src/stm_images.F +++ b/src/stm_images.F @@ -45,10 +45,8 @@ MODULE stm_images pw_env_type USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -113,11 +111,11 @@ SUBROUTINE th_stm_image(qs_env, stm_section, particles, unoccupied_orbs, & TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: rho_ao TYPE(dbcsr_type), POINTER :: stm_density_ao TYPE(mo_set_type), DIMENSION(:), POINTER :: mos - TYPE(pw_c1d_type) :: wf_g + TYPE(pw_c1d_gs_type) :: wf_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: wf_r + TYPE(pw_r3d_rs_type) :: wf_r TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho @@ -157,8 +155,8 @@ SUBROUTINE th_stm_image(qs_env, stm_section, particles, unoccupied_orbs, & CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(wf_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(wf_g) nspin = SIZE(mos, 1) ALLOCATE (nadd_unocc(nspin)) @@ -256,8 +254,8 @@ SUBROUTINE stm_cubes(ks_env, stm_section, stm_density_ao, wf_r, wf_g, mo_arrays, TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(section_vals_type), POINTER :: stm_section TYPE(dbcsr_type), POINTER :: stm_density_ao - TYPE(pw_r3d_type), INTENT(INOUT) :: wf_r - TYPE(pw_c1d_type), INTENT(INOUT) :: wf_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: wf_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: wf_g TYPE(cp_fm_type), DIMENSION(:), INTENT(IN) :: mo_arrays TYPE(cp_1d_r_p_type), DIMENSION(:), INTENT(IN) :: evals, occupation REAL(KIND=dp) :: efermi diff --git a/src/surface_dipole.F b/src/surface_dipole.F index 7dc0b74e6d..04d44c16cd 100644 --- a/src/surface_dipole.F +++ b/src/surface_dipole.F @@ -24,9 +24,8 @@ MODULE surface_dipole pw_zero USE pw_pool_types, ONLY: pw_pool_p_type,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -73,13 +72,13 @@ SUBROUTINE calc_dipsurf_potential(qs_env, energy) REAL(dp), ALLOCATABLE, DIMENSION(:) :: rhoavsurf TYPE(cell_type), POINTER :: cell TYPE(dft_control_type), POINTER :: dft_control - TYPE(pw_c1d_type), POINTER :: rho0_s_gs, rho_core + TYPE(pw_c1d_gs_type), POINTER :: rho0_s_gs, rho_core TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_p_type), DIMENSION(:), POINTER :: pw_pools TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: vdip_r, wf_r - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r - TYPE(pw_r3d_type), POINTER :: v_hartree_rspace + TYPE(pw_r3d_rs_type) :: vdip_r, wf_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), POINTER :: v_hartree_rspace TYPE(qs_rho_type), POINTER :: rho TYPE(qs_subsys_type), POINTER :: subsys @@ -99,8 +98,8 @@ SUBROUTINE calc_dipsurf_potential(qs_env, energy) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, & pw_pools=pw_pools) - CALL auxbas_pw_pool%create_pw(wf_r, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(vdip_r, in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(wf_r) + CALL auxbas_pw_pool%create_pw(vdip_r) IF (dft_control%qs_control%gapw) THEN IF (dft_control%qs_control%gapw_control%nopaw_as_gpw) THEN diff --git a/src/tip_scan_methods.F b/src/tip_scan_methods.F index 0dd99e1ce1..203632ddb1 100644 --- a/src/tip_scan_methods.F +++ b/src/tip_scan_methods.F @@ -31,10 +31,8 @@ MODULE tip_scan_methods pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_ks_types, ONLY: qs_ks_env_type,& @@ -84,10 +82,10 @@ SUBROUTINE tip_scanning(qs_env, input_section) TYPE(dft_control_type), POINTER :: dft_control TYPE(mo_set_type), ALLOCATABLE, DIMENSION(:) :: mos_ref TYPE(mo_set_type), DIMENSION(:), POINTER :: mos - TYPE(pw_c1d_type) :: sf, vref + TYPE(pw_c1d_gs_type) :: sf, vref TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type), POINTER :: vee, vtip + TYPE(pw_r3d_rs_type), POINTER :: vee, vtip TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(scanning_type) :: scan_env @@ -126,11 +124,11 @@ SUBROUTINE tip_scanning(qs_env, input_section) CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool) NULLIFY (vtip) ALLOCATE (vtip) - CALL auxbas_pw_pool%create_pw(vtip, REALSPACE) + CALL auxbas_pw_pool%create_pw(vtip) CALL pw_zero(vtip) - CALL auxbas_pw_pool%create_pw(vref, RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(vref) CALL pw_zero(vref) - CALL auxbas_pw_pool%create_pw(sf, RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(sf) ! get the reference tip potential and store it in reciprocal space (vref) CALL pw_transfer(scan_env%tip_pw_g, vref) @@ -225,8 +223,8 @@ END SUBROUTINE tip_scanning ! ************************************************************************************************** SUBROUTINE shift_tip_potential(vref, sf, vtip, rpos) - TYPE(pw_c1d_type), INTENT(INOUT) :: vref, sf - TYPE(pw_r3d_type), INTENT(INOUT) :: vtip + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: vref, sf + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vtip REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: rpos CHARACTER(LEN=*), PARAMETER :: routineN = 'shift_tip_potential' @@ -292,12 +290,12 @@ SUBROUTINE read_tip_file(qs_env, scan_env) NULLIFY (pw_grid) CALL pw_grid_create(pw_grid, para_env) CALL pw_grid_setup(dcell, pw_grid, npts=npts) - CALL scan_env%tip_pw_r%create(pw_grid, in_space=REALSPACE) + CALL scan_env%tip_pw_r%create(pw_grid) !deb scaling = 0.1_dp !deb CALL cp_cube_to_pw(scan_env%tip_pw_r, scan_env%tip_cube_file, scaling, silent=.TRUE.) - CALL scan_env%tip_pw_g%create(pw_grid, in_space=RECIPROCALSPACE) + CALL scan_env%tip_pw_g%create(pw_grid) CALL pw_transfer(scan_env%tip_pw_r, scan_env%tip_pw_g) CALL pw_grid_release(pw_grid) diff --git a/src/tip_scan_types.F b/src/tip_scan_types.F index 4f4abf3f78..bc07c3b07b 100644 --- a/src/tip_scan_types.F +++ b/src/tip_scan_types.F @@ -10,8 +10,8 @@ MODULE tip_scan_types section_vals_val_get USE kinds, ONLY: default_string_length,& dp - USE pw_types, ONLY: pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type #include "./base/base_uses.f90" IMPLICIT NONE @@ -29,8 +29,8 @@ MODULE tip_scan_types REAL(KIND=dp), DIMENSION(:, :), & ALLOCATABLE :: tip_pos CHARACTER(LEN=default_string_length) :: tip_cube_file - TYPE(pw_r3d_type), POINTER :: tip_pw_r - TYPE(pw_c1d_type), POINTER :: tip_pw_g + TYPE(pw_r3d_rs_type), POINTER :: tip_pw_r + TYPE(pw_c1d_gs_type), POINTER :: tip_pw_g END TYPE scanning_type ! ************************************************************************************************** diff --git a/src/transport.F b/src/transport.F index 43dc102f3b..8778311d85 100644 --- a/src/transport.F +++ b/src/transport.F @@ -62,10 +62,8 @@ MODULE transport pw_env_type USE pw_methods, ONLY: pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type,& set_qs_env @@ -653,12 +651,12 @@ SUBROUTINE transport_current(input, qs_env) TYPE(dbcsr_type), POINTER :: zero TYPE(dft_control_type), POINTER :: dft_control TYPE(particle_list_type), POINTER :: particles - TYPE(pw_c1d_type) :: gs - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type) :: gs + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: rs - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type) :: rs + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_rho_type), POINTER :: rho TYPE(qs_subsys_type), POINTER :: subsys TYPE(section_vals_type), POINTER :: dft_section @@ -695,8 +693,8 @@ SUBROUTINE transport_current(input, qs_env) current_env%gauge = -1 current_env%gauge_init = .FALSE. - CALL auxbas_pw_pool%create_pw(rs, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(gs, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(rs) + CALL auxbas_pw_pool%create_pw(gs) NULLIFY (zero) ALLOCATE (zero) diff --git a/src/voronoi_interface.F b/src/voronoi_interface.F index a3ae5f66f6..8a8455d0f6 100644 --- a/src/voronoi_interface.F +++ b/src/voronoi_interface.F @@ -21,7 +21,7 @@ MODULE voronoi_interface Brehm2021, cite_reference USE kinds, ONLY: dp, default_path_length USE cell_types, ONLY: cell_type, pbc - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE physcon, ONLY: bohr, debye USE mathconstants, ONLY: fourpi USE orbital_pointers, ONLY: indco @@ -316,7 +316,7 @@ SUBROUTINE entry_voronoi_or_bqb(do_voro, do_bqb, input_voro, input_bqb, unit_vor TYPE(section_vals_type), POINTER :: input_voro, input_bqb INTEGER, INTENT(IN) :: unit_voro TYPE(qs_environment_type), POINTER :: qs_env - TYPE(pw_r3d_type) :: rspace_pw + TYPE(pw_r3d_rs_type) :: rspace_pw #if defined(__LIBVORI) diff --git a/src/xc/xc.F b/src/xc/xc.F index 0e438c4e4e..dfd95b7098 100644 --- a/src/xc/xc.F +++ b/src/xc/xc.F @@ -44,9 +44,7 @@ MODULE xc USE pw_pool_types, ONLY: & pw_pool_type USE pw_types, ONLY: & - REALSPACE, & - RECIPROCALSPACE, & - pw_c1d_type, pw_r3d_type + pw_c1d_gs_type, pw_r3d_rs_type USE xc_derivative_desc, ONLY: & deriv_rho, deriv_rhoa, deriv_rhob, & deriv_norm_drhoa, deriv_norm_drhob, deriv_norm_drho, deriv_tau_a, deriv_tau_b, deriv_tau, & @@ -150,15 +148,15 @@ FUNCTION xc_uses_norm_drho(xc_fun_section, lsd) RESULT(res) ! ************************************************************************************************** SUBROUTINE xc_vxc_pw_create1(vxc_rho, vxc_tau, rho_r, rho_g, tau, exc, xc_section, & pw_pool, compute_virial, virial_xc, exc_r) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g REAL(KIND=dp), INTENT(out) :: exc TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: pw_pool LOGICAL, INTENT(IN) :: compute_virial REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT) :: virial_xc - TYPE(pw_r3d_type), INTENT(INOUT), OPTIONAL :: exc_r + TYPE(pw_r3d_rs_type), INTENT(INOUT), OPTIONAL :: exc_r INTEGER :: f_routine @@ -214,9 +212,9 @@ END SUBROUTINE xc_vxc_pw_create1 ! ************************************************************************************************** SUBROUTINE xc_vxc_pw_create_test_lsd(vxc_rho, vxc_tau, rho_r, rho_g, tau, & exc, xc_section, pw_pool) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g REAL(KIND=dp), INTENT(out) :: exc TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: pw_pool @@ -231,9 +229,9 @@ SUBROUTINE xc_vxc_pw_create_test_lsd(vxc_rho, vxc_tau, rho_r, rho_g, tau, & REAL(KIND=dp), DIMENSION(3, 3) :: virial_xc REAL(kind=dp), DIMENSION(:, :, :), POINTER :: pot, pot2, pot3 TYPE(cp_sll_xc_deriv_type), POINTER :: deriv_iter - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho2, vxc_tau2 - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho2_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho2_r, tau2 + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho2, vxc_tau2 + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho2_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho2_r, tau2 TYPE(xc_derivative_set_type) :: dSet1, dSet2 TYPE(xc_derivative_type), POINTER :: deriv, deriv2, deriv3 TYPE(xc_rho_set_type) :: rho_set1, rho_set2 @@ -245,7 +243,7 @@ SUBROUTINE xc_vxc_pw_create_test_lsd(vxc_rho, vxc_tau, rho_r, rho_g, tau, & ALLOCATE (rho2_r(2)) DO ispin = 1, 2 - CALL pw_pool%create_pw(rho2_r(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(rho2_r(ispin)) END DO DO k = bo(1, 3), bo(2, 3) DO j = bo(1, 2), bo(2, 2) @@ -260,7 +258,7 @@ SUBROUTINE xc_vxc_pw_create_test_lsd(vxc_rho, vxc_tau, rho_r, rho_g, tau, & IF (ASSOCIATED(tau)) THEN ALLOCATE (tau2(2)) DO ispin = 1, 2 - CALL pw_pool%create_pw(tau2(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(tau2(ispin)) END DO DO k = bo(1, 3), bo(2, 3) @@ -551,9 +549,9 @@ END SUBROUTINE xc_vxc_pw_create_test_lsd ! ************************************************************************************************** SUBROUTINE xc_vxc_pw_create_debug(vxc_rho, vxc_tau, rho_r, rho_g, tau, exc, & xc_section, pw_pool) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g REAL(KIND=dp), INTENT(out) :: exc TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: pw_pool @@ -845,8 +843,8 @@ SUBROUTINE xc_rho_set_and_dset_create(rho_set, deriv_set, deriv_order, & TYPE(xc_rho_set_type) :: rho_set TYPE(xc_derivative_set_type) :: deriv_set INTEGER, INTENT(in) :: deriv_order - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: pw_pool LOGICAL, INTENT(in) :: calc_potential @@ -1062,8 +1060,8 @@ SUBROUTINE smooth_cutoff(pot, rho, rhoa, rhob, rho_cutoff, & END SUBROUTINE smooth_cutoff SUBROUTINE calc_xc_density(pot, rho, rho_cutoff) - TYPE(pw_r3d_type), INTENT(INOUT) :: pot - TYPE(pw_r3d_type), DIMENSION(:), INTENT(INOUT) :: rho + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pot + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(INOUT) :: rho REAL(kind=dp), INTENT(in) :: rho_cutoff INTEGER :: i, j, k, nspins @@ -1133,15 +1131,15 @@ END SUBROUTINE calc_xc_density ! ************************************************************************************************** SUBROUTINE xc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section, & pw_pool, compute_virial, virial_xc, exc_r) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau REAL(KIND=dp), INTENT(out) :: exc - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: pw_pool LOGICAL :: compute_virial REAL(KIND=dp), DIMENSION(3, 3), INTENT(OUT) :: virial_xc - TYPE(pw_r3d_type), INTENT(INOUT), OPTIONAL :: exc_r + TYPE(pw_r3d_rs_type), INTENT(INOUT), OPTIONAL :: exc_r CHARACTER(len=*), PARAMETER :: routineN = 'xc_vxc_pw_create' INTEGER, DIMENSION(2), PARAMETER :: norm_drho_spin_name = [deriv_norm_drhoa, deriv_norm_drhob] @@ -1159,9 +1157,9 @@ SUBROUTINE xc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section rho, rhoa, rhob TYPE(cp_sll_xc_deriv_type), POINTER :: pos TYPE(pw_grid_type), POINTER :: pw_grid - TYPE(pw_r3d_type), DIMENSION(3) :: pw_to_deriv, pw_to_deriv_rho - TYPE(pw_c1d_type) :: tmp_g, vxc_g - TYPE(pw_r3d_type) :: v_drho_r, virial_pw + TYPE(pw_r3d_rs_type), DIMENSION(3) :: pw_to_deriv, pw_to_deriv_rho + TYPE(pw_c1d_gs_type) :: tmp_g, vxc_g + TYPE(pw_r3d_rs_type) :: v_drho_r, virial_pw TYPE(xc_derivative_set_type) :: deriv_set TYPE(xc_derivative_type), POINTER :: deriv_att TYPE(xc_rho_set_type) :: rho_set @@ -1234,7 +1232,7 @@ SUBROUTINE xc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section CPASSERT(ASSOCIATED(deriv_data)) IF (use_virial) THEN - CALL pw_pool%create_pw(virial_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(virial_pw) CALL pw_zero(virial_pw) DO idir = 1, 3 !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(virial_pw,pw_to_deriv_rho,deriv_data,idir) @@ -1262,11 +1260,9 @@ SUBROUTINE xc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section END IF IF ((has_gradient .AND. xc_requires_tmp_g(xc_deriv_method_id)) .OR. pw_grid%spherical) THEN - CALL pw_pool%create_pw(vxc_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(vxc_g) IF (.NOT. pw_grid%spherical) THEN - CALL pw_pool%create_pw(tmp_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(tmp_g) END IF END IF @@ -1291,7 +1287,7 @@ SUBROUTINE xc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section CALL xc_derivative_get(deriv_att, deriv_data=deriv_data) IF (use_virial) THEN - CALL pw_pool%create_pw(virial_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(virial_pw) CALL pw_zero(virial_pw) DO idir = 1, 3 !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(deriv_data,pw_to_deriv,virial_pw,idir) @@ -1383,8 +1379,7 @@ SUBROUTINE xc_vxc_pw_create(vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section rho_smooth_cutoff_range=density_smooth_cut_range) v_drho_r = vxc_rho(ispin) - CALL pw_pool%create_pw(vxc_rho(ispin), & - in_space=REALSPACE) + CALL pw_pool%create_pw(vxc_rho(ispin)) CALL xc_pw_smooth(v_drho_r, vxc_rho(ispin), xc_rho_smooth_id) CALL pw_pool%give_back_pw(v_drho_r) END DO @@ -1452,8 +1447,8 @@ END SUBROUTINE xc_vxc_pw_create ! ************************************************************************************************** FUNCTION xc_exc_calc(rho_r, rho_g, tau, xc_section, pw_pool) & RESULT(exc) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(section_vals_type), POINTER :: xc_section TYPE(pw_pool_type), POINTER :: pw_pool REAL(kind=dp) :: exc @@ -1527,11 +1522,11 @@ SUBROUTINE xc_calc_2nd_deriv(v_xc, v_xc_tau, deriv_set, rho_set, rho1_r, rho1_g, lsd_singlets, do_excitations, do_triplet, do_tddft, & compute_virial, virial_xc) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_xc, v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_xc, v_xc_tau TYPE(xc_derivative_set_type) :: deriv_set TYPE(xc_rho_set_type) :: rho_set - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho1_r, tau1_r - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho1_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho1_r, tau1_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho1_g TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(section_vals_type), INTENT(IN), POINTER :: xc_section LOGICAL, INTENT(IN) :: gapw @@ -1581,7 +1576,7 @@ SUBROUTINE xc_calc_2nd_deriv(v_xc, v_xc_tau, deriv_set, rho_set, rho1_r, rho1_g, NULLIFY (v_xc, v_xc_tau) ALLOCATE (v_xc(nspins)) DO ispin = 1, nspins - CALL pw_pool%create_pw(v_xc(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(v_xc(ispin)) CALL pw_zero(v_xc(ispin)) END DO @@ -1593,7 +1588,7 @@ SUBROUTINE xc_calc_2nd_deriv(v_xc, v_xc_tau, deriv_set, rho_set, rho1_r, rho1_g, CPABORT("Tau-dependent functionals requires allocated kinetic energy density grid") ALLOCATE (v_xc_tau(nspins)) DO ispin = 1, nspins - CALL pw_pool%create_pw(v_xc_tau(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(v_xc_tau(ispin)) CALL pw_zero(v_xc_tau(ispin)) END DO END IF @@ -1659,10 +1654,10 @@ SUBROUTINE xc_calc_2nd_deriv_numerical(v_xc, v_tau, rho_set, rho1_r, rho1_g, tau pw_pool, xc_section, & do_triplet, calc_virial, virial_xc, deriv_set) - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN), POINTER :: v_xc, v_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN), POINTER :: v_xc, v_tau TYPE(xc_rho_set_type), INTENT(IN) :: rho_set - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN), POINTER :: rho1_r, tau1_r - TYPE(pw_c1d_type), DIMENSION(:), INTENT(IN), POINTER :: rho1_g + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN), POINTER :: rho1_r, tau1_r + TYPE(pw_c1d_gs_type), DIMENSION(:), INTENT(IN), POINTER :: rho1_g TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(section_vals_type), INTENT(IN), POINTER :: xc_section LOGICAL, INTENT(IN) :: do_triplet @@ -1691,11 +1686,11 @@ SUBROUTINE xc_calc_2nd_deriv_numerical(v_xc, v_tau, rho_set, rho1_r, rho1_g, tau laplacea, laplaceb, laplace1a, laplace1b, & laplace2, laplace2a, laplace2b, deriv_data TYPE(cp_3d_r_cp_type), DIMENSION(3) :: drho, drho1, drho1a, drho1b, drhoa, drhob - TYPE(pw_r3d_type) :: v_drho, v_drhoa, v_drhob - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, tau_r - TYPE(pw_r3d_type) :: virial_pw, v_laplace, v_laplacea, v_laplaceb + TYPE(pw_r3d_rs_type) :: v_drho, v_drhoa, v_drhob + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_rho, vxc_tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, tau_r + TYPE(pw_r3d_rs_type) :: virial_pw, v_laplace, v_laplacea, v_laplaceb TYPE(section_vals_type), POINTER :: xc_fun_section TYPE(xc_derivative_set_type) :: deriv_set1 TYPE(xc_rho_cflags_type) :: needs @@ -1720,12 +1715,12 @@ SUBROUTINE xc_calc_2nd_deriv_numerical(v_xc, v_tau, rho_set, rho1_r, rho1_g, tau NULLIFY (vxc_rho, rho_g, vxc_tau) ALLOCATE (rho_r(2)) DO ispin = 1, nspins - CALL pw_pool%create_pw(rho_r(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(rho_r(ispin)) END DO IF (ASSOCIATED(tau1_r) .AND. ASSOCIATED(v_tau)) THEN ALLOCATE (tau_r(2)) DO ispin = 1, nspins - CALL pw_pool%create_pw(tau_r(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(tau_r(ispin)) END DO END IF CALL xc_rho_set_get(rho_set, can_return_null=.TRUE., rhoa=rhoa, rhob=rhob, tau_a=tau_a, tau_b=tau_b) @@ -1756,12 +1751,12 @@ SUBROUTINE xc_calc_2nd_deriv_numerical(v_xc, v_tau, rho_set, rho1_r, rho1_g, tau NULLIFY (vxc_rho, vxc_tau, rho_g) ALLOCATE (rho_r(2)) DO ispin = 1, 2 - CALL pw_pool%create_pw(rho_r(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(rho_r(ispin)) END DO IF (ASSOCIATED(tau1_r) .AND. ASSOCIATED(v_tau)) THEN ALLOCATE (tau_r(2)) DO ispin = 1, nspins - CALL pw_pool%create_pw(tau_r(ispin), in_space=REALSPACE) + CALL pw_pool%create_pw(tau_r(ispin)) END DO END IF CALL xc_rho_set_get(rho_set, can_return_null=.TRUE., rhoa=rhoa, rhob=rhob, tau_a=tau_a, tau_b=tau_b) @@ -1839,10 +1834,10 @@ SUBROUTINE xc_calc_2nd_deriv_numerical(v_xc, v_tau, rho_set, rho1_r, rho1_g, tau ELSE NULLIFY (vxc_rho, rho_r, rho_g, vxc_tau, tau_r, tau) ALLOCATE (rho_r(1)) - CALL pw_pool%create_pw(rho_r(1), in_space=REALSPACE) + CALL pw_pool%create_pw(rho_r(1)) IF (ASSOCIATED(tau1_r) .AND. ASSOCIATED(v_tau)) THEN ALLOCATE (tau_r(1)) - CALL pw_pool%create_pw(tau_r(1), in_space=REALSPACE) + CALL pw_pool%create_pw(tau_r(1)) END IF CALL xc_rho_set_get(rho_set, can_return_null=.TRUE., rho=rho, tau=tau) DO istep = -nsteps, nsteps @@ -2295,16 +2290,16 @@ SUBROUTINE calc_resp_potential_numer_ab(rho_r, rho_g, rho1_r, rhoa, rhob, vxc_rh tau_r, tau1_r, tau_a, tau_b, vxc_tau, & xc_section, pw_pool, step) - TYPE(pw_r3d_type), DIMENSION(:), POINTER, INTENT(IN) :: vxc_rho, vxc_tau - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: rho1_r - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN), POINTER :: tau1_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER, INTENT(IN) :: vxc_rho, vxc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: rho1_r + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN), POINTER :: tau1_r TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool TYPE(section_vals_type), INTENT(IN), POINTER :: xc_section REAL(KIND=dp), INTENT(IN) :: step REAL(KIND=dp), DIMENSION(:, :, :), POINTER, INTENT(IN) :: rhoa, rhob, tau_a, tau_b - TYPE(pw_r3d_type), DIMENSION(:), POINTER, INTENT(IN) :: rho_r - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: tau_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER, INTENT(IN) :: rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: tau_r CHARACTER(len=*), PARAMETER :: routineN = 'calc_resp_potential_numer_ab' @@ -2354,7 +2349,7 @@ SUBROUTINE apply_drho(deriv_set, description, virial_pw, drho, drho1, virial_xc, TYPE(xc_derivative_set_type), INTENT(IN) :: deriv_set INTEGER, DIMENSION(:), INTENT(in) :: description - TYPE(pw_r3d_type), INTENT(IN) :: virial_pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: virial_pw TYPE(cp_3d_r_cp_type), DIMENSION(3), INTENT(IN) :: drho, drho1 REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: virial_xc REAL(KIND=dp), DIMENSION(:, :, :), INTENT(IN) :: norm_drho @@ -2639,7 +2634,7 @@ SUBROUTINE xc_calc_2nd_deriv_analytical(v_xc, v_xc_tau, deriv_set, rho_set, rho1 pw_pool, xc_section, gapw, vxg, tddfpt_fac, & compute_virial, virial_xc) - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_xc, v_xc_tau + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_xc, v_xc_tau TYPE(xc_derivative_set_type) :: deriv_set TYPE(xc_rho_set_type), INTENT(IN) :: rho_set, rho1_set TYPE(pw_pool_type), POINTER :: pw_pool @@ -2667,10 +2662,10 @@ SUBROUTINE xc_calc_2nd_deriv_analytical(v_xc, v_xc_tau, deriv_set, rho_set, rho1 tau1, tau1a, tau1b, laplace1, laplace1a, laplace1b, & rho, rhoa, rhob TYPE(cp_3d_r_cp_type), DIMENSION(3) :: drho, drho1, drho1a, drho1b, drhoa, drhob - TYPE(pw_r3d_type), DIMENSION(:), ALLOCATABLE :: v_drhoa, v_drhob, v_drho, v_laplace - TYPE(pw_r3d_type), DIMENSION(:, :), ALLOCATABLE :: v_drho_r - TYPE(pw_r3d_type) :: virial_pw - TYPE(pw_c1d_type) :: tmp_g, vxc_g + TYPE(pw_r3d_rs_type), DIMENSION(:), ALLOCATABLE :: v_drhoa, v_drhob, v_drho, v_laplace + TYPE(pw_r3d_rs_type), DIMENSION(:, :), ALLOCATABLE :: v_drho_r + TYPE(pw_r3d_rs_type) :: virial_pw + TYPE(pw_c1d_gs_type) :: tmp_g, vxc_g TYPE(xc_derivative_type), POINTER :: deriv_att CALL timeset(routineN, handle) @@ -2721,10 +2716,8 @@ SUBROUTINE xc_calc_2nd_deriv_analytical(v_xc, v_xc_tau, deriv_set, rho_set, rho1 IF (xc_requires_tmp_g(xc_deriv_method_id) .AND. .NOT. my_gapw) THEN IF (ASSOCIATED(pw_pool)) THEN - CALL pw_pool%create_pw(tmp_g, & - in_space=RECIPROCALSPACE) - CALL pw_pool%create_pw(vxc_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(tmp_g) + CALL pw_pool%create_pw(vxc_g) ELSE ! remember to refix for gapw CPABORT("XC_DERIV method is not implemented in GAPW") @@ -3059,18 +3052,16 @@ END SUBROUTINE xc_calc_2nd_deriv_analytical !> \param bo ... ! ************************************************************************************************** SUBROUTINE allocate_pw(pw, pw_pool, bo) - TYPE(pw_r3d_type), INTENT(OUT) :: pw + TYPE(pw_r3d_rs_type), INTENT(OUT) :: pw TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool INTEGER, DIMENSION(2, 3), INTENT(IN) :: bo IF (ASSOCIATED(pw_pool)) THEN - CALL pw_pool%create_pw(pw, & - in_space=REALSPACE) + CALL pw_pool%create_pw(pw) CALL pw_zero(pw) ELSE ALLOCATE (pw%array(bo(1, 1):bo(2, 1), bo(1, 2):bo(2, 2), bo(1, 3):bo(2, 3))) pw%array = 0.0_dp - pw%in_space = REALSPACE END IF END SUBROUTINE allocate_pw @@ -3081,7 +3072,7 @@ END SUBROUTINE allocate_pw !> \param pw_pool ... ! ************************************************************************************************** SUBROUTINE deallocate_pw(pw, pw_pool) - TYPE(pw_r3d_type), INTENT(INOUT) :: pw + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool IF (ASSOCIATED(pw_pool)) THEN @@ -3101,7 +3092,7 @@ END SUBROUTINE deallocate_pw !> \param virial_xc ... ! ************************************************************************************************** SUBROUTINE virial_drho_drho1(virial_pw, drho, drho1, deriv_data, virial_xc) - TYPE(pw_r3d_type), INTENT(IN) :: virial_pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: virial_pw TYPE(cp_3d_r_cp_type), DIMENSION(3), INTENT(IN) :: drho, drho1 REAL(KIND=dp), DIMENSION(:, :, :), INTENT(IN) :: deriv_data REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: virial_xc @@ -3132,9 +3123,9 @@ END SUBROUTINE virial_drho_drho1 !> \param virial_xc ... ! ************************************************************************************************** SUBROUTINE virial_drho_drho(virial_pw, drho, v_drho, virial_xc) - TYPE(pw_r3d_type), INTENT(IN) :: virial_pw + TYPE(pw_r3d_rs_type), INTENT(IN) :: virial_pw TYPE(cp_3d_r_cp_type), DIMENSION(3), INTENT(IN) :: drho - TYPE(pw_r3d_type), INTENT(IN) :: v_drho + TYPE(pw_r3d_rs_type), INTENT(IN) :: v_drho REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: virial_xc INTEGER :: idir, jdir @@ -3163,7 +3154,7 @@ END SUBROUTINE virial_drho_drho !> \param deriv_data ... ! ************************************************************************************************** SUBROUTINE virial_laplace(rho_r, pw_pool, virial_xc, deriv_data) - TYPE(pw_r3d_type), TARGET :: rho_r + TYPE(pw_r3d_rs_type), TARGET :: rho_r TYPE(pw_pool_type), POINTER, INTENT(IN) :: pw_pool REAL(KIND=dp), DIMENSION(3, 3), INTENT(INOUT) :: virial_xc REAL(KIND=dp), DIMENSION(:, :, :), INTENT(IN) :: deriv_data @@ -3171,17 +3162,17 @@ SUBROUTINE virial_laplace(rho_r, pw_pool, virial_xc, deriv_data) CHARACTER(len=*), PARAMETER :: routineN = 'virial_laplace' INTEGER :: handle, idir, jdir - TYPE(pw_r3d_type), POINTER :: virial_pw - TYPE(pw_c1d_type), POINTER :: tmp_g, rho_g + TYPE(pw_r3d_rs_type), POINTER :: virial_pw + TYPE(pw_c1d_gs_type), POINTER :: tmp_g, rho_g INTEGER, DIMENSION(3) :: my_deriv CALL timeset(routineN, handle) NULLIFY (virial_pw, tmp_g, rho_g) ALLOCATE (virial_pw, tmp_g, rho_g) - CALL pw_pool%create_pw(virial_pw, in_space=REALSPACE) - CALL pw_pool%create_pw(tmp_g, in_space=RECIPROCALSPACE) - CALL pw_pool%create_pw(rho_g, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(virial_pw) + CALL pw_pool%create_pw(tmp_g) + CALL pw_pool%create_pw(rho_g) CALL pw_zero(virial_pw) CALL pw_transfer(rho_r, rho_g) DO idir = 1, 3 @@ -3225,17 +3216,17 @@ SUBROUTINE xc_prep_2nd_deriv(deriv_set, & TYPE(xc_derivative_set_type) :: deriv_set TYPE(xc_rho_set_type) :: rho_set - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(pw_pool_type), POINTER :: pw_pool TYPE(section_vals_type), POINTER :: xc_section - TYPE(pw_r3d_type), DIMENSION(:), OPTIONAL, POINTER :: tau_r + TYPE(pw_r3d_rs_type), DIMENSION(:), OPTIONAL, POINTER :: tau_r CHARACTER(len=*), PARAMETER :: routineN = 'xc_prep_2nd_deriv' INTEGER :: handle, nspins LOGICAL :: lsd - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: tau + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: tau CALL timeset(routineN, handle) diff --git a/src/xc/xc_atom.F b/src/xc/xc_atom.F index 0d2f8cae2e..4ca46805b9 100644 --- a/src/xc/xc_atom.F +++ b/src/xc/xc_atom.F @@ -14,7 +14,7 @@ MODULE xc_atom section_vals_type USE kinds, ONLY: dp USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE xc, ONLY: divide_by_norm_drho,& xc_calc_2nd_deriv_analytical USE xc_derivative_desc, ONLY: & @@ -365,7 +365,7 @@ SUBROUTINE xc_2nd_deriv_of_r(rho_set, rho1_set, xc_section, & REAL(dp) :: drho_cutoff, my_fac_triplet TYPE(cp_sll_xc_deriv_type), POINTER :: pos TYPE(pw_pool_type), POINTER :: pw_pool - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: vxc_pw, vxc_tau_pw + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: vxc_pw, vxc_tau_pw TYPE(section_vals_type), POINTER :: xc_fun_section TYPE(xc_derivative_type), POINTER :: deriv_att diff --git a/src/xc/xc_b97_fxc.F b/src/xc/xc_b97_fxc.F index c1cbeb8c7e..9014d85be5 100644 --- a/src/xc/xc_b97_fxc.F +++ b/src/xc/xc_b97_fxc.F @@ -11,7 +11,7 @@ ! ************************************************************************************************** MODULE xc_b97_fxc USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type #include "../base/base_uses.f90" IMPLICIT NONE @@ -31,8 +31,8 @@ MODULE xc_b97_fxc !> \param eps_rho ... ! ************************************************************************************************** SUBROUTINE b97_fxc_eval(rhos, norm_drhos, fxc, gx, cx, eps_rho) - TYPE(pw_r3d_type), INTENT(IN) :: rhos, norm_drhos - TYPE(pw_r3d_type), INTENT(INOUT) :: fxc + TYPE(pw_r3d_rs_type), INTENT(IN) :: rhos, norm_drhos + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: fxc REAL(KIND=dp), INTENT(IN) :: gx REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: cx REAL(KIND=dp), INTENT(IN) :: eps_rho @@ -85,8 +85,8 @@ END SUBROUTINE b97_fxc_eval !> \param eps_rho ... ! ************************************************************************************************** SUBROUTINE b97_fcc_eval(rhoa, rhob, norm_drhoa, norm_drhob, fcc, gcc, cco, eps_rho) - TYPE(pw_r3d_type), INTENT(IN) :: rhoa, rhob, norm_drhoa, norm_drhob - TYPE(pw_r3d_type), INTENT(INOUT) :: fcc + TYPE(pw_r3d_rs_type), INTENT(IN) :: rhoa, rhob, norm_drhoa, norm_drhob + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: fcc REAL(KIND=dp), INTENT(IN) :: gcc REAL(KIND=dp), DIMENSION(:), INTENT(IN) :: cco REAL(KIND=dp), INTENT(IN) :: eps_rho diff --git a/src/xc/xc_derivative_set_types.F b/src/xc/xc_derivative_set_types.F index abd33ad65d..cfa98bbd11 100644 --- a/src/xc/xc_derivative_set_types.F +++ b/src/xc/xc_derivative_set_types.F @@ -25,8 +25,7 @@ MODULE xc_derivative_set_types USE pw_pool_types, ONLY: pw_pool_create,& pw_pool_release,& pw_pool_type - USE pw_types, ONLY: REALSPACE,& - pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE xc_derivative_desc, ONLY: standardize_desc USE xc_derivative_types, ONLY: xc_derivative_create,& xc_derivative_release,& @@ -183,8 +182,8 @@ SUBROUTINE xc_dset_zero_all(deriv_set) END SUBROUTINE xc_dset_zero_all ! ************************************************************************************************** -!> \brief Recovers a derivative on a pw_r3d_type, the caller is responsible to release the grid later -!> If the derivative is not found, either creates a blank pw_r3d_type from pw_pool or leaves it unassociated +!> \brief Recovers a derivative on a pw_r3d_rs_type, the caller is responsible to release the grid later +!> If the derivative is not found, either creates a blank pw_r3d_rs_type from pw_pool or leaves it unassociated !> \param deriv_set ... !> \param description ... !> \param pw ... @@ -194,7 +193,7 @@ END SUBROUTINE xc_dset_zero_all SUBROUTINE xc_dset_recover_pw(deriv_set, description, pw, pw_grid, pw_pool) TYPE(xc_derivative_set_type), INTENT(IN) :: deriv_set INTEGER, DIMENSION(:), INTENT(IN) :: description - TYPE(pw_r3d_type), INTENT(OUT) :: pw + TYPE(pw_r3d_rs_type), INTENT(OUT) :: pw TYPE(pw_grid_type), INTENT(IN), POINTER :: pw_grid TYPE(pw_pool_type), INTENT(IN), OPTIONAL, POINTER :: pw_pool @@ -202,11 +201,10 @@ SUBROUTINE xc_dset_recover_pw(deriv_set, description, pw, pw_grid, pw_pool) deriv_att => xc_dset_get_derivative(deriv_set, description) IF (ASSOCIATED(deriv_att)) THEN - CALL pw%create(pw_grid=pw_grid, array_ptr=deriv_att%deriv_data, & - in_space=REALSPACE) + CALL pw%create(pw_grid=pw_grid, array_ptr=deriv_att%deriv_data) NULLIFY (deriv_att%deriv_data) ELSE IF (PRESENT(pw_pool)) THEN - CALL pw_pool%create_pw(pw, in_space=REALSPACE) + CALL pw_pool%create_pw(pw) CALL pw_zero(pw) END IF diff --git a/src/xc/xc_fxc_kernel.F b/src/xc/xc_fxc_kernel.F index ab10a2ab82..850dad48ff 100644 --- a/src/xc/xc_fxc_kernel.F +++ b/src/xc/xc_fxc_kernel.F @@ -18,10 +18,8 @@ MODULE xc_fxc_kernel pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE xc_b97_fxc, ONLY: b97_fcc_eval,& b97_fxc_eval USE xc_input_constants, ONLY: xc_deriv_pw @@ -56,9 +54,9 @@ MODULE xc_fxc_kernel !> \author JGH ! ************************************************************************************************** SUBROUTINE calc_fxc_kernel(fxc_rspace, rho_r, rho_g, tau_r, xc_kernel, triplet, pw_pool) - TYPE(pw_r3d_type), DIMENSION(:) :: fxc_rspace, rho_r - TYPE(pw_c1d_type), DIMENSION(:) :: rho_g - TYPE(pw_r3d_type), DIMENSION(:) :: tau_r + TYPE(pw_r3d_rs_type), DIMENSION(:) :: fxc_rspace, rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:) :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:) :: tau_r TYPE(section_vals_type), POINTER :: xc_kernel LOGICAL, INTENT(IN) :: triplet TYPE(pw_pool_type), POINTER :: pw_pool @@ -73,10 +71,10 @@ SUBROUTINE calc_fxc_kernel(fxc_rspace, rho_r, rho_g, tau_r, xc_kernel, triplet, REAL(KIND=dp) :: scalec, scalex REAL(KIND=dp), DIMENSION(3) :: ccaa, ccab, cxaa, g_ab REAL(KIND=dp), DIMENSION(:), POINTER :: rvals - TYPE(pw_c1d_type) :: rhog, tmpg - TYPE(pw_r3d_type) :: fxa, fxb, norm_drhoa, norm_drhob, rhoa, & + TYPE(pw_c1d_gs_type) :: rhog, tmpg + TYPE(pw_r3d_rs_type) :: fxa, fxb, norm_drhoa, norm_drhob, rhoa, & rhob - TYPE(pw_r3d_type), DIMENSION(3) :: drhoa + TYPE(pw_r3d_rs_type), DIMENSION(3) :: drhoa TYPE(xc_rho_cflags_type) :: needs CPASSERT(ASSOCIATED(xc_kernel)) @@ -97,8 +95,8 @@ SUBROUTINE calc_fxc_kernel(fxc_rspace, rho_r, rho_g, tau_r, xc_kernel, triplet, CALL xc_rho_cflags_setall(needs, .FALSE.) CALL fxc_kernel_info(fxc_name, needs, lsd) - CALL pw_pool%create_pw(rhoa, in_space=REALSPACE) - CALL pw_pool%create_pw(rhob, in_space=REALSPACE) + CALL pw_pool%create_pw(rhoa) + CALL pw_pool%create_pw(rhob) IF (lsd) THEN CALL pw_copy(rho_r(1), rhoa) CALL pw_copy(rho_r(2), rhob) @@ -114,12 +112,12 @@ SUBROUTINE calc_fxc_kernel(fxc_rspace, rho_r, rho_g, tau_r, xc_kernel, triplet, IF (needs%norm_drho) THEN ! deriv rho DO idir = 1, 3 - CALL pw_pool%create_pw(drhoa(idir), in_space=REALSPACE) + CALL pw_pool%create_pw(drhoa(idir)) END DO - CALL pw_pool%create_pw(norm_drhoa, in_space=REALSPACE) - CALL pw_pool%create_pw(norm_drhob, in_space=REALSPACE) - CALL pw_pool%create_pw(rhog, in_space=RECIPROCALSPACE) - CALL pw_pool%create_pw(tmpg, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(norm_drhoa) + CALL pw_pool%create_pw(norm_drhob) + CALL pw_pool%create_pw(rhog) + CALL pw_pool%create_pw(tmpg) IF (lsd) THEN CALL pw_copy(rho_g(1), rhog) ELSE IF (triplet) THEN @@ -205,8 +203,8 @@ SUBROUTINE calc_fxc_kernel(fxc_rspace, rho_r, rho_g, tau_r, xc_kernel, triplet, CALL b97_fxc_eval(rhob, norm_drhob, fxc_rspace(3), g_ab(3), ccaa, eps_rho) CALL b97_fcc_eval(rhoa, rhob, norm_drhoa, norm_drhob, fxc_rspace(2), g_ab(2), ccab, eps_rho) ! exchange - CALL pw_pool%create_pw(fxa, in_space=REALSPACE) - CALL pw_pool%create_pw(fxb, in_space=REALSPACE) + CALL pw_pool%create_pw(fxa) + CALL pw_pool%create_pw(fxb) CALL pw_zero(fxa) CALL pw_zero(fxb) CALL xalpha_fxc_eval(rhoa, rhob, fxa, fxb, scalex, eps_rho) diff --git a/src/xc/xc_pade.F b/src/xc/xc_pade.F index 89a198bd3b..dcf75bf618 100644 --- a/src/xc/xc_pade.F +++ b/src/xc/xc_pade.F @@ -20,7 +20,7 @@ MODULE xc_pade USE bibliography, ONLY: Goedecker1996,& cite_reference USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE xc_derivative_desc, ONLY: deriv_rho,& deriv_rhoa,& deriv_rhob @@ -810,8 +810,8 @@ END SUBROUTINE pade_lsd_3 !> \param fxc_bb ... ! ************************************************************************************************** SUBROUTINE pade_fxc_eval(rho_a, rho_b, fxc_aa, fxc_ab, fxc_bb) - TYPE(pw_r3d_type), INTENT(IN) :: rho_a, rho_b - TYPE(pw_r3d_type), INTENT(INOUT) :: fxc_aa, fxc_ab, fxc_bb + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_a, rho_b + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: fxc_aa, fxc_ab, fxc_bb INTEGER :: i, j, k INTEGER, DIMENSION(2, 3) :: bo diff --git a/src/xc/xc_perdew_wang.F b/src/xc/xc_perdew_wang.F index 7823322713..52ad677288 100644 --- a/src/xc/xc_perdew_wang.F +++ b/src/xc/xc_perdew_wang.F @@ -18,7 +18,7 @@ MODULE xc_perdew_wang #:include "xc_perdew_wang.fypp" USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE xc_derivative_set_types, ONLY: xc_derivative_set_type, & xc_dset_get_derivative USE xc_derivative_types, ONLY: xc_derivative_get, & @@ -431,8 +431,8 @@ END SUBROUTINE perdew_wang_lsd_calc !> \param eps_rho ... ! ************************************************************************************************** SUBROUTINE perdew_wang_fxc_calc(rho_a, rho_b, fxc_aa, fxc_ab, fxc_bb, scalec, eps_rho) - TYPE(pw_r3d_type), INTENT(IN) :: rho_a, rho_b - TYPE(pw_r3d_type), INTENT(INOUT) :: fxc_aa, fxc_ab, fxc_bb + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_a, rho_b + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: fxc_aa, fxc_ab, fxc_bb REAL(kind=dp), INTENT(in) :: scalec, eps_rho INTEGER :: i, j, k diff --git a/src/xc/xc_rho_set_types.F b/src/xc/xc_rho_set_types.F index 7d5dbed9a2..0dbbfae753 100644 --- a/src/xc/xc_rho_set_types.F +++ b/src/xc/xc_rho_set_types.F @@ -21,10 +21,8 @@ MODULE xc_rho_set_types pw_pool_type USE pw_spline_utils, ONLY: pw_spline_scale_deriv USE pw_types, ONLY: & - pw_c1d_type, & - REALSPACE, & - RECIPROCALSPACE, & - pw_r3d_type + pw_c1d_gs_type, & + pw_r3d_rs_type USE xc_input_constants, ONLY: xc_deriv_pw, & xc_deriv_spline2, & xc_deriv_spline3, & @@ -451,11 +449,11 @@ SUBROUTINE xc_rho_set_recover_pw(rho_set, pw_grid, pw_pool, owns_data, rho, drho rhob_1_3, laplace_rho, laplace_rhoa, laplace_rhob, drhoa, drhob, & tau, tau_a, tau_b) TYPE(xc_rho_set_type) :: rho_set - TYPE(pw_r3d_type), DIMENSION(3), OPTIONAL, INTENT(OUT) :: drho, drhoa, drhob - TYPE(pw_r3d_type), OPTIONAL, POINTER :: rho, norm_drho, rhoa, rhob, norm_drhoa, & - norm_drhob, rho_1_3, rhoa_1_3, & - rhob_1_3, laplace_rho, laplace_rhoa, & - laplace_rhob, tau, tau_a, tau_b + TYPE(pw_r3d_rs_type), DIMENSION(3), OPTIONAL, INTENT(OUT) :: drho, drhoa, drhob + TYPE(pw_r3d_rs_type), OPTIONAL, POINTER :: rho, norm_drho, rhoa, rhob, norm_drhoa, & + norm_drhob, rho_1_3, rhoa_1_3, & + rhob_1_3, laplace_rho, laplace_rhoa, & + laplace_rhob, tau, tau_a, tau_b TYPE(pw_grid_type), POINTER, INTENT(IN) :: pw_grid TYPE(pw_pool_type), POINTER, INTENT(IN) :: pw_pool LOGICAL, INTENT(OUT) :: owns_data @@ -469,18 +467,17 @@ SUBROUTINE xc_rho_set_recover_pw(rho_set, pw_grid, pw_pool, owns_data, rho, drho END SUBROUTINE SUBROUTINE xc_rho_set_recover_pw_low(rho_pw, rho, pw_grid, pw_pool, rhoa, rhob) - TYPE(pw_r3d_type), INTENT(OUT) :: rho_pw + TYPE(pw_r3d_rs_type), INTENT(OUT) :: rho_pw REAL(KIND=dp), DIMENSION(:, :, :), POINTER, CONTIGUOUS :: rho TYPE(pw_grid_type), POINTER, INTENT(IN) :: pw_grid TYPE(pw_pool_type), POINTER, INTENT(IN) :: pw_pool REAL(KIND=dp), DIMENSION(:, :, :), POINTER, OPTIONAL :: rhoa, rhob IF (ASSOCIATED(rho)) THEN - CALL rho_pw%create(pw_grid=pw_grid, array_ptr=rho, & - in_space=REALSPACE) + CALL rho_pw%create(pw_grid=pw_grid, array_ptr=rho) NULLIFY (rho) ELSE IF (PRESENT(rhoa) .AND. PRESENT(rhob)) THEN - CALL pw_pool%create_pw(rho_pw, in_space=REALSPACE) + CALL pw_pool%create_pw(rho_pw) !$OMP PARALLEL WORKSHARE DEFAULT(NONE) SHARED(rho_pw,rhoa,rhob) rho_pw%array(:, :, :) = rhoa(:, :, :) + rhob(:, :, :) !$OMP END PARALLEL WORKSHARE @@ -601,9 +598,9 @@ END SUBROUTINE xc_rho_set_clean SUBROUTINE xc_rho_set_update(rho_set, rho_r, rho_g, tau, needs, & xc_deriv_method_id, xc_rho_smooth_id, pw_pool) TYPE(xc_rho_set_type), INTENT(INOUT) :: rho_set - TYPE(pw_r3d_type), DIMENSION(:), INTENT(IN) :: rho_r - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g - TYPE(pw_r3d_type), DIMENSION(:), POINTER, INTENT(IN) :: tau + TYPE(pw_r3d_rs_type), DIMENSION(:), INTENT(IN) :: rho_r + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER, INTENT(IN) :: tau TYPE(xc_rho_cflags_type), INTENT(in) :: needs INTEGER, INTENT(IN) :: xc_deriv_method_id, xc_rho_smooth_id TYPE(pw_pool_type), POINTER :: pw_pool @@ -614,10 +611,10 @@ SUBROUTINE xc_rho_set_update(rho_set, rho_r, rho_g, tau, needs, & LOGICAL :: gradient_f, my_rho_g_local, & needs_laplace, needs_rho_g REAL(kind=dp) :: rho_cutoff - TYPE(pw_r3d_type), DIMENSION(2) :: laplace_rho_r - TYPE(pw_r3d_type), DIMENSION(3, 2) :: drho_r - TYPE(pw_c1d_type) :: my_rho_g, tmp_g - TYPE(pw_r3d_type), DIMENSION(2) :: my_rho_r + TYPE(pw_r3d_rs_type), DIMENSION(2) :: laplace_rho_r + TYPE(pw_r3d_rs_type), DIMENSION(3, 2) :: drho_r + TYPE(pw_c1d_gs_type) :: my_rho_g, tmp_g + TYPE(pw_r3d_rs_type), DIMENSION(2) :: my_rho_r IF (ANY(rho_set%local_bounds /= pw_pool%pw_grid%bounds_local)) & CPABORT("pw_pool cr3d have different size than expected") @@ -662,12 +659,10 @@ SUBROUTINE xc_rho_set_update(rho_set, rho_r, rho_g, tau, needs, & END IF IF (needs_rho_g) THEN - CALL pw_pool%create_pw(tmp_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(tmp_g) END IF DO ispin = 1, nspins - CALL pw_pool%create_pw(my_rho_r(ispin), & - in_space=REALSPACE) + CALL pw_pool%create_pw(my_rho_r(ispin)) ! introduce a smoothing kernel on the density IF (xc_rho_smooth_id == xc_rho_no_smooth) THEN IF (needs_rho_g) THEN @@ -687,27 +682,23 @@ SUBROUTINE xc_rho_set_update(rho_set, rho_r, rho_g, tau, needs, & ! (for the partial integration) ! deriv rho DO idir = 1, 3 - CALL pw_pool%create_pw(drho_r(idir, ispin), & - in_space=REALSPACE) + CALL pw_pool%create_pw(drho_r(idir, ispin)) END DO IF (needs_rho_g) THEN IF (.NOT. ASSOCIATED(my_rho_g%pw_grid)) THEN my_rho_g_local = .TRUE. - CALL pw_pool%create_pw(my_rho_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(my_rho_g) CALL pw_transfer(my_rho_r(ispin), my_rho_g) END IF IF (.NOT. my_rho_g_local .AND. (xc_deriv_method_id == xc_deriv_spline2 .OR. & xc_deriv_method_id == xc_deriv_spline3)) THEN - CALL pw_pool%create_pw(my_rho_g, & - in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(my_rho_g) my_rho_g_local = .TRUE. CALL pw_copy(rho_g(ispin), my_rho_g) END IF END IF IF (needs%laplace_rho .OR. needs%laplace_rho_spin) THEN - CALL pw_pool%create_pw(laplace_rho_r(ispin), & - in_space=REALSPACE) + CALL pw_pool%create_pw(laplace_rho_r(ispin)) CALL xc_pw_laplace(my_rho_g, pw_pool, xc_deriv_method_id, laplace_rho_r(ispin), tmp_g=tmp_g) END IF CALL xc_pw_gradient(my_rho_r(ispin), my_rho_g, tmp_g, drho_r(:, ispin), xc_deriv_method_id) diff --git a/src/xc/xc_util.F b/src/xc/xc_util.F index 01d2912ff5..3e633578ac 100644 --- a/src/xc/xc_util.F +++ b/src/xc/xc_util.F @@ -24,9 +24,8 @@ MODULE xc_util pw_nn_smear_r, pw_spline2_deriv_g, pw_spline2_interpolate_values_g, pw_spline3_deriv_g, & pw_spline3_interpolate_values_g, pw_spline_scale_deriv, spline2_coeffs, & spline2_deriv_coeffs, spline3_coeffs, spline3_deriv_coeffs - USE pw_types, ONLY: RECIPROCALSPACE, & - REALSPACE, pw_c1d_type, & - pw_r3d_type + USE pw_types, ONLY: & + pw_c1d_gs_type, pw_r3d_rs_type USE xc_input_constants, ONLY: & xc_deriv_nn10_smooth, xc_deriv_nn50_smooth, xc_deriv_pw, xc_deriv_spline2, & xc_deriv_spline2_smooth, xc_deriv_spline3, xc_deriv_spline3_smooth, xc_rho_nn10, & @@ -41,11 +40,11 @@ MODULE xc_util CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'xc_util' INTERFACE xc_pw_derive - MODULE PROCEDURE xc_pw_derive_r3d, xc_pw_derive_c1d + MODULE PROCEDURE xc_pw_derive_r3d_rs, xc_pw_derive_c1d_gs END INTERFACE INTERFACE xc_pw_laplace - MODULE PROCEDURE xc_pw_laplace_r3d, xc_pw_laplace_c1d + MODULE PROCEDURE xc_pw_laplace_r3d_rs, xc_pw_laplace_c1d_gs END INTERFACE CONTAINS @@ -71,8 +70,8 @@ ELEMENTAL FUNCTION xc_requires_tmp_g(xc_deriv_id) RESULT(requires) !> \param xc_smooth_id ... ! ************************************************************************************************** SUBROUTINE xc_pw_smooth(pw_in, pw_out, xc_smooth_id) - TYPE(pw_r3d_type), INTENT(IN) :: pw_in - TYPE(pw_r3d_type), INTENT(INOUT) :: pw_out + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_in + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: pw_out INTEGER, INTENT(IN) :: xc_smooth_id CHARACTER(len=*), PARAMETER :: routineN = 'xc_pw_smooth' @@ -121,9 +120,9 @@ END SUBROUTINE xc_pw_smooth !> \param xc_deriv_method_id ... ! ************************************************************************************************** SUBROUTINE xc_pw_gradient(pw_r, pw_g, tmp_g, gradient, xc_deriv_method_id) - TYPE(pw_r3d_type), INTENT(IN) :: pw_r - TYPE(pw_c1d_type), INTENT(INOUT) :: pw_g, tmp_g - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: gradient + TYPE(pw_r3d_rs_type), INTENT(IN) :: pw_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: pw_g, tmp_g + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: gradient INTEGER, INTENT(IN) :: xc_deriv_method_id INTEGER :: idir @@ -135,7 +134,7 @@ SUBROUTINE xc_pw_gradient(pw_r, pw_g, tmp_g, gradient, xc_deriv_method_id) END SUBROUTINE xc_pw_gradient - #:for kind in ["r3d", "c1d"] + #:for kind in ["r3d_rs", "c1d_gs"] ! ************************************************************************************************** !> \brief Calculates the Laplacian of pw !> \param pw on input: pw of which the Laplacian shall be calculated, on output if pw_out is absent: Laplacian of input @@ -148,14 +147,14 @@ SUBROUTINE xc_pw_laplace_${kind}$ (pw, pw_pool, deriv_method_id, pw_out, tmp_g) TYPE(pw_${kind}$_type), INTENT(INOUT) :: pw TYPE(pw_pool_type), INTENT(IN), POINTER :: pw_pool INTEGER, INTENT(IN) :: deriv_method_id - TYPE(pw_r3d_type), INTENT(INOUT), OPTIONAL :: pw_out - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: tmp_g + TYPE(pw_r3d_rs_type), INTENT(INOUT), OPTIONAL :: pw_out + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: tmp_g CHARACTER(len=*), PARAMETER :: routineN = 'xc_pw_laplace' INTEGER :: handle LOGICAL :: owns_tmp_g - TYPE(pw_c1d_type) :: my_tmp_g + TYPE(pw_c1d_gs_type) :: my_tmp_g CALL timeset(routineN, handle) @@ -166,7 +165,7 @@ SUBROUTINE xc_pw_laplace_${kind}$ (pw, pw_pool, deriv_method_id, pw_out, tmp_g) owns_tmp_g = .FALSE. IF (.NOT. ASSOCIATED(my_tmp_g%pw_grid)) THEN - CALL pw_pool%create_pw(my_tmp_g, in_space=RECIPROCALSPACE) + CALL pw_pool%create_pw(my_tmp_g) owns_tmp_g = .TRUE. END IF CALL pw_zero(my_tmp_g) @@ -201,9 +200,9 @@ END SUBROUTINE xc_pw_laplace_${kind}$ ! ************************************************************************************************** SUBROUTINE xc_pw_divergence(xc_deriv_method_id, pw_to_deriv, tmp_g, vxc_g, vxc_r) INTEGER, INTENT(IN) :: xc_deriv_method_id - TYPE(pw_r3d_type), DIMENSION(3), INTENT(INOUT) :: pw_to_deriv - TYPE(pw_c1d_type), INTENT(INOUT) :: tmp_g, vxc_g - TYPE(pw_r3d_type), INTENT(INOUT) :: vxc_r + TYPE(pw_r3d_rs_type), DIMENSION(3), INTENT(INOUT) :: pw_to_deriv + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: tmp_g, vxc_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vxc_r CHARACTER(len=*), PARAMETER :: routineN = 'xc_pw_divergence' @@ -232,7 +231,7 @@ SUBROUTINE xc_pw_divergence(xc_deriv_method_id, pw_to_deriv, tmp_g, vxc_g, vxc_r END SUBROUTINE xc_pw_divergence - #:for kind in ["r3d", "c1d"] + #:for kind in ["r3d_rs", "c1d_gs"] ! ************************************************************************************************** !> \brief Calculates the derivative of a function on a planewave grid in a given direction !> \param pw function to derive @@ -245,19 +244,19 @@ END SUBROUTINE xc_pw_divergence ! ************************************************************************************************** SUBROUTINE xc_pw_derive_${kind}$ (pw, tmp_g, vxc_r, idir, xc_deriv_method_id, copy_to_vxcr, pw_g) TYPE(pw_${kind}$_type), INTENT(IN) :: pw - TYPE(pw_c1d_type), INTENT(INOUT) :: tmp_g - TYPE(pw_r3d_type), INTENT(INOUT) :: vxc_r + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: tmp_g + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: vxc_r INTEGER, INTENT(IN) :: idir, xc_deriv_method_id LOGICAL, INTENT(IN), OPTIONAL :: copy_to_vxcr - TYPE(pw_c1d_type), INTENT(IN), OPTIONAL :: pw_g + TYPE(pw_c1d_gs_type), INTENT(IN), OPTIONAL :: pw_g CHARACTER(len=*), PARAMETER :: routineN = 'xc_pw_derive' INTEGER, DIMENSION(3, 3), PARAMETER :: nd = RESHAPE((/1, 0, 0, 0, 1, 0, 0, 0, 1/), (/3, 3/)) INTEGER :: handle LOGICAL :: my_copy_to_vxcr - #:if kind=="c1d" - TYPE(pw_r3d_type) :: tmp_r + #:if kind=="c1d_gs" + TYPE(pw_r3d_rs_type) :: tmp_r #:endif CALL timeset(routineN, handle) @@ -292,7 +291,7 @@ SUBROUTINE xc_pw_derive_${kind}$ (pw, tmp_g, vxc_r, idir, xc_deriv_method_id, co IF (my_copy_to_vxcr) CALL pw_transfer(tmp_g, vxc_r) ELSE - #:if kind=="r3d" + #:if kind=="r3d_rs" SELECT CASE (xc_deriv_method_id) CASE (xc_deriv_spline2_smooth) CALL pw_nn_deriv_r(pw_in=pw, & @@ -314,7 +313,7 @@ SUBROUTINE xc_pw_derive_${kind}$ (pw, tmp_g, vxc_r, idir, xc_deriv_method_id, co CPABORT("Unsupported derivative method") END SELECT #:else - CALL tmp_r%create(pw%pw_grid, REALSPACE) + CALL tmp_r%create(pw%pw_grid) SELECT CASE (xc_deriv_method_id) CASE (xc_deriv_spline2_smooth) CALL pw_nn_deriv_r(pw_in=tmp_r, & diff --git a/src/xc/xc_xalpha.F b/src/xc/xc_xalpha.F index 0adca2823f..dc48f318ef 100644 --- a/src/xc/xc_xalpha.F +++ b/src/xc/xc_xalpha.F @@ -21,7 +21,7 @@ MODULE xc_xalpha USE input_section_types, ONLY: section_vals_type,& section_vals_val_get USE kinds, ONLY: dp - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE xc_derivative_desc, ONLY: deriv_rho,& deriv_rhoa,& deriv_rhob @@ -556,8 +556,8 @@ END SUBROUTINE xalpha_lsd_3 !> \param eps_rho ... ! ************************************************************************************************** SUBROUTINE xalpha_fxc_eval(rho_a, rho_b, fxc_aa, fxc_bb, scale_x, eps_rho) - TYPE(pw_r3d_type), INTENT(IN) :: rho_a, rho_b - TYPE(pw_r3d_type), INTENT(INOUT) :: fxc_aa, fxc_bb + TYPE(pw_r3d_rs_type), INTENT(IN) :: rho_a, rho_b + TYPE(pw_r3d_rs_type), INTENT(INOUT) :: fxc_aa, fxc_bb REAL(KIND=dp), INTENT(IN) :: scale_x, eps_rho INTEGER :: i, j, k diff --git a/src/xc_adiabatic_utils.F b/src/xc_adiabatic_utils.F index cc855a66fb..5347ff17ee 100644 --- a/src/xc_adiabatic_utils.F +++ b/src/xc_adiabatic_utils.F @@ -28,7 +28,7 @@ MODULE xc_adiabatic_utils section_vals_val_get USE kinds, ONLY: dp USE message_passing, ONLY: mp_para_env_type - USE pw_types, ONLY: pw_r3d_type + USE pw_types, ONLY: pw_r3d_rs_type USE qs_energy_types, ONLY: qs_energy_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -72,7 +72,7 @@ SUBROUTINE rescale_xc_potential(qs_env, ks_matrix, rho, energy, v_rspace_new, v_ TYPE(dbcsr_p_type), DIMENSION(:, :), POINTER :: ks_matrix TYPE(qs_rho_type), POINTER :: rho TYPE(qs_energy_type), POINTER :: energy - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: v_rspace_new, v_tau_rspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: v_rspace_new, v_tau_rspace REAL(dp), DIMENSION(:) :: hf_energy LOGICAL, INTENT(in) :: just_energy, calculate_forces, use_virial diff --git a/src/xc_pot_saop.F b/src/xc_pot_saop.F index a67ea57771..8dd804ab33 100644 --- a/src/xc_pot_saop.F +++ b/src/xc_pot_saop.F @@ -48,10 +48,8 @@ MODULE xc_pot_saop pw_scale,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: REALSPACE,& - RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_collocate_density, ONLY: calculate_rho_elec USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type @@ -146,13 +144,13 @@ SUBROUTINE add_saop_pot(ks_matrix, qs_env, oe_corr) TYPE(cp_fm_type), POINTER :: mo_coeff TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: orbital_density_matrix, rho_struct_ao TYPE(mo_set_type), DIMENSION(:), POINTER :: molecular_orbitals - TYPE(pw_c1d_type) :: orbital_g - TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g + TYPE(pw_c1d_gs_type) :: orbital_g + TYPE(pw_c1d_gs_type), DIMENSION(:), POINTER :: rho_g TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_r3d_type) :: orbital - TYPE(pw_r3d_type), ALLOCATABLE, DIMENSION(:) :: vxc_GLLB, vxc_SAOP - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r, rho_struct_r, tau, vxc_LB, & + TYPE(pw_r3d_rs_type) :: orbital + TYPE(pw_r3d_rs_type), ALLOCATABLE, DIMENSION(:) :: vxc_GLLB, vxc_SAOP + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r, rho_struct_r, tau, vxc_LB, & vxc_tau, vxc_tmp TYPE(qs_ks_env_type), POINTER :: ks_env TYPE(qs_rho_type), POINTER :: rho_struct @@ -294,7 +292,7 @@ SUBROUTINE add_saop_pot(ks_matrix, qs_env, oe_corr) ALLOCATE (vxc_GLLB(nspins)) DO ispin = 1, nspins - CALL auxbas_pw_pool%create_pw(vxc_GLLB(ispin), in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vxc_GLLB(ispin)) END DO DO ispin = 1, nspins @@ -303,8 +301,8 @@ SUBROUTINE add_saop_pot(ks_matrix, qs_env, oe_corr) CALL xc_dset_release(deriv_set) - CALL auxbas_pw_pool%create_pw(orbital, in_space=REALSPACE) - CALL auxbas_pw_pool%create_pw(orbital_g, in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(orbital) + CALL auxbas_pw_pool%create_pw(orbital_g) DO ispin = 1, nspins @@ -376,8 +374,7 @@ SUBROUTINE add_saop_pot(ks_matrix, qs_env, oe_corr) mo_coeff=mo_coeff, & eigenvalues=mo_eigenvalues, & homo=homo) - CALL auxbas_pw_pool%create_pw(vxc_SAOP(ispin), & - in_space=REALSPACE) + CALL auxbas_pw_pool%create_pw(vxc_SAOP(ispin)) CALL pw_zero(vxc_SAOP(ispin)) ALLOCATE (coeff_col(nrow(ispin), 1)) diff --git a/src/xray_diffraction.F b/src/xray_diffraction.F index b35c5da40a..8edf52b2e1 100644 --- a/src/xray_diffraction.F +++ b/src/xray_diffraction.F @@ -47,9 +47,8 @@ MODULE xray_diffraction pw_transfer,& pw_zero USE pw_pool_types, ONLY: pw_pool_type - USE pw_types, ONLY: RECIPROCALSPACE,& - pw_c1d_type,& - pw_r3d_type + USE pw_types, ONLY: pw_c1d_gs_type,& + pw_r3d_rs_type USE qs_environment_types, ONLY: get_qs_env,& qs_environment_type USE qs_kind_types, ONLY: get_qs_kind,& @@ -106,7 +105,7 @@ SUBROUTINE xray_diffraction_spectrum(qs_env, unit_number, q_max) TYPE(dft_control_type), POINTER :: dft_control TYPE(mp_para_env_type), POINTER :: para_env TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_c1d_type) :: rhotot_elec_gspace + TYPE(pw_c1d_gs_type) :: rhotot_elec_gspace TYPE(pw_env_type), POINTER :: pw_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool TYPE(qs_rho_type), POINTER :: rho @@ -161,8 +160,7 @@ SUBROUTINE xray_diffraction_spectrum(qs_env, unit_number, q_max) ! Plane waves grid to assemble the total electronic density - CALL auxbas_pw_pool%create_pw(pw=rhotot_elec_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rhotot_elec_gspace) CALL pw_zero(rhotot_elec_gspace) CALL get_pw_grid_info(pw_grid=rhotot_elec_gspace%pw_grid, & @@ -489,7 +487,7 @@ SUBROUTINE calculate_rhotot_elec_gspace(qs_env, auxbas_pw_pool, & TYPE(qs_environment_type), POINTER :: qs_env TYPE(pw_pool_type), POINTER :: auxbas_pw_pool - TYPE(pw_c1d_type), INTENT(INOUT) :: rhotot_elec_gspace + TYPE(pw_c1d_gs_type), INTENT(INOUT) :: rhotot_elec_gspace REAL(KIND=dp), INTENT(IN) :: q_max REAL(KIND=dp), INTENT(OUT) :: rho_hard, rho_soft REAL(KIND=dp), INTENT(IN), OPTIONAL :: fsign @@ -511,8 +509,8 @@ SUBROUTINE calculate_rhotot_elec_gspace(qs_env, auxbas_pw_pool, & TYPE(dft_control_type), POINTER :: dft_control TYPE(gto_basis_set_type), POINTER :: basis_1c_set TYPE(particle_type), DIMENSION(:), POINTER :: particle_set - TYPE(pw_C1d_type) :: rho_elec_gspace - TYPE(pw_r3d_type), DIMENSION(:), POINTER :: rho_r + TYPE(pw_c1d_gs_type) :: rho_elec_gspace + TYPE(pw_r3d_rs_type), DIMENSION(:), POINTER :: rho_r TYPE(qs_kind_type), DIMENSION(:), POINTER :: qs_kind_set TYPE(qs_rho_type), POINTER :: rho TYPE(rho_atom_coeff), DIMENSION(:), POINTER :: cpc_h, cpc_s @@ -560,8 +558,7 @@ SUBROUTINE calculate_rhotot_elec_gspace(qs_env, auxbas_pw_pool, & ! Load the soft contribution of the electronic density - CALL auxbas_pw_pool%create_pw(pw=rho_elec_gspace, & - in_space=RECIPROCALSPACE) + CALL auxbas_pw_pool%create_pw(pw=rho_elec_gspace) CALL pw_zero(rhotot_elec_gspace) @@ -782,7 +779,7 @@ SUBROUTINE collocate_pgf_product_gspace(la_max, zeta, la_min, & REAL(dp), DIMENSION(:, :), POINTER :: pab INTEGER, INTENT(IN) :: na, nb REAL(dp), INTENT(IN) :: eps_rho_gspace, gsq_max - TYPE(pw_c1d_type), INTENT(IN) :: pw + TYPE(pw_c1d_gs_type), INTENT(IN) :: pw CHARACTER(LEN=*), PARAMETER :: routineN = 'collocate_pgf_product_gspace' diff --git a/src/xtb_coulomb.F b/src/xtb_coulomb.F index 8a9ad853c8..35a8fe6170 100644 --- a/src/xtb_coulomb.F +++ b/src/xtb_coulomb.F @@ -37,7 +37,7 @@ MODULE xtb_coulomb ewald_environment_type USE ewald_methods_tb, ONLY: tb_ewald_overlap,& tb_spme_evaluate - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE kpoint_types, ONLY: get_kpoint_info,& kpoint_type @@ -140,7 +140,7 @@ SUBROUTINE build_xtb_coulomb(qs_env, ks_matrix, rho, charges, mcharge, energy, & TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(kpoint_type), POINTER :: kpoints TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_iterator_p_type), & diff --git a/src/xtb_ehess.F b/src/xtb_ehess.F index 66b574923f..ca22fd3d13 100644 --- a/src/xtb_ehess.F +++ b/src/xtb_ehess.F @@ -29,7 +29,7 @@ MODULE xtb_ehess ewald_environment_type USE ewald_methods_tb, ONLY: tb_ewald_overlap,& tb_spme_evaluate - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: oorootpi,& pi @@ -103,7 +103,7 @@ SUBROUTINE xtb_coulomb_hessian(qs_env, ks_matrix, charges1, mcharge1, mcharge) TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_iterator_p_type), & DIMENSION(:), POINTER :: nl_iterator diff --git a/src/xtb_ehess_force.F b/src/xtb_ehess_force.F index f34c5caf8a..8e729302ee 100644 --- a/src/xtb_ehess_force.F +++ b/src/xtb_ehess_force.F @@ -28,7 +28,7 @@ MODULE xtb_ehess_force ewald_environment_type USE ewald_methods_tb, ONLY: tb_ewald_overlap,& tb_spme_zforce - USE ewald_pw_types, ONLY: ewald_pw_r3d_type + USE ewald_pw_types, ONLY: ewald_pw_r3d_rs_type USE kinds, ONLY: dp USE mathconstants, ONLY: oorootpi,& pi @@ -119,7 +119,7 @@ SUBROUTINE calc_xtb_ehess_force(qs_env, matrix_p0, matrix_p1, charges0, mcharge0 TYPE(dft_control_type), POINTER :: dft_control TYPE(distribution_1d_type), POINTER :: local_particles TYPE(ewald_environment_type), POINTER :: ewald_env - TYPE(ewald_pw_r3d_type), POINTER :: ewald_pw + TYPE(ewald_pw_r3d_rs_type), POINTER :: ewald_pw TYPE(mp_para_env_type), POINTER :: para_env TYPE(neighbor_list_iterator_p_type), & DIMENSION(:), POINTER :: nl_iterator