Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
flexpart
flexpart
Commits
57c5b2ed
Commit
57c5b2ed
authored
Sep 13, 2015
by
Espen Sollum
Browse files
Bug fixed where number of particles released (MPI version) was not always correct
parent
f55fdcec
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/releaseparticles_mpi.f90
View file @
57c5b2ed
...
...
@@ -54,7 +54,7 @@ subroutine releaseparticles(itime)
use
par_mod
use
com_mod
use
random_mod
,
only
:
ran1
use
mpi_mod
,
only
:
mp_partid
,
maxpart_mpi
,
mp_partgroup_np
,
mp_seed
use
mpi_mod
,
only
:
mp_partid
,
maxpart_mpi
,
mp_partgroup_np
,
mp_seed
,
mpif_mpi_barrier
implicit
none
...
...
@@ -77,7 +77,8 @@ subroutine releaseparticles(itime)
logical
::
first_call
=
.true.
! Use different seed for each process
! Use different seed for each process.
!****************************************************************************
if
(
first_call
)
then
idummy
=
idummy
+
mp_seed
first_call
=
.false.
...
...
@@ -151,18 +152,24 @@ subroutine releaseparticles(itime)
! Also scale by number of MPI processes
!**********************************************************************
if
(
mp_partid
.lt.
mod
(
npart
(
i
),
mp_partgroup_np
))
then
rfraction
=
rfraction
*
average_timecorrect
rfraction
=
rfraction
+
xmasssave
(
i
)
! number to be released at this time
! number to be released for one process
if
(
mp_partid
.lt.
mod
(
int
(
rfraction
),
mp_partgroup_np
))
then
addone
=
1
else
addone
=
0
end
if
rfraction
=
rfraction
*
average_timecorrect
/
real
(
mp_partgroup_np
)
numrel
=
int
(
rfraction
/
mp_partgroup_np
)
+
addone
xmasssave
(
i
)
=
rfraction
-
int
(
rfraction
)
rfraction
=
rfraction
+
xmasssave
(
i
)
! number to be released at this time
numrel
=
int
(
rfraction
)
+
addone
xmasssave
(
i
)
=
rfraction
-
real
(
numrel
)
else
! All particles are released in this time interval
! ************************************************
if
(
mp_partid
.lt.
mod
(
npart
(
i
),
mp_partgroup_np
))
then
addone
=
1
else
...
...
@@ -171,7 +178,7 @@ subroutine releaseparticles(itime)
numrel
=
npart
(
i
)/
mp_partgroup_np
+
addone
endif
xaux
=
xpoint2
(
i
)
-
xpoint1
(
i
)
yaux
=
ypoint2
(
i
)
-
ypoint1
(
i
)
zaux
=
zpoint2
(
i
)
-
zpoint1
(
i
)
...
...
@@ -207,7 +214,7 @@ subroutine releaseparticles(itime)
do
k
=
1
,
nspec
xmass1
(
ipart
,
k
)
=
xmass
(
i
,
k
)/
real
(
npart
(
i
))
&
*
timecorrect
(
k
)/
average_timecorrect
! write (*,*) 'xmass1: ',xmass1(ipart,k),ipart,k
!
write (*,*) 'xmass1: ',xmass1(ipart,k),ipart,k
! Assign certain properties to particle
!**************************************
end
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment