3 |
|
|
4 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
5 |
|
|
6 |
CStartOfInterface |
CBOP |
7 |
|
C !ROUTINE: INI_CARTESIAN_GRID |
8 |
|
C !INTERFACE: |
9 |
SUBROUTINE INI_CARTESIAN_GRID( myThid ) |
SUBROUTINE INI_CARTESIAN_GRID( myThid ) |
10 |
C /==========================================================\ |
C !DESCRIPTION: \bv |
11 |
C | SUBROUTINE INI_CARTESIAN_GRID | |
C *==========================================================* |
12 |
C | o Initialise model coordinate system | |
C | SUBROUTINE INI_CARTESIAN_GRID |
13 |
C |==========================================================| |
C | o Initialise model coordinate system |
14 |
C | These arrays are used throughout the code in evaluating | |
C *==========================================================* |
15 |
C | gradients, integrals and spatial avarages. This routine | |
C | The grid arrays, initialised here, are used throughout |
16 |
C | is called separately by each thread and initialise only | |
C | the code in evaluating gradients, integrals and spatial |
17 |
C | the region of the domain it is "responsible" for. | |
C | avarages. This routine |
18 |
C | Notes: | |
C | is called separately by each thread and initialises only |
19 |
C | Two examples are included. One illustrates the | |
C | the region of the domain it is "responsible" for. |
20 |
C | initialisation of a cartesian grid. The other shows the | |
C | Notes: |
21 |
C | inialisation of a spherical polar grid. Other orthonormal| |
C | Two examples are included. One illustrates the |
22 |
C | grids can be fitted into this design. In this case | |
C | initialisation of a cartesian grid (this routine). |
23 |
C | custom metric terms also need adding to account for the | |
C | The other shows the |
24 |
C | projections of velocity vectors onto these grids. | |
C | inialisation of a spherical polar grid. Other orthonormal |
25 |
C | The structure used here also makes it possible to | |
C | grids can be fitted into this design. In this case |
26 |
C | implement less regular grid mappings. In particular | |
C | custom metric terms also need adding to account for the |
27 |
C | o Schemes which leave out blocks of the domain that are | |
C | projections of velocity vectors onto these grids. |
28 |
C | all land could be supported. | |
C | The structure used here also makes it possible to |
29 |
C | o Multi-level schemes such as icosohedral or cubic | |
C | implement less regular grid mappings. In particular |
30 |
C | grid projections onto a sphere can also be fitted | |
C | o Schemes which leave out blocks of the domain that are |
31 |
C | within the strategy we use. | |
C | all land could be supported. |
32 |
C | Both of the above also require modifying the support | |
C | o Multi-level schemes such as icosohedral or cubic |
33 |
C | routines that map computational blocks to simulation | |
C | grid projections onto a sphere can also be fitted |
34 |
C | domain blocks. | |
C | within the strategy we use. |
35 |
C | Under the cartesian grid mode primitive distances in X | |
C | Both of the above also require modifying the support |
36 |
C | and Y are in metres. Disktance in Z are in m or Pa | |
C | routines that map computational blocks to simulation |
37 |
C | depending on the vertical gridding mode. | |
C | domain blocks. |
38 |
C \==========================================================/ |
C | Under the cartesian grid mode primitive distances in X |
39 |
IMPLICIT NONE |
C | and Y are in metres. Disktance in Z are in m or Pa |
40 |
|
C | depending on the vertical gridding mode. |
41 |
|
C *==========================================================* |
42 |
|
C \ev |
43 |
|
|
44 |
|
C !USES: |
45 |
|
IMPLICIT NONE |
46 |
C === Global variables === |
C === Global variables === |
47 |
#include "SIZE.h" |
#include "SIZE.h" |
48 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
49 |
#include "PARAMS.h" |
#include "PARAMS.h" |
50 |
#include "GRID.h" |
#include "GRID.h" |
51 |
|
|
52 |
|
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 |
|
CEndOfInterface |
|
56 |
|
|
57 |
|
C !LOCAL VARIABLES: |
58 |
C == Local variables == |
C == Local variables == |
59 |
INTEGER iG, jG, bi, bj, I, J |
INTEGER iG, jG, bi, bj, I, J |
60 |
_RL xG0, yG0 |
_RL xG0, yG0 |
61 |
|
C "Long" real for temporary coordinate calculation |
62 |
C "Long" real for temporary coordinate calculation |
C NOTICE the extended range of indices!! |
|
C NOTICE the extended range of indices!! |
|
63 |
_RL xGloc(1-Olx:sNx+Olx+1,1-Oly:sNy+Oly+1) |
_RL xGloc(1-Olx:sNx+Olx+1,1-Oly:sNy+Oly+1) |
64 |
_RL yGloc(1-Olx:sNx+Olx+1,1-Oly:sNy+Oly+1) |
_RL yGloc(1-Olx:sNx+Olx+1,1-Oly:sNy+Oly+1) |
65 |
|
C These functions return the "global" index with valid values beyond |
66 |
C These functions return the "global" index with valid values beyond |
C halo regions |
|
C halo regions |
|
67 |
INTEGER iGl,jGl |
INTEGER iGl,jGl |
68 |
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) |
69 |
jGl(J,bj) = 1+mod(myYGlobalLo-1+(bj-1)*sNy+J+Oly*Ny-1,Ny) |
jGl(J,bj) = 1+mod(myYGlobalLo-1+(bj-1)*sNy+J+Oly*Ny-1,Ny) |
70 |
|
CEOP |
71 |
|
|
72 |
C For each tile ... |
C For each tile ... |
73 |
DO bj = myByLo(myThid), myByHi(myThid) |
DO bj = myByLo(myThid), myByHi(myThid) |