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