[mesa-users] Proper use of "other_winds"

Mathieu mathren90 at gmail.com
Mon May 26 14:42:03 EDT 2014


Hi everyone,

I am trying to implement a wind scheme in MESA 6208 using the 
"other_wind" hook (see the attached run_star_extras).
To compile it, I have copied  $MESA_DIR/star/make/mod_kuma.mod into 
$MESA_DIR/include, to be able to call the routine "eval_Kudritzki_wind" 
(defined in /$MESA_DIR/star/private/winds.f )
I would like to use the surface hydrogen mass fraction, so I tried to 
access this variable with:

     type (star_info), pointer :: s
     real(dp) :: xsurf
     xsurf = s% xa(2,1)

but when I run an initial model I get:

Fortran runtime error: Index '1' of dimension 2 of array 's%xa' below 
lower bound of 47946330539336

which looks like s% xa is not initialized. Can someone shed some light 
on how should I access to the surface H mass fraction?
And maybe there is a better way to call the routine 
"eval_Kudritzki_wind" than copying a module in the $MESA_DIR/include 
directory?

Eventually I would also like to use the x_cntrl variable to set the 
efficiency of my wind from the inlist_project.

Thanks in advance!

Mathieu





-------------- next part --------------
	
! inlist_project 

! contains the parameters controlling this job

! for the sake of future readers of this (yourself included),
! ONLY include the controls you are actually using.
! DO NOT include all of the other controls that
! simply have their default values.

!This inlist has been created merging "inlist_massive_defaults" and "inlist_massive_15M_z1.9m2"

&star_job

      mesa_dir = '' ! empty string defaults to environment variable MESA_DIR
!      history_columns_file = './history_columns.list' ! if null string, use default.
!      profile_columns_file = './profile_columns.list' ! if null string, use default.      


!      show_log_description_at_start = .true.
!      show_net_species_info = .true.
!       show_net_reactions_info = .true.	  

      
      create_pre_main_sequence_model = .false.

      change_net = .true.      
      new_net_name = 'approx26.net'

      set_rates_preference = .true. ! for use by net + rates modules
      new_rates_preference = 1 ! only used if set_rates_preference is true
      ! 1 = NACRE rates -- this is the default
      ! 2 = jina reaclib rates
			
       T_lo_neut = 2d9	
       T_hi_neut= 5d9
       min_factor_neut = 1d-12

       T_lo_prot = 2d9
       T_hi_prot = 5d9
       min_factor_prot = 1d-12
      
      ! rate limit factors for high temperatures
      turn_on_T_limits = .true.
      turn_off_T_limits = .false.

      eos_file_prefix = 'mesa'
      kappa_file_prefix = 'gs98'

      set_initial_age = .true.
      initial_age = 0 ! in years

      set_initial_model_number = .true.
      initial_model_number = 0
      
      !SOLAR CHEMICAL COMPOSITION
      change_initial_Z = .true.
      new_Z = 0.019d0     
      change_initial_Y = .true.
      new_Y=0.27

      save_photo_when_terminate = .true.
      pause_before_terminate = .false.
!      pgstar_flag =.true.
	  pgstar_flag = .false.

/ !end of star_job

&controls
  
  ! starting specifications
      initial_mass = 12 ! in Msun units
      !solar chemical composition
      initial_Z = 0.02
      !initial_Y = 0.27
   
   ! high center T limit to avoid negative mass fractions
   sig_min_factor_for_high_Tcenter = 0.01
   ! inactive when >= 1d0
   ! if Tcenter >= Tcenter_min_for_sig_min_factor_full_on,
   ! then okay to reduce sig by as much as this factor
   ! as needed to prevent causing negative abundances
   Tcenter_min_for_sig_min_factor_full_on = 2d9
   ! if Tcenter >= this, factor = sig_min_factor_for_neg_abundances
   ! this should be > Tcenter_max_for_sig_min_factor_full_off.
   Tcenter_max_for_sig_min_factor_full_off = 1d9
   ! if Tcenter <= this, factor = 1, so has no effect
   ! this should be < Tcenter_min_for_sig_min_factor_full_on.
   ! for T > full_off and < full_on, factor changes linearly with Tcenter
   
   min_years_dt_for_redo_mdot = 1 ! experimental

   num_trace_history_values = 0
   trace_history_value_name(1) = 'surf_avg_v_div_v_crit'
         
   
   ! output to files and terminal
      photostep = 10
      profile_interval = 1
      history_interval = 1
      terminal_interval = 1
      write_header_frequency = 1
      max_num_profile_models = 10000

    velocity_logT_lower_bound = 8
    max_dt_yrs_for_velocity_logT_lower_bound = 0.1

    okay_to_reduce_gradT_excess = .true. 
         
     gradT_excess_f1 = 1d-4
     gradT_excess_f2 = 1d-2
     gradT_excess_age_fraction = 0.9d0

     gradT_excess_lambda1 = 1.0
     gradT_excess_beta1 = 0.35
            
     gradT_excess_lambda2 = 0.5
     gradT_excess_beta2 = 0.25
            
     gradT_excess_dlambda = 0.1
     gradT_excess_dbeta = 0.1

   !Mass Loss

	 use_other_wind = .true.
     RGB_wind_scheme = 'other'
     AGB_wind_scheme = 'other'
     RGB_to_AGB_wind_switch = 1d-4
     Nieuwenhuijzen_wind_eta = 1.0
	 Kudritzki_wind_eta = 1.0
     x_ctrl(1) = 1.0  !efficiency of the manyally implemented wind	 

    use_Type2_opacities = .true.
    Zbase = 0.02

    xa_scale = 1d-5
    newton_itermin = 2

    mixing_length_alpha = 2.0
    MLT_option = 'Henyey'

    use_Ledoux_criterion = .true.
    alpha_semiconvection = 0.1
!    thermo_haline_coeff = 2
!    thermohaline_option = 'Kippenhahn'

    overshoot_f_above_nonburn = 0.025
    overshoot_f_above_burn_h = 0.025
    overshoot_f_above_burn_he = 0.025
    overshoot_f_above_burn_z = 0.025
    overshoot_f_below_nonburn = 0.025
    overshoot_f_below_burn_h = 0.025
    overshoot_f_below_burn_he = 0.025
    overshoot_f_below_burn_z =  0.025

    set_min_D_mix = .true.          !D_mix is the diffusion coefficient for mixing of material
    min_D_mix = 1d3                 ! D_mix will be at least this large
    min_center_Ye_for_min_D_mix = 0 !D_mix is used only for Ye>= than this

    screening_mode = 'extended'
         
    max_iter_for_resid_tol1 = 3     !in the first max_iter_for_resid_tol1
    tol_residual_norm1 = 1d-5       !the maximum difference between lhs and rhs of the equation  
    tol_max_residual1 = 1d-2        !is determined by this parameters
         
    max_iter_for_resid_tol2 = 12    !after the first max_iter_for_resid_tol1 iterations
    tol_residual_norm2 = 1d99       !use this instead
    tol_max_residual2 = 1d99
         
    delta_lgL_He_limit = 0.1	    ! limit for magnitude of change in lgL_He

    dX_nuc_drop_limit = 1d-2
    delta_Ye_highT_limit = 1d-4

    dX_nuc_drop_max_A_limit = 52
    dX_nuc_drop_min_X_limit = 1d-2
    dX_nuc_drop_hard_limit = 1d99
         
    delta_lgTeff_limit = 0.5  
    delta_lgL_limit = 0.5
    delta_lgRho_cntr_limit = 0.02  

    xa_function_species(1) = 'h1'
    xa_function_weight(1) = 70
    xa_function_param(1) = 1d-3

    xa_function_species(2) = 'he4'
    xa_function_weight(2) = 70
    xa_function_param(2) = 1d-3

    mesh_delta_coeff_for_highT = 1.0
    logT_max_for_standard_mesh_delta_coeff = 9.0 
    logT_min_for_highT_mesh_delta_coeff = 9.5 

    varcontrol_target = 1d-4
    mesh_delta_coeff=1.0
    mesh_max_allowed_ratio=15.0
    min_timestep_limit = 1d-4 !in sec
    ! when to stop
    fe_core_infall_limit = 1d8 

/


&pgstar        
      ! top level controls
        ! pause = .false. 
            ! if true, the code waits for user to enter a RETURN on the command line
      
      ! main window
      
         MAIN_win_flag = .true.
         
         show_TRho_Profile_with_main = .true.
      
         show_HR_TRho_with_main = .true. ! if false, use aspect ratio > 1
         MAIN_win_width = 7
         MAIN_win_aspect_ratio = 1.2 ! aspect_ratio = height/width
      
         xaxis_by = 'by_mass' !'by_radius' 
            
         show_main_win_text_info = .true.
         
         ! xaxis limits -- to override system default selections
         !main_xmin = -12 !0.4
         !main_xmax = 4.5
         
         logxq_cutoff = -12.1 ! min value when using logxm for xaxis
         !main_logL_max = 7
         !main_logL_min = 0
         
         ! control for plot showing abundances
         log_mass_frac_ymax = 0.7 ! making this > 0 helps readability
         log_mass_frac_ymin = -7.5
         num_abundance_line_labels = 5
      
         log_abund_vary = 0.1 ! don't show species if it would vary by < this in plot
      
         ! file output
         !MAIN_file_flag = .true.
         MAIN_file_dir = 'png'
         MAIN_file_prefix = 'main'
         MAIN_file_cnt = 1 ! output when mod(model_number,main_file_cnt)==0
               
      
      ! Abund_TRho_History window -- Abundance and Center TRho History together
      
         Abund_TRho_History_win_flag = .true.
      
         Abund_TRho_History_win_width = 7.0
         Abund_TRho_History_win_aspect_ratio = 1.2 ! aspect_ratio = height/width
                  
         Abund_TRho_History_xaxis_by = 'by_mass' ! select xaxis (same options as for main window)
            ! not used if == ''
         Abund_TRho_History_xmin = -101 ! only used if > -100
         Abund_TRho_History_xmax = 5 ! only used if > -100

         ! file output
         !Abund_TRho_History_file_flag = .true.
         Abund_TRho_History_file_dir = 'png'
         Abund_TRho_History_file_prefix = 'abund_trho_history'
         Abund_TRho_History_file_cnt = 3 ! output when mod(model_number,Abund_TRho_History_file_cnt)==0
         Abund_TRho_History_file_width = -1 ! negative means use same value as for window
         Abund_TRho_History_file_aspect_ratio = -1 ! negative means use same value as for window
            
         
      
      ! Mixing_Dynamo window -- Mixing_Ds and Dynamo together
      
         Mixing_Dynamo_win_flag = .false.
      
         Mixing_Dynamo_win_width = 7
         Mixing_Dynamo_win_aspect_ratio = 1.2 ! aspect_ratio = height/width

         Mixing_Dynamo_xaxis_by = '' ! select xaxis (same options as for main window)
            ! not used if == ''
         Mixing_Dynamo_xmin = -101 ! only used if > -100
         Mixing_Dynamo_xmax = -101 ! only used if > -100
                  
         ! file output
         Mixing_Dynamo_file_flag = .false.
         Mixing_Dynamo_file_dir = 'pgstar_out'
         Mixing_Dynamo_file_prefix = 'md'
         Mixing_Dynamo_file_cnt = 5 ! output when mod(model_number,Mixing_Dynamo_file_cnt)==0
         Mixing_Dynamo_file_width = -1 ! negative means use same value as for window
         Mixing_Dynamo_file_aspect_ratio = -1 ! negative means use same value as for window
         


/ ! end of pgstar namelist
-------------- next part --------------
A non-text attachment was scrubbed...
Name: run_star_extras.f
Type: text/x-fortran
Size: 14715 bytes
Desc: not available
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20140526/21abfcc3/attachment.bin>


More information about the Mesa-users mailing list