FV3DYCORE  Version 2.0.0
fv_grid_tools_mod Module Reference

Functions/Subroutines

subroutine read_grid (Atm, grid_file, ndims, nregions, ng)
 The subroutine 'read_grid' reads the grid from the mosaic grid file. More...
 
subroutine get_symmetry (data_in, data_out, ishift, jshift, npes_x, npes_y, domain, tile, npx_g, bd)
 
subroutine, public init_grid (Atm, grid_name, grid_file, npx, npy, npz, ndims, nregions, ng, tile_coarse)
 The subroutine 'init_grid' reads the grid from the input file and sets up grid descriptors. More...
 
subroutine cartesian_to_spherical (x, y, z, lon, lat, r)
 
subroutine, public spherical_to_cartesian (lon, lat, r, x, y, z)
 
subroutine rot_3d (axis, x1in, y1in, z1in, angle, x2out, y2out, z2out, degrees, convert)
 The subroutine 'rot_3d' rotates points on a sphere in xyz coordinates. More...
 
real(kind=r_grid) function get_area_tri (ndims, p_1, p_2, p_3)
 brief The function 'get_area_tri' gets the surface area of a cell defined as a triangle on the sphere. More...
 
subroutine grid_area (nx, ny, ndims, nregions, bounded_domain, gridstruct, domain, bd)
 The subroutine 'grid_area' gets the surface area on a grid in lat/lon or xyz coordinates. More...
 
real(kind=r_grid) function get_angle (ndims, p1, p2, p3, rad)
 The function 'get_angle' gets the angle between 3 points on a sphere in lat/lon or xyz coordinates. More...
 
subroutine mirror_grid (grid_global, ng, npx, npy, ndims, nregions)
 The subroutine 'mirror_grid' mirrors the grid across the 0-longitude line. More...
 

Variables

real(kind=r_grid), parameter radius = cnst_radius
 
real(kind=r_grid), parameter, public todeg = 180.0d0/pi
 convert to degrees More...
 
real(kind=r_grid), parameter torad = pi/180.0d0
 convert to radians More...
 
real(kind=r_grid), parameter, public missing = 1.d25
 
real(kind=r_grid) csfac
 
logical, parameter debug_message_size = .false.
 
logical write_grid_char_file = .false.
 

Function/Subroutine Documentation

◆ cartesian_to_spherical()

subroutine fv_grid_tools_mod::cartesian_to_spherical ( real(kind=r_grid), intent(in)  x,
real(kind=r_grid), intent(in)  y,
real(kind=r_grid), intent(in)  z,
real(kind=r_grid), intent(out)  lon,
real(kind=r_grid), intent(out)  lat,
real(kind=r_grid), intent(out)  r 
)
private

Definition at line 1972 of file fv_grid_tools.F90.

◆ get_angle()

real(kind=r_grid) function fv_grid_tools_mod::get_angle ( integer, intent(in)  ndims,
real(kind=r_grid), dimension(ndims), intent(in)  p1,
real(kind=r_grid), dimension(ndims), intent(in)  p2,
real(kind=r_grid), dimension(ndims), intent(in)  p3,
integer, intent(in), optional  rad 
)
private

The function 'get_angle' gets the angle between 3 points on a sphere in lat/lon or xyz coordinates.

Determined by the 'ndims' argument: 2=lat/lon, 3=xyz The angle is returned in degrees.

Parameters
[in]ndims2=lat/lon, 3=xyz

Definition at line 2312 of file fv_grid_tools.F90.

◆ get_area_tri()

real(kind=r_grid) function fv_grid_tools_mod::get_area_tri ( integer, intent(in)  ndims,
real(kind=r_grid), dimension(ndims), intent(in)  p_1,
real(kind=r_grid), dimension(ndims), intent(in)  p_2,
real(kind=r_grid), dimension(ndims), intent(in)  p_3 
)
private

brief The function 'get_area_tri' gets the surface area of a cell defined as a triangle on the sphere.

The area is computed as the spherical excess [area units are based on the units of radius]

Parameters
[in]ndims2=lat/lon, 3=xyz

Definition at line 2069 of file fv_grid_tools.F90.

◆ get_symmetry()

subroutine fv_grid_tools_mod::get_symmetry ( real(kind=r_grid), dimension(bd%is:bd%ie+ishift, bd%js:bd%je+jshift ), intent(in)  data_in,
real(kind=r_grid), dimension(bd%is:bd%ie+jshift, bd%js:bd%je+ishift ), intent(out)  data_out,
integer, intent(in)  ishift,
integer, intent(in)  jshift,
integer, intent(in)  npes_x,
integer, intent(in)  npes_y,
type(domain2d)  domain,
integer  tile,
integer  npx_g,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

Definition at line 307 of file fv_grid_tools.F90.

◆ grid_area()

subroutine fv_grid_tools_mod::grid_area ( integer, intent(in)  nx,
integer, intent(in)  ny,
integer, intent(in)  ndims,
integer, intent(in)  nregions,
logical, intent(in)  bounded_domain,
type(fv_grid_type), intent(in), target  gridstruct,
type(domain2d), intent(inout)  domain,
type(fv_grid_bounds_type), intent(in)  bd 
)
private

The subroutine 'grid_area' gets the surface area on a grid in lat/lon or xyz coordinates.

Determined by 'ndims' argument: 2=lat/lon, 3=xyz) The area is returned in m^2 on a unit sphere.

Definition at line 2095 of file fv_grid_tools.F90.

◆ init_grid()

subroutine, public fv_grid_tools_mod::init_grid ( type(fv_atmos_type), intent(inout), target  Atm,
character(len=80), intent(in)  grid_name,
character(len=120), intent(in)  grid_file,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  npz,
integer, intent(in)  ndims,
integer, intent(in)  nregions,
integer, intent(in)  ng,
integer, dimension(:), intent(in)  tile_coarse 
)

The subroutine 'init_grid' reads the grid from the input file and sets up grid descriptors.

Definition at line 530 of file fv_grid_tools.F90.

◆ mirror_grid()

subroutine fv_grid_tools_mod::mirror_grid ( real(kind=r_grid), dimension(1-ng:npx +ng,1-ng:npy +ng,ndims,1:nregions), intent(inout)  grid_global,
integer, intent(in)  ng,
integer, intent(in)  npx,
integer, intent(in)  npy,
integer, intent(in)  ndims,
integer, intent(in)  nregions 
)
private

The subroutine 'mirror_grid' mirrors the grid across the 0-longitude line.

Definition at line 2340 of file fv_grid_tools.F90.

◆ read_grid()

subroutine fv_grid_tools_mod::read_grid ( type(fv_atmos_type), intent(inout), target  Atm,
character(len=*), intent(in)  grid_file,
integer, intent(in)  ndims,
integer, intent(in)  nregions,
integer, intent(in)  ng 
)
private

The subroutine 'read_grid' reads the grid from the mosaic grid file.

Definition at line 176 of file fv_grid_tools.F90.

◆ rot_3d()

subroutine fv_grid_tools_mod::rot_3d ( integer, intent(in)  axis,
real(kind=r_grid), intent(in)  x1in,
real(kind=r_grid), intent(in)  y1in,
real(kind=r_grid), intent(in)  z1in,
real(kind=r_grid), intent(inout)  angle,
real(kind=r_grid), intent(out)  x2out,
real(kind=r_grid), intent(out)  y2out,
real(kind=r_grid), intent(out)  z2out,
integer, intent(in), optional  degrees,
integer, intent(in), optional  convert 
)
private

The subroutine 'rot_3d' rotates points on a sphere in xyz coordinates.

Converts angle from degrees to radians if necessary

Parameters
[in]axisaxis of rotation 1=x, 2=y, 3=z
[in,out]angleangle to rotate in radians
[in]degreesif present convert angle from degrees to radians
[in]convertif present convert input point from spherical to cartesian, rotate, and convert back

Definition at line 2005 of file fv_grid_tools.F90.

◆ spherical_to_cartesian()

subroutine, public fv_grid_tools_mod::spherical_to_cartesian ( real(kind=r_grid), intent(in)  lon,
real(kind=r_grid), intent(in)  lat,
real(kind=r_grid), intent(in)  r,
real(kind=r_grid), intent(out)  x,
real(kind=r_grid), intent(out)  y,
real(kind=r_grid), intent(out)  z 
)

Definition at line 1990 of file fv_grid_tools.F90.

Variable Documentation

◆ csfac

real(kind=r_grid) fv_grid_tools_mod::csfac
private

Definition at line 164 of file fv_grid_tools.F90.

◆ debug_message_size

logical, parameter fv_grid_tools_mod::debug_message_size = .false.
private

Definition at line 166 of file fv_grid_tools.F90.

◆ missing

real(kind=r_grid), parameter, public fv_grid_tools_mod::missing = 1.d25

Definition at line 162 of file fv_grid_tools.F90.

◆ radius

real(kind=r_grid), parameter fv_grid_tools_mod::radius = cnst_radius
private

Definition at line 158 of file fv_grid_tools.F90.

◆ todeg

real(kind=r_grid), parameter, public fv_grid_tools_mod::todeg = 180.0d0/pi

convert to degrees

Definition at line 160 of file fv_grid_tools.F90.

◆ torad

real(kind=r_grid), parameter fv_grid_tools_mod::torad = pi/180.0d0
private

convert to radians

Definition at line 161 of file fv_grid_tools.F90.

◆ write_grid_char_file

logical fv_grid_tools_mod::write_grid_char_file = .false.
private

Definition at line 167 of file fv_grid_tools.F90.