Index bug fixed:
Fortran code uses index starting from 1 anc in C++ index starts from 0.
In two loop I had this bug and I fixed it. Now code is good and
results are in good agreement.