Warning, /pkg/exch2/exch2_3d_rx.template is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
046fd16d1c Andr*0001 #include "CPP_EEOPTIONS.h"
8c27c9de99 Jean*0002 #include "W2_OPTIONS.h"
0003
046fd16d1c Andr*0004 CBOP
d4e639dc4c Jean*0005 C !ROUTINE: EXCH2_3D_RX
046fd16d1c Andr*0006
0007 C !INTERFACE:
d4e639dc4c Jean*0008 SUBROUTINE EXCH2_3D_RX(
8c27c9de99 Jean*0009 U phi,
d4e639dc4c Jean*0010 I myNz, myThid )
046fd16d1c Andr*0011
0012 C !DESCRIPTION:
0013 C *==========================================================*
d4e639dc4c Jean*0014 C | SUBROUTINE EXCH2_3D_RX
8c27c9de99 Jean*0015 C | o Handle exchanges for _RX, three-dim scalar arrays.
046fd16d1c Andr*0016 C *==========================================================*
0017
0018 C !USES:
d4e639dc4c Jean*0019 IMPLICIT NONE
046fd16d1c Andr*0020 C === Global data ===
0021 #include "SIZE.h"
0022 #include "EEPARAMS.h"
90219e5912 Jean*0023 #include "W2_EXCH2_SIZE.h"
046fd16d1c Andr*0024 #include "W2_EXCH2_TOPOLOGY.h"
d0ce7fc1dc Jean*0025 c#ifdef W2_FILL_NULL_REGIONS
0026 c#include "W2_EXCH2_PARAMS.h"
0027 c#endif
046fd16d1c Andr*0028
0029 C !INPUT/OUTPUT PARAMETERS:
0030 C === Routine arguments ===
0031 C phi :: Array with overlap regions are to be exchanged
d4e639dc4c Jean*0032 C myNz :: 3rd dimension of array to exchange
046fd16d1c Andr*0033 C myThid :: My thread id.
d4e639dc4c Jean*0034 INTEGER myNz
0035 _RX phi(1-OLx:sNx+OLx,1-OLy:sNy+OLy,myNz,nSx,nSy)
046fd16d1c Andr*0036 INTEGER myThid
0037
0038 C !LOCAL VARIABLES:
0039 C == Local variables ==
0040 C OL[wens] :: Overlap extents in west, east, north, south.
0041 C exchWidth[XY] :: Extent of regions that will be exchanged.
d4e639dc4c Jean*0042 INTEGER OLw, OLe, OLn, OLs, exchWidthX, exchWidthY
412d4bd65c Jean*0043 #ifdef W2_FILL_NULL_REGIONS
046fd16d1c Andr*0044 INTEGER bi, bj, myTile, i, j, k
412d4bd65c Jean*0045 #endif
046fd16d1c Andr*0046
0047 CEOP
0048
0049 OLw = OLx
0050 OLe = OLx
0051 OLn = OLy
0052 OLs = OLy
0053 exchWidthX = OLx
0054 exchWidthY = OLy
8c27c9de99 Jean*0055
8bc539472e Jean*0056 CALL EXCH2_RX1_CUBE( phi, .FALSE., 'T ',
046fd16d1c Andr*0057 I OLw, OLe, OLs, OLn, myNz,
0058 I exchWidthX, exchWidthY,
1a3a8861a0 Jean*0059 I EXCH_IGNORE_CORNERS, myThid )
046fd16d1c Andr*0060
8bc539472e Jean*0061 CALL EXCH2_RX1_CUBE( phi, .FALSE., 'T ',
046fd16d1c Andr*0062 I OLw, OLe, OLs, OLn, myNz,
0063 I exchWidthX, exchWidthY,
8bc539472e Jean*0064 I EXCH_UPDATE_CORNERS, myThid )
046fd16d1c Andr*0065
8c27c9de99 Jean*0066 #ifdef W2_FILL_NULL_REGIONS
5df640d755 Jean*0067 IF (useCubedSphereExchange) THEN
046fd16d1c Andr*0068 DO bj=myByLo(myThid),myByHi(myThid)
0069 DO bi=myBxLo(myThid),myBxHi(myThid)
5df640d755 Jean*0070 myTile = W2_myTileList(bi,bj)
046fd16d1c Andr*0071 C South-east corner
0072 IF ( exch2_isEedge(myTile) .EQ. 1 .AND.
0073 & exch2_isSedge(myTile) .EQ. 1 ) THEN
0074 DO j=1-OLy,0
0075 DO i=sNx+1,sNx+OLx
d4e639dc4c Jean*0076 DO k=1,myNz
8c27c9de99 Jean*0077 phi(i,j,k,bi,bj)=e2FillValue_RX
046fd16d1c Andr*0078 ENDDO
0079 ENDDO
0080 ENDDO
0081 ENDIF
0082 C North-east corner
0083 IF ( exch2_isEedge(myTile) .EQ. 1 .AND.
0084 & exch2_isNedge(myTile) .EQ. 1 ) THEN
0085 DO j=sNy+1,sNy+OLy
0086 DO i=sNx+1,sNx+OLx
d4e639dc4c Jean*0087 DO k=1,myNz
8c27c9de99 Jean*0088 phi(i,j,k,bi,bj)=e2FillValue_RX
046fd16d1c Andr*0089 ENDDO
0090 ENDDO
0091 ENDDO
0092 ENDIF
0093 C South-west corner
0094 IF ( exch2_isWedge(myTile) .EQ. 1 .AND.
0095 & exch2_isSedge(myTile) .EQ. 1 ) THEN
0096 DO j=1-OLy,0
0097 DO i=1-OLx,0
d4e639dc4c Jean*0098 DO k=1,myNz
8c27c9de99 Jean*0099 phi(i,j,k,bi,bj)=e2FillValue_RX
046fd16d1c Andr*0100 ENDDO
0101 ENDDO
0102 ENDDO
0103 ENDIF
0104 C North-west corner
0105 IF ( exch2_isWedge(myTile) .EQ. 1 .AND.
0106 & exch2_isNedge(myTile) .EQ. 1 ) THEN
0107 DO j=sNy+1,sNy+OLy
0108 DO i=1-OLx,0
d4e639dc4c Jean*0109 DO k=1,myNz
8c27c9de99 Jean*0110 phi(i,j,k,bi,bj)=e2FillValue_RX
046fd16d1c Andr*0111 ENDDO
0112 ENDDO
0113 ENDDO
0114 ENDIF
0115 ENDDO
0116 ENDDO
0117 ENDIF
5df640d755 Jean*0118 #endif /* W2_FILL_NULL_REGIONS */
046fd16d1c Andr*0119
0120 RETURN
0121 END
2ad152b417 Ed H*0122
0123 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
0124
0125 CEH3 ;;; Local Variables: ***
0126 CEH3 ;;; mode:fortran ***
0127 CEH3 ;;; End: ***