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
449149bd7b Jean*0001 #include "PACKAGES_CONFIG.h"
0002 #include "CPP_EEOPTIONS.h"
0003
0004
0005
0006
0007
0008
0009 SUBROUTINE FILL_CS_CORNER_AG_RL(
0010 I fill4dirX, withSigns,
0011 U uFld, vFld,
0012 I bi,bj, myThid)
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026 IMPLICIT NONE
0027
0028
0029 #include "SIZE.h"
0030 #include "EEPARAMS.h"
0031 #ifdef ALLOW_EXCH2
1cc6effca6 Jean*0032 #include "W2_EXCH2_SIZE.h"
449149bd7b Jean*0033 #include "W2_EXCH2_TOPOLOGY.h"
0034 #endif /* ALLOW_EXCH2 */
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 LOGICAL fill4dirX
0047 LOGICAL withSigns
0048 _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0049 _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0050 INTEGER bi,bj
0051 INTEGER myThid
0052
0053
0054
0055
0056
0057 INTEGER i,j
0058 LOGICAL southWestCorner
0059 LOGICAL southEastCorner
0060 LOGICAL northWestCorner
0061 LOGICAL northEastCorner
0062 _RL negOne
0063 #ifdef ALLOW_EXCH2
0064 INTEGER myTile
0065 #endif
0066
0067
0068 negOne = 1.
0069 IF (withSigns) negOne = -1.
0070
0071 IF (useCubedSphereExchange) THEN
0072
0073 #ifdef ALLOW_EXCH2
6e33c64afb Jean*0074 myTile = W2_myTileList(bi,bj)
449149bd7b Jean*0075 southWestCorner = exch2_isWedge(myTile).EQ.1
0076 & .AND. exch2_isSedge(myTile).EQ.1
0077 southEastCorner = exch2_isEedge(myTile).EQ.1
0078 & .AND. exch2_isSedge(myTile).EQ.1
0079 northEastCorner = exch2_isEedge(myTile).EQ.1
0080 & .AND. exch2_isNedge(myTile).EQ.1
0081 northWestCorner = exch2_isWedge(myTile).EQ.1
0082 & .AND. exch2_isNedge(myTile).EQ.1
0083 #else
0084 southWestCorner = .TRUE.
0085 southEastCorner = .TRUE.
0086 northWestCorner = .TRUE.
0087 northEastCorner = .TRUE.
0088 #endif
0089
0090 IF ( fill4dirX ) THEN
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
0125
0126
0127
0128
0129
0130 IF ( southWestCorner ) THEN
0131 DO j=1,OLy
0132 DO i=1,OLx
0133 uFld( 1-i , 1-j ) = vFld( 1-j , i )*negOne
0134 vFld( 1-i , 1-j ) = uFld( 1-j , i )
0135 ENDDO
0136 ENDDO
0137 ENDIF
0138 IF ( southEastCorner ) THEN
0139 DO j=1,OLy
0140 DO i=1,OLx
0141 uFld(sNx+i, 1-j ) = vFld(sNx+j, i )
0142 vFld(sNx+i, 1-j ) = uFld(sNx+j, i )*negOne
0143 ENDDO
0144 ENDDO
0145 ENDIF
0146 IF ( northWestCorner ) THEN
0147 DO j=1,OLy
0148 DO i=1,OLx
0149 uFld( 1-i ,sNy+j) = vFld( 1-j , sNy+1-i )
0150 vFld( 1-i ,sNy+j) = uFld( 1-j , sNy+1-i )*negOne
0151 ENDDO
0152 ENDDO
0153 ENDIF
0154 IF ( northEastCorner ) THEN
0155 DO j=1,OLy
0156 DO i=1,OLx
0157 uFld(sNx+i,sNy+j) = vFld(sNx+j, sNy+1-i )*negOne
0158 vFld(sNx+i,sNy+j) = uFld(sNx+j, sNy+1-i )
0159 ENDDO
0160 ENDDO
0161 ENDIF
0162
0163
0164
0165 ELSE
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184
0185
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204 IF ( southWestCorner ) THEN
0205 DO j=1,Oly
0206 DO i=1,Olx
0207 uFld( 1-i , 1-j ) = vFld( j , 1-i )
0208 vFld( 1-i , 1-j ) = uFld( j , 1-i )*negOne
0209 ENDDO
0210 ENDDO
0211 ENDIF
0212 IF ( southEastCorner ) THEN
0213 DO j=1,Oly
0214 DO i=1,Olx
0215 uFld(sNx+i, 1-j ) = vFld(sNx+1-j, 1-i )*negOne
0216 vFld(sNx+i, 1-j ) = uFld(sNx+1-j, 1-i )
0217 ENDDO
0218 ENDDO
0219 ENDIF
0220 IF ( northWestCorner ) THEN
0221 DO j=1,Oly
0222 DO i=1,Olx
0223 uFld( 1-i ,sNy+j) = vFld( j ,sNy+i)*negOne
0224 vFld( 1-i ,sNy+j) = uFld( j ,sNy+i)
0225 ENDDO
0226 ENDDO
0227 ENDIF
0228 IF ( northEastCorner ) THEN
0229 DO j=1,Oly
0230 DO i=1,Olx
0231 uFld(sNx+i,sNy+j) = vFld(sNx+1-j,sNy+i)
0232 vFld(sNx+i,sNy+j) = uFld(sNx+1-j,sNy+i)*negOne
0233 ENDDO
0234 ENDDO
0235 ENDIF
0236
0237
0238 ENDIF
0239
0240
0241 ENDIF
0242
0243 RETURN
0244 END