ESMF_UtilCubedSphereMod Module



Variables

Type Visibility Attributes Name Initial
integer, private, parameter :: f_p = selected_real_kind(15)
integer, private :: grid_type = 0
integer, private, dimension(:,:,:), allocatable :: iinta
integer, private, dimension(:,:,:), allocatable :: iintb
integer, private :: interpOrder = 1
integer, private, dimension(:,:,:), allocatable :: jinta
integer, private, dimension(:,:,:), allocatable :: jintb
integer, private :: npx_g
integer, private :: npy_g
integer, private :: npz_g
integer, private :: ntiles_g
logical, private :: channel = .false.
logical, private :: cubed_sphere = .false.
logical, private :: debug_message_size = .false.
logical, private :: double_periodic = .false.
logical, private :: dxdy_area = .false.
logical, private :: have_north_pole = .false.
logical, private :: have_south_pole = .false.
logical, private :: is_grid_created = .false.
logical, private :: latlon = .false.
logical, private :: latlon_patch = .false.
logical, private :: latlon_strip = .false.
logical, private :: stretched_grid = .false.
logical, private :: uniform_ppm = .true.
logical, private :: write_grid_char_file = .false.
real(kind=ESMF_KIND_R8), private :: acapN
real(kind=ESMF_KIND_R8), private :: acapS
real(kind=ESMF_KIND_R8), private, allocatable :: acosp(:,:)
real(kind=ESMF_KIND_R8), private, allocatable, target, dimension(:,:,:) :: agrid
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: area
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: area_c
real(kind=ESMF_KIND_R8), private, allocatable :: cose(:,:)
real(kind=ESMF_KIND_R8), private, allocatable :: cosp(:,:)
real(kind=ESMF_KIND_R8), private :: csFac = -999
real(kind=ESMF_KIND_R8), private :: deglat_start = -30.
real(kind=ESMF_KIND_R8), private :: deglat_stop = 30.
real(kind=ESMF_KIND_R8), private :: deglon_start = -30.
real(kind=ESMF_KIND_R8), private :: deglon_stop = 30.
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: dx
real(kind=ESMF_KIND_R8), private :: dx_const = 1000.
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: dxa
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: dxc
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: dy
real(kind=ESMF_KIND_R8), private :: dy_const = 1000.
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: dya
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: dyc
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:,:) :: e1
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:,:) :: e2
real(kind=ESMF_KIND_R8), private :: globalarea
real(kind=ESMF_KIND_R8), private, allocatable, target, dimension(:,:,:) :: grid
real(kind=ESMF_KIND_R8), private, allocatable, target, dimension(:,:,:) :: grid_g
real(kind=ESMF_KIND_R8), private, parameter :: missing = 1.e25
real(kind=ESMF_KIND_R8), private, parameter :: pi = 3.14159265358979323846_ESMF_KIND_R8
real(kind=ESMF_KIND_R8), private, parameter :: radius = 6371.0
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rarea
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rarea_c
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rdx
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rdxa
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rdxc
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rdy
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rdya
real(kind=ESMF_KIND_R8), private, allocatable, dimension(:,:) :: rdyc
real(kind=ESMF_KIND_R8), private :: stretch
real(kind=ESMF_KIND_R8), private, parameter :: todeg = 180.0/pi
real(kind=ESMF_KIND_R8), private, parameter :: torad = pi/180.0
real(kind=ESMF_KIND_R8), private :: zeta = 1.0

Derived Types

type, public ::  ESMF_CubedSphereTransform_Args

Components

Type Visibility Attributes Name Initial
real(kind=ESMF_KIND_R8), public :: stretch_factor
real(kind=ESMF_KIND_R8), public :: target_lat
real(kind=ESMF_KIND_R8), public :: target_lon

Functions

private function great_circle_dist(q1, q2, radius)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: q1(2)
real(kind=ESMF_KIND_R8), intent(in) :: q2(2)
real(kind=ESMF_KIND_R8), intent(in), optional :: radius

Return Value real(kind=esmf_kind_r8)


Subroutines

public subroutine ESMF_UtilCreateCSCoords(npts, LonEdge, LatEdge, start, count, tile, LonCenter, LatCenter, schmidtTransform)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npts
real(kind=ESMF_KIND_R8), intent(inout), optional :: LonEdge(:,:)
real(kind=ESMF_KIND_R8), intent(inout), optional :: LatEdge(:,:)
integer, intent(in), optional :: start(:)
integer, intent(in), optional :: count(:)
integer, intent(in), optional :: tile
real(kind=ESMF_KIND_R8), intent(inout), optional :: LonCenter(:,:)
real(kind=ESMF_KIND_R8), intent(inout), optional :: LatCenter(:,:)
type(ESMF_CubedSphereTransform_Args), intent(in), optional :: schmidtTransform

public subroutine ESMF_UtilCreateCSCoordsPar(npts, LonEdge, LatEdge, start, count, tile, LonCenter, LatCenter, schmidtTransform)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: npts
real(kind=ESMF_KIND_R8), intent(inout), optional :: LonEdge(:,:)
real(kind=ESMF_KIND_R8), intent(inout), optional :: LatEdge(:,:)
integer, intent(in), optional :: start(:)
integer, intent(in), optional :: count(:)
integer, intent(in), optional :: tile
real(kind=ESMF_KIND_R8), intent(inout), optional :: LonCenter(:,:)
real(kind=ESMF_KIND_R8), intent(inout), optional :: LatCenter(:,:)
type(ESMF_CubedSphereTransform_Args), intent(in), optional :: schmidtTransform

private subroutine cart_to_latlon(np, q, xs, ys)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: np
real(kind=ESMF_KIND_R8), intent(inout) :: q(3,np)
real(kind=ESMF_KIND_R8), intent(inout) :: xs(np)
real(kind=ESMF_KIND_R8), intent(inout) :: ys(np)

private subroutine cartesian_to_spherical(x, y, z, lon, lat, r)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: x
real(kind=ESMF_KIND_R8), intent(in) :: y
real(kind=ESMF_KIND_R8), intent(in) :: z
real(kind=ESMF_KIND_R8), intent(out) :: lon
real(kind=ESMF_KIND_R8), intent(out) :: lat
real(kind=ESMF_KIND_R8), intent(out) :: r

private subroutine cell_center2(q11, q12, q21, q22, q31, q32, q41, q42, e2)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: q11
real(kind=ESMF_KIND_R8), intent(in) :: q12
real(kind=ESMF_KIND_R8), intent(in) :: q21
real(kind=ESMF_KIND_R8), intent(in) :: q22
real(kind=ESMF_KIND_R8), intent(in) :: q31
real(kind=ESMF_KIND_R8), intent(in) :: q32
real(kind=ESMF_KIND_R8), intent(in) :: q41
real(kind=ESMF_KIND_R8), intent(in) :: q42
real(kind=ESMF_KIND_R8), intent(out) :: e2(2)

private subroutine direct_transform(stretch_factor, lon_p, lat_p, lon, lat)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: stretch_factor

Stretching factor

real(kind=ESMF_KIND_R8), intent(in) :: lon_p

center location of the target face, radian

real(kind=ESMF_KIND_R8), intent(in) :: lat_p

center location of the target face, radian

real(kind=ESMF_KIND_R8), intent(inout) :: lon(:,:)
real(kind=ESMF_KIND_R8), intent(inout) :: lat(:,:)

private subroutine gnomonic_angl(im, lamda, theta)

Arguments

Type IntentOptional Attributes Name
integer :: im
real(kind=ESMF_KIND_R8) :: lamda(im+1,im+1)
real(kind=ESMF_KIND_R8) :: theta(im+1,im+1)

private subroutine gnomonic_dist(im, lamda, theta)

Arguments

Type IntentOptional Attributes Name
integer :: im
real(kind=ESMF_KIND_R8) :: lamda(im+1,im+1)
real(kind=ESMF_KIND_R8) :: theta(im+1,im+1)

private subroutine gnomonic_ed(im, lamda, theta)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: im
real(kind=ESMF_KIND_R8), intent(out) :: lamda(im+1,im+1)
real(kind=ESMF_KIND_R8), intent(out) :: theta(im+1,im+1)

private subroutine gnomonic_grids(grid_type, im, lon, lat)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: grid_type
integer, intent(in) :: im
real(kind=ESMF_KIND_R8), intent(out) :: lon(im+1,im+1)
real(kind=ESMF_KIND_R8), intent(out) :: lat(im+1,im+1)

private subroutine latlon2xyz(p, e)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: p(2)
real(kind=ESMF_KIND_R8), intent(out) :: e(3)

private subroutine latlon2xyz2(lon, lat, p3)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: lon
real(kind=ESMF_KIND_R8), intent(in) :: lat
real(kind=ESMF_KIND_R8), intent(out) :: p3(3)

private subroutine mirror_grid(grid_global, ng, npx, npy, ndims, nregions)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(inout) :: grid_global(1-ng:npx+ng,1-ng:npy+ng,ndims,1:nregions)
integer, intent(in) :: ng
integer, intent(in) :: npx
integer, intent(in) :: npy
integer, intent(in) :: ndims
integer, intent(in) :: nregions

private subroutine mirror_grid_local(local_tile, global_tile1, start, count, ndims, tileno)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(inout) :: local_tile(:,:,:)
real(kind=ESMF_KIND_R8), intent(inout) :: global_tile1(:,:,:)
integer, intent(in) :: start(2)
integer, intent(in) :: count(2)
integer, intent(in) :: ndims
integer, intent(in) :: tileno

private subroutine mirror_latlon(lon1, lat1, lon2, lat2, lon0, lat0, lon3, lat3)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: lon1
real(kind=ESMF_KIND_R8), intent(in) :: lat1
real(kind=ESMF_KIND_R8), intent(in) :: lon2
real(kind=ESMF_KIND_R8), intent(in) :: lat2
real(kind=ESMF_KIND_R8), intent(in) :: lon0
real(kind=ESMF_KIND_R8), intent(in) :: lat0
real(kind=ESMF_KIND_R8), intent(out) :: lon3
real(kind=ESMF_KIND_R8), intent(out) :: lat3

private subroutine rot_3d(axis, x1in, y1in, z1in, angle, x2out, y2out, z2out, degrees, convert)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: axis
real(kind=ESMF_KIND_R8), intent(in) :: x1in
real(kind=ESMF_KIND_R8), intent(in) :: y1in
real(kind=ESMF_KIND_R8), intent(in) :: z1in
real(kind=ESMF_KIND_R8), intent(inout) :: angle
real(kind=ESMF_KIND_R8), intent(out) :: x2out
real(kind=ESMF_KIND_R8), intent(out) :: y2out
real(kind=ESMF_KIND_R8), intent(out) :: z2out
integer, intent(in), optional :: degrees
integer, intent(in), optional :: convert

private subroutine spherical_to_cartesian(lon, lat, r, x, y, z)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(in) :: lon
real(kind=ESMF_KIND_R8), intent(in) :: lat
real(kind=ESMF_KIND_R8), intent(in) :: r
real(kind=ESMF_KIND_R8), intent(out) :: x
real(kind=ESMF_KIND_R8), intent(out) :: y
real(kind=ESMF_KIND_R8), intent(out) :: z

private subroutine symm_ed(im, lamda, theta)

Arguments

Type IntentOptional Attributes Name
integer :: im
real(kind=ESMF_KIND_R8) :: lamda(im+1,im+1)
real(kind=ESMF_KIND_R8) :: theta(im+1,im+1)

private subroutine vect_cross(e, p1, p2)

Arguments

Type IntentOptional Attributes Name
real(kind=ESMF_KIND_R8), intent(out) :: e(3)
real(kind=ESMF_KIND_R8), intent(in) :: p1(3)
real(kind=ESMF_KIND_R8), intent(in) :: p2(3)