orog_mask_tools 1.14.0
Loading...
Searching...
No Matches
nb.F90 File Reference

This module contains the subroutines that find the adjacent neighbors of a given cell, in a cubed sphere grid. More...

Go to the source code of this file.

Data Types

type  cs_nb::nb_gp_idx
 Neighboring cell descriptor. More...
 
type  cs_nb::nb_tile_idx
 Neighboring tile descriptor. More...
 

Functions/Subroutines

integer function cs_nb::bndry (i, j)
 Get boundary type from indices for global grid.
 
integer function cs_nb::bndry_reg (i, j)
 Get boundary type from indices for regional grid.
 
subroutine cs_nb::idx_init (cres_in)
 Initialize inter-panel neighbor index for global grid.
 
subroutine cs_nb::idx_init_reg (xres_in, yres_in)
 Initialize resolution module variables for regional grid.
 
subroutine cs_nb::neighbors (tile, i, j, nb)
 Get neighbors of cell 'c' at (tile, i, j) for global grid.
 
subroutine cs_nb::neighbors_reg (i, j, nb)
 Get neighbors of cell 'c' at (tile, i, j) for regional grid.
 

Variables

integer cs_nb::cres
 Cubed sphere resolution.
 
type(nb_tile_idx), dimension(4, 6) cs_nb::nb_tile
 Descriptor for each edge of each tile on the cubed sphere.
 
integer cs_nb::xres
 x resolution of regional grid
 
integer cs_nb::yres
 y resolution of regional grid
 

Detailed Description

This module contains the subroutines that find the adjacent neighbors of a given cell, in a cubed sphere grid.

Each neighbor is in the form of (i,j,tile).

Author
Ning Wang
Date
July 1, 2020

Definition in file nb.F90.

Function/Subroutine Documentation

◆ bndry()

integer function cs_nb::bndry ( integer i,
integer j )

Get boundary type from indices for global grid.

Parameters
[in]icell index
[in]jcell index
Returns
bndry cell boundary type
Author
Ning Wang

Definition at line 106 of file nb.F90.

◆ bndry_reg()

integer function cs_nb::bndry_reg ( integer i,
integer j )

Get boundary type from indices for regional grid.

Parameters
[in]icell index
[in]jcell index
Returns
cell boundary type
Author
Ning Wang

Definition at line 140 of file nb.F90.

◆ idx_init()

subroutine cs_nb::idx_init ( integer cres_in)

Initialize inter-panel neighbor index for global grid.

Parameters
[in]cres_incubed sphere resolution (48, 96...)
  !!   _______1_______
  !!  |               |       1-upper, 2-bottom, 3-left, 4-right 
  !!  |               |
  !!  |               |
  !! 3|               |4
  !!  |               |
  !!  |               |
  !!  |_______________|
  !!          2
  !!      Figure 1. Boundary numbers
  !! 


Author
Ning Wang

Definition at line 48 of file nb.F90.

◆ idx_init_reg()

subroutine cs_nb::idx_init_reg ( integer, intent(in) xres_in,
integer, intent(in) yres_in )

Initialize resolution module variables for regional grid.

Parameters
[in]xres_inx resolution
[in]yres_iny resolution
Author
Ning Wang

Definition at line 91 of file nb.F90.

◆ neighbors()

subroutine cs_nb::neighbors ( integer tile,
integer i,
integer j,
type(nb_gp_idx) nb )

Get neighbors of cell 'c' at (tile, i, j) for global grid.

  !!     ______________
  !!    |    |    |    |              ________
  !!    | 5  | 1  | 6  |             /\ 1 \ 6 \
  !!    |____|____|____|            /  \___\___\
  !!    |    |    |    |           /\2 / c / 3 /
  !!    | 2  | c  | 3  |          /  \/___/___/
  !!    |____|____|____|          \7 / 4 / 8 /
  !!    |    |    |    |           \/___/___/
  !!    | 7  | 4  | 8  |       
  !!    |____|____|____|    
  !!  
  !! Figure 2.  Eight neighbors of cell 'c' and special cases at upper left
  !! cornner of the tile
  !! 
Parameters
[in]tiletile face
[in]icell index
[in]jcell index
[out]nbneighbors
Author
Ning Wang

Definition at line 192 of file nb.F90.

◆ neighbors_reg()

subroutine cs_nb::neighbors_reg ( integer i,
integer j,
type(nb_gp_idx) nb )

Get neighbors of cell 'c' at (tile, i, j) for regional grid.

Parameters
[in]icell index
[in]jcell index
[out]nbneighbors
Author
Ning Wang

Definition at line 393 of file nb.F90.

Variable Documentation

◆ cres

integer cs_nb::cres

Cubed sphere resolution.

Definition at line 24 of file nb.F90.

◆ nb_tile

type(nb_tile_idx), dimension(4,6) cs_nb::nb_tile

Descriptor for each edge of each tile on the cubed sphere.

Definition at line 22 of file nb.F90.

◆ xres

integer cs_nb::xres

x resolution of regional grid

Definition at line 25 of file nb.F90.

◆ yres

integer cs_nb::yres

y resolution of regional grid

Definition at line 26 of file nb.F90.