[Mesa-users] Questions about using other_eos

Rob Farmer r.j.farmer at uva.nl
Mon Dec 14 04:26:20 EST 2020


Hi,
>1) I am currently writing my other_eosDT_get routine in run_star_extras.f.
In order to call the default EOS first, I am just copying the routine from
$MESA_DIR/eos/public/eos_lib.f90 but it appears that this relies on modules
located in $MESA_DIR/eos/make.

No, in your run_star_extras add:
use eos_lib
use eos_def

Then inside your other_eosDT routine you can add a call to eosDT_get() to
get mesa's normal eos results (have a look at eos_support.f90 to see how
mesa calls eosDT_get() ). You don't need to copy any files or put anything
in eos_lib.f90 yourself.

>2) My plan was just to modify the other_eosDT_get routine to change the
entries in res(i). Do I need to modify the entire set of routines given in
$MESA_DIR/star/other/other_eos.f90 e.g.

It depends on the problem your solving and your eos options, hopefully an
eos expert can chime in with which ones need setting?

Rob




On Sat, 12 Dec 2020 at 03:34, Jeremy Sakstein <sakstein at hawaii.edu> wrote:

> Hi everyone,
>
> I have two questions about using other_eos. To give some context, I would
> like to call the usual MESA EOS routines to find the EOS then change the
> values in the entries of res(i).
>
> I'm using r-12778.
>
> My questions are:
>
> 1) I am currently writing my other_eosDT_get routine in run_star_extras.f.
> In order to call the default EOS first, I am just copying the routine from
> $MESA_DIR/eos/public/eos_lib.f90 but it appears that this relies on modules
> located in $MESA_DIR/eos/make.
>
> My workaround for this is to just copy these to the make directory and
> then my code compiles. I am worried that I may be messing something up when
> I do this.
>
> Is the correct way to use other_eos to write my routine directly into
> $MESA_DIR/eos/public/eos_lib.f90, recompile the entire module, then point
> to this from run_star_extras.f?
>
> 2) My plan was just to modify the other_eosDT_get routine to change the
> entries in res(i). Do I need to modify the entire set of routines given in
> $MESA_DIR/star/other/other_eos.f90 e.g.
>
>          ! s% other_eosDT_get_T => my_eosDT_get_T
>
>          ! s% other_eosDT_get_Rho => my_eosDT_get_Rho
>
>          ! s% other_eosPT_get => my_eosPT_get
>
>          ! s% other_eosPT_get_T => my_eosPT_get_T
>
>          ! s% other_eosPT_get_Pgas => my_eosPT_get_Pgas
>
>          ! s% other_eosPT_get_Pgas_for_Rho => my_eosPT_get_Pgas_for_Rho
>
> as well? Looking at these routines, it looks like if routines like
> my_eosPT_get or my_eosDE_get are called then I need to do this, but I am
> not sure if they are called during a normal MESA run or not. The others
> seem to find the density, temperature, gas pressure given the EOS so it
> looks like I can leave these alone.
>
> Is this correct?
>
> Thanks for any help you can give.
>
> Cheers,
>
> Jeremy
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20201214/37a37d1e/attachment.htm>


More information about the Mesa-users mailing list