diff --git a/src/modules/swiftest.f90 b/src/modules/swiftest.f90 index 3cd04545e..bd329f0d9 100644 --- a/src/modules/swiftest.f90 +++ b/src/modules/swiftest.f90 @@ -205,7 +205,9 @@ module swiftest real(DP) :: R0 = 0.0_DP !! Initial radius of the central body real(DP) :: dR = 0.0_DP !! Change in the radius of the central body contains - procedure :: read_in => swiftest_io_read_in_cb !! Read in central body initial conditions from an ASCII file + procedure :: read_in => swiftest_io_read_in_cb !! Read in central body initial conditions from an ASCII file + procedure :: write_frame => swiftest_io_netcdf_write_frame_cb !! I/O routine for writing out a single frame of time-series data for all bodies in the system in NetCDF format + procedure :: write_info => swiftest_io_netcdf_write_info_cb !! Dump contents of particle information metadata to file end type swiftest_cb @@ -870,6 +872,13 @@ module subroutine swiftest_io_netcdf_write_frame_body(self, nc, param) class(base_parameters), intent(inout) :: param !! Current run configuration parameters end subroutine swiftest_io_netcdf_write_frame_body + module subroutine swiftest_io_netcdf_write_frame_cb(self, nc, param) + implicit none + class(swiftest_cb), intent(in) :: self !! Swiftest base object + class(base_io_netcdf_parameters), intent(inout) :: nc !! Parameters used to for writing a NetCDF dataset to file + class(base_parameters), intent(inout) :: param !! Current run configuration parameters + end subroutine swiftest_io_netcdf_write_frame_cb + module subroutine swiftest_io_netcdf_write_frame_system(self, nc, param) implicit none class(swiftest_nbody_system), intent(inout) :: self !! Swiftest system object @@ -891,6 +900,13 @@ module subroutine swiftest_io_netcdf_write_info_body(self, nc, param) class(base_parameters), intent(inout) :: param !! Current run configuration parameters end subroutine swiftest_io_netcdf_write_info_body + module subroutine swiftest_io_netcdf_write_info_cb(self, nc, param) + implicit none + class(swiftest_cb), intent(in) :: self !! Swiftest particle object + class(base_io_netcdf_parameters), intent(inout) :: nc !! Parameters used to identify a particular NetCDF dataset + class(base_parameters), intent(inout) :: param !! Current run configuration parameters + end subroutine swiftest_io_netcdf_write_info_cb + module subroutine swiftest_io_write_discard(self, param) implicit none class(swiftest_nbody_system), intent(inout) :: self !! SyMBA nbody system object diff --git a/src/swiftest_procedures/swiftest_io_netcdf.f90 b/src/swiftest_procedures/swiftest_io_netcdf.f90 index f9d48e366..f45c29639 100644 --- a/src/swiftest_procedures/swiftest_io_netcdf.f90 +++ b/src/swiftest_procedures/swiftest_io_netcdf.f90 @@ -133,7 +133,7 @@ module subroutine swiftest_io_netcdf_initialize_output(self, param) end if ! Create the file - call netcdf_check( nf90_create(nc%file_name, NF90io_netcdf4, nc%id), "swiftest_io_netcdf_initialize_output nf90_create" ) + call netcdf_check( nf90_create(nc%file_name, NF90_NETCDF4, nc%id), "swiftest_io_netcdf_initialize_output nf90_create" ) ! Dimensions call netcdf_check( nf90_def_dim(nc%id, nc%time_dimname, NF90_UNLIMITED, nc%time_dimid), "swiftest_io_netcdf_initialize_output nf90_def_dim time_dimid" ) ! Simulation time dimension @@ -788,8 +788,7 @@ module subroutine swiftest_io_netcdf_read_particle_info_system(self, nc, param, call cb%info%set_value(particle_type=CB_TYPE_NAME) ! Handle semi-interacting bodies in SyMBA - select type(pl) - class is (symba_pl) + if (param%integrator == INT_SYMBA) then select type (param) class is (swiftest_parameters) do i = 1, npl @@ -800,11 +799,11 @@ module subroutine swiftest_io_netcdf_read_particle_info_system(self, nc, param, end if end do end select - class default ! Non-SyMBA massive bodies + else ! Non-SyMBA massive bodies do i = 1, npl call pl%info(i)%set_value(particle_type=PL_TYPE_NAME) end do - end select + end if do i = 1, ntp call tp%info(i)%set_value(particle_type=TP_TYPE_NAME) end do @@ -975,7 +974,9 @@ module subroutine swiftest_io_netcdf_write_frame_body(self, nc, param) call netcdf_check( nf90_set_fill(nc%id, nf90_nofill, old_mode), "swiftest_io_netcdf_write_frame_body nf90_set_fill" ) select type(self) - class is (swiftest_body) + class is (swiftest_body) + select type (param) + class is (swiftest_parameters) associate(n => self%nbody) if (n == 0) return @@ -1044,23 +1045,7 @@ module subroutine swiftest_io_netcdf_write_frame_body(self, nc, param) end select end do end associate - class is (swiftest_cb) - idslot = self%id + 1 - call netcdf_check( nf90_put_var(nc%id, nc%id_varid, self%id, start=[idslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb id_varid" ) - - call netcdf_check( nf90_put_var(nc%id, nc%Gmass_varid, self%Gmass, start=[idslot, tslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb Gmass_varid" ) - if (param%lclose) call netcdf_check( nf90_put_var(nc%id, nc%radius_varid, self%radius, start=[idslot, tslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb radius_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%j2rp2_varid, self%j2rp2, start=[tslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb j2rp2_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%j4rp4_varid, self%j4rp4, start=[tslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb j4rp4_varid" ) - if (param%lrotation) then - call netcdf_check( nf90_put_var(nc%id, nc%Ip_varid, self%Ip(:), start=[1, idslot, tslot], count=[NDIM,1,1]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb Ip_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%rot_varid, self%rot(:), start=[1, idslot, tslot], count=[NDIM,1,1]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb rot_varid" ) - end if - ! if (param%ltides) then - ! call netcdf_check( nf90_put_var(nc%id, nc%k2_varid, self%k2, start=[idslot, tslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb k2_varid" ) - ! call netcdf_check( nf90_put_var(nc%id, nc%Q_varid, self%Q, start=[idslot, tslot]), "swiftest_io_netcdf_write_frame_body nf90_put_var cb Q_varid" ) - ! end if - + end select end select call netcdf_check( nf90_set_fill(nc%id, old_mode, old_mode), "swiftest_io_netcdf_write_frame_body nf90_set_fill old_mode" ) @@ -1068,6 +1053,42 @@ module subroutine swiftest_io_netcdf_write_frame_body(self, nc, param) end subroutine swiftest_io_netcdf_write_frame_body + module subroutine swiftest_io_netcdf_write_frame_cb(self, nc, param) + !! author: Carlisle A. Wishard, Dana Singh, and David A. Minton + !! + !! Write a frame of output of the central body + implicit none + ! Arguments + class(swiftest_cb), intent(in) :: self !! Swiftest base object + class(base_io_netcdf_parameters), intent(inout) :: nc !! Parameters used to for writing a NetCDF dataset to file + class(base_parameters), intent(inout) :: param !! Current run configuration parameters + ! Internals + integer(I4B) :: i, j, tslot, idslot, old_mode + + tslot = param%ioutput + + call self%write_info(nc, param) + + call netcdf_check( nf90_set_fill(nc%id, nf90_nofill, old_mode), "swiftest_io_netcdf_write_frame_cb nf90_set_fill" ) + + idslot = self%id + 1 + call netcdf_check( nf90_put_var(nc%id, nc%id_varid, self%id, start=[idslot]), "swiftest_io_netcdf_write_frame_cb nf90_put_var cb id_varid" ) + + call netcdf_check( nf90_put_var(nc%id, nc%Gmass_varid, self%Gmass, start=[idslot, tslot]), "swiftest_io_netcdf_write_frame_cb nf90_put_var cb Gmass_varid" ) + if (param%lclose) call netcdf_check( nf90_put_var(nc%id, nc%radius_varid, self%radius, start=[idslot, tslot]), "swiftest_io_netcdf_write_frame_cb nf90_put_var cb radius_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%j2rp2_varid, self%j2rp2, start=[tslot]), "swiftest_io_netcdf_write_frame_cb nf90_put_var cb j2rp2_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%j4rp4_varid, self%j4rp4, start=[tslot]), "swiftest_io_netcdf_write_frame_cb nf90_put_var cb j4rp4_varid" ) + if (param%lrotation) then + call netcdf_check( nf90_put_var(nc%id, nc%Ip_varid, self%Ip(:), start=[1, idslot, tslot], count=[NDIM,1,1]), "swiftest_io_netcdf_write_frame_cb nf90_put_var cb Ip_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%rot_varid, self%rot(:), start=[1, idslot, tslot], count=[NDIM,1,1]), "swiftest_io_netcdf_write_frame_cby nf90_put_var cb rot_varid" ) + end if + + call netcdf_check( nf90_set_fill(nc%id, old_mode, old_mode), "swiftest_io_netcdf_write_frame_cb nf90_set_fill old_mode" ) + + return + end subroutine swiftest_io_netcdf_write_frame_cb + + module subroutine swiftest_io_netcdf_write_frame_system(self, nc, param) !! author: The Purdue Swiftest Team - David A. Minton, Carlisle A. Wishard, Jennifer L.L. Pouplin, and Jacob R. Elliott !! @@ -1087,7 +1108,6 @@ module subroutine swiftest_io_netcdf_write_frame_system(self, nc, param) end subroutine swiftest_io_netcdf_write_frame_system - module subroutine swiftest_io_netcdf_write_hdr_system(self, nc, param) !! author: David A. Minton !! @@ -1107,10 +1127,7 @@ module subroutine swiftest_io_netcdf_write_hdr_system(self, nc, param) call netcdf_check( nf90_put_var(nc%id, nc%time_varid, self%t, start=[tslot]), "swiftest_io_netcdf_write_hdr_system nf90_put_var time_varid" ) call netcdf_check( nf90_put_var(nc%id, nc%npl_varid, self%pl%nbody, start=[tslot]), "swiftest_io_netcdf_write_hdr_system nf90_put_var npl_varid" ) call netcdf_check( nf90_put_var(nc%id, nc%ntp_varid, self%tp%nbody, start=[tslot]), "swiftest_io_netcdf_write_hdr_system nf90_put_var ntp_varid" ) - select type(pl => self%pl) - class is (symba_pl) - call netcdf_check( nf90_put_var(nc%id, nc%nplm_varid, pl%nplm, start=[tslot]), "swiftest_io_netcdf_write_hdr_system nf90_put_var nplm_varid" ) - end select + if (param%integrator == INT_SYMBA) call netcdf_check( nf90_put_var(nc%id, nc%nplm_varid, self%pl%nplm, start=[tslot]), "swiftest_io_netcdf_write_hdr_system nf90_put_var nplm_varid" ) if (param%lenergy) then call netcdf_check( nf90_put_var(nc%id, nc%KE_orb_varid, self%ke_orbit, start=[tslot]), "swiftest_io_netcdf_write_hdr_system nf90_put_var KE_orb_varid" ) @@ -1177,35 +1194,53 @@ module subroutine swiftest_io_netcdf_write_info_body(self, nc, param) end do end associate + end select + + call netcdf_check( nf90_set_fill(nc%id, old_mode, old_mode) ) + return + end subroutine swiftest_io_netcdf_write_info_body + + + module subroutine swiftest_io_netcdf_write_info_cb(self, nc, param) + !! author: Carlisle A. Wishard, Dana Singh, and David A. Minton + !! + !! Write the central body info to file + implicit none + class(swiftest_cb), intent(in) :: self !! Swiftest particle object + class(base_io_netcdf_parameters), intent(inout) :: nc !! Parameters used to identify a particular NetCDF dataset + class(base_parameters), intent(inout) :: param !! Current run configuration parameters + ! Internals + integer(I4B) :: idslot, old_mode + character(len=:), allocatable :: charstring - class is (swiftest_cb) - idslot = self%id + 1 - call netcdf_check( nf90_put_var(nc%id, nc%id_varid, self%id, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb id_varid" ) + ! This string of spaces of length NAMELEN is used to clear out any old data left behind inside the string variables + call netcdf_check( nf90_set_fill(nc%id, nf90_nofill, old_mode), "swiftest_io_netcdf_write_info_body nf90_set_fill nf90_nofill" ) - charstring = trim(adjustl(self%info%name)) - call netcdf_check( nf90_put_var(nc%id, nc%name_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb name_varid" ) + idslot = self%id + 1 + call netcdf_check( nf90_put_var(nc%id, nc%id_varid, self%id, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb id_varid" ) - charstring = trim(adjustl(self%info%particle_type)) - call netcdf_check( nf90_put_var(nc%id, nc%ptype_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb ptype_varid" ) + charstring = trim(adjustl(self%info%name)) + call netcdf_check( nf90_put_var(nc%id, nc%name_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb name_varid" ) - if (param%lclose) then - charstring = trim(adjustl(self%info%origin_type)) - call netcdf_check( nf90_put_var(nc%id, nc%origin_type_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_type_varid" ) + charstring = trim(adjustl(self%info%particle_type)) + call netcdf_check( nf90_put_var(nc%id, nc%ptype_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb ptype_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%origin_time_varid, self%info%origin_time, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_time_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%origin_rh_varid, self%info%origin_rh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_rh_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%origin_vh_varid, self%info%origin_vh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_vh_varid" ) - - call netcdf_check( nf90_put_var(nc%id, nc%collision_id_varid, self%info%collision_id, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb collision_id_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%discard_time_varid, self%info%discard_time, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb discard_time_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%discard_rh_varid, self%info%discard_rh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb discard_rh_varid" ) - call netcdf_check( nf90_put_var(nc%id, nc%discard_vh_varid, self%info%discard_vh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb discard_vh_varid" ) - end if + if (param%lclose) then + charstring = trim(adjustl(self%info%origin_type)) + call netcdf_check( nf90_put_var(nc%id, nc%origin_type_varid, charstring, start=[1, idslot], count=[len(charstring), 1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_type_varid" ) - end select + call netcdf_check( nf90_put_var(nc%id, nc%origin_time_varid, self%info%origin_time, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_time_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%origin_rh_varid, self%info%origin_rh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_rh_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%origin_vh_varid, self%info%origin_vh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb origin_vh_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%collision_id_varid, self%info%collision_id, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb collision_id_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%discard_time_varid, self%info%discard_time, start=[idslot]), "swiftest_io_netcdf_write_info_body nf90_put_var cb discard_time_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%discard_rh_varid, self%info%discard_rh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb discard_rh_varid" ) + call netcdf_check( nf90_put_var(nc%id, nc%discard_vh_varid, self%info%discard_vh(:), start=[1, idslot], count=[NDIM,1]), "swiftest_io_netcdf_write_info_body nf90_put_var cb discard_vh_varid" ) + end if call netcdf_check( nf90_set_fill(nc%id, old_mode, old_mode) ) + return - end subroutine swiftest_io_netcdf_write_info_body + end subroutine swiftest_io_netcdf_write_info_cb end submodule s_io_netcdf diff --git a/src/swiftest_procedures/swiftest_kick.f90 b/src/swiftest_procedures/swiftest_kick.f90 index b1c9fe20a..584750098 100644 --- a/src/swiftest_procedures/swiftest_kick.f90 +++ b/src/swiftest_procedures/swiftest_kick.f90 @@ -7,7 +7,7 @@ !! You should have received a copy of the GNU General Public License along with Swiftest. !! If not, see: https://www.gnu.org/licenses. -submodule(swiftets) s_kick +submodule(swiftest) s_kick contains module subroutine swiftest_kick_getacch_int_pl(self, param) !! author: David A. Minton @@ -21,41 +21,41 @@ module subroutine swiftest_kick_getacch_int_pl(self, param) class(swiftest_pl), intent(inout) :: self !! Swiftest massive body object class(swiftest_parameters), intent(inout) :: param !! Current swiftest run configuration parameters ! Internals - type(interaction_timer), save :: itimer + ! type(interaction_timer), save :: itimer logical, save :: lfirst = .true. - if (param%ladaptive_interactions) then - if (self%nplpl > 0) then - if (lfirst) then - write(itimer%loopname, *) "kick_getacch_int_pl" - write(itimer%looptype, *) "INTERACTION" - call itimer%time_this_loop(param, self%nplpl, self) - lfirst = .false. - else - if (itimer%io_netcdf_check(param, self%nplpl)) call itimer%time_this_loop(param, self%nplpl, self) - end if - else - param%lflatten_interactions = .false. - end if - end if - - if (param%lflatten_interactions) then - if (param%lclose) then - call kick_getacch_int_all_flat_pl(self%nbody, self%nplpl, self%k_plpl, self%rh, self%Gmass, self%radius, self%ah) - else - call kick_getacch_int_all_flat_pl(self%nbody, self%nplpl, self%k_plpl, self%rh, self%Gmass, acc=self%ah) - end if - else + ! if (param%ladaptive_interactions) then + ! if (self%nplpl > 0) then + ! if (lfirst) then + ! write(itimer%loopname, *) "kick_getacch_int_pl" + ! write(itimer%looptype, *) "INTERACTION" + ! call itimer%time_this_loop(param, self%nplpl, self) + ! lfirst = .false. + ! else + ! if (itimer%io_netcdf_check(param, self%nplpl)) call itimer%time_this_loop(param, self%nplpl, self) + ! end if + ! else + ! param%lflatten_interactions = .false. + ! end if + ! end if + + ! if (param%lflatten_interactions) then + ! if (param%lclose) then + ! call swiftest_kick_getacch_int_all_flat_pl(self%nbody, self%nplpl, self%k_plpl, self%rh, self%Gmass, self%radius, self%ah) + ! else + ! call swiftest_kick_getacch_int_all_flat_pl(self%nbody, self%nplpl, self%k_plpl, self%rh, self%Gmass, acc=self%ah) + ! end if + ! else if (param%lclose) then - call kick_getacch_int_all_triangular_pl(self%nbody, self%nbody, self%rh, self%Gmass, self%radius, self%ah) + call swiftest_kick_getacch_int_all_triangular_pl(self%nbody, self%nbody, self%rh, self%Gmass, self%radius, self%ah) else - call kick_getacch_int_all_triangular_pl(self%nbody, self%nbody, self%rh, self%Gmass, acc=self%ah) + call swiftest_kick_getacch_int_all_triangular_pl(self%nbody, self%nbody, self%rh, self%Gmass, acc=self%ah) end if - end if + ! end if - if (param%ladaptive_interactions .and. self%nplpl > 0) then - if (itimer%is_on) call itimer%adapt(param, self%nplpl, self) - end if + ! if (param%ladaptive_interactions .and. self%nplpl > 0) then + ! if (itimer%is_on) call itimer%adapt(param, self%nplpl, self) + ! end if return end subroutine swiftest_kick_getacch_int_pl @@ -78,7 +78,7 @@ module subroutine swiftest_kick_getacch_int_tp(self, param, GMpl, rhp, npl) if ((self%nbody == 0) .or. (npl == 0)) return - call kick_getacch_int_all_tp(self%nbody, npl, self%rh, rhp, GMpl, self%lmask, self%ah) + call swiftest_kick_getacch_int_all_tp(self%nbody, npl, self%rh, rhp, GMpl, self%lmask, self%ah) return end subroutine swiftest_kick_getacch_int_tp @@ -124,7 +124,7 @@ module subroutine swiftest_kick_getacch_int_all_flat_pl(npl, nplpl, k_plpl, x, G zr = x(3, j) - x(3, i) rji2 = xr**2 + yr**2 + zr**2 rlim2 = (radius(i) + radius(j))**2 - if (rji2 > rlim2) call kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & + if (rji2 > rlim2) call swiftest_kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & ahi(1,i), ahi(2,i), ahi(3,i), ahj(1,j), ahj(2,j), ahj(3,j)) end do !$omp end parallel do @@ -141,7 +141,7 @@ module subroutine swiftest_kick_getacch_int_all_flat_pl(npl, nplpl, k_plpl, x, G yr = x(2, j) - x(2, i) zr = x(3, j) - x(3, i) rji2 = xr**2 + yr**2 + zr**2 - call kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & + call swiftest_kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & ahi(1,i), ahi(2,i), ahi(3,i), ahj(1,j), ahj(2,j), ahj(3,j)) end do !$omp end parallel do @@ -190,7 +190,7 @@ module subroutine swiftest_kick_getacch_int_all_triangular_pl(npl, nplm, x, Gmas zr = x(3, j) - x(3, i) rji2 = xr**2 + yr**2 + zr**2 rlim2 = (radius(i) + radius(j))**2 - if (rji2 > rlim2) call kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & + if (rji2 > rlim2) call swiftest_kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & ahi(1,i), ahi(2,i), ahi(3,i), ahj(1,j), ahj(2,j), ahj(3,j)) end do end do @@ -207,7 +207,7 @@ module subroutine swiftest_kick_getacch_int_all_triangular_pl(npl, nplm, x, Gmas yr = x(2, j) - x(2, i) zr = x(3, j) - x(3, i) rji2 = xr**2 + yr**2 + zr**2 - call kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & + call swiftest_kick_getacch_int_one_pl(rji2, xr, yr, zr, Gmass(i), Gmass(j), & ahi(1,i), ahi(2,i), ahi(3,i), ahj(1,j), ahj(2,j), ahj(3,j)) end do end do @@ -252,7 +252,7 @@ module subroutine swiftest_kick_getacch_int_all_tp(ntp, npl, xtp, xpl, GMpl, lma yr = xtp(2, i) - xpl(2, j) zr = xtp(3, i) - xpl(3, j) rji2 = xr**2 + yr**2 + zr**2 - call kick_getacch_int_one_tp(rji2, xr, yr, zr, GMpl(j), acc(1,i), acc(2,i), acc(3,i)) + call swiftest_kick_getacch_int_one_tp(rji2, xr, yr, zr, GMpl(j), acc(1,i), acc(2,i), acc(3,i)) end do end if end do diff --git a/src/swiftest_procedures/swiftest_orbel.f90 b/src/swiftest_procedures/swiftest_orbel.f90 index c731c23a4..097034111 100644 --- a/src/swiftest_procedures/swiftest_orbel.f90 +++ b/src/swiftest_procedures/swiftest_orbel.f90 @@ -275,7 +275,7 @@ real(DP) pure function swiftest_orbel_flon(e,icapn) ! normal return here, but check if capn was originally negative if(iflag == 1) then - swiftest_orbel_flon = -orbel_flon + swiftest_orbel_flon = -swiftest_orbel_flon capn = -capn end if @@ -398,7 +398,7 @@ real(DP) pure function swiftest_orbel_zget(iq) end if if(iflag == 1) then - swiftest_orbel_zget = -orbel_zget + swiftest_orbel_zget = -swiftest_orbel_zget q = -q end if diff --git a/src/symba/symba_kick.f90 b/src/symba/symba_kick.f90 index 5fbe3d8f6..03b72c143 100644 --- a/src/symba/symba_kick.f90 +++ b/src/symba/symba_kick.f90 @@ -42,9 +42,9 @@ module subroutine symba_kick_getacch_int_pl(self, param) end if if (param%lflatten_interactions) then - call kick_getacch_int_all_flat_pl(self%nbody, self%nplplm, self%k_plpl, self%rh, self%Gmass, self%radius, self%ah) + call swiftest_kick_getacch_int_all_flat_pl(self%nbody, self%nplplm, self%k_plpl, self%rh, self%Gmass, self%radius, self%ah) else - call kick_getacch_int_all_triangular_pl(self%nbody, self%nplm, self%rh, self%Gmass, self%radius, self%ah) + call swiftest_kick_getacch_int_all_triangular_pl(self%nbody, self%nplm, self%rh, self%Gmass, self%radius, self%ah) end if if (param%ladaptive_interactions .and. self%nplplm > 0) then @@ -87,7 +87,7 @@ module subroutine symba_kick_getacch_pl(self, system, param, t, lbeg) allocate(k_plpl_enc(2,nplplenc)) k_plpl_enc(1,1:nplplenc) = plpl_encounter%index1(1:nplplenc) k_plpl_enc(2,1:nplplenc) = plpl_encounter%index2(1:nplplenc) - call kick_getacch_int_all_flat_pl(npl, nplplenc, k_plpl_enc, pl%rh, pl%Gmass, pl%radius, ah_enc) + call swiftest_kick_getacch_int_all_flat_pl(npl, nplplenc, k_plpl_enc, pl%rh, pl%Gmass, pl%radius, ah_enc) pl%ah(:,1:npl) = pl%ah(:,1:npl) - ah_enc(:,1:npl) end if