Back to home page

MITgcm

 
 

    


File indexing completed on 2018-03-02 18:36:08 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
d4318425b4 Patr*0001 #include "CPP_EEOPTIONS.h"
                0002 
4c563c2ee9 Chri*0003 CBOP
                0004 C     !ROUTINE: EXCH_CYCLE_EBL
                0005 
                0006 C     !INTERFACE:
048ce7bdb7 Chri*0007       SUBROUTINE EXCH_CYCLE_EBL( myThid )
                0008       IMPLICIT NONE
4c563c2ee9 Chri*0009 
                0010 C     !DESCRIPTION:
                0011 C     *==========================================================*
2b4c849245 Ed H*0012 C     | SUBROUTINE EXCH\_CYCLE\_EBL                                 
4c563c2ee9 Chri*0013 C     | o Cycle exchange buffer level.                            
                0014 C     *==========================================================*
                0015 C     | Step the "exchange buffer level" to next value.           
                0016 C     | The buffer level is used to prevent consecutive messages  
                0017 C     | overwriting one another. Because we know that every tile  
                0018 C     | will participate in an exchange we can be sure that every 
                0019 C     | tile will cycle through the buffers with the same         
                0020 C     | sequence. Also we know that a tile cannot start a new     
                0021 C     | exchange before it has completed its end of the previous  
                0022 C     | exchange. Thus by cycling through three buffer levels we  
                0023 C     | can be sure that the buffer we write to will be free.     
                0024 C     |  That is by the time we are participating in the third    
                0025 C     | exchange transaction we know that both ends of the first  
                0026 C     | transaction must have completed.                          
                0027 C     | Note --                                                   
                0028 C     | 1. We allow more than three levels below although this    
                0029 C     | is not necessary.                                         
                0030 C     *==========================================================*
                0031 
                0032 C     !USES:
048ce7bdb7 Chri*0033 C     == Global data ==
                0034 #include "SIZE.h"
                0035 #include "EEPARAMS.h"
                0036 #include "EESUPPORT.h"
                0037 #include "EXCH.h"
                0038 
4c563c2ee9 Chri*0039 C     !INPUT PARAMETERS:
048ce7bdb7 Chri*0040 C     == Routine arguments ==
4c563c2ee9 Chri*0041 C     myThid :: Thread number of this instance of the routine
048ce7bdb7 Chri*0042       INTEGER myThid
                0043 
4c563c2ee9 Chri*0044 C     !LOCAL VARIABLES:
048ce7bdb7 Chri*0045 C     == Local variables ==
4c563c2ee9 Chri*0046 C     bi, bj :: Loop counters
048ce7bdb7 Chri*0047       INTEGER bi, bj
4c563c2ee9 Chri*0048 CEOP
048ce7bdb7 Chri*0049 
                0050       DO bj=myByLo(myThid),myByHi(myThid)
                0051        DO bi=myBxLo(myThid),myBxHi(myThid)
                0052 C--     Use next level exchange buffer in cycle.
                0053         exchangeBufLevel(1,bi,bj) = exchangeBufLevel(1,bi,bj)+1
                0054         IF ( exchangeBufLevel(1,bi,bj) .GT. NUMBER_OF_BUFFER_LEVELS )
                0055      &   exchangeBufLevel(1,bi,bj) = 1
                0056        ENDDO
                0057       ENDDO
                0058 
                0059       RETURN
                0060       END