43 |
C xG, yG - Global coordinate location. |
C xG, yG - Global coordinate location. |
44 |
C xBase - South-west corner location for process. |
C xBase - South-west corner location for process. |
45 |
C yBase |
C yBase |
46 |
C zUpper - Work arrays for upper and lower |
C zUpper - Work arrays for upper and lower |
47 |
C zLower cell-face heights. |
C zLower cell-face heights. |
48 |
C phi - Temporary scalar |
C phi - Temporary scalar |
49 |
C iG, jG - Global coordinate index. Usually used to hold |
C iG, jG - Global coordinate index. Usually used to hold |
74 |
C > overlap by the total domain size e.g |
C > overlap by the total domain size e.g |
75 |
C > OLx*Nx, OLy*Ny. |
C > OLx*Nx, OLy*Ny. |
76 |
C > Can anybody explain? Lines are in ini_spherical_polar_grid.F. |
C > Can anybody explain? Lines are in ini_spherical_polar_grid.F. |
77 |
C > Surprised the code works if its wrong, so I am puzzled. |
C > Surprised the code works if its wrong, so I am puzzled. |
78 |
C jmc replied: |
C jmc replied: |
79 |
C Yes, I can explain this since I put this modification to work |
C Yes, I can explain this since I put this modification to work |
80 |
C with small domain (where Oly > Ny, as for instance, zonal-average |
C with small domain (where Oly > Ny, as for instance, zonal-average |
84 |
C But in case a or b is negative, then the FORTRAN function "mod" |
C But in case a or b is negative, then the FORTRAN function "mod" |
85 |
C does not return the matematical value of the "modulus" function, |
C does not return the matematical value of the "modulus" function, |
86 |
C and this is not good for your purpose. |
C and this is not good for your purpose. |
87 |
C This is why I add +OLx*Nx and +OLy*Ny to be sure that the 1rst |
C This is why I add +OLx*Nx and +OLy*Ny to be sure that the 1rst |
88 |
C argument of the mod function is positive. |
C argument of the mod function is positive. |
89 |
INTEGER iGl,jGl |
INTEGER iGl,jGl |
90 |
iGl(I,bi) = 1+mod(myXGlobalLo-1+(bi-1)*sNx+I+Olx*Nx-1,Nx) |
iGl(I,bi) = 1+mod(myXGlobalLo-1+(bi-1)*sNx+I+Olx*Nx-1,Nx) |
101 |
iG = myXGlobalLo + (bi-1)*sNx |
iG = myXGlobalLo + (bi-1)*sNx |
102 |
|
|
103 |
C-- First find coordinate of tile corner (meaning outer corner of halo) |
C-- First find coordinate of tile corner (meaning outer corner of halo) |
104 |
xG0 = thetaMin |
xG0 = xgOrigin |
105 |
C Find the X-coordinate of the outer grid-line of the "real" tile |
C Find the X-coordinate of the outer grid-line of the "real" tile |
106 |
DO i=1, iG-1 |
DO i=1, iG-1 |
107 |
xG0 = xG0 + delX(i) |
xG0 = xG0 + delX(i) |
111 |
xG0 = xG0 - delX( 1+mod(Olx*Nx-1+iG-i,Nx) ) |
xG0 = xG0 - delX( 1+mod(Olx*Nx-1+iG-i,Nx) ) |
112 |
ENDDO |
ENDDO |
113 |
C Find the Y-coordinate of the outer grid-line of the "real" tile |
C Find the Y-coordinate of the outer grid-line of the "real" tile |
114 |
yG0 = phiMin |
yG0 = ygOrigin |
115 |
DO j=1, jG-1 |
DO j=1, jG-1 |
116 |
yG0 = yG0 + delY(j) |
yG0 = yG0 + delY(j) |
117 |
ENDDO |
ENDDO |
148 |
DO J=1-Oly,sNy+Oly |
DO J=1-Oly,sNy+Oly |
149 |
DO I=1-Olx,sNx+Olx |
DO I=1-Olx,sNx+Olx |
150 |
C by averaging |
C by averaging |
151 |
xC(I,J,bi,bj) = 0.25*( |
xC(I,J,bi,bj) = 0.25*( |
152 |
& xGloc(I,J)+xGloc(I+1,J)+xGloc(I,J+1)+xGloc(I+1,J+1) ) |
& xGloc(I,J)+xGloc(I+1,J)+xGloc(I,J+1)+xGloc(I+1,J+1) ) |
153 |
yC(I,J,bi,bj) = 0.25*( |
yC(I,J,bi,bj) = 0.25*( |
154 |
& yGloc(I,J)+yGloc(I+1,J)+yGloc(I,J+1)+yGloc(I+1,J+1) ) |
& yGloc(I,J)+yGloc(I+1,J)+yGloc(I,J+1)+yGloc(I+1,J+1) ) |
155 |
ENDDO |
ENDDO |
156 |
ENDDO |
ENDDO |