Thank you very much.
In these two days, I read some documents on openmp. Based on my studies, I have changed my code as the style of the following code. Now all the calculations in a big loop are put into a subroutine like "pr" below. I test it on linux. It works. Interestingly, the following code get the same results with sequential and parallel runnings. Do you think it is ok or not? Another thing is that in my code there is some situation like k as follows . I hope k will sum some values in different threads when it meets a preset-condition . Therefore here k is treated as DEFAULT(SHARED). This way is correct, right?
c.....OpenMP : Start parallel loop section
c$OMP PARALLEL DO DEFAULT(SHARED), PRIVATE(i,