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

Commit

Permalink
Merge branch 'oblate_coord_rot' of github.com:MintonGroup/swiftest in…
Browse files Browse the repository at this point in the history
…to oblate_coord_rot
  • Loading branch information
daminton committed Feb 25, 2024
2 parents 6c796ec + 62173f7 commit 6a45db8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 6 additions & 3 deletions src/collision/collision_resolve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,8 @@ module subroutine collision_resolve_plpl(self, nbody_system, param, t, dt, irec)
class is (swiftest_parameters)
associate(plpl_collision => nbody_system%plpl_collision, &
collision_history => nbody_system%collision_history, pl => nbody_system%pl, cb => nbody_system%cb, &
collider => nbody_system%collider, fragments => nbody_system%collider%fragments, impactors => nbody_system%collider%impactors)
collider => nbody_system%collider, fragments => nbody_system%collider%fragments, &
impactors => nbody_system%collider%impactors)
if (plpl_collision%nenc == 0) return ! No collisions to resolve


Expand All @@ -607,11 +608,13 @@ module subroutine collision_resolve_plpl(self, nbody_system, param, t, dt, irec)
ncollisions = plpl_collision%nenc
write(timestr,*) t
call swiftest_io_log_one_message(COLLISION_LOG_OUT, "")
call swiftest_io_log_one_message(COLLISION_LOG_OUT, "***********************************************************" // &
call swiftest_io_log_one_message(COLLISION_LOG_OUT,&
"***********************************************************" // &
"***********************************************************")
call swiftest_io_log_one_message(COLLISION_LOG_OUT, "Collision between massive bodies detected at time t = " // &
trim(adjustl(timestr)))
call swiftest_io_log_one_message(COLLISION_LOG_OUT, "***********************************************************" // &
call swiftest_io_log_one_message(COLLISION_LOG_OUT, &
"***********************************************************" // &
"***********************************************************")

do k = 1_I8B, ncollisions
Expand Down
11 changes: 6 additions & 5 deletions src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1010,8 +1010,8 @@ module subroutine swiftest_io_netcdf_initialize_output(self, param)

! status = nf90_inq_varid(nc%id, nc%c_lm_varname, nc%c_lm_varid)
! if (status == NF90_NOERR) then
call netcdf_io_check( nf90_def_var(nc%id, nc%c_lm_varname, nc%out_type, [nc%m_dimid, nc%l_dimid, nc%sign_dimid], nc%c_lm_varid), &
"netcdf_io_initialize_output nf90_def_var c_lm_varid" )
call netcdf_io_check( nf90_def_var(nc%id, nc%c_lm_varname, nc%out_type, [nc%m_dimid, nc%l_dimid, nc%sign_dimid], &
nc%c_lm_varid), "netcdf_io_initialize_output nf90_def_var c_lm_varid" )
! end if

! Set fill mode to NaN for all variables
Expand Down Expand Up @@ -2125,7 +2125,7 @@ module subroutine swiftest_io_netcdf_write_frame_cb(self, nc, param)
"swiftest_io_netcdf_write_frame_cb nf90_put_var cb rot_varid" )

! Following the template of j2rp2
call netcdf_io_check( nf90_put_var(nc%id, nc%rotphase_varid, self%rotphase * RAD2DEG, start = [tslot]), & ! start = [1, idslot, tslot]), &
call netcdf_io_check( nf90_put_var(nc%id, nc%rotphase_varid, self%rotphase * RAD2DEG, start = [tslot]), &
"swiftest_io_netcdf_write_frame_cb nf90_put_var cb rotphase")
end if

Expand All @@ -2143,10 +2143,11 @@ module subroutine swiftest_io_netcdf_write_frame_cb(self, nc, param)

call netcdf_io_check( nf90_put_var(nc%id, nc%l_varid, lm_coords), "netcdf_io_write_frame_cb nf90_put_var l_varid")
call netcdf_io_check( nf90_put_var(nc%id, nc%m_varid, lm_coords), "netcdf_io_write_frame_cb nf90_put_var m_varid")
call netcdf_io_check( nf90_put_var(nc%id, nc%sign_varid, [1, -1]), "netcdf_io_write_frame_cb nf90_put_var sign_varid")
call netcdf_io_check( nf90_put_var(nc%id, nc%sign_varid, [1,-1]), "netcdf_io_write_frame_cb nf90_put_var sign_varid")

! Write dimension-coordinates to file
call netcdf_io_check( nf90_put_var(nc%id, nc%c_lm_varid, self%c_lm, count = [m_dim_max, l_dim_max, 2]), "netcdf_io_write_frame_cb nf90_put_var c_lm_varid")
call netcdf_io_check( nf90_put_var(nc%id, nc%c_lm_varid, self%c_lm, count = [m_dim_max, l_dim_max, 2]), &
"netcdf_io_write_frame_cb nf90_put_var c_lm_varid")
end if
end if

Expand Down

0 comments on commit 6a45db8

Please sign in to comment.