The full inlists solutions ready to be downloaded can be found in the Google Drive folder called MINILAB2_alpha_SOL.
integer function how_many_extra_history_columns(id)
...
! TO DO
! Add a column to the count
how_many_extra_history_columns = 1
end function how_many_extra_history_columns
subroutine data_for_extra_history_columns(id, n, names, vals, ierr)
...
! TO DO
! Kelvin-Helmholtz timescale computation, see Eq.(2) of
! your instructions.
names(1) = "t_KH"
vals(1) = 0.5*standard_cgrav*(s% m(1))*(s% m(1))/s% L(1)/s% r(1)/secyer
end subroutine data_for_extra_history_columns
And here's how the inlist_pgstar_minilab2 would have to look like after completion of Task 1:
subroutine data_for_extra_profile_columns(id, n, names, vals, ierr)
...
! TO DO
! Computation of local thermal timescale t_th, see Eq.(3)
! of your instructions
names(1) = "local_tt"
vals(:,1) = 0.d0
! Remember that the outermost zone is at k=1 and the
! innermost is at k = s% nz
do k=1, s% nz
vals(k,1) = (1/s% L(k))*(s% cp(k)*s% T(k)*s% dm(k))/secyer
if (k > 1) then
vals(k,1) = vals(k-1,1)+(1/s% L(1))*(s% cp(k)*s% T(k)*s% dm(k))/secyer
end if
end do
end subroutine data_for_extra_profile_columns
And here's how the inlist_pgstar_minilab2 would have to look like after completion of Task 2:
integer function how_many_extra_history_columns(id)
...
! TO DO
! Add a column to the count
how_many_extra_history_columns = 2
end function how_many_extra_history_columns
subroutine data_for_extra_history_columns(id, n, names, vals, ierr)
...
! TO DO
! BONUS exercise. Kelvin-Helmholtz mass loss rate M_KH
! computation
names(2) = "M_KH"
vals(2) = -s% m(1)/Msun/vals(1)
end subroutine data_for_extra_history_columns
subroutine data_for_extra_profile_columns(id, n, names, vals, ierr)
...
! TO DO
! BONUS exercise. Computation of the local thermal mass loss rate
! correspondent to the local thermal timescale
names(2) = "local_tml"
vals(:,2) = 0d0
do k=1, s% nz
vals(k,2) = -(s% m(1)-s% m(k))/vals(k,1)/Msun
end do
end subroutine data_for_extra_profile_columns
And here's how the inlist_pgstar_minilab2 would have to look like after completion of the bonus tasks: