/[MITgcm]/MITgcm/pkg/atm_compon_interf/cpl_register.F
ViewVC logotype

Annotation of /MITgcm/pkg/atm_compon_interf/cpl_register.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.6 - (hide annotations) (download)
Thu Dec 31 21:37:34 2015 UTC (8 years, 4 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65s, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, HEAD
Changes since 1.5: +1 -2 lines
remove unnecessary #include "ATMIDS.h"

1 jmc 1.6 C $Header: /u/gcmpack/MITgcm/pkg/atm_compon_interf/cpl_register.F,v 1.5 2015/11/12 01:01:58 jmc Exp $
2 jmc 1.2 C $Name: $
3 jmc 1.1
4 jmc 1.5 #include "ATM_CPL_OPTIONS.h"
5 jmc 1.1
6 jmc 1.2 CBOP 0
7     C !ROUTINE: CPL_REGISTER
8    
9     C !INTERFACE:
10 jmc 1.1 SUBROUTINE CPL_REGISTER
11 jmc 1.2
12     C !DESCRIPTION:
13 jmc 1.1 C *==========================================================*
14 jmc 1.2 C | SUBROUTINE CPL_REGISTER
15     C | o Routine controlling registration with MIT coupler.
16     C | - Atmospheric version -
17 jmc 1.1 C *==========================================================*
18 jmc 1.2 C | This version talks to the MIT Coupler. It uses the MIT
19     C | Coupler "checkpoint1" library calls.
20 jmc 1.1 C *==========================================================*
21 jmc 1.2
22     C !USES:
23 jmc 1.1 IMPLICIT NONE
24     C == Global variables ==
25     #include "SIZE.h"
26     #include "EEPARAMS.h"
27 jmc 1.3 #ifdef ALLOW_EXCH2
28     # include "W2_EXCH2_SIZE.h"
29     # include "W2_EXCH2_TOPOLOGY.h"
30     # include "W2_EXCH2_PARAMS.h"
31     #endif /* ALLOW_EXCH2 */
32 jmc 1.1
33 jmc 1.2 C !INPUT/OUTPUT PARAMETERS:
34 jmc 1.1 C == Routine arguments ==
35 jmc 1.2 C myThid :: Thread number for this instance of the routine
36     c INTEGER myThid
37     CEOP
38 jmc 1.1
39 jmc 1.2 #ifdef COMPONENT_MODULE
40     C !LOCAL VARIABLES:
41 jmc 1.1 C == Local variables ==
42 jmc 1.2 C bi, bj :: Tile indices
43     C j :: Loop counter
44     C iG0, jG0 :: Base coordinates of a tile on the global grid.
45 jmc 1.3 C iReg :: Array for passing attributes to the coupler
46 jmc 1.4 C x,ySize :: expected size of the coupler 2-D maps
47 jmc 1.2 INTEGER iG0, jG0
48     INTEGER bi, bj
49 jmc 1.3 INTEGER j, nTiles
50     INTEGER iReg(6,nSx*nSy)
51 jmc 1.4 c INTEGER xSize, ySize
52 jmc 1.3 #ifdef ALLOW_EXCH2
53     INTEGER tN
54 jmc 1.4 LOGICAL useExch2LayOut
55     #endif /* ALLOW_EXCH2 */
56    
57     C-- Set dimensions of coupler 2-D maps:
58     c xSize = Nx
59     c ySize = Ny
60    
61     #ifdef ALLOW_EXCH2
62     C-- Note: current coupler mapping relies only on i0,j0,nx,ny ; this prevent to
63     C map tiles to Exch-2 global map when faces do not fit in global-IO-array
64     C (see, e.g., gather/scatter_2d routines in eesupp/src, case where
65     C iGjLoc <> 0 or jGjLoc <> 1 ).
66     useExch2LayOut = .FALSE.
67     IF ( W2_useE2ioLayOut ) THEN
68     useExch2LayOut = .TRUE.
69     DO tN=1,exch2_nTiles
70     IF ( exch2_mydNx(tN) .GT. exch2_global_Nx ) THEN
71     useExch2LayOut = .FALSE.
72     C- face x-size larger than glob-size : fold it
73     c iGjLoc = 0
74     c jGjLoc = exch2_mydNx(tN) / xSize
75     ELSEIF ( exch2_tNy(tN) .GT. exch2_global_Ny ) THEN
76     useExch2LayOut = .FALSE.
77     C- tile y-size larger than glob-size : make a long line
78     c iGjLoc = exch2_mydNx(tN)
79     c jGjLoc = 0
80     ELSE
81     C- default (face fit into global-IO-array)
82     c iGjLoc = 0
83     c jGjLoc = 1
84     ENDIF
85     ENDDO
86     ENDIF
87     c IF ( useExch2LayOut ) THEN
88     c xSize = exch2_global_Nx
89     c ySize = exch2_global_Ny
90     c ENDIF
91     C-- Note: should check that xSize,ySize match with coupler Nx_atm,Ny_atm
92 jmc 1.3 #endif /* ALLOW_EXCH2 */
93 jmc 1.1
94     C-- Register with the MIT coupler
95 jmc 1.3 j = 0
96 jmc 1.1 DO bj=1,nSy
97     DO bi=1,nSx
98 jmc 1.3 j = j+1
99 jmc 1.1 jG0 = myYGlobalLo+(bj-1)*sNy
100     iG0 = myXGlobalLo+(bi-1)*sNx
101 jmc 1.3 #ifdef ALLOW_EXCH2
102 jmc 1.4 IF ( useExch2LayOut ) THEN
103 jmc 1.3 tN = W2_myTileList(bi,bj)
104     iG0 = exch2_txGlobalo(tN)
105     jG0 = exch2_tyGlobalo(tN)
106     ENDIF
107     #endif /* ALLOW_EXCH2 */
108     iReg(1,j) = bi
109     iReg(2,j) = bj
110     iReg(3,j) = sNx
111     iReg(4,j) = sNy
112     iReg(5,j) = iG0
113     iReg(6,j) = jG0
114 jmc 1.1 ENDDO
115     ENDDO
116 jmc 1.3 nTiles = nSx*nSy
117     CALL MITCOMPONENT_TILE_REGISTER( nTiles, iReg )
118 jmc 1.2 #endif /* COMPONENT_MODULE */
119 jmc 1.1
120     RETURN
121     END

  ViewVC Help
Powered by ViewVC 1.1.22