Skip to content

Commit

Permalink
[indent-bot] standardised indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljprice committed Jul 13, 2020
1 parent 3810f97 commit 68e841f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
14 changes: 7 additions & 7 deletions src/main/inject_asteroidwind.f90
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ real function get_E(period,ecc,deltat)
M_guess = M_ref - 2.*tol

do while (abs(M_ref - M_guess) > tol)
M_guess = E_guess - ecc*sin(E_guess)
if (M_guess > M_ref) then
E_right = E_guess
else
E_left = E_guess
endif
E_guess = 0.5*(E_left + E_right)
M_guess = E_guess - ecc*sin(E_guess)
if (M_guess > M_ref) then
E_right = E_guess
else
E_left = E_guess
endif
E_guess = 0.5*(E_left + E_right)
enddo

get_E = E_guess
Expand Down
42 changes: 21 additions & 21 deletions src/setup/setup_asteroidwind.f90
Original file line number Diff line number Diff line change
Expand Up @@ -147,30 +147,30 @@ subroutine setpart(id,npart,npartoftype,xyzh,massoftype,vxyzu,polyk,gamma,hfact,
! point mass for the asteroid

if (ipot == 0) then
!
!--Set a binary orbit given the desired orbital parameters
!
call set_binary(m1,m2,semia,ecc,hacc1,hacc2,xyzmh_ptmass,vxyz_ptmass,nptmass,ierr)
xyzmh_ptmass(ihsoft,2) = rasteroid ! Asteroid radius softening
!
!--Set a binary orbit given the desired orbital parameters
!
call set_binary(m1,m2,semia,ecc,hacc1,hacc2,xyzmh_ptmass,vxyz_ptmass,nptmass,ierr)
xyzmh_ptmass(ihsoft,2) = rasteroid ! Asteroid radius softening

else

!
!--Set the asteroid on orbit around the fixed potential
!
mass1 = m1
accradius1 = hacc1
iexternalforce = 11
call update_externalforce(iexternalforce,time,0.)

! Orbit and position
nptmass = 1
xyzmh_ptmass(1:3,1) = (/semia*(1. + ecc),0.,0./)
vxyz_ptmass(1:3,1) = (/0.,sqrt(semia*(1.-ecc**2)*(m1+m2))/xyzmh_ptmass(1,1),0./)

xyzmh_ptmass(4,1) = m2
xyzmh_ptmass(ihacc,1) = hacc2 ! Asteroid should not accrete
xyzmh_ptmass(ihsoft,1) = rasteroid ! Asteroid radius softening
!
!--Set the asteroid on orbit around the fixed potential
!
mass1 = m1
accradius1 = hacc1
iexternalforce = 11
call update_externalforce(iexternalforce,time,0.)

! Orbit and position
nptmass = 1
xyzmh_ptmass(1:3,1) = (/semia*(1. + ecc),0.,0./)
vxyz_ptmass(1:3,1) = (/0.,sqrt(semia*(1.-ecc**2)*(m1+m2))/xyzmh_ptmass(1,1),0./)

xyzmh_ptmass(4,1) = m2
xyzmh_ptmass(ihacc,1) = hacc2 ! Asteroid should not accrete
xyzmh_ptmass(ihsoft,1) = rasteroid ! Asteroid radius softening
endif

! both of these are reset in the first call to inject_particles
Expand Down

0 comments on commit 68e841f

Please sign in to comment.