1 MODULE duplicate_of_driver_constants
2 ! These definitions must be the same as frame/module_driver_constants
3 ! and also the same as the definitions in rsl_lite.h
4 INTEGER , PARAMETER :: DATA_ORDER_XYZ = 1
5 INTEGER , PARAMETER :: DATA_ORDER_YXZ = 2
6 INTEGER , PARAMETER :: DATA_ORDER_ZXY = 3
7 INTEGER , PARAMETER :: DATA_ORDER_ZYX = 4
8 INTEGER , PARAMETER :: DATA_ORDER_XZY = 5
9 INTEGER , PARAMETER :: DATA_ORDER_YZX = 6
10 END MODULE duplicate_of_driver_constants
12 SUBROUTINE f_pack_int ( inbuf, outbuf, memorder, js, je, ks, ke, &
13 & is, ie, jms, jme, kms, kme, ims, ime, curs )
14 USE duplicate_of_driver_constants
16 INTEGER, INTENT(IN) :: memorder
17 INTEGER ims, ime, jms, jme, kms, kme
18 INTEGER inbuf(*), outbuf(*)
19 INTEGER js, je, ks, ke, is, ie, curs
20 SELECT CASE ( memorder )
21 CASE ( DATA_ORDER_XYZ )
22 CALL f_pack_int_ijk( inbuf, outbuf, js, je, ks, ke, is, ie, &
23 & jms, jme, kms, kme, ims, ime, curs )
24 CASE ( DATA_ORDER_YXZ )
25 CALL f_pack_int_jik( inbuf, outbuf, js, je, ks, ke, is, ie, &
26 & jms, jme, kms, kme, ims, ime, curs )
27 CASE ( DATA_ORDER_XZY )
28 CALL f_pack_int_ikj( inbuf, outbuf, js, je, ks, ke, is, ie, &
29 & jms, jme, kms, kme, ims, ime, curs )
30 CASE ( DATA_ORDER_YZX )
31 CALL f_pack_int_jki( inbuf, outbuf, js, je, ks, ke, is, ie, &
32 & jms, jme, kms, kme, ims, ime, curs )
33 CASE ( DATA_ORDER_ZXY )
34 CALL f_pack_int_kij( inbuf, outbuf, js, je, ks, ke, is, ie, &
35 & jms, jme, kms, kme, ims, ime, curs )
36 CASE ( DATA_ORDER_ZYX )
37 CALL f_pack_int_kji( inbuf, outbuf, js, je, ks, ke, is, ie, &
38 & jms, jme, kms, kme, ims, ime, curs )
41 END SUBROUTINE f_pack_int
43 SUBROUTINE f_pack_lint ( inbuf, outbuf, memorder, js, je, ks, ke, &
44 & is, ie, jms, jme, kms, kme, ims, ime, curs )
45 USE duplicate_of_driver_constants
47 INTEGER, INTENT(IN) :: memorder
48 INTEGER jms, jme, kms, kme, ims, ime
49 INTEGER*8 inbuf(*), outbuf(*)
50 INTEGER js, je, ks, ke, is, ie, curs
51 SELECT CASE ( memorder )
52 CASE ( DATA_ORDER_XYZ )
53 CALL f_pack_lint_ijk( inbuf, outbuf, js, je, ks, ke, is, ie, &
54 & jms, jme, kms, kme, ims, ime, curs )
55 CASE ( DATA_ORDER_YXZ )
56 CALL f_pack_lint_jik( inbuf, outbuf, js, je, ks, ke, is, ie, &
57 & jms, jme, kms, kme, ims, ime, curs )
58 CASE ( DATA_ORDER_XZY )
59 CALL f_pack_lint_ikj( inbuf, outbuf, js, je, ks, ke, is, ie, &
60 & jms, jme, kms, kme, ims, ime, curs )
61 CASE ( DATA_ORDER_YZX )
62 CALL f_pack_lint_jki( inbuf, outbuf, js, je, ks, ke, is, ie, &
63 & jms, jme, kms, kme, ims, ime, curs )
64 CASE ( DATA_ORDER_ZXY )
65 CALL f_pack_lint_kij( inbuf, outbuf, js, je, ks, ke, is, ie, &
66 & jms, jme, kms, kme, ims, ime, curs )
67 CASE ( DATA_ORDER_ZYX )
68 CALL f_pack_lint_kji( inbuf, outbuf, js, je, ks, ke, is, ie, &
69 & jms, jme, kms, kme, ims, ime, curs )
72 END SUBROUTINE f_pack_lint
74 SUBROUTINE f_unpack_int ( inbuf, outbuf, memorder, js, je, ks, ke, &
75 & is, ie, jms, jme, kms, kme, ims, ime, curs )
76 USE duplicate_of_driver_constants
78 INTEGER, INTENT(IN) :: memorder
79 INTEGER jms, jme, kms, kme, ims, ime
80 INTEGER outbuf(*), inbuf(*)
81 INTEGER js, je, ks, ke, is, ie, curs
82 SELECT CASE ( memorder )
83 CASE ( DATA_ORDER_XYZ )
84 CALL f_unpack_int_ijk( inbuf, outbuf, js, je, ks, ke, &
85 & is, ie, jms, jme, kms, kme, ims, ime, curs )
86 CASE ( DATA_ORDER_YXZ )
87 CALL f_unpack_int_jik( inbuf, outbuf, js, je, ks, ke, &
88 & is, ie, jms, jme, kms, kme, ims, ime, curs )
89 CASE ( DATA_ORDER_XZY )
90 CALL f_unpack_int_ikj( inbuf, outbuf, js, je, ks, ke, &
91 & is, ie, jms, jme, kms, kme, ims, ime, curs )
92 CASE ( DATA_ORDER_YZX )
93 CALL f_unpack_int_jki( inbuf, outbuf, js, je, ks, ke, &
94 & is, ie, jms, jme, kms, kme, ims, ime, curs )
95 CASE ( DATA_ORDER_ZXY )
96 CALL f_unpack_int_kij( inbuf, outbuf, js, je, ks, ke, &
97 & is, ie, jms, jme, kms, kme, ims, ime, curs )
98 CASE ( DATA_ORDER_ZYX )
99 CALL f_unpack_int_kji( inbuf, outbuf, js, je, ks, ke, &
100 & is, ie, jms, jme, kms, kme, ims, ime, curs )
103 END SUBROUTINE f_unpack_int
105 SUBROUTINE f_unpack_lint ( inbuf, outbuf, memorder, js, je, ks, &
106 & ke, is, ie, jms, jme, kms, kme, ims, ime, curs )
107 USE duplicate_of_driver_constants
109 INTEGER, INTENT(IN) :: memorder
110 INTEGER jms, jme, kms, kme, ims, ime
111 INTEGER*8 outbuf(*), inbuf(*)
112 INTEGER js, je, ks, ke, is, ie, curs
113 SELECT CASE ( memorder )
114 CASE ( DATA_ORDER_XYZ )
115 CALL f_unpack_lint_ijk( inbuf, outbuf, js, je, ks, ke, &
116 & is, ie, jms, jme, kms, kme, ims, ime, curs )
117 CASE ( DATA_ORDER_YXZ )
118 CALL f_unpack_lint_jik( inbuf, outbuf, js, je, ks, ke, &
119 & is, ie, jms, jme, kms, kme, ims, ime, curs )
120 CASE ( DATA_ORDER_XZY )
121 CALL f_unpack_lint_ikj( inbuf, outbuf, js, je, ks, ke, &
122 & is, ie, jms, jme, kms, kme, ims, ime, curs )
123 CASE ( DATA_ORDER_YZX )
124 CALL f_unpack_lint_jki( inbuf, outbuf, js, je, ks, ke, &
125 & is, ie, jms, jme, kms, kme, ims, ime, curs )
126 CASE ( DATA_ORDER_ZXY )
127 CALL f_unpack_lint_kij( inbuf, outbuf, js, je, ks, ke, &
128 & is, ie, jms, jme, kms, kme, ims, ime, curs )
129 CASE ( DATA_ORDER_ZYX )
130 CALL f_unpack_lint_kji( inbuf, outbuf, js, je, ks, ke, &
131 & is, ie, jms, jme, kms, kme, ims, ime, curs )
134 END SUBROUTINE f_unpack_lint
137 SUBROUTINE f_pack_int_ikj ( inbuf, outbuf, js, je, ks, ke, &
138 & is, ie, jms, jme, kms, kme, ims, ime, curs )
140 INTEGER jms, jme, kms, kme, ims, ime
141 INTEGER inbuf(ims:ime,kms:kme,jms:jme), outbuf(*)
142 INTEGER js, je, ks, ke, is, ie, curs
145 !$OMP PARALLEL PRIVATE (i,j,k,p)
149 !$OMP DO SCHEDULE(RUNTIME)
152 p = (j-js)*(ie-is+1)*(ke-ks+1)+1
156 outbuf(p) = inbuf(i,k,j)
164 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
166 END SUBROUTINE f_pack_int_ikj
168 SUBROUTINE f_pack_lint_ikj ( inbuf, outbuf, js, je, ks, ke, &
169 & is, ie, jms, jme, kms, kme, ims, ime, curs )
171 INTEGER jms, jme, kms, kme, ims, ime
172 INTEGER*8 inbuf(ims:ime,kms:kme,jms:jme), outbuf(*)
173 INTEGER js, je, ks, ke, is, ie, curs
176 !$OMP PARALLEL PRIVATE (i,j,k,p)
180 !$OMP DO SCHEDULE(RUNTIME)
183 p = (j-js)*(ie-is+1)*(ke-ks+1)+1
187 outbuf(p) = inbuf(i,k,j)
194 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
196 END SUBROUTINE f_pack_lint_ikj
198 SUBROUTINE f_unpack_int_ikj ( inbuf, outbuf, js, je, ks, ke, &
199 & is, ie, jms, jme, kms, kme, ims, ime, curs )
201 INTEGER jms, jme, kms, kme, ims, ime
202 INTEGER outbuf(ims:ime,kms:kme,jms:jme), inbuf(*)
203 INTEGER js, je, ks, ke, is, ie, curs
206 !$OMP PARALLEL PRIVATE (i,j,k,p)
210 !$OMP DO SCHEDULE(RUNTIME)
213 p = (j-js)*(ie-is+1)*(ke-ks+1)+1
217 outbuf(i,k,j) = inbuf(p)
224 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
226 END SUBROUTINE f_unpack_int_ikj
228 SUBROUTINE f_unpack_lint_ikj ( inbuf, outbuf, js, je, ks, ke, &
229 & is, ie, jms, jme, kms, kme, ims, ime, curs )
231 INTEGER jms, jme, kms, kme, ims, ime
232 INTEGER*8 outbuf(ims:ime,kms:kme,jms:jme), inbuf(*)
233 INTEGER js, je, ks, ke, is, ie, curs
236 !$OMP PARALLEL PRIVATE (i,j,k,p)
240 !$OMP DO SCHEDULE(RUNTIME)
243 p = (j-js)*(ie-is+1)*(ke-ks+1)+1
247 outbuf(i,k,j) = inbuf(p)
254 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
256 END SUBROUTINE f_unpack_lint_ikj
259 SUBROUTINE f_pack_int_jki ( inbuf, outbuf, js, je, ks, ke, &
260 & is, ie, jms, jme, kms, kme, ims, ime, curs )
262 INTEGER jms, jme, kms, kme, ims, ime
263 INTEGER inbuf(jms:jme,kms:kme,ims:ime), outbuf(*)
264 INTEGER js, je, ks, ke, is, ie, curs
267 !$OMP PARALLEL PRIVATE (i,j,k,p)
271 !$OMP DO SCHEDULE(RUNTIME)
274 p = (i-is)*(je-js+1)*(ke-ks+1)+1
278 outbuf(p) = inbuf(j,k,i)
285 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
287 END SUBROUTINE f_pack_int_jki
289 SUBROUTINE f_pack_lint_jki ( inbuf, outbuf, js, je, ks, ke, &
290 & is, ie, jms, jme, kms, kme, ims, ime, curs )
292 INTEGER jms, jme, kms, kme, ims, ime
293 INTEGER*8 inbuf(jms:jme,kms:kme,ims:ime), outbuf(*)
294 INTEGER js, je, ks, ke, is, ie, curs
297 !$OMP PARALLEL PRIVATE (i,j,k,p)
301 !$OMP DO SCHEDULE(RUNTIME)
304 p = (i-is)*(je-js+1)*(ke-ks+1)+1
308 outbuf(p) = inbuf(j,k,i)
315 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
317 END SUBROUTINE f_pack_lint_jki
319 SUBROUTINE f_unpack_int_jki ( inbuf, outbuf, js, je, ks, ke, &
320 & is, ie, jms, jme, kms, kme, ims, ime, curs )
322 INTEGER jms, jme, kms, kme, ims, ime
323 INTEGER outbuf(jms:jme,kms:kme,ims:ime), inbuf(*)
324 INTEGER js, je, ks, ke, is, ie, curs
327 !$OMP PARALLEL PRIVATE (i,j,k,p)
331 !$OMP DO SCHEDULE(RUNTIME)
334 p = (i-is)*(je-js+1)*(ke-ks+1)+1
338 outbuf(j,k,i) = inbuf(p)
345 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
347 END SUBROUTINE f_unpack_int_jki
349 SUBROUTINE f_unpack_lint_jki ( inbuf, outbuf, js, je, ks, ke, &
350 & is, ie, jms, jme, kms, kme, ims, ime, curs )
352 INTEGER jms, jme, kms, kme, ims, ime
353 INTEGER*8 outbuf(jms:jme,kms:kme,ims:ime), inbuf(*)
354 INTEGER js, je, ks, ke, is, ie, curs
357 !$OMP PARALLEL PRIVATE (i,j,k,p)
361 !$OMP DO SCHEDULE(RUNTIME)
364 p = (i-is)*(je-js+1)*(ke-ks+1)+1
368 outbuf(j,k,i) = inbuf(p)
375 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
377 END SUBROUTINE f_unpack_lint_jki
380 SUBROUTINE f_pack_int_ijk ( inbuf, outbuf, js, je, ks, ke, &
381 & is, ie, jms, jme, kms, kme, ims, ime, curs )
383 INTEGER jms, jme, kms, kme, ims, ime
384 INTEGER inbuf(ims:ime,jms:jme,kms:kme), outbuf(*)
385 INTEGER js, je, ks, ke, is, ie, curs
388 !$OMP PARALLEL PRIVATE (i,j,k,p)
392 !$OMP DO SCHEDULE(RUNTIME)
395 p = (k-ks)*(je-js+1)*(ie-is+1)+1
399 outbuf(p) = inbuf(i,j,k)
406 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
408 END SUBROUTINE f_pack_int_ijk
410 SUBROUTINE f_pack_lint_ijk ( inbuf, outbuf, js, je, ks, ke, &
411 & is, ie, jms, jme, kms, kme, ims, ime, curs )
413 INTEGER jms, jme, kms, kme, ims, ime
414 INTEGER*8 inbuf(ims:ime,jms:jme,kms:kme), outbuf(*)
415 INTEGER js, je, ks, ke, is, ie, curs
418 !$OMP PARALLEL PRIVATE (i,j,k,p)
422 !$OMP DO SCHEDULE(RUNTIME)
425 p = (k-ks)*(je-js+1)*(ie-is+1)+1
429 outbuf(p) = inbuf(i,j,k)
436 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
438 END SUBROUTINE f_pack_lint_ijk
440 SUBROUTINE f_unpack_int_ijk ( inbuf, outbuf, js, je, ks, ke, &
441 & is, ie, jms, jme, kms, kme, ims, ime, curs )
443 INTEGER jms, jme, kms, kme, ims, ime
444 INTEGER outbuf(ims:ime,jms:jme,kms:kme), inbuf(*)
445 INTEGER js, je, ks, ke, is, ie, curs
448 !$OMP PARALLEL PRIVATE (i,j,k,p)
452 !$OMP DO SCHEDULE(RUNTIME)
455 p = (k-ks)*(je-js+1)*(ie-is+1)+1
459 outbuf(i,j,k) = inbuf(p)
466 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
468 END SUBROUTINE f_unpack_int_ijk
470 SUBROUTINE f_unpack_lint_ijk ( inbuf, outbuf, js, je, ks, ke, &
471 & is, ie, jms, jme, kms, kme, ims, ime, curs )
473 INTEGER jms, jme, kms, kme, ims, ime
474 INTEGER*8 outbuf(ims:ime,jms:jme,kms:kme), inbuf(*)
475 INTEGER js, je, ks, ke, is, ie, curs
478 !$OMP PARALLEL PRIVATE (i,j,k,p)
482 !$OMP DO SCHEDULE(RUNTIME)
485 p = (k-ks)*(je-js+1)*(ie-is+1)+1
489 outbuf(i,j,k) = inbuf(p)
496 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
498 END SUBROUTINE f_unpack_lint_ijk
501 SUBROUTINE f_pack_int_jik ( inbuf, outbuf, js, je, ks, ke, &
502 & is, ie, jms, jme, kms, kme, ims, ime, curs )
504 INTEGER jms, jme, kms, kme, ims, ime
505 INTEGER inbuf(jms:jme,ims:ime,kms:kme), outbuf(*)
506 INTEGER js, je, ks, ke, is, ie, curs
509 !$OMP PARALLEL PRIVATE (i,j,k,p)
513 !$OMP DO SCHEDULE(RUNTIME)
516 p = (k-ks)*(je-js+1)*(ie-is+1)+1
520 outbuf(p) = inbuf(j,i,k)
527 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
529 END SUBROUTINE f_pack_int_jik
531 SUBROUTINE f_pack_lint_jik ( inbuf, outbuf, js, je, ks, ke, &
532 & is, ie, jms, jme, kms, kme, ims, ime, curs )
534 INTEGER jms, jme, kms, kme, ims, ime
535 INTEGER*8 inbuf(jms:jme,ims:ime,kms:kme), outbuf(*)
536 INTEGER js, je, ks, ke, is, ie, curs
539 !$OMP PARALLEL PRIVATE (i,j,k,p)
543 !$OMP DO SCHEDULE(RUNTIME)
546 p = (k-ks)*(je-js+1)*(ie-is+1)+1
550 outbuf(p) = inbuf(j,i,k)
557 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
559 END SUBROUTINE f_pack_lint_jik
561 SUBROUTINE f_unpack_int_jik ( inbuf, outbuf, js, je, ks, ke, &
562 & is, ie, jms, jme, kms, kme, ims, ime, curs )
564 INTEGER jms, jme, kms, kme, ims, ime
565 INTEGER outbuf(jms:jme,ims:ime,kms:kme), inbuf(*)
566 INTEGER js, je, ks, ke, is, ie, curs
569 !$OMP PARALLEL PRIVATE (i,j,k,p)
573 !$OMP DO SCHEDULE(RUNTIME)
576 p = (k-ks)*(je-js+1)*(ie-is+1)+1
580 outbuf(j,i,k) = inbuf(p)
587 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
589 END SUBROUTINE f_unpack_int_jik
591 SUBROUTINE f_unpack_lint_jik ( inbuf, outbuf, js, je, ks, ke, &
592 & is, ie, jms, jme, kms, kme, ims, ime, curs )
594 INTEGER jms, jme, kms, kme, ims, ime
595 INTEGER*8 outbuf(jms:jme,ims:ime,kms:kme), inbuf(*)
596 INTEGER js, je, ks, ke, is, ie, curs
599 !$OMP PARALLEL PRIVATE (i,j,k,p)
603 !$OMP DO SCHEDULE(RUNTIME)
606 p = (k-ks)*(je-js+1)*(ie-is+1)+1
610 outbuf(j,i,k) = inbuf(p)
617 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
619 END SUBROUTINE f_unpack_lint_jik
622 SUBROUTINE f_pack_int_kij ( inbuf, outbuf, js, je, ks, ke, &
623 & is, ie, jms, jme, kms, kme, ims, ime, curs )
625 INTEGER jms, jme, kms, kme, ims, ime
626 INTEGER inbuf(kms:kme,ims:ime,jms:jme), outbuf(*)
627 INTEGER js, je, ks, ke, is, ie, curs
630 !$OMP PARALLEL PRIVATE (i,j,k,p)
634 !$OMP DO SCHEDULE(RUNTIME)
637 p = (j-js)*(ke-ks+1)*(ie-is+1)+1
641 outbuf(p) = inbuf(k,i,j)
648 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
650 END SUBROUTINE f_pack_int_kij
652 SUBROUTINE f_pack_lint_kij ( inbuf, outbuf, js, je, ks, ke, &
653 & is, ie, jms, jme, kms, kme, ims, ime, curs )
655 INTEGER jms, jme, kms, kme, ims, ime
656 INTEGER*8 inbuf(kms:kme,ims:ime,jms:jme), outbuf(*)
657 INTEGER js, je, ks, ke, is, ie, curs
660 !$OMP PARALLEL PRIVATE (i,j,k,p)
664 !$OMP DO SCHEDULE(RUNTIME)
667 p = (j-js)*(ke-ks+1)*(ie-is+1)+1
671 outbuf(p) = inbuf(k,i,j)
678 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
680 END SUBROUTINE f_pack_lint_kij
682 SUBROUTINE f_unpack_int_kij ( inbuf, outbuf, js, je, ks, ke, &
683 & is, ie, jms, jme, kms, kme, ims, ime, curs )
685 INTEGER jms, jme, kms, kme, ims, ime
686 INTEGER outbuf(kms:kme,ims:ime,jms:jme), inbuf(*)
687 INTEGER js, je, ks, ke, is, ie, curs
690 !$OMP PARALLEL PRIVATE (i,j,k,p)
694 !$OMP DO SCHEDULE(RUNTIME)
697 p = (j-js)*(ke-ks+1)*(ie-is+1)+1
701 outbuf(k,i,j) = inbuf(p)
708 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
710 END SUBROUTINE f_unpack_int_kij
712 SUBROUTINE f_unpack_lint_kij ( inbuf, outbuf, js, je, ks, ke, &
713 & is, ie, jms, jme, kms, kme, ims, ime, curs )
715 INTEGER jms, jme, kms, kme, ims, ime
716 INTEGER*8 outbuf(kms:kme,ims:ime,jms:jme), inbuf(*)
717 INTEGER js, je, ks, ke, is, ie, curs
720 !$OMP PARALLEL PRIVATE (i,j,k,p)
724 !$OMP DO SCHEDULE(RUNTIME)
727 p = (j-js)*(ke-ks+1)*(ie-is+1)+1
731 outbuf(k,i,j) = inbuf(p)
738 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
740 END SUBROUTINE f_unpack_lint_kij
743 SUBROUTINE f_pack_int_kji ( inbuf, outbuf, js, je, ks, ke, &
744 & is, ie, jms, jme, kms, kme, ims, ime, curs )
746 INTEGER jms, jme, kms, kme, ims, ime
747 INTEGER inbuf(kms:kme,jms:jme,ims:ime), outbuf(*)
748 INTEGER js, je, ks, ke, is, ie, curs
751 !$OMP PARALLEL PRIVATE (i,j,k,p)
755 !$OMP DO SCHEDULE(RUNTIME)
758 p = (i-is)*(ke-ks+1)*(je-js+1)+1
762 outbuf(p) = inbuf(k,j,i)
769 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
771 END SUBROUTINE f_pack_int_kji
773 SUBROUTINE f_pack_lint_kji ( inbuf, outbuf, js, je, ks, ke, &
774 & is, ie, jms, jme, kms, kme, ims, ime, curs )
776 INTEGER jms, jme, kms, kme, ims, ime
777 INTEGER*8 inbuf(kms:kme,jms:jme,ims:ime), outbuf(*)
778 INTEGER js, je, ks, ke, is, ie, curs
781 !$OMP PARALLEL PRIVATE (i,j,k,p)
785 !$OMP DO SCHEDULE(RUNTIME)
788 p = (i-is)*(ke-ks+1)*(je-js+1)+1
792 outbuf(p) = inbuf(k,j,i)
799 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
801 END SUBROUTINE f_pack_lint_kji
803 SUBROUTINE f_unpack_int_kji ( inbuf, outbuf, js, je, ks, ke, &
804 & is, ie, jms, jme, kms, kme, ims, ime, curs )
806 INTEGER jms, jme, kms, kme, ims, ime
807 INTEGER outbuf(kms:kme,jms:jme,ims:ime), inbuf(*)
808 INTEGER js, je, ks, ke, is, ie, curs
811 !$OMP PARALLEL PRIVATE (i,j,k,p)
815 !$OMP DO SCHEDULE(RUNTIME)
818 p = (i-is)*(ke-ks+1)*(je-js+1)+1
822 outbuf(k,j,i) = inbuf(p)
829 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
831 END SUBROUTINE f_unpack_int_kji
833 SUBROUTINE f_unpack_lint_kji ( inbuf, outbuf, js, je, ks, ke, &
834 & is, ie, jms, jme, kms, kme, ims, ime, curs )
836 INTEGER jms, jme, kms, kme, ims, ime
837 INTEGER*8 outbuf(kms:kme,jms:jme,ims:ime), inbuf(*)
838 INTEGER js, je, ks, ke, is, ie, curs
841 !$OMP PARALLEL PRIVATE (i,j,k,p)
845 !$OMP DO SCHEDULE(RUNTIME)
848 p = (i-is)*(ke-ks+1)*(je-js+1)+1
852 outbuf(k,j,i) = inbuf(p)
859 curs = (ie-is+1)*(je-js+1)*(ke-ks+1)
861 END SUBROUTINE f_unpack_lint_kji
864 !--------------------------------------------------------------------------------
865 SUBROUTINE f_pack_int_ad ( inbuf, outbuf, memorder, js, je, ks, ke, &
866 & is, ie, jms, jme, kms, kme, ims, ime, curs )
867 USE duplicate_of_driver_constants
869 INTEGER, INTENT(IN) :: memorder
870 INTEGER ims, ime, jms, jme, kms, kme
871 INTEGER inbuf(*), outbuf(*)
872 INTEGER js, je, ks, ke, is, ie, curs
873 SELECT CASE ( memorder )
874 CASE ( DATA_ORDER_XYZ )
875 CALL f_pack_real_ad_ijk( inbuf, outbuf, js, je, ks, ke, is, ie, &
876 & jms, jme, kms, kme, ims, ime, curs )
877 CASE ( DATA_ORDER_YXZ )
878 CALL f_pack_real_ad_jik( inbuf, outbuf, js, je, ks, ke, is, ie, &
879 & jms, jme, kms, kme, ims, ime, curs )
880 CASE ( DATA_ORDER_XZY )
881 CALL f_pack_real_ad_ikj( inbuf, outbuf, js, je, ks, ke, is, ie, &
882 & jms, jme, kms, kme, ims, ime, curs )
883 CASE ( DATA_ORDER_YZX )
884 CALL f_pack_real_ad_jki( inbuf, outbuf, js, je, ks, ke, is, ie, &
885 & jms, jme, kms, kme, ims, ime, curs )
886 CASE ( DATA_ORDER_ZXY )
887 CALL f_pack_real_ad_kij( inbuf, outbuf, js, je, ks, ke, is, ie, &
888 & jms, jme, kms, kme, ims, ime, curs )
889 CASE ( DATA_ORDER_ZYX )
890 CALL f_pack_real_ad_kji( inbuf, outbuf, js, je, ks, ke, is, ie, &
891 & jms, jme, kms, kme, ims, ime, curs )
894 END SUBROUTINE f_pack_int_ad
896 SUBROUTINE f_pack_lint_ad ( inbuf, outbuf, memorder, js, je, ks, ke, &
897 & is, ie, jms, jme, kms, kme, ims, ime, curs )
898 USE duplicate_of_driver_constants
900 INTEGER, INTENT(IN) :: memorder
901 INTEGER jms, jme, kms, kme, ims, ime
902 INTEGER*8 inbuf(*), outbuf(*)
903 INTEGER js, je, ks, ke, is, ie, curs
904 SELECT CASE ( memorder )
905 CASE ( DATA_ORDER_XYZ )
906 CALL f_pack_lreal_ad_ijk( inbuf, outbuf, js, je, ks, ke, is, ie, &
907 & jms, jme, kms, kme, ims, ime, curs )
908 CASE ( DATA_ORDER_YXZ )
909 CALL f_pack_lreal_ad_jik( inbuf, outbuf, js, je, ks, ke, is, ie, &
910 & jms, jme, kms, kme, ims, ime, curs )
911 CASE ( DATA_ORDER_XZY )
912 CALL f_pack_lreal_ad_ikj( inbuf, outbuf, js, je, ks, ke, is, ie, &
913 & jms, jme, kms, kme, ims, ime, curs )
914 CASE ( DATA_ORDER_YZX )
915 CALL f_pack_lreal_ad_jki( inbuf, outbuf, js, je, ks, ke, is, ie, &
916 & jms, jme, kms, kme, ims, ime, curs )
917 CASE ( DATA_ORDER_ZXY )
918 CALL f_pack_lreal_ad_kij( inbuf, outbuf, js, je, ks, ke, is, ie, &
919 & jms, jme, kms, kme, ims, ime, curs )
920 CASE ( DATA_ORDER_ZYX )
921 CALL f_pack_lreal_ad_kji( inbuf, outbuf, js, je, ks, ke, is, ie, &
922 & jms, jme, kms, kme, ims, ime, curs )
925 END SUBROUTINE f_pack_lint_ad
927 SUBROUTINE f_unpack_int_ad ( inbuf, outbuf, memorder, js, je, ks, ke, &
928 & is, ie, jms, jme, kms, kme, ims, ime, curs )
929 USE duplicate_of_driver_constants
931 INTEGER, INTENT(IN) :: memorder
932 INTEGER jms, jme, kms, kme, ims, ime
933 INTEGER outbuf(*), inbuf(*)
934 INTEGER js, je, ks, ke, is, ie, curs
935 SELECT CASE ( memorder )
936 CASE ( DATA_ORDER_XYZ )
937 CALL f_unpack_real_ad_ijk( inbuf, outbuf, js, je, ks, ke, &
938 & is, ie, jms, jme, kms, kme, ims, ime, curs )
939 CASE ( DATA_ORDER_YXZ )
940 CALL f_unpack_real_ad_jik( inbuf, outbuf, js, je, ks, ke, &
941 & is, ie, jms, jme, kms, kme, ims, ime, curs )
942 CASE ( DATA_ORDER_XZY )
943 CALL f_unpack_real_ad_ikj( inbuf, outbuf, js, je, ks, ke, &
944 & is, ie, jms, jme, kms, kme, ims, ime, curs )
945 CASE ( DATA_ORDER_YZX )
946 CALL f_unpack_real_ad_jki( inbuf, outbuf, js, je, ks, ke, &
947 & is, ie, jms, jme, kms, kme, ims, ime, curs )
948 CASE ( DATA_ORDER_ZXY )
949 CALL f_unpack_real_ad_kij( inbuf, outbuf, js, je, ks, ke, &
950 & is, ie, jms, jme, kms, kme, ims, ime, curs )
951 CASE ( DATA_ORDER_ZYX )
952 CALL f_unpack_real_ad_kji( inbuf, outbuf, js, je, ks, ke, &
953 & is, ie, jms, jme, kms, kme, ims, ime, curs )
956 END SUBROUTINE f_unpack_int_ad
958 SUBROUTINE f_unpack_lint_ad ( inbuf, outbuf, memorder, js, je, ks, &
959 & ke, is, ie, jms, jme, kms, kme, ims, ime, curs )
960 USE duplicate_of_driver_constants
962 INTEGER, INTENT(IN) :: memorder
963 INTEGER jms, jme, kms, kme, ims, ime
964 INTEGER*8 outbuf(*), inbuf(*)
965 INTEGER js, je, ks, ke, is, ie, curs
966 SELECT CASE ( memorder )
967 CASE ( DATA_ORDER_XYZ )
968 CALL f_unpack_lreal_ad_ijk( inbuf, outbuf, js, je, ks, ke, &
969 & is, ie, jms, jme, kms, kme, ims, ime, curs )
970 CASE ( DATA_ORDER_YXZ )
971 CALL f_unpack_lreal_ad_jik( inbuf, outbuf, js, je, ks, ke, &
972 & is, ie, jms, jme, kms, kme, ims, ime, curs )
973 CASE ( DATA_ORDER_XZY )
974 CALL f_unpack_lreal_ad_ikj( inbuf, outbuf, js, je, ks, ke, &
975 & is, ie, jms, jme, kms, kme, ims, ime, curs )
976 CASE ( DATA_ORDER_YZX )
977 CALL f_unpack_lreal_ad_jki( inbuf, outbuf, js, je, ks, ke, &
978 & is, ie, jms, jme, kms, kme, ims, ime, curs )
979 CASE ( DATA_ORDER_ZXY )
980 CALL f_unpack_lreal_ad_kij( inbuf, outbuf, js, je, ks, ke, &
981 & is, ie, jms, jme, kms, kme, ims, ime, curs )
982 CASE ( DATA_ORDER_ZYX )
983 CALL f_unpack_lreal_ad_kji( inbuf, outbuf, js, je, ks, ke, &
984 & is, ie, jms, jme, kms, kme, ims, ime, curs )
987 END SUBROUTINE f_unpack_lint_ad
990 SUBROUTINE f_pack_real_ad_ikj ( inbuf, outbuf, js, je, ks, ke, &
991 & is, ie, jms, jme, kms, kme, ims, ime, curs )
993 INTEGER jms, jme, kms, kme, ims, ime
994 REAL inbuf(ims:ime,kms:kme,jms:jme), outbuf(*)
995 INTEGER js, je, ks, ke, is, ie, curs
1002 outbuf(p) = inbuf(i,k,j)
1010 END SUBROUTINE f_pack_real_ad_ikj
1012 SUBROUTINE f_pack_lreal_ad_ikj ( inbuf, outbuf, js, je, ks, ke, &
1013 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1015 INTEGER jms, jme, kms, kme, ims, ime
1016 REAL*8 inbuf(ims:ime,kms:kme,jms:jme), outbuf(*)
1017 INTEGER js, je, ks, ke, is, ie, curs
1024 outbuf(p) = inbuf(i,k,j)
1032 END SUBROUTINE f_pack_lreal_ad_ikj
1034 SUBROUTINE f_unpack_real_ad_ikj ( inbuf, outbuf, js, je, ks, ke, &
1035 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1037 INTEGER jms, jme, kms, kme, ims, ime
1038 REAL outbuf(ims:ime,kms:kme,jms:jme), inbuf(*)
1039 INTEGER js, je, ks, ke, is, ie, curs
1046 outbuf(i,k,j) = outbuf(i,k,j) + inbuf(p)
1053 END SUBROUTINE f_unpack_real_ad_ikj
1055 SUBROUTINE f_unpack_lreal_ad_ikj ( inbuf, outbuf, js, je, ks, ke, &
1056 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1058 INTEGER jms, jme, kms, kme, ims, ime
1059 REAL*8 outbuf(ims:ime,kms:kme,jms:jme), inbuf(*)
1060 INTEGER js, je, ks, ke, is, ie, curs
1067 outbuf(i,k,j) = outbuf(i,k,j) + inbuf(p)
1074 END SUBROUTINE f_unpack_lreal_ad_ikj
1077 SUBROUTINE f_pack_real_ad_jki ( inbuf, outbuf, js, je, ks, ke, &
1078 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1080 INTEGER jms, jme, kms, kme, ims, ime
1081 REAL inbuf(jms:jme,kms:kme,ims:ime), outbuf(*)
1082 INTEGER js, je, ks, ke, is, ie, curs
1089 outbuf(p) = inbuf(j,k,i)
1097 END SUBROUTINE f_pack_real_ad_jki
1099 SUBROUTINE f_pack_lreal_ad_jki ( inbuf, outbuf, js, je, ks, ke, &
1100 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1102 INTEGER jms, jme, kms, kme, ims, ime
1103 REAL*8 inbuf(jms:jme,kms:kme,ims:ime), outbuf(*)
1104 INTEGER js, je, ks, ke, is, ie, curs
1111 outbuf(p) = inbuf(j,k,i)
1119 END SUBROUTINE f_pack_lreal_ad_jki
1121 SUBROUTINE f_unpack_real_ad_jki ( inbuf, outbuf, js, je, ks, ke, &
1122 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1124 INTEGER jms, jme, kms, kme, ims, ime
1125 REAL outbuf(jms:jme,kms:kme,ims:ime), inbuf(*)
1126 INTEGER js, je, ks, ke, is, ie, curs
1133 outbuf(j,k,i) = outbuf(j,k,i) + inbuf(p)
1140 END SUBROUTINE f_unpack_real_ad_jki
1142 SUBROUTINE f_unpack_lreal_ad_jki ( inbuf, outbuf, js, je, ks, ke, &
1143 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1145 INTEGER jms, jme, kms, kme, ims, ime
1146 REAL*8 outbuf(jms:jme,kms:kme,ims:ime), inbuf(*)
1147 INTEGER js, je, ks, ke, is, ie, curs
1154 outbuf(j,k,i) = outbuf(j,k,i) + inbuf(p)
1161 END SUBROUTINE f_unpack_lreal_ad_jki
1164 SUBROUTINE f_pack_real_ad_ijk ( inbuf, outbuf, js, je, ks, ke, &
1165 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1167 INTEGER jms, jme, kms, kme, ims, ime
1168 REAL inbuf(ims:ime,jms:jme,kms:kme), outbuf(*)
1169 INTEGER js, je, ks, ke, is, ie, curs
1176 outbuf(p) = inbuf(i,j,k)
1184 END SUBROUTINE f_pack_real_ad_ijk
1186 SUBROUTINE f_pack_lreal_ad_ijk ( inbuf, outbuf, js, je, ks, ke, &
1187 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1189 INTEGER jms, jme, kms, kme, ims, ime
1190 REAL*8 inbuf(ims:ime,jms:jme,kms:kme), outbuf(*)
1191 INTEGER js, je, ks, ke, is, ie, curs
1198 outbuf(p) = inbuf(i,j,k)
1206 END SUBROUTINE f_pack_lreal_ad_ijk
1208 SUBROUTINE f_unpack_real_ad_ijk ( inbuf, outbuf, js, je, ks, ke, &
1209 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1211 INTEGER jms, jme, kms, kme, ims, ime
1212 REAL outbuf(ims:ime,jms:jme,kms:kme), inbuf(*)
1213 INTEGER js, je, ks, ke, is, ie, curs
1220 outbuf(i,j,k) = outbuf(i,j,k) + inbuf(p)
1227 END SUBROUTINE f_unpack_real_ad_ijk
1229 SUBROUTINE f_unpack_lreal_ad_ijk ( inbuf, outbuf, js, je, ks, ke, &
1230 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1232 INTEGER jms, jme, kms, kme, ims, ime
1233 REAL*8 outbuf(ims:ime,jms:jme,kms:kme), inbuf(*)
1234 INTEGER js, je, ks, ke, is, ie, curs
1241 outbuf(i,j,k) = outbuf(i,j,k) + inbuf(p)
1248 END SUBROUTINE f_unpack_lreal_ad_ijk
1251 SUBROUTINE f_pack_real_ad_jik ( inbuf, outbuf, js, je, ks, ke, &
1252 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1254 INTEGER jms, jme, kms, kme, ims, ime
1255 REAL inbuf(jms:jme,ims:ime,kms:kme), outbuf(*)
1256 INTEGER js, je, ks, ke, is, ie, curs
1263 outbuf(p) = inbuf(j,i,k)
1271 END SUBROUTINE f_pack_real_ad_jik
1273 SUBROUTINE f_pack_lreal_ad_jik ( inbuf, outbuf, js, je, ks, ke, &
1274 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1276 INTEGER jms, jme, kms, kme, ims, ime
1277 REAL*8 inbuf(jms:jme,ims:ime,kms:kme), outbuf(*)
1278 INTEGER js, je, ks, ke, is, ie, curs
1285 outbuf(p) = inbuf(j,i,k)
1293 END SUBROUTINE f_pack_lreal_ad_jik
1295 SUBROUTINE f_unpack_real_ad_jik ( inbuf, outbuf, js, je, ks, ke, &
1296 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1298 INTEGER jms, jme, kms, kme, ims, ime
1299 REAL outbuf(jms:jme,ims:ime,kms:kme), inbuf(*)
1300 INTEGER js, je, ks, ke, is, ie, curs
1307 outbuf(j,i,k) = outbuf(j,i,k) + inbuf(p)
1314 END SUBROUTINE f_unpack_real_ad_jik
1316 SUBROUTINE f_unpack_lreal_ad_jik ( inbuf, outbuf, js, je, ks, ke, &
1317 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1319 INTEGER jms, jme, kms, kme, ims, ime
1320 REAL*8 outbuf(jms:jme,ims:ime,kms:kme), inbuf(*)
1321 INTEGER js, je, ks, ke, is, ie, curs
1328 outbuf(j,i,k) = outbuf(j,i,k) + inbuf(p)
1335 END SUBROUTINE f_unpack_lreal_ad_jik
1338 SUBROUTINE f_pack_real_ad_kij ( inbuf, outbuf, js, je, ks, ke, &
1339 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1341 INTEGER jms, jme, kms, kme, ims, ime
1342 REAL inbuf(kms:kme,ims:ime,jms:jme), outbuf(*)
1343 INTEGER js, je, ks, ke, is, ie, curs
1350 outbuf(p) = inbuf(k,i,j)
1358 END SUBROUTINE f_pack_real_ad_kij
1360 SUBROUTINE f_pack_lreal_ad_kij ( inbuf, outbuf, js, je, ks, ke, &
1361 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1363 INTEGER jms, jme, kms, kme, ims, ime
1364 REAL*8 inbuf(kms:kme,ims:ime,jms:jme), outbuf(*)
1365 INTEGER js, je, ks, ke, is, ie, curs
1372 outbuf(p) = inbuf(k,i,j)
1380 END SUBROUTINE f_pack_lreal_ad_kij
1382 SUBROUTINE f_unpack_real_ad_kij ( inbuf, outbuf, js, je, ks, ke, &
1383 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1385 INTEGER jms, jme, kms, kme, ims, ime
1386 REAL outbuf(kms:kme,ims:ime,jms:jme), inbuf(*)
1387 INTEGER js, je, ks, ke, is, ie, curs
1394 outbuf(k,i,j) = outbuf(k,i,j) + inbuf(p)
1401 END SUBROUTINE f_unpack_real_ad_kij
1403 SUBROUTINE f_unpack_lreal_ad_kij ( inbuf, outbuf, js, je, ks, ke, &
1404 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1406 INTEGER jms, jme, kms, kme, ims, ime
1407 REAL*8 outbuf(kms:kme,ims:ime,jms:jme), inbuf(*)
1408 INTEGER js, je, ks, ke, is, ie, curs
1415 outbuf(k,i,j) = outbuf(k,i,j) + inbuf(p)
1422 END SUBROUTINE f_unpack_lreal_ad_kij
1425 SUBROUTINE f_pack_real_ad_kji ( inbuf, outbuf, js, je, ks, ke, &
1426 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1428 INTEGER jms, jme, kms, kme, ims, ime
1429 REAL inbuf(kms:kme,jms:jme,ims:ime), outbuf(*)
1430 INTEGER js, je, ks, ke, is, ie, curs
1437 outbuf(p) = inbuf(k,j,i)
1445 END SUBROUTINE f_pack_real_ad_kji
1447 SUBROUTINE f_pack_lreal_ad_kji ( inbuf, outbuf, js, je, ks, ke, &
1448 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1450 INTEGER jms, jme, kms, kme, ims, ime
1451 REAL*8 inbuf(kms:kme,jms:jme,ims:ime), outbuf(*)
1452 INTEGER js, je, ks, ke, is, ie, curs
1459 outbuf(p) = inbuf(k,j,i)
1467 END SUBROUTINE f_pack_lreal_ad_kji
1469 SUBROUTINE f_unpack_real_ad_kji ( inbuf, outbuf, js, je, ks, ke, &
1470 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1472 INTEGER jms, jme, kms, kme, ims, ime
1473 REAL outbuf(kms:kme,jms:jme,ims:ime), inbuf(*)
1474 INTEGER js, je, ks, ke, is, ie, curs
1481 outbuf(k,j,i) = outbuf(k,j,i) + inbuf(p)
1488 END SUBROUTINE f_unpack_real_ad_kji
1490 SUBROUTINE f_unpack_lreal_ad_kji ( inbuf, outbuf, js, je, ks, ke, &
1491 & is, ie, jms, jme, kms, kme, ims, ime, curs )
1493 INTEGER jms, jme, kms, kme, ims, ime
1494 REAL*8 outbuf(kms:kme,jms:jme,ims:ime), inbuf(*)
1495 INTEGER js, je, ks, ke, is, ie, curs
1502 outbuf(k,j,i) = outbuf(k,j,i) + inbuf(p)
1509 END SUBROUTINE f_unpack_lreal_ad_kji