Skip to content

Commit

Permalink
Convert all C1D grids
Browse files Browse the repository at this point in the history
  • Loading branch information
fstein93 committed Feb 13, 2024
1 parent 8bd29a5 commit 383c4fa
Show file tree
Hide file tree
Showing 116 changed files with 1,616 additions and 3,590 deletions.
6 changes: 4 additions & 2 deletions src/admm_dm_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +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_type
USE pw_types, ONLY: pw_c1d_type,&
pw_type
USE qs_collocate_density, ONLY: calculate_rho_elec
USE qs_environment_types, ONLY: get_qs_env,&
qs_environment_type
Expand Down Expand Up @@ -237,7 +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_type), DIMENSION(:), POINTER :: rho_g_aux, rho_r_aux
TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux
TYPE(pw_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
Expand Down
13 changes: 8 additions & 5 deletions src/admm_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +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_type
USE pw_types, ONLY: pw_c1d_type,&
pw_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,&
Expand Down Expand Up @@ -160,7 +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_type), DIMENSION(:), POINTER :: rho_g_aux, rho_r_aux
TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux
TYPE(pw_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
Expand Down Expand Up @@ -320,7 +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_type), DIMENSION(:), POINTER :: rho_g_aux, rho_r_aux
TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g_aux
TYPE(pw_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
Expand Down Expand Up @@ -2398,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_type), DIMENSION(:), POINTER :: rho_g, rho_r, v_rspace_dummy, &
v_tau_rspace_dummy
TYPE(pw_c1d_type), DIMENSION(:), POINTER :: rho_g
TYPE(pw_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
Expand Down
20 changes: 10 additions & 10 deletions src/cp_ddapc.F
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ MODULE cp_ddapc
pw_transfer,&
pw_zero
USE pw_pool_types, ONLY: pw_pool_type
USE pw_types, ONLY: COMPLEXDATA1D,&
REALDATA3D,&
USE pw_types, ONLY: REALDATA3D,&
REALSPACE,&
RECIPROCALSPACE,&
pw_c1d_type,&
pw_type
USE qs_energy_types, ONLY: qs_energy_type
USE qs_environment_types, ONLY: get_qs_env,&
Expand Down Expand Up @@ -84,7 +84,7 @@ 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_type), INTENT(IN) :: rho_tot_gspace, v_hartree_gspace
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_gspace, v_hartree_gspace
TYPE(pw_type), POINTER :: v_spin_ddapc_rest_r
TYPE(qs_energy_type), POINTER :: energy
LOGICAL, INTENT(in) :: calculate_forces
Expand All @@ -99,7 +99,7 @@ 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_type) :: v_spin_ddapc_rest_g
TYPE(pw_c1d_type) :: v_spin_ddapc_rest_g
TYPE(pw_type), POINTER :: v_hartree_rspace

NULLIFY (v_hartree_rspace, dft_control)
Expand Down Expand Up @@ -138,7 +138,7 @@ SUBROUTINE qs_ks_ddapc(qs_env, auxbas_pw_pool, rho_tot_gspace, v_hartree_gspace,
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, &
use_data=COMPLEXDATA1D, in_space=RECIPROCALSPACE)
in_space=RECIPROCALSPACE)
CALL pw_zero(v_spin_ddapc_rest_g)
NULLIFY (v_spin_ddapc_rest_r)
ALLOCATE (v_spin_ddapc_rest_r)
Expand Down Expand Up @@ -229,9 +229,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_type), INTENT(IN) :: rho_tot_gspace
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_gspace
REAL(KIND=dp), INTENT(INOUT) :: energy
TYPE(pw_type), INTENT(IN) :: v_hartree_gspace
TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace
LOGICAL, INTENT(IN), OPTIONAL :: calculate_forces
CHARACTER(LEN=*) :: Itype_of_density
Expand Down Expand Up @@ -364,7 +364,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_type), INTENT(IN) :: v_hartree_gspace, v_spin_ddapc_rest_g
TYPE(pw_c1d_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
Expand Down Expand Up @@ -467,9 +467,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_type), INTENT(IN) :: rho_tot_gspace
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_gspace
REAL(KIND=dp), INTENT(INOUT) :: energy
TYPE(pw_type), INTENT(IN) :: v_hartree_gspace
TYPE(pw_c1d_type), INTENT(IN) :: v_hartree_gspace
LOGICAL, INTENT(IN), OPTIONAL :: calculate_forces
CHARACTER(LEN=*) :: Itype_of_density
Expand Down
21 changes: 11 additions & 10 deletions src/cp_ddapc_methods.F
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +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_type
USE pw_types, ONLY: pw_c1d_type,&
pw_type
USE spherical_harmonics, ONLY: legendre
#include "./base/base_uses.f90"

Expand Down Expand Up @@ -61,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g
REAL(kind=dp), DIMENSION(:), POINTER :: radii

CHARACTER(len=*), PARAMETER :: routineN = 'ddapc_eval_gfunc'
Expand Down Expand Up @@ -114,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g
REAL(KIND=dp), INTENT(IN) :: gcut

CHARACTER(len=*), PARAMETER :: routineN = 'build_b_vector'
Expand Down Expand Up @@ -147,7 +148,7 @@ SUBROUTINE build_b_vector(bv, gfunc, w, particle_set, radii, rho_tot_g, gcut)
gvec = rho_tot_g%pw_grid%g(:, ig)
arg = DOT_PRODUCT(gvec, rvec)
phase = CMPLX(COS(arg), -SIN(arg), KIND=dp)
my_bv(ig) = w(ig)*REAL(CONJG(rho_tot_g%cc(ig))*phase, KIND=dp)
my_bv(ig) = w(ig)*REAL(CONJG(rho_tot_g%array(ig))*phase, KIND=dp)
END DO
DO igauss = 1, SIZE(radii)
idim = (iparticle - 1)*SIZE(radii) + igauss
Expand Down Expand Up @@ -192,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_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

Expand Down Expand Up @@ -278,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g
REAL(KIND=dp), INTENT(IN) :: gcut
INTEGER, INTENT(IN) :: iparticle0

Expand Down Expand Up @@ -312,7 +313,7 @@ SUBROUTINE build_der_b_vector(dbv, gfunc, w, particle_set, radii, rho_tot_g, gcu
gvec = rho_tot_g%pw_grid%g(:, ig)
arg = DOT_PRODUCT(gvec, rvec)
dphase = -CMPLX(SIN(arg), COS(arg), KIND=dp)
my_dbv(:, ig) = w(ig)*REAL(CONJG(rho_tot_g%cc(ig))*dphase, KIND=dp)*gvec(:)
my_dbv(:, ig) = w(ig)*REAL(CONJG(rho_tot_g%array(ig))*dphase, KIND=dp)*gvec(:)
END DO
DO igauss = 1, SIZE(radii)
idim = (iparticle - 1)*SIZE(radii) + igauss
Expand Down Expand Up @@ -370,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_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
Expand Down Expand Up @@ -488,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_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
Expand Down Expand Up @@ -546,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g
REAL(KIND=dp), DIMENSION(:), POINTER :: radii
INTEGER, INTENT(IN) :: iw
REAL(KIND=dp), INTENT(IN) :: Vol
Expand Down
5 changes: 3 additions & 2 deletions src/cp_ddapc_types.F
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +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_type
USE pw_types, ONLY: pw_c1d_type,&
pw_type
#include "./base/base_uses.f90"

IMPLICIT NONE
Expand Down Expand Up @@ -101,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_type), INTENT(IN) :: rho_tot_g
TYPE(pw_c1d_type), INTENT(IN) :: rho_tot_g
REAL(KIND=dp), INTENT(IN) :: gcut
INTEGER, INTENT(IN) :: iw2
REAL(KIND=dp), INTENT(IN) :: Vol
Expand Down
Loading

0 comments on commit 383c4fa

Please sign in to comment.