File indexing completed on 2018-03-02 18:38:52 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
0b42559cbf Jean*0001 #include "DEBUG_OPTIONS.h"
ad30945049 Jean*0002
1b71c3d58f Jean*0003 SUBROUTINE DEBUG_CS_CORNER_UV(
c424ee7cc7 Jean*0004 I word2print,
0005 I uFld, vFld,
0006 I k, ioUnit, bi,bj, myThid )
ad30945049 Jean*0007
0008
0009
0010
0011
0012
0013
1b71c3d58f Jean*0014
0015
ad30945049 Jean*0016
0017
0018
0019
0b42559cbf Jean*0020
ad30945049 Jean*0021
0022 IMPLICIT NONE
0023
0024
0025 #include "SIZE.h"
0026 #include "EEPARAMS.h"
0b42559cbf Jean*0027 #ifdef ALLOW_EXCH2
f9f661930b Jean*0028 #include "W2_EXCH2_SIZE.h"
0b42559cbf Jean*0029 #include "W2_EXCH2_TOPOLOGY.h"
0030 #endif
ad30945049 Jean*0031
0032
0033
0034
c424ee7cc7 Jean*0035
0036
0037
0038
0039
0040
0041
bcbb4a5699 Jean*0042 CHARACTER*(*) word2print
ad30945049 Jean*0043 _RL uFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0044 _RL vFld(1-OLx:sNx+OLx,1-OLy:sNy+OLy)
0b42559cbf Jean*0045 INTEGER k, ioUnit
0046 INTEGER bi, bj
ad30945049 Jean*0047 INTEGER myThid
0048
0b42559cbf Jean*0049 #ifdef ALLOW_DEBUG
ad30945049 Jean*0050
0051
0052 COMMON / DEBUG_CS_CORNER_UV_LOCAL / tmpU, tmpV
5a7b2a763a Jean*0053 _RL tmpU(4,Nr,nSx*nSy)
0054 _RL tmpV(4,Nr,nSx*nSy)
ad30945049 Jean*0055
0056
0b42559cbf Jean*0057
1b71c3d58f Jean*0058
5a7b2a763a Jean*0059
0060
0061
0062
0063 #ifdef ALLOW_EXCH2
0064 INTEGER t1, t2, t3
0065 #endif
0066 INTEGER n1, n2, n3
0b42559cbf Jean*0067 INTEGER edgeIndex
c424ee7cc7 Jean*0068 INTEGER ic, i, j
ad30945049 Jean*0069
bcbb4a5699 Jean*0070 EXTERNAL ILNBLNK
0071 INTEGER ILNBLNK
0072
ad30945049 Jean*0073
0074
0b42559cbf Jean*0075 edgeIndex = 1
0076
0077 j = MIN(MAX(1-Olx,edgeIndex),Olx)
5a7b2a763a Jean*0078 n1 = bi + (bj-1)*nSx
ad30945049 Jean*0079 1010 FORMAT(2A,I2,1PE12.4,I3,1P2E12.4)
0080
5a7b2a763a Jean*0081 tmpU(1,k,n1)= uFld(1,j)
0082 tmpU(2,k,n1)= uFld(1,sNy+1-j)
0083 tmpU(3,k,n1)= uFld(sNx+1,j)
0084 tmpU(4,k,n1)= uFld(sNx+1,sNy+1-j)
0085 tmpV(1,k,n1)= vFld(j,1)
0086 tmpV(2,k,n1)= vFld(sNx+1-j,1)
0087 tmpV(3,k,n1)= vFld(j,sNy+1)
0088 tmpV(4,k,n1)= vFld(sNx+1-j,sNy+1)
ad30945049 Jean*0089 _BARRIER
0b42559cbf Jean*0090 #ifdef ALLOW_EXCH2
c424ee7cc7 Jean*0091 IF (bi.EQ.nSx .AND. bj.EQ.nSy .AND. sNx.EQ.sNy) THEN
0b42559cbf Jean*0092 #else /* ALLOW_EXCH2 */
c424ee7cc7 Jean*0093 IF (bi.EQ.nSx .AND. nSy.EQ.1 .AND. nSx.EQ.6) THEN
0b42559cbf Jean*0094 #endif /* ALLOW_EXCH2 */
ad30945049 Jean*0095 WRITE(ioUnit,'(2A)') 'DEBUG_CS_CORNER_UV: ',
0096 & '------------------------------------------------------------'
bcbb4a5699 Jean*0097 ic = MAX(1,ILNBLNK(word2print))
0b42559cbf Jean*0098 WRITE(ioUnit,'(3A,I3)') 'DEBUG_CS_CORNER_UV: ',
0099 & word2print(1:ic), ' , index=', j
ad30945049 Jean*0100 WRITE(ioUnit,'(2A,I4)') 'DEBUG_CS_CORNER_UV: ',
1b71c3d58f Jean*0101 & ' Edges values near a corner, lev=',k
ad30945049 Jean*0102 WRITE(ioUnit,'(2A)') 'DEBUG_CS_CORNER_UV: ',
0b42559cbf Jean*0103 & ' tile_1, value_1, tile_2, value_2, difference v1-v2:'
c424ee7cc7 Jean*0104 DO j=1,nSy
0105 DO i=1,nSx
0b42559cbf Jean*0106 #ifdef ALLOW_EXCH2
5a7b2a763a Jean*0107 n1 = i + (j-1)*nSx
0108 n2 = 0
0109 n3 = 0
0110 t1 = W2_myTileList(i,j)
0111 t2 = exch2_neighbourId(4,t1)
0112 t3 = exch2_neighbourId(2,t1)
0113 IF ( W2_tileProc(t2).EQ.myProcId+1 ) n2 = W2_tileIndex(t2)
0114 IF ( W2_tileProc(t3).EQ.myProcId+1 ) n3 = W2_tileIndex(t3)
0115
0116 IF ( n2.GE.1 .AND. exch2_pij(3,4,t1).EQ.-1 ) THEN
c424ee7cc7 Jean*0117 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, S:',
5a7b2a763a Jean*0118 & t1,tmpU(1,k,n1), t2,tmpV(4,k,n2),
0119 & tmpU(1,k,n1) - tmpV(4,k,n2)
c424ee7cc7 Jean*0120 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, N:',
5a7b2a763a Jean*0121 & t1,tmpU(2,k,n1), t2,tmpV(3,k,n2),
0122 & tmpU(2,k,n1) - tmpV(3,k,n2)
c424ee7cc7 Jean*0123 ENDIF
5a7b2a763a Jean*0124 IF ( n2.GE.1 .AND. exch2_pij(4,4,t1).EQ.1 ) THEN
c424ee7cc7 Jean*0125 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, S:',
5a7b2a763a Jean*0126 & t1,tmpU(1,k,n1), t2,tmpU(3,k,n2),
0127 & tmpU(1,k,n1) - tmpU(3,k,n2)
c424ee7cc7 Jean*0128 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, N:',
5a7b2a763a Jean*0129 & t1,tmpU(2,k,n1), t2,tmpU(4,k,n2),
0130 & tmpU(2,k,n1) - tmpU(4,k,n2)
c424ee7cc7 Jean*0131 ENDIF
5a7b2a763a Jean*0132 IF ( n3.GE.1 .AND. exch2_pij(1,2,t1).EQ.1 ) THEN
c424ee7cc7 Jean*0133 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, W:',
5a7b2a763a Jean*0134 & t1,tmpV(1,k,n1), t3,tmpV(3,k,n3),
0135 & tmpV(1,k,n1) - tmpV(3,k,n3)
c424ee7cc7 Jean*0136 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, E:',
5a7b2a763a Jean*0137 & t1,tmpV(2,k,n1), t3,tmpV(4,k,n3),
0138 & tmpV(2,k,n1) - tmpV(4,k,n3)
c424ee7cc7 Jean*0139 ENDIF
5a7b2a763a Jean*0140 IF ( n3.GE.1 .AND. exch2_pij(2,2,t1).EQ.-1 ) THEN
c424ee7cc7 Jean*0141 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, W:',
5a7b2a763a Jean*0142 & t1,tmpV(1,k,n1), t3,tmpU(4,k,n3),
0143 & tmpV(1,k,n1) - tmpU(4,k,n3)
c424ee7cc7 Jean*0144 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, E:',
5a7b2a763a Jean*0145 & t1,tmpV(2,k,n1), t3,tmpU(3,k,n3),
0146 & tmpV(2,k,n1) - tmpU(3,k,n3)
c424ee7cc7 Jean*0147 ENDIF
0b42559cbf Jean*0148 #else /* ALLOW_EXCH2 */
c424ee7cc7 Jean*0149 n1 = i
0150 IF (MOD(n1,2).EQ.1 ) THEN
0151
0152
0153
0154
0155
0156
5a7b2a763a Jean*0157 n2 = 1+MOD(n1-2+5,6)
0158 n3 = 1+MOD(n1-1+5,6)
c424ee7cc7 Jean*0159 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, S:',
5a7b2a763a Jean*0160 & n1,tmpU(1,k,n1), n2,tmpV(4,k,n2),
0161 & tmpU(1,k,n1) - tmpV(4,k,n2)
c424ee7cc7 Jean*0162 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, N:',
5a7b2a763a Jean*0163 & n1,tmpU(2,k,n1), n2,tmpV(3,k,n2),
0164 & tmpU(2,k,n1) - tmpV(3,k,n2)
c424ee7cc7 Jean*0165 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, W:',
5a7b2a763a Jean*0166 & n1,tmpV(1,k,n1), n3,tmpV(3,k,n3),
0167 & tmpV(1,k,n1) - tmpV(3,k,n3)
c424ee7cc7 Jean*0168 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, E:',
5a7b2a763a Jean*0169 & n1,tmpV(2,k,n1), n3,tmpV(4,k,n3),
0170 & tmpV(2,k,n1) - tmpV(4,k,n3)
c424ee7cc7 Jean*0171 ELSE
0172
0173
0174
0175
0176
0177
5a7b2a763a Jean*0178 n2 = 1+MOD(n1-1+5,6)
0179 n3 = 1+MOD(n1-2+5,6)
c424ee7cc7 Jean*0180 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, S:',
5a7b2a763a Jean*0181 & n1,tmpU(1,k,n1), n2,tmpU(3,k,n2),
0182 & tmpU(1,k,n1) - tmpU(3,k,n2)
c424ee7cc7 Jean*0183 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'W edge, N:',
5a7b2a763a Jean*0184 & n1,tmpU(2,k,n1), n2,tmpU(4,k,n2),
0185 & tmpU(2,k,n1) - tmpU(4,k,n2)
c424ee7cc7 Jean*0186 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, W:',
5a7b2a763a Jean*0187 & n1,tmpV(1,k,n1), n3,tmpU(4,k,n3),
0188 & tmpV(1,k,n1) - tmpU(4,k,n3)
c424ee7cc7 Jean*0189 WRITE(ioUnit,1010) 'DEBUG_CS_CORNER_UV: ', 'S edge, E:',
5a7b2a763a Jean*0190 & n1,tmpV(2,k,n1), n3,tmpU(3,k,n3),
0191 & tmpV(2,k,n1) - tmpU(3,k,n3)
c424ee7cc7 Jean*0192 ENDIF
0b42559cbf Jean*0193 #endif /* ALLOW_EXCH2 */
c424ee7cc7 Jean*0194 ENDDO
ad30945049 Jean*0195 ENDDO
0196 WRITE(ioUnit,'(2A)') 'DEBUG_CS_CORNER_UV: ',
0197 & '------------------------------------------------------------'
0198 ENDIF
0199
0200
0b42559cbf Jean*0201 #endif /* ALLOW_DEBUG */
ad30945049 Jean*0202
0203 RETURN
0204 END