1- Are species_name and species_code some parameters that are already
defined by the developers of openkim, or these two variables are something
\emph{I} should define it arbitrarily in my model?
2- What is the difference between species_name_string and species_name? If
I should define these variables arbitrarily in my model, can I define them
to be identical?
There are defined constants for all of the periodic table species. See the kim-api-v2.../fortran/include/kim_species_name_module.f90 file.
These are the constants that the kim-api uses to represent each species.
If you read a string from a parameter file representing the atom species (such as "Ni"), then you can convert this to a type(kim_species_name_type) variable that is equal to the corresponding kim_species_name_type defined constant using the
kim_species_name_from_string()
function.
The species_code is an integer that your model driver source code must define to represent a particular species. The simulator will provide an array, the "particleSpecies" array, containing these integer codes to communicate the species of each particle in the simulation to your model driver.
You only need to define a code for the species that your (parameterized) model supports.
There is an example of all this in the LennardJones612__MD_414112407348_003 code (it is in C++). If you look starting at line 368 of LennardJones612Implementation.cpp, you will see that the model driver reads in lines from the parameter file corresponding to:
spec1, spec2, nextCutoff, nextEpsilon, nextSigma
spec1 and spec2 are strings such as "He", "Ni", etc.
Then, these are converted to KIM::SpeciesName variables on line 383. This is the C++ equivalent of making a call to the
kim_species_name_from_string()
function. Then it figures out the species code it will/is using for those species and registers it with the kim-api on line 395.
Cheers,
Ryan