grid_tools  1.13.0
pfun Module Reference

This module is for evaluating several useful real-valued functions that are not always available in Fortran compilers. More...

Data Types

interface  ahav
 
interface  ahavh
 
interface  atanh
 
interface  gd
 
interface  gdi
 
interface  hav
 
interface  havh
 
interface  sech
 
interface  sechs
 
interface  sinhox
 
interface  sinhoxm
 
interface  sinox
 
interface  sinoxm
 

Functions/Subroutines

real(dp) function ahav_d (a)
 Arc-haversine function for double precision real. More...
 
real(sp) function ahav_s (a)
 Arc-haversine function for single precision real. More...
 
real(dp) function ahavh_d (a)
 Hyperbolic arc-haversine for double precision real. More...
 
real(sp) function ahavh_s (a)
 Hyperbolic arc-haversine for single precision real. More...
 
real(dp) function atanh_d (t)
 Hyperbolic arc-tangent for double precision real. More...
 
real(sp) function atanh_s (t)
 Hyperbolic arc-tangent for single precision real. More...
 
real(dp) function gd_d (x)
 Gudermannian function (related to Mercator map projections) More...
 
real(sp) function gd_s (x)
 Gudermannian function (related to Mercator map projections) More...
 
real(dp) function gdi_d (y)
 Inverse Gudermannian function for double precision real. More...
 
real(sp) function gdi_s (y)
 Inverse Gudermannian function for single precision real. More...
 
real(dp) function hav_d (t)
 Haversine function for double precision real (for geometry on the sphere). More...
 
real(sp) function hav_s (t)
 Haversine function for single precision real (for geometry on the sphere). More...
 
real(dp) function havh_d (t)
 Hyperbolic-haversine for double precision real (for pseudosphere geometry). More...
 
real(sp) function havh_s (t)
 Hyperbolic-haversine for single precision real (for pseudosphere geometry). More...
 
real(dp) function sech_d (x)
 Hyperbolic secant for double precision real. More...
 
real(sp) function sech_s (x)
 Hyperbolic secant for single precision real. More...
 
real(dp) function sechs_d (x)
 Hyperbolic secant-squared function (logistic distribution). More...
 
real(sp) function sechs_s (x)
 Hyperbolic secant-squared function (logistic distribution). More...
 
real(dp) function sinhox_d (x)
 Evaluate the symmetric real function sinh(x)/x. More...
 
real(dp) function sinhoxm_d (x)
 Evaluate the symmetric real function sinh(x)/x-1. More...
 
real(dp) function sinox_d (x)
 Evaluate the symmetric real function sin(x)/x. More...
 
real(dp) function sinoxm_d (x)
 Evaluate the symmetric real function sin(x)/x-1, still accurate near x=0. More...
 

Detailed Description

This module is for evaluating several useful real-valued functions that are not always available in Fortran compilers.

These have applications in map transformations, spherical and pseudo-spherical surface geometry, probability distributions, and splines.

Author
R. J. Purser

Function/Subroutine Documentation

◆ ahav_d()

real(dp) function pfun::ahav_d ( real(dp), intent(in)  a)

Arc-haversine function for double precision real.

Parameters
[in]adouble precision real argument
Returns
t arc-haversine function of a
Author
R. J. Purser

Definition at line 157 of file pfun.f90.

References pietc::u2.

◆ ahav_s()

real(sp) function pfun::ahav_s ( real(sp), intent(in)  a)

Arc-haversine function for single precision real.

Parameters
[in]asingle precision real argument
Returns
t arc-haversine function of a
Author
R. J. Purser

Definition at line 144 of file pfun.f90.

References pietc::t, and pietc::u2.

◆ ahavh_d()

real(dp) function pfun::ahavh_d ( real(dp), intent(in)  a)

Hyperbolic arc-haversine for double precision real.

Parameters
[in]adouble precision real argument
Returns
t hyperbolic arc-haversine of a
Author
R. J. Purser

Definition at line 185 of file pfun.f90.

References pietc::u2.

◆ ahavh_s()

real(sp) function pfun::ahavh_s ( real(sp), intent(in)  a)

Hyperbolic arc-haversine for single precision real.

Note
The minus sign in the hyperbolic arc-haversine definition.
Parameters
[in]asingle precision real argument
Returns
t hyperbolic arc-haversine of a
Author
R. J. Purser

Definition at line 172 of file pfun.f90.

References pietc::t, and pietc::u2.

◆ atanh_d()

real(dp) function pfun::atanh_d ( real(dp), intent(in)  t)

Hyperbolic arc-tangent for double precision real.

Parameters
[in]tdouble precision real argument
Returns
a hyperbolic arc-tangent of t
Author
R. J. Purser

Definition at line 216 of file pfun.f90.

References pietc::o2, pietc::o3, pietc::o5, and pietc::u1.

◆ atanh_s()

real(sp) function pfun::atanh_s ( real(sp), intent(in)  t)

Hyperbolic arc-tangent for single precision real.

(compilers now have this)

Parameters
[in]tsingle precision real argument
Returns
a hyperbolic arc-tangent of t
Author
R. J. Purser

Definition at line 198 of file pfun.f90.

References pietc::o2, pietc::t, and pietc::u1.

◆ gd_d()

real(dp) function pfun::gd_d ( real(dp), intent(in)  x)
private

Gudermannian function (related to Mercator map projections)

Parameters
[in]xdouble precision real argument of function
Returns
y Gudermannian function of x
Author
R. J. Purser

Definition at line 54 of file pfun.f90.

◆ gd_s()

real(sp) function pfun::gd_s ( real(sp), intent(in)  x)
private

Gudermannian function (related to Mercator map projections)

Parameters
[in]xsingle precision real argument of function
Returns
y Gudermannian function of x
Author
R. J. Purser

Definition at line 41 of file pfun.f90.

◆ gdi_d()

real(dp) function pfun::gdi_d ( real(dp), intent(in)  y)
private

Inverse Gudermannian function for double precision real.

Parameters
[in]ydouble precision real argument
Returns
x inverse Gudermannian function of y
Author
R. J. Purser

Definition at line 78 of file pfun.f90.

◆ gdi_s()

real(sp) function pfun::gdi_s ( real(sp), intent(in)  y)
private

Inverse Gudermannian function for single precision real.

Parameters
[in]ysingle precision real argument
Returns
x inverse Gudermannian function of y
Author
R. J. Purser

Definition at line 66 of file pfun.f90.

◆ hav_d()

real(dp) function pfun::hav_d ( real(dp), intent(in)  t)

Haversine function for double precision real (for geometry on the sphere).

Parameters
[in]tdouble precision real argument
Returns
a haversine function of t
Author
R. J. Purser

Definition at line 103 of file pfun.f90.

References pietc::o2.

◆ hav_s()

real(sp) function pfun::hav_s ( real(sp), intent(in)  t)
private

Haversine function for single precision real (for geometry on the sphere).

Parameters
[in]tsingle precision real argument
Returns
a haversine function of t
Author
R. J. Purser

Definition at line 90 of file pfun.f90.

References pietc::o2, and pietc::t.

◆ havh_d()

real(dp) function pfun::havh_d ( real(dp), intent(in)  t)

Hyperbolic-haversine for double precision real (for pseudosphere geometry).

Parameters
[in]tdouble precision real argument
Returns
a hyperbolic-haversine function of t
Author
R. J. Purser

Definition at line 131 of file pfun.f90.

References pietc::o2.

◆ havh_s()

real(sp) function pfun::havh_s ( real(sp), intent(in)  t)

Hyperbolic-haversine for single precision real (for pseudosphere geometry).

Note
The minus sign in the hyperbolic-haversine definition.
Parameters
[in]tsingle precision real argument
Returns
a hyperbolic-haversine function of t
Author
R. J. Purser

Definition at line 118 of file pfun.f90.

References pietc::o2, and pietc::t.

◆ sech_d()

real(dp) function pfun::sech_d ( real(dp), intent(in)  x)

Hyperbolic secant for double precision real.

Parameters
[in]xdouble precision real argument
Returns
r hyperbolic secant of x
Author
R. J. Purser

Definition at line 251 of file pfun.f90.

References pietc::u1, and pietc::u2.

◆ sech_s()

real(sp) function pfun::sech_s ( real(sp), intent(in)  x)

Hyperbolic secant for single precision real.

Parameters
[in]xsingle precision real argument
Returns
r hyperbolic secant of x
Author
R. J. Purser

Definition at line 234 of file pfun.f90.

References pietc::u1, and pietc::u2.

◆ sechs_d()

real(dp) function pfun::sechs_d ( real(dp), intent(in)  x)
private

Hyperbolic secant-squared function (logistic distribution).

Parameters
[in]xdouble precision real argument
Returns
r sech-squared of x
Author
R. J. Purser

Definition at line 279 of file pfun.f90.

◆ sechs_s()

real(sp) function pfun::sechs_s ( real(sp), intent(in)  x)

Hyperbolic secant-squared function (logistic distribution).

Parameters
[in]xsingle precision real argument
Returns
r sech-squared of x
Author
R. J. Purser

Definition at line 267 of file pfun.f90.

◆ sinhox_d()

real(dp) function pfun::sinhox_d ( real(dp), intent(in)  x)

Evaluate the symmetric real function sinh(x)/x.

Parameters
[in]xdouble precision real argument
Returns
r sinh(x)/x
Author
R. J. Purser

Definition at line 345 of file pfun.f90.

References pietc::u1.

◆ sinhoxm_d()

real(dp) function pfun::sinhoxm_d ( real(dp), intent(in)  x)

Evaluate the symmetric real function sinh(x)/x-1.

still accurate near x=0.

Parameters
[in]xdouble precision real argument
Returns
r sinh(x)-1
Author
R. J. Purser

Definition at line 325 of file pfun.f90.

References pietc::u1.

◆ sinox_d()

real(dp) function pfun::sinox_d ( real(dp), intent(in)  x)

Evaluate the symmetric real function sin(x)/x.

Parameters
[in]xdouble precision real argument
Returns
r sin(x)/x
Author
R. J. Purser

Definition at line 311 of file pfun.f90.

References pietc::u1.

◆ sinoxm_d()

real(dp) function pfun::sinoxm_d ( real(dp), intent(in)  x)
private

Evaluate the symmetric real function sin(x)/x-1, still accurate near x=0.

Parameters
[in]xdouble precision real argument
Returns
r sin(x)/x-1
Author
R. J. Purser

Definition at line 291 of file pfun.f90.

References pietc::u1.