MESAHub/mesa

Use of pgstar to plot custom instability strip edges

susmitadas130 opened this issue · 2 comments

Hi,

For one of the MESA Summer School labs, we want to plot our own classical instability strip edges.

Currently- the problem is that the custom IS edges (intentionally set at an offset for a comparison with the inbuilt HR classical IS) are flickering between model computations.

Please find attached the working directory. MESA version used is mesa-r23.05.1. The solid lines are from the inbuilt HR classical IS while the flickering lines are from the custom IS edges.

The changes made are as follows:

  1. In the inlist_project:

&controls
! see star/defaults/controls.defaults
use_other_pgstar_plots = .true.

! Replace with values obtained from Minilab2
! blue edge
x_ctrl(2) = 4 ! logT1
x_ctrl(3) = 5.5 ! logL1
x_ctrl(4) = 4.2 ! logT2
x_ctrl(5) = 1.0 ! logL2

! red edge
x_ctrl(6) = 4.1 ! logT1
x_ctrl(7) = 5.5 ! logL1
x_ctrl(8) = 4.3! logT2
x_ctrl(9) = 1.0 ! logL2 

  1. In the run_star_extras:

s% other_pgstar_plots_info => custom_ISedges

subroutine custom_ISedges(id, ierr)
integer, intent(in) :: id
integer, intent(out) :: ierr
type (star_info), pointer :: s
real :: logT1, logT2, logL1, logL2
ierr = 0
call get_star_ptr(id, s, ierr)
if (ierr /= 0) return

        call pgsls(1)
        call pgslw(s% pg% pgstar_lw)
       
        ! approximate edges
       
        ! blue edge
        logT1 = s% x_ctrl(2)
        logL1 = s% x_ctrl(3)
       
        logT2 = s% x_ctrl(4)
        logL2 = s% x_ctrl(5)
       
        call pgsci(2)
        call pgmove(logT1, logL1)
        call pgdraw(logT2, logL2)
       
        ! red edge
        logT1 = s% x_ctrl(6)
        logL1 = s% x_ctrl(7)
       
        logT2 = s% x_ctrl(8)
        logL2 = s% x_ctrl(9)
       
        call pgsci(4)
        call pgmove(logT1, logL1)
        call pgdraw(logT2, logL2)
   
  end subroutine custom_ISedges

Looking forward to suggestions
Thanks in advance
customISedges.zip

Hello!

other_pgstar_plots_info expects you to create whole new plot windows (hence the no device errors in the first few models).
For this application it's better to use the decorator functionality:

HR_use_decorator = .true.

in the pgstar_inlist, and

s% pg% HR_pgstar_decorator => custom_ISedges

in your run_star_extras.
custom_is_decorator.zip

Good luck at the summer school!

Thank you so much for the explanation and the solution- it works great!