[mesa-users] Adding User-Supplied Modules Into MESA
Aaron Dotter
aaron.dotter at gmail.com
Fri Apr 20 09:34:19 EDT 2012
Hi Ehsan,
In my response, I will suppose that you want to call the "extra" routine(s)
from run_star_extras.f. I think that is what you're saying, but just to be
clear.
First of all, you would create the module source file and then you would
insert in your run_star_extras.f file near the top with other use
statements:
module run_star_extras
use star_lib
use star_def
use const_def
use my_new_module
For example, and then put the calls to your subroutines and/or functions,
etc. in the appropriate extras_* routines below.
Then you would add a compile line to the makefile for the star executable
(not the star module -- you should not have to change that at all). Let's
assume we do this in a work directory, then you could either edit
mesa/star/work_standard_makefile or make a local copy of that makefile in
your work/make directory and edit it there.
To set up the makefile for the new module, you'll need to edit "OBJS" to
add the .o for your compiled source file. Then down below where you see
things like "run.o: $(WORK_DIR)/run.f" you would add the corresponding
lines to compile your source file.
If you don't add a special line for your file, it will be compiled using
the default settings. The next thing you need to check is that any module
accessed by your new one is included in the LOAD_MESA list. For example, I
have been recently adding support for the FreeEOS code into MESA, and my
LOAD_MESA line looks like this:
LOAD_MESA = $(LOAD_MESA_STAR) $(LOAD_EXTRAS) -lfree_eos
and if your additional library is in a non-MESA location, you'd add a
-L[path] to that line as well (before the additional library).
Anyway, I think this will get you most of the way there, and please feel
free to write back to me with further questions if you get stuck. If this
isn't what you were asking about, please try again, and Good Luck!
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.mesastar.org/pipermail/mesa-users/attachments/20120420/ef0fb1b7/attachment.html>
More information about the Mesa-users
mailing list