forked from lanl/SuperNu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparticlemod.f90
72 lines (63 loc) · 2.59 KB
/
particlemod.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
! © 2023. Triad National Security, LLC. All rights reserved.
! This program was produced under U.S. Government contract 89233218CNA000001 for Los Alamos National
! Laboratory (LANL), which is operated by Triad National Security, LLC for the U.S. Department of
! Energy/National Nuclear Security Administration. All rights in the program are reserved by Triad
! National Security, LLC, and the U.S. Department of Energy/National Nuclear Security Administration.
! The Government is granted for itself and others acting on its behalf a nonexclusive, paid-up,
! irrevocable worldwide license in this material to reproduce, prepare. derivative works, distribute
! copies to the public, perform publicly and display publicly, and to permit others to do so.
!This file is part of SuperNu. SuperNu is released under the terms of the GNU GPLv3, see COPYING.
!Copyright (c) 2013-2022 Ryan T. Wollaeger and Daniel R. van Rossum. All rights reserved.
module particlemod
implicit none
type packet
real*8 :: x, y, z
real*8 :: mu, om, t
real*8 :: e, e0, wl
end type packet
!
!-- secondary particle properties
type packet2
real*8 :: mux,muy,muz !particle direction in lab frame cartesian coordinates
real*8 :: dist !particle travel distance
character(4) :: stat !particle status: live, cens, flux, dead
integer :: ix, iy, iz !positional cell indices
integer :: ic, ig !index into compressed domain arrays, group index
integer :: itype !IMC or DDMC type
integer :: ipart, istep !particle number and transport step number
integer :: idist !transport distance identifier
end type packet2
!
type(packet),allocatable,target :: prt_particles(:) !(prt_npartmax)
logical,allocatable :: prt_isvacant(:) !(prt_npartmax)
!
integer :: prt_npartmax
save
contains
subroutine particle_alloc(ltalk)
!--------------------------------------------------!{{{
implicit none
logical,intent(in) :: ltalk
integer :: n
!-- allocate permanent storage (dealloc in dealloc_all.f)
allocate(prt_particles(prt_npartmax),prt_isvacant(prt_npartmax))
prt_isvacant = .true.
!
!-- print size only on master rank
if(ltalk) then
n = int(sizeof(prt_particles)/1024) !kB
write(6,*) 'ALLOC particles:',n,"kB",n/1024,"MB",n/1024**2,"GB"
endif
!
!-- output
if(ltalk) then
write(6,*)
write(6,*) 'particle array:'
write(6,*) '===================='
write(6,*) 'npart :',prt_npartmax,prt_npartmax/1000,'k'
write(6,*)
endif
!}}}
end subroutine particle_alloc
end module particlemod
! vim: fdm=marker