[Mesa-users] Usage of the MESA EoS module outside of MESA/star

trobolo dinni trobolo.trobolo.dinni5 at gmail.com
Mon Jul 27 23:14:21 EDT 2020


Dear Rob,

Thank you for the link.

I am trying to use your pyMesa package at the moment actually, which fits
better my needs I think.
I managed to build it properly, then I built the gfort2py package. However,
when running an example from the files you provide in the mesa_model folder
of pyMesa I receive the following error (in this case is the const.py
script):

































































*In [1]: run const.py


---------------------------------------------------------------------------FileNotFoundError
                        Traceback (most recent call
last)~/.local/lib/python3.7/site-packages/gfort2py/gfort2py.py in
_load_data(self, ffile, rerun)     48         try:---> 49             f =
open(self._fpy, 'rb')     50         except FileNotFoundError as
e:FileNotFoundError: [Errno 2] No such file or directory:
'/xc/home/roberto.fpy'During handling of the above exception, another
exception occurred:PermissionError                           Traceback
(most recent call
last)/xc/home/roberto.iaconi/codes/pyMesa/mesa_models/const.py in <module>
    1 import pyMesaUtils as pym      2 ----> 3 const_lib,const_def =
pym.loadMod("const")      4       5
/xc/home/roberto.iaconi/codes/pyMesa/pyMesaUtils.py in loadMod(module)
114     115     try:--> 116         x =
gf.fFort(SHARED_LIB,MODULE_LIB,rerun=True)    117     except
FileNotFoundError:    118
pass~/.local/lib/python3.7/site-packages/gfort2py/gfort2py.py in
__init__(self, libname, ffile, rerun)     41         self._ffile = ffile
 42         self._fpy = pm.fpyname(ffile)---> 43
self._load_data(ffile, rerun)     44         self._init()     45
self._initialized =
True~/.local/lib/python3.7/site-packages/gfort2py/gfort2py.py in
_load_data(self, ffile, rerun)     51             if e.errno !=
errno.ENOENT:     52                 raise---> 53             pm.run(ffile,
save=True)     54         else:     55
f.close()~/.local/lib/python3.7/site-packages/gfort2py/parseMod/parseMod.py
in run(filename, output, save, unpack)     60
output=fpyname(filename)     61 ---> 62         x.save(output)     63
 64     if
unpack:~/.local/lib/python3.7/site-packages/gfort2py/parseMod/parseModCommon.py
in save(self, output)     68         self.pickler(output,
self.PYFILE_VERSION,      69                     self.mod_data,
self.mod_vars, self.param,---> 70                     self.funcs,
self.dt_defs, self.func_ptrs)     71      72
~/.local/lib/python3.7/site-packages/gfort2py/parseMod/parseModCommon.py in
pickler(self, filename, *args)     72      73     def
pickler(self,filename, *args):---> 74         with open(filename, 'wb') as
f:     75             for i in args:     76                 pickle.dump(i,
f, protocol=2)PermissionError: [Errno 13] Permission denied:
'/xc/home/roberto.fpy'In [2]:
 *

Looks like the .fpy file had to be created automatically upon
building gfort2py, but it wasn't.
Can I ask if you witnessed this error before?

Best,
Roberto


On Mon, 27 Jul 2020 at 16:45, Rob Farmer <r.j.farmer at uva.nl> wrote:

> Hi,
>
> There is an example from a previous mesa summer school
> https://zenodo.org/record/3372835 by Frank Timmes which
>  shows how to use the eos, kap, and net modules separately.
>
> Rob
>
> On Mon, 27 Jul 2020 at 08:42, trobolo dinni via Mesa-users <
> mesa-users at lists.mesastar.org> wrote:
>
>> Dear MESA users,
>>
>> I am interested in directly querying the tabulated equation of state of
>> MESA to obtain some thermodynamic quantities.
>> Specifically, I want to give as inputs density and pressure, and receive
>> as outputs internal energy and temperature.
>>
>> I know that the MESA EoS module can be used independently from MESA/star,
>> but I have never done it and I am not sure on how to proceed.
>> Can I ask for a simple explanation/tutorial on how to do it?
>>
>> Thanks in advance,
>> Roberto
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20200728/1b122be8/attachment.htm>


More information about the Mesa-users mailing list