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

Commit

Permalink
Fixed bugs prevening SyMBA variables from being written to dump param…
Browse files Browse the repository at this point in the history
…eter file
  • Loading branch information
daminton committed Jan 2, 2023
1 parent b63ca31 commit 86a707f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions python/swiftest/swiftest/init_cond.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ def vec2xr(param: Dict, **kwargs: Any):
if param['ROTATION']:
if "rot" not in kwargs and "Gmass" in kwargs:
kwargs['rot'] = np.zeros((len(kwargs['Gmass']),3))
if "Ip" not in kwargs and "rot" in kwargs:
kwargs['Ip'] = np.full_like(kwargs['rot'], 0.4)
if "Ip" not in kwargs and "Gmass" in kwargs:
kwargs['Ip'] = np.full_like(kwargs['Gmass'], 0.4)

if "time" not in kwargs:
kwargs["time"] = np.array([0.0])
Expand Down
13 changes: 10 additions & 3 deletions src/swiftest/swiftest_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2094,7 +2094,6 @@ module subroutine swiftest_io_param_reader(self, unit, iotype, v_list, iostat, i
return
end if


if ((param%collision_model /= "MERGE") .and. &
(param%collision_model /= "BOUNCE") .and. &
(param%collision_model /= "FRAGGLE")) then
Expand Down Expand Up @@ -2127,7 +2126,6 @@ module subroutine swiftest_io_param_reader(self, unit, iotype, v_list, iostat, i
param%inv_c2 = (param%inv_c2)**(-2)
end if


select case(trim(adjustl(param%interaction_loops)))
case("ADAPTIVE")
param%ladaptive_interactions = .true.
Expand Down Expand Up @@ -2230,6 +2228,7 @@ module subroutine swiftest_io_param_writer(self, unit, iotype, v_list, iostat, i
character(*),parameter :: Ifmt = '(I0)' !! Format label for integer values
character(*),parameter :: Rfmt = '(ES25.17)' !! Format label for real values
character(*),parameter :: Lfmt = '(L1)' !! Format label for logical values
integer(I4B) :: nseeds

associate(param => self)
call io_param_writer_one("T0", param%t0, unit)
Expand Down Expand Up @@ -2275,13 +2274,22 @@ module subroutine swiftest_io_param_writer(self, unit, iotype, v_list, iostat, i
call io_param_writer_one("INTERACTION_LOOPS", param%interaction_loops, unit)
call io_param_writer_one("ENCOUNTER_CHECK_PLPL", param%encounter_check_plpl, unit)
call io_param_writer_one("ENCOUNTER_CHECK_PLTP", param%encounter_check_pltp, unit)
call io_param_writer_one("ENCOUNTER_SAVE", param%encounter_save, unit)

if (param%lenergy) then
call io_param_writer_one("FIRSTENERGY", param%lfirstenergy, unit)
end if
call io_param_writer_one("FIRSTKICK",param%lfirstkick, unit)
call io_param_writer_one("MAXID",param%maxid, unit)
call io_param_writer_one("MAXID_COLLISION",param%maxid_collision, unit)

if (param%GMTINY > 0.0_DP) call io_param_writer_one("GMTINY",param%GMTINY, unit)
if (param%min_GMfrag > 0.0_DP) call io_param_writer_one("MIN_GMFRAG",param%min_GMfrag, unit)
call io_param_writer_one("COLLISION_MODEL",param%collision_model, unit)
if (param%collision_model == "FRAGGLE" ) then
nseeds = size(param%seed)
call io_param_writer_one("SEED", [nseeds, param%seed(:)], unit)
end if

iostat = 0
iomsg = "UDIO not implemented"
Expand Down Expand Up @@ -2837,7 +2845,6 @@ module subroutine swiftest_io_toupper(string)
end subroutine swiftest_io_toupper



module subroutine swiftest_io_write_discard(self, param)
!! author: David A. Minton
!!
Expand Down

0 comments on commit 86a707f

Please sign in to comment.