[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 16:25:35 CST 2016
Sure, but that would have to be done explicitly, not via `include`
statements, because the include files contain F77-style comments and line
continuations. Then, if one of those common block names changes in the
include file, the compiler interprets your common block as being a new
declaration and you get a silent bug. The include files seem to be
relatively stable, so just be careful...
On Thu, Feb 11, 2016 at 4:07 PM <nek5000-users at lists.mcs.anl.gov> wrote:
> I guess you could just use common blocks also in the Fortran90 code.
>
> Philipp
>
> On 2016-02-11 18:00, nek5000-users at lists.mcs.anl.gov wrote:
> > 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
> > <mailto: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 <mailto:
> Nek5000-users at lists.mcs.anl.gov>
> > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> >
> >
> >
> > _______________________________________________
> > Nek5000-users mailing list
> > Nek5000-users at lists.mcs.anl.gov
> > https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> >
> _______________________________________________
> 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/1c5d93e8/attachment.html>
More information about the Nek5000-users
mailing list