i just added -openmp when i compile the serial code but i found an unexpected error: some arraies becomes NaN which should be a constant, while anothers are correct.
Are you using Fortran? And does your code depend on the values of local variables being preserved between subroutine calls?
If so, then you need to ensure they are declared with the SAVE attribute.
Thanks for your reply ,MarkB！
yes, the code is in Fortran, and all arraies are defined in several common blocks, so as defined in the syntax, they should be SHARED, right?
And is there a possibility that the problem comes with the COMMON BLOCKS? Should i try to replace them with modules?