Skip to content

Commit

Permalink
Merge branch 'hotfix/4.17.15' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
keithbennett committed Feb 16, 2021
2 parents 3245264 + c2eb131 commit bbc1c3f
Show file tree
Hide file tree
Showing 23 changed files with 50 additions and 173 deletions.
8 changes: 4 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_ubuntu_gfortran:
- web
- hook
except:
- master
- main
- wip/*
- tag
script:
Expand All @@ -27,7 +27,7 @@ test_ubuntu_intel:
- web
- hook
except:
- master
- main
- wip/*
- tag
script:
Expand All @@ -43,7 +43,7 @@ test_ubuntu_pgi:
- web
- hook
except:
- master
- main
- wip/*
- tag
script:
Expand All @@ -60,7 +60,7 @@ test_osx:
- web
- hook
except:
- master
- main
- wip/*
- tag
script:
Expand Down
2 changes: 1 addition & 1 deletion SDF
Submodule SDF updated 4 files
+1 −1 C
+1 −1 FORTRAN
+1 −1 VisIt
+1 −1 utilities
1 change: 1 addition & 0 deletions epoch1d/src/deck/deck_control_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SUBROUTINE control_deck_initialise
n_zeros_control = -1
dlb_maximum_interval = 500
dlb_force_interval = 2000
dlb_threshold = -1.0_num
nx_global = -1
particle_push_start_time = 0.0_num
particle_migration_interval = 1
Expand Down
8 changes: 7 additions & 1 deletion epoch1d/src/deck/deck_io_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ END SUBROUTINE io_deck_initialise
SUBROUTINE io_deck_finalise

INTEGER :: i, io, iu, n_zeros_estimate, n_dumps
REAL(num) :: dumps
REAL(num) :: dumps, dx
#ifndef NO_IO
CHARACTER(LEN=c_max_path_length) :: list_filename
#endif
Expand Down Expand Up @@ -138,6 +138,12 @@ SUBROUTINE io_deck_finalise
IF (io_block_list(i)%dt_snapshot > 0.0_num) THEN
dumps = MAX(dumps, t_end / io_block_list(i)%dt_snapshot)
END IF

! This might fail if Debye length not resolved
IF (io_block_list(i)%nstep_snapshot > 0) THEN
dx = (x_max - x_min) / nx_global
dumps = MAX(dumps, t_end * c / dx / io_block_list(i)%nstep_snapshot)
END IF
END DO

n_dumps = FLOOR(dumps)
Expand Down
1 change: 1 addition & 0 deletions epoch1d/src/deck/deck_species_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ SUBROUTINE species_deck_initialise
ALLOCATE(dumpmask_array(4))
ALLOCATE(bc_particle_array(2*c_ndims,4))
release_species = ''
release_species_list = ''
END IF

END SUBROUTINE species_deck_initialise
Expand Down
2 changes: 2 additions & 0 deletions epoch1d/src/housekeeping/window.F90
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ SUBROUTINE insert_particles
DO ispecies = 1, n_species
species => species_list(ispecies)

IF (species%background_species) CYCLE

CALL create_empty_partlist(append_list)
npart_per_cell = FLOOR(species%npart_per_cell, KIND=i8)
npart_frac = species%npart_per_cell - npart_per_cell
Expand Down
2 changes: 1 addition & 1 deletion epoch1d/src/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def print_integer_array(value):
print_integer_array(0)
else:
if pack_git_diff_from_origin:
sp.call(["git diff origin/master > %s" % gitdiff], shell=True)
sp.call(["git diff origin/main > %s" % gitdiff], shell=True)
else:
sp.call(["git diff > %s" % gitdiff], shell=True)
if os.path.getsize(gitdiff) != 0:
Expand Down
2 changes: 1 addition & 1 deletion epoch1d/src/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ cat >> $outfile <<EOF
EOF
else
if [ $pack_git_diff_from_origin -ne 0 ]; then
git diff --exit-code origin/master > $gitdiff
git diff --exit-code origin/main > $gitdiff
else
git diff --exit-code > $gitdiff
fi
Expand Down
54 changes: 1 addition & 53 deletions epoch1d/src/physics_packages/collisions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,6 @@ SUBROUTINE intra_collisions_np(p_list, mass, charge, weight, &
REAL(num), PARAMETER :: two_thirds = 2.0_num / 3.0_num
REAL(num), PARAMETER :: pi_fac = &
(4.0_num * pi / 3.0_num)**(1.0_num / 3.0_num)
#ifndef PER_SPECIES_WEIGHT
REAL(num) :: w1, w2, wr, e1, e5, e2, e6
#endif
factor = 0.0_num
np = 0.0_num

Expand Down Expand Up @@ -1132,29 +1129,6 @@ SUBROUTINE intra_collisions_np(p_list, mass, charge, weight, &
p5 = (p3 + (gc_m1_vc * DOT_PRODUCT(vc, p3) + gm3 * gc) * vc) * c
p6 = (p4 + (gc_m1_vc * DOT_PRODUCT(vc, p4) + gm4 * gc) * vc) * c

#ifndef PER_SPECIES_WEIGHT
w1 = current%weight
w2 = impact%weight
wr = w1 / w2

! Energies before and after collision.
! Only required for weighted particle correction
e1 = c * SQRT(DOT_PRODUCT(p1, p1) + (m1 * c)**2)
e2 = c * SQRT(DOT_PRODUCT(p2, p2) + (m2 * c)**2)

e5 = c * SQRT(DOT_PRODUCT(p5, p5) + (m1 * c)**2)
e6 = c * SQRT(DOT_PRODUCT(p6, p6) + (m2 * c)**2)

! Restore values of p1, p2
p1 = p1 * c
p2 = p2 * c

IF (wr > one_p_2eps) THEN
CALL weighted_particles_correction(w2 / w1, p1, p5, e1, e5, m1)
ELSE IF (wr < one_m_2eps) THEN
CALL weighted_particles_correction(w1 / w2, p2, p6, e2, e6, m2)
END IF
#endif
! Update particle properties
current%part_p = p5
impact%part_p = p6
Expand Down Expand Up @@ -1438,7 +1412,7 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
TYPE(particle), POINTER :: current, impact
REAL(num) :: factor, np
INTEGER(i8) :: icount, jcount, pcount, k
REAL(num) :: m1, m2, q1, q2, w1, w2
REAL(num) :: m1, m2, q1, q2
REAL(num) :: ran1, ran2, s12, cosp, sinp, s_fac, v_rel
REAL(num) :: sinp_cos, sinp_sin, s_prime, s_fac_prime
REAL(num) :: a, a_inv, p_perp, p_tot, v_sq, gamma_rel_inv
Expand All @@ -1448,7 +1422,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
REAL(num), DIMENSION(3,3) :: mat
REAL(num) :: p_mag, p_mag2, fac, gc, vc_sq, wr
REAL(num) :: gm1, gm2, gm3, gm4, gm, gc_m1_vc
REAL(num) :: e1, e5, e2, e6
REAL(num), PARAMETER :: pi4_eps2_c4 = 4.0_num * pi * epsilon0**2 * c**4
REAL(num), PARAMETER :: two_thirds = 2.0_num / 3.0_num
REAL(num), PARAMETER :: pi_fac = &
Expand Down Expand Up @@ -1506,9 +1479,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
m2 = mass2
q1 = charge1
q2 = charge2
w1 = weight1
w2 = weight2
wr = w1 / w2

current => p_list1%head
impact => p_list2%head
Expand All @@ -1525,11 +1495,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
q1 = current%charge
q2 = impact%charge
#endif
#ifndef PER_SPECIES_WEIGHT
w1 = current%weight
w2 = impact%weight
wr = w1 / w2
#endif

p1 = current%part_p / c
p2 = impact%part_p / c
Expand Down Expand Up @@ -1557,10 +1522,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
v1 = p1 / gm1
v2 = p2 / gm2

! Pre-collision energies
e1 = c * SQRT(DOT_PRODUCT(p1, p1) + (m1 * c)**2)
e2 = c * SQRT(DOT_PRODUCT(p2, p2) + (m2 * c)**2)

! Velocity of centre-of-momentum (COM) reference frame
vc = (p1 + p2) / gm
vc_sq = DOT_PRODUCT(vc, vc)
Expand Down Expand Up @@ -1642,19 +1603,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
p5 = (p3 + (gc_m1_vc * DOT_PRODUCT(vc, p3) + gm3 * gc) * vc) * c
p6 = (p4 + (gc_m1_vc * DOT_PRODUCT(vc, p4) + gm4 * gc) * vc) * c

e5 = c * SQRT(DOT_PRODUCT(p5, p5) + (m1 * c)**2)
e6 = c * SQRT(DOT_PRODUCT(p6, p6) + (m2 * c)**2)

! Restore values of p1, p2
p1 = p1 * c
p2 = p2 * c

IF (wr > one_p_2eps) THEN
CALL weighted_particles_correction(w2 / w1, p1, p5, e1, e5, m1)
ELSE IF (wr < one_m_2eps) THEN
CALL weighted_particles_correction(w1 / w2, p2, p6, e2, e6, m2)
END IF

! Update particle properties
current%part_p = p5
impact%part_p = p6
Expand Down
1 change: 1 addition & 0 deletions epoch2d/src/deck/deck_control_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SUBROUTINE control_deck_initialise
n_zeros_control = -1
dlb_maximum_interval = 500
dlb_force_interval = 2000
dlb_threshold = -1.0_num
nx_global = -1
ny_global = -1
particle_push_start_time = 0.0_num
Expand Down
9 changes: 8 additions & 1 deletion epoch2d/src/deck/deck_io_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ END SUBROUTINE io_deck_initialise
SUBROUTINE io_deck_finalise

INTEGER :: i, io, iu, n_zeros_estimate, n_dumps
REAL(num) :: dumps
REAL(num) :: dumps, dx
#ifndef NO_IO
CHARACTER(LEN=c_max_path_length) :: list_filename
#endif
Expand Down Expand Up @@ -138,6 +138,13 @@ SUBROUTINE io_deck_finalise
IF (io_block_list(i)%dt_snapshot > 0.0_num) THEN
dumps = MAX(dumps, t_end / io_block_list(i)%dt_snapshot)
END IF

! This might fail if Debye length not resolved
IF (io_block_list(i)%nstep_snapshot > 0) THEN
dx = (x_max - x_min) / nx_global
dx = MIN(dx, (y_max - y_min) / ny_global)
dumps = MAX(dumps, t_end * c / dx / io_block_list(i)%nstep_snapshot)
END IF
END DO

n_dumps = FLOOR(dumps)
Expand Down
1 change: 1 addition & 0 deletions epoch2d/src/deck/deck_species_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ SUBROUTINE species_deck_initialise
ALLOCATE(dumpmask_array(4))
ALLOCATE(bc_particle_array(2*c_ndims,4))
release_species = ''
release_species_list = ''
END IF

END SUBROUTINE species_deck_initialise
Expand Down
2 changes: 2 additions & 0 deletions epoch2d/src/housekeeping/window.F90
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ SUBROUTINE insert_particles
DO ispecies = 1, n_species
species => species_list(ispecies)

IF (species%background_species) CYCLE

CALL create_empty_partlist(append_list)
npart_per_cell = FLOOR(species%npart_per_cell, KIND=i8)
npart_frac = species%npart_per_cell - npart_per_cell
Expand Down
2 changes: 1 addition & 1 deletion epoch2d/src/pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ def print_integer_array(value):
print_integer_array(0)
else:
if pack_git_diff_from_origin:
sp.call(["git diff origin/master > %s" % gitdiff], shell=True)
sp.call(["git diff origin/main > %s" % gitdiff], shell=True)
else:
sp.call(["git diff > %s" % gitdiff], shell=True)
if os.path.getsize(gitdiff) != 0:
Expand Down
2 changes: 1 addition & 1 deletion epoch2d/src/pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ cat >> $outfile <<EOF
EOF
else
if [ $pack_git_diff_from_origin -ne 0 ]; then
git diff --exit-code origin/master > $gitdiff
git diff --exit-code origin/main > $gitdiff
else
git diff --exit-code > $gitdiff
fi
Expand Down
54 changes: 1 addition & 53 deletions epoch2d/src/physics_packages/collisions.F90
Original file line number Diff line number Diff line change
Expand Up @@ -981,9 +981,6 @@ SUBROUTINE intra_collisions_np(p_list, mass, charge, weight, &
REAL(num), PARAMETER :: two_thirds = 2.0_num / 3.0_num
REAL(num), PARAMETER :: pi_fac = &
(4.0_num * pi / 3.0_num)**(1.0_num / 3.0_num)
#ifndef PER_SPECIES_WEIGHT
REAL(num) :: w1, w2, wr, e1, e5, e2, e6
#endif
factor = 0.0_num
np = 0.0_num

Expand Down Expand Up @@ -1147,29 +1144,6 @@ SUBROUTINE intra_collisions_np(p_list, mass, charge, weight, &
p5 = (p3 + (gc_m1_vc * DOT_PRODUCT(vc, p3) + gm3 * gc) * vc) * c
p6 = (p4 + (gc_m1_vc * DOT_PRODUCT(vc, p4) + gm4 * gc) * vc) * c

#ifndef PER_SPECIES_WEIGHT
w1 = current%weight
w2 = impact%weight
wr = w1 / w2

! Energies before and after collision.
! Only required for weighted particle correction
e1 = c * SQRT(DOT_PRODUCT(p1, p1) + (m1 * c)**2)
e2 = c * SQRT(DOT_PRODUCT(p2, p2) + (m2 * c)**2)

e5 = c * SQRT(DOT_PRODUCT(p5, p5) + (m1 * c)**2)
e6 = c * SQRT(DOT_PRODUCT(p6, p6) + (m2 * c)**2)

! Restore values of p1, p2
p1 = p1 * c
p2 = p2 * c

IF (wr > one_p_2eps) THEN
CALL weighted_particles_correction(w2 / w1, p1, p5, e1, e5, m1)
ELSE IF (wr < one_m_2eps) THEN
CALL weighted_particles_correction(w1 / w2, p2, p6, e2, e6, m2)
END IF
#endif
! Update particle properties
current%part_p = p5
impact%part_p = p6
Expand Down Expand Up @@ -1453,7 +1427,7 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
TYPE(particle), POINTER :: current, impact
REAL(num) :: factor, np
INTEGER(i8) :: icount, jcount, pcount, k
REAL(num) :: m1, m2, q1, q2, w1, w2
REAL(num) :: m1, m2, q1, q2
REAL(num) :: ran1, ran2, s12, cosp, sinp, s_fac, v_rel
REAL(num) :: sinp_cos, sinp_sin, s_prime, s_fac_prime
REAL(num) :: a, a_inv, p_perp, p_tot, v_sq, gamma_rel_inv
Expand All @@ -1463,7 +1437,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
REAL(num), DIMENSION(3,3) :: mat
REAL(num) :: p_mag, p_mag2, fac, gc, vc_sq, wr
REAL(num) :: gm1, gm2, gm3, gm4, gm, gc_m1_vc
REAL(num) :: e1, e5, e2, e6
REAL(num), PARAMETER :: pi4_eps2_c4 = 4.0_num * pi * epsilon0**2 * c**4
REAL(num), PARAMETER :: two_thirds = 2.0_num / 3.0_num
REAL(num), PARAMETER :: pi_fac = &
Expand Down Expand Up @@ -1521,9 +1494,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
m2 = mass2
q1 = charge1
q2 = charge2
w1 = weight1
w2 = weight2
wr = w1 / w2

current => p_list1%head
impact => p_list2%head
Expand All @@ -1540,11 +1510,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
q1 = current%charge
q2 = impact%charge
#endif
#ifndef PER_SPECIES_WEIGHT
w1 = current%weight
w2 = impact%weight
wr = w1 / w2
#endif

p1 = current%part_p / c
p2 = impact%part_p / c
Expand Down Expand Up @@ -1572,10 +1537,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
v1 = p1 / gm1
v2 = p2 / gm2

! Pre-collision energies
e1 = c * SQRT(DOT_PRODUCT(p1, p1) + (m1 * c)**2)
e2 = c * SQRT(DOT_PRODUCT(p2, p2) + (m2 * c)**2)

! Velocity of centre-of-momentum (COM) reference frame
vc = (p1 + p2) / gm
vc_sq = DOT_PRODUCT(vc, vc)
Expand Down Expand Up @@ -1657,19 +1618,6 @@ SUBROUTINE inter_collisions_np(p_list1, p_list2, mass1, mass2, &
p5 = (p3 + (gc_m1_vc * DOT_PRODUCT(vc, p3) + gm3 * gc) * vc) * c
p6 = (p4 + (gc_m1_vc * DOT_PRODUCT(vc, p4) + gm4 * gc) * vc) * c

e5 = c * SQRT(DOT_PRODUCT(p5, p5) + (m1 * c)**2)
e6 = c * SQRT(DOT_PRODUCT(p6, p6) + (m2 * c)**2)

! Restore values of p1, p2
p1 = p1 * c
p2 = p2 * c

IF (wr > one_p_2eps) THEN
CALL weighted_particles_correction(w2 / w1, p1, p5, e1, e5, m1)
ELSE IF (wr < one_m_2eps) THEN
CALL weighted_particles_correction(w1 / w2, p2, p6, e2, e6, m2)
END IF

! Update particle properties
current%part_p = p5
impact%part_p = p6
Expand Down
1 change: 1 addition & 0 deletions epoch3d/src/deck/deck_control_block.F90
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SUBROUTINE control_deck_initialise
n_zeros_control = -1
dlb_maximum_interval = 500
dlb_force_interval = 2000
dlb_threshold = -1.0_num
nx_global = -1
ny_global = -1
nz_global = -1
Expand Down
Loading

0 comments on commit bbc1c3f

Please sign in to comment.