/[MITgcm]/MITgcm/pkg/exch2/exch2_get_scal_bounds.F
ViewVC logotype

Contents of /MITgcm/pkg/exch2/exch2_get_scal_bounds.F

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


Revision 1.1 - (show annotations) (download)
Sat May 30 21:22:13 2009 UTC (14 years, 11 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint62, checkpoint63, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint61z, checkpoint61x, checkpoint61y, HEAD
simplify argument list of S/R exch2_get_uv_bounds and exch2_get_scal_bounds
 (which replaces exch2_get_recv_bounds & exch2_get_send_bounds) by including
 Topology header file (and common blocks);
implement EXCH_IGNORE_CORNERS in S/R exch2_get_scal_bounds.

1 C $Header: /u/gcmpack/MITgcm/pkg/exch2/exch2_get_send_bounds.F,v 1.3 2007/10/09 00:03:33 jmc Exp $
2 C $Name: $
3
4 #include "CPP_EEOPTIONS.h"
5
6 CBOP 0
7 C !ROUTINE: EXCH2_GET_SCAL_BOUNDS
8
9 C !INTERFACE:
10 SUBROUTINE EXCH2_GET_SCAL_BOUNDS(
11 I fCode, eWdth, updateCorners,
12 I tgTile, tgNb,
13 O tIlo, tIhi, tJlo, tJhi,
14 O tiStride, tjStride,
15 I myThid )
16
17 C !DESCRIPTION:
18 C Return the index range & step of the part of the array (overlap-region)
19 C which is going to be updated by the exchange with 1 neighbour.
20 C Scalar field version (as opposed to 2-components vector field).
21 C Note: presently only coded for grid-centered (mass point) scalar.
22 C needs to extend it to grid-corner (vorticity point) scalar.
23
24 C !USES:
25 IMPLICIT NONE
26
27 #include "SIZE.h"
28 #include "W2_EXCH2_SIZE.h"
29 #include "W2_EXCH2_TOPOLOGY.h"
30
31 C !INPUT/OUTPUT PARAMETERS:
32 C fCode :: field code (position on staggered grid)
33 C eWdth :: width of data region to exchange
34 C updateCorners :: flag, do update corner halo region if true
35 C tgTile :: target tile
36 C tgNb :: target Neighbour entry
37 C tIlo, tIhi :: index range in I that will be filled in target array
38 C tJlo, tJhi :: index range in J that will be filled in target array
39 C tiStride :: index step in I that will be filled in target array
40 C tjStride :: index step in J that will be filled in target array
41 C myThid :: my Thread Id. number
42
43 CHARACTER*2 fCode
44 INTEGER eWdth
45 LOGICAL updateCorners
46 INTEGER tgTile, tgNb
47 INTEGER tIlo, tIhi, tJlo, tJhi
48 INTEGER tiStride, tjStride
49 INTEGER myThid
50
51 C !LOCAL VARIABLES:
52 CEOP
53
54 C--- Initialise index range from Topology values:
55 tIlo = exch2_iLo(tgNb,tgTile)
56 tIhi = exch2_iHi(tgNb,tgTile)
57 tJlo = exch2_jLo(tgNb,tgTile)
58 tJhi = exch2_jHi(tgNb,tgTile)
59
60 C--- Expand index range according to exchange-Width "eWdth"
61 IF ( tIlo .EQ. tIhi .AND. tIlo .EQ. 0 ) THEN
62 C Filling a west edge overlap
63 tIlo = 1-eWdth
64 tiStride = 1
65 IF ( tJlo .LE. tJhi ) THEN
66 tjStride = 1
67 ELSE
68 tjStride =-1
69 ENDIF
70 IF ( updateCorners ) THEN
71 tJlo = tJlo-tjStride*(eWdth-1)
72 tJhi = tJhi+tjStride*(eWdth-1)
73 ELSE
74 tJlo = tJlo+tjStride
75 tJhi = tJhi-tjStride
76 ENDIF
77 ENDIF
78 IF ( tIlo .EQ. tIhi .AND. tIlo .GT. 1 ) THEN
79 C Filling an east edge overlap
80 tIhi = tIhi+eWdth-1
81 tiStride = 1
82 IF ( tJlo .LE. tJhi ) THEN
83 tjStride = 1
84 ELSE
85 tjStride =-1
86 ENDIF
87 IF ( updateCorners ) THEN
88 tJlo = tJlo-tjStride*(eWdth-1)
89 tJhi = tJhi+tjStride*(eWdth-1)
90 ELSE
91 tJlo = tJlo+tjStride
92 tJhi = tJhi-tjStride
93 ENDIF
94 ENDIF
95 IF ( tJlo .EQ. tJhi .AND. tJlo .EQ. 0 ) THEN
96 C Filling a south edge overlap
97 tJlo = 1-eWdth
98 tjStride = 1
99 IF ( tIlo .LE. tIhi ) THEN
100 tiStride = 1
101 ELSE
102 tiStride =-1
103 ENDIF
104 IF ( updateCorners ) THEN
105 tIlo = tIlo-tiStride*(eWdth-1)
106 tIhi = tIhi+tiStride*(eWdth-1)
107 ELSE
108 tIlo = tIlo+tiStride
109 tIhi = tIhi-tiStride
110 ENDIF
111 ENDIF
112 IF ( tJlo .EQ. tJhi .AND. tJlo .GT. 1 ) THEN
113 C Filling a north edge overlap
114 tJhi = tJhi+eWdth-1
115 tjStride = 1
116 IF ( tIlo .LE. tIhi ) THEN
117 tiStride = 1
118 ELSE
119 tiStride =-1
120 ENDIF
121 IF ( updateCorners ) THEN
122 tIlo = tIlo-tiStride*(eWdth-1)
123 tIhi = tIhi+tiStride*(eWdth-1)
124 ELSE
125 tIlo = tIlo+tiStride
126 tIhi = tIhi-tiStride
127 ENDIF
128 ENDIF
129
130 RETURN
131 END

  ViewVC Help
Powered by ViewVC 1.1.22