new potential in LAMMPS Fortran version

Good day. I’m beginner in lammps. I need to add new potential in fortran version. What i need to do this?

Good day. I'm beginner in lammps. I need to add new potential in fortran
version. What i need to do this?

​the fortran version of LAMMPS is obsolete and unsupported.​ anybody who
knew how to do this has probably forgotten it over the last 10+ years. do
yourself a favor and use the C++ version.

axel.

If you are a fortran programmer, then what Axel said may seem
discouraging. You are not going to get a lot of sympathy for fortran.

    But if you know fortran, it should not be difficult to learn C. I
admit that C++ is harder to learn than C, however LAMMPS is written in
a style of C++ that should be comfortable for C programmers. You do
not have to be fluent in the many complicated features and quirks of
C++. Knowledge of C is enough. (Almost enough.)

   There is one caveat: To add a new potential to LAMMPS, you will
probably need to create a new "Pair" or "Bond" child class, so you
should be familiar with the basics of what a "class" is:

http://www.learncpp.com/cpp-tutorial/81-welcome-to-object-oriented-programming/
http://www.learncpp.com/cpp-tutorial/82-classes-and-class-members/
http://www.cplusplus.com/doc/tutorial/classes/
https://www.reddit.com/r/learnprogramming/comments/2gnqkc/c_what_is_not_c_with_classes/

   But that's all you need. When creating new LAMMPS force-fields,
you do not need to know about templates, STL, vectors, maps,
stringstreams, iterators, &references, operator-overloading,
exceptions, lambda-expressions, multiple-inheritance,
virtual-member-functions, abstract-base-classes, initializer-lists,
private/protected-inheritance (all classes in LAMMPS use public
inheritance), or even "const". (This is not a criticism.) If you
felt the need to learn all of those topics, then it might seem like
contributing to LAMMPS is an insurmountable task. But you don't.

Cheers
Andrew

    If you are a fortran programmer, then what Axel said may seem
discouraging. You are not going to get a lot of sympathy for fortran.

​just for clarity, my comment wasn't meant to give a ranking on programming
languages, but based on the simple fact that in the C++ version​ it is very
easy to add a feature and the fact that people here are willing and able to
explain and help with that (within reason).

    But if you know fortran, it should not be difficult to learn C. I

admit that C++ is harder to learn than C, however LAMMPS is written in
a style of C++ that should be comfortable for C programmers. You do
not have to be fluent in the many complicated features and quirks of
C++. Knowledge of C is enough. (Almost enough.)

​when i want to tease steve, i tell him that he writes C++ like he is still
- at heart - programming in fortran. that is, of course, an exaggeration,
but if you look close enough, there are quite a few programming constructs
in the code that could be called "fortran-isms" (e.g. classes are often
used like common blocks where there should be getter/setter functions
instead). i have a long laundry list of those and every once in a while, i
manage to get one of those changes past steve, when he is not paying
attention or i succeed in talking him down. :wink:

axel.

when i want to tease steve, i tell him that he writes C++ like he is still - at heart - programming >in fortran. that is, of course, an exaggeration, but if you look close enough, there are quite a >few programming constructs in the code that could be called “fortran-isms” (e.g. classes are >often used like common blocks where there should be getter/setter functions instead). i have a >long laundry list of those and every once in a while, i manage to get one of those changes past >steve, when he is not paying attention or i succeed in talking him down. :wink:

Hey, I resemble that comment.

Steve

>when i want to tease steve, i tell him that he writes C++ like he is
still - at heart - programming >in fortran. that is, of course, an
exaggeration, but if you look close enough, there are quite a >few
programming constructs in the code that could be called "fortran-isms"
(e.g. classes are >often used like common blocks where there should be
getter/setter functions instead). i have a >long laundry list of those and
every once in a while, i manage to get one of those changes past >steve,
when he is not paying attention or i succeed in talking him down. :wink:

Hey, I resemble that comment.

​ahhh... works all the time. ;-)​