File indexing completed on 2018-03-02 18:39:43 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
11942f961e Jean*0001 #include "CPP_EEOPTIONS.h"
0002
0003
0004
0005
0006
0007 SUBROUTINE EXCH2_GET_SCAL_BOUNDS(
0008 I fCode, eWdth, updateCorners,
0009 I tgTile, tgNb,
0010 O tIlo, tIhi, tJlo, tJhi,
0011 O tiStride, tjStride,
0012 I myThid )
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 IMPLICIT NONE
0023
0024 #include "SIZE.h"
0025 #include "W2_EXCH2_SIZE.h"
0026 #include "W2_EXCH2_TOPOLOGY.h"
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040 CHARACTER*2 fCode
0041 INTEGER eWdth
0042 LOGICAL updateCorners
0043 INTEGER tgTile, tgNb
0044 INTEGER tIlo, tIhi, tJlo, tJhi
0045 INTEGER tiStride, tjStride
0046 INTEGER myThid
0047
0048
0049
0050
0051
0052 tIlo = exch2_iLo(tgNb,tgTile)
0053 tIhi = exch2_iHi(tgNb,tgTile)
0054 tJlo = exch2_jLo(tgNb,tgTile)
0055 tJhi = exch2_jHi(tgNb,tgTile)
0056
0057
0058 IF ( tIlo .EQ. tIhi .AND. tIlo .EQ. 0 ) THEN
0059
0060 tIlo = 1-eWdth
0061 tiStride = 1
0062 IF ( tJlo .LE. tJhi ) THEN
0063 tjStride = 1
0064 ELSE
0065 tjStride =-1
0066 ENDIF
0067 IF ( updateCorners ) THEN
0068 tJlo = tJlo-tjStride*(eWdth-1)
0069 tJhi = tJhi+tjStride*(eWdth-1)
0070 ELSE
0071 tJlo = tJlo+tjStride
0072 tJhi = tJhi-tjStride
0073 ENDIF
0074 ENDIF
0075 IF ( tIlo .EQ. tIhi .AND. tIlo .GT. 1 ) THEN
0076
0077 tIhi = tIhi+eWdth-1
0078 tiStride = 1
0079 IF ( tJlo .LE. tJhi ) THEN
0080 tjStride = 1
0081 ELSE
0082 tjStride =-1
0083 ENDIF
0084 IF ( updateCorners ) THEN
0085 tJlo = tJlo-tjStride*(eWdth-1)
0086 tJhi = tJhi+tjStride*(eWdth-1)
0087 ELSE
0088 tJlo = tJlo+tjStride
0089 tJhi = tJhi-tjStride
0090 ENDIF
0091 ENDIF
0092 IF ( tJlo .EQ. tJhi .AND. tJlo .EQ. 0 ) THEN
0093
0094 tJlo = 1-eWdth
0095 tjStride = 1
0096 IF ( tIlo .LE. tIhi ) THEN
0097 tiStride = 1
0098 ELSE
0099 tiStride =-1
0100 ENDIF
0101 IF ( updateCorners ) THEN
0102 tIlo = tIlo-tiStride*(eWdth-1)
0103 tIhi = tIhi+tiStride*(eWdth-1)
0104 ELSE
0105 tIlo = tIlo+tiStride
0106 tIhi = tIhi-tiStride
0107 ENDIF
0108 ENDIF
0109 IF ( tJlo .EQ. tJhi .AND. tJlo .GT. 1 ) THEN
0110
0111 tJhi = tJhi+eWdth-1
0112 tjStride = 1
0113 IF ( tIlo .LE. tIhi ) THEN
0114 tiStride = 1
0115 ELSE
0116 tiStride =-1
0117 ENDIF
0118 IF ( updateCorners ) THEN
0119 tIlo = tIlo-tiStride*(eWdth-1)
0120 tIhi = tIhi+tiStride*(eWdth-1)
0121 ELSE
0122 tIlo = tIlo+tiStride
0123 tIhi = tIhi-tiStride
0124 ENDIF
0125 ENDIF
0126
0127 RETURN
0128 END