FV3DYCORE  Version1.0.0
fv_grid_utils_mod Module Reference

The module 'fv_grid_utils' contains routines for setting up and computing grid-related quantities. More...

Data Types

interface  fill_ghost
 

Functions/Subroutines

subroutine, public grid_utils_init (Atm, npx, npy, npz, non_ortho, grid_type, c2l_order)
 
subroutine, public grid_utils_end
 
subroutine, public direct_transform (c, i1, i2, j1, j2, lon_p, lat_p, n, lon, lat)
 The subroutine 'direct_transform' performs a direct transformation of the standard (symmetrical) cubic grid to a locally enhanced high-res grid on the sphere. More...
 
real function, public inner_prod (v1, v2)
 
subroutine efactor_a2c_v (edge_vect_s, edge_vect_n, edge_vect_w, edge_vect_e, non_ortho, grid, agrid, npx, npy, nested, bd, regional)
 The subroutine 'efactor_a2c_v' initializes interpolation factors at face edges for interpolating vectors from A to C grid. More...
 
subroutine edge_factors (edge_s, edge_n, edge_w, edge_e, non_ortho, grid, agrid, npx, npy, bd)
 The subroutine 'edge_factors' initializes interpolation factors at face edges for interpolation from A to B grid. More...
 
subroutine, public gnomonic_grids (grid_type, im, lon, lat)
 
subroutine gnomonic_ed (im, lamda, theta)
 The subroutine 'gnomonic_ed' computes the equal distances along the 4 edges of the cubed sphere. More...
 
subroutine gnomonic_ed_limited (im, in, nghost, lL, lR, uL, uR, lamda, theta)
 The subroutine 'gnomonic_ed_limited' creates a limited-area equidistant gnomonic grid with corners given by lL (lower-left), lR (lower-right), uL (upper-left),and uR (upper-right) with im by in cells. More...
 
subroutine gnomonic_angl (im, lamda, theta)
 
subroutine gnomonic_dist (im, lamda, theta)
 
subroutine symm_ed (im, lamda, theta)
 
subroutine latlon2xyz2 (lon, lat, p3)
 
subroutine, public latlon2xyz (p, e, id)
 The subroutine 'latlon2xyz' maps (lon, lat) to (x,y,z) More...
 
subroutine mirror_xyz (p1, p2, p0, p)
 The subroutine 'mirror_xyz' computes the mirror image of p0(x0, y0, z0) as p(x, y, z) given the "mirror" as defined by p1(x1, y1, z1), p2(x2, y2, z2), and the center of the sphere. More...
 
subroutine mirror_latlon (lon1, lat1, lon2, lat2, lon0, lat0, lon3, lat3)
 The subroutine 'mirror_latlon' computes the mirror image of (lon0, lat0) as (lon3, lat3) given the "mirror" as defined by (lon1, lat1), (lon2, lat2), and center of the sphere. More...
 
subroutine, public cart_to_latlon (np, q, xs, ys)
 
subroutine, public vect_cross (e, p1, p2)
 The subroutine 'vect_cross performs cross products of 3D vectors: e = P1 X P2. More...
 
subroutine get_center_vect (npx, npy, pp, u1, u2, bd)
 
subroutine, public get_unit_vect2 (e1, e2, uc)
 
subroutine get_unit_vect3 (p1, p2, uc)
 
subroutine, public normalize_vect (e)
 The subroutine 'normalize_vect' makes 'e' a unit vector. More...
 
subroutine, public intp_great_circle (beta, p1, p2, x_o, y_o)
 
subroutine, public spherical_linear_interpolation (beta, p1, p2, pb)
 The subroutine 'spherical_linear_interpolation' interpolates along the great circle connecting points p1 and p2. More...
 
subroutine, public mid_pt_sphere (p1, p2, pm)
 
subroutine mid_pt3_cart (p1, p2, e)
 
subroutine, public mid_pt_cart (p1, p2, e3)
 
real function, public great_circle_dist (q1, q2, radius)
 
real(kind=r_grid) function great_circle_dist_cart (v1, v2, radius)
 The function 'great_circle_dist_cart' calculates the normalized great circle distance between 'v1' and 'v2'.
More...
 
subroutine intersect (a1, a2, b1, b2, radius, x_inter, local_a, local_b)
 The subroutine 'intersect' calculates the intersection of two great circles.
More...
 
subroutine intersect_cross (a1, a2, b1, b2, radius, x_inter, local_a, local_b)
 The subroutine 'intersect_cross' calculates the intersection of two great circles.

More...
 
subroutine, public unit_vect_latlon (pp, elon, elat)
 
real(kind=r_grid) function, public v_prod (v1, v2)
 
subroutine init_cubed_to_latlon (gridstruct, hydrostatic, agrid, grid_type, ord, bd)
 
subroutine, public cubed_to_latlon (u, v, ua, va, gridstruct, npx, npy, km, mode, grid_type, domain, nested, c2l_ord, bd)
 
subroutine c2l_ord4 (u, v, ua, va, gridstruct, npx, npy, km, grid_type, domain, nested, mode, bd)
 
subroutine, public c2l_ord2 (u, v, ua, va, gridstruct, km, grid_type, bd, do_halo)
 
subroutine, public expand_cell (q1, q2, q3, q4, a1, a2, a3, a4, fac)
 
subroutine, public cell_center2 (q1, q2, q3, q4, e2)
 
subroutine cell_center3 (p1, p2, p3, p4, ec)
 The subroutine 'cell_center3' gets the center position of a cell. More...
 
real(kind=r_grid) function, public get_area (p1, p4, p2, p3, radius)
 
real(kind=r_grid) function dist2side (v1, v2, point)
 The function 'dist2side' calculates the shortest normalized distance on a sphere from point to straight line defined by 'v1' and 'v2'.
More...
 
real(kind=r_grid) function, public dist2side_latlon (v1, v2, point)
 The function 'dist2side_latlon' is the version of 'dist2side' that takes points in latitude-longitude coordinates. More...
 
real(kind=r_grid) function, public spherical_angle (p1, p2, p3)
 
real(kind=r_grid) function, public cos_angle (p1, p2, p3)
 
real function, public g_sum (domain, p, ifirst, ilast, jfirst, jlast, ngc, area, mode, reproduce)
 The function 'g_sum' is the fast version of 'globalsum'. More...
 
real function, public global_qsum (p, ifirst, ilast, jfirst, jlast)
 The function 'global_qsum' computes the quick global sum without area weighting. More...
 
subroutine, public global_mx (q, n_g, qmin, qmax, bd)
 
subroutine global_mx_c (q, i1, i2, j1, j2, qmin, qmax)
 The subroutine 'global_mx_c' computes the global max and min at the cell corners. More...
 
subroutine fill_ghost_r4 (q, npx, npy, value, bd)
 
subroutine fill_ghost_r8 (q, npx, npy, value, bd)
 
subroutine, public make_eta_level (km, pe, area, kks, ak, bk, ptop, domain, bd)
 
subroutine invert_matrix (n, a, x)
 
subroutine elgs (a, n, indx)
 The subroutine 'elgs' performs the partial-pivoting gaussian elimination. More...
 
subroutine, public get_latlon_vector (pp, elon, elat)
 
subroutine, public project_sphere_v (np, f, e)
 
subroutine init_mq (phis, gridstruct, npx, npy, is, ie, js, je, ng)
 

Variables

logical, public symm_grid
 
integer, parameter, public f_p = selected_real_kind(20)
 
real, parameter, public big_number =1.d8
 
real, parameter tiny_number =1.d-8
 
real(kind=r_grid) radius =cnst_radius
 
real, parameter, public ptop_min =1.d-8
 

Detailed Description

The module 'fv_grid_utils' contains routines for setting up and computing grid-related quantities.

Many of these are useful for computing diagnostics or setting up initial conditions.

Function/Subroutine Documentation

◆ c2l_ord2()

subroutine, public fv_grid_utils_mod::c2l_ord2 ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed+1,km), intent(in)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed,km), intent(in)  v,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed,km), intent(out)  ua,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed,km), intent(out)  va,
type(fv_grid_type), intent(in), target  gridstruct,
integer, intent(in)  km,
integer, intent(in)  grid_type,
type(fv_grid_bounds_type), intent(in)  bd,
logical, intent(in)  do_halo 
)

Definition at line 2507 of file fv_grid_utils.F90.

◆ c2l_ord4()

subroutine fv_grid_utils_mod::c2l_ord4 ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed+1,km), intent(inout)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed,km), intent(inout)  v,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed,km), intent(out)  ua,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed,km), intent(out)  va,
type(fv_grid_type), intent(in), target  gridstruct,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  km,
integer, intent(in)  grid_type,
type(domain2d), intent(inout)  domain,
logical, intent(in)  nested,
integer, intent(in)  mode,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

Definition at line 2367 of file fv_grid_utils.F90.

◆ cart_to_latlon()

subroutine, public fv_grid_utils_mod::cart_to_latlon ( integer, intent(in)  np,
real(kind=r_grid), dimension(3,np), intent(inout)  q,
real(kind=r_grid), dimension(np), intent(inout)  xs,
real(kind=r_grid), dimension(np), intent(inout)  ys 
)

Definition at line 1716 of file fv_grid_utils.F90.

◆ cell_center2()

subroutine, public fv_grid_utils_mod::cell_center2 ( real(kind=r_grid), dimension(2), intent(in)  q1,
real(kind=r_grid), dimension(2), intent(in)  q2,
real(kind=r_grid), dimension(2), intent(in)  q3,
real(kind=r_grid), dimension(2), intent(in)  q4,
real(kind=r_grid), dimension(2), intent(out)  e2 
)

Definition at line 2660 of file fv_grid_utils.F90.

◆ cell_center3()

subroutine fv_grid_utils_mod::cell_center3 ( real(kind=r_grid), dimension(3), intent(in)  p1,
real(kind=r_grid), dimension(3), intent(in)  p2,
real(kind=r_grid), dimension(3), intent(in)  p3,
real(kind=r_grid), dimension(3), intent(in)  p4,
real(kind=r_grid), dimension(kind=r_grid), intent(out)  ec 
)
private

The subroutine 'cell_center3' gets the center position of a cell.

Definition at line 2688 of file fv_grid_utils.F90.

◆ cos_angle()

real(kind=r_grid) function, public fv_grid_utils_mod::cos_angle ( real(kind=r_grid), dimension(3), intent(in)  p1,
real(kind=r_grid), dimension(3), intent(in)  p2,
real(kind=r_grid), dimension(3), intent(in)  p3 
)

Definition at line 2855 of file fv_grid_utils.F90.

◆ cubed_to_latlon()

subroutine, public fv_grid_utils_mod::cubed_to_latlon ( real, dimension(bd%isd:bd%ied,bd%jsd:bd%jed+1,km), intent(inout)  u,
real, dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed,km), intent(inout)  v,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed,km), intent(out)  ua,
real, dimension(bd%isd:bd%ied, bd%jsd:bd%jed,km), intent(out)  va,
type(fv_grid_type), intent(in)  gridstruct,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  km,
integer, intent(in)  mode,
integer, intent(in)  grid_type,
type(domain2d), intent(inout)  domain,
logical, intent(in)  nested,
integer, intent(in)  c2l_ord,
type(fv_grid_bounds_type), intent(in)  bd 
)

Definition at line 2346 of file fv_grid_utils.F90.

◆ direct_transform()

subroutine, public fv_grid_utils_mod::direct_transform ( real(kind=r_grid), intent(in)  c,
integer, intent(in)  i1,
integer, intent(in)  i2,
integer, intent(in)  j1,
integer, intent(in)  j2,
real(kind=r_grid), intent(in)  lon_p,
real(kind=r_grid), intent(in)  lat_p,
integer, intent(in)  n,
real(kind=r_grid), dimension(i1:i2,j1:j2), intent(inout)  lon,
real(kind=r_grid), dimension(i1:i2,j1:j2), intent(inout)  lat 
)

The subroutine 'direct_transform' performs a direct transformation of the standard (symmetrical) cubic grid to a locally enhanced high-res grid on the sphere.

It is an application of the Schmidt transformation at the south pole followed by a pole_shift_to_target (rotation) operation.

Parameters
[in]cStretching factor
[in]lat_pcenter location of the target face, radian
[in]ngrid face number

Definition at line 918 of file fv_grid_utils.F90.

◆ dist2side()

real(kind=r_grid) function fv_grid_utils_mod::dist2side ( real(kind=r_grid), dimension(3), intent(in)  v1,
real(kind=r_grid), dimension(3), intent(in)  v2,
real(kind=r_grid), dimension(3), intent(in)  point 
)
private

The function 'dist2side' calculates the shortest normalized distance on a sphere from point to straight line defined by 'v1' and 'v2'.

This version uses cartesian coordinates.

Date
Feb 2007
Version
0.1

Definition at line 2756 of file fv_grid_utils.F90.

◆ dist2side_latlon()

real(kind=r_grid) function, public fv_grid_utils_mod::dist2side_latlon ( real(kind=r_grid), dimension(2), intent(in)  v1,
real(kind=r_grid), dimension(2), intent(in)  v2,
real(kind=r_grid), dimension(2), intent(in)  point 
)

The function 'dist2side_latlon' is the version of 'dist2side' that takes points in latitude-longitude coordinates.

Definition at line 2770 of file fv_grid_utils.F90.

◆ edge_factors()

subroutine fv_grid_utils_mod::edge_factors ( real(kind=r_grid), dimension(npx), intent(inout)  edge_s,
real(kind=r_grid), dimension(npx), intent(inout)  edge_n,
real(kind=r_grid), dimension(npy), intent(inout)  edge_w,
real(kind=r_grid), dimension(npy), intent(inout)  edge_e,
logical, intent(in)  non_ortho,
real(kind=r_grid), dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed+1,2), intent(in)  grid,
real(kind=r_grid), dimension(bd%isd:bd%ied ,bd%jsd:bd%jed ,2), intent(in)  agrid,
integer, intent(in)  npx,
integer, intent(in)  npy,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

The subroutine 'edge_factors' initializes interpolation factors at face edges for interpolation from A to B grid.

Definition at line 1166 of file fv_grid_utils.F90.

◆ efactor_a2c_v()

subroutine fv_grid_utils_mod::efactor_a2c_v ( real(kind=r_grid), dimension(bd%isd:bd%ied), intent(inout)  edge_vect_s,
real(kind=r_grid), dimension(bd%isd:bd%ied), intent(inout)  edge_vect_n,
real(kind=r_grid), dimension(bd%jsd:bd%jed), intent(inout)  edge_vect_w,
real(kind=r_grid), dimension(bd%jsd:bd%jed), intent(inout)  edge_vect_e,
logical, intent(in)  non_ortho,
real(kind=r_grid), dimension(bd%isd:bd%ied+1,bd%jsd:bd%jed+1,2), intent(in)  grid,
real(kind=r_grid), dimension(bd%isd:bd%ied ,bd%jsd:bd%jed ,2), intent(in)  agrid,
integer, intent(in)  npx,
integer, intent(in)  npy,
logical, intent(in)  nested,
type(fv_grid_bounds_type), intent(in)  bd,
logical, intent(in)  regional 
)
private

The subroutine 'efactor_a2c_v' initializes interpolation factors at face edges for interpolating vectors from A to C grid.

Definition at line 989 of file fv_grid_utils.F90.

◆ elgs()

subroutine fv_grid_utils_mod::elgs ( real(kind=r_grid), dimension (n,n), intent(inout)  a,
integer, intent(in)  n,
integer, dimension (n), intent(out)  indx 
)
private

The subroutine 'elgs' performs the partial-pivoting gaussian elimination.

a(n,n) is the original matrix in the input and transformed matrix plus the pivoting element ratios below the diagonal in the output.

Definition at line 3217 of file fv_grid_utils.F90.

◆ expand_cell()

subroutine, public fv_grid_utils_mod::expand_cell ( real(kind=r_grid), dimension(2), intent(in)  q1,
real(kind=r_grid), dimension(2), intent(in)  q2,
real(kind=r_grid), dimension(2), intent(in)  q3,
real(kind=r_grid), dimension(2), intent(in)  q4,
real(kind=r_grid), dimension(2), intent(out)  a1,
real(kind=r_grid), dimension(2), intent(out)  a2,
real(kind=r_grid), dimension(2), intent(out)  a3,
real(kind=r_grid), dimension(2), intent(out)  a4,
real(kind=r_grid), intent(in)  fac 
)

Definition at line 2591 of file fv_grid_utils.F90.

◆ fill_ghost_r4()

subroutine fv_grid_utils_mod::fill_ghost_r4 ( real(kind=4), dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q,
integer, intent(in)  npx,
integer, intent(in)  npy,
real, intent(in)  value,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

Definition at line 3024 of file fv_grid_utils.F90.

◆ fill_ghost_r8()

subroutine fv_grid_utils_mod::fill_ghost_r8 ( real(kind=r_grid), dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(inout)  q,
integer, intent(in)  npx,
integer, intent(in)  npy,
real, intent(in)  value,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

Definition at line 3064 of file fv_grid_utils.F90.

◆ g_sum()

real function, public fv_grid_utils_mod::g_sum ( type(domain2d), intent(in)  domain,
real, dimension(ifirst:ilast,jfirst:jlast), intent(in)  p,
integer, intent(in)  ifirst,
integer, intent(in)  ilast,
integer, intent(in)  jfirst,
integer, intent(in)  jlast,
integer, intent(in)  ngc,
real(kind=r_grid), dimension(ifirst-ngc:ilast+ngc,jfirst-ngc:jlast+ngc), intent(in)  area,
integer, intent(in)  mode,
logical, intent(in), optional  reproduce 
)

The function 'g_sum' is the fast version of 'globalsum'.

Definition at line 2902 of file fv_grid_utils.F90.

◆ get_area()

real(kind=r_grid) function, public fv_grid_utils_mod::get_area ( real(kind=r_grid), dimension(2), intent(in)  p1,
real(kind=r_grid), dimension(2), intent(in)  p4,
real(kind=r_grid), dimension(2), intent(in)  p2,
real(kind=r_grid), dimension(2), intent(in)  p3,
real(kind=r_grid), intent(in), optional  radius 
)

Definition at line 2708 of file fv_grid_utils.F90.

◆ get_center_vect()

subroutine fv_grid_utils_mod::get_center_vect ( integer, intent(in)  npx,
integer, intent(in)  npy,
real(kind=r_grid), dimension(3,bd%isd:bd%ied+1,bd%jsd:bd%jed+1), intent(in)  pp,
real(kind=r_grid), dimension(3,bd%isd:bd%ied, bd%jsd:bd%jed), intent(out)  u1,
real(kind=r_grid), dimension(3,bd%isd:bd%ied, bd%jsd:bd%jed), intent(out)  u2,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

Definition at line 1768 of file fv_grid_utils.F90.

◆ get_latlon_vector()

subroutine, public fv_grid_utils_mod::get_latlon_vector ( real(kind=r_grid), dimension(2), intent(in)  pp,
real(kind=r_grid), dimension(3), intent(out)  elon,
real(kind=r_grid), dimension(3), intent(out)  elat 
)

Definition at line 3274 of file fv_grid_utils.F90.

◆ get_unit_vect2()

subroutine, public fv_grid_utils_mod::get_unit_vect2 ( real(kind=r_grid), dimension(2), intent(in)  e1,
real(kind=r_grid), dimension(2), intent(in)  e2,
real(kind=r_grid), dimension(3), intent(out)  uc 
)
Parameters
[out]ucunit vector e1—>e2

Definition at line 1821 of file fv_grid_utils.F90.

◆ get_unit_vect3()

subroutine fv_grid_utils_mod::get_unit_vect3 ( real(kind=r_grid), dimension(3), intent(in)  p1,
real(kind=r_grid), dimension(3), intent(in)  p2,
real(kind=r_grid), dimension(3), intent(out)  uc 
)
private

Definition at line 1838 of file fv_grid_utils.F90.

◆ global_mx()

subroutine, public fv_grid_utils_mod::global_mx ( real(kind=r_grid), dimension(bd%is-n_g:bd%ie+n_g, bd%js-n_g:bd%je+n_g), intent(in)  q,
integer, intent(in)  n_g,
real(kind=r_grid), intent(out)  qmin,
real(kind=r_grid), intent(out)  qmax,
type(fv_grid_bounds_type), intent(in)  bd 
)

Definition at line 2974 of file fv_grid_utils.F90.

◆ global_mx_c()

subroutine fv_grid_utils_mod::global_mx_c ( real(kind=r_grid), dimension(i1:i2,j1:j2), intent(in)  q,
integer, intent(in)  i1,
integer, intent(in)  i2,
integer, intent(in)  j1,
integer, intent(in)  j2,
real(kind=r_grid), intent(out)  qmin,
real(kind=r_grid), intent(out)  qmax 
)
private

The subroutine 'global_mx_c' computes the global max and min at the cell corners.

Definition at line 3003 of file fv_grid_utils.F90.

◆ global_qsum()

real function, public fv_grid_utils_mod::global_qsum ( real, dimension(ifirst:ilast,jfirst:jlast), intent(in)  p,
integer, intent(in)  ifirst,
integer, intent(in)  ilast,
integer, intent(in)  jfirst,
integer, intent(in)  jlast 
)

The function 'global_qsum' computes the quick global sum without area weighting.

Parameters
[in]pfield to be summed

Definition at line 2954 of file fv_grid_utils.F90.

◆ gnomonic_angl()

subroutine fv_grid_utils_mod::gnomonic_angl ( integer  im,
real(kind=r_grid), dimension(im+1,im+1)  lamda,
real(kind=r_grid), dimension(im+1,im+1)  theta 
)
private

Definition at line 1514 of file fv_grid_utils.F90.

◆ gnomonic_dist()

subroutine fv_grid_utils_mod::gnomonic_dist ( integer  im,
real(kind=r_grid), dimension(im+1,im+1)  lamda,
real(kind=r_grid), dimension(im+1,im+1)  theta 
)
private

Definition at line 1541 of file fv_grid_utils.F90.

◆ gnomonic_ed()

subroutine fv_grid_utils_mod::gnomonic_ed ( integer, intent(in)  im,
real(kind=r_grid), dimension(im+1,im+1), intent(out)  lamda,
real(kind=r_grid), dimension(im+1,im+1), intent(out)  theta 
)
private

The subroutine 'gnomonic_ed' computes the equal distances along the 4 edges of the cubed sphere.

Properties: defined by intersections of great circles max(dx,dy; global) / min(dx,dy; global) = sqrt(2) = 1.4142 Max(aspect ratio) = 1.06089 the N-S coordinate curves are const longitude on the 4 faces with equator For C2000: (dx_min, dx_max) = (3.921, 5.545) in km unit This is the grid of choice for global cloud resolving

Definition at line 1309 of file fv_grid_utils.F90.

◆ gnomonic_ed_limited()

subroutine fv_grid_utils_mod::gnomonic_ed_limited ( integer, intent(in)  im,
integer, intent(in)  in,
integer, intent(in)  nghost,
real(kind=r_grid), dimension(2), intent(in)  lL,
real(kind=r_grid), dimension(2), intent(in)  lR,
real(kind=r_grid), dimension(2), intent(in)  uL,
real(kind=r_grid), dimension(2), intent(in)  uR,
real(kind=r_grid), dimension(1-nghost:im+1+nghost,1-nghost:in+1+nghost), intent(out)  lamda,
real(kind=r_grid), dimension(1-nghost:im+1+nghost,1-nghost:in+1+nghost), intent(out)  theta 
)
private

The subroutine 'gnomonic_ed_limited' creates a limited-area equidistant gnomonic grid with corners given by lL (lower-left), lR (lower-right), uL (upper-left),and uR (upper-right) with im by in cells.

'lamda' and 'theta' are the latitude-longitude coordinates of the corners of the cells. This formulation assumes the coordinates given are on the 'prototypical equatorial panel' given by gnomonic_ed. The resulting gnomonic limited area grid can then be translated and/or scaled to its appropriate location on another panel if desired.

Definition at line 1405 of file fv_grid_utils.F90.

◆ gnomonic_grids()

subroutine, public fv_grid_utils_mod::gnomonic_grids ( integer, intent(in)  grid_type,
integer, intent(in)  im,
real(kind=r_grid), dimension(im+1,im+1), intent(out)  lon,
real(kind=r_grid), dimension(im+1,im+1), intent(out)  lat 
)

Definition at line 1274 of file fv_grid_utils.F90.

◆ great_circle_dist()

real function, public fv_grid_utils_mod::great_circle_dist ( real(kind=r_grid), dimension(2), intent(in)  q1,
real(kind=r_grid), dimension(2), intent(in)  q2,
real(kind=r_grid), intent(in), optional  radius 
)

Definition at line 2013 of file fv_grid_utils.F90.

◆ great_circle_dist_cart()

real(kind=r_grid) function fv_grid_utils_mod::great_circle_dist_cart ( real(kind=r_grid), dimension(3), intent(in)  v1,
real(kind=r_grid), dimension(3), intent(in)  v2,
real(kind=r_grid), intent(in), optional  radius 
)
private

The function 'great_circle_dist_cart' calculates the normalized great circle distance between 'v1' and 'v2'.

Date
July 2006
Version
0.1

Definition at line 2041 of file fv_grid_utils.F90.

◆ grid_utils_end()

subroutine, public fv_grid_utils_mod::grid_utils_end ( )

Definition at line 906 of file fv_grid_utils.F90.

◆ grid_utils_init()

subroutine, public fv_grid_utils_mod::grid_utils_init ( type(fv_atmos_type), intent(inout), target  Atm,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  npz,
logical, intent(in)  non_ortho,
integer, intent(in)  grid_type,
integer, intent(in)  c2l_order 
)
Parameters
[in,out]atmInitialize 2D memory and geometrical factors

Definition at line 134 of file fv_grid_utils.F90.

◆ init_cubed_to_latlon()

subroutine fv_grid_utils_mod::init_cubed_to_latlon ( type(fv_grid_type), intent(inout), target  gridstruct,
logical, intent(in)  hydrostatic,
real(kind=r_grid), dimension(bd%isd:bd%ied,bd%jsd:bd%jed,2), intent(in)  agrid,
integer, intent(in)  grid_type,
integer, intent(in)  ord,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

Definition at line 2281 of file fv_grid_utils.F90.

◆ init_mq()

subroutine fv_grid_utils_mod::init_mq ( real, dimension(is-ng:ie+ng, js-ng:je+ng), intent(in)  phis,
type(fv_grid_type), intent(in), target  gridstruct,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  is,
integer, intent(in)  ie,
integer, intent(in)  js,
integer, intent(in)  je,
integer, intent(in)  ng 
)
private

Definition at line 3312 of file fv_grid_utils.F90.

◆ inner_prod()

real function, public fv_grid_utils_mod::inner_prod ( real(kind=r_grid), dimension(3), intent(in)  v1,
real(kind=r_grid), dimension(3), intent(in)  v2 
)

Definition at line 973 of file fv_grid_utils.F90.

◆ intersect()

subroutine fv_grid_utils_mod::intersect ( real(kind=r_grid), dimension(3), intent(in)  a1,
real(kind=r_grid), dimension(3), intent(in)  a2,
real(kind=r_grid), dimension(3), intent(in)  b1,
real(kind=r_grid), dimension(3), intent(in)  b2,
real(kind=r_grid), intent(in)  radius,
real(kind=r_grid), dimension(3), intent(out)  x_inter,
logical, intent(out)  local_a,
logical, intent(out)  local_b 
)
private

The subroutine 'intersect' calculates the intersection of two great circles.

input:
a1, a2, - pairs of points on sphere in cartesian coordinates
b1, b2 defining great circles
radius - radius of the sphere
output:
x_inter - nearest intersection point of the great circles
local_a - true if x1 between (a1, a2)
local_b - true if x1 between (b1, b2)

Date
July 2006
Version
: 0.1

Definition at line 2076 of file fv_grid_utils.F90.

◆ intersect_cross()

subroutine fv_grid_utils_mod::intersect_cross ( real(kind=r_grid), dimension(3), intent(in)  a1,
real(kind=r_grid), dimension(3), intent(in)  a2,
real(kind=r_grid), dimension(3), intent(in)  b1,
real(kind=r_grid), dimension(3), intent(in)  b2,
real(kind=r_grid), intent(in)  radius,
real(kind=r_grid), dimension(3), intent(out)  x_inter,
logical, intent(out)  local_a,
logical, intent(out)  local_b 
)
private

The subroutine 'intersect_cross' calculates the intersection of two great circles.

input:

a1, a2, - pairs of points on sphere in cartesian coordinates

b1, b2 defining great circles

radius - radius of the sphere

output:

x_inter - nearest intersection point of the great circles

local_a - true if x1 between (a1, a2)

local_b - true if x1 between (b1, b2)

A great circle is the intersection of a plane through the center of the sphere with the sphere. That plane is specified by a vector v1, which is the cross product of any two vectors lying in the plane; here, we use position vectors, which are unit vectors lying in the plane and rooted at the center of the sphere. The intersection of two great circles is where the the intersection of the planes, a line, itself intersects the sphere. Since the planes are defined by perpendicular vectors v1, v2 respectively, the intersecting line is perpendicular to both v1 and v2, and so lies along the cross product of v1 and v2. The two intersection points of the great circles is therefore +/- v1 x v2.

Definition at line 2168 of file fv_grid_utils.F90.

◆ intp_great_circle()

subroutine, public fv_grid_utils_mod::intp_great_circle ( real(kind=r_grid), intent(in)  beta,
real(kind=r_grid), dimension(2), intent(in)  p1,
real(kind=r_grid), dimension(2), intent(in)  p2,
real(kind=r_grid), intent(out)  x_o,
real(kind=r_grid), intent(out)  y_o 
)
Parameters
[in]beta[0,1]
[out]y_obetween p1 and p2 along GC

Definition at line 1868 of file fv_grid_utils.F90.

◆ invert_matrix()

subroutine fv_grid_utils_mod::invert_matrix ( integer, intent(in)  n,
real(kind=r_grid), dimension (n,n), intent(inout)  a,
real(kind=r_grid), dimension (n,n), intent(out)  x 
)
private
Parameters
[out]xinverted maxtrix

Definition at line 3173 of file fv_grid_utils.F90.

◆ latlon2xyz()

subroutine, public fv_grid_utils_mod::latlon2xyz ( real(kind=r_grid), dimension(2), intent(in)  p,
real(kind=r_grid), dimension(3), intent(out)  e,
integer, intent(in), optional  id 
)

The subroutine 'latlon2xyz' maps (lon, lat) to (x,y,z)

Parameters
[in]idid=0 do nothing; id=1, right_hand

Definition at line 1622 of file fv_grid_utils.F90.

◆ latlon2xyz2()

subroutine fv_grid_utils_mod::latlon2xyz2 ( real(kind=r_grid), intent(in)  lon,
real(kind=r_grid), intent(in)  lat,
real(kind=r_grid), dimension(3), intent(out)  p3 
)
private

Definition at line 1611 of file fv_grid_utils.F90.

◆ make_eta_level()

subroutine, public fv_grid_utils_mod::make_eta_level ( integer, intent(in)  km,
real, dimension(bd%is-1:bd%ie+1,km+1,bd%js-1:bd%je+1), intent(inout)  pe,
real(kind=r_grid), dimension(bd%isd:bd%ied,bd%jsd:bd%jed), intent(in)  area,
integer, intent(out)  kks,
real, dimension(km+1), intent(out)  ak,
real, dimension(km+1), intent(out)  bk,
real, intent(inout)  ptop,
type(domain2d), intent(in)  domain,
type(fv_grid_bounds_type), intent(in)  bd 
)

Definition at line 3105 of file fv_grid_utils.F90.

◆ mid_pt3_cart()

subroutine fv_grid_utils_mod::mid_pt3_cart ( real(kind=r_grid), dimension(3), intent(in)  p1,
real(kind=r_grid), dimension(3), intent(in)  p2,
real(kind=r_grid), dimension(3), intent(out)  e 
)
private

Definition at line 1969 of file fv_grid_utils.F90.

◆ mid_pt_cart()

subroutine, public fv_grid_utils_mod::mid_pt_cart ( real(kind=r_grid), dimension(2), intent(in)  p1,
real(kind=r_grid), dimension(2), intent(in)  p2,
real(kind=r_grid), dimension(3), intent(out)  e3 
)

Definition at line 1999 of file fv_grid_utils.F90.

◆ mid_pt_sphere()

subroutine, public fv_grid_utils_mod::mid_pt_sphere ( real(kind=r_grid), dimension(2), intent(in)  p1,
real(kind=r_grid), dimension(2), intent(in)  p2,
real(kind=r_grid), dimension(2), intent(out)  pm 
)

Definition at line 1954 of file fv_grid_utils.F90.

◆ mirror_latlon()

subroutine fv_grid_utils_mod::mirror_latlon ( real(kind=r_grid), intent(in)  lon1,
real(kind=r_grid), intent(in)  lat1,
real(kind=r_grid), intent(in)  lon2,
real(kind=r_grid), intent(in)  lat2,
real(kind=r_grid), intent(in)  lon0,
real(kind=r_grid), intent(in)  lat0,
real(kind=r_grid), intent(out)  lon3,
real(kind=r_grid), intent(out)  lat3 
)
private

The subroutine 'mirror_latlon' computes the mirror image of (lon0, lat0) as (lon3, lat3) given the "mirror" as defined by (lon1, lat1), (lon2, lat2), and center of the sphere.

Definition at line 1686 of file fv_grid_utils.F90.

◆ mirror_xyz()

subroutine fv_grid_utils_mod::mirror_xyz ( real(kind=r_grid), dimension(3), intent(in)  p1,
real(kind=r_grid), dimension(3), intent(in)  p2,
real(kind=r_grid), dimension(3), intent(in)  p0,
real(kind=r_grid), dimension(3), intent(out)  p 
)
private

The subroutine 'mirror_xyz' computes the mirror image of p0(x0, y0, z0) as p(x, y, z) given the "mirror" as defined by p1(x1, y1, z1), p2(x2, y2, z2), and the center of the sphere.

Definition at line 1651 of file fv_grid_utils.F90.

◆ normalize_vect()

subroutine, public fv_grid_utils_mod::normalize_vect ( real(kind=r_grid), dimension(3), intent(inout)  e)

The subroutine 'normalize_vect' makes 'e' a unit vector.

Definition at line 1852 of file fv_grid_utils.F90.

◆ project_sphere_v()

subroutine, public fv_grid_utils_mod::project_sphere_v ( integer, intent(in)  np,
real(kind=r_grid), dimension(3,np), intent(inout)  f,
real(kind=r_grid), dimension(3,np), intent(in)  e 
)
Parameters
[in]nptotal number of points
[in]einput position unit vector

Definition at line 3293 of file fv_grid_utils.F90.

◆ spherical_angle()

real(kind=r_grid) function, public fv_grid_utils_mod::spherical_angle ( real(kind=r_grid), dimension(3)  p1,
real(kind=r_grid), dimension(3)  p2,
real(kind=r_grid), dimension(3)  p3 
)

Definition at line 2795 of file fv_grid_utils.F90.

◆ spherical_linear_interpolation()

subroutine, public fv_grid_utils_mod::spherical_linear_interpolation ( real(kind=r_grid), intent(in)  beta,
real(kind=r_grid), dimension(2), intent(in)  p1,
real(kind=r_grid), dimension(2), intent(in)  p2,
real(kind=r_grid), dimension(2), intent(out)  pb 
)

The subroutine 'spherical_linear_interpolation' interpolates along the great circle connecting points p1 and p2.

The routine uses the formula taken from http://en.wikipedia.org/wiki/Slerp and is attributed to Glenn Davis based on a concept by Ken Shoemake.

Parameters
[in]beta[0,1]
[out]pbbetween p1 and p2 along GC

Definition at line 1902 of file fv_grid_utils.F90.

◆ symm_ed()

subroutine fv_grid_utils_mod::symm_ed ( integer  im,
real(kind=r_grid), dimension(im+1,im+1)  lamda,
real(kind=r_grid), dimension(im+1,im+1)  theta 
)
private

Definition at line 1570 of file fv_grid_utils.F90.

◆ unit_vect_latlon()

subroutine, public fv_grid_utils_mod::unit_vect_latlon ( real(kind=r_grid), dimension(2), intent(in)  pp,
real(kind=r_grid), dimension(3), intent(out)  elon,
real(kind=r_grid), dimension(3), intent(out)  elat 
)

Definition at line 2246 of file fv_grid_utils.F90.

◆ v_prod()

real(kind=r_grid) function, public fv_grid_utils_mod::v_prod ( real(kind=r_grid), dimension(3)  v1,
real(kind=r_grid), dimension(3)  v2 
)

Definition at line 2273 of file fv_grid_utils.F90.

◆ vect_cross()

subroutine, public fv_grid_utils_mod::vect_cross ( real(kind=r_grid), dimension(3), intent(out)  e,
real(kind=r_grid), dimension(3), intent(in)  p1,
real(kind=r_grid), dimension(3), intent(in)  p2 
)

The subroutine 'vect_cross performs cross products of 3D vectors: e = P1 X P2.

Definition at line 1758 of file fv_grid_utils.F90.

Variable Documentation

◆ big_number

real, parameter, public fv_grid_utils_mod::big_number =1.d8

Definition at line 104 of file fv_grid_utils.F90.

◆ f_p

integer, parameter, public fv_grid_utils_mod::f_p = selected_real_kind(20)

Definition at line 102 of file fv_grid_utils.F90.

◆ ptop_min

real, parameter, public fv_grid_utils_mod::ptop_min =1.d-8

Definition at line 109 of file fv_grid_utils.F90.

◆ radius

real(kind=r_grid) fv_grid_utils_mod::radius =cnst_radius
private

Definition at line 107 of file fv_grid_utils.F90.

◆ symm_grid

logical, public fv_grid_utils_mod::symm_grid

Definition at line 96 of file fv_grid_utils.F90.

◆ tiny_number

real, parameter fv_grid_utils_mod::tiny_number =1.d-8
private

Definition at line 105 of file fv_grid_utils.F90.