Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fixed argument list in encounter write interface and removed unnecess…
Browse files Browse the repository at this point in the history
…ary encounter_list variables
  • Loading branch information
daminton committed Dec 4, 2022
1 parent 8bd3cdf commit c094acc
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 71 deletions.
2 changes: 1 addition & 1 deletion src/encounter/encounter_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module subroutine encounter_io_initialize_output(self, param)
end subroutine encounter_io_initialize_output


module subroutine encounter_io_write_frame(self, iu, param)
module subroutine encounter_io_write_frame(self, nciu, param)
!! author: David A. Minton
!!
!! Write a frame of output of an encounter list structure.
Expand Down
20 changes: 0 additions & 20 deletions src/encounter/encounter_setup.f90
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,6 @@ module subroutine encounter_setup_list(self, n)
if (allocated(self%x2)) deallocate(self%x2)
if (allocated(self%v1)) deallocate(self%v1)
if (allocated(self%v2)) deallocate(self%v2)
if (allocated(self%Gmass1)) deallocate(self%Gmass1)
if (allocated(self%Gmass2)) deallocate(self%Gmass2)
if (allocated(self%radius1)) deallocate(self%radius1)
if (allocated(self%radius2)) deallocate(self%radius2)
if (allocated(self%name1)) deallocate(self%name1)
if (allocated(self%name2)) deallocate(self%name2)

self%nenc = n
if (n == 0_I8B) return
Expand All @@ -98,12 +92,6 @@ module subroutine encounter_setup_list(self, n)
allocate(self%x2(NDIM,n))
allocate(self%v1(NDIM,n))
allocate(self%v2(NDIM,n))
allocate(self%Gmass1(n))
allocate(self%Gmass2(n))
allocate(self%radius1(n))
allocate(self%radius2(n))
allocate(self%name1(n))
allocate(self%name2(n))

self%lvdotr(:) = .false.
self%status(:) = INACTIVE
Expand All @@ -115,14 +103,6 @@ module subroutine encounter_setup_list(self, n)
self%x2(:,:) = 0.0_DP
self%v1(:,:) = 0.0_DP
self%v2(:,:) = 0.0_DP
self%Gmass1(:) = 0.0_DP
self%Gmass2(:) = 0.0_DP
self%radius1(:) = 0.0_DP
self%radius2(:) = 0.0_DP
do i = 1_I8B, n
self%name1(i) = "UNNAMED"
self%name2(i) = "UNNAMED"
end do

return
end subroutine encounter_setup_list
Expand Down
24 changes: 0 additions & 24 deletions src/encounter/encounter_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ module subroutine encounter_util_append_list(self, source, lsource_mask)
call util_append(self%x2, source%x2, nold, nsrc, lsource_mask)
call util_append(self%v1, source%v1, nold, nsrc, lsource_mask)
call util_append(self%v2, source%v2, nold, nsrc, lsource_mask)
call util_append(self%Gmass1, source%Gmass1, nold, nsrc, lsource_mask)
call util_append(self%Gmass2, source%Gmass2, nold, nsrc, lsource_mask)
call util_append(self%radius1, source%radius1, nold, nsrc, lsource_mask)
call util_append(self%radius2, source%radius2, nold, nsrc, lsource_mask)
call util_append(self%name1, source%name1, nold, nsrc, lsource_mask)
call util_append(self%name2, source%name2, nold, nsrc, lsource_mask)
self%nenc = nold + count(lsource_mask(1:nsrc))

return
Expand Down Expand Up @@ -70,12 +64,6 @@ module subroutine encounter_util_copy_list(self, source)
self%x2(:,1:n) = source%x2(:,1:n)
self%v1(:,1:n) = source%v1(:,1:n)
self%v2(:,1:n) = source%v2(:,1:n)
self%Gmass1(1:n) = source%Gmass1(1:n)
self%Gmass2(1:n) = source%Gmass2(1:n)
self%radius1(1:n) = source%radius1(1:n)
self%radius2(1:n) = source%radius2(1:n)
self%name1(1:n) = source%name1(1:n)
self%name2(1:n) = source%name2(1:n)
end associate

return
Expand Down Expand Up @@ -115,12 +103,6 @@ module subroutine encounter_util_dealloc_list(self)
if (allocated(self%x2)) deallocate(self%x2)
if (allocated(self%v1)) deallocate(self%v1)
if (allocated(self%v2)) deallocate(self%v2)
if (allocated(self%Gmass1)) deallocate(self%Gmass1)
if (allocated(self%Gmass2)) deallocate(self%Gmass2)
if (allocated(self%radius1)) deallocate(self%radius1)
if (allocated(self%radius2)) deallocate(self%radius2)
if (allocated(self%name1)) deallocate(self%name1)
if (allocated(self%name2)) deallocate(self%name2)

return
end subroutine encounter_util_dealloc_list
Expand Down Expand Up @@ -216,12 +198,6 @@ module subroutine encounter_util_spill_list(self, discards, lspill_list, ldestru
call util_spill(keeps%x2, discards%x2, lspill_list, ldestructive)
call util_spill(keeps%v1, discards%v1, lspill_list, ldestructive)
call util_spill(keeps%v2, discards%v2, lspill_list, ldestructive)
call util_spill(keeps%Gmass1, discards%Gmass1, lspill_list, ldestructive)
call util_spill(keeps%Gmass2, discards%Gmass2, lspill_list, ldestructive)
call util_spill(keeps%radius1, discards%radius1, lspill_list, ldestructive)
call util_spill(keeps%radius2, discards%radius2, lspill_list, ldestructive)
call util_spill(keeps%name1, discards%name1, lspill_list, ldestructive)
call util_spill(keeps%name2, discards%name2, lspill_list, ldestructive)

nenc_old = keeps%nenc

Expand Down
10 changes: 2 additions & 8 deletions src/modules/encounter_classes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@ module encounter_classes
real(DP), dimension(:,:), allocatable :: x2 !! the position of body 2 in the encounter
real(DP), dimension(:,:), allocatable :: v1 !! the velocity of body 1 in the encounter
real(DP), dimension(:,:), allocatable :: v2 !! the velocity of body 2 in the encounter
real(DP), dimension(:), allocatable :: Gmass1 !! G*mass of body 1 in the encounter
real(DP), dimension(:), allocatable :: Gmass2 !! G*mass of body 2 in the encounter
real(DP), dimension(:), allocatable :: radius1 !! radius of body 1 in the encounter
real(DP), dimension(:), allocatable :: radius2 !! radius of body 2 in the encounter
character(NAMELEN), dimension(:), allocatable :: name1 !! name body 1 in the encounter
character(NAMELEN), dimension(:), allocatable :: name2 !! name of body 2 in the encounter
contains
procedure :: setup => encounter_setup_list !! A constructor that sets the number of encounters and allocates and initializes all arrays
procedure :: append => encounter_util_append_list !! Appends elements from one structure to another
Expand Down Expand Up @@ -217,10 +211,10 @@ module subroutine encounter_io_initialize_output(self, param)
class(swiftest_parameters), intent(in) :: param
end subroutine encounter_io_initialize_output

module subroutine encounter_io_write_frame(self, iu, param)
module subroutine encounter_io_write_frame(self, nciu, param)
implicit none
class(encounter_list), intent(in) :: self !! Swiftest encounter structure
class(encounter_io_parameters), intent(inout) :: iu !! Parameters used to identify a particular encounter io NetCDF dataset
class(encounter_io_parameters), intent(inout) :: nciu !! Parameters used to identify a particular encounter io NetCDF dataset
class(swiftest_parameters), intent(inout) :: param !! Current run configuration parameters
end subroutine encounter_io_write_frame

Expand Down
18 changes: 0 additions & 18 deletions src/symba/symba_util.f90
Original file line number Diff line number Diff line change
Expand Up @@ -726,12 +726,6 @@ module subroutine symba_util_rearray_pl(self, system, param)
! This is an encounter we already know about, so save the old information
system%plplenc_list%lvdotr(k) = plplenc_old%lvdotr(k)
system%plplenc_list%status(k) = plplenc_old%status(k)
system%plplenc_list%Gmass1(k) = plplenc_old%Gmass1(k)
system%plplenc_list%Gmass2(k) = plplenc_old%Gmass2(k)
system%plplenc_list%radius1(k) = plplenc_old%radius1(k)
system%plplenc_list%radius2(k) = plplenc_old%radius2(k)
system%plplenc_list%name1(k) = plplenc_old%name1(k)
system%plplenc_list%name2(k) = plplenc_old%name2(k)
system%plplenc_list%x1(:,k) = plplenc_old%x1(:,k)
system%plplenc_list%x2(:,k) = plplenc_old%x2(:,k)
system%plplenc_list%v1(:,k) = plplenc_old%v1(:,k)
Expand All @@ -742,12 +736,6 @@ module subroutine symba_util_rearray_pl(self, system, param)
! This is an encounter we already know about, but with the order reversed, so save the old information
system%plplenc_list%lvdotr(k) = plplenc_old%lvdotr(k)
system%plplenc_list%status(k) = plplenc_old%status(k)
system%plplenc_list%Gmass1(k) = plplenc_old%Gmass2(k)
system%plplenc_list%Gmass2(k) = plplenc_old%Gmass1(k)
system%plplenc_list%radius1(k) = plplenc_old%radius2(k)
system%plplenc_list%radius2(k) = plplenc_old%radius1(k)
system%plplenc_list%name1(k) = plplenc_old%name2(k)
system%plplenc_list%name2(k) = plplenc_old%name1(k)
system%plplenc_list%x1(:,k) = plplenc_old%x2(:,k)
system%plplenc_list%x2(:,k) = plplenc_old%x1(:,k)
system%plplenc_list%v1(:,k) = plplenc_old%v2(:,k)
Expand Down Expand Up @@ -775,12 +763,6 @@ module subroutine symba_util_rearray_pl(self, system, param)
system%plplenc_list%id2(1:nencmin) = pack(system%plplenc_list%id2(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%lvdotr(1:nencmin) = pack(system%plplenc_list%lvdotr(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%status(1:nencmin) = pack(system%plplenc_list%status(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%Gmass1(1:nencmin) = pack(system%plplenc_list%Gmass1(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%Gmass2(1:nencmin) = pack(system%plplenc_list%Gmass2(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%radius1(1:nencmin) = pack(system%plplenc_list%radius1(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%radius2(1:nencmin) = pack(system%plplenc_list%radius2(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%name1(1:nencmin) = pack(system%plplenc_list%name1(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%name2(1:nencmin) = pack(system%plplenc_list%name2(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%tcollision(1:nencmin) = pack(system%plplenc_list%tcollision(1:nenc_old), lmask(1:nenc_old))
system%plplenc_list%level(1:nencmin) = pack(system%plplenc_list%level(1:nenc_old), lmask(1:nenc_old))
do i = 1, NDIM
Expand Down

0 comments on commit c094acc

Please sign in to comment.