mention example using the new Fortran module in examples/COUPLE/simple
This commit is contained in:
@ -19,10 +19,12 @@ for a simple program using the Fortran interface would be:
|
|||||||
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps
|
||||||
|
|
||||||
Please note, that the MPI compiler wrapper is only required when the
|
Please note, that the MPI compiler wrapper is only required when the
|
||||||
calling the library from an MPI parallel code. Please also note the order
|
calling the library from an MPI parallel code. Please also note the
|
||||||
of the source files: the lammps.f90 file needs to be compiled first,
|
order of the source files: the ``lammps.f90`` file needs to be compiled
|
||||||
since it provides the ``LIBLAMMPS`` module that is imported by the
|
first, since it provides the ``LIBLAMMPS`` module that is imported by
|
||||||
Fortran code using the interface.
|
the Fortran code using the interface. A working example code can be
|
||||||
|
found together with equivalent examples in C and C++ in the
|
||||||
|
``examples/COUPLE/simple`` folder of the LAMMPS distribution.
|
||||||
|
|
||||||
.. versionadded:: 9Oct2020
|
.. versionadded:: 9Oct2020
|
||||||
|
|
||||||
@ -36,11 +38,11 @@ Fortran code using the interface.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
A contributed (and complete!) Fortran interface that is more
|
A contributed (and complete!) Fortran interface that more
|
||||||
closely resembling the C-library interface is available
|
closely resembles the C-library interface is available
|
||||||
in the ``examples/COUPLE/fortran2`` folder. Please see the
|
in the ``examples/COUPLE/fortran2`` folder. Please see the
|
||||||
``README`` file in that folder for more information about that
|
``README`` file in that folder for more information about it
|
||||||
Fortran interface and how to contact its author and maintainer.
|
and how to contact its author and maintainer.
|
||||||
|
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|||||||
@ -116,12 +116,11 @@ PROGRAM f_driver
|
|||||||
natoms = NINT(lmp%get_natoms())
|
natoms = NINT(lmp%get_natoms())
|
||||||
ALLOCATE(x(3*natoms))
|
ALLOCATE(x(3*natoms))
|
||||||
|
|
||||||
! these calls are commented out, b/c libfwrapper.c
|
! these calls are commented out, because they are not interfaced yet
|
||||||
! needs to be updated to use gather_atoms and scatter_atoms
|
|
||||||
|
|
||||||
!CALL lammps_gather_atoms(ptr,'x',1,3,x)
|
!CALL lmp%gather_atoms('x',1,3,x)
|
||||||
!x(1) = x(1) + epsilon
|
!x(1) = x(1) + epsilon
|
||||||
!CALL lammps_scatter_atoms(ptr,'x',1,3,x)
|
!CALL lmp%scatter_atoms('x',1,3,x)
|
||||||
|
|
||||||
DEALLOCATE(x)
|
DEALLOCATE(x)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user