25 #include "../base/base_uses.f90"
31 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'gaussian_gridlevels'
34 TYPE gridlevel_info_type
35 INTEGER :: ngrid_levels = 0
36 REAL(KIND=
dp),
POINTER,
DIMENSION(:) :: cutoff => null()
37 INTEGER(KIND=int_8),
POINTER,
DIMENSION(:) :: count => null()
38 INTEGER(KIND=int_8) :: total_count = 0_int_8
39 REAL(KIND=
dp) :: rel_cutoff = 0.0_dp
40 TYPE(section_vals_type),
POINTER :: print_section => null()
41 END TYPE gridlevel_info_type
43 PUBLIC :: gridlevel_info_type
59 TYPE(gridlevel_info_type),
INTENT(OUT) :: gridlevel_info
60 INTEGER,
INTENT(IN) :: ngrid_levels
61 REAL(kind=
dp),
DIMENSION(ngrid_levels),
INTENT(IN) :: cutoff
62 REAL(kind=
dp),
INTENT(IN) :: rel_cutoff
63 TYPE(section_vals_type),
INTENT(IN),
TARGET :: print_section
67 ALLOCATE (gridlevel_info%cutoff(ngrid_levels))
68 ALLOCATE (gridlevel_info%count(ngrid_levels))
69 gridlevel_info%ngrid_levels = ngrid_levels
70 gridlevel_info%rel_cutoff = rel_cutoff
71 DO i = 1, ngrid_levels
72 gridlevel_info%cutoff(i) = cutoff(i)
73 gridlevel_info%count(i) = 0
75 gridlevel_info%print_section => print_section
85 TYPE(gridlevel_info_type),
INTENT(INOUT) :: gridlevel_info
86 TYPE(mp_para_env_type),
INTENT(IN),
OPTIONAL :: para_env
88 INTEGER :: i, output_unit
90 TYPE(cp_logger_type),
POINTER :: logger
91 TYPE(mp_comm_type) :: group
95 IF (
PRESENT(para_env))
THEN
99 group = logger%para_env
105 CALL group%sum(gridlevel_info%total_count)
106 CALL group%sum(gridlevel_info%count)
109 "", extension=
".Log")
111 IF (output_unit > 0)
THEN
112 WRITE (output_unit,
'(/,T2,A,A)')
"----------------------------------------", &
113 "---------------------------------------"
114 WRITE (output_unit,
'(T2,A,T35,A,T77,A)')
"----",
"MULTIGRID INFO",
"----"
115 WRITE (output_unit,
'(T2,A,A)')
"----------------------------------------", &
116 "---------------------------------------"
117 IF (gridlevel_info%ngrid_levels > 1)
THEN
118 DO i = 1, gridlevel_info%ngrid_levels
119 WRITE (output_unit,
'(T2,A,I4,A,I14,9x,A,F12.2)')
"count for grid ", i,
": ", &
120 gridlevel_info%count(i),
" cutoff [a.u.] ", gridlevel_info%cutoff(i)
122 WRITE (output_unit,
'(T2,A,I14)')
"total gridlevel count : ", &
123 gridlevel_info%total_count
125 WRITE (output_unit,
'(T2,A,I14,T51,A,F12.2)')
"total grid count :", &
126 gridlevel_info%count(1),
" cutoff [a.u.] ", gridlevel_info%cutoff(1)
133 DEALLOCATE (gridlevel_info%cutoff)
137 DEALLOCATE (gridlevel_info%count)
148 TYPE(gridlevel_info_type),
INTENT(INOUT) :: gridlevel_info
149 REAL(kind=
dp),
INTENT(IN) :: exponent
153 REAL(kind=
dp) :: needed_cutoff
156 needed_cutoff = abs(exponent)*gridlevel_info%rel_cutoff
157 DO i = 1, gridlevel_info%ngrid_levels
158 IF ((gridlevel_info%cutoff(i) + 1e-6_dp) .GE. needed_cutoff)
THEN
163 gridlevel_info%total_count = gridlevel_info%total_count + 1
165 gridlevel_info%count(gridlevel) = gridlevel_info%count(gridlevel) + 1
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
integer function, public gaussian_gridlevel(gridlevel_info, exponent)
...
subroutine, public destroy_gaussian_gridlevel(gridlevel_info, para_env)
...
subroutine, public init_gaussian_gridlevel(gridlevel_info, ngrid_levels, cutoff, rel_cutoff, print_section)
...
Defines the basic variable types.
integer, parameter, public int_8
integer, parameter, public dp
Interface to the message passing library MPI.