1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
CBOP |
5 |
|
C !ROUTINE: EXCH_CYCLE_EBL |
6 |
|
|
7 |
|
C !INTERFACE: |
8 |
SUBROUTINE EXCH_CYCLE_EBL( myThid ) |
SUBROUTINE EXCH_CYCLE_EBL( myThid ) |
|
C /==========================================================\ |
|
|
C | SUBROUTINE EXCH_CYCLE_EBL | |
|
|
C | o Cycle exchange buffer level. | |
|
|
C |==========================================================| |
|
|
C | Step the "exchange buffer level" to next value. | |
|
|
C | The buffer level is used to prevent consecutive messages | |
|
|
C | overwriting one another. Because we know that every tile | |
|
|
C | will participate in an exchange we can be sure that every| |
|
|
C | tile will cycle through the buffers with the same | |
|
|
C | sequence. Also we know that a tile cannot start a new | |
|
|
C | exchange before it has completed its end of the previous | |
|
|
C | exchange. Thus by cycling through three buffer levels we | |
|
|
C | can be sure that the buffer we write to will be free. | |
|
|
C | That is by the time we are participating in the third | |
|
|
C | exchange transaction we know that both ends of the first | |
|
|
C | transaction must have completed. | |
|
|
C | Note -- | |
|
|
C | 1. We allow more than three levels below although this | |
|
|
C | is not necessary. | |
|
|
C \==========================================================/ |
|
9 |
IMPLICIT NONE |
IMPLICIT NONE |
10 |
|
|
11 |
|
C !DESCRIPTION: |
12 |
|
C *==========================================================* |
13 |
|
C | SUBROUTINE EXCH_CYCLE_EBL |
14 |
|
C | o Cycle exchange buffer level. |
15 |
|
C *==========================================================* |
16 |
|
C | Step the "exchange buffer level" to next value. |
17 |
|
C | The buffer level is used to prevent consecutive messages |
18 |
|
C | overwriting one another. Because we know that every tile |
19 |
|
C | will participate in an exchange we can be sure that every |
20 |
|
C | tile will cycle through the buffers with the same |
21 |
|
C | sequence. Also we know that a tile cannot start a new |
22 |
|
C | exchange before it has completed its end of the previous |
23 |
|
C | exchange. Thus by cycling through three buffer levels we |
24 |
|
C | can be sure that the buffer we write to will be free. |
25 |
|
C | That is by the time we are participating in the third |
26 |
|
C | exchange transaction we know that both ends of the first |
27 |
|
C | transaction must have completed. |
28 |
|
C | Note -- |
29 |
|
C | 1. We allow more than three levels below although this |
30 |
|
C | is not necessary. |
31 |
|
C *==========================================================* |
32 |
|
|
33 |
|
C !USES: |
34 |
C == Global data == |
C == Global data == |
35 |
#include "SIZE.h" |
#include "SIZE.h" |
36 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
37 |
#include "EESUPPORT.h" |
#include "EESUPPORT.h" |
38 |
#include "EXCH.h" |
#include "EXCH.h" |
39 |
|
|
40 |
|
C !INPUT PARAMETERS: |
41 |
C == Routine arguments == |
C == Routine arguments == |
42 |
C myThid - Thread number of this instance of the routine |
C myThid :: Thread number of this instance of the routine |
43 |
INTEGER myThid |
INTEGER myThid |
44 |
|
|
45 |
|
C !LOCAL VARIABLES: |
46 |
C == Local variables == |
C == Local variables == |
47 |
C bi, bj - Loop counters |
C bi, bj :: Loop counters |
48 |
INTEGER bi, bj |
INTEGER bi, bj |
49 |
|
CEOP |
50 |
|
|
51 |
DO bj=myByLo(myThid),myByHi(myThid) |
DO bj=myByLo(myThid),myByHi(myThid) |
52 |
DO bi=myBxLo(myThid),myBxHi(myThid) |
DO bi=myBxLo(myThid),myBxHi(myThid) |