-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tidal deformation #773
base: main
Are you sure you want to change the base?
Tidal deformation #773
Conversation
# Conflicts: # star/private/hydro_rotation.f90
|
||
! Initial eccentricity of the system | ||
! ~~~~~~~~~~~~~~~~~~~~ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure Sphinx will emit a warning if the underline isn't as long as the heading.
! ~~~~~~~~~~~~~~~~~~~~ | |
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
@@ -3,6 +3,6 @@ | |||
# goal of QUIET is to make it easier to spot warnings and/or circular dependency | |||
# errors. | |||
|
|||
QUIET = yes | |||
QUIET = no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want yes
in production.
QUIET = no | |
QUIET = yes |
|
||
write (*, 1) 'no implementation for other_tidal_deformation_function' | ||
! must set f_switch | ||
ierr = -1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it's quite common in the blank other_*
routines and I don't expect anyone to change anything here, just a comment that ifort
will warn that f_switch
has no value here.
real(dp), parameter :: nudge = 1d-4 | ||
real(dp), pointer :: xvals(:), yvals(:), yvals_gtr_than_1(:), fpfunc1d(:), ftfunc1d(:), & | ||
irotfunc1d(:), otherrfunc1d(:), afunc1d(:) | ||
logical :: inter_ok = .false., dbg = .true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing we don't generally want the debug output on, otherwise it isn't really debug output.
logical :: inter_ok = .false., dbg = .true. | |
logical :: inter_ok = .false., dbg = .false. |
inter_ok = .true. | ||
end if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I won't have a chance to look at this closely for a bit but do we want to inter_ok
to .true.
inside the debug block? Should it not be set to .true.
in normal operation? I'd expect
inter_ok = .true. | |
end if | |
end if | |
inter_ok = .true. |
if (dbg) then | ||
write(*, 1) 'starting interpolator setup' | ||
end if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Though it's cosmetic, we can just have
if (dbg) then | |
write(*, 1) 'starting interpolator setup' | |
end if | |
if (dbg) write(*, 1) 'starting interpolator setup' |
I imagine there was more in this if
block while you were working on this.
call star_ptr(id, s, ierr) | ||
if (ierr /= 0) return | ||
call binary_ptr(s% binary_id, b, ierr) | ||
if (ierr /=0 ) return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (ierr /=0 ) return | |
if (ierr /= 0) return |
|
||
i_rot = 0d0 | ||
if (s% simple_i_rot_flag) then | ||
i_rot = (2d0/3d0)*r00*r00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i_rot = (2d0/3d0)*r00*r00 | |
i_rot = two_thirds*r00*r00 |
use auto_diff | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do we need from auto_diff
here?
@@ -243,44 +299,94 @@ subroutine check_omega(s, str) | |||
end subroutine check_omega | |||
|
|||
subroutine update1_i_rot_from_xh(s, k) | |||
use auto_diff |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above, what do we need from auto_diff
here?
Not a blocker for me but would it be possible to use this in the test suite somewhere, be that in a new test or tweaking an existing one? |
Following on #637, this (rather large) overhaul of
hydro_rotation.f90
includes support for computing the stellar structure corrections of tidally distorted stars. This is especially useful when modeling contact binaries.The setup is as follows:
I used procedure hooks (akin to
binary_other_torque
for tidal J_dot calculations) to communicate the binary calculated fp, ft, and i_rot values for the stellar layers.Then these values are "blended" with the single-rotating-star corrections according to the synchronicity of the component to the orbit. I implemented a user hook
binary_other_tidal_deformation_switch_function
if one does not agree with this treatment.The user can still use the
other_fp_ft
andother_i_rot
hooks to bypass all default calculations (and blending).