21#include "./base/base_uses.f90"
38 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_fb_env_types'
68 INTEGER :: ref_count = -1
69 REAL(KIND=
dp),
DIMENSION(:),
POINTER :: rcut => null()
72 REAL(KIND=
dp) :: filter_temperature = -1.0_dp
73 REAL(KIND=
dp) :: auto_cutoff_scale = -1.0_dp
74 REAL(KIND=
dp) :: eps_default = -1.0_dp
75 LOGICAL :: collective_com = .false.
76 INTEGER,
DIMENSION(:),
POINTER :: local_atoms => null()
77 INTEGER :: nlocal_atoms = -1
87 TYPE(fb_env_data),
POINTER,
PRIVATE :: obj => null()
100 cpassert(
ASSOCIATED(fb_env%obj))
101 cpassert(fb_env%obj%ref_count > 0)
102 fb_env%obj%ref_count = fb_env%obj%ref_count + 1
114 IF (
ASSOCIATED(fb_env%obj))
THEN
115 cpassert(fb_env%obj%ref_count > 0)
116 fb_env%obj%ref_count = fb_env%obj%ref_count - 1
117 IF (fb_env%obj%ref_count == 0)
THEN
118 fb_env%obj%ref_count = 1
119 IF (
ASSOCIATED(fb_env%obj%rcut))
THEN
120 DEALLOCATE (fb_env%obj%rcut)
122 IF (
ASSOCIATED(fb_env%obj%local_atoms))
THEN
123 DEALLOCATE (fb_env%obj%local_atoms)
127 fb_env%obj%ref_count = 0
128 DEALLOCATE (fb_env%obj)
156 SUBROUTINE fb_env_associate(a, b)
161 END SUBROUTINE fb_env_associate
174 res =
ASSOCIATED(fb_env%obj)
186 cpassert(.NOT.
ASSOCIATED(fb_env%obj))
187 ALLOCATE (fb_env%obj)
188 NULLIFY (fb_env%obj%rcut)
191 fb_env%obj%filter_temperature = 0.0_dp
192 fb_env%obj%auto_cutoff_scale = 1.0_dp
193 fb_env%obj%eps_default = 0.0_dp
194 fb_env%obj%collective_com = .true.
195 NULLIFY (fb_env%obj%local_atoms)
196 fb_env%obj%nlocal_atoms = 0
197 fb_env%obj%ref_count = 1
207 SUBROUTINE fb_env_init(fb_env)
210 cpassert(
ASSOCIATED(fb_env%obj))
211 IF (
ASSOCIATED(fb_env%obj%rcut))
THEN
212 DEALLOCATE (fb_env%obj%rcut)
216 fb_env%obj%filter_temperature = 0.0_dp
217 fb_env%obj%auto_cutoff_scale = 1.0_dp
218 fb_env%obj%eps_default = 0.0_dp
219 fb_env%obj%collective_com = .true.
220 IF (
ASSOCIATED(fb_env%obj%local_atoms))
THEN
221 DEALLOCATE (fb_env%obj%local_atoms)
223 fb_env%obj%nlocal_atoms = 0
224 END SUBROUTINE fb_env_init
248 filter_temperature, &
257 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: rcut
258 REAL(kind=
dp),
INTENT(OUT),
OPTIONAL :: filter_temperature, auto_cutoff_scale, &
261 OPTIONAL :: atomic_halos
263 LOGICAL,
INTENT(OUT),
OPTIONAL :: collective_com
264 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: local_atoms
265 INTEGER,
INTENT(OUT),
OPTIONAL :: nlocal_atoms
267 cpassert(
ASSOCIATED(fb_env%obj))
268 cpassert(fb_env%obj%ref_count > 0)
270 rcut => fb_env%obj%rcut
271 IF (
PRESENT(filter_temperature)) &
272 filter_temperature = fb_env%obj%filter_temperature
273 IF (
PRESENT(auto_cutoff_scale)) &
274 auto_cutoff_scale = fb_env%obj%auto_cutoff_scale
275 IF (
PRESENT(eps_default)) &
276 eps_default = fb_env%obj%eps_default
277 IF (
PRESENT(atomic_halos)) &
279 IF (
PRESENT(trial_fns)) &
281 IF (
PRESENT(collective_com)) &
282 collective_com = fb_env%obj%collective_com
283 IF (
PRESENT(local_atoms)) &
284 local_atoms => fb_env%obj%local_atoms
285 IF (
PRESENT(nlocal_atoms)) &
286 nlocal_atoms = fb_env%obj%nlocal_atoms
306 filter_temperature, &
315 REAL(kind=
dp),
DIMENSION(:),
OPTIONAL,
POINTER :: rcut
316 REAL(kind=
dp),
INTENT(IN),
OPTIONAL :: filter_temperature, auto_cutoff_scale, &
319 OPTIONAL :: atomic_halos
321 LOGICAL,
INTENT(IN),
OPTIONAL :: collective_com
322 INTEGER,
DIMENSION(:),
OPTIONAL,
POINTER :: local_atoms
323 INTEGER,
INTENT(IN),
OPTIONAL :: nlocal_atoms
325 cpassert(
ASSOCIATED(fb_env%obj))
326 IF (
PRESENT(rcut))
THEN
327 IF (
ASSOCIATED(fb_env%obj%rcut))
THEN
328 DEALLOCATE (fb_env%obj%rcut)
330 fb_env%obj%rcut => rcut
332 IF (
PRESENT(filter_temperature)) &
333 fb_env%obj%filter_temperature = filter_temperature
334 IF (
PRESENT(auto_cutoff_scale)) &
335 fb_env%obj%auto_cutoff_scale = auto_cutoff_scale
336 IF (
PRESENT(eps_default)) &
337 fb_env%obj%eps_default = eps_default
338 IF (
PRESENT(atomic_halos))
THEN
342 IF (
PRESENT(trial_fns))
THEN
348 IF (
PRESENT(collective_com)) &
349 fb_env%obj%collective_com = collective_com
350 IF (
PRESENT(local_atoms))
THEN
351 IF (
ASSOCIATED(fb_env%obj%local_atoms))
THEN
352 DEALLOCATE (fb_env%obj%local_atoms)
354 fb_env%obj%local_atoms => local_atoms
356 IF (
PRESENT(nlocal_atoms)) &
357 fb_env%obj%nlocal_atoms = nlocal_atoms
Defines the basic variable types.
integer, parameter, public dp
subroutine, public fb_atomic_halo_list_release(atomic_halos)
Releases an fb_atomic_halo_list object.
subroutine, public fb_atomic_halo_list_associate(a, b)
Associates one fb_atomic_halo_list object to another.
subroutine, public fb_atomic_halo_list_nullify(atomic_halos)
Nullifies a fb_atomic_halo_list object, note that it does not release the original object....
logical function, public fb_env_has_data(fb_env)
Checks if a fb_env object is associated with an actual data content or not.
subroutine, public fb_env_release(fb_env)
releases a given fb_env
subroutine fb_env_retain(fb_env)
retains the given fb_env
subroutine, public fb_env_get(fb_env, rcut, filter_temperature, auto_cutoff_scale, eps_default, atomic_halos, trial_fns, collective_com, local_atoms, nlocal_atoms)
method to get attributes from a given fb_env object
subroutine, public fb_env_nullify(fb_env)
nullifies a fb_env object, note that this does not release the original object. This procedure is use...
subroutine, public fb_env_set(fb_env, rcut, filter_temperature, auto_cutoff_scale, eps_default, atomic_halos, trial_fns, collective_com, local_atoms, nlocal_atoms)
method to set attributes from a given fb_env object
subroutine, public fb_env_create(fb_env)
creates an empty fb_env object
subroutine, public fb_trial_fns_nullify(trial_fns)
nullifies the content of given object
logical function, public fb_trial_fns_has_data(trial_fns)
check if the object has data associated to it
subroutine, public fb_trial_fns_associate(a, b)
associates the content of an object to that of another object of the same type
subroutine, public fb_trial_fns_retain(trial_fns)
retains given object
subroutine, public fb_trial_fns_release(trial_fns)
releases given object
defines a fb_atomic_halo_list object
the object container which allows for the creation of an array of pointers to fb_env
the object container which allows for the creation of an array of pointers to fb_trial_fns objects