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
f1344853ff Mart*0001 #include "PACKAGES_CONFIG.h"
0002 #include "CPP_EEOPTIONS.h"
0003
0004
0005
0006
0007
0008
0009 SUBROUTINE FILL_CS_CORNER_UV_RL(
0010 I withSigns,
0011 U uFld, vFld,
0012 I bi,bj, myThid)
0013 IMPLICIT NONE
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031 #include "SIZE.h"
0032 #include "EEPARAMS.h"
0033 #ifdef ALLOW_EXCH2
0034 #include "W2_EXCH2_SIZE.h"
0035 #include "W2_EXCH2_TOPOLOGY.h"
0036 #endif /* ALLOW_EXCH2 */
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 LOGICAL withSigns
0047 _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0048 _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0049 INTEGER bi,bj
0050 INTEGER myThid
0051
0052
0053
0054
0055
0056 INTEGER i,j
0057 LOGICAL southWestCorner
0058 LOGICAL southEastCorner
0059 LOGICAL northWestCorner
0060 LOGICAL northEastCorner
0061 _RL negOne
0062 #ifdef ALLOW_EXCH2
0063 INTEGER myTile
0064 #endif
0065
0066
0067 IF (useCubedSphereExchange) THEN
0068
0069 negOne = 1. _d 0
0070 IF (withSigns) negOne = -1. _d 0
0071
0072 #ifdef ALLOW_EXCH2
0073 myTile = W2_myTileList(bi,bj)
0074 southWestCorner = exch2_isWedge(myTile).EQ.1
0075 & .AND. exch2_isSedge(myTile).EQ.1
0076 southEastCorner = exch2_isEedge(myTile).EQ.1
0077 & .AND. exch2_isSedge(myTile).EQ.1
0078 northEastCorner = exch2_isEedge(myTile).EQ.1
0079 & .AND. exch2_isNedge(myTile).EQ.1
0080 northWestCorner = exch2_isWedge(myTile).EQ.1
0081 & .AND. exch2_isNedge(myTile).EQ.1
0082 #else
0083 southWestCorner = .TRUE.
0084 southEastCorner = .TRUE.
0085 northWestCorner = .TRUE.
0086 northEastCorner = .TRUE.
0087 #endif
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124 IF ( southWestCorner ) THEN
0125
0126 DO j=1,OLy
0127 DO i=1,OLx
0128 uFld( 1-i , 1-j ) = negOne*vFld( 1-j , 1+i )
0129 ENDDO
0130 ENDDO
0131
0132 DO j=1,OLy
0133 DO i=1,OLx
0134 vFld( 1-i , 1-j ) = negOne*uFld( 1+j , 1-i )
0135 ENDDO
0136 ENDDO
0137 ENDIF
0138
0139 IF ( southEastCorner ) THEN
0140
0141 DO j=1,OLy
0142 DO i=2,OLx
0143 uFld(sNx+i, 1-j ) = vFld(sNx+j, i )
0144 ENDDO
0145 ENDDO
0146
0147 DO j=1,OLy
0148 DO i=1,OLx
0149 vFld(sNx+i, 1-j ) = uFld(sNx+1-j, 1-i )
0150 ENDDO
0151 ENDDO
0152 ENDIF
0153
0154 IF ( northWestCorner ) THEN
0155
0156 DO j=1,OLy
0157 DO i=1,OLx
0158 uFld( 1-i ,sNy+j) = vFld( 1-j , sNy+1-i )
0159 ENDDO
0160 ENDDO
0161
0162 DO j=2,OLy
0163 DO i=1,OLx
0164 vFld( 1-i ,sNy+j) = uFld( j , sNy+i )
0165 ENDDO
0166 ENDDO
0167 ENDIF
0168
0169 IF ( northEastCorner ) THEN
0170
0171 DO j=1,OLy
0172 DO i=2,OLx
0173 uFld(sNx+i,sNy+j) = negOne*vFld(sNx+j, sNy+2-i )
0174 ENDDO
0175 ENDDO
0176
0177 DO j=2,OLy
0178 DO i=1,OLx
0179 vFld(sNx+i,sNy+j) = negOne*uFld(sNx+2-j, sNy+i )
0180 ENDDO
0181 ENDDO
0182 ENDIF
0183
0184
0185 ENDIF
0186
0187 RETURN
0188 END