Merge branch 'develop' into collected-small-changes
This commit is contained in:
@ -5,46 +5,58 @@ The :f:mod:`LIBLAMMPS` module provides an interface to call LAMMPS from
|
||||
Fortran. It is based on the LAMMPS C library interface and requires a
|
||||
fully Fortran 2003-compatible compiler to be compiled. It is designed
|
||||
to be self-contained and not require any support functions written in C,
|
||||
C++, or Fortran other than those in the C library interface and the module
|
||||
itself.
|
||||
C++, or Fortran other than those in the C library interface and the
|
||||
LAMMPS Fortran module itself.
|
||||
|
||||
While C libraries have a defined binary interface (ABI) and can thus be
|
||||
used from multiple compiler versions from different vendors as long
|
||||
as they are compatible with the hosting operating system, the same is
|
||||
not true for Fortran programs. Thus, the LAMMPS Fortran module needs to be
|
||||
used from multiple compiler versions from different vendors as long as
|
||||
they are compatible with the hosting operating system, the same is not
|
||||
true for Fortran programs. Thus, the LAMMPS Fortran module needs to be
|
||||
compiled alongside the code using it from the source code in
|
||||
``fortran/lammps.f90``. When linking, you also need to
|
||||
:doc:`link to the LAMMPS library <Build_link>`. A typical command line
|
||||
for a simple program using the Fortran interface would be:
|
||||
``fortran/lammps.f90`` *and* with the same compiler used to build the
|
||||
rest of the Fortran code that interfaces to LAMMPS. When linking, you
|
||||
also need to :doc:`link to the LAMMPS library <Build_link>`. A typical
|
||||
command line for a simple program using the Fortran interface would be:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
||||
|
||||
Please note that the MPI compiler wrapper is only required when the
|
||||
calling the library from an MPI-parallelized program. Otherwise, using
|
||||
the plain Fortran compiler (gfortran, ifort, flang, etc.) will suffice.
|
||||
It may be necessary to link to additional libraries, depending on how
|
||||
LAMMPS was configured and whether the LAMMPS library :doc:`was compiled
|
||||
as a static or dynamic library <Build_link>`.
|
||||
calling the library *from* an MPI-parallelized program. Otherwise,
|
||||
using the plain Fortran compiler (gfortran, ifort, flang, etc.) will
|
||||
suffice, since there are no direct references to MPI library features,
|
||||
definitions and subroutine calls; MPI communicators are referred to by
|
||||
their integer index representation as required by the Fortran MPI
|
||||
interface. It may be necessary to link to additional libraries,
|
||||
depending on how LAMMPS was configured and whether the LAMMPS library
|
||||
:doc:`was compiled as a static or dynamic library <Build_link>`.
|
||||
|
||||
If the LAMMPS library itself has been compiled with MPI support, the
|
||||
resulting executable will still be able to run LAMMPS in parallel with
|
||||
``mpirun``, ``mpiexec``, or equivalent. Please also note that the order
|
||||
of the source files matters: the ``lammps.f90`` file needs to be
|
||||
compiled first, since it provides the :f:mod:`LIBLAMMPS` module that is
|
||||
imported by the Fortran code that uses the interface. A working example
|
||||
can be found together with equivalent examples in C and C++ in the
|
||||
``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
||||
resulting executable will be able to run LAMMPS in parallel with
|
||||
``mpirun``, ``mpiexec``, or equivalent. This may be either on the
|
||||
"world" communicator or a sub-communicator created by the calling
|
||||
Fortran code. If, on the other hand, the LAMMPS library has been
|
||||
compiled **without** MPI support, each LAMMPS instance will run
|
||||
independently using just one processor.
|
||||
|
||||
.. versionadded:: 9Oct2020
|
||||
Please also note that the order of the source files matters: the
|
||||
``lammps.f90`` file needs to be compiled first, since it provides the
|
||||
:f:mod:`LIBLAMMPS` module that would need to be imported by the calling
|
||||
Fortran code in order to uses the Fortran interface.
|
||||
A working example can be found together with equivalent examples in C and
|
||||
C++ in the ``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
||||
|
||||
.. versionchanged:: TBD
|
||||
|
||||
.. note::
|
||||
|
||||
A contributed Fortran interface that more closely resembles the C library
|
||||
interface is available in the ``examples/COUPLE/fortran2`` folder. Please
|
||||
see the ``README`` file in that folder for more information about it and how
|
||||
to contact its author and maintainer.
|
||||
A contributed Fortran interface interface is available in the
|
||||
``examples/COUPLE/fortran2`` folder. However, since the completion
|
||||
of the :f:mod:`LIBLAMMPS` module, this interface is now deprecated,
|
||||
no longer actively maintained and will likely be removed in the
|
||||
future. Please see the ``README`` file in that folder for more
|
||||
information about it and how to contact its author and maintainer.
|
||||
|
||||
----------
|
||||
|
||||
|
||||
@ -131,7 +131,7 @@ the parameter *window_moves* (see Sect. III.B in :ref:`Sadigh1
|
||||
------------
|
||||
|
||||
Restart, fix_modify, output, run start/stop, minimize info
|
||||
==========================================================
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
No information about this fix is written to restart files.
|
||||
|
||||
@ -149,7 +149,7 @@ components of the vector represent the following quantities:
|
||||
* N+2: The current global concentration of species *X* (= number of atoms of type *N* / total number of atoms)
|
||||
|
||||
Restrictions
|
||||
============
|
||||
""""""""""""
|
||||
|
||||
This fix is part of the MC package. It is only enabled if LAMMPS was
|
||||
built with that package. See the :doc:`Build package <Build_package>`
|
||||
@ -169,7 +169,7 @@ execution i.e. it only works with a single MPI process.
|
||||
------------
|
||||
|
||||
Default
|
||||
=======
|
||||
"""""""
|
||||
|
||||
The optional parameters default to the following values:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user