/[MITgcm]/MITgcm/eesupp/src/exch_uv_xy_rx.template
ViewVC logotype

Diff of /MITgcm/eesupp/src/exch_uv_xy_rx.template

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.2 by jmc, Tue Apr 10 00:58:17 2001 UTC revision 1.9 by jmc, Fri Aug 17 18:34:17 2007 UTC
# Line 1  Line 1 
1  C $Header$  C $Header$
2  C $Name$  C $Name$
3    
4    #include "PACKAGES_CONFIG.h"
5  #include "CPP_EEOPTIONS.h"  #include "CPP_EEOPTIONS.h"
6    #ifdef ALLOW_EXCH2
7    #include "W2_OPTIONS.h"
8    #endif
9    
10    CBOP
11    C     !ROUTINE: EXCH_UV_XY_RX
12    
13    C     !INTERFACE:
14        SUBROUTINE EXCH_UV_XY_RX(        SUBROUTINE EXCH_UV_XY_RX(
15       U                       Uphi, Vphi, withSigns,       U                       Uphi, Vphi,
16       I                       myThid )       I                       withSigns, myThid )
 C     /==========================================================\  
 C     | SUBROUTINE EXCH_UV_XY_RX                                 |  
 C     | o Handle exchanges for _RX,    two-dimensional arrays.   |  
 C     |==========================================================|  
 C     | Do true shared-memory data transfers and "messaging"     |  
 C     | tranfers for blocking case of data transfers.            |  
 C     | Applications call this routine using                     |  
 C     |  CALL EXCH..( x, myThid )                                |  
 C     | where x is a two-dimensional array with overlaps.        |  
 C     | This routine does true-shared-memory copies for blocks   |  
 C     | within a thread. It will also do MPI meesaging between   |  
 C     | different processes.                                     |  
 C     | Note:                                                    |  
 C     | =====                                                    |  
 C     | This routine is a default mode interface to the more     |  
 C     | general exchange routine. Under default mode the         |  
 C     | exchange is for an edge width of OLx, and OLy and        |  
 C     | updates corner points as well as edges ( slightly more   |  
 C     | synchronisation required).                               |  
 C     \==========================================================/  
17        IMPLICIT NONE        IMPLICIT NONE
18    C     !DESCRIPTION:
19    C     *==========================================================*
20    C     | SUBROUTINE EXCH_UV_XY_RX
21    C     | o Handle exchanges for _RX, two-dimensional arrays.
22    C     *==========================================================*
23    C     | Driver exchange routine which branches to cube sphere or
24    C     | global, simple cartesian index grid. Exchange routine is
25    C     | called with two arrays that are components of a vector.
26    C     | These components are rotated and interchanged on the
27    C     | rotated grid during cube exchanges.
28    C     *==========================================================*
29    
30    C     !USES:
31  C     === Global data ===  C     === Global data ===
32  #include "SIZE.h"  #include "SIZE.h"
33  #include "EEPARAMS.h"  #include "EEPARAMS.h"
34  #include "EESUPPORT.h"  cph-mpi#include "EESUPPORT.h"
35    c#include "EXCH.h"
36    
37    C     !INPUT/OUTPUT PARAMETERS:
38  C     === Routine arguments ===  C     === Routine arguments ===
39  C     phi    - Array with overlap regions are to be exchanged  C     Uphi      :: Arrays with overlap regions are to be exchanged
40  C              Note - The interface to EXCH_RL assumes that  C     Vphi         Note - The interface to EXCH_ assumes that
41  C              the standard Fortran 77 sequence association rules  C                  the standard Fortran 77 sequence association rules
42  C              apply.  C                  apply.
43  C     myThid - My thread id.  C     myThid    :: My thread id.
44    C     withSigns :: Flag controlling whether vector is signed.
45        _RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
46        _RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)        _RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,nSx,nSy)
47        LOGICAL withSigns        LOGICAL withSigns
48        INTEGER myThid        INTEGER myThid
 CEndOfInterface  
49    
50    C     !LOCAL VARIABLES:
51    #ifndef ALLOW_EXCH2
52  C     == Local variables ==  C     == Local variables ==
53  C     OL[wens]       - Overlap extents in west, east, north, south.  C     OL[wens]       :: Overlap extents in west, east, north, south.
54  C     exchWidth[XY]  - Extent of regions that will be exchanged.  C     exchWidth[XY]  :: Extent of regions that will be exchanged.
55        INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz        INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY, myNz
56    #endif
57    CEOP
58    
59    #ifdef ALLOW_EXCH2
60    #ifdef W2_USE_R1_ONLY
61          CALL EXCH2_UV_CGRID_3D_RX(
62         U                       Uphi, Vphi,
63         I                       withSigns, 1, myThid )
64    #else
65          CALL EXCH2_UV_XY_RX(
66         U                       Uphi, Vphi,
67         I                       withSigns, myThid )
68    #endif
69          RETURN
70    #else /* ALLOW_EXCH2 */
71    
72        OLw        = OLx        OLw        = OLx
73        OLe        = OLx        OLe        = OLx
# Line 63  C                However, the slow, simp Line 82  C                However, the slow, simp
82  C                that is calling it here is meant to ensure  C                that is calling it here is meant to ensure
83  C                that threads are synchronised before exchanges  C                that threads are synchronised before exchanges
84  C                begine.  C                begine.
       _BARRIER  
85        IF (useCubedSphereExchange) THEN        IF (useCubedSphereExchange) THEN
86         CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns,         CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns,
87       I            OLw, OLe, OLs, OLn, myNz,       I            OLw, OLe, OLs, OLn, myNz,
# Line 82  c_jmc: for JAM compatibility, replace th Line 100  c_jmc: for JAM compatibility, replace th
100         _EXCH_XY_RX( Uphi, myThid )         _EXCH_XY_RX( Uphi, myThid )
101         _EXCH_XY_RX( Vphi, myThid )         _EXCH_XY_RX( Vphi, myThid )
102        ENDIF        ENDIF
       _BARRIER  
103    
104        RETURN        RETURN
105    #endif /* ALLOW_EXCH2 */
106        END        END
107    
108    C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
109    
110    CEH3 ;;; Local Variables: ***
111    CEH3 ;;; mode:fortran ***
112    CEH3 ;;; End: ***

Legend:
Removed from v.1.1.2.2  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.22