1 |
C $Header$ |
C $Header$ |
2 |
C $Name$ |
C $Name$ |
3 |
|
|
4 |
|
#include "PACKAGES_CONFIG.h" |
5 |
#include "CPP_OPTIONS.h" |
#include "CPP_OPTIONS.h" |
6 |
|
|
7 |
CStartOfInterface |
CBOP 0 |
8 |
|
C !ROUTINE: CPL_REGISTER |
9 |
|
|
10 |
|
C !INTERFACE: |
11 |
SUBROUTINE CPL_REGISTER |
SUBROUTINE CPL_REGISTER |
12 |
|
|
13 |
|
C !DESCRIPTION: |
14 |
C *==========================================================* |
C *==========================================================* |
15 |
C | SUBROUTINE CPL_REGISTER | |
C | SUBROUTINE CPL_REGISTER |
16 |
C | o Routine controlling registration with MIT coupler. | |
C | o Routine controlling registration with MIT coupler. |
17 |
C | - Atmospheric version - | |
C | - Atmospheric version - |
18 |
C *==========================================================* |
C *==========================================================* |
19 |
C | This version talks to the MIT Coupler. It uses the MIT | |
C | This version talks to the MIT Coupler. It uses the MIT |
20 |
C | Coupler "checkpoint1" library calls. | |
C | Coupler "checkpoint1" library calls. |
21 |
C *==========================================================* |
C *==========================================================* |
|
IMPLICIT NONE |
|
22 |
|
|
23 |
|
C !USES: |
24 |
|
IMPLICIT NONE |
25 |
C == Global variables == |
C == Global variables == |
26 |
#include "SIZE.h" |
#include "SIZE.h" |
27 |
#include "EEPARAMS.h" |
#include "EEPARAMS.h" |
28 |
#include "ATMIDS.h" |
#include "ATMIDS.h" |
29 |
|
#ifdef ALLOW_EXCH2 |
30 |
|
# include "W2_EXCH2_SIZE.h" |
31 |
|
# include "W2_EXCH2_TOPOLOGY.h" |
32 |
|
# include "W2_EXCH2_PARAMS.h" |
33 |
|
#endif /* ALLOW_EXCH2 */ |
34 |
|
|
35 |
|
C !INPUT/OUTPUT PARAMETERS: |
36 |
C == Routine arguments == |
C == Routine arguments == |
37 |
C myThid - Thread number for this instance of the routine |
C myThid :: Thread number for this instance of the routine |
38 |
INTEGER myThid |
c INTEGER myThid |
39 |
CEndOfInterface |
CEOP |
40 |
|
|
|
C == Local variables == |
|
41 |
#ifdef COMPONENT_MODULE |
#ifdef COMPONENT_MODULE |
42 |
C Arrays for passing attributes to the coupler |
C !LOCAL VARIABLES: |
43 |
INTEGER iReg(4,nSx,nSy) |
C == Local variables == |
44 |
Real*4 rReg(4,nSx,nSy) |
C bi, bj :: Tile indices |
45 |
C bi, bj, J - Loop counters |
C j :: Loop counter |
46 |
INTEGER bi,bj,J |
C iG0, jG0 :: Base coordinates of a tile on the global grid. |
47 |
C Base coordinates of a tile on the global grid. |
C iReg :: Array for passing attributes to the coupler |
48 |
INTEGER iG0, jG0 |
INTEGER iG0, jG0 |
49 |
#endif |
INTEGER bi, bj |
50 |
|
INTEGER j, nTiles |
51 |
|
INTEGER iReg(6,nSx*nSy) |
52 |
|
#ifdef ALLOW_EXCH2 |
53 |
|
INTEGER tN |
54 |
|
#endif /* ALLOW_EXCH2 */ |
55 |
|
|
56 |
C-- Register with the MIT coupler |
C-- Register with the MIT coupler |
57 |
#ifdef COMPONENT_MODULE |
j = 0 |
58 |
DO bj=1,nSy |
DO bj=1,nSy |
59 |
DO bi=1,nSx |
DO bi=1,nSx |
60 |
|
j = j+1 |
61 |
jG0 = myYGlobalLo+(bj-1)*sNy |
jG0 = myYGlobalLo+(bj-1)*sNy |
62 |
iG0 = myXGlobalLo+(bi-1)*sNx |
iG0 = myXGlobalLo+(bi-1)*sNx |
63 |
IREG(1,bi,bj)=sNx |
#ifdef ALLOW_EXCH2 |
64 |
IREG(2,bi,bj)=sNy |
IF ( W2_useE2ioLayOut ) THEN |
65 |
IREG(3,bi,bj)=iG0 |
tN = W2_myTileList(bi,bj) |
66 |
IREG(4,bi,bj)=jG0 |
iG0 = exch2_txGlobalo(tN) |
67 |
|
jG0 = exch2_tyGlobalo(tN) |
68 |
|
ENDIF |
69 |
|
#endif /* ALLOW_EXCH2 */ |
70 |
|
iReg(1,j) = bi |
71 |
|
iReg(2,j) = bj |
72 |
|
iReg(3,j) = sNx |
73 |
|
iReg(4,j) = sNy |
74 |
|
iReg(5,j) = iG0 |
75 |
|
iReg(6,j) = jG0 |
76 |
ENDDO |
ENDDO |
77 |
ENDDO |
ENDDO |
78 |
CALL MITCOMPONENT_TILE_REGISTER( nSx, nSy, ireg, rreg ) |
nTiles = nSx*nSy |
79 |
#endif |
CALL MITCOMPONENT_TILE_REGISTER( nTiles, iReg ) |
80 |
|
#endif /* COMPONENT_MODULE */ |
81 |
|
|
82 |
RETURN |
RETURN |
83 |
END |
END |