alloc-comp-2.f90 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368
  1. ! { dg-do run }
  2. ! Don't cycle by default through all options, just test -O0 and -O2,
  3. ! as this is quite large test.
  4. ! { dg-skip-if "" { ! run_expensive_tests } { "*" } { "-O0" "-O2" } }
  5. module m
  6. type dl
  7. integer :: a, b
  8. integer, allocatable :: c(:,:)
  9. integer :: d, e
  10. integer, allocatable :: f
  11. end type
  12. type dt
  13. integer :: g
  14. type (dl), allocatable :: h(:)
  15. integer :: i
  16. type (dl) :: j(2, 2)
  17. type (dl), allocatable :: k
  18. end type
  19. contains
  20. subroutine ver_dl (obj, val, c, cl1, cu1, cl2, cu2, f)
  21. type (dl), intent (in) :: obj
  22. integer, intent (in) :: val, cl1, cu1, cl2, cu2
  23. logical, intent (in) :: c, f
  24. if ((c .neqv. allocated (obj%c)) .or. (f .neqv. allocated (obj%f))) call abort
  25. if (c) then
  26. if (lbound (obj%c, 1) /= cl1 .or. ubound (obj%c, 1) /= cu1) call abort
  27. if (lbound (obj%c, 2) /= cl2 .or. ubound (obj%c, 2) /= cu2) call abort
  28. end if
  29. if (val /= 0) then
  30. if (obj%a /= val .or. obj%b /= val) call abort
  31. if (obj%d /= val .or. obj%e /= val) call abort
  32. if (c) then
  33. if (any (obj%c /= val)) call abort
  34. end if
  35. if (f) then
  36. if (obj%f /= val) call abort
  37. end if
  38. end if
  39. end subroutine ver_dl
  40. subroutine ver_dt (obj, val, h, hl, hu, k, c, cl1, cu1, cl2, cu2, f)
  41. type (dt), intent (in) :: obj
  42. integer, intent (in) :: val, hl, hu, cl1, cu1, cl2, cu2
  43. logical, intent (in) :: h, k, c, f
  44. integer :: i, j
  45. if ((h .neqv. allocated (obj%h)) .or. (k .neqv. allocated (obj%k))) call abort
  46. if (h) then
  47. if (lbound (obj%h, 1) /= hl .or. ubound (obj%h, 1) /= hu) call abort
  48. do i = hl, hu
  49. call ver_dl (obj%h(i), val, c, cl1, cu1, cl2, cu2, f)
  50. end do
  51. end if
  52. do i = 1, 2
  53. do j = 1, 2
  54. call ver_dl (obj%j(i, j), val, c, cl1, cu1, cl2, cu2, f)
  55. end do
  56. end do
  57. if (k) call ver_dl (obj%k, val, c, cl1, cu1, cl2, cu2, f)
  58. if (val /= 0) then
  59. if (obj%g /= val .or. obj%i /= val) call abort
  60. end if
  61. end subroutine ver_dt
  62. subroutine alloc_dl (obj, val, c, cl1, cu1, cl2, cu2, f)
  63. type (dl), intent (inout) :: obj
  64. integer, intent (in) :: val, cl1, cu1, cl2, cu2
  65. logical, intent (in) :: c, f
  66. if (val /= 0) then
  67. obj%a = val
  68. obj%b = val
  69. obj%d = val
  70. obj%e = val
  71. end if
  72. if (allocated (obj%c)) deallocate (obj%c)
  73. if (c) then
  74. allocate (obj%c(cl1:cu1, cl2:cu2))
  75. if (val /= 0) obj%c = val
  76. end if
  77. if (f) then
  78. if (.not.allocated (obj%f)) allocate (obj%f)
  79. if (val /= 0) obj%f = val
  80. else
  81. if (allocated (obj%f)) deallocate (obj%f)
  82. end if
  83. end subroutine alloc_dl
  84. subroutine alloc_dt (obj, val, h, hl, hu, k, c, cl1, cu1, cl2, cu2, f)
  85. type (dt), intent (inout) :: obj
  86. integer, intent (in) :: val, hl, hu, cl1, cu1, cl2, cu2
  87. logical, intent (in) :: h, k, c, f
  88. integer :: i, j
  89. if (val /= 0) then
  90. obj%g = val
  91. obj%i = val
  92. end if
  93. if (allocated (obj%h)) deallocate (obj%h)
  94. if (h) then
  95. allocate (obj%h(hl:hu))
  96. do i = hl, hu
  97. call alloc_dl (obj%h(i), val, c, cl1, cu1, cl2, cu2, f)
  98. end do
  99. end if
  100. do i = 1, 2
  101. do j = 1, 2
  102. call alloc_dl (obj%j(i, j), val, c, cl1, cu1, cl2, cu2, f)
  103. end do
  104. end do
  105. if (k) then
  106. if (.not.allocated (obj%k)) allocate (obj%k)
  107. call alloc_dl (obj%k, val, c, cl1, cu1, cl2, cu2, f)
  108. else
  109. if (allocated (obj%k)) deallocate (obj%k)
  110. end if
  111. end subroutine alloc_dt
  112. end module m
  113. use m
  114. type (dt), allocatable :: y
  115. call foo (y)
  116. contains
  117. subroutine foo (y)
  118. use m
  119. type (dt), allocatable :: x, y, z(:,:)
  120. logical, parameter :: F = .false.
  121. logical, parameter :: T = .true.
  122. logical :: l
  123. !$omp parallel private (x, y, z)
  124. if (allocated (x) .or. allocated (y) .or. allocated (z)) call abort
  125. !$omp end parallel
  126. !$omp parallel firstprivate (x, y, z)
  127. if (allocated (x) .or. allocated (y) .or. allocated (z)) call abort
  128. !$omp end parallel
  129. l = F
  130. !$omp parallel sections lastprivate (x, y, z) firstprivate (l)
  131. !$omp section
  132. if (.not. l) then
  133. if (allocated (x) .or. allocated (y) .or. allocated (z)) call abort
  134. end if
  135. !$omp section
  136. if (.not. l) then
  137. if (allocated (x) .or. allocated (y) .or. allocated (z)) call abort
  138. end if
  139. allocate (x, y, z(-3:-3,2:3))
  140. call alloc_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  141. call ver_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  142. call alloc_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  143. call ver_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  144. call alloc_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  145. call ver_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  146. call alloc_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  147. call ver_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  148. !$omp section
  149. !$omp end parallel sections
  150. if (.not.allocated (x) .or. .not.allocated (y)) call abort
  151. if (.not.allocated (z)) call abort
  152. if (lbound (z, 1) /= -3 .or. ubound (z, 1) /= -3) call abort
  153. if (lbound (z, 2) /= 2 .or. ubound (z, 2) /= 3) call abort
  154. call ver_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  155. call ver_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  156. call ver_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  157. call ver_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  158. call alloc_dt (x, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  159. call ver_dt (x, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  160. call alloc_dt (y, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  161. call ver_dt (y, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  162. call alloc_dt (z(-3,2), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  163. call ver_dt (z(-3,2), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  164. call alloc_dt (z(-3,3), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  165. call ver_dt (z(-3,3), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  166. !$omp parallel private (x, y, z)
  167. call ver_dt (x, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  168. call alloc_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  169. call ver_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  170. call ver_dt (y, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  171. call alloc_dt (y, 14, T, 3, 4, F, T, 1, 1, 2, 4, T)
  172. call ver_dt (y, 14, T, 3, 4, F, T, 1, 1, 2, 4, T)
  173. call ver_dt (z(-3,2), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  174. call alloc_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  175. call ver_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  176. call ver_dt (z(-3,3), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  177. call alloc_dt (z(-3,3), 14, T, 3, 4, F, T, 1, 1, 2, 4, T)
  178. call ver_dt (z(-3,3), 14, T, 3, 4, F, T, 1, 1, 2, 4, T)
  179. !$omp end parallel
  180. call ver_dt (x, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  181. call alloc_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  182. call ver_dt (y, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  183. call alloc_dt (y, 14, T, 3, 4, F, T, 1, 1, 2, 4, T)
  184. call ver_dt (z(-3,2), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  185. call alloc_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  186. call ver_dt (z(-3,3), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  187. call alloc_dt (z(-3,3), 14, T, 3, 4, F, T, 1, 1, 2, 4, T)
  188. !$omp parallel private (x, y, z)
  189. call ver_dt (x, 0, T, -3, -1, T, T, -1, -1, 2, 3, T)
  190. call ver_dt (y, 0, T, 3, 4, F, T, 1, 1, 2, 4, T)
  191. deallocate (x%h, x%k)
  192. deallocate (y%h)
  193. allocate (y%k)
  194. call ver_dt (z(-3,2), 0, T, -3, -1, T, T, -1, -1, 2, 3, T)
  195. call ver_dt (z(-3,3), 0, T, 3, 4, F, T, 1, 1, 2, 4, T)
  196. deallocate (z(-3,2)%h, z(-3,2)%k)
  197. deallocate (z(-3,3)%h)
  198. allocate (z(-3,3)%k)
  199. !$omp end parallel
  200. call alloc_dt (x, 5, T, 1, 2, F, T, 2, 3, -2, -2, F)
  201. call alloc_dt (y, 15, F, 0, 0, T, T, 2, 2, 2, 2, T)
  202. call alloc_dt (z(-3,2), 5, T, 1, 2, F, T, 2, 3, -2, -2, F)
  203. call alloc_dt (z(-3,3), 15, F, 0, 0, T, T, 2, 2, 2, 2, T)
  204. !$omp parallel firstprivate (x, y, z)
  205. call ver_dt (x, 5, T, 1, 2, F, T, 2, 3, -2, -2, F)
  206. call alloc_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  207. call ver_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  208. call ver_dt (y, 15, F, 0, 0, T, T, 2, 2, 2, 2, T)
  209. call alloc_dt (y, 4, T, 3, 4, T, T, 1, 1, 2, 4, T)
  210. call ver_dt (y, 4, T, 3, 4, T, T, 1, 1, 2, 4, T)
  211. call ver_dt (z(-3,2), 5, T, 1, 2, F, T, 2, 3, -2, -2, F)
  212. call alloc_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  213. call ver_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  214. call ver_dt (z(-3,3), 15, F, 0, 0, T, T, 2, 2, 2, 2, T)
  215. call alloc_dt (z(-3,3), 4, T, 3, 4, T, T, 1, 1, 2, 4, T)
  216. call ver_dt (z(-3,3), 4, T, 3, 4, T, T, 1, 1, 2, 4, T)
  217. !$omp end parallel
  218. call ver_dt (x, 5, T, 1, 2, F, T, 2, 3, -2, -2, F)
  219. call alloc_dt (x, 4, F, 0, 0, F, F, 0, 0, 0, 0, F)
  220. call ver_dt (y, 15, F, 0, 0, T, T, 2, 2, 2, 2, T)
  221. call alloc_dt (y, 16, F, 0, 0, F, F, 0, 0, 0, 0, F)
  222. call ver_dt (z(-3,2), 5, T, 1, 2, F, T, 2, 3, -2, -2, F)
  223. call alloc_dt (z(-3,2), 4, F, 0, 0, F, F, 0, 0, 0, 0, F)
  224. call ver_dt (z(-3,3), 15, F, 0, 0, T, T, 2, 2, 2, 2, T)
  225. call alloc_dt (z(-3,3), 16, F, 0, 0, F, F, 0, 0, 0, 0, F)
  226. !$omp parallel firstprivate (x, y, z)
  227. call ver_dt (x, 4, F, 0, 0, F, F, 0, 0, 0, 0, F)
  228. call alloc_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  229. call ver_dt (x, 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  230. call ver_dt (y, 16, F, 0, 0, F, F, 0, 0, 0, 0, F)
  231. call alloc_dt (y, 17, T, 1, 2, F, T, 2, 2, 3, 3, F)
  232. call ver_dt (y, 17, T, 1, 2, F, T, 2, 2, 3, 3, F)
  233. call ver_dt (z(-3,2), 4, F, 0, 0, F, F, 0, 0, 0, 0, F)
  234. call alloc_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  235. call ver_dt (z(-3,2), 4, T, -3, -1, T, T, -1, -1, 2, 3, T)
  236. call ver_dt (z(-3,3), 16, F, 0, 0, F, F, 0, 0, 0, 0, F)
  237. call alloc_dt (z(-3,3), 17, T, 1, 2, F, T, 2, 2, 3, 3, F)
  238. call ver_dt (z(-3,3), 17, T, 1, 2, F, T, 2, 2, 3, 3, F)
  239. !$omp end parallel
  240. call ver_dt (x, 4, F, 0, 0, F, F, 0, 0, 0, 0, F)
  241. call ver_dt (y, 16, F, 0, 0, F, F, 0, 0, 0, 0, F)
  242. call alloc_dt (y, 18, T, 0, 1, T, T, 0, 1, 0, 1, T)
  243. call ver_dt (z(-3,2), 4, F, 0, 0, F, F, 0, 0, 0, 0, F)
  244. call ver_dt (z(-3,3), 16, F, 0, 0, F, F, 0, 0, 0, 0, F)
  245. call alloc_dt (z(-3,3), 18, T, 0, 1, T, T, 0, 1, 0, 1, T)
  246. l = F
  247. !$omp parallel sections lastprivate (x, y, z) firstprivate (l)
  248. !$omp section
  249. if (l) then
  250. call ver_dt (x, 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  251. call ver_dt (y, 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  252. call ver_dt (z(-3,2), 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  253. call ver_dt (z(-3,3), 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  254. else
  255. call ver_dt (x, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  256. call ver_dt (y, 0, T, 0, 1, T, T, 0, 1, 0, 1, T)
  257. call ver_dt (z(-3,2), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  258. call ver_dt (z(-3,3), 0, T, 0, 1, T, T, 0, 1, 0, 1, T)
  259. end if
  260. l = T
  261. call alloc_dt (x, 7, T, 1, 1, T, T, 1, 2, 3, 3, T)
  262. call ver_dt (x, 7, T, 1, 1, T, T, 1, 2, 3, 3, T)
  263. call alloc_dt (y, 20, T, 0, 0, F, T, 2, 2, 3, 4, F)
  264. call ver_dt (y, 20, T, 0, 0, F, T, 2, 2, 3, 4, F)
  265. call alloc_dt (z(-3,2), 7, T, 1, 1, T, T, 1, 2, 3, 3, T)
  266. call ver_dt (z(-3,2), 7, T, 1, 1, T, T, 1, 2, 3, 3, T)
  267. call alloc_dt (z(-3,3), 20, T, 0, 0, F, T, 2, 2, 3, 4, F)
  268. call ver_dt (z(-3,3), 20, T, 0, 0, F, T, 2, 2, 3, 4, F)
  269. !$omp section
  270. if (l) then
  271. call ver_dt (x, 7, T, 1, 1, T, T, 1, 2, 3, 3, T)
  272. call ver_dt (y, 20, T, 0, 0, F, T, 2, 2, 3, 4, F)
  273. call ver_dt (z(-3,2), 7, T, 1, 1, T, T, 1, 2, 3, 3, T)
  274. call ver_dt (z(-3,3), 20, T, 0, 0, F, T, 2, 2, 3, 4, F)
  275. else
  276. call ver_dt (x, 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  277. call ver_dt (y, 0, T, 0, 1, T, T, 0, 1, 0, 1, T)
  278. call ver_dt (z(-3,2), 0, F, 0, 0, F, F, 0, 0, 0, 0, F)
  279. call ver_dt (z(-3,3), 0, T, 0, 1, T, T, 0, 1, 0, 1, T)
  280. end if
  281. l = T
  282. call alloc_dt (x, 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  283. call ver_dt (x, 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  284. call alloc_dt (y, 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  285. call ver_dt (y, 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  286. call alloc_dt (z(-3,2), 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  287. call ver_dt (z(-3,2), 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  288. call alloc_dt (z(-3,3), 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  289. call ver_dt (z(-3,3), 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  290. !$omp section
  291. !$omp end parallel sections
  292. call ver_dt (x, 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  293. call ver_dt (y, 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  294. call ver_dt (z(-3,2), 9, T, 1, 1, F, F, 0, 0, 0, 0, T)
  295. call ver_dt (z(-3,3), 21, F, 0, 0, T, T, 1, 2, 3, 4, T)
  296. !$omp parallel sections lastprivate (x, y, z) firstprivate (l)
  297. !$omp section
  298. if (l) then
  299. call ver_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  300. call ver_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  301. call ver_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  302. call ver_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  303. else
  304. call ver_dt (x, 0, T, 1, 1, F, F, 0, 0, 0, 0, T)
  305. call ver_dt (y, 0, F, 0, 0, T, T, 1, 2, 3, 4, T)
  306. call ver_dt (z(-3,2), 0, T, 1, 1, F, F, 0, 0, 0, 0, T)
  307. call ver_dt (z(-3,3), 0, F, 0, 0, T, T, 1, 2, 3, 4, T)
  308. end if
  309. l = T
  310. call alloc_dt (x, 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  311. call ver_dt (x, 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  312. call alloc_dt (y, 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  313. call ver_dt (y, 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  314. call alloc_dt (z(-3,2), 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  315. call ver_dt (z(-3,2), 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  316. call alloc_dt (z(-3,3), 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  317. call ver_dt (z(-3,3), 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  318. !$omp section
  319. if (l) then
  320. call ver_dt (x, 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  321. call ver_dt (y, 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  322. call ver_dt (z(-3,2), 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  323. call ver_dt (z(-3,3), 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  324. else
  325. call ver_dt (x, 0, T, 1, 1, F, F, 0, 0, 0, 0, T)
  326. call ver_dt (y, 0, F, 0, 0, T, T, 1, 2, 3, 4, T)
  327. call ver_dt (z(-3,2), 0, T, 1, 1, F, F, 0, 0, 0, 0, T)
  328. call ver_dt (z(-3,3), 0, F, 0, 0, T, T, 1, 2, 3, 4, T)
  329. end if
  330. l = T
  331. call alloc_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  332. call ver_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  333. call alloc_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  334. call ver_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  335. call alloc_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  336. call ver_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  337. call alloc_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  338. call ver_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  339. !$omp section
  340. !$omp end parallel sections
  341. call ver_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  342. call ver_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  343. call ver_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  344. call ver_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  345. !$omp parallel private (x, y, z)
  346. call ver_dt (x, 0, F, 0, 0, T, T, -1, -1, -1, -1, T)
  347. call ver_dt (y, 0, T, 0, 1, T, T, 2, 2, 2, 2, F)
  348. call ver_dt (z(-3,2), 0, F, 0, 0, T, T, -1, -1, -1, -1, T)
  349. call ver_dt (z(-3,3), 0, T, 0, 1, T, T, 2, 2, 2, 2, F)
  350. !$omp single
  351. call alloc_dt (x, 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  352. call alloc_dt (y, 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  353. call alloc_dt (z(-3,2), 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  354. call alloc_dt (z(-3,3), 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  355. !$omp end single copyprivate (x, y, z)
  356. call ver_dt (x, 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  357. call ver_dt (y, 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  358. call ver_dt (z(-3,2), 3, F, 0, 0, T, T, 0, 1, 0, 1, F)
  359. call ver_dt (z(-3,3), 22, T, 5, 5, F, T, 2, 3, 2, 2, T)
  360. !$omp end parallel
  361. call ver_dt (x, 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  362. call ver_dt (y, 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  363. call ver_dt (z(-3,2), 5, F, 0, 0, T, T, -1, -1, -1, -1, T)
  364. call ver_dt (z(-3,3), 23, T, 0, 1, T, T, 2, 2, 2, 2, F)
  365. end subroutine foo
  366. end