[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [modeller_usage] Using Fortran 90 with modeller

Lee wrote:
I would like to use modeller library in my own Fortran 90 code,
and implement extensions to Modeller in Fortran 90.
What is the best way of doing this ?

Implementing extensions should be straightforward enough - you can write them in any language which can link against C. See examples/c-extensions/ for examples. For Fortran 90 code, this usually involves writing a C wrapper that converts C-style arguments (pass-by-value) to and from Fortran style (pass-by-reference). (Since some Fortran 90 compilers also do weird things with name munging in modules, it's often easier to declare your F90 code outside of a module, too.)

The same C-to-Fortran conversion applies for using the Modeller library from your own code. See examples/commands/c-example.c. But I usually recommend that you embed Python in your application (or even implement your application itself as a Python module) if you want to use Modeller functionality, since the Modeller Python interface exposes a much simpler and less error-prone object-oriented API than the low-level C one (plus, many parts of Modeller functionality, such as the automodel class, are implemented entirely in Python anyway).

	Ben Webb, Modeller Caretaker
Modeller mail list: http://salilab.org/mailman/listinfo/modeller_usage