Skip to content

d2a2c_vect

DGrid2AGrid2CGridVectors

Fortran name d2a2c_vect

__call__(uc, vc, u, v, ua, va, utc, vtc)

Calculate velocity vector from D-grid to A-grid to C-grid.

Parameters:

Name Type Description Default
uc

C-grid x-velocity (inout)

required
vc

C-grid y-velocity (inout)

required
u

D-grid x-velocity (in)

required
v

D-grid y-velocity (in)

required
ua

A-grid x-velocity (inout)

required
va

A-grid y-velocity (inout)

required
utc

C-grid u * dx (inout)

required
vtc

C-grid v * dy (inout)

required

avg_box(u, v, utmp, vtmp)

D2A2C_AVG_OFFSET is an external that describes how far the averaging should go before switching to Lagrangian interpolation. For sufficiently small grids, this should be set to -1, otherwise 3. Note that this makes the stencil code in d2a2c grid-dependent!

contravariant(v1, v2, cosa, rsin2)

Retrieve the contravariant component of the wind from its covariant component and the covariant component in the "other" (x/y) direction.

For an orthogonal grid, cosa would be 0 and rsin2 would be 1, meaning the contravariant component is equal to the covariant component. However, the gnomonic cubed sphere grid is not orthogonal.

This equation is only valid within the tile. On the edge of a tile, it has this simpler form:

u_contra = u / sin(alpha) at the edges

Parameters:

Name Type Description Default
v1

covariant component of the wind for which we want to get the contravariant component

required
v2

covariant component of the wind for the other direction, i.e. y if v1 is in x, x if v1 is in y

required
cosa

cosine of the angle between the local x-direction and y-direction.

required
rsin2

1 / (sin(alpha))^2, where alpha is the angle between the local x-direction and y-direction

required

Returns:

Name Type Description
v1_contravariant

contravariant component of v1