https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81205
--- Comment #2 from Pasha <pasha.313 at hotmail dot com> --- This is my main routine for example . . . !!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(K,jL) DO k=1,nG3 DO jL=1,nL2 j = idx2start + jL IF(masque(j,k))THEN ! dudx CALL fvec (nG1,curC(1:nG1,jL,k), difles1C(1:nG1,jL,k)) CALL tridgn (ff,s1,w1,difles1C(1:nG1,jL,k), nG1,1) ENDIF ENDDO ENDDO !!$OMP END PARALLEL DO . . . This is one of those subroutine SUBROUTINE fvec (n,y,q) ! ! Multiplie le vecteur y par les coefs de la matrice ! passee en common (param6) et le retourne dans q USE OMP_LIB IMPLICIT NONE INTEGER, INTENT(IN) :: n REAL(prec), DIMENSION(n), INTENT(IN) :: y REAL(prec), DIMENSION(n), INTENT(OUT) :: q INTEGER :: i,nm,nmm ! nmm=n-2 nm =n-1 q(1) = af0*y(1)+bf0*y(2) +cf0*y(3) +df0*y(4) +ef0*y(5) q(2) = af1*y(3)-af1*y(1) q(nm)= af1*y(n)-af1*y(nmm) q(n) =-ag0*y(n)-bg0*y(nm)-cg0*y(nmm)-dg0*y(n-3)-eg0*y(n-4) ! IF(bf2.EQ.ZERO)THEN !!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(I) DO i=3,nmm q(i)=af2*y(i+1)-af2*y(i-1) ENDDO !!$OMP END PARALLEL DO ELSE !!$OMP PARALLEL DO DEFAULT(SHARED) PRIVATE(I) DO i=3,nmm q(i)=af2*y(i+1)-af2*y(i-1)+bf2*y(i+2)-bf2*y(i-2) ENDDO !!$OMP END PARALLEL DO ENDIF END SUBROUTINE fvec please be aware that OMP commands works well in other subroutines except those who has loops and calling from inside a main code. So for running the program, I disabled all OMP commands in these subroutines and some part of codes as you can see.