orog_mask_tools  1.12.0
 All Data Structures Files Functions Variables Pages
nb.F90
Go to the documentation of this file.
1 
7 MODULE cs_nb
8  IMPLICIT NONE
9 
12  INTEGER :: nb_tile_num
13  CHARACTER (1) :: nb_tile_bndry
14  END TYPE nb_tile_idx
15 
17  TYPE nb_gp_idx
18  INTEGER :: gp_type
19  INTEGER :: ijt(3,8)
20  END TYPE nb_gp_idx
21 
22  TYPE(nb_tile_idx):: nb_tile(4,6)
23 
24  INTEGER :: cres
25  integer :: xres
26  integer :: yres
27 
28 CONTAINS
29 
48  SUBROUTINE idx_init(cres_in)
49  INTEGER :: cres_in
50 
51  nb_tile(1,1)%nb_tile_num = 3; nb_tile(1,1)%nb_tile_bndry ='l'
52  nb_tile(2,1)%nb_tile_num = 6; nb_tile(2,1)%nb_tile_bndry ='t'
53  nb_tile(3,1)%nb_tile_num = 5; nb_tile(3,1)%nb_tile_bndry ='t'
54  nb_tile(4,1)%nb_tile_num = 2; nb_tile(4,1)%nb_tile_bndry ='l'
55 
56  nb_tile(1,2)%nb_tile_num = 3; nb_tile(1,2)%nb_tile_bndry ='b'
57  nb_tile(2,2)%nb_tile_num = 6; nb_tile(2,2)%nb_tile_bndry ='r'
58  nb_tile(3,2)%nb_tile_num = 1; nb_tile(3,2)%nb_tile_bndry ='r'
59  nb_tile(4,2)%nb_tile_num = 4; nb_tile(4,2)%nb_tile_bndry ='b'
60 
61  nb_tile(1,3)%nb_tile_num = 5; nb_tile(1,3)%nb_tile_bndry ='l'
62  nb_tile(2,3)%nb_tile_num = 2; nb_tile(2,3)%nb_tile_bndry ='t'
63  nb_tile(3,3)%nb_tile_num = 1; nb_tile(3,3)%nb_tile_bndry ='t'
64  nb_tile(4,3)%nb_tile_num = 4; nb_tile(4,3)%nb_tile_bndry ='l'
65 
66  nb_tile(1,4)%nb_tile_num = 5; nb_tile(1,4)%nb_tile_bndry ='b'
67  nb_tile(2,4)%nb_tile_num = 2; nb_tile(2,4)%nb_tile_bndry ='r'
68  nb_tile(3,4)%nb_tile_num = 3; nb_tile(3,4)%nb_tile_bndry ='r'
69  nb_tile(4,4)%nb_tile_num = 6; nb_tile(4,4)%nb_tile_bndry ='b'
70 
71  nb_tile(1,5)%nb_tile_num = 1; nb_tile(1,5)%nb_tile_bndry ='l'
72  nb_tile(2,5)%nb_tile_num = 4; nb_tile(2,5)%nb_tile_bndry ='t'
73  nb_tile(3,5)%nb_tile_num = 3; nb_tile(3,5)%nb_tile_bndry ='t'
74  nb_tile(4,5)%nb_tile_num = 6; nb_tile(4,5)%nb_tile_bndry ='l'
75 
76  nb_tile(1,6)%nb_tile_num = 1; nb_tile(1,6)%nb_tile_bndry ='b'
77  nb_tile(2,6)%nb_tile_num = 4; nb_tile(2,6)%nb_tile_bndry ='r'
78  nb_tile(3,6)%nb_tile_num = 5; nb_tile(3,6)%nb_tile_bndry ='r'
79  nb_tile(4,6)%nb_tile_num = 2; nb_tile(4,6)%nb_tile_bndry ='b'
80 
81  cres = cres_in
82 
83  END SUBROUTINE idx_init
84 
91  SUBROUTINE idx_init_reg(xres_in, yres_in)
92  INTEGER, INTENT(IN) :: xres_in, yres_in
93 
94  xres = xres_in
95  yres = yres_in
96 
97  END SUBROUTINE idx_init_reg
98 
106  INTEGER FUNCTION bndry(i, j)
107  INTEGER :: i,j
108 
109  bndry = 0 ! no boundary
110 
111  IF (j == cres) THEN ! upper boundary
112  bndry = 1
113  IF (i == 1) THEN
114  bndry = 13
115  ELSE IF (i == cres) THEN
116  bndry = 14
117  ENDIF
118  ELSE IF (j == 1) THEN ! bottom boundary
119  bndry = 2
120  IF (i == 1) THEN
121  bndry = 23
122  ELSE IF (i == cres) THEN
123  bndry = 24
124  ENDIF
125  ELSE IF (i == 1) THEN ! left boundary
126  bndry = 3
127  ELSE IF (i == cres) THEN ! right boundary
128  bndry = 4
129  ENDIF
130 
131  END FUNCTION bndry
132 
140  INTEGER FUNCTION bndry_reg(i, j)
141  INTEGER :: i,j
142 
143  bndry_reg = 0 ! no boundary
144 
145  IF (j == yres) THEN ! upper boundary
146  bndry_reg = 1
147  IF (i == 1) THEN
148  bndry_reg = 13
149  ELSE IF (i == xres) THEN
150  bndry_reg = 14
151  ENDIF
152  ELSE IF (j == 1) THEN ! bottom boundary
153  bndry_reg = 2
154  IF (i == 1) THEN
155  bndry_reg = 23
156  ELSE IF (i == xres) THEN
157  bndry_reg = 24
158  ENDIF
159  ELSE IF (i == 1) THEN ! left boundary
160  bndry_reg = 3
161  ELSE IF (i == xres) THEN ! right boundary
162  bndry_reg = 4
163  ENDIF
164 
165  END FUNCTION bndry_reg
166 
192  SUBROUTINE neighbors(tile, i, j, nb)
193  INTEGER :: tile, i, j
194  TYPE(nb_gp_idx) :: nb
195 
196  INTEGER :: bd, nb_t_num
197 
198  nb%gp_type = bndry(i,j)
199  IF (nb%gp_type == 0) THEN ! interior (non-boundary) cell
200  ! top, bottom, left, and right
201  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = tile
202  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = tile
203  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = tile
204  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = tile
205  ! top left, top right, bottom left, and bottom right
206  nb%ijt(1,5) = i-1; nb%ijt(2,5) = j+1; nb%ijt(3,5) = tile
207  nb%ijt(1,6) = i+1; nb%ijt(2,6) = j+1; nb%ijt(3,6) = tile
208  nb%ijt(1,7) = i-1; nb%ijt(2,7) = j-1; nb%ijt(3,7) = tile
209  nb%ijt(1,8) = i+1; nb%ijt(2,8) = j-1; nb%ijt(3,8) = tile
210  ELSEIF (nb%gp_type == 1) THEN ! top boundary cell
211  bd = 1
212  nb_t_num = nb_tile(nb%gp_type,tile)%nb_tile_num
213  nb%ijt(3,1)=nb_t_num; nb%ijt(3,5)=nb_t_num; nb%ijt(3,6)=nb_t_num
214  IF (nb_tile(bd,tile)%nb_tile_bndry == 'l') THEN
215  nb%ijt(1,1) = 1; nb%ijt(2,1) = cres+1-i;
216  nb%ijt(1,5) = 1; nb%ijt(2,5) = cres+1-(i-1);
217  nb%ijt(1,6) = 1; nb%ijt(2,6) = cres+1-(i+1);
218  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 'b') THEN
219  nb%ijt(1,1) = i; nb%ijt(2,1) = 1
220  nb%ijt(1,5) = i-1; nb%ijt(2,5) = 1
221  nb%ijt(1,6) = i+1; nb%ijt(2,6) = 1
222  ENDIF
223  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = tile
224  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = tile
225  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = tile
226  nb%ijt(1,7) = i-1; nb%ijt(2,7) = j-1; nb%ijt(3,7) = tile
227  nb%ijt(1,8) = i+1; nb%ijt(2,8) = j-1; nb%ijt(3,8) = tile
228  ELSEIF (nb%gp_type == 2) THEN ! bottom boundary cell
229  bd = 2
230  nb_t_num = nb_tile(nb%gp_type,tile)%nb_tile_num
231  nb%ijt(3,4)=nb_t_num; nb%ijt(3,7)=nb_t_num; nb%ijt(3,8)=nb_t_num
232  IF (nb_tile(bd,tile)%nb_tile_bndry == 'r') THEN
233  nb%ijt(1,4) = cres; nb%ijt(2,4) = cres+1-i;
234  nb%ijt(1,7) = cres; nb%ijt(2,7) = cres+1-(i-1);
235  nb%ijt(1,8) = cres; nb%ijt(2,8) = cres+1-(i+1);
236  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 't') THEN
237  nb%ijt(1,4) = i; nb%ijt(2,4) = cres
238  nb%ijt(1,7) = i-1; nb%ijt(2,7) = cres
239  nb%ijt(1,8) = i+1; nb%ijt(2,8) = cres
240  ENDIF
241  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = tile
242  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = tile
243  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = tile
244  nb%ijt(1,5) = i-1; nb%ijt(2,5) = j+1; nb%ijt(3,5) = tile
245  nb%ijt(1,6) = i+1; nb%ijt(2,6) = j+1; nb%ijt(3,6) = tile
246  ELSEIF (nb%gp_type == 3) THEN ! left boundary cell
247  bd = 3
248  nb_t_num = nb_tile(nb%gp_type,tile)%nb_tile_num
249  nb%ijt(3,2)=nb_t_num; nb%ijt(3,5)=nb_t_num; nb%ijt(3,7)=nb_t_num
250  IF (nb_tile(bd,tile)%nb_tile_bndry == 'r') THEN
251  nb%ijt(1,2) = cres; nb%ijt(2,2) = j;
252  nb%ijt(1,5) = cres; nb%ijt(2,5) = j+1;
253  nb%ijt(1,7) = cres; nb%ijt(2,7) = j-1;
254  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 't') THEN
255  nb%ijt(1,2) = cres+1-j; nb%ijt(2,2) = cres
256  nb%ijt(1,5) = cres+1-(j+1); nb%ijt(2,5) = cres
257  nb%ijt(1,7) = cres+1-(j-1); nb%ijt(2,7) = cres
258  ENDIF
259  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = tile
260  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = tile
261  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = tile
262  nb%ijt(1,6) = i+1; nb%ijt(2,6) = j+1; nb%ijt(3,6) = tile
263  nb%ijt(1,8) = i+1; nb%ijt(2,8) = j-1; nb%ijt(3,8) = tile
264  ELSEIF (nb%gp_type == 4) THEN ! right boundary cell
265  bd = 4
266  nb_t_num = nb_tile(nb%gp_type,tile)%nb_tile_num
267  nb%ijt(3,3)=nb_t_num; nb%ijt(3,6)=nb_t_num; nb%ijt(3,8)=nb_t_num
268  IF (nb_tile(bd,tile)%nb_tile_bndry == 'l') THEN
269  nb%ijt(1,3) = 1; nb%ijt(2,3) = j;
270  nb%ijt(1,6) = 1; nb%ijt(2,6) = j+1;
271  nb%ijt(1,8) = 1; nb%ijt(2,8) = j-1;
272  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 'b') THEN
273  nb%ijt(1,3) = cres+1-j; nb%ijt(2,3) = 1
274  nb%ijt(1,6) = cres+1-(j+1); nb%ijt(2,6) = 1
275  nb%ijt(1,8) = cres+1-(j-1); nb%ijt(2,8) = 1
276  ENDIF
277  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = tile
278  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = tile
279  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = tile
280  nb%ijt(1,5) = i-1; nb%ijt(2,5) = j+1; nb%ijt(3,5) = tile
281  nb%ijt(1,7) = i-1; nb%ijt(2,7) = j-1; nb%ijt(3,7) = tile
282  ELSEIF (nb%gp_type == 13) THEN ! upper left coner
283  bd = 1
284  nb_t_num = nb_tile(bd,tile)%nb_tile_num
285  nb%ijt(3,1)=nb_t_num; nb%ijt(3,6)=nb_t_num
286  IF (nb_tile(bd,tile)%nb_tile_bndry == 'l') THEN
287  nb%ijt(1,1) = 1; nb%ijt(2,1) = cres+1-i
288  nb%ijt(1,6) = 1; nb%ijt(2,6) = cres+1-(i+1)
289  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 'b') THEN
290  nb%ijt(1,1) = i; nb%ijt(2,1) = 1
291  nb%ijt(1,6) = i+1; nb%ijt(2,6) = 1
292  ENDIF
293  bd = 3
294  nb_t_num = nb_tile(bd,tile)%nb_tile_num
295  nb%ijt(3,2)=nb_t_num; nb%ijt(3,7)=nb_t_num
296  IF (nb_tile(bd,tile)%nb_tile_bndry == 'r') THEN
297  nb%ijt(1,2) = cres; nb%ijt(2,2) = j
298  nb%ijt(1,7) = cres; nb%ijt(2,7) = j-1
299  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 't') THEN
300  nb%ijt(1,2) = cres+1-j; nb%ijt(2,2) = cres
301  nb%ijt(1,7) = cres+1-(j-1); nb%ijt(2,7) = cres
302  ENDIF
303  nb%ijt(3,5)=0
304  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = tile
305  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = tile
306  nb%ijt(1,8) = i+1; nb%ijt(2,8) = j-1; nb%ijt(3,8) = tile
307  ELSEIF (nb%gp_type == 14) THEN ! upper right coner
308  bd = 1
309  nb_t_num = nb_tile(bd,tile)%nb_tile_num
310  nb%ijt(3,1)=nb_t_num; nb%ijt(3,5)=nb_t_num
311  IF (nb_tile(bd,tile)%nb_tile_bndry == 'l') THEN
312  nb%ijt(1,1) = 1; nb%ijt(2,1) = cres+1-i
313  nb%ijt(1,5) = 1; nb%ijt(2,5) = cres+1-(i-1)
314  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 'b') THEN
315  nb%ijt(1,1) = i; nb%ijt(2,1) = 1
316  nb%ijt(1,5) = i-1; nb%ijt(2,5) = 1
317  ENDIF
318  bd = 4
319  nb_t_num = nb_tile(bd,tile)%nb_tile_num
320  nb%ijt(3,3)=nb_t_num; nb%ijt(3,8)=nb_t_num
321  IF (nb_tile(bd,tile)%nb_tile_bndry == 'l') THEN
322  nb%ijt(1,3) = 1; nb%ijt(2,3) = j
323  nb%ijt(1,8) = 1; nb%ijt(2,8) = j-1
324  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 'b') THEN
325  nb%ijt(1,3) = cres+1-j; nb%ijt(2,3) = 1
326  nb%ijt(1,8) = cres+1-(j-1); nb%ijt(2,8) = 1
327  ENDIF
328  nb%ijt(3,6)=0
329  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = tile
330  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = tile
331  nb%ijt(1,7) = i-1; nb%ijt(2,7) = j-1; nb%ijt(3,7) = tile
332  ELSEIF (nb%gp_type == 23) THEN ! lower left coner
333  bd = 2
334  nb_t_num = nb_tile(bd,tile)%nb_tile_num
335  nb%ijt(3,4)=nb_t_num; nb%ijt(3,8)=nb_t_num
336  IF (nb_tile(bd,tile)%nb_tile_bndry == 'r') THEN
337  nb%ijt(1,4) = cres; nb%ijt(2,4) = cres+1-i
338  nb%ijt(1,8) = cres; nb%ijt(2,8) = cres+1-(i+1)
339  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 't') THEN
340  nb%ijt(1,4) = i; nb%ijt(2,4) = cres
341  nb%ijt(1,8) = i+1; nb%ijt(2,8) = cres
342  ENDIF
343  bd = 3
344  nb_t_num = nb_tile(bd,tile)%nb_tile_num
345  nb%ijt(3,2)=nb_t_num; nb%ijt(3,5)=nb_t_num
346  IF (nb_tile(bd,tile)%nb_tile_bndry == 'r') THEN
347  nb%ijt(1,2) = cres; nb%ijt(2,2) = j
348  nb%ijt(1,5) = cres; nb%ijt(2,5) = j+1
349  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 't') THEN
350  nb%ijt(1,2) = cres+1-j; nb%ijt(2,2) = cres
351  nb%ijt(1,5) = cres+1-(j+1); nb%ijt(2,5) = cres
352  ENDIF
353  nb%ijt(3,7)=0
354  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = tile
355  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = tile
356  nb%ijt(1,6) = i+1; nb%ijt(2,6) = j+1; nb%ijt(3,6) = tile
357  ELSEIF (nb%gp_type == 24) THEN ! lower right coner
358  bd = 2
359  nb_t_num = nb_tile(bd,tile)%nb_tile_num
360  nb%ijt(3,4)=nb_t_num; nb%ijt(3,7)=nb_t_num
361  IF (nb_tile(bd,tile)%nb_tile_bndry == 'r') THEN
362  nb%ijt(1,4) = cres; nb%ijt(2,4) = cres+1-i
363  nb%ijt(1,7) = cres; nb%ijt(2,7) = cres+1-(i-1)
364  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 't') THEN
365  nb%ijt(1,4) = i; nb%ijt(2,4) = cres
366  nb%ijt(1,7) = i-1; nb%ijt(2,7) = cres
367  ENDIF
368  bd = 4
369  nb_t_num = nb_tile(bd,tile)%nb_tile_num
370  nb%ijt(3,3)=nb_t_num; nb%ijt(3,6)=nb_t_num
371  IF (nb_tile(bd,tile)%nb_tile_bndry == 'l') THEN
372  nb%ijt(1,3) = 1; nb%ijt(2,3) = j
373  nb%ijt(1,6) = 1; nb%ijt(2,6) = j+1
374  ELSEIF (nb_tile(bd,tile)%nb_tile_bndry == 'b') THEN
375  nb%ijt(1,3) = cres+1-j; nb%ijt(2,3) = 1
376  nb%ijt(1,6) = cres+1-(j+1); nb%ijt(2,6) = 1
377  ENDIF
378  nb%ijt(3,8)=0
379  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = tile
380  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = tile
381  nb%ijt(1,5) = i-1; nb%ijt(2,5) = j+1; nb%ijt(3,5) = tile
382 
383  ENDIF
384  END SUBROUTINE neighbors
385 
393  SUBROUTINE neighbors_reg(i, j, nb)
394  INTEGER :: i, j
395  TYPE(nb_gp_idx) :: nb
396 
397 ! assign the standard interior cell neighbors as default values
398  ! top, bottom, left, and right
399  nb%ijt(1,1) = i; nb%ijt(2,1) = j+1; nb%ijt(3,1) = 1
400  nb%ijt(1,2) = i-1; nb%ijt(2,2) = j; nb%ijt(3,2) = 1
401  nb%ijt(1,3) = i+1; nb%ijt(2,3) = j; nb%ijt(3,3) = 1
402  nb%ijt(1,4) = i; nb%ijt(2,4) = j-1; nb%ijt(3,4) = 1
403  ! top left, top right, bottom left, and bottom right
404  nb%ijt(1,5) = i-1; nb%ijt(2,5) = j+1; nb%ijt(3,5) = 1
405  nb%ijt(1,6) = i+1; nb%ijt(2,6) = j+1; nb%ijt(3,6) = 1
406  nb%ijt(1,7) = i-1; nb%ijt(2,7) = j-1; nb%ijt(3,7) = 1
407  nb%ijt(1,8) = i+1; nb%ijt(2,8) = j-1; nb%ijt(3,8) = 1
408 
409  nb%gp_type = bndry_reg(i,j)
410  IF (nb%gp_type == 1) THEN !top boundary cell
411  nb%ijt(3,1) = 0; nb%ijt(3,5) = 0; nb%ijt(3,6) = 0
412  ELSEIF (nb%gp_type == 2) THEN !bottom boundary cell
413  nb%ijt(3,4) = 0; nb%ijt(3,7) = 0; nb%ijt(3,8) = 0
414  ELSEIF (nb%gp_type == 3) THEN !left boundary cell
415  nb%ijt(3,2) = 0; nb%ijt(3,5) = 0; nb%ijt(3,7) = 0
416  ELSEIF (nb%gp_type == 4) THEN !right boundary cell
417  nb%ijt(3,3) = 0; nb%ijt(3,6) = 0; nb%ijt(3,8) = 0
418  ELSEIF (nb%gp_type == 13) THEN ! upper left coner
419  nb%ijt(3,1) = 0; nb%ijt(3,5) = 0; nb%ijt(3,6) = 0;
420  nb%ijt(3,2) = 0; nb%ijt(3,7) = 0
421  ELSEIF (nb%gp_type == 14) THEN ! upper right coner
422  nb%ijt(3,1) = 0; nb%ijt(3,5) = 0; nb%ijt(3,6) = 0;
423  nb%ijt(3,3) = 0; nb%ijt(3,8) = 0
424  ELSEIF (nb%gp_type == 23) THEN ! lower left coner
425  nb%ijt(3,4) = 0; nb%ijt(3,7) = 0; nb%ijt(3,8) = 0
426  nb%ijt(3,2) = 0; nb%ijt(3,5) = 0;
427  ELSEIF (nb%gp_type == 24) THEN ! lower right coner
428  nb%ijt(3,4) = 0; nb%ijt(3,7) = 0; nb%ijt(3,8) = 0
429  nb%ijt(3,3) = 0; nb%ijt(3,6) = 0;
430  ENDIF
431 
432  END SUBROUTINE neighbors_reg
433 
434 END MODULE cs_nb
435 
436 #ifdef TEST_CS_NB
437 PROGRAM test_nb
438  USE cs_nb
439 
440  INTEGER :: tile, i, j
441  TYPE(nb_gp_idx) :: nbs
442 
443  INTEGER, PARAMETER :: res = 96
444 
445  CALL idx_init(res)
446 ! tile = 1; i = 1; j = 5
447 ! tile = 1; i = 5; j = 1
448 ! tile = 1; i = 96; j = 10
449  tile = 2; i = 96; j = 96
450  CALL neighbors(tile, i, j, nbs)
451  print*, 'tile = ', tile, ' i = ',i, ' j = ', j
452  print*, 'nbs%type: ', nbs%gp_type
453  print*, 'nbs%ijt: '
454  print*, nbs%ijt
455 END PROGRAM test_nb
456 #endif
subroutine neighbors(tile, i, j, nb)
Get neighbors of cell 'c' at (tile, i, j) for global grid.
Definition: nb.F90:192
Neighboring cell descriptor.
Definition: nb.F90:17
subroutine idx_init(cres_in)
Initialize inter-panel neighbor index for global grid.
Definition: nb.F90:48
Neighboring tile descriptor.
Definition: nb.F90:11
Definition: nb.F90:7
subroutine neighbors_reg(i, j, nb)
Get neighbors of cell 'c' at (tile, i, j) for regional grid.
Definition: nb.F90:393
INTEGER function bndry_reg(i, j)
Get boundary type from indices for regional grid.
Definition: nb.F90:140
INTEGER function bndry(i, j)
Get boundary type from indices for global grid.
Definition: nb.F90:106
subroutine idx_init_reg(xres_in, yres_in)
Initialize resolution module variables for regional grid.
Definition: nb.F90:91