14#include "../base/base_uses.f90"
26 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'cp_iter_types'
27 LOGICAL,
PRIVATE,
PARAMETER :: debug_this_module = .false.
49 "SPLINE_FIND_COEFFS", &
56 CHARACTER(LEN=default_path_length),
PARAMETER,
PUBLIC,
DIMENSION(19) ::
each_desc_labels = [ &
57 "Iteration level for __ROOT__ (fictitious iteration level) ", &
58 "Iteration level for an ENERGY/ENERGY_FORCE calculation. ", &
59 "Iteration level for POWELL based optimization steps. ", &
60 "Iteration level for the SCF steps. ", &
61 "Iteration level for the X-Ray Absorption Spectroscopy (XAS) SCF steps. ", &
62 "Iteration level for the MD steps. ", &
63 "Iteration level for the Path integral md steps. ", &
64 "Iteration level for the METADYNAMICS steps (number of hills added). ", &
65 "Iteration level for the Geometry optimization steps. ", &
66 "Iteration level for the Rotational optimization steps in the Dimer calculation.", &
67 "Iteration level for the Cell optimization steps. ", &
68 "Iteration level for the BAND calculation steps ", &
69 "Iteration level for the Energy Perturbation (EP) linear solver ", &
70 "Iteration level for the solution of the coefficients of the splines ", &
71 "Iteration level for the evaluation of the Replica Environment ", &
72 "Iteration level for the Basis Set Superposition Error (BSSE) calculation ", &
73 "Iteration level for the Shell-Core distances optimization steps ", &
74 "Iteration level for the Time-Dependent Density Functional Theory SCF steps. ", &
75 "Iteration level for the NEGF SCF steps. "]
83 INTEGER :: ref_count = -1
84 INTEGER :: print_level = -1, n_rlevel = -1
86 INTEGER,
DIMENSION(:),
POINTER :: iteration => null()
87 LOGICAL,
DIMENSION(:),
POINTER :: last_iter => null()
88 CHARACTER(len=default_string_length) :: project_name =
""
89 CHARACTER(LEN=default_string_length), &
90 DIMENSION(:),
POINTER :: level_name => null()
103 CHARACTER(len=*),
INTENT(in) :: project_name
105 ALLOCATE (iteration_info)
107 iteration_info%ref_count = 1
108 iteration_info%print_level = 2
109 iteration_info%n_rlevel = 1
111 iteration_info%project_name = project_name
112 ALLOCATE (iteration_info%iteration(iteration_info%n_rlevel))
113 ALLOCATE (iteration_info%level_name(iteration_info%n_rlevel))
114 ALLOCATE (iteration_info%last_iter(iteration_info%n_rlevel))
115 iteration_info%iteration(iteration_info%n_rlevel) = 1
116 iteration_info%level_name(iteration_info%n_rlevel) =
"__ROOT__"
117 iteration_info%last_iter(iteration_info%n_rlevel) = .false.
129 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_iteration_info_retain', &
130 routinep = modulen//
':'//routinen
132 IF (iteration_info%ref_count <= 0)
THEN
133 cpabort(routinep//
" iteration_info%ref_counf<=0")
135 iteration_info%ref_count = iteration_info%ref_count + 1
146 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_iteration_info_release', &
147 routinep = modulen//
':'//routinen
149 IF (
ASSOCIATED(iteration_info))
THEN
150 IF (iteration_info%ref_count <= 0)
THEN
151 cpabort(routinep//
" iteration_info%ref_counf<=0")
153 iteration_info%ref_count = iteration_info%ref_count - 1
154 IF (iteration_info%ref_count == 0)
THEN
155 IF (
ASSOCIATED(iteration_info%iteration))
THEN
156 DEALLOCATE (iteration_info%iteration)
158 IF (
ASSOCIATED(iteration_info%last_iter))
THEN
159 DEALLOCATE (iteration_info%last_iter)
161 IF (
ASSOCIATED(iteration_info%level_name))
THEN
162 DEALLOCATE (iteration_info%level_name)
164 DEALLOCATE (iteration_info)
178 CHARACTER(len=*),
PARAMETER :: routinen =
'cp_iteration_info_copy_iter', &
179 routinep = modulen//
':'//routinen
183 IF (iteration_info_in%ref_count <= 0)
THEN
184 cpabort(routinep//
" iteration_info_in%ref_counf<=0")
187 iteration_info_out%n_rlevel = iteration_info_in%n_rlevel
189 DEALLOCATE (iteration_info_out%iteration)
190 i =
SIZE(iteration_info_in%iteration)
191 ALLOCATE (iteration_info_out%iteration(i))
192 iteration_info_out%iteration = iteration_info_in%iteration
194 DEALLOCATE (iteration_info_out%last_iter)
195 i =
SIZE(iteration_info_in%last_iter)
196 ALLOCATE (iteration_info_out%last_iter(i))
197 iteration_info_out%last_iter = iteration_info_in%last_iter
199 DEALLOCATE (iteration_info_out%level_name)
200 i =
SIZE(iteration_info_in%level_name)
201 ALLOCATE (iteration_info_out%level_name(i))
202 iteration_info_out%level_name = iteration_info_in%level_name
Collection of routines to handle the iteration info.
integer, parameter, public iter_silent
subroutine, public cp_iteration_info_copy_iter(iteration_info_in, iteration_info_out)
Copies iterations info of an iteration info into another iteration info.
pure subroutine, public cp_iteration_info_create(iteration_info, project_name)
creates an output info object
character(len=default_path_length), dimension(19), parameter, public each_possible_labels
subroutine, public cp_iteration_info_retain(iteration_info)
retains the iteration_info (see doc/ReferenceCounting.html)
integer, parameter, public iter_stack
subroutine, public cp_iteration_info_release(iteration_info)
releases the iteration_info (see doc/ReferenceCounting.html)
character(len=default_path_length), dimension(19), parameter, public each_desc_labels
integer, parameter, public iter_notice
Defines the basic variable types.
integer, parameter, public default_string_length
integer, parameter, public default_path_length
contains the information about the current state of the program to be able to decide if output is nec...