[Nek5000-users] Link Fortran90 code via Fortran Interface

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Thu Feb 11 11:00:25 CST 2016


Hi Philipp,

You should be able to define subprograms in a separate F90 file and call
them from the usr file.  Then, just compile your new file and add it to the
link line using the "USR_LFLAGS" option in makenek. However, it could be a
bit tricky to access global data stored Nek5000's common blocks, so I'd
strongly suggest making those routines self-contained with all data passing
via arguments.  This approach can be used to link in C or C++ code as well,
as they are all object compatible.

The usr file itself needs to be F77, if for no other reason than the
include files ('SIZE', for example) are in F77 format.

Depending on your problem, you may be able to use NekBox, which is written
in F90 and uses F90 for the usr file.  NekBox is more of a prototyping code
than a production code, so its functionality is limited.  See:
https://github.com/Nek5000/NekBox

Max

On Thu, Feb 11, 2016 at 8:35 AM <nek5000-users at lists.mcs.anl.gov> wrote:

> Hi Neks,
>
> Is it possible to link Fortran90 code via the Fortran Interface (b3d.usr).
>
> Best regards, Philipp Weiss
> _______________________________________________
> Nek5000-users mailing list
> Nek5000-users at lists.mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/nek5000-users/attachments/20160211/e8ef47fe/attachment.html>


More information about the Nek5000-users mailing list