9 |
SUBROUTINE INI_CARTESIAN_GRID( myThid ) |
SUBROUTINE INI_CARTESIAN_GRID( myThid ) |
10 |
C !DESCRIPTION: \bv |
C !DESCRIPTION: \bv |
11 |
C *==========================================================* |
C *==========================================================* |
12 |
C | SUBROUTINE INI_CARTESIAN_GRID |
C | SUBROUTINE INI_CARTESIAN_GRID |
13 |
C | o Initialise model coordinate system |
C | o Initialise model coordinate system |
14 |
C *==========================================================* |
C *==========================================================* |
15 |
C | The grid arrays, initialised here, are used throughout |
C | The grid arrays, initialised here, are used throughout |
16 |
C | the code in evaluating gradients, integrals and spatial |
C | the code in evaluating gradients, integrals and spatial |
17 |
C | avarages. This routine |
C | avarages. This routine |
18 |
C | is called separately by each thread and initialises only |
C | is called separately by each thread and initialises only |
19 |
C | the region of the domain it is "responsible" for. |
C | the region of the domain it is "responsible" for. |
20 |
C | Notes: |
C | Notes: |
21 |
C | Two examples are included. One illustrates the |
C | Two examples are included. One illustrates the |
22 |
C | initialisation of a cartesian grid (this routine). |
C | initialisation of a cartesian grid (this routine). |
23 |
C | The other shows the |
C | The other shows the |
24 |
C | inialisation of a spherical polar grid. Other orthonormal |
C | inialisation of a spherical polar grid. Other orthonormal |
25 |
C | grids can be fitted into this design. In this case |
C | grids can be fitted into this design. In this case |
26 |
C | custom metric terms also need adding to account for the |
C | custom metric terms also need adding to account for the |
27 |
C | projections of velocity vectors onto these grids. |
C | projections of velocity vectors onto these grids. |
28 |
C | The structure used here also makes it possible to |
C | The structure used here also makes it possible to |
29 |
C | implement less regular grid mappings. In particular |
C | implement less regular grid mappings. In particular |
30 |
C | o Schemes which leave out blocks of the domain that are |
C | o Schemes which leave out blocks of the domain that are |
31 |
C | all land could be supported. |
C | all land could be supported. |
32 |
C | o Multi-level schemes such as icosohedral or cubic |
C | o Multi-level schemes such as icosohedral or cubic |
33 |
C | grid projections onto a sphere can also be fitted |
C | grid projections onto a sphere can also be fitted |
34 |
C | within the strategy we use. |
C | within the strategy we use. |
35 |
C | Both of the above also require modifying the support |
C | Both of the above also require modifying the support |
36 |
C | routines that map computational blocks to simulation |
C | routines that map computational blocks to simulation |
37 |
C | domain blocks. |
C | domain blocks. |
38 |
C | Under the cartesian grid mode primitive distances in X |
C | Under the cartesian grid mode primitive distances in X |
39 |
C | and Y are in metres. Disktance in Z are in m or Pa |
C | and Y are in metres. Disktance in Z are in m or Pa |
40 |
C | depending on the vertical gridding mode. |
C | depending on the vertical gridding mode. |
41 |
C *==========================================================* |
C *==========================================================* |
42 |
C \ev |
C \ev |
43 |
|
|
51 |
|
|
52 |
C !INPUT/OUTPUT PARAMETERS: |
C !INPUT/OUTPUT PARAMETERS: |
53 |
C == Routine arguments == |
C == Routine arguments == |
54 |
C myThid - Number of this instance of INI_CARTESIAN_GRID |
C myThid :: Number of this instance of INI_CARTESIAN_GRID |
55 |
INTEGER myThid |
INTEGER myThid |
56 |
|
|
57 |
C !LOCAL VARIABLES: |
C !LOCAL VARIABLES: |
78 |
iG = myXGlobalLo + (bi-1)*sNx |
iG = myXGlobalLo + (bi-1)*sNx |
79 |
|
|
80 |
C-- First find coordinate of tile corner (meaning outer corner of halo) |
C-- First find coordinate of tile corner (meaning outer corner of halo) |
81 |
xG0 = 0. |
xG0 = xgOrigin |
82 |
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 |
83 |
DO i=1, iG-1 |
DO i=1, iG-1 |
84 |
xG0 = xG0 + delX(i) |
xG0 = xG0 + delX(i) |
88 |
xG0 = xG0 - delX( 1+mod(Olx*Nx-1+iG-i,Nx) ) |
xG0 = xG0 - delX( 1+mod(Olx*Nx-1+iG-i,Nx) ) |
89 |
ENDDO |
ENDDO |
90 |
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 |
91 |
yG0 = 0. |
yG0 = ygOrigin |
92 |
DO j=1, jG-1 |
DO j=1, jG-1 |
93 |
yG0 = yG0 + delY(j) |
yG0 = yG0 + delY(j) |
94 |
ENDDO |
ENDDO |
188 |
ENDDO |
ENDDO |
189 |
ENDDO |
ENDDO |
190 |
|
|
191 |
C Calculate vertical face area |
C-- Calculate vertical face area |
192 |
DO J=1-Oly,sNy+Oly |
DO J=1-Oly,sNy+Oly |
193 |
DO I=1-Olx,sNx+Olx |
DO I=1-Olx,sNx+Olx |
194 |
rA (I,J,bi,bj) = dxF(I,J,bi,bj)*dyF(I,J,bi,bj) |
rA (I,J,bi,bj) = dxF(I,J,bi,bj)*dyF(I,J,bi,bj) |
195 |
rAw(I,J,bi,bj) = dxC(I,J,bi,bj)*dyG(I,J,bi,bj) |
rAw(I,J,bi,bj) = dxC(I,J,bi,bj)*dyG(I,J,bi,bj) |
196 |
rAs(I,J,bi,bj) = dxG(I,J,bi,bj)*dyC(I,J,bi,bj) |
rAs(I,J,bi,bj) = dxG(I,J,bi,bj)*dyC(I,J,bi,bj) |
197 |
rAz(I,J,bi,bj) = dxV(I,J,bi,bj)*dyU(I,J,bi,bj) |
rAz(I,J,bi,bj) = dxV(I,J,bi,bj)*dyU(I,J,bi,bj) |
198 |
|
C-- Set trigonometric terms & grid orientation: |
199 |
tanPhiAtU(I,J,bi,bj) = 0. |
tanPhiAtU(I,J,bi,bj) = 0. |
200 |
tanPhiAtV(I,J,bi,bj) = 0. |
tanPhiAtV(I,J,bi,bj) = 0. |
201 |
|
angleCosC(I,J,bi,bj) = 1. |
202 |
|
angleSinC(I,J,bi,bj) = 0. |
203 |
ENDDO |
ENDDO |
204 |
ENDDO |
ENDDO |
205 |
|
|
211 |
sqcosFacV(J,bi,bj)=1. |
sqcosFacV(J,bi,bj)=1. |
212 |
ENDDO |
ENDDO |
213 |
|
|
214 |
ENDDO ! bi |
C-- end bi,bj loops |
215 |
ENDDO ! bj |
ENDDO |
216 |
|
ENDDO |
217 |
|
|
218 |
|
C-- Set default (=whole domain) for where relaxation to climatology applies |
219 |
|
_BEGIN_MASTER(myThid) |
220 |
|
IF ( latBandClimRelax.EQ.UNSET_RL ) THEN |
221 |
|
latBandClimRelax = 0. |
222 |
|
DO j=1,Ny |
223 |
|
latBandClimRelax = latBandClimRelax + delY(j) |
224 |
|
ENDDO |
225 |
|
latBandClimRelax = latBandClimRelax*3. _d 0 |
226 |
|
ENDIF |
227 |
|
_END_MASTER(myThid) |
228 |
|
|
229 |
RETURN |
RETURN |
230 |
END |
END |