PUBLIC INTERFACE
use bgrid_horiz_mod [ ,only: horiz_grid_type,
bgrid_type,
horiz_grid_init,
get_horiz_grid_size,
get_horiz_grid_bound,
update_np, update_sp,
TGRID, VGRID ]
bgrid_type, horiz_grid_type
Data structues (i.e., derived-type variables) containing
horizontal grid constants needed by the B-grid dynamical core.
horiz_grid_init
Function that initializes/returns a variable of
type (horiz_grid_type).
get_horiz_grid_size
Subroutine that returns the number of grid boxes along the x and
y axes of the temperature grid or velocity grid. There is an
option for returning either the global or local compute grid sizes.
Usually used in conjunction with routine get_horiz_grid_bound.
get_horiz_grid_bound
Subroutine that returns the longitude and latitude boundaries (edges)
of temperature or velocity grid boxes. There is an option for
returning either the global or local compute grid edges.
Routine get_horiz_grid_size is usually called first to get
the axis sizes.
update_np, update_sp
Logical functions that determine if the northern (or southern)
halo rows for the local processor lie within the global halo
rows (ie.e, need a polar boundary update).
TGRID, VGRID
Integer parameters to be used as the "grid" argument with interfaces
get_horiz_grid_size, get_horiz_grid_bound, update_np, and update_sp.
PUBLIC DATA
TYPE bgrid_type
is, ie starting, ending x-axis index in the compute domain [integer,scalar]
js, je starting, ending y-axis index in the compute domain [integer,scalar]
isd, ied starting, ending x-axis index in the data domain [integer,scalar]
jsd, jed starting, ending y-axis index in the data domain [integer,scalar]
isg, ieg starting, ending x-axis index in the global domain [integer,scalar]
jsg, jeg starting, ending y-axis index in the global domain [integer,scalar]
dx local grid spacing for x-axis (in meters) [real,dimension(ilb:iub,jlb:jub)]
rdx reciprocal of dx (1/m) [real,dimension(jlb:jub)]
dy local grid spacing for y-axis (in meters) [real,scalar]
rdy reciprocal of dy (1/m) [real,scalar]
area area of a local grid box (in m2) [real,dimension(jlb:jub)]
rarea reciprocal of area (1/m2) [real,dimension(jlb:jub)]
areasum bit-reproducible global sum of area (in m2) [real,scalar]
tlm longitude at the center of a local grid box (in radians)
[real,dimension(ilb:iub)]
tph latitude at the center of a local grid box (in radians)
[real,dimension(jlb:jub)]
aph, alm actual latitude, longitude at the center of a local grid box (in radians)
[real,dimension(ilb:iub,jlb:jub)]
blatg latitude boundaries of grid boxes along the global y-axis (in radians)
[real,dimension(jsg:jeg+1)]
blong longitude boundaries grid boxes along the global x-axis (in radians)
[real,dimension(isg:ieg+1)]
Domain domain2D derived-type variable with halosize halo size = 1
[type(domain2d)]
Domain_nohalo domain2D derived-type variable with halo size = 0, used for outputting diagnostic fields
[type(domain2d)]
TYPE horiz_grid_type
Tmp grid constants for the temperature/tracer/mass grid [type(bgrid_type)]
Vel grid constants for the u/v wind component grid [type(bgrid_type)]
Interp interpolation weights used by module bgrid_change_grid [type(bgrid_interp_type)]
sinphv sine of Vel%aph [real,dimension(ilb:iub,jlb:jub)]
tanphv tangent of Vel%aph [real,dimension(ilb:iub,jlb:jub)]
nlon number of longitude (x-axis) grid points in the global grid (no halo points)
[integer,scalar]
nlat number of latitude (y-axis) grid points in the global grid (no halo points)
[integer,scalar]
isize, jsize size of arrays on the local processor's grid (including halo points)
Note: isize=iub-ilb+1, jsize=jub-jlb+1
[integer,scalar]
ilb, iub lower, upper bounds of local x-axis indexing [integer,scalar]
jlb, jub lower, upper bounds of local y-axis indexing [integer,scalar]
ihalo, jhalo number of halo points along the east and west boundaries (ihalo) or
south and north boundaries (jhalo) [integer,scalar]
dlm grid spacing for x-axis (in radians) [real,scalar]
dph grid spacing for y-axis (in radians) [real,scalar]
dlmd grid spacing for x-axis (in degrees of longitude) [real,scalar]
dphd grid spacing for y-axis (in degrees of latitude) [real,scalar]
decompx indicates if the x-axis has been decomposed across processors [logical,scalar]
channel indicates if the channel model feature has been implemented (NOT RECOMMENDED)
[logical,scalar]
NOTES:
The local indexing variables: is, ie, js, je, isd, ied, jsd, jed, ilb, iub, jlb, jub,
are consistent with the global index values (isg, ieg, jsg, jeg).
All local arrays (on either the temperature or velocity grid) have the same
horizontal size [dimension(ilb:iub,jlb:jub)]. Due to the grid staggering,
the northernmost velocity domains do not use the last j-row (jub).
call horiz_grid_init ( Hgrid, nlon, nlat [, decomp] )
INPUT
nlon, nlat The number of global longitude, latitude grid points (respectively)
for the mass/temperature grid.
[integer,scalar]
INPUT/OUTPUT
Hgrid Data structure that contains all necessary horizontal grid information
and domain decomposition variables needed by the model.
[type(horiz_grid_type)]
OPTIONAL INPUT
decomp The domain decomposition for the x and y axis, where
decomp(1) = x-axis decomposition, decomp(2) = y-axis
decomposition. If decomp(1)*decomp(2) does not equal
the number of processors the model will fail.
If either or both decomp(1), decomp(2) is zero,
the rules below apply.
[integer,dimension(2), default: decomp=0,0]
NOTES
1) If decomp(1)=0 and decomp(2)>0, then decomp(1)=decomp(2)/(# PEs), or vice versa.
The final decomposition must always satisfy: decomp(1)*decomp(2)=number of processors.
2) If decomp(1)=decomp(2)=0, then MPP_DEFINE_LAYOUT will be called.
It is likely that two-dimensional decomposition will be implemented.
NOTES
THE B-GRID
----------
The B-grid can be visualized as two overlapping grids, one that
contains momentum (u and v) and the other mass fields (surface
pressure, temperature, and tracers). These separate grids are
rectangular in shape, defined by longitudes along the x-axis and
latitude along the y-axis. The grids are diagonally shifted from
each other, such that, the center of a momentum grid box is located
at the corners where four mass grid boxes intersect.
Horizontal indexing increases from west to east, and from south to north.
Indexing is set up so that a velocity point with the same i,j is
located to the north and east of the mass (temperature) point.
T(i-1,j+1) T(i,j+1) T(i+1,j+1)
v(i-1,j ) v(i,j )
T(i-1,j ) T(i,j ) T(i+1,j )
v(i-1,j-1) v(i,j-1)
T(i-1,j-1) T(i,j-1) T(i+1,j-1)
For computational purposes, extra rows and columns of grid boxes
are carried on the perimeter of the horizontal grid. These extra
points are called halo points. The number of halo points along
the west/east boundaries and south/north boundaries are specified
as separate arguments when initializing the horizontal grid. The
default is for one halo row along all boundaries. Because of the
grid staggering, the global momentum grid does not use it's
northernmost row.
The interior grid (excluding halo points) is called the compute domain.
The global size of the longitude axis (first dimension) can have an
even or odd number of points. The latitude axis (2nd dimension) should
always be an even number of points. When there is an even number of
global latitude points, mass points will straddle the equator,
while velocity points lie along the equator.
UNSUPPORTED INTERNAL OPTIONS
----------------------------
tph0d,tlm0d Latitude/longitude for shifting the position of the poles.
Set both to zero for no transformation (the default).
This option has not been recently used and is currently
not supported.
[real, default: tph0d=0., tlm0d=0.]
channel Flag for running in channel model mode.
This option has not been recently used and is currently not supported.
[logical, default: channel=FALSE]