next up previous contents index
Next: 5.5.2 Compiler directives Up: 5.5 Compiler switches and Previous: 5.5 Compiler switches and   Contents   Index

5.5.1 OpenMP

CO5BOLD is parallelized with OpenMP directives. They should be capitalized and indented with the surrounding code, as in:

!$OMP PARALLEL DEFAULT(SHARED), PRIVATE(i1, i2, i3)
!
! -- Set bulk HD quantities to zero --
!$OMP DO SCHEDULE(RUNTIME)
do i3=m3-nghost3,n3+nghost3
  do i2=m2-nghost2,n2+nghost2
     !DIR$ IVDEP
    do i1=m1-nghost1,n1+nghost1
      box%rho(i1,i2,i3)=0.0
      box%ei( i1,i2,i3)=0.0
      box%v1( i1,i2,i3)=0.0
      box%v2( i1,i2,i3)=0.0
      box%v3( i1,i2,i3)=0.0
    end do ! i1
  end do ! i2
end do ! i3
!$OMP END DO
!
!$OMP END PARALLEL