[lammps-users] Add a new potential defined in the .f fortran code format

Hi,

I have a new potential defined as a fortran subroutine. Is it possible for me to add it to the existing potentials or must I have a .cpp and .h equivalent?
If its possible, how do I go about it?

Thank you.

Yes, you can add it to LAMMPS. MEAM potential included with LAMMPS is in
form of fortran files. There, pair_meam.cpp calls the fortran
subroutines. You may do something similar.

Rohit

Yes, you can add it to LAMMPS. MEAM potential included with LAMMPS is
in form of fortran files. There, pair_meam.cpp calls the fortran
subroutines. You may do something similar.

which means, that the .cpp and .h are still
required to act as a proxy class.

unless you know well how to call fortran from c++
and how to pass the data around, it may be less of
a hassle to take a similar enough existing pair
style class, copy and rename it, and then translate
your fortran code into c++.
it is not *that* much different: you have free format,
have to add an ';' at the end of each line,
arrays have [] instead of () and array and loop counting
starts at 0 instead of 1. those few things cover the
majority of changes. the rest need you to have a c++
reference available or somebody who knows how to write it. :wink:

cheers,
    axel.