generation
GridDefinition
dataclass
dims
instance-attribute
units
instance-attribute
__init__(dims, units)
GridDefinitions
CELL_CENTER = (I_DIM, J_DIM)
class-attribute
instance-attribute
CELL_CORNERS = (I_INTERFACE_DIM, J_INTERFACE_DIM)
class-attribute
instance-attribute
LON_OR_LAT_DIM = 'lon_or_lat'
class-attribute
instance-attribute
TILE_DIM = 'tile'
class-attribute
instance-attribute
CARTESIAN_DIM = 'xyz_direction'
class-attribute
instance-attribute
grid = GridDefinition(dims=(CELL_CORNERS + (LON_OR_LAT_DIM,)), units='radians')
class-attribute
instance-attribute
agrid = GridDefinition(dims=(CELL_CENTER + (LON_OR_LAT_DIM,)), units='radians')
class-attribute
instance-attribute
lon = GridDefinition(dims=CELL_CORNERS, units='radians')
class-attribute
instance-attribute
lat = GridDefinition(dims=CELL_CORNERS, units='radians')
class-attribute
instance-attribute
lon_agrid = GridDefinition(dims=CELL_CENTER, units='radians')
class-attribute
instance-attribute
lat_agrid = GridDefinition(dims=CELL_CENTER, units='radians')
class-attribute
instance-attribute
area = GridDefinition(dims=CELL_CENTER, units='m^2')
class-attribute
instance-attribute
area_cgrid = GridDefinition(dims=CELL_CORNERS, units='m^2')
class-attribute
instance-attribute
rarea = GridDefinition(dims=(area.dims), units='1/m^2')
class-attribute
instance-attribute
rarea_c = GridDefinition(dims=(area_cgrid.dims), units='1/m^2')
class-attribute
instance-attribute
dx = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='m')
class-attribute
instance-attribute
dy = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='m')
class-attribute
instance-attribute
dxc = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='m')
class-attribute
instance-attribute
dyc = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='m')
class-attribute
instance-attribute
dxa = GridDefinition(dims=CELL_CENTER, units='m')
class-attribute
instance-attribute
dya = GridDefinition(dims=CELL_CENTER, units='m')
class-attribute
instance-attribute
rdx = GridDefinition(dims=(dx.dims), units='1/m')
class-attribute
instance-attribute
rdy = GridDefinition(dims=(dy.dims), units='1/m')
class-attribute
instance-attribute
rdxc = GridDefinition(dims=(dxc.dims), units='1/m')
class-attribute
instance-attribute
rdyc = GridDefinition(dims=(dyc.dims), units='1/m')
class-attribute
instance-attribute
rdxa = GridDefinition(dims=(dxa.dims), units='1/m')
class-attribute
instance-attribute
rdya = GridDefinition(dims=(dya.dims), units='1/m')
class-attribute
instance-attribute
ak = GridDefinition(dims=(K_INTERFACE_DIM,), units='m')
class-attribute
instance-attribute
bk = GridDefinition(dims=(K_INTERFACE_DIM,), units='m')
class-attribute
instance-attribute
ec1 = GridDefinition(dims=(CELL_CENTER + (CARTESIAN_DIM,)), units='m')
class-attribute
instance-attribute
ec2 = GridDefinition(dims=(CELL_CENTER + (CARTESIAN_DIM,)), units='m')
class-attribute
instance-attribute
ew1 = GridDefinition(dims=(CELL_CORNERS + (CARTESIAN_DIM,)), units='m')
class-attribute
instance-attribute
ew2 = GridDefinition(dims=(CELL_CORNERS + (CARTESIAN_DIM,)), units='m')
class-attribute
instance-attribute
es1 = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM, CARTESIAN_DIM), units='m')
class-attribute
instance-attribute
es2 = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM, CARTESIAN_DIM), units='m')
class-attribute
instance-attribute
cosa_u = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='')
class-attribute
instance-attribute
cosa_v = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
cosa_s = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sina_u = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='')
class-attribute
instance-attribute
sina_v = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
rsin_u = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='')
class-attribute
instance-attribute
rsin_v = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
rsina = GridDefinition(dims=(I_INTERFACE_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
rsin2 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cosa = GridDefinition(dims=(I_INTERFACE_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
sina = GridDefinition(dims=(I_INTERFACE_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
cos_sg1 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg2 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg3 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg4 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg5 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg6 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg7 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg8 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
cos_sg9 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg1 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg2 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg3 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg4 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg5 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg6 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg7 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg8 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
sin_sg9 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
l2c_u = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
l2c_v = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='')
class-attribute
instance-attribute
ee1 = GridDefinition(dims=(CELL_CORNERS + (CARTESIAN_DIM,)), units='')
class-attribute
instance-attribute
ee2 = GridDefinition(dims=(CELL_CORNERS + (CARTESIAN_DIM,)), units='')
class-attribute
instance-attribute
del6_u = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
del6_v = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='')
class-attribute
instance-attribute
divg_u = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
divg_v = GridDefinition(dims=(I_INTERFACE_DIM, J_DIM), units='')
class-attribute
instance-attribute
z11 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
z12 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
z21 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
z22 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
a11 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
a12 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
a21 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
a22 = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
edge_s = GridDefinition(dims=(I_INTERFACE_DIM,), units='')
class-attribute
instance-attribute
edge_n = GridDefinition(dims=(I_INTERFACE_DIM,), units='')
class-attribute
instance-attribute
edge_e = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
edge_w = GridDefinition(dims=(I_DIM, J_INTERFACE_DIM), units='')
class-attribute
instance-attribute
edge_vect_s = GridDefinition(dims=(I_DIM,), units='')
class-attribute
instance-attribute
edge_vect_n = GridDefinition(dims=(I_DIM,), units='')
class-attribute
instance-attribute
edge_vect_e_1d = GridDefinition(dims=(J_DIM,), units='')
class-attribute
instance-attribute
edge_vect_w_1d = GridDefinition(dims=(J_DIM,), units='')
class-attribute
instance-attribute
edge_vect_e = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
edge_vect_w = GridDefinition(dims=(I_DIM, J_DIM), units='')
class-attribute
instance-attribute
MetricTerms
LON_OR_LAT_DIM = GridDefinitions.LON_OR_LAT_DIM
class-attribute
instance-attribute
TILE_DIM = GridDefinitions.TILE_DIM
class-attribute
instance-attribute
CARTESIAN_DIM = GridDefinitions.CARTESIAN_DIM
class-attribute
instance-attribute
N_TILES = 6
class-attribute
instance-attribute
RIGHT_HAND_GRID = False
class-attribute
instance-attribute
quantity_factory = quantity_factory
instance-attribute
grid
property
dgrid_lon_lat
property
The longitudes and latitudes of the cell corners.
gridvar
property
agrid
property
agrid_lon_lat
property
The longitudes and latitudes of the cell centers.
lon
property
lat
property
lon_agrid
property
lat_agrid
property
dx
property
The distance between grid corners along the x-direction.
dy
property
The distance between grid corners along the y-direction.
dxa
property
The with of each grid cell along the x-direction.
dya
property
The with of each grid cell along the y-direction.
dxc
property
The distance between cell centers along the x-direction.
dyc
property
The distance between cell centers along the y-direction.
ks
property
Number of levels where the vertical coordinate is purely pressure-based.
ak
property
The ak coefficient used to calculate the pressure at a given k-level:
pk = ak + (bk * ps)
bk
property
The bk coefficient used to calculate the pressure at a given k-level:
pk = ak + (bk * ps)
ptop
property
The pressure of the top of atmosphere level.
ec1
property
Cartesian components of the local unit vector in the x-direction at the cell centers.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
ec2
property
Cartesian components of the local unit vector in the y-direction at the cell centers.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
ew1
property
Cartesian components of the local unit vector in the x-direction at the left/right cell edges.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
ew2
property
Cartesian components of the local unit vector in the y-direction at the left/right cell edges.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
cos_sg1
property
Cosine of the angle at point 1 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg2
property
Cosine of the angle at point 2 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg3
property
Cosine of the angle at point 3 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg4
property
Cosine of the angle at point 4 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg5
property
Cosine of the angle at point 5 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7 The inner product of ec1 and ec2 for point 5
cos_sg6
property
Cosine of the angle at point 6 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg7
property
Cosine of the angle at point 7 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg8
property
Cosine of the angle at point 8 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cos_sg9
property
Cosine of the angle at point 9 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg1
property
Sine of the angle at point 1 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg2
property
Sine of the angle at point 2 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg3
property
Sine of the angle at point 3 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg4
property
Sine of the angle at point 4 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg5
property
Sine of the angle at point 5 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
For the center point this is one minus the inner product of ec1 and ec2 squared
sin_sg6
property
Sine of the angle at point 6 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg7
property
Sine of the angle at point 7 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg8
property
Sine of the angle at point 8 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
sin_sg9
property
Sine of the angle at point 9 of the 'supergrid' within each grid cell:
9---4---8 | | 1 5 3 | | 6---2---7
cosa
property
Cosine of angle between coordinate lines at the cell corners.
Averaged to ensure consistent answers.
sina
property
Sine of angle between coordinate lines at the cell corners.
Averaged to ensure consistent answers.
cosa_u
property
Cosine of angle between coordinate lines at the left and right cell edges.
Averaged to ensure consistent answers.
cosa_v
property
Cosine of angle between coordinate lines at the top and bottom cell edges.
Averaged to ensure consistent answers.
cosa_s
property
as cosa but defined at cell centers
Averaged to ensure consistent answers.
sina_u
property
Sine of angle between coordinate lines at the left and right cell edges.
Averaged to ensure consistent answers.
sina_v
property
Sine of angle between coordinate lines at the top and bottom cell edges.
Averaged to ensure consistent answers.
rsin_u
property
1/sina_u**2, defined as the inverse-squrared as it is only used as such
rsin_v
property
1/sina_v**2, defined as the inverse-squrared as it is only used as such
rsina
property
1/sina**2, defined as the inverse-squrared as it is only used as such
rsin2
property
1/sin_sg5**2, defined as the inverse-squrared as it is only used as such
l2c_v
property
Angular momentum correction for converting v-winds from lat/lon to cartesian coordinates.
l2c_u
property
Angular momentum correction for converting u-winds from lat/lon to cartesian coordinates.
es1
property
Cartesian components of the local unit vetcor in the x-direation at the top/bottom cell edges.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
es2
property
Cartesian components of the local unit vetcor in the y-direation at the top/bottom cell edges.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
ee1
property
Cartesian components of the local unit vetcor in the x-direation at the cell corners.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
ee2
property
Cartesian components of the local unit vetcor in the y-direation at the cell corners.
3d array whose last dimension is length 3 and indicates cartesian x/y/z value.
divg_u
property
sina_v * dyc/dx
divg_v
property
sina_u * dxc/dy
del6_u
property
sina_v * dx/dyc
del6_v
property
sina_u * dy/dxc
vlon
property
Unit vector in eastward longitude direction.
3d array whose last dimension is length 3 and indicates x/y/z value.
vlat
property
Unit vector in northward latitude direction.
3d array whose last dimension is length 3 and indicates x/y/z value.
z11
property
Vector product of horizontal component of the cell-center vector with the unit longitude vector.
z12
property
Vector product of horizontal component of the cell-center vector with the unit latitude vector.
z21
property
Vector product of vertical component of the cell-center vector with the unit longitude vector.
z22
property
Vector product of vertical component of the cell-center vector with the unit latitude vector.
a11
property
0.5*z22/sin_sg5
a12
property
0.5*z21/sin_sg5
a21
property
0.5*z12/sin_sg5
a22
property
0.5*z11/sin_sg5
edge_w
property
Factor to interpolate scalars from a to c grid at the western grid edge.
edge_e
property
Factor to interpolate scalars from a to c grid at the eastern grid edge.
edge_s
property
Factor to interpolate scalars from a to c grid at the southern grid edge.
edge_n
property
Factor to interpolate scalars from a to c grid at the northern grid edge.
edge_vect_w_1d
property
Factor to interpolate vectors from a to c grid at the western grid edge.
edge_vect_w
property
Factor to interpolate vectors from a to c grid at the western grid edge repeated in x and y to be used in stencils.
edge_vect_e_1d
property
Factor to interpolate vectors from a to c grid at the eastern grid edge.
edge_vect_e
property
Factor to interpolate vectors from a to c grid at the eastern grid edge repeated in x and y to be used in stencils.
edge_vect_s
property
Factor to interpolate vectors from a to c grid at the southern grid edge.
edge_vect_n
property
Factor to interpolate vectors from a to c grid at the northern grid edge.
da_min
property
The minimum agrid cell area across all ranks.
If mpi is not present and the communicator is a DummyComm this will be the minimum on the local rank.
da_max
property
Fhe maximum agrid cell area across all ranks.
Ff mpi is not present and the communicator is a DummyComm this will be the maximum on the local rank.
da_min_c
property
The minimum cgrid cell area across all ranks.
If mpi is not present and the communicator is a DummyComm this will be the minimum on the local rank.
da_max_c
property
The maximum cgrid cell area across all ranks.
If mpi is not present and the communicator is a DummyComm this will be the maximum on the local rank.
area
property
The area of each a-grid cell.
area64
property
The area of each a-grid cell, at 64-bit precision.
area_c
property
The area of each c-grid cell.
rarea
cached
property
1/cell area
rarea_c
cached
property
1/cgrid cell area
rdx
cached
property
1/dx
rdy
cached
property
1/dy
rdxa
cached
property
1/dxa
rdya
cached
property
1/dya
rdxc
cached
property
1/dxc
rdyc
cached
property
1/dyc
__init__(*, quantity_factory, communicator, grid_type=0, dx_const=1000.0, dy_const=1000.0, deglat=15.0, extdgrid=False, eta_file=None, ak=None, bk=None)
from_external(x, y, quantity_factory, communicator, grid_type, eta_file=None)
classmethod
Generates a metric terms object, using input from data contained in an externally generated tile file.
from_tile_sizing(npx, npy, npz, communicator, backend, grid_type=0, dx_const=1000.0, dy_const=1000.0, deglat=15.0, eta_file=None)
classmethod
ignore_zero_division(func)
quantity_cast_to_model_float(quantity_factory, qty_64)
Copy & cast from 64-bit float to model precision if need be.