Skip to content

Remove_shells functionality needs TDC support #880

@Debraheem

Description

@Debraheem

Remove_shells functionality for star_relax_to_cut is missing support for TDC. I label this as affecting the test_suite because this subroutine is called inside ppisn see below:

! Relax to a trimmed stellar model with surface cells removed down to k_remove
! (the cell k_remove will be the outermost in the new model).
subroutine do_relax_to_star_cut( &
id, k_remove, do_jrot, do_entropy, turn_off_energy_sources_and_sinks, ierr)

!!create interpolant for convective velocities
! TODO: adapt this for TDC
!conv_vel_flag = .false.
!if (s% conv_vel_flag) then
! conv_vel_flag = .true.
! allocate(interp_work((num_pts)*pm_work_size), &
! conv_vel_interp(4*(num_pts)), stat=ierr)
! do k0 = 1, num_pts
! conv_vel_interp(4*k0-3) = s% conv_vel(k0+k_remove-1)
! q(k0) = s% q(k0+k_remove-1)/s% q(k_remove)
! end do
! call interp_pm(q, num_pts, conv_vel_interp,&
! pm_work_size, interp_work, 'conv_vel interpolant', ierr)
! ! turn off conv vel flag to load model
! call set_conv_vel_flag(id, .false., ierr)
! if (dbg) write(*,*) "set_conv_vel_flag ierr", ierr
!end if

!!take care of convective velocities
! TODO: adapt for TDC
!if (s% conv_vel_flag) then
! do k0=1, s% nz
! call interp_value(q, num_pts, conv_vel_interp, s% q(k0), s% conv_vel(k0), ierr)
! !avoid extending regions with non-zero conv vel
! do k=2, num_pts-1
! if(s% q(k0) < q(k) .and. s% q(k0) > q(k+1) &
! .and. (conv_vel_interp(4*k-3)<1d-5 .or. conv_vel_interp(4*(k+1)-3)<1d-5)) then
! s% conv_vel(k0) = 0d0
! exit
! end if
! end do
! s% xh(s% i_ln_cvpv0, k0) = log(s% conv_vel(k0)+s% conv_vel_v0)
! end do
! write(*,*) 'need to rewrite some things here in do_relax_to_star_cut'
! call mesa_error(__FILE__,__LINE__,'do_relax_to_star_cut')
! deallocate(conv_vel_interp, interp_work)
!end if

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions