PROGRESS  master
prg_c_interface.F90
Go to the documentation of this file.
2 
3  use iso_c_binding
4 
8  use prg_ewald_mod
9  use prg_dos_mod
10  use prg_genz_mod
13  use prg_system_mod
19  use prg_sp2_mod
20  use prg_timer_mod
21  use bml_types_m
23 
24  implicit none
25 
26  public :: prg_version_c
27  public :: prg_progress_init_c
28  public :: prg_progress_shutdown_c
29 
30  ! density matrix module
31  public :: prg_build_density_t0_c
37 
38 contains
39 
40  function string_c2f(c_str) result(f_str)
41  character(c_char), dimension(:), intent(in) :: c_str
42  character(len=size(c_str)) :: f_str
43  integer :: i
44  do i = 1, size(c_str)
45  if (c_str(i) == c_null_char) exit
46  f_str(i:i) = c_str(i)
47  end do
48  end function string_c2f
49 
50  ! C wrapper subroutine
51  subroutine prg_version_c() bind(C, name="prg_version")
52  call prg_version()
53  end subroutine prg_version_c
54 
55  subroutine prg_progress_init_c() bind(C, name="prg_progress_init")
56  call prg_progress_init()
57  end subroutine prg_progress_init_c
58 
59  subroutine prg_progress_shutdown_c() bind(C, name="prg_progress_shutdown")
61  end subroutine prg_progress_shutdown_c
62 
63 
64  !------------------------------------------------
65  ! Beginning of prg_densitymatrix_mod
66  !------------------------------------------------
67 
68  subroutine prg_build_density_t0_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil,&
69  eigenvalues_out) bind(C, name="prg_build_density_T0")
70  integer(c_int), value :: norbs
71  real(c_double), intent(in), value :: threshold, bndfil
72  type(c_ptr), value :: ham_bml_c
73  type(c_ptr), value :: rho_bml_c
74  type(bml_matrix_t) :: ham_bml
75  type(bml_matrix_t) :: rho_bml
76  real(c_double) :: eigenvalues_out(norbs)
77  real(c_double), allocatable :: eigenvalues(:)
78 
79  ham_bml%ptr = ham_bml_c
80  rho_bml%ptr = rho_bml_c
81 
82  call prg_build_density_t0(ham_bml, rho_bml, threshold, bndfil, eigenvalues)
83  eigenvalues_out = eigenvalues
84  deallocate(eigenvalues)
85 
86  end subroutine prg_build_density_t0_c
87 
88  subroutine prg_build_density_t_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil, kbt,&
89  ef, eigenvalues_out) bind(C, name="prg_build_density_T")
90  integer(c_int), value :: norbs
91  real(c_double), value :: bndfil
92  real(c_double), value :: threshold
93  real(c_double), value :: kbt
94  real(c_double), value :: ef
95  real(c_double) :: eigenvalues_out(norbs)
96  real(c_double), allocatable :: eigenvalues(:)
97  type(c_ptr), value :: ham_bml_c
98  type(bml_matrix_t) :: ham_bml
99  type(c_ptr), value :: rho_bml_c
100  type(bml_matrix_t) :: rho_bml
101  ham_bml%ptr = ham_bml_c
102  rho_bml%ptr = rho_bml_c
103  call prg_build_density_t(ham_bml, rho_bml, threshold, bndfil, kbt, ef, eigenvalues)
104  eigenvalues_out = eigenvalues
105  deallocate(eigenvalues)
106  end subroutine prg_build_density_t_c
107 
108  subroutine prg_build_density_t_fulldata_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil, kbt, &
109  ef, eigenvalues_out, evects_bml_c, fvals_out) bind(C, name="prg_build_density_T_fulldata")
110  integer(c_int), value :: norbs
111  real(c_double), value :: bndfil
112  real(c_double), value :: threshold
113  real(c_double), value :: kbt
114  real(c_double), value :: ef
115  real(c_double) :: eigenvalues_out(norbs)
116  real(c_double) :: fvals_out(norbs)
117 
118  real(c_double), allocatable :: fvals(:)
119  real(c_double), allocatable :: eigenvalues(:)
120 
121  type(c_ptr), value :: ham_bml_c
122  type(c_ptr), value :: rho_bml_c
123  type(c_ptr), value :: evects_bml_c
124  type(bml_matrix_t) :: ham_bml
125  type(bml_matrix_t) :: rho_bml
126  type(bml_matrix_t) :: evects_bml
127 
128  ham_bml%ptr = ham_bml_c
129  rho_bml%ptr = rho_bml_c
130  evects_bml%ptr = evects_bml_c
131  call prg_build_density_t_fulldata(ham_bml, rho_bml, threshold, bndfil, kbt, ef,&
132  eigenvalues, evects_bml, fvals)
133  fvals_out = fvals
134  eigenvalues_out = eigenvalues
135  deallocate(eigenvalues)
136  deallocate(fvals)
137 
138  end subroutine prg_build_density_t_fulldata_c
139 
140  subroutine prg_build_density_t_ed_c(norbs, ham_bml_c, rho_bml_c, evects_bml_c, threshold,&
141  bndfil, kbt, ef, evals_out, dvals_out, hindex_out, llsize, verbose)&
142  bind(C, name="prg_build_density_T_ed")
143  integer(c_int), value :: norbs
144  integer(c_int), value :: llsize
145  integer(c_int), value :: verbose
146  real(c_double), value :: bndfil
147  real(c_double), value :: threshold
148  real(c_double), value :: kbt
149  real(c_double), value :: ef
150  real(c_double) :: evals_out(norbs)
151  real(c_double) :: dvals_out(norbs)
152  integer(c_int) :: hindex_out(norbs, norbs)
153 
154  integer(c_int), allocatable :: hindex(:,:)
155  real(c_double), allocatable :: evals(:)
156  real(c_double), allocatable :: dvals(:)
157 
158  type(c_ptr), value :: ham_bml_c
159  type(bml_matrix_t) :: ham_bml
160  type(c_ptr), value :: rho_bml_c
161  type(bml_matrix_t) :: rho_bml
162  type(c_ptr), value :: evects_bml_c
163  type(bml_matrix_t) :: evects_bml
164  ham_bml%ptr = ham_bml_c
165  rho_bml%ptr = rho_bml_c
166  evects_bml%ptr = evects_bml_c
167 
168  call prg_build_density_t_ed(ham_bml, rho_bml, evects_bml, threshold, bndfil, kbt, ef, evals,&
169  dvals, hindex, llsize, verbose)
170 
171  evals_out = evals
172  dvals_out = dvals
173  hindex_out = hindex
174  deallocate(evals)
175  deallocate(dvals)
176  deallocate(hindex)
177 
178  end subroutine prg_build_density_t_ed_c
179 
180  subroutine prg_get_evalsdvalsevects_c(norbs, ham_bml_c, threshold, hindex_in, llsize, evals_out,&
181  dvals_out, evects_bml_c, verbose) bind(C, name="prg_get_evalsDvalsEvects")
182  integer(c_int), value :: norbs, llsize, verbose
183  real(c_double), value :: threshold
184  integer(c_int) :: hindex_in(norbs,norbs)
185  real(c_double) :: evals_out(norbs)
186  real(c_double) :: dvals_out(norbs)
187  integer(c_int), allocatable :: hindex(:,:)
188  real(c_double), allocatable :: evals(:)
189  real(c_double), allocatable :: dvals(:)
190  type(bml_matrix_t) :: ham_bml
191  type(bml_matrix_t) :: evects_bml
192  type(c_ptr), value :: ham_bml_c
193  type(c_ptr), value :: evects_bml_c
194 
195  ham_bml%ptr = ham_bml_c
196  evects_bml%ptr = evects_bml_c
197  allocate(hindex(2, llsize))
198  hindex = hindex_in
199  call prg_get_evalsdvalsevects(ham_bml, threshold, hindex, llsize, evals, dvals, evects_bml,&
200  verbose)
201  evals_out = evals
202  dvals_out = dvals
203  deallocate(hindex, evals, dvals)
204 
205  end subroutine prg_get_evalsdvalsevects_c
206 
207  subroutine prg_build_density_fromevalsandevects_c(norbs,evects_bml_c, evals,rho_bml_c,threshold,&
208  bndfil, kbt, ef, verbose) bind(C, name="prg_build_density_fromEvalsAndEvects")
209  integer(c_int), value :: norbs, verbose
210  real(c_double), value :: threshold
211  real(c_double), value :: bndfil
212  real(c_double), value :: kbt
213  real(c_double), value :: ef
214  real(c_double) :: evals(norbs)
215  type(c_ptr), value :: evects_bml_c
216  type(bml_matrix_t) :: evects_bml
217  type(c_ptr), value :: rho_bml_c
218  type(bml_matrix_t) :: rho_bml
219 
220  evects_bml%ptr = evects_bml_c
221  rho_bml%ptr = rho_bml_c
222  call prg_build_density_fromevalsandevects(evects_bml, evals, rho_bml, threshold, bndfil, kbt,&
223  ef, verbose)
224 
226 
227  subroutine prg_build_density_t_fermi_c(ham_bml_c, rho_bml_c, threshold, kbt, ef, verbose, drho)&
228  bind(C, name="prg_build_density_T_fermi")
229  integer(c_int), value :: verbose
230  real(c_double), value :: threshold
231  real(c_double), value :: kbt
232  real(c_double), value :: ef
233  type(c_ptr), value :: ham_bml_c
234  type(bml_matrix_t) :: ham_bml
235  type(c_ptr), value :: rho_bml_c
236  type(bml_matrix_t) :: rho_bml
237  real(c_double), intent(inout) :: drho
238  ham_bml%ptr = ham_bml_c
239  rho_bml%ptr = rho_bml_c
240  call prg_build_density_t_fermi(ham_bml, rho_bml, threshold, kbt, ef, verbose, drho)
241  end subroutine prg_build_density_t_fermi_c
242 
243  subroutine prg_build_atomic_density_c(rhoat_bml_c, numel, hindex, spindex, norb, bml_type)&
244  bind(C, name="prg_build_atomic_density")
245  character(c_char), value :: bml_type
246  integer(c_int), target :: hindex(norb, norb)
247  integer(c_int), value :: norb
248  integer(c_int), target :: spindex(norb)
249  real(c_double), target :: numel(norb)
250  type(c_ptr), value :: rhoat_bml_c
251  type(bml_matrix_t) :: rhoat_bml
252  rhoat_bml%ptr = rhoat_bml_c
253  call prg_build_atomic_density(rhoat_bml, numel, hindex, spindex, norb, bml_type)
254  end subroutine prg_build_atomic_density_c
255 
256  subroutine prg_get_flevel_c(norbs, eigenvalues, kbt, bndfil, tol, Ef)&
257  bind(C, name="prg_get_flevel")
258  integer(c_int) :: norbs
259  real(c_double), value :: tol
260  real(c_double), value :: bndfil
261  real(c_double), target :: eigenvalues(norbs)
262  real(c_double), value :: kbt
263  real(c_double), value :: ef
264  logical :: err
265  call prg_get_flevel(eigenvalues, kbt, bndfil, tol, ef, err)
266  end subroutine prg_get_flevel_c
267 
268  subroutine prg_get_flevel_nt_c(norbs, eigenvalues, kbt, bndfil, tol, ef, verbose)&
269  bind(C, name="prg_get_flevel_nt")
270  integer(c_int) :: norbs
271  real(c_double), value :: bndfil
272  real(c_double), value :: kbt
273  real(c_double), value :: tol
274  real(c_double), target :: eigenvalues(norbs)
275  real(c_double), value :: ef
276  integer(c_int), optional :: verbose
277  logical :: err
278  call prg_get_flevel_nt(eigenvalues, kbt, bndfil, tol, ef, err, verbose)
279  end subroutine prg_get_flevel_nt_c
280 
281  subroutine prg_get_eigenvalues_c(norbs, ham_bml_c, eigenvalues_out, verbose)&
282  bind(C, name="prg_get_eigenvalues")
283  integer(c_int) :: norbs
284  integer(c_int), value :: verbose
285  real(c_double) :: eigenvalues_out(norbs)
286  real(c_double), allocatable :: eigenvalues(:)
287  type(c_ptr), value :: ham_bml_c
288  type(bml_matrix_t) :: ham_bml
289  ham_bml%ptr = ham_bml_c
290  call prg_get_eigenvalues(ham_bml, eigenvalues, verbose)
291  eigenvalues_out = eigenvalues
292  deallocate(eigenvalues)
293  end subroutine prg_get_eigenvalues_c
294 
295  subroutine prg_check_idempotency_c(mat_bml_c, threshold, idempotency)&
296  bind(C, name="prg_check_idempotency")
297  real(c_double), value :: threshold
298  real(c_double), intent(inout) :: idempotency
299  type(c_ptr), value :: mat_bml_c
300  type(bml_matrix_t) :: mat_bml
301  mat_bml%ptr = mat_bml_c
302 
303  call prg_check_idempotency(mat_bml, threshold, idempotency)
304 
305  end subroutine prg_check_idempotency_c
306 
307  subroutine prg_toeigenspace_c(mat_bml_c, matEig_bml_c, evects_bml_c, threshold, verbose)&
308  bind(C, name="prg_toEigenspace")
309  integer(c_int), optional :: verbose
310  type(c_ptr), value :: mat_bml_c
311  type(bml_matrix_t) :: mat_bml
312  type(c_ptr), value :: evects_bml_c
313  type(bml_matrix_t) :: evects_bml
314  type(c_ptr), value :: mateig_bml_c
315  type(bml_matrix_t) :: mateig_bml
316  real(c_double), value :: threshold
317  mat_bml%ptr = mat_bml_c
318  evects_bml%ptr = evects_bml_c
319  mateig_bml%ptr = mateig_bml_c
320  call prg_toeigenspace(mat_bml, mateig_bml, evects_bml, threshold, verbose)
321  end subroutine prg_toeigenspace_c
322 
323  subroutine prg_tocanonicalspace_c(mat_bml_c, matCan_bml_c, evects_bml_c, threshold, verbose)&
324  bind(C, name="prg_toCanonicalspace")
325  integer(c_int), optional :: verbose
326  type(c_ptr), value :: mat_bml_c
327  type(bml_matrix_t) :: mat_bml
328  type(c_ptr), value :: evects_bml_c
329  type(bml_matrix_t) :: evects_bml
330  type(c_ptr), value :: matcan_bml_c
331  type(bml_matrix_t) :: matcan_bml
332  real(c_double), value :: threshold
333  mat_bml%ptr = mat_bml_c
334  evects_bml%ptr = evects_bml_c
335  matcan_bml%ptr = matcan_bml_c
336  call prg_tocanonicalspace(mat_bml, matcan_bml, evects_bml, threshold, verbose)
337  end subroutine prg_tocanonicalspace_c
338 
339  subroutine canon_dm_prt_c(P1, H1, Nocc, T, Q, e, mu0, m, HDIM) bind(C, name="Canon_DM_PRT")
340  integer(c_int), value :: hdim
341  integer(c_int), value :: m
342  real(c_double), intent(in) :: h1(hdim, hdim), q(hdim, hdim), e(hdim)
343  real(c_double), intent(out) :: p1(hdim, hdim)
344  real(c_double), value :: t, mu0, nocc
345 
346  call canon_dm_prt(p1, h1, nocc, t, q, e, mu0, m, hdim)
347  end subroutine canon_dm_prt_c
348 
349  !------------------------------------------------
350  ! end of prg_densitymatrix_mod
351  !------------------------------------------------
352 
353  !------------------------------------------------
354  ! Beginning of prg_charges_mod
355  !------------------------------------------------
356  subroutine prg_get_charges_c(nats, norbs, rho_bml_c, over_bml_c, hindex, charges, numel,&
357  spindex, mdimin, threshold) bind(C, name="prg_get_charges")
358  integer(c_int), value :: nats, norbs
359  integer(c_int), value :: mdimin
360  integer(c_int) :: hindex(nats,nats)
361  integer(c_int) :: spindex(nats)
362  real(c_double) :: charges_out(nats)
363  real(c_double) :: numel_in(norbs)
364  real(c_double), value :: threshold
365 
366  real(c_double), allocatable :: charges(:)
367  real(c_double), allocatable :: numel(:)
368 
369  type(c_ptr), value :: over_bml_c
370  type(bml_matrix_t) :: over_bml
371  type(c_ptr), value :: rho_bml_c
372  type(bml_matrix_t) :: rho_bml
373  over_bml%ptr = over_bml_c
374  rho_bml%ptr = rho_bml_c
375  allocate(numel(norbs))
376  numel = numel_in
377  call prg_get_charges(rho_bml, over_bml, hindex, charges, numel, spindex, mdimin, threshold)
378  charges_out = charges
379  deallocate(charges, numel)
380 
381  end subroutine prg_get_charges_c
382 
383  subroutine prg_get_hscf_c(nats, ham0_bml_c, over_bml_c, ham_bml_c, spindex, hindex, hubbardu,&
384  charges, coulomb_pot_r, coulomb_pot_k, mdimin, threshold) bind(C, name="prg_get_hscf")
385  integer(c_int), value :: nats
386  integer(c_int), target :: hindex(nats, nats)
387  integer(c_int), value :: mdimin
388  integer(c_int), target :: spindex(nats)
389  real(c_double), target :: charges(nats)
390  real(c_double), target :: coulomb_pot_r(nats)
391  real(c_double), target :: coulomb_pot_k(nats)
392  real(c_double), target :: hubbardu(nats)
393  real(c_double), value :: threshold
394  type(c_ptr), value :: ham0_bml_c
395  type(bml_matrix_t) :: ham0_bml
396  type(c_ptr), value :: over_bml_c
397  type(bml_matrix_t) :: over_bml
398  type(c_ptr), value :: ham_bml_c
399  type(bml_matrix_t) :: ham_bml
400  ham0_bml%ptr = ham0_bml_c
401  over_bml%ptr = over_bml_c
402  ham_bml%ptr = ham_bml_c
403  call prg_get_hscf(ham0_bml, over_bml, ham_bml, spindex, hindex, hubbardu, charges,&
404  coulomb_pot_r, coulomb_pot_k, mdimin, threshold)
405  end subroutine prg_get_hscf_c
406 
407  subroutine prg_get_hscf_v2_c(nats, ham0_bml_c, over_bml_c, ham_bml_c, spindex, hindex, hubbardu,&
408  charges, coulomb_pot_r, coulomb_pot_k, mdimin, threshold) bind(C, name="prg_get_hscf_v2")
409  integer(c_int), value :: nats
410  integer(c_int) :: hindex(nats, nats)
411  integer(c_int), value :: mdimin
412  real(c_double), value :: threshold
413  integer(c_int) :: spindex(nats)
414  real(c_double) :: charges(nats)
415  real(c_double) :: coulomb_pot_r(nats)
416  real(c_double) :: coulomb_pot_k(nats)
417  real(c_double) :: hubbardu(nats)
418  type(c_ptr), value :: ham0_bml_c
419  type(bml_matrix_t) :: ham0_bml
420  type(c_ptr), value :: over_bml_c
421  type(bml_matrix_t) :: over_bml
422  type(c_ptr), value :: ham_bml_c
423  type(bml_matrix_t) :: ham_bml
424 
425  ham0_bml%ptr = ham0_bml_c
426  over_bml%ptr = over_bml_c
427  ham_bml%ptr = ham_bml_c
428  call prg_get_hscf_v2(ham0_bml, over_bml, ham_bml, spindex, hindex, hubbardu, charges,&
429  coulomb_pot_r, coulomb_pot_k, mdimin, threshold)
430  end subroutine prg_get_hscf_v2_c
431 
432  !------------------------------------------------
433  ! End of prg_charges_mod
434  !------------------------------------------------
435 
436 
437  !------------------------------------------------
438  ! prg_implicit_fermi_mod
439  !------------------------------------------------
440  subroutine prg_implicit_fermi_save_inverse_c(Inv_bml_c, h_bml_c, p_bml_c, nsteps, nocc, mu,&
441  beta, occErrLimit, threshold, tol, SCF_IT, occiter, totns)&
442  bind(C, name="prg_implicit_fermi_save_inverse")
443  type(c_ptr), value :: h_bml_c
444  type(bml_matrix_t) :: h_bml
445  type(c_ptr), value :: p_bml_c
446  type(bml_matrix_t) :: p_bml
447  type(c_ptr), target :: Inv_bml_c(nsteps)
448  type(bml_matrix_t) :: Inv_bml(nsteps)
449  integer(c_int), value :: nsteps
450  integer(c_int), value :: SCF_IT
451  real(c_double), value :: nocc
452  real(c_double), value :: threshold
453  real(c_double), value :: tol
454  real(c_double), value :: occErrLimit
455  real(c_double), value :: beta
456  real(c_double), intent(inout) :: mu
457  integer(c_int), value :: occiter
458  integer(c_int), value :: totns
459  integer :: i
460  h_bml%ptr = h_bml_c
461  p_bml%ptr = p_bml_c
462 
463  ! Use the transfer intrinsic to move data from C pointer array to Fortran derived type array.
464  inv_bml = transfer(inv_bml_c, inv_bml)
465  call prg_implicit_fermi_save_inverse(inv_bml, h_bml, p_bml, nsteps, nocc, mu, beta,&
466  occerrlimit, threshold, tol, scf_it, occiter, totns)
467 
468  end subroutine prg_implicit_fermi_save_inverse_c
469 
470  subroutine prg_implicit_fermi_c(h_bml_c, p_bml_c, nsteps, k, nocc, mu, beta, method, osteps,&
471  occErrLimit, threshold, tol) bind(C, name="prg_implicit_fermi")
472  type(c_ptr), value :: h_bml_c
473  type(bml_matrix_t) :: h_bml
474  type(c_ptr), value :: p_bml_c
475  type(bml_matrix_t) :: p_bml
476  integer(c_int), value :: osteps
477  integer(c_int), value :: nsteps
478  integer(c_int), value :: method
479  integer(c_int), value :: k
480  real(c_double), value :: nocc
481  real(c_double), value :: threshold
482  real(c_double), value :: tol
483  real(c_double), value :: occErrLimit
484  real(c_double), value :: beta
485  real(c_double), value :: mu
486  h_bml%ptr = h_bml_c
487  p_bml%ptr = p_bml_c
488  call prg_implicit_fermi(h_bml, p_bml, nsteps, k, nocc, mu, beta, method, osteps,&
489  occerrlimit, threshold, tol)
490  end subroutine prg_implicit_fermi_c
491 
492  subroutine prg_implicit_fermi_zero_c(h_bml_c, p_bml_c, nsteps, mu, method, threshold, tol)&
493  bind(C, name="prg_implicit_fermi_zero")
494  type(c_ptr), value :: h_bml_c
495  type(bml_matrix_t) :: h_bml
496  type(c_ptr), value :: p_bml_c
497  type(bml_matrix_t) :: p_bml
498  integer(c_int), value :: nsteps
499  integer(c_int), value :: method
500  real(c_double), value :: mu
501  real(c_double), value :: threshold
502  real(c_double), value :: tol
503  h_bml%ptr = h_bml_c
504  p_bml%ptr = p_bml_c
505  call prg_implicit_fermi_zero(h_bml, p_bml, nsteps, mu, method, threshold, tol)
506  end subroutine prg_implicit_fermi_zero_c
507 
508  subroutine prg_implicit_fermi_first_order_response_c(H0_bml_c, H1_bml_c, P0_bml_c, P1_bml_c,&
509  Inv_bml_c, nsteps, mu0, beta, nocc, threshold)&
510  bind(C, name="prg_implicit_fermi_first_order_response")
511  type(c_ptr), value :: H0_bml_c
512  type(bml_matrix_t) :: H0_bml
513  type(c_ptr), value :: H1_bml_c
514  type(bml_matrix_t) :: H1_bml
515  type(c_ptr), target :: Inv_bml_c(nsteps)
516  type(bml_matrix_t) :: Inv_bml(nsteps)
517  type(c_ptr), value :: P0_bml_c
518  type(bml_matrix_t) :: P0_bml
519  type(c_ptr), value :: P1_bml_c
520  type(bml_matrix_t) :: P1_bml
521  real(c_double), value :: mu0
522  real(c_double), value :: threshold
523  real(c_double), value :: beta
524  real(c_double), value :: nocc
525  integer(c_int), value :: nsteps
526  h0_bml%ptr = h0_bml_c
527  h1_bml%ptr = h1_bml_c
528  p0_bml%ptr = p0_bml_c
529  p1_bml%ptr = p1_bml_c
530  inv_bml = transfer(inv_bml_c, inv_bml)
531  call prg_implicit_fermi_first_order_response(h0_bml, h1_bml, p0_bml, p1_bml, inv_bml, nsteps,&
532  mu0, beta, nocc, threshold)
534 
535  subroutine prg_test_density_matrix_c(ham_bml_c, p_bml_c, beta, mu, nocc, osteps, occErrLimit, threshold) bind(C, name="prg_test_density_matrix")
536  type(c_ptr), value :: ham_bml_c
537  type(bml_matrix_t) :: ham_bml
538  type(c_ptr), value :: p_bml_c
539  type(bml_matrix_t) :: p_bml
540  real(c_double), value :: beta
541  real(c_double), value :: nocc
542  real(c_double), value :: occErrLimit
543  real(c_double), value :: threshold
544  real(c_double), value :: mu
545  integer(c_int), value :: osteps
546  ham_bml%ptr = ham_bml_c
547  p_bml%ptr = p_bml_c
548  call prg_test_density_matrix(ham_bml, p_bml, beta, mu, nocc, osteps, occerrlimit, threshold)
549  end subroutine prg_test_density_matrix_c
550 
551  !------------------------------------------------
552  ! End of prg_implicit_fermi_mod
553  !------------------------------------------------
554 
555  !------------------------------------------------
556  ! prg_chebyshev_mod
557  !------------------------------------------------
558 
559  subroutine prg_build_density_cheb_c(ham_bml_c, rho_bml_c, athr, threshold, ncoeffs, kbt, ef,&
560  bndfil, jon, verbose) bind(C, name="prg_build_density_cheb")
561  integer(c_int), value :: ncoeffs
562  integer(c_int), value :: verbose
563  real(c_double), value :: athr
564  real(c_double), value :: kbt
565  real(c_double), value :: bndfil
566  real(c_double), value :: threshold
567  real(c_double), value :: ef
568  type(c_ptr), value :: ham_bml_c
569  type(bml_matrix_t) :: ham_bml
570  type(c_ptr), value :: rho_bml_c
571  type(bml_matrix_t) :: rho_bml
572  integer(c_int), value :: jon
573  logical :: jon_l = .false.
574  if (jon==1) jon_l = .true.
575 
576  ham_bml%ptr = ham_bml_c
577  rho_bml%ptr = rho_bml_c
578  call prg_build_density_cheb(ham_bml, rho_bml, athr, threshold, ncoeffs, kbt, ef, bndfil,&
579  jon_l, verbose)
580  end subroutine prg_build_density_cheb_c
581 
582  subroutine prg_build_density_cheb_fermi_c(ham_bml_c, rho_bml_c, athr, threshold, ncoeffs, kbt,&
583  ef, bndfil, getef, fermitol, jon, npts, trkfunc, verbose)&
584  bind(C, name="prg_build_density_cheb_fermi")
585  type(c_ptr), value :: ham_bml_c
586  type(c_ptr), value :: rho_bml_c
587  integer(c_int), value :: npts
588  integer(c_int), value :: ncoeffs
589  integer(c_int), value :: verbose
590  real(c_double), value :: fermitol
591  real(c_double), value :: athr
592  real(c_double), value :: kbt
593  real(c_double), value :: bndfil
594  real(c_double), value :: threshold
595  real(c_double), value :: ef
596  type(bml_matrix_t) :: ham_bml
597  type(bml_matrix_t) :: rho_bml
598  integer(c_int), value :: getef
599  integer(c_int), value :: jon
600  integer(c_int), value :: trkfunc
601  logical :: getef_l = .false., jon_l = .false., trkfunc_l = .false.
602 
603  if (jon == 1) jon_l = .true.
604  if (getef == 1) getef_l = .true.
605  if (trkfunc == 1) trkfunc_l = .true.
606 
607  ham_bml%ptr = ham_bml_c
608  rho_bml%ptr = rho_bml_c
609 
610  call prg_build_density_cheb_fermi(ham_bml, rho_bml, athr, threshold, ncoeffs, kbt, ef, bndfil,&
611  getef_l, fermitol, jon_l, npts, trkfunc_l, verbose)
612 
613  end subroutine prg_build_density_cheb_fermi_c
614 
615  !------------------------------------------------
616  ! prg_dos_mod
617  !------------------------------------------------
618 
619  subroutine prg_write_tdos_c(nstates, eigenvals, gamma, npts, emin, emax, filename)&
620  bind(C, name="prg_write_tdos")
621  integer(c_int), value :: nstates, npts
622  real(c_double), target :: eigenvals(nstates)
623  real(c_double), value :: emax
624  real(c_double), value :: emin
625  real(c_double), value :: gamma
626  character(c_char), value :: filename
627 
628  call prg_write_tdos(eigenvals, gamma, npts, emin, emax, filename)
629  end subroutine prg_write_tdos_c
630 
631  !------------------------------------------------
632  ! prg_ewald_mod
633  !------------------------------------------------
634 
635  subroutine ewald_real_space_single_latte_c(COULOMBV, I, RXYZ, Box, Nr_elem, DELTAQ, J, U,&
636  Element_Pointer, Nr_atoms, COULACC, HDIM, Max_Nr_Neigh) bind(C, name="Ewald_Real_Space_Single_latte")
637  integer(c_int), value :: Nr_atoms
638  integer(c_int), value :: Nr_elem
639  integer(c_int), value :: HDIM
640  integer(c_int), value :: Max_Nr_Neigh
641  integer(c_int), value :: I
642  integer(c_int), value :: J
643  integer(c_int), target :: Element_Pointer(Nr_atoms)
644  real(c_double), value :: COULACC
645  real(c_double), target :: DELTAQ(Nr_atoms)
646  real(c_double), target :: RXYZ(3,Nr_atoms)
647  real(c_double), target :: Box(3,3)
648  real(c_double), target :: U(Nr_elem)
649  real(c_double), intent(out) :: COULOMBV
650  call ewald_real_space_single_latte(coulombv, i, rxyz, box, nr_elem, deltaq, j, u, element_pointer,&
651  nr_atoms, coulacc, hdim, max_nr_neigh)
652  end subroutine ewald_real_space_single_latte_c
653 
654  subroutine ewald_real_space_single_c(COULOMBV, FCOUL, I, RX, RY, RZ, LBox, DELTAQ, J, U,&
655  Element_Type, Nr_atoms, COULACC, TIMERATIO, HDIM, Max_Nr_Neigh)&
656  bind(C, name="Ewald_Real_Space_Single")
657  integer(c_int), value :: Nr_atoms
658  integer(c_int), value :: HDIM
659  integer(c_int), value :: Max_Nr_Neigh
660  integer(c_int), value :: I
661  integer(c_int), value :: J
662  real(c_double), value :: COULACC
663  real(c_double), value :: TIMERATIO
664  real(c_double), target :: DELTAQ(Nr_atoms)
665  real(c_double), target :: RX(Nr_atoms)
666  real(c_double), target :: RY(Nr_atoms)
667  real(c_double), target :: RZ(Nr_atoms)
668  real(c_double), target :: LBox(3)
669  real(c_double), target :: U(Nr_atoms)
670  character(c_char), target :: Element_Type(Nr_atoms)
671  real(c_double), intent(out) :: COULOMBV
672  real(c_double), intent(out) :: FCOUL(3)
673  call ewald_real_space_single(coulombv, fcoul, i, rx, ry, rz, lbox, deltaq, j, u, element_type,&
674  nr_atoms, coulacc, timeratio, hdim, max_nr_neigh)
675  end subroutine ewald_real_space_single_c
676 
677  subroutine ewald_real_space_matrix_latte_c(E, RXYZ, Box, U, Element_Pointer, Nr_atoms, COULACC,&
678  nebcoul, totnebcoul, HDIM, Max_Nr_Neigh, Nr_Elem)&
679  bind(C, name="Ewald_Real_Space_Matrix_latte")
680  integer(c_int), value :: Nr_atoms
681  integer(c_int), value :: HDIM
682  integer(c_int), value :: Max_Nr_Neigh
683  integer(c_int), value :: Nr_Elem
684  real(c_double), value :: COULACC
685  real(c_double), intent(out) :: E(Nr_atoms,Nr_atoms)
686  real(c_double), target :: RXYZ(3,Nr_atoms)
687  real(c_double), target :: Box(3,3)
688  real(c_double), target :: U(Nr_elem)
689  integer(c_int), target :: Element_Pointer(Nr_atoms)
690  integer(c_int), target :: totnebcoul(Nr_atoms)
691  integer(c_int), target :: nebcoul(4,Max_Nr_Neigh,Nr_atoms)
692  call ewald_real_space_matrix_latte(e, rxyz, box, u, element_pointer, nr_atoms, coulacc, nebcoul,&
693  totnebcoul, hdim, max_nr_neigh, nr_elem)
694  end subroutine ewald_real_space_matrix_latte_c
695 
696  subroutine ewald_real_space_latte_c(COULOMBV, I, RXYZ, Box, DELTAQ, U, Element_Pointer, Nr_atoms,&
697  COULACC, nebcoul, totnebcoul, HDIM, Max_Nr_Neigh, Nr_Elem)&
698  bind(C, name="Ewald_Real_Space_latte")
699  integer(c_int), value :: Nr_atoms
700  integer(c_int), value :: HDIM
701  integer(c_int), value :: Max_Nr_Neigh
702  integer(c_int), value :: I
703  integer(c_int), value :: Nr_Elem
704  real(c_double), value :: COULACC
705  real(c_double), target :: RXYZ(3,Nr_atoms)
706  real(c_double), target :: Box(3,3)
707  real(c_double), target :: DELTAQ(Nr_atoms)
708  real(c_double), target :: U(Nr_elem)
709  integer(c_int), target :: Element_Pointer(Nr_atoms)
710  integer(c_int), target :: totnebcoul(Nr_atoms)
711  integer(c_int), target :: nebcoul(4,Max_Nr_Neigh,Nr_atoms)
712  real(c_double), intent(out) :: COULOMBV
713  call ewald_real_space_latte(coulombv, i, rxyz, box, deltaq, u, element_pointer, nr_atoms, coulacc, &
714  nebcoul, totnebcoul, hdim, max_nr_neigh, nr_elem)
715  end subroutine ewald_real_space_latte_c
716 
717  subroutine ewald_real_space_test_c(COULOMBV, I, RX, RY, RZ, LBox, DELTAQ, U, Element_Type,&
718  Nr_atoms, COULACC, nnRx, nnRy, nnRz, nrnnlist, nnType, Max_Nr_Neigh)&
719  bind(C, name="Ewald_Real_Space_Test")
720  integer(c_int), value :: Nr_atoms
721  integer(c_int), value :: Max_Nr_Neigh
722  integer(c_int), value :: I
723  real(c_double), value :: COULACC
724  real(c_double), target :: RX(Nr_atoms)
725  real(c_double), target :: RY(Nr_atoms)
726  real(c_double), target :: RZ(Nr_atoms)
727  real(c_double), target :: LBox(3)
728  real(c_double), target :: DELTAQ(Nr_atoms)
729  real(c_double), target :: U(Nr_atoms)
730  character(c_char), target :: Element_Type(Nr_atoms)
731  integer(c_int), target :: nrnnlist(Nr_atoms)
732  integer(c_int), target :: nnType(Nr_atoms,Max_Nr_Neigh)
733  real(c_double), target :: nnRx(Nr_atoms,Max_Nr_Neigh)
734  real(c_double), target :: nnRy(Nr_atoms,Max_Nr_Neigh)
735  real(c_double), target :: nnRz(Nr_atoms,Max_Nr_Neigh)
736  real(c_double), intent(out) :: COULOMBV
737  call ewald_real_space_test(coulombv, i, rx, ry, rz, lbox, deltaq, u, element_type, nr_atoms,&
738  coulacc, nnrx, nnry, nnrz, nrnnlist, nntype, max_nr_neigh)
739  end subroutine ewald_real_space_test_c
740 
741  subroutine ewald_real_space_c(COULOMBV, FCOUL, I, RX, RY, RZ, LBox, DELTAQ, U, Element_Type,&
742  Nr_atoms, COULACC, TIMERATIO, nnRx, nnRy, nnRz, nrnnlist, nnType, HDIM, Max_Nr_Neigh)&
743  bind(C, name="Ewald_Real_Space")
744  integer(c_int), value :: Nr_atoms
745  integer(c_int), value :: HDIM
746  integer(c_int), value :: Max_Nr_Neigh
747  integer(c_int), value :: I
748  real(c_double), value :: COULACC
749  real(c_double), value :: TIMERATIO
750  real(c_double), target :: RX(Nr_atoms)
751  real(c_double), target :: RY(Nr_atoms)
752  real(c_double), target :: RZ(Nr_atoms)
753  real(c_double), target :: LBox(3)
754  real(c_double), target :: DELTAQ(Nr_atoms)
755  real(c_double), target :: U(Nr_atoms)
756  character(c_char), target :: Element_Type(Nr_atoms)
757  integer(c_int), target :: nrnnlist(Nr_atoms)
758  integer(c_int), target :: nnType(Nr_atoms,Max_Nr_Neigh)
759  real(c_double), target :: nnRx(Nr_atoms,Max_Nr_Neigh)
760  real(c_double), target :: nnRy(Nr_atoms,Max_Nr_Neigh)
761  real(c_double), target :: nnRz(Nr_atoms,Max_Nr_Neigh)
762  real(c_double), intent(out) :: COULOMBV
763  real(c_double), intent(out) :: FCOUL(3)
764  call ewald_real_space(coulombv, fcoul, i, rx, ry, rz, lbox, deltaq, u, element_type, nr_atoms,&
765  coulacc, timeratio, nnrx, nnry, nnrz, nrnnlist, nntype, hdim, max_nr_neigh)
766  end subroutine ewald_real_space_c
767 
768  !------------------------------------------------
769  ! prg_genz_mod
770  !------------------------------------------------
771 
772  subroutine prg_init_zspmat_c(igenz, zk1_bml_c, zk2_bml_c, zk3_bml_c, zk4_bml_c,&
773  zk5_bml_c, zk6_bml_c, norb, bml_type, bml_element_type) &
774  bind(C, name="prg_init_ZSPmat")
775  integer(c_int), value :: norb
776  integer(c_int), value :: igenz
777  character(c_char), value :: bml_type
778  character(c_char), value :: bml_element_type
779  type(c_ptr), value :: zk1_bml_c
780  type(bml_matrix_t) :: zk1_bml
781  type(c_ptr), value :: zk2_bml_c
782  type(bml_matrix_t) :: zk2_bml
783  type(c_ptr), value :: zk3_bml_c
784  type(bml_matrix_t) :: zk3_bml
785  type(c_ptr), value :: zk4_bml_c
786  type(bml_matrix_t) :: zk4_bml
787  type(c_ptr), value :: zk5_bml_c
788  type(bml_matrix_t) :: zk5_bml
789  type(c_ptr), value :: zk6_bml_c
790  type(bml_matrix_t) :: zk6_bml
791  zk1_bml%ptr = zk1_bml_c
792  zk2_bml%ptr = zk2_bml_c
793  zk3_bml%ptr = zk3_bml_c
794  zk4_bml%ptr = zk4_bml_c
795  zk5_bml%ptr = zk5_bml_c
796  zk6_bml%ptr = zk6_bml_c
797  call prg_init_zspmat(igenz, zk1_bml, zk2_bml, zk3_bml, zk4_bml, zk5_bml, zk6_bml, norb, bml_type, bml_element_type)
798  end subroutine prg_init_zspmat_c
799 
800  subroutine prg_genz_sp_initialz0_c(smat_bml_c, zmat_bml_c, norb, mdim, bml_type_f, threshold)&
801  bind(C, name="prg_genz_sp_initialz0")
802  character(c_char), value :: bml_type_f
803  integer(c_int), value :: mdim
804  integer(c_int), value :: norb
805  real(c_double), value :: threshold
806  type(c_ptr), value :: zmat_bml_c
807  type(bml_matrix_t) :: zmat_bml
808  type(c_ptr), value :: smat_bml_c
809  type(bml_matrix_t) :: smat_bml
810  zmat_bml%ptr = zmat_bml_c
811  smat_bml%ptr = smat_bml_c
812  call prg_genz_sp_initialz0(smat_bml, zmat_bml, norb, mdim, bml_type_f, threshold)
813  end subroutine prg_genz_sp_initialz0_c
814 
815  subroutine prg_genz_sp_initial_zmat_c(smat_bml_c, zmat_bml_c, norb, mdim, bml_type_f, threshold)&
816  bind(C, name="prg_genz_sp_initial_zmat")
817  character(c_char), value :: bml_type_f
818  integer(c_int), value :: mdim
819  integer(c_int), value :: norb
820  real(c_double), value :: threshold
821  type(c_ptr), value :: zmat_bml_c
822  type(bml_matrix_t) :: zmat_bml
823  type(c_ptr), value :: smat_bml_c
824  type(bml_matrix_t) :: smat_bml
825  zmat_bml%ptr = zmat_bml_c
826  smat_bml%ptr = smat_bml_c
827  call prg_genz_sp_initial_zmat(smat_bml, zmat_bml, norb, mdim, bml_type_f, threshold)
828  end subroutine prg_genz_sp_initial_zmat_c
829 
830  subroutine prg_genz_sp_ref_c(smat_bml_c, zmat_bml_c, nref, norb, bml_type, threshold)&
831  bind(C, name="prg_genz_sp_ref")
832  integer(c_int), value :: norb
833  integer(c_int), value :: nref
834  character(c_char), value :: bml_type
835  real(c_double), value :: threshold
836  type(c_ptr), value :: smat_bml_c
837  type(c_ptr), value :: zmat_bml_c
838  type(bml_matrix_t) :: smat_bml
839  type(bml_matrix_t) :: zmat_bml
840  smat_bml%ptr = smat_bml_c
841  zmat_bml%ptr = zmat_bml_c
842  call prg_genz_sp_ref(smat_bml, zmat_bml, nref, norb, bml_type, threshold)
843  end subroutine prg_genz_sp_ref_c
844 
845  !------------------------------------------------
846  ! prg_normalize_mod
847  !------------------------------------------------
848 
849  subroutine prg_normalize_c(h_bml_c) bind(C, name="prg_normalize")
850  type(c_ptr),value :: h_bml_c
851  type(bml_matrix_t) :: h_bml
852  h_bml%ptr = h_bml_c
853  call prg_normalize(h_bml)
854  end subroutine prg_normalize_c
855 
856  subroutine prg_normalize_fermi_c(h_bml_c, h1, hN, mu) bind(C, name="prg_normalize_fermi")
857  type(c_ptr),value :: h_bml_c
858  type(bml_matrix_t) :: h_bml
859  real(c_double), value :: h1
860  real(c_double), value :: hN
861  real(c_double), value :: mu
862  h_bml%ptr = h_bml_c
863  call prg_normalize_fermi(h_bml, h1, hn, mu)
864  end subroutine prg_normalize_fermi_c
865 
866  subroutine prg_normalize_implicit_fermi_c(h_bml_c, cnst, mu)&
867  bind(C, name="prg_normalize_implicit_fermi")
868  type(c_ptr),value :: h_bml_c
869  type(bml_matrix_t) :: h_bml
870  real(c_double), value :: cnst
871  real(c_double), value :: mu
872  h_bml%ptr = h_bml_c
873  call prg_normalize_implicit_fermi(h_bml, cnst, mu)
874  end subroutine prg_normalize_implicit_fermi_c
875 
876  subroutine prg_normalize_cheb_c(h_bml_c, mu, emin, emax, alpha, scaledmu)&
877  bind(C, name="prg_normalize_cheb")
878  type(c_ptr),value :: h_bml_c
879  type(bml_matrix_t) :: h_bml
880  real(c_double), value :: mu
881  real(c_double), value :: emin
882  real(c_double), value :: emax
883  real(c_double), value :: scaledmu
884  real(c_double), value :: alpha
885  h_bml%ptr = h_bml_c
886  call prg_normalize_cheb(h_bml, mu, emin, emax, alpha, scaledmu)
887  end subroutine prg_normalize_cheb_c
888 
889  !------------------------------------------------
890  ! prg_sys_mod
891  !------------------------------------------------
892 
893  subroutine prg_get_nameandext_c(fullfilename, filename, ext) bind(C, name="prg_get_nameandext")
894  character(c_char), value :: fullfilename
895  character(c_char), value :: filename
896  character(c_char), value :: ext
897  call prg_get_nameandext(fullfilename, filename, ext)
898  end subroutine prg_get_nameandext_c
899 
900  !------------------------------------------------
901  ! prg_sp2_mod
902  !------------------------------------------------
903 
904  subroutine prg_sp2_fermi_init_c(h_bml_c, nsteps, nocc, tscale, threshold, occErrLimit,&
905  traceLimit, x_bml_c, mu, beta, h1, hN, sgnlist, verbose) &
906  bind(C, name="prg_sp2_fermi_init")
907  type(c_ptr), value :: h_bml_c
908  type(c_ptr), value :: x_bml_c
909  type(bml_matrix_t) :: h_bml
910  type(bml_matrix_t) :: x_bml
911  integer(c_int), value :: nsteps
912  integer(c_int), intent(inout) :: sgnlist(nsteps)
913  integer(c_int), value :: verbose
914  real(c_double), value :: nocc
915  real(c_double), value :: tscale
916  real(c_double), value :: threshold
917  real(c_double), value :: occErrLimit
918  real(c_double), value :: traceLimit
919  real(c_double), intent(inout) :: mu
920  real(c_double), intent(inout) :: beta
921  real(c_double), intent(inout) :: h1
922  real(c_double), intent(inout) :: hN
923  h_bml%ptr = h_bml_c
924  x_bml%ptr = x_bml_c
925  call prg_sp2_fermi_init(h_bml, nsteps, nocc, tscale, threshold, occerrlimit, tracelimit,&
926  x_bml, mu, beta, h1, hn, sgnlist)
927  end subroutine prg_sp2_fermi_init_c
928 
929  subroutine prg_sp2_fermi_init_norecs_c(h_bml_c, nsteps, nocc, tscale, threshold, occErrLimit,&
930  traceLimit, x_bml_c, mu, beta, h1, hN, sgnlist, verbose)&
931  bind(C, name="prg_sp2_fermi_init_norecs")
932  type(c_ptr), value :: h_bml_c
933  type(bml_matrix_t) :: h_bml
934  type(c_ptr), value :: x_bml_c
935  type(bml_matrix_t) :: x_bml
936  integer(c_int), intent(inout) :: nsteps
937  integer(c_int), intent(inout) :: sgnlist(nsteps)
938  real(c_double), value :: nocc
939  real(c_double), value :: tscale
940  real(c_double), value :: threshold
941  real(c_double), value :: occErrLimit
942  real(c_double), value :: traceLimit
943  real(c_double), intent(inout) :: mu
944  real(c_double), intent(inout) :: beta
945  real(c_double), intent(inout) :: h1
946  real(c_double), intent(inout) :: hN
947  integer(c_int), value :: verbose
948  h_bml%ptr = h_bml_c
949  x_bml%ptr = x_bml_c
950  call prg_sp2_fermi_init_norecs(h_bml, nsteps, nocc, tscale, threshold, occerrlimit,&
951  tracelimit, x_bml, mu, beta, h1, hn, sgnlist, verbose)
952  end subroutine prg_sp2_fermi_init_norecs_c
953 
954  subroutine prg_sp2_fermi_c(h_bml_c, osteps, nsteps, nocc, mu, beta, h1, hN, sgnlist,&
955  threshold, eps, traceLimit, x_bml_c) bind(C, name="prg_sp2_fermi")
956  type(c_ptr), value :: h_bml_c
957  type(bml_matrix_t) :: h_bml
958  type(c_ptr), value :: x_bml_c
959  type(bml_matrix_t) :: x_bml
960  integer(c_int), value :: osteps
961  integer(c_int), value :: nsteps
962  integer(c_int), target :: sgnlist(nsteps)
963  real(c_double), value :: nocc
964  real(c_double), value :: threshold
965  real(c_double), value :: eps
966  real(c_double), value :: traceLimit
967  real(c_double), intent(inout) :: beta
968  real(c_double), intent(inout) :: h1
969  real(c_double), intent(inout) :: hN
970  real(c_double), intent(inout) :: mu
971  h_bml%ptr = h_bml_c
972  x_bml%ptr = x_bml_c
973  call prg_sp2_fermi(h_bml, osteps, nsteps, nocc, mu, beta, h1, hn, sgnlist, threshold,&
974  eps, tracelimit, x_bml)
975  end subroutine prg_sp2_fermi_c
976 
977  subroutine prg_sp2_entropy_function_c(mu, h1, hN, nsteps, sgnlist, GG, ee)&
978  bind(C, name="prg_sp2_entropy_function")
979  real(c_double), value :: mu
980  real(c_double), value :: h1
981  real(c_double), value :: hN
982  integer(c_int), value :: nsteps
983  integer(c_int), target :: sgnlist(nsteps)
984  real(c_double) :: GG(1001)
985  real(c_double) :: ee(1001)
986  real(c_double), allocatable :: GG_tmp(:), ee_tmp(:)
987  call prg_sp2_entropy_function(mu, h1, hn, nsteps, sgnlist, gg_tmp, ee_tmp)
988  gg = gg_tmp
989  ee = ee_tmp
990  deallocate(gg_tmp, ee_tmp)
991  end subroutine prg_sp2_entropy_function_c
992 
993  !------------------------------------------------
994  ! prg_pulaycomponent_mod
995  !------------------------------------------------
996  subroutine prg_pulaycomponent0_c(rho_bml_c, ham_bml_c, pcm_bml_c, threshold, M, &
997  verbose) bind(C, name="prg_PulayComponent0")
998  type(c_ptr), value :: rho_bml_c
999  type(bml_matrix_t) :: rho_bml
1000  type(c_ptr), value :: ham_bml_c
1001  type(bml_matrix_t) :: ham_bml
1002  type(c_ptr), value :: pcm_bml_c
1003  type(bml_matrix_t) :: pcm_bml
1004  integer(c_int), value :: M
1005  integer(c_int), value :: verbose
1006  real(c_double), value :: threshold
1007  rho_bml%ptr = rho_bml_c
1008  ham_bml%ptr = ham_bml_c
1009  pcm_bml%ptr = pcm_bml_c
1010  call prg_pulaycomponent0(rho_bml, ham_bml, pcm_bml, threshold, m, verbose)
1011  end subroutine prg_pulaycomponent0_c
1012 
1013  subroutine prg_pulaycomponentt_c(rho_bml_c, ham_bml_c, zmat_bml_c, pcm_bml_c, threshold, M,&
1014  bml_type, verbose) bind(C, name="prg_PulayComponentT")
1015  type(c_ptr), value :: rho_bml_c
1016  type(bml_matrix_t) :: rho_bml
1017  type(c_ptr), value :: ham_bml_c
1018  type(bml_matrix_t) :: ham_bml
1019  type(c_ptr), value :: zmat_bml_c
1020  type(bml_matrix_t) :: zmat_bml
1021  type(c_ptr), value :: pcm_bml_c
1022  type(bml_matrix_t) :: pcm_bml
1023  integer(c_int), value :: M
1024  integer(c_int), value :: verbose
1025  real(c_double), value :: threshold
1026  character(c_char), value :: bml_type
1027  rho_bml%ptr = rho_bml_c
1028  ham_bml%ptr = ham_bml_c
1029  zmat_bml%ptr = zmat_bml_c
1030  pcm_bml%ptr = pcm_bml_c
1031  call prg_pulaycomponentt(rho_bml, ham_bml, zmat_bml, pcm_bml, threshold, m, bml_type, verbose)
1032  end subroutine prg_pulaycomponentt_c
1033 
1034  subroutine prg_get_pulayforce_c(nats, zmat_bml_c, ham_bml_c, rho_bml_c, dSx_bml_c, dSy_bml_c,&
1035  dSz_bml_c, hindex_out, fpul_out, threshold) bind(C, name="prg_get_pulayforce")
1036  integer(c_int), value :: nats
1037  type(c_ptr), value :: dSx_bml_c
1038  type(bml_matrix_t) :: dSx_bml
1039  type(c_ptr), value :: dSy_bml_c
1040  type(bml_matrix_t) :: dSy_bml
1041  type(c_ptr), value :: dSz_bml_c
1042  type(bml_matrix_t) :: dSz_bml
1043  type(c_ptr), value :: rho_bml_c
1044  type(bml_matrix_t) :: rho_bml
1045  type(c_ptr), value :: ham_bml_c
1046  type(bml_matrix_t) :: ham_bml
1047  type(c_ptr), value :: zmat_bml_c
1048  type(bml_matrix_t) :: zmat_bml
1049  integer(c_int) :: hindex_out(2,nats)
1050  real(c_double) :: fpul_out(3,nats)
1051  real(c_double), allocatable :: fpul(:,:)
1052  integer(c_int), allocatable :: hindex(:,:)
1053  real(c_double), value :: threshold
1054  dsx_bml%ptr = dsx_bml_c
1055  dsy_bml%ptr = dsy_bml_c
1056  dsz_bml%ptr = dsz_bml_c
1057  rho_bml%ptr = rho_bml_c
1058  ham_bml%ptr = ham_bml_c
1059  zmat_bml%ptr = zmat_bml_c
1060 
1061  allocate(fpul(3,nats), hindex(2,nats))
1062  call prg_get_pulayforce(nats, zmat_bml, ham_bml, rho_bml, dsx_bml, dsy_bml, dsz_bml, hindex, fpul, threshold)
1063  fpul_out = fpul
1064  hindex_out = hindex
1065  deallocate(fpul, hindex)
1066 
1067  end subroutine prg_get_pulayforce_c
1068 
1069  !------------------------------------------------
1070  ! prg_sp2_mod
1071  !------------------------------------------------
1072 
1073  subroutine prg_sp2_basic_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv,&
1074  idemtol, verbose) bind(C, name="prg_sp2_basic")
1075  integer(c_int), value :: minsp2iter
1076  integer(c_int), value :: maxsp2iter
1077  integer(c_int), value :: verbose
1078  real(c_double), value :: bndfil
1079  real(c_double), value :: threshold
1080  real(c_double), value :: idemtol
1081  character(c_char), value :: sp2conv
1082  type(c_ptr), value :: rho_bml_c
1083  type(bml_matrix_t) :: rho_bml
1084  type(c_ptr), value :: h_bml_c
1085  type(bml_matrix_t) :: h_bml
1086  rho_bml%ptr = rho_bml_c
1087  h_bml%ptr = h_bml_c
1088  call prg_sp2_basic(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
1089  end subroutine prg_sp2_basic_c
1090 
1091  subroutine prg_sp2_basic_tcore_c(h_bml_c, rho_bml_c, rhofull_bml_c, threshold, bndfil, minsp2iter,&
1092  maxsp2iter, sp2conv, idemtol, verbose) bind(C, name="prg_sp2_basic_tcore")
1093  integer(c_int), value :: minsp2iter
1094  integer(c_int), value :: maxsp2iter
1095  integer(c_int), value :: verbose
1096  real(c_double), value :: bndfil
1097  real(c_double), value :: threshold
1098  real(c_double), value :: idemtol
1099  character(c_char), value :: sp2conv
1100  type(c_ptr), value :: rho_bml_c
1101  type(bml_matrix_t) :: rho_bml
1102  type(c_ptr), value :: rhofull_bml_c
1103  type(bml_matrix_t) :: rhofull_bml
1104  type(c_ptr), value :: h_bml_c
1105  type(bml_matrix_t) :: h_bml
1106  rho_bml%ptr = rho_bml_c
1107  rhofull_bml%ptr = rhofull_bml_c
1108  h_bml%ptr = h_bml_c
1109  call prg_sp2_basic_tcore(h_bml, rho_bml, rhofull_bml, threshold, bndfil, minsp2iter, maxsp2iter,&
1110  sp2conv, idemtol, verbose)
1111  end subroutine prg_sp2_basic_tcore_c
1112 
1113  subroutine prg_sp2_alg2_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv,&
1114  idemtol, verbose) bind(C, name="prg_sp2_alg2")
1115  integer(c_int), value :: minsp2iter
1116  integer(c_int), value :: maxsp2iter
1117  real(c_double), value :: threshold
1118  real(c_double), value :: bndfil
1119  real(c_double), value :: idemtol
1120  character(c_char), value :: sp2conv
1121  integer(c_int), value :: verbose
1122  type(c_ptr),value :: h_bml_c
1123  type(bml_matrix_t) :: h_bml
1124  type(c_ptr),value :: rho_bml_c
1125  type(bml_matrix_t) :: rho_bml
1126  h_bml%ptr = h_bml_c
1127  rho_bml%ptr = rho_bml_c
1128  call prg_sp2_alg2(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
1129  end subroutine prg_sp2_alg2_c
1130 
1131  subroutine prg_sp2_alg2_genseq_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv,&
1132  idemtol, pp, icount, vv, verbose) bind(C, name="prg_sp2_alg2_genseq")
1133  integer(c_int), value :: minsp2iter
1134  integer(c_int), value :: maxsp2iter
1135  integer(c_int), intent(inout) :: icount
1136  real(c_double), value :: threshold
1137  real(c_double), value :: bndfil
1138  real(c_double), value :: idemtol
1139  integer(c_int), target :: pp(maxsp2iter)
1140  real(c_double), target :: vv(maxsp2iter)
1141  character(c_char), value :: sp2conv
1142  integer(c_int), value :: verbose
1143  type(c_ptr),value :: h_bml_c
1144  type(bml_matrix_t) :: h_bml
1145  type(c_ptr),value :: rho_bml_c
1146  type(bml_matrix_t) :: rho_bml
1147  h_bml%ptr = h_bml_c
1148  rho_bml%ptr = rho_bml_c
1149  call prg_sp2_alg2_genseq(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol,&
1150  pp, icount, vv, verbose)
1151  end subroutine prg_sp2_alg2_genseq_c
1152 
1153  subroutine prg_sp2_alg2_seq_c(h_bml_c, rho_bml_c, threshold, pp, icount, vv, verbose)&
1154  bind(C, name="prg_sp2_alg2_seq")
1155  integer(c_int), intent(inout) :: icount
1156  integer(c_int), target :: pp(:)
1157  real(c_double), value :: threshold
1158  real(c_double), target :: vv(:)
1159  type(c_ptr),value :: h_bml_c
1160  type(bml_matrix_t) :: h_bml
1161  type(c_ptr),value :: rho_bml_c
1162  type(bml_matrix_t) :: rho_bml
1163  integer(c_int), value :: verbose
1164  h_bml%ptr = h_bml_c
1165  rho_bml%ptr = rho_bml_c
1166  call prg_sp2_alg2_seq(h_bml, rho_bml, threshold, pp, icount, vv, verbose)
1167  end subroutine prg_sp2_alg2_seq_c
1168 
1169  subroutine prg_prg_sp2_alg2_seq_inplace_c(rho_bml_c, threshold, ppsize, pp, icount, vv, mineval, maxeval) &
1170  !verbose)
1171  bind(C, name="prg_prg_sp2_alg2_seq_inplace")
1172  integer(c_int), intent(inout) :: icount
1173  integer(c_int), value :: ppsize
1174  integer(c_int), target :: pp(ppsize)
1175  real(c_double), value :: threshold
1176  real(c_double), target :: vv(ppsize)
1177  real(c_double), value :: mineval
1178  real(c_double), value :: maxeval
1179  type(c_ptr),value :: rho_bml_c
1180  type(bml_matrix_t) :: rho_bml
1181  !integer(c_int), value :: verbose
1182  rho_bml%ptr = rho_bml_c
1183  call prg_prg_sp2_alg2_seq_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval) !verbose)
1184  end subroutine prg_prg_sp2_alg2_seq_inplace_c
1185 
1186  subroutine prg_sp2_alg1_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter,&
1187  sp2conv, idemtol, verbose) bind(C, name="prg_sp2_alg1")
1188  integer(c_int), value :: minsp2iter
1189  integer(c_int), value :: maxsp2iter
1190  integer(c_int), value :: verbose
1191  real(c_double), value :: threshold
1192  real(c_double), value :: bndfil
1193  real(c_double), value :: idemtol
1194  character(c_char), value :: sp2conv
1195  type(c_ptr),value :: h_bml_c
1196  type(bml_matrix_t) :: h_bml
1197  type(c_ptr),value :: rho_bml_c
1198  type(bml_matrix_t) :: rho_bml
1199  h_bml%ptr = h_bml_c
1200  rho_bml%ptr = rho_bml_c
1201 
1202  call prg_sp2_alg1(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv,&
1203  idemtol, verbose)
1204  end subroutine prg_sp2_alg1_c
1205 
1206  subroutine prg_sp2_alg1_genseq_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, &
1207  maxsp2iter, sp2conv, idemtol, pp, icount, vv) bind(C, name="prg_sp2_alg1_genseq")
1208  integer(c_int), value :: minsp2iter
1209  integer(c_int), value :: maxsp2iter
1210  integer(c_int), intent(inout) :: icount
1211  real(c_double), value :: threshold
1212  real(c_double), value :: bndfil
1213  real(c_double), value :: idemtol
1214  real(c_double), target :: vv(maxsp2iter)
1215  integer(c_int), target :: pp(maxsp2iter)
1216  character(c_char), value :: sp2conv
1217  type(c_ptr),value :: h_bml_c
1218  type(bml_matrix_t) :: h_bml
1219  type(c_ptr),value :: rho_bml_c
1220  type(bml_matrix_t) :: rho_bml
1221  h_bml%ptr = h_bml_c
1222  rho_bml%ptr = rho_bml_c
1223  call prg_sp2_alg1_genseq(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, pp, icount, vv)
1224  end subroutine prg_sp2_alg1_genseq_c
1225 
1226  subroutine prg_sp2_alg1_seq_c(h_bml_c, rho_bml_c, threshold, pp, icount, vv)&
1227  bind(C, name="prg_sp2_alg1_seq")
1228  integer(c_int), intent(inout) :: icount
1229  integer(c_int), target :: pp(:)
1230  real(c_double), value :: threshold
1231  real(c_double), target :: vv(:)
1232  type(c_ptr),value :: h_bml_c
1233  type(bml_matrix_t) :: h_bml
1234  type(c_ptr),value :: rho_bml_c
1235  type(bml_matrix_t) :: rho_bml
1236  h_bml%ptr = h_bml_c
1237  rho_bml%ptr = rho_bml_c
1238  call prg_sp2_alg1_seq(h_bml, rho_bml, threshold, pp, icount, vv)
1239  end subroutine prg_sp2_alg1_seq_c
1240 
1241  subroutine prg_prg_sp2_alg1_seq_inplace_c(rho_bml_c, threshold, ppsize, pp, icount, vv, mineval, maxeval)&
1242  bind(C, name="prg_prg_sp2_alg1_seq_inplace")
1243  integer(c_int), value :: ppsize
1244  integer(c_int), intent(inout) :: icount
1245  integer(c_int), target :: pp(ppsize)
1246  real(c_double), value :: threshold
1247  real(c_double), target :: vv(ppsize)
1248  real(c_double), value :: mineval
1249  real(c_double), value :: maxeval
1250  type(c_ptr),value :: rho_bml_c
1251  type(bml_matrix_t) :: rho_bml
1252  rho_bml%ptr = rho_bml_c
1253  call prg_prg_sp2_alg1_seq_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval)
1254 
1255  end subroutine prg_prg_sp2_alg1_seq_inplace_c
1256 
1257  subroutine prg_sp2_submatrix_c(ham_bml_c, rho_bml_c, threshold, pp, icount, vv, mineval, maxeval,&
1258  core_size) bind(C, name="prg_sp2_submatrix")
1259  integer(c_int), intent(inout) :: icount
1260  integer(c_int), target :: pp(:)
1261  integer(c_int), value :: core_size
1262  real(c_double), value :: threshold
1263  real(c_double), target :: vv(:)
1264  real(c_double), value :: mineval
1265  real(c_double), value :: maxeval
1266  type(c_ptr),value :: ham_bml_c
1267  type(bml_matrix_t) :: ham_bml
1268  type(c_ptr),value :: rho_bml_c
1269  type(bml_matrix_t) :: rho_bml
1270  ham_bml%ptr = ham_bml_c
1271  rho_bml%ptr = rho_bml_c
1272  call prg_sp2_submatrix(ham_bml, rho_bml, threshold, pp, icount, vv, mineval, maxeval, core_size)
1273  end subroutine prg_sp2_submatrix_c
1274 
1275  subroutine prg_sp2_submatrix_inplace_c(rho_bml_c, threshold, pp, icount, vv, mineval, maxeval,&
1276  core_size) bind(C, name="prg_sp2_submatrix_inplace")
1277  integer(c_int), intent(inout) :: icount
1278  integer(c_int), target :: pp(:)
1279  integer(c_int), value :: core_size
1280  real(c_double), value :: threshold
1281  real(c_double), target :: vv(:)
1282  real(c_double), value :: mineval
1283  real(c_double), value :: maxeval
1284  type(c_ptr),value :: rho_bml_c
1285  type(bml_matrix_t) :: rho_bml
1286  rho_bml%ptr = rho_bml_c
1287  call prg_sp2_submatrix_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval, core_size)
1288  end subroutine prg_sp2_submatrix_inplace_c
1289 
1290  !------------------------------------------------
1291  ! prg_timer_mod
1292  !------------------------------------------------
1293 
1294  subroutine timer_prg_init_c() bind(C, name="timer_prg_init")
1295  call timer_prg_init()
1296  end subroutine timer_prg_init_c
1297 
1298  subroutine prg_timer_shutdown_c() bind(C, name="prg_timer_shutdown")
1299  call prg_timer_shutdown()
1300  end subroutine prg_timer_shutdown_c
1301 
1302  subroutine prg_timer_start_c(itimer, tag) bind(C, name="prg_timer_start")
1303  integer(c_int) :: itimer
1304  character(c_char), value :: tag
1305  call prg_timer_start(itimer, tag)
1306  end subroutine prg_timer_start_c
1307 
1308  subroutine prg_timer_stop_c(itimer, verbose) bind(C, name="prg_timer_stop")
1309  integer(c_int) :: itimer, verbose
1310  call prg_timer_stop(itimer, verbose)
1311  end subroutine prg_timer_stop_c
1312 
1313  subroutine prg_timer_collect_c() bind(C, name="prg_timer_collect")
1314  call prg_timer_collect()
1315  end subroutine prg_timer_collect_c
1316 
1317  subroutine prg_timer_results_c() bind(C, name="prg_timer_results")
1318  call prg_timer_results()
1319  end subroutine prg_timer_results_c
1320 
1321  subroutine prg_print_date_and_time_c(tag) bind(C, name="prg_print_date_and_time")
1322  character(c_char), value :: tag
1323  call prg_print_date_and_time(tag)
1324  end subroutine prg_print_date_and_time_c
1325 
1326 
1327 
1328  !------------------------------------------------
1329  ! prg_openfiles_mod
1330  !------------------------------------------------
1331 
1332  subroutine prg_open_file_c(io, name) bind(C, name="prg_open_file")
1333  character(c_char), value :: name
1334  integer(c_int), value :: io
1335  call prg_open_file(io, name)
1336  end subroutine prg_open_file_c
1337 
1338  subroutine prg_open_file_to_read_c(io, name) bind(C, name="prg_open_file_to_read")
1339  character(c_char), value :: name
1340  integer(c_int), value :: io
1341  call prg_open_file_to_read(io, name)
1342  end subroutine prg_open_file_to_read_c
1343 
1344  !------------------------------------------------
1345  ! prg_parallel_mod
1346  !------------------------------------------------
1347  subroutine prg_initparallel_c() bind(C, name="prg_initParallel")
1348  call prg_initparallel()
1349  end subroutine prg_initparallel_c
1350 
1351  subroutine prg_shutdownparallel_c() bind(C, name="prg_shutdownParallel")
1352  call prg_shutdownparallel()
1353  end subroutine prg_shutdownparallel_c
1354 
1355  subroutine prg_barrierparallel_c() bind(C, name="prg_barrierParallel")
1356  call prg_barrierparallel()
1357  end subroutine prg_barrierparallel_c
1358 
1359  subroutine sendreceiveparallel_c(sendBuf, sendLen, dest, recvBuf, recvLen, source, nreceived) bind(C, name="sendReceiveParallel")
1360  integer(c_int), value :: sendLen
1361  integer(c_int), value :: recvLen
1362  real(c_double), target :: sendBuf(sendLen)
1363  real(c_double), intent(out) :: recvBuf(recvLen)
1364  integer(c_int), value :: dest
1365  integer(c_int), value :: source
1366  integer(c_int), value :: nreceived
1367  call sendreceiveparallel(sendbuf, sendlen, dest, recvbuf, recvlen, source, nreceived)
1368  end subroutine sendreceiveparallel_c
1369 
1370  subroutine isendparallel_c(sendBuf, sendLen, dest) bind(C, name="isendParallel")
1371  real(c_double),target :: sendBuf(sendLen)
1372  integer(c_int),value :: sendLen
1373  integer(c_int),value :: dest
1374  call isendparallel(sendbuf, sendlen, dest)
1375  end subroutine isendparallel_c
1376 
1377  subroutine sendparallel_c(sendBuf, sendLen, dest) bind(C, name="sendParallel")
1378  real(c_double),target :: sendBuf(sendLen)
1379  integer(c_int),value :: sendLen
1380  integer(c_int),value :: dest
1381  call sendparallel(sendbuf, sendlen, dest)
1382  end subroutine sendparallel_c
1383 
1384  subroutine prg_iprg_recvparallel_c(recvBuf, recvLen, rind) bind(C, name="prg_iprg_recvParallel")
1385  real(c_double), target :: recvBuf(recvLen)
1386  integer(c_int),value :: recvLen
1387  integer(c_int), value :: rind
1388  call prg_iprg_recvparallel(recvbuf, recvlen, rind)
1389  end subroutine prg_iprg_recvparallel_c
1390 
1391  subroutine prg_recvparallel_c(recvBuf, recvLen) bind(C, name="prg_recvParallel")
1392  real(c_double), target :: recvBuf(recvLen)
1393  integer(c_int),value :: recvLen
1394  call prg_recvparallel(recvbuf, recvlen)
1395  end subroutine prg_recvparallel_c
1396 
1397  subroutine sumintparallel_c(sendBuf, recvBuf, icount) bind(C, name="sumIntParallel")
1398  integer(c_int),target :: sendBuf(icount)
1399  integer(c_int), target :: recvBuf(icount)
1400  integer(c_int),value :: icount
1401  call sumintparallel(sendbuf, recvbuf, icount)
1402  end subroutine sumintparallel_c
1403 
1404  subroutine sumrealparallel_c(sendBuf, recvBuf, icount) bind(C, name="sumRealParallel")
1405  real(c_double),target :: sendBuf(icount)
1406  real(c_double),intent(out) :: recvBuf(icount)
1407  integer(c_int),value :: icount
1408  call sumrealparallel(sendbuf, recvbuf, icount)
1409  end subroutine sumrealparallel_c
1410 
1411  subroutine maxintparallel_c(sendBuf, recvBuf, icount) bind(C, name="maxIntParallel")
1412  integer(c_int),target :: sendBuf(icount)
1413  integer(c_int),intent(out) :: recvBuf(icount)
1414  integer(c_int),value :: icount
1415  call maxintparallel(sendbuf, recvbuf, icount)
1416  end subroutine maxintparallel_c
1417 
1418  subroutine maxrealparallel_c(sendBuf, recvBuf, icount) bind(C, name="maxRealParallel")
1419  real(c_double),target :: sendBuf(icount)
1420  real(c_double),intent(out) :: recvBuf(icount)
1421  integer(c_int),value :: icount
1422  call maxrealparallel(sendbuf, recvbuf, icount)
1423  end subroutine maxrealparallel_c
1424 
1425  subroutine minintparallel_c(sendBuf, recvBuf, icount) bind(C, name="minIntParallel")
1426  integer(c_int),target :: sendBuf(icount)
1427  integer(c_int),intent(out) :: recvBuf(icount)
1428  integer(c_int),value :: icount
1429  call minintparallel(sendbuf, recvbuf, icount)
1430  end subroutine minintparallel_c
1431 
1432  subroutine minrealparallel_c(sendBuf, recvBuf, icount) bind(C, name="minRealParallel")
1433  real(c_double),target :: sendBuf(icount)
1434  real(c_double),intent(out) :: recvBuf(icount)
1435  integer(c_int),value :: icount
1436  call minrealparallel(sendbuf, recvbuf, icount)
1437  end subroutine minrealparallel_c
1438 
1439  subroutine prg_minrealreduce_c(rvalue) bind(C, name="prg_minRealReduce")
1440  real(c_double),value :: rvalue
1441  call prg_minrealreduce(rvalue)
1442  end subroutine prg_minrealreduce_c
1443 
1444  subroutine prg_maxrealreduce_c(rvalue) bind(C, name="prg_maxRealReduce")
1445  real(c_double),value :: rvalue
1446  call prg_maxrealreduce(rvalue)
1447  end subroutine prg_maxrealreduce_c
1448 
1449  subroutine prg_maxintreduce2_c(value1, value2) bind(C, name="prg_maxIntReduce2")
1450  integer(c_int),value :: value1
1451  integer(c_int),value :: value2
1452  call prg_maxintreduce2(value1, value2)
1453  end subroutine prg_maxintreduce2_c
1454 
1455  subroutine prg_sumintreduce2_c(value1, value2) bind(C, name="prg_sumIntReduce2")
1456  integer(c_int), value :: value1
1457  integer(c_int), value :: value2
1458  call prg_sumintreduce2(value1, value2)
1459  end subroutine prg_sumintreduce2_c
1460 
1461 
1462 end module prg_c_interface
subroutine prg_timer_results_c()
subroutine prg_sp2_alg2_seq_c(h_bml_c, rho_bml_c, threshold, pp, icount, vv, verbose)
subroutine prg_sp2_fermi_init_norecs_c(h_bml_c, nsteps, nocc, tscale, threshold, occErrLimit, traceLimit, x_bml_c, mu, beta, h1, hN, sgnlist, verbose)
subroutine prg_timer_collect_c()
subroutine prg_normalize_cheb_c(h_bml_c, mu, emin, emax, alpha, scaledmu)
subroutine prg_implicit_fermi_first_order_response_c(H0_bml_c, H1_bml_c, P0_bml_c, P1_bml_c, Inv_bml_c, nsteps, mu0, beta, nocc, threshold)
subroutine prg_iprg_recvparallel_c(recvBuf, recvLen, rind)
subroutine minrealparallel_c(sendBuf, recvBuf, icount)
subroutine prg_sp2_submatrix_c(ham_bml_c, rho_bml_c, threshold, pp, icount, vv, mineval, maxeval, core_size)
subroutine ewald_real_space_single_c(COULOMBV, FCOUL, I, RX, RY, RZ, LBox, DELTAQ, J, U, Element_Type, Nr_atoms, COULACC, TIMERATIO, HDIM, Max_Nr_Neigh)
subroutine prg_timer_start_c(itimer, tag)
subroutine ewald_real_space_c(COULOMBV, FCOUL, I, RX, RY, RZ, LBox, DELTAQ, U, Element_Type, Nr_atoms, COULACC, TIMERATIO, nnRx, nnRy, nnRz, nrnnlist, nnType, HDIM, Max_Nr_Neigh)
subroutine prg_shutdownparallel_c()
subroutine, public prg_build_density_t_ed_c(norbs, ham_bml_c, rho_bml_c, evects_bml_c, threshold, bndfil, kbt, ef, evals_out, dvals_out, hindex_out, llsize, verbose)
subroutine prg_get_hscf_v2_c(nats, ham0_bml_c, over_bml_c, ham_bml_c, spindex, hindex, hubbardu, charges, coulomb_pot_r, coulomb_pot_k, mdimin, threshold)
subroutine prg_pulaycomponentt_c(rho_bml_c, ham_bml_c, zmat_bml_c, pcm_bml_c, threshold, M, bml_type, verbose)
subroutine ewald_real_space_latte_c(COULOMBV, I, RXYZ, Box, DELTAQ, U, Element_Pointer, Nr_atoms, COULACC, nebcoul, totnebcoul, HDIM, Max_Nr_Neigh, Nr_Elem)
subroutine prg_pulaycomponent0_c(rho_bml_c, ham_bml_c, pcm_bml_c, threshold, M, verbose)
subroutine maxintparallel_c(sendBuf, recvBuf, icount)
subroutine prg_sp2_submatrix_inplace_c(rho_bml_c, threshold, pp, icount, vv, mineval, maxeval, core_size)
subroutine prg_open_file_c(io, name)
subroutine minintparallel_c(sendBuf, recvBuf, icount)
subroutine, public prg_progress_shutdown_c()
subroutine maxrealparallel_c(sendBuf, recvBuf, icount)
subroutine ewald_real_space_single_latte_c(COULOMBV, I, RXYZ, Box, Nr_elem, DELTAQ, J, U, Element_Pointer, Nr_atoms, COULACC, HDIM, Max_Nr_Neigh)
subroutine, public prg_version_c()
subroutine prg_normalize_c(h_bml_c)
character(len=size(c_str)) function string_c2f(c_str)
subroutine prg_get_nameandext_c(fullfilename, filename, ext)
subroutine sendreceiveparallel_c(sendBuf, sendLen, dest, recvBuf, recvLen, source, nreceived)
subroutine, public prg_build_density_t_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil, kbt, ef, eigenvalues_out)
subroutine, public prg_build_density_t0_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil, eigenvalues_out)
subroutine timer_prg_init_c()
subroutine prg_genz_sp_initialz0_c(smat_bml_c, zmat_bml_c, norb, mdim, bml_type_f, threshold)
subroutine prg_normalize_fermi_c(h_bml_c, h1, hN, mu)
subroutine prg_sp2_alg1_genseq_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, pp, icount, vv)
subroutine prg_sp2_entropy_function_c(mu, h1, hN, nsteps, sgnlist, GG, ee)
subroutine prg_init_zspmat_c(igenz, zk1_bml_c, zk2_bml_c, zk3_bml_c, zk4_bml_c, zk5_bml_c, zk6_bml_c, norb, bml_type, bml_element_type)
subroutine prg_initparallel_c()
subroutine prg_recvparallel_c(recvBuf, recvLen)
subroutine, public prg_build_density_t_fermi_c(ham_bml_c, rho_bml_c, threshold, kbt, ef, verbose, drho)
subroutine prg_maxintreduce2_c(value1, value2)
subroutine, public prg_build_atomic_density_c(rhoat_bml_c, numel, hindex, spindex, norb, bml_type)
subroutine prg_implicit_fermi_zero_c(h_bml_c, p_bml_c, nsteps, mu, method, threshold, tol)
subroutine prg_build_density_cheb_c(ham_bml_c, rho_bml_c, athr, threshold, ncoeffs, kbt, ef, bndfil, jon, verbose)
subroutine, public prg_get_flevel_nt_c(norbs, eigenvalues, kbt, bndfil, tol, ef, verbose)
subroutine, public prg_build_density_t_fulldata_c(norbs, ham_bml_c, rho_bml_c, threshold, bndfil, kbt, ef, eigenvalues_out, evects_bml_c, fvals_out)
subroutine prg_implicit_fermi_save_inverse_c(Inv_bml_c, h_bml_c, p_bml_c, nsteps, nocc, mu, beta, occErrLimit, threshold, tol, SCF_IT, occiter, totns)
subroutine prg_sp2_alg1_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
subroutine prg_get_hscf_c(nats, ham0_bml_c, over_bml_c, ham_bml_c, spindex, hindex, hubbardu, charges, coulomb_pot_r, coulomb_pot_k, mdimin, threshold)
subroutine prg_prg_sp2_alg2_seq_inplace_c(rho_bml_c, threshold, ppsize, pp, icount, vv, mineval, maxeval)
subroutine prg_print_date_and_time_c(tag)
subroutine sendparallel_c(sendBuf, sendLen, dest)
subroutine ewald_real_space_matrix_latte_c(E, RXYZ, Box, U, Element_Pointer, Nr_atoms, COULACC, nebcoul, totnebcoul, HDIM, Max_Nr_Neigh, Nr_Elem)
subroutine ewald_real_space_test_c(COULOMBV, I, RX, RY, RZ, LBox, DELTAQ, U, Element_Type, Nr_atoms, COULACC, nnRx, nnRy, nnRz, nrnnlist, nnType, Max_Nr_Neigh)
subroutine prg_write_tdos_c(nstates, eigenvals, gamma, npts, emin, emax, filename)
subroutine, public prg_tocanonicalspace_c(mat_bml_c, matCan_bml_c, evects_bml_c, threshold, verbose)
subroutine prg_get_charges_c(nats, norbs, rho_bml_c, over_bml_c, hindex, charges, numel, spindex, mdimin, threshold)
subroutine prg_barrierparallel_c()
subroutine prg_prg_sp2_alg1_seq_inplace_c(rho_bml_c, threshold, ppsize, pp, icount, vv, mineval, maxeval)
subroutine, public prg_toeigenspace_c(mat_bml_c, matEig_bml_c, evects_bml_c, threshold, verbose)
subroutine prg_implicit_fermi_c(h_bml_c, p_bml_c, nsteps, k, nocc, mu, beta, method, osteps, occErrLimit, threshold, tol)
subroutine, public prg_get_eigenvalues_c(norbs, ham_bml_c, eigenvalues_out, verbose)
subroutine prg_minrealreduce_c(rvalue)
subroutine prg_maxrealreduce_c(rvalue)
subroutine, public prg_check_idempotency_c(mat_bml_c, threshold, idempotency)
subroutine isendparallel_c(sendBuf, sendLen, dest)
subroutine prg_sp2_basic_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
subroutine prg_sp2_alg2_genseq_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, pp, icount, vv, verbose)
subroutine, public prg_build_density_fromevalsandevects_c(norbs, evects_bml_c, evals, rho_bml_c, threshold, bndfil, kbt, ef, verbose)
subroutine prg_sp2_fermi_init_c(h_bml_c, nsteps, nocc, tscale, threshold, occErrLimit, traceLimit, x_bml_c, mu, beta, h1, hN, sgnlist, verbose)
subroutine prg_timer_shutdown_c()
subroutine, public prg_get_flevel_c(norbs, eigenvalues, kbt, bndfil, tol, Ef)
subroutine, public canon_dm_prt_c(P1, H1, Nocc, T, Q, e, mu0, m, HDIM)
subroutine sumrealparallel_c(sendBuf, recvBuf, icount)
subroutine prg_sp2_basic_tcore_c(h_bml_c, rho_bml_c, rhofull_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
subroutine prg_sp2_alg1_seq_c(h_bml_c, rho_bml_c, threshold, pp, icount, vv)
subroutine prg_genz_sp_ref_c(smat_bml_c, zmat_bml_c, nref, norb, bml_type, threshold)
subroutine prg_test_density_matrix_c(ham_bml_c, p_bml_c, beta, mu, nocc, osteps, occErrLimit, threshold)
subroutine prg_open_file_to_read_c(io, name)
subroutine prg_get_pulayforce_c(nats, zmat_bml_c, ham_bml_c, rho_bml_c, dSx_bml_c, dSy_bml_c, dSz_bml_c, hindex_out, fpul_out, threshold)
subroutine prg_normalize_implicit_fermi_c(h_bml_c, cnst, mu)
subroutine prg_timer_stop_c(itimer, verbose)
subroutine, public prg_get_evalsdvalsevects_c(norbs, ham_bml_c, threshold, hindex_in, llsize, evals_out, dvals_out, evects_bml_c, verbose)
subroutine prg_sp2_alg2_c(h_bml_c, rho_bml_c, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
subroutine prg_genz_sp_initial_zmat_c(smat_bml_c, zmat_bml_c, norb, mdim, bml_type_f, threshold)
subroutine, public prg_progress_init_c()
subroutine prg_build_density_cheb_fermi_c(ham_bml_c, rho_bml_c, athr, threshold, ncoeffs, kbt, ef, bndfil, getef, fermitol, jon, npts, trkfunc, verbose)
subroutine sumintparallel_c(sendBuf, recvBuf, icount)
subroutine prg_sumintreduce2_c(value1, value2)
subroutine prg_sp2_fermi_c(h_bml_c, osteps, nsteps, nocc, mu, beta, h1, hN, sgnlist, threshold, eps, traceLimit, x_bml_c)
A module to compute the Mulliken charges of a chemical system.
subroutine, public prg_get_hscf(ham0_bml, over_bml, ham_bml, spindex, hindex, hubbardu, charges, coulomb_pot_r, coulomb_pot_k, mdimin, threshold)
Constructs the SCF Hamiltonian given H0, HubbardU and charges. This routine does: ,...
subroutine, public prg_get_hscf_v2(ham0_bml, over_bml, ham_bml, spindex, hindex, hubbardu, charges, coulomb_pot_r, coulomb_pot_k, mdimin, threshold)
subroutine, public prg_get_charges(rho_bml, over_bml, hindex, charges, numel, spindex, mdimin, threshold)
Constructs the charges from the density matrix.
Module to obtain the density matrix by applying a Chebyshev polynomial expansion.
subroutine, public prg_build_density_cheb_fermi(ham_bml, rho_bml, athr, threshold, ncoeffs, kbt, ef, bndfil, getef, fermitol, jon, npts, trkfunc, verbose)
Builds the density matrix from for a Fermi function approximated with a Chebyshev polynomial expansi...
subroutine, public prg_build_density_cheb(ham_bml, rho_bml, athr, threshold, ncoeffs, kbt, ef, bndfil, jon, verbose)
Builds the density matrix from for a Fermi function approximated with a Chebyshev polynomial expansi...
Module to obtain the density matrix by diagonalizing an orthogonalized Hamiltonian.
subroutine, public prg_get_flevel_nt(eigenvalues, kbt, bndfil, tol, ef, err, verbose)
Routine to compute the Fermi level given a set of eigenvalues and a temperature. It applies the Newto...
subroutine, public prg_build_density_t(ham_bml, rho_bml, threshold, bndfil, kbt, ef, eigenvalues_out)
Builds the density matrix from for electronic temperature T. Where, is the matrix eigenvector and ...
subroutine, public prg_build_density_t_fermi(ham_bml, rho_bml, threshold, kbt, ef, verbose, drho)
Builds the density matrix from for electronic temperature T. Where, is the matrix eigenvector and ...
subroutine, public prg_build_density_t0(ham_bml, rho_bml, threshold, bndfil, eigenvalues_out)
Builds the density matrix from for zero electronic temperature. Where, is the matrix eigenvector a...
subroutine, public prg_build_density_t_ed(ham_bml, rho_bml, evects_bml, threshold, bndfil, kbt, ef, evals, dvals, hindex, llsize, verbose)
Builds the density matrix from for electronic temperature T. Where, is the matrix eigenvector and ...
subroutine, public prg_get_eigenvalues(ham_bml, eigenvalues, verbose)
Gets the eigenvalues of the Orthogonalized Hamiltonian.
subroutine, public prg_tocanonicalspace(mat_bml, matCan_bml, evects_bml, threshold, verbose)
Change an operator into the eigenspace representation.
subroutine, public prg_check_idempotency(mat_bml, threshold, idempotency)
To check the idempotency error of a matrix. This is calculated as the Frobenius norm of .
subroutine, public prg_build_atomic_density(rhoat_bml, numel, hindex, spindex, norb, bml_type)
Builds the atomic density matrix. Where, is the number of electrons for orbital i.
subroutine, public prg_build_density_t_fulldata(ham_bml, rho_bml, threshold, bndfil, kbt, ef, eigenvalues_out, evects_bml, fvals)
Builds the density matrix from for electronic temperature T. Where, is the matrix eigenvector and ...
subroutine, public canon_dm_prt(P1, H1, Nocc, T, Q, e, mu0, m, HDIM)
subroutine, public prg_get_evalsdvalsevects(ham_bml, threshold, hindex, llsize, evals, dvals, evects_bml, verbose)
Gets the eigenvalues and eigenvectors and the core contribution to each eigenvalue (dvals) .
subroutine, public prg_toeigenspace(mat_bml, matEig_bml, evects_bml, threshold, verbose)
Change an operator into the eigenspace representation.
subroutine, public prg_build_density_fromevalsandevects(evects_bml, evals, rho_bml, threshold, bndfil, kbt, ef, verbose)
Builds the density matrix from the evects and evals for electronic temperature T.
subroutine, public prg_get_flevel(eigenvalues, kbt, bndfil, tol, Ef, err)
Routine to compute the Fermi level given a set of eigenvalues and a temperature. It applies the Bisec...
A module to compute the Density of state (DOS) and lDOS.
Definition: prg_dos_mod.F90:8
subroutine, public prg_write_tdos(eigenvals, gamma, npts, emin, emax, filename)
Writes the total DOS into a file. Where .
Definition: prg_dos_mod.F90:35
subroutine, public ewald_real_space_single_latte(COULOMBV, I, RXYZ, Box, Nr_elem, DELTAQ, J, U, Element_Pointer, Nr_atoms, COULACC, HDIM, Max_Nr_Neigh)
Find Coulomb potential on site I from single charge at site J.
subroutine, public ewald_real_space(COULOMBV, FCOUL, I, RX, RY, RZ, LBox, DELTAQ, U, Element_Type, Nr_atoms, COULACC, TIMERATIO, nnRx, nnRy, nnRz, nrnnlist, nnType, HDIM, Max_Nr_Neigh)
subroutine, public ewald_real_space_test(COULOMBV, I, RX, RY, RZ, LBox, DELTAQ, U, Element_Type, Nr_atoms, COULACC, nnRx, nnRy, nnRz, nrnnlist, nnType, Max_Nr_Neigh)
subroutine, public ewald_real_space_latte(COULOMBV, I, RXYZ, Box, DELTAQ, U, Element_Pointer, Nr_atoms, COULACC, nebcoul, totnebcoul, HDIM, Max_Nr_Neigh, Nr_Elem)
subroutine, public ewald_real_space_matrix_latte(E, RXYZ, Box, U, Element_Pointer, Nr_atoms, COULACC, nebcoul, totnebcoul, HDIM, Max_Nr_Neigh, Nr_Elem)
subroutine, public ewald_real_space_single(COULOMBV, FCOUL, I, RX, RY, RZ, LBox, DELTAQ, J, U, Element_Type, Nr_atoms, COULACC, TIMERATIO, HDIM, Max_Nr_Neigh)
To produce a matrix which is needed to orthogonalize .
Definition: prg_genz_mod.F90:6
subroutine, public prg_genz_sp_initial_zmat(smat_bml, zmat_bml, norb, mdim, bml_type_f, threshold)
Initial estimation of Z.
subroutine, public prg_genz_sp_ref(smat_bml, zmat_bml, nref, norb, bml_type, threshold)
Iterative refinement.
subroutine, public prg_genz_sp_initialz0(smat_bml, zmat_bml, norb, mdim, bml_type_f, threshold)
Initial estimation of Z.
subroutine, public prg_init_zspmat(igenz, zk1_bml, zk2_bml, zk3_bml, zk4_bml, zk5_bml, zk6_bml, norb, bml_type, bml_element_type)
Initiates the matrices for the Xl integration of Z.
Module for graph-based solvers.
subroutine, public prg_implicit_fermi(h_bml, p_bml, nsteps, k, nocc, mu, beta, method, osteps, occErrLimit, threshold, tol)
Recursive Implicit Fermi Dirac for finite temperature.
subroutine, public prg_implicit_fermi_save_inverse(Inv_bml, h_bml, p_bml, nsteps, nocc, mu, beta, occErrLimit, threshold, tol, SCF_IT, occiter, totns)
Recursive Implicit Fermi Dirac for finite temperature.
subroutine, public prg_implicit_fermi_first_order_response(H0_bml, H1_bml, P0_bml, P1_bml, Inv_bml, nsteps, mu0, beta, nocc, threshold)
Calculate first order density matrix response to perturbations using Implicit Fermi Dirac.
subroutine, public prg_test_density_matrix(ham_bml, p_bml, beta, mu, nocc, osteps, occErrLimit, threshold)
Calculate the density matrix with diagonalization and converge chemical.
subroutine, public prg_implicit_fermi_zero(h_bml, p_bml, nsteps, mu, method, threshold, tol)
Recursive Implicit Fermi Dirac for zero temperature.
The prg_normalize module.
subroutine, public prg_normalize_fermi(h_bml, h1, hN, mu)
Normalize a Hamiltonian matrix prior to running the truncated SP2 algorithm.
subroutine, public prg_normalize(h_bml)
Normalize a Hamiltonian matrix prior to running the SP2 algorithm.
subroutine, public prg_normalize_cheb(h_bml, mu, emin, emax, alpha, scaledmu)
Normalize a Hamiltonian matrix prior to running the Chebyshev algorithm.
subroutine, public prg_normalize_implicit_fermi(h_bml, cnst, mu)
Normalize a Hamiltonian matrix prior to running the implicit fermi dirac algorithm.
Module to handle input output files for the PROGRESS lib.
subroutine, public prg_open_file(io, name)
Opens a file to write.
subroutine, public prg_open_file_to_read(io, name)
Opens a file to read.
The parallel module.
subroutine, public prg_iprg_recvparallel(recvBuf, recvLen, rind)
subroutine, public minintparallel(sendBuf, recvBuf, icount)
subroutine, public prg_barrierparallel()
subroutine, public prg_maxintreduce2(value1, value2)
subroutine, public sumrealparallel(sendBuf, recvBuf, icount)
subroutine, public prg_maxrealreduce(rvalue)
subroutine, public sendparallel(sendBuf, sendLen, dest)
subroutine, public prg_shutdownparallel()
subroutine, public isendparallel(sendBuf, sendLen, dest)
subroutine, public maxrealparallel(sendBuf, recvBuf, icount)
subroutine, public prg_sumintreduce2(value1, value2)
subroutine, public sendreceiveparallel(sendBuf, sendLen, dest, recvBuf, recvLen, source, nreceived)
subroutine, public prg_initparallel()
subroutine, public maxintparallel(sendBuf, recvBuf, icount)
subroutine, public minrealparallel(sendBuf, recvBuf, icount)
subroutine, public prg_minrealreduce(rvalue)
subroutine, public prg_recvparallel(recvBuf, recvLen)
subroutine, public sumintparallel(sendBuf, recvBuf, icount)
The progress module.
subroutine, public prg_progress_init()
Initialize progress.
subroutine, public prg_version()
Print PROGRESS and BML versions.
subroutine, public prg_progress_shutdown()
Shutdown progress.
Produces a matrix to get the Pulay Component of the forces.
subroutine, public prg_pulaycomponentt(rho_bml, ham_bml, zmat_bml, pcm_bml, threshold, M, bml_type, verbose)
At , .
subroutine, public prg_pulaycomponent0(rho_bml, ham_bml, pcm_bml, threshold, M, verbose)
At , .
subroutine, public prg_get_pulayforce(nats, zmat_bml, ham_bml, rho_bml, dSx_bml, dSy_bml, dSz_bml, hindex, FPUL, threshold)
Pulay Force FPUL from .
The SP2 Fermi module.
subroutine, public prg_sp2_fermi(h_bml, osteps, nsteps, nocc, mu, beta, h1, hN, sgnlist, threshold, eps, traceLimit, x_bml)
Calculate Truncated SP2.
subroutine, public prg_sp2_fermi_init_norecs(h_bml, nsteps, nocc, tscale, threshold, occErrLimit, traceLimit, x_bml, mu, beta, h1, hN, sgnlist, verbose)
Truncated SP2 prg_initialization. This routine also gives back the Number of SP2 recursive steps that...
subroutine, public prg_sp2_fermi_init(h_bml, nsteps, nocc, tscale, threshold, occErrLimit, traceLimit, x_bml, mu, beta, h1, hN, sgnlist)
Truncated SP2 prg_initialization.
subroutine, public prg_sp2_entropy_function(mu, h1, hN, nsteps, sgnlist, GG, ee)
Calculate SP2 entropy function using gaussian quadrature. Note that GG and ee are allocated and retur...
The SP2 module.
Definition: prg_sp2_mod.F90:7
subroutine, public prg_sp2_alg2(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
subroutine, public prg_sp2_alg2_genseq(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, pp, icount, vv, verbose)
subroutine, public prg_sp2_alg1_seq(h_bml, rho_bml, threshold, pp, icount, vv)
subroutine, public prg_sp2_basic_tcore(h_bml, rho_bml, rhofull_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
subroutine, public prg_prg_sp2_alg2_seq_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval, verbose)
subroutine, public prg_sp2_submatrix(ham_bml, rho_bml, threshold, pp, icount, vv, mineval, maxeval, core_size)
Perform SP2 algorithm using sequence and calculate norm for a submatrix.
subroutine, public prg_sp2_alg2_seq(h_bml, rho_bml, threshold, pp, icount, vv, verbose)
subroutine, public prg_sp2_submatrix_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval, core_size)
subroutine, public prg_sp2_basic(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
Calculates the density matrix from a Hamiltonian matrix by purification. The method implemented here ...
Definition: prg_sp2_mod.F90:51
subroutine, public prg_sp2_alg1_genseq(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, pp, icount, vv)
subroutine, public prg_prg_sp2_alg1_seq_inplace(rho_bml, threshold, pp, icount, vv, mineval, maxeval)
subroutine, public prg_sp2_alg1(h_bml, rho_bml, threshold, bndfil, minsp2iter, maxsp2iter, sp2conv, idemtol, verbose)
A module to read and handle chemical systems.
subroutine, public prg_get_nameandext(fullfilename, filename, ext)
Get the name and extension of a file.
The timer module.
subroutine, public prg_print_date_and_time(tag)
subroutine, public prg_timer_results()
subroutine, public prg_timer_shutdown()
Done with timers.
subroutine, public timer_prg_init()
Initialize timers.
subroutine, public prg_timer_start(itimer, tag)
Start Timing.
subroutine, public prg_timer_stop(itimer, verbose)
Stop timing.
subroutine, public prg_timer_collect()