Is there anything wrong in these "for" loops? About syntax..? It compiles. The results start to increase while the program running, without any physical sense. i and j indexes are right. These loops are part of a long code but after debugging it seems that the mistake is not anywhere else.
for (i=0; i< *nbox; i++) {
for(j=0; j< *m1;j++) {
bn[i][j] =bn[i][j]/dx[1];
}
for(j=0; j< *m2;j++) {
cn[i][j] =cn[i][j]/dx[1];
}
}
for (i=0; i<=*npmax-1; i++) {
for(j=0; j< *m1;j++) {
partic[j][i]= partic[j][i]*dx[1];
}
for(j=0; j< *m2;j++) {
partic[j+ *m1][i]=partic[j+ *m1][i]*dx[1];
}
}
Thanks!