C $Header: /home/ubuntu/mnt/e9_copy/MITgcm/eesupp/src/exch_uv_3d_rx.template,v 1.1 2006/08/23 15:18:47 jmc Exp $ C $Name: $ #include "PACKAGES_CONFIG.h" #include "CPP_EEOPTIONS.h" CBOP C !ROUTINE: EXCH_UV_3D_RX C !INTERFACE: SUBROUTINE EXCH_UV_3D_RX( U Uphi, Vphi, I withSigns, myNz, myThid ) C !DESCRIPTION: C *==========================================================* C | SUBROUTINE EXCH_UV_3D_RX C | o Handle exchanges for _RX, 3-dimensional vector arrays. C *==========================================================* C | Vector arrays need to be rotated and interchaged for C | exchange operations on some grids. This driver routine C | branches to support this. C *==========================================================* C !USES: IMPLICIT NONE C === Global data === #include "SIZE.h" #include "EEPARAMS.h" #include "EESUPPORT.h" #include "EXCH.h" C !INPUT/OUTPUT PARAMETERS: C === Routine arguments === C phi :: Array with overlap regions are to be exchanged C Note - The interface to EXCH_RX assumes that C the standard Fortran 77 sequence association rules C apply. C myNz :: 3rd dimension of array to exchange C myThid :: My thread id. INTEGER myNz _RX Uphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) _RX Vphi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy) LOGICAL withSigns INTEGER myThid C !LOCAL VARIABLES: C == Local variables == C OL[wens] :: Overlap extents in west, east, north, south. C exchWidth[XY] :: Extent of regions that will be exchanged. INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY CEOP #ifdef ALLOW_EXCH2 CALL EXCH2_UV_3D_RX( U Uphi, Vphi, I withSigns, myNz, myThid ) RETURN #endif OLw = OLx OLe = OLx OLn = OLy OLs = OLy exchWidthX = OLx exchWidthY = OLy C ** NOTE ** The exchange routine we use here does not C require the preceeding and following barriers. C However, the slow, simple exchange interface C that is calling it here is meant to ensure C that threads are synchronised before exchanges C begine. IF (useCubedSphereExchange) THEN CALL EXCH_UV_RX_CUBE( Uphi, Vphi, withSigns, I OLw, OLe, OLs, OLn, myNz, I exchWidthX, exchWidthY, I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) ELSE CALL EXCH_RX( Uphi, I OLw, OLe, OLs, OLn, myNz, I exchWidthX, exchWidthY, I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) CALL EXCH_RX( Vphi, I OLw, OLe, OLs, OLn, myNz, I exchWidthX, exchWidthY, I FORWARD_SIMULATION, EXCH_UPDATE_CORNERS, myThid ) ENDIF RETURN END C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| CEH3 ;;; Local Variables: *** CEH3 ;;; mode:fortran *** CEH3 ;;; End: ***