25 use,
intrinsic :: iso_fortran_env
50 integer,
public :: ndim
53 integer,
public :: ntype_of_particle
55 integer :: max_particles_per_type
57 integer,
public :: nparticle = 0
59 integer :: ndensities_to_calculate
68 character(80),
allocatable :: labels_particles(:)
70 integer,
allocatable,
public :: particletype(:)
71 integer,
allocatable,
public :: nparticles_per_type(:)
72 integer,
allocatable,
public :: particles_of_type(:,:)
73 integer,
allocatable,
public :: bosonfermion(:)
75 integer,
allocatable :: exchange_symmetry(:,:,:)
77 real(real64),
allocatable :: mass_particle(:)
79 real(real64),
allocatable,
public :: charge_particle(:)
88 character(80),
allocatable :: labels_densities(:)
90 integer,
allocatable :: particle_kept_densities(:)
92 integer,
allocatable,
public :: nspindown(:,:)
94 integer,
allocatable,
public :: iyoung(:,:)
95 real(real64),
allocatable,
public :: proj(:)
107 type(modelmb_particle_t),
intent(inout) :: this
108 type(namespace_t),
intent(in) :: namespace
109 class(space_t),
intent(in) :: space
110 integer,
intent(in) :: nst
112 integer :: ipart, ncols, nline, itmp, jtmp, ntype
127 call parse_variable(namespace,
'NParticleModelmb', 0, this%nparticle)
129 if (this%nparticle == 0)
then
155 call parse_variable(namespace,
'NTypeParticleModelmb', 1, this%ntype_of_particle)
157 if (this%ntype_of_particle > this%nparticle)
then
158 write (
message(1),
'(2a,2I6)')
' Number of types of modelmb particles should be <= Number of modelmb particles ', &
159 this%ntype_of_particle, this%nparticle
163 if (this%ndim*this%nparticle /= space%dim)
then
164 message(1) =
' Number of modelmb particles * dimension of modelmb space must be = Ndim'
170 ntype = this%ntype_of_particle
171 safe_allocate(this%labels_particles(1:this%nparticle))
172 safe_allocate(this%particletype(1:this%nparticle))
173 safe_allocate(this%mass_particle(1:this%nparticle))
174 safe_allocate(this%charge_particle(1:this%nparticle))
175 safe_allocate(this%bosonfermion(1:this%nparticle))
176 safe_allocate(this%nparticles_per_type(1:ntype))
177 safe_allocate(this%particles_of_type(1:this%nparticle, 1:ntype))
180 this%labels_particles =
'electron'
181 this%particletype = 1
182 this%mass_particle =
m_one
184 this%bosonfermion = 1
213 if (
parse_block(namespace,
'DescribeParticlesModelmb', blk) == 0)
then
222 if (nline /= this%nparticle)
then
226 do ipart = 1, this%nparticle
233 write (
message(1),
'(a,a)')
'labels_particles = ', this%labels_particles(ipart)
234 write (
message(2),
'(a,i6)')
'particletype = ', this%particletype(ipart)
235 write (
message(3),
'(a,E20.10)')
'mass_particle = ', this%mass_particle(ipart)
236 write (
message(4),
'(a,E20.10)')
'charge_particle = ', this%charge_particle(ipart)
237 write (
message(5),
'(a,i6)')
'bosonfermion = ', this%bosonfermion(ipart)
244 this%nparticles_per_type = 0
245 this%particles_of_type = 0
246 do ipart = 1, this%nparticle
247 this%nparticles_per_type(this%particletype(ipart)) = &
248 this%nparticles_per_type(this%particletype(ipart)) + 1
249 this%particles_of_type(this%nparticles_per_type(this%particletype(ipart)), &
250 this%particletype(ipart)) = ipart
253 this%max_particles_per_type = maxval(this%nparticles_per_type)
254 itmp = this%max_particles_per_type
255 jtmp = this%ntype_of_particle
256 safe_allocate(this%exchange_symmetry(1:itmp, 1:itmp, 1:jtmp))
257 this%exchange_symmetry = 0
259 if (this%nparticle > 0)
then
261 safe_allocate(this%nspindown(1:this%ntype_of_particle, 1:nst))
262 this%nspindown(:,:) = -1
263 safe_allocate(this%iyoung(1:this%ntype_of_particle, 1:nst))
264 this%iyoung(:,:) = -1
265 safe_allocate(this%proj(1:nst))
279 safe_deallocate_a(this%nspindown)
280 safe_deallocate_a(this%iyoung)
281 safe_deallocate_a(this%proj)
283 safe_deallocate_a(this%labels_particles)
284 safe_deallocate_a(this%particletype)
285 safe_deallocate_a(this%mass_particle)
286 safe_deallocate_a(this%charge_particle)
287 safe_deallocate_a(this%nparticles_per_type)
288 safe_deallocate_a(this%particles_of_type)
289 safe_deallocate_a(this%exchange_symmetry)
290 safe_deallocate_a(this%bosonfermion)
292 safe_deallocate_a(this%labels_densities)
293 safe_deallocate_a(this%particle_kept_densities)
306 modelmb_out%ndim = modelmb_in%ndim
307 modelmb_out%ntype_of_particle = modelmb_in%ntype_of_particle
308 modelmb_out%max_particles_per_type = modelmb_in%max_particles_per_type
309 modelmb_out%nparticle = modelmb_in%nparticle
310 modelmb_out%ndensities_to_calculate = modelmb_in%ndensities_to_calculate
312 safe_allocate_source_a(modelmb_out%labels_particles,modelmb_in%labels_particles)
313 safe_allocate_source_a(modelmb_out%particletype,modelmb_in%particletype)
314 safe_allocate_source_a(modelmb_out%mass_particle,modelmb_in%mass_particle)
315 safe_allocate_source_a(modelmb_out%charge_particle,modelmb_in%charge_particle)
316 safe_allocate_source_a(modelmb_out%nparticles_per_type,modelmb_in%nparticles_per_type)
317 safe_allocate_source_a(modelmb_out%particles_of_type,modelmb_in%particles_of_type)
318 safe_allocate_source_a(modelmb_out%exchange_symmetry,modelmb_in%exchange_symmetry)
319 safe_allocate_source_a(modelmb_out%bosonfermion,modelmb_in%bosonfermion)
321 safe_allocate_source_a(modelmb_out%labels_densities,modelmb_in%labels_densities)
322 safe_allocate_source_a(modelmb_out%particle_kept_densities,modelmb_in%particle_kept_densities)
324 if (modelmb_in%nparticle > 0)
then
325 safe_allocate_source_a(modelmb_out%nspindown, modelmb_in%nspindown)
326 safe_allocate_source_a(modelmb_out%iyoung, modelmb_in%iyoung)
327 safe_allocate_source_a(modelmb_out%proj, modelmb_in%proj)
337 real(real64),
intent(inout) :: masses(:)
339 real(real64),
parameter :: tol_mass = 1.e-10_real64
340 integer :: dimcounter,ipart
346 do ipart = 1,this%nparticle
347 if (abs(this%mass_particle(ipart)-1.0_real64) > tol_mass)
then
348 masses(dimcounter+1:dimcounter+this%ndim) = this%mass_particle(ipart)
350 dimcounter = dimcounter+this%ndim
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
real(real64), parameter, public m_zero
real(real64), parameter, public m_one
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_input_error(namespace, var, details, row, column)
subroutine, public messages_experimental(name, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
general module for modelmb particles
subroutine, public modelmb_copy_masses(this, masses)
Copy masses for particles. To be used for the derivative object.
subroutine, public modelmb_particles_end(this)
subroutine, public modelmb_particles_init(this, namespace, space, nst)
==============================================================
subroutine, public modelmb_particles_copy(modelmb_out, modelmb_in)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
==============================================================