error #7566: A RETURN or EXIT statement is not legal in a DO loop associated with a parallel directive.

error #7566: A RETURN or EXIT statement is not legal in a DO loop associated with a parallel directive.


Hello~I have a problem, and i need some help.

I encountered this problem while compiling WRF. The error log is as follows:

../main/module_wrf_top.f90(768): error #5082: Syntax error, found 'DO' when expecting one of: PRIVATE FIRSTPRIVATE REDUCTION COLLAPSE LASTPRIVATE SHARED DEFAULT LINEAR COPYIN ...
   DO ij = 1, head_grid%num_tiles
---^
../main/module_wrf_top.f90(768): error #5082: Syntax error, found ',' when expecting one of: <END-OF-STATEMENT> ;
   DO ij = 1, head_grid%num_tiles
------------^
../main/module_wrf_top.f90(766): error #7644: The statement or directive following this OpenMP* directive is incorrect.
!$OMP PARALLEL DO    &

Can someone help me?

2 posts / 0 new

Your question is about Fortran and OpenMP, not about the abandoned Intel Cilk Plus extension of C.

It appears that either your source file has been corrupted, or perhaps you have a problem with your pre-processing options.  You would need to look at least at this part of the pre-processed source code and the source format options.  Assuming you are on linux, the .f90 file suffix would imply no pre-processing step ahead of OpenMP, and Fortran 90 free format source, if you didn't have an over-riding option set.

Leave a Comment

Please sign in to add a comment. Not a member? Join today