1 |
cnh |
1.3 |
C $Header: /u/gcmpack/models/MITgcmUV/model/src/ini_grid.F,v 1.2 1998/04/24 02:05:41 cnh Exp $ |
2 |
cnh |
1.1 |
|
3 |
|
|
#include "CPP_EEOPTIONS.h" |
4 |
|
|
|
5 |
|
|
CStartOfInterface |
6 |
|
|
SUBROUTINE INI_GRID( myThid ) |
7 |
|
|
C /==========================================================\ |
8 |
|
|
C | SUBROUTINE INI_GRID | |
9 |
|
|
C | o Initialise model grid | |
10 |
|
|
C |==========================================================| |
11 |
|
|
C | These arrays are used throughout the code in evaluating | |
12 |
|
|
C | gradients, integrals and spatial avarages. This routine | |
13 |
|
|
C | is called separately by each thread and initialise only | |
14 |
|
|
C | the region of the domain it is "responsible" for. | |
15 |
|
|
C | Notes: | |
16 |
|
|
C | Two examples are shown in this code. One illustrates the | |
17 |
|
|
C | initialisation of a cartesian grid. The other shows the | |
18 |
|
|
C | inialisation of a spherical polar grid. Other orthonormal| |
19 |
|
|
C | grids can be fitted into this design. In this case | |
20 |
|
|
C | custom metric terms also need adding to account for the | |
21 |
|
|
C | projections of velocity vectors onto these grids. | |
22 |
|
|
C | The structure used here also makes it possible to | |
23 |
|
|
C | implement less regular grid mappings. In particular | |
24 |
|
|
C | o Schemes which leave out blocks of the domain that are | |
25 |
|
|
C | all land could be supported. | |
26 |
|
|
C | o Multi-level schemes such as icosohedral or cubic | |
27 |
|
|
C | grid projectedions onto a sphere can also be fitted | |
28 |
|
|
C | within the strategy we use. | |
29 |
|
|
C | Both of the above also require modifying the support | |
30 |
|
|
C | routines that map computational blocks to simulation | |
31 |
|
|
C | domain blocks. | |
32 |
|
|
C \==========================================================/ |
33 |
|
|
|
34 |
|
|
C === Global variables === |
35 |
|
|
#include "SIZE.h" |
36 |
|
|
#include "EEPARAMS.h" |
37 |
|
|
#include "PARAMS.h" |
38 |
|
|
#include "GRID.h" |
39 |
|
|
|
40 |
|
|
C == Routine arguments == |
41 |
|
|
C myThid - Number of this instance of INI_GRID |
42 |
|
|
INTEGER myThid |
43 |
|
|
CEndOfInterface |
44 |
|
|
|
45 |
|
|
C == Local variables == |
46 |
|
|
C msgBuf - Used for informational I/O. |
47 |
|
|
CHARACTER*(MAX_LEN_MBUF) msgBuf |
48 |
|
|
|
49 |
|
|
C-- Set up grid coordinate system |
50 |
|
|
IF ( usingCartesianGrid ) THEN |
51 |
|
|
CALL INI_CARTESIAN_GRID( myThid ) |
52 |
|
|
ELSEIF ( usingSphericalPolarGrid ) THEN |
53 |
|
|
CALL INI_SPHERICAL_POLAR_GRID( myThid ) |
54 |
|
|
ELSE |
55 |
|
|
_BEGIN_MASTER(myThid) |
56 |
|
|
WRITE(msgBuf,'(A)') |
57 |
|
|
& 'S/R INI_GRID: No grid coordinate system has been selected' |
58 |
|
|
CALL PRINT_ERROR( msgBuf , myThid) |
59 |
|
|
STOP 'ABNORMAL END: S/R INI_GRID' |
60 |
|
|
_END_MASTER(myThid) |
61 |
|
|
ENDIF |
62 |
|
|
C |
63 |
|
|
RETURN |
64 |
|
|
END |