[Mesa-users] compiling errors

AbdelBassit Senhadji sen-abd at hotmail.fr
Thu May 19 22:34:40 UTC 2022


Hi Warrick,

Thanks for this detailed explanation! I will follow your advice and to answer your question, I am trying to build a massive CO WD with a mass of 1.3Msun.

I tried to use the: mesa-r15140/star/test_suite/make_co_wd but it was not successful because the way how it was made is to not let the star evolve that match. I have also tried to use the O-Ne WD model but did not get that massive WD.


Thanks
Abdel


________________________________
De : Warrick Ball <W.H.Ball at bham.ac.uk>
Envoyé : 18 mai 2022 15:24
À : sen-abd at hotmail.fr <sen-abd at hotmail.fr>
Cc : mesa-users at lists.mesastar.org <mesa-users at lists.mesastar.org>
Objet : Re: [Mesa-users] compiling errors

Hi Abdel,

Okay, I'll go back a few steps and work slowly to what I think is happening and how you might fix it.

First, since you're using a custom `run_star_extras.f90`, you should read the documentation on "Extending MESA", in particular the subsection on using the "other" hooks:

     https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.mesastar.org%2Fen%2Frelease-r22.05.1%2Fusing_mesa%2Fextending_mesa.html%23using-the-other-hooks&data=05%7C01%7C%7Cfdea0e5f3ab24fac4ec108da390402ac%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637884986641302797%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EyOUYPMjzSRogOZqGZYO7tPwI8r8rLws5RjB4CYPXYY%3D&reserved=0

The compilation problem you originally reported was about `other_mlt`, so let's have a closer look.  (I noticed that the `run_star_extras.f90` you attached is identical to the one under `wd_builder_models` in the Zenodo archive.)

If you open `run_star_extras.f90` and scroll down to `my_other_mlt`, you'll see that this function takes a (quite long) list of arguments:

       subroutine my_other_mlt( &
             id, k, cgrav, m, mstar, r, L, X, &
             ...
             MLT_option_in, Henyey_y_param, Henyey_nu_param, &
             normal_mlt_gradT_factor, &
             max_conv_vel, dt, tau, just_gradr, &
             mixing_type, mlt_basics, mlt_partials1, ierr)

where I've skipped all but the first and last four lines for reasons that'll become clear.

For MESA's hooks to work, this argument list has to match what MESA expects when `my_other_mlt` is eventually called.  This is what I mean by the "interface".  You can find these the empty hook templates given in `star/other/other_*.f90`.  The interfaces sometimes change between versions, for various reasons.

So let's look at what MESA r15140 is expecting by opening `star/other/other_mlt.f90`, where you'll find:

       subroutine null_other_mlt( &
             id, k, cgrav, m, mstar, r, L, X, &
             ...
             MLT_option, Henyey_y_param, Henyey_nu_param, &
             normal_mlt_gradT_factor, &
             prev_conv_vel, max_conv_vel, g_theta, dt, tau, just_gradr, &
             mixing_type, mlt_basics, mlt_partials1, ierr)

Notice that the last four lines are slightly different.  This is why the compiler then complains about various type and interface mismatches.

If this code was never going to work with r15140, when would it work?  That's where the reference to commit 5e701e79 comes in.  That commit happened on April 6, 2021, between r15140 and r21.12.1.  Let's see if might work with r21.12.1 by looking at `star/other/other_mlt.f90` again.  Actually, `other_mlt.f90` was renamed to `other_mlt_results.f90`!  So let's look there:

       subroutine null_other_mlt_results(id, k, MLT_option, &  ! NOTE: k=0 is a valid arg
             r, L, T, P, opacity, rho, chiRho, chiT, Cp, gradr, grada, scale_height, &
             iso, XH1, cgrav, m, gradL_composition_term, mixing_length_alpha, &
             alpha_semiconvection, thermohaline_coeff, &
             mixing_type, gradT, Y_face, conv_vel, D, Gamma, ierr)

Well, something dramatic* happened between 5e701e79 and r21.12.1 and that interface doesn't match either.

What about commit 5e701e79, as mentioned in the paper?

       subroutine null_other_mlt( &
             id, k, cgrav, m, mstar, r, L, X, &
             ...
             MLT_option, Henyey_y_param, Henyey_nu_param, &
             normal_mlt_gradT_factor, &
             max_conv_vel, dt, tau, just_gradr, &
             mixing_type, mlt_basics, mlt_partials1, ierr)

That looks better!  And that's why I think this code was written for that particular commit, rather than a release version.

So, what now?  I think you need to figure out why it is that you're trying to use this particular Zenodo code.  If you're just trying to use `wd_builder`, then it might be the same code that's now in `mesa-contrib` under `wd_builder`:

     https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmesahub%2Fmesa-contrib&data=05%7C01%7C%7Cfdea0e5f3ab24fac4ec108da390402ac%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637884986641302797%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=BQ72cbRMGN3aTd7MN2PW53hQ0xJtoBOa05DPCp0GgVM%3D&reserved=0

Alternatively, you can try to change the various routines from the Zenodo repo to match r15140.  It looks like the `other_mlt` routine is quite simple: it calls MESA's own MLT subroutine but with the MLT option set to 'none' for densities ρ > 1000.

       subroutine my_other_mlt( &
          ...
          if (rho_face .gt. 1d3) then
             MLT_option = 'none'
          else
             MLT_option = MLT_option_in
          endif

          call star_mlt_eval(  &
             ...
             mixing_type, mlt_basics, mlt_partials1, ierr)

       end subroutine my_other_mlt


Cheers,
Warrick

* In this case, it looks like "something dramatic" was the interface being vastly simplified by using the new `auto_diff` module.

___________

Warrick Ball
Postdoc, School of Physics and Astronomy
University of Birmingham, Edgbaston, Birmingham B15 2TT
W.H.Ball at bham.ac.uk
+44 (0)121 414 4552

On Wed, 18 May 2022, sen-abd at hotmail.fr wrote:

>
> Hi Warrick,
>
> Attached the files you requested. I have never used  MESA (r21.12.1 or r22.05.1).
>
> How I can change the interface 'other_mlt'?
>
> Thanks
> Abdel
>
> __________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> De : Warrick Ball <W.H.Ball at bham.ac.uk>
> Envoyé : 18 mai 2022 12:22
> À : sen-abd at hotmail.fr <sen-abd at hotmail.fr>
> Cc : mesa-users at lists.mesastar.org <mesa-users at lists.mesastar.org>
> Objet : Re: [Mesa-users] compiling errors
> Hi Abdel,
>
> > I did some changes and now it is compiling perfectly.
>
> You need to be much more specific about your "changes".  Please attach the `run_star_extras.f90` and inlists that produce this error.
>
> Anyway, this still seems odd.  If you have newer versions of MESA (r21.12.1 or r22.05.1) installed, you may want to check to which version the Zenodo code's interface corresponds.  For example, I noticed this line in the associated paper:
>
>      "We cool our WD models using the MESA development version (commit 5e701e79)."
>
> A quick glance on GitHub shows that the `other_mlt` interface in commit 5e701e79 is different from r15140.
>
> Cheers,
> Warrick
>
>
> ___________
>
> Warrick Ball
> Postdoc, School of Physics and Astronomy
> University of Birmingham, Edgbaston, Birmingham B15 2TT
> W.H.Ball at bham.ac.uk
> +44 (0)121 414 4552
>
> On Wed, 18 May 2022, sen-abd at hotmail.fr wrote:
>
> > Hi Warrick,
> >
> > I was using the same version of MESA (R15140). The problem was in the  'star/other/other_*.f90` routines. I did some changes and now it is compiling perfectly. Thanks for the help.
> >
> > But now this is what I am getting when I run the code:
> >
> > I have not changed anything else in the inlists or src files.
> >
> > What do you think about this error? I never had that before.
> >
> > Thanks
> > Abdel
> >
> >
> >
> >
> >
> > TIME: 11:58:48  version_number 15140
> >  read inlist_wd_builder
> >  read inlist_model
> >
> >
> >  The terminal output contains the following information
> >
> >       'step' is the number of steps since the start of the run,
> >       'lg_dt' is log10 timestep in years,
> >       'age_yr' is the simulated years since the start run,
> >       'lg_Tcntr' is log10 center temperature (K),
> >       'lg_Dcntr' is log10 center density (g/cm^3),
> >       'lg_Tmax' is log10 max temperature (K),
> >       'Teff' is the surface temperature (K),
> >       'lg_R' is log10 surface radius (Rsun),
> >       'lg_L' is log10 surface luminosity (Lsun),
> >       'lg_LH' is log10 total PP and CNO hydrogen burning power (Lsun),
> >       'lg_L3a' is log10 total triple-alpha helium burning power (Lsun),
> >       'lg_gsurf' is log10 surface gravity,
> >       'lg_LNuc' is log10 nuclear power (Lsun),
> >       'lg_LNeu' is log10 total neutrino power (Lsun),
> >       'lg_Lphoto' is log10 total photodisintegration (Lsun),
> >       'Mass' is the total stellar baryonic mass (Msun),
> >       'lg_Mdot' is log10 magnitude of rate of change of mass (Msun/year),
> >       'lg_Dsurf' is log10 surface density (g/cm^3),
> >       'H_env' is the amount of mass where H is the most abundant iso,
> >       'He_core' is the largest mass where He is most abundant iso.
> >       'C_core' is the largest mass where C is most abundant iso.
> >       'H_cntr' is the center H1 mass fraction,
> >       'He_cntr' is the center He4 mass fraction,
> >       'C_cntr' is the center C12 mass fraction,
> >       'N_cntr' is the center N14 mass fraction,
> >       'O_cntr' is the center O16 mass fraction,
> >       'Ne_cntr' is the center Ne20 mass fraction,
> >       'gam_cntr' is the center plasma interaction parameter,
> >       'eta_cntr' is the center electron degeneracy parameter,
> >       'zones' is the number of zones in the current model,
> >       'iters' is the number of solver iterations for the current step,
> >       'retry' is the number of step retries required during the run,
> >       'dt_limit' is an indication of what limited the timestep.
> >
> >  All this and more are saved in the LOGS directory during the run.
> >  create initial model
> >
> > Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
> >
> > Backtrace for this error:
> > #0  0x7fc2b5e1a51f in ???
> > #1  0x0 in ???
> > ./rn: line 6:  9120 Segmentation fault      (core dumped) ./star
> > DATE: 2022-05-18
> > TIME: 11:58:50
> >
> >
> >_________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
> _
> > De : Warrick Ball <W.H.Ball at bham.ac.uk>
> > Envoyé : 18 mai 2022 08:35
> > À : AbdelBassit Senhadji <sen-abd at hotmail.fr>
> > Cc : mesa-users at lists.mesastar.org <mesa-users at lists.mesastar.org>
> > Objet : Re: [Mesa-users] compiling errors
> > Hi Abdel,
> >
> > What version of MESA are you using, and does it correspond to the version associated with Schwab (2021)?
> >
> > My guess is that the interface for the `other_mlt` hook has changed since the code in the Zenodo entry was written.
> >
> > If you want the extra code to work with the MESA release you're using, check that the hooks use the interfaces defined in the `star/other/other_*.f90` routines.
> >
> > Cheers,
> > Warrick
> >
> > ____________
> >
> > Warrick Ball
> > Postdoc, School of Physics and Astronomy
> > University of Birmingham, Edgbaston, Birmingham B15 2TT
> > W.H.Ball at bham.ac.uk
> > +44 (0)121 414 4552
> >
> >
> > On Tue, 17 May 2022, mesa-users at lists.mesastar.org wrote:
> >
> > > Good afternoon,
> > >
> > > I have downloaded a zip file to build a massiveWDfrom https://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fzenodo.org%2Frecord%2F5047378%23.YoQYAHXMJ-0&data=05%7C01%7C%7Cfdea0e5f3ab24fac4ec108da390402ac%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637884986641302797%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1GLYc3yDb%2B62YB2uJJQv4oRwWasJ0xtqDq0dK7wZKcU%3D&reserved=0
> TWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=AAs712bdG1Hstt7NrHdbsQYcHFAn1OSQtggglCP7pj8%3D&reserved=0
> > FpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=1kmFfq1HIAQLR7Lzp3jZsSzYEBu9FFlj%2BQtVUKTKErw%3D&reserved=0
> > > Cooling Models for the Most Massive White Dwarfs | Zenodo
> > > Input and output files associated with Schwab (2021). See README in zipfile. Version 2 is after peer review and first proofs, reflecting some changes in the plots due to revisions in the quoted properties of
> > > ZTF J190132.9+145808.7. (The MESA models remain unchanged from version 1.)
> > > zenodo.org
> > >
> > >
> > > I've tried to compile and checked the necessary flags, but still having the errors below. Not only that, but I was not able to solve the problem, any advice?
> > >
> > > Thanks in advance for your help!
> > > Abdel
> > >
> > >
> > > (base) abdel at pop-os:~/PHD/NOVAE/wd_builder_models$ ./clean (base) abdel at pop-os:~/PHD/NOVAE/wd_builder_models$ ./mk
> > > gfortran -Wno-uninitialized -fno-range-check -fmax-errors=7  -fprotect-parens -fno-sign-zero -fbacktrace -ggdb -finit-real=snan -fopenmp -fbounds-check -Wuninitialized -Warray-bounds -ggdb -ffree-form
> > > -ffree-line-length-none -x f95-cpp-input -I/home/abdel/mesa-r15140/include -I../src -c ../src/run_star_extras.f90
> > > wd_builder.inc:257:37:
> > >
> > > Error: Symbol 'num_kap_fracs' at (1) has no IMPLICIT type; did you mean 'kap_fracs'?
> > > ../src/run_star_extras.f90:597:57:
> > >
> > >   597 |             mixing_type, mlt_basics, mlt_partials1, ierr)
> > >       |                                                         1
> > > Error: Type mismatch in argument 'dt' at (1); passed LOGICAL(4) to REAL(8)
> > > ../src/run_star_extras.f90:243:25:
> > >
> > >   243 |          s% other_mlt => my_other_mlt
> > >       |                         1
> > > Error: Interface mismatch in procedure pointer assignment at (1): Type mismatch in argument 'dt' (REAL(8)/LOGICAL(4))
> > > wd_builder.inc:685:52:
> > >
> > > Error: Type mismatch in argument 'dt' at (1); passed LOGICAL(4) to REAL(8)
> > > wd_builder.inc:331:17:
> > >
> > > Error: Rank mismatch in argument 'z' at (1) (scalar and rank-1)
> > > wd_builder.inc:350:70:
> > >
> > > Error: Type mismatch in argument 'zbar' at (1); passed INTEGER(4) to REAL(8)
> > > wd_builder.inc:447:82:
> > >
> > > Error: Type mismatch in argument 'zbar' at (1); passed INTEGER(4) to REAL(8)
> > > compilation terminated due to -fmax-errors=7.
> > > make: *** [/home/abdel/mesa-r15140/star/work_standard_makefile:39: run_star_extras.o] Error 1
> > >
> > > FAILED
> > >
> > > (base) abdel at pop-os:~/PHD/NOVAE/wd_builder_models$
> > >
> > >
> > >
> > >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20220519/47a035f2/attachment.htm>


More information about the Mesa-users mailing list