[mesa-users] dlnRho_dlnT_const_Pgas, dlnRho_dlnPgas_const_T

Bill Paxton paxton at kitp.ucsb.edu
Wed Jun 22 13:36:37 EDT 2016


Let me add to Rob's comments.   It is important that you and the other mesa users understand what is happening here.

As you know from a look at star_data.inc in star/public, there are many vectors of data defined.  But only some of them are used in any particular configuration of parameters.  For example, if you are not using rotation, star is not using any of the many vectors that are only defined for rotation: omega, am_sig_omega, domega_dlnR, ..... When you are not using velocities, star doesn't set v, v_div_csound, ...  When you are not using eps_grav, it doesn't set eps_grav, d_eps_grav_dlnd00, d_eps_grav_dlnPgas00_const_T, eps_grav_dm_term_const_q, ...  And so on and so on......

Some of those unused vectors are set to 0's, but some are just left alone.   

For computational efficiency, we don't want to force mesa to calculate lots of things it doesn't need just on the chance that someone will access them from run_star_extras.

So if you get weird results when you look at something like dlnRho_dlnT_const_Pgas, the 1st thing to check is that it is actually being used for your current set of parameters.


For the star/work inlists, you are not using Pgas as a primary variable, and that means the code doesn't need to use partials that hold Pgas constant.  Of course it is possible to calculate those partials, but the code doesn't waste time doing that (or any of the other possible computations that are possible but not useful).

So when you access s% dlnRho_dlnT_const_Pgas(k) from run_star_extras you get an uninitialized variable that has been set to NaN according to the compiler flags.  

When you add  dlnRho_dlnT_const_Pgas to your profile, you get 0d0 instead of NaN because of this code in star/private/profile_getval.f90

            case (p_dlnRho_dlnT_const_Pgas)
               if (s% lnPgas_flag) then
                  val = s% dlnRho_dlnT_const_Pgas(k)
               else
                  val = 0
               end if

But I don't claim to have added sufficient checks like that to catch all cases of uninitialized variables printed to profiles.    If you find a column of NaNs in a profile output, check to see if you need to remove an unused variable from your profile_columns.list. 

Hope that makes things clearer.

Bill









On Jun 22, 2016, at 9:52 AM, Robert Farmer wrote:

> Hi
> Can i ask why you want those terms? 
> 
> Whats happened is that mesa has an option to either use lnPgas (ln gas pressure) or lnd (ln density) as a variable in the equations. By default we use lnd, thus those dlnRho terms are not defined. Either you can set to true:
> 
>          !### change_lnPgas_flag
>          !### change_initial_lnPgas_flag
>          !### new_lnPgas_flag
>          ! lnPgas variables
>          ! `lnPgas_flag` is true if we are using lnPgas variables in place of lnd
> 
>       change_lnPgas_flag = .false.
>       change_initial_lnPgas_flag = .false.
>       new_lnPgas_flag = .false.
> 
> In your stars inlist to switch to lnPgas, or if i know why you want those terms i could suggest another set of d... terms that are useful for you.
> 
> Have a look in star/private/profile_getval and you'll see you need s% lnPgas_flag to be true to get a value.
> 
> Rob
> 
> 
> On Tue, Jun 21, 2016 at 6:30 PM, Martin C. <martincs14 at gmail.com> wrote:
> Hi,
> In my profiles*.data files, for 
> dlnRho_dlnT_const_Pgas    and
> dlnRho_dlnPgas_const_T 
> I get just zeros. 
> 
> When I put 
> 
>          do k = 1,s% nz,30
>             print*,k, s% dlnRho_dlnT_const_Pgas(k)
>          end do
> 
> in extras_finish_step, I get just NaN.
> 
> Is this normal, or what don't I understand.
> 
> I'm just using the 'default' star work folder,
> mesa 8118, ubuntu14
> 
> thanks,
> 
> Martin
> 
> 
> 
> 
> -- 
> Martin C.
> 
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> _______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users
> 
> 
> ------------------------------------------------------------------------------
> Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape_______________________________________________
> mesa-users mailing list
> mesa-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mesa-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20160622/26d4acba/attachment.html>


More information about the Mesa-users mailing list