| 1 | C $Header: /u/gcmpack/MITgcm/pkg/ex3/ex3_util.F,v 1.2 2005/10/16 06:55:48 edhill Exp $ | 
| 2 | C $Name:  $ | 
| 3 |  | 
| 4 | #include "EX3_OPTIONS.h" | 
| 5 |  | 
| 6 | C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| | 
| 7 | CBOP 0 | 
| 8 | C     !ROUTINE: EX3_GET_BUFFTAG | 
| 9 |  | 
| 10 | C     !INTERFACE: | 
| 11 | SUBROUTINE EX3_GET_BUFFTAG( | 
| 12 | I     i_sendtile, i_recvtile, i_neigh, | 
| 13 | O     bufftag, | 
| 14 | I     myThid ) | 
| 15 |  | 
| 16 | C     !DESCRIPTION: | 
| 17 | C     Vector exchange routine which copies values from two input arrays, | 
| 18 | C     performs a rotation/permutation of the values, writes the values | 
| 19 | C     to two buffers in the specified order and then, if necessary, | 
| 20 | C     calls the appropriate MPI send functions. | 
| 21 |  | 
| 22 | C     !USES: | 
| 23 | IMPLICIT NONE | 
| 24 | #include "EX3_SIZE.h" | 
| 25 |  | 
| 26 | C     !INPUT PARAMETERS: | 
| 27 | INTEGER i_sendtile, i_recvtile, i_neigh | 
| 28 | INTEGER bifftag | 
| 29 | INTEGER myThid | 
| 30 | CEOP | 
| 31 |  | 
| 32 | C     !LOCAL VARIABLES | 
| 33 | INTEGER bufftag | 
| 34 |  | 
| 35 | C     Probably a 32-bit (signed or unsigned?) int so things are fine as | 
| 36 | C     when: (EX3_MAX_E_NBS * EX3_MAX_TILES) < 21,000 | 
| 37 |  | 
| 38 | C     .  2^32 = 4294967296 | 
| 39 | C     .  2^31 = 2147483648 | 
| 40 | C     .  2^30 = 1073741824 | 
| 41 | C | 
| 42 | C     .         2100021000 | 
| 43 | C     .         rrrrrsssss | 
| 44 | C     .         0987654321 | 
| 45 | bufftag = | 
| 46 | &     (i_sendtile - 1)*EX3_MAX_E_NBS + i_neigh | 
| 47 | &     + 100000*( (i_recvtile - 1)*EX3_MAX_E_NBS + i_neigh ) | 
| 48 |  | 
| 49 | RETURN | 
| 50 | END | 
| 51 |  | 
| 52 | C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| | 
| 53 |  |