GVTDX_sub Module

Sub module for GVTDX procedures.


Variables

Type Visibility Attributes Name Initial
real, public, parameter :: pi = 3.14159265e0

Pi for real

real, public, parameter :: radius = 6.371e6

polar radius of the Earth (m)

complex, public, parameter :: img = (0.0, 1.0)

Imaginary unit for real

double precision, public, parameter :: pi_dp = 3.14159265358979d0

Pi for double

double precision, public, parameter :: radius_dp = 6.371d6

polar radius of the Earth (m)

double precision, public, parameter :: omega_dp = 7.2918933286303412732d-5

rotational angular velocity of Earth (s-1)

complex(kind=kind(0d0)), public, parameter :: img_cdp = (0.0d0, 1.0d0)

Imaginary unit for double


Functions

public function line_integral(nr, rdh, gkrr, div_r, undef)

Calculate a line integral (actually, sum for arguments)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nr

Radial grid number

double precision, intent(in) :: rdh(nr+1)

R-coordinate [m]

double precision, intent(in) :: gkrr(nr+1)

Green function

double precision, intent(in) :: div_r(nr+1)

Integral of gkrr

double precision, intent(in), optional :: undef

Undefined value

Return Value doubleprecision

public function green_func(rc, r, nval)

Calculation of the Green function:


nval

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: rc

Source radius

double precision, intent(in) :: r

Non-source radius

integer, intent(in) :: nval

Order number

Return Value doubleprecision

public function undef_checker_2d(val, undef)

Check missing value in "val"

Arguments

Type IntentOptional Attributes Name
double precision, intent(in), dimension(:,:) :: val

Input

double precision, intent(in) :: undef

Undefined value

Return Value logical

public function undef_checker_1d(val, undef)

Check missing value in "val"

Arguments

Type IntentOptional Attributes Name
double precision, intent(in), dimension(:) :: val

Input

double precision, intent(in) :: undef

Undefined value

Return Value logical

public function ll2radi(lon1, lat1, lon2, lat2, forcef)

calculate arc distance between two points on the sphere

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: lon1

longitude1 (rad)

double precision, intent(in) :: lat1

latitude1 (rad)

double precision, intent(in) :: lon2

longitude2 (rad)

double precision, intent(in) :: lat2

latitude2 (rad)

logical, intent(in), optional :: forcef

truncating flag for numerical error, default = .false. (no truncating)

Return Value real

public function line_number_counter(fname, funit)

count the line in the fname

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fname

counting the file name

integer, intent(in), optional :: funit

file unit (default: 11)

Return Value integer

public function c2r_convert(cval)

convert char to float

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: cval

char

Return Value real


Subroutines

public subroutine prod_vortex_structure(r, t, rmax, vmax, c1u, c2u, Vt, Vr, Vt_pert, Vr_pert, Vt_pert_ang, Vr_pert_ang, ropt, dopt, Vt_0, Vr_0, Uxm, Vym, flag_disp)

Producing vortex structure with rmax, vmax, and umax

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

radius [m]

double precision, intent(in) :: t(:)

azimuthal angle [rad]

double precision, intent(in) :: rmax

radius of maximum tangential wind speed [m]

double precision, intent(in) :: vmax

maximum tangential wind speed [m s-1]

double precision, intent(in) :: c1u

coefficient 1 for radial wind [s-1]

double precision, intent(in) :: c2u

coefficient 2 for radial wind [s-1]

double precision, intent(out) :: Vt(size(r),size(t))

Profile of tangential wind

double precision, intent(out) :: Vr(size(r),size(t))

Profile of radial wind

double precision, intent(in), optional :: Vt_pert(:)

perturbations of tangential wind [m s-1]

double precision, intent(in), optional :: Vr_pert(:)

perturbations of radial wind [m s-1]

double precision, intent(in), optional :: Vt_pert_ang(:)

angles of tangential wind [rad]

double precision, intent(in), optional :: Vr_pert_ang(:)

angles of radial wind [rad]

logical, intent(in), optional :: ropt

option for radial variation of perturbation Vt and Vr

logical, intent(in), optional :: dopt

option for divergent components of perturbation Vt and Vr

double precision, intent(out), optional :: Vt_0(:)

Radial profile of axisymmetric Vt [m s-1]

double precision, intent(out), optional :: Vr_0(:)

Radial profile of axisymmetric Vr [m s-1]

double precision, intent(out), optional :: Uxm(2)

Azimuthal averaged X-wind of wavenumber-1 component [m s-1]

double precision, intent(out), optional :: Vym(2)

Azimuthal averaged Y-wind of wavenumber-1 component [m s-1]

logical, intent(in), optional :: flag_disp

public subroutine prod_vortex_structure_L06(r, t, rmax, zmax, epsr, Vt_pert_ang, Vt, Vr)

Producing vortex structure with rmax, vmax, and umax in Lee et al. (2006)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

radius [m]

double precision, intent(in) :: t(:)

azimuthal angle [rad]

double precision, intent(in) :: rmax

radius of maximum tangential wind speed [m]

double precision, intent(in) :: zmax

constant vorticity in the eye [s-1]

double precision, intent(in) :: epsr

distance of epsilon for WN2 [m]

double precision, intent(in) :: Vt_pert_ang

angles of tangential wind [rad]

double precision, intent(out) :: Vt(size(r),size(t))

Profile of tangential wind

double precision, intent(out) :: Vr(size(r),size(t))

Profile of radial wind

public subroutine conv_VtVr2VxVy_rt(r, t, Vt, Vr, Vx, Vy, undef)

Convert Vt and Vr to Vx and Vy on R-T coordinates

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

R-coordinate [m]

double precision, intent(in) :: t(:)

T-coordinate [rad]

double precision, intent(in) :: Vt(size(r),size(t))

tangential wind component on R-T coordinates

double precision, intent(in) :: Vr(size(r),size(t))

radial wind component on R-T coordinates

double precision, intent(out) :: Vx(size(r),size(t))

X-component of wind on R-T coordinates

double precision, intent(out) :: Vy(size(r),size(t))

Y-component of wind on R-T coordinates

double precision, intent(in), optional :: undef

Undefined value

public subroutine conv_VxVy2VtVr_rt(r, t, Vx, Vy, Vt, Vr, undef)

Convert Vx and Vy to Vr and Vt on R-T coordinates

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

R-coordinate [m]

double precision, intent(in) :: t(:)

T-coordinate [rad]

double precision, intent(in) :: Vx(size(r),size(t))

X-component of wind on R-T coordinates

double precision, intent(in) :: Vy(size(r),size(t))

Y-component of wind on R-T coordinates

double precision, intent(out) :: Vt(size(r),size(t))

tangential wind component on R-T coordinates

double precision, intent(out) :: Vr(size(r),size(t))

radial wind component on R-T coordinates

double precision, intent(in), optional :: undef

Undefined value

public subroutine conv_VxVy2VtVr_xy(x, y, xc, yc, Vx, Vy, Vt, Vr, undef)

Convert Vx and Vy to Vr and Vt on X-Y coordinates

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

X-coordinate [m]

double precision, intent(in) :: y(:)

Y-coordinate [m]

double precision, intent(in) :: xc

X component of the center [m]

double precision, intent(in) :: yc

Y component of the center [m]

double precision, intent(in) :: Vx(size(x),size(y))

X-component of wind on X-Y coordinates

double precision, intent(in) :: Vy(size(x),size(y))

Y-component of wind on X-Y coordinates

double precision, intent(out) :: Vt(size(x),size(y))

tangential wind component on X-Y coordinates

double precision, intent(out) :: Vr(size(x),size(y))

radial wind component on X-Y coordinates

double precision, intent(in), optional :: undef

Undefined value

public subroutine proj_VxVy2Vraxy(x, y, rax, ray, Vx, Vy, Vraxy, undef)

Calculate Vx and Vy to Vd along with radar beams on X-Y coodinates

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

X-coordinate

double precision, intent(in) :: y(:)

Y-coordinate

double precision, intent(in) :: rax

X-coodinate of radar location

double precision, intent(in) :: ray

Y-coodinate of radar location

double precision, intent(in) :: Vx(size(x),size(y))

X-component of wind on X-Y coordinates

double precision, intent(in) :: Vy(size(x),size(y))

Y-component of wind on X-Y coordinates

double precision, intent(out) :: Vraxy(size(x),size(y))

velocity along with beam on X-Y coordinates

double precision, intent(in), optional :: undef

Undefined value

public subroutine proj_VtVr2Vrart(r, t, td, Vt, Vr, Vra, undef)

Convert Vt and Vr to Vx and Vy on R-T coordinates

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

R-coordinate [m]

double precision, intent(in) :: t(:)

T-coordinate [rad]

double precision, intent(in) :: td(size(r),size(t))

radar azimuthal angle on R-T coordinate [rad]

double precision, intent(in) :: Vt(size(r),size(t))

tangential wind component on R-T coordinates

double precision, intent(in) :: Vr(size(r),size(t))

radial wind component on R-T coordinates

double precision, intent(out) :: Vra(size(r),size(t))

Velocity along beam on R-T coordinates

double precision, intent(in), optional :: undef

undefined value

public subroutine div_curl_2d(r, t, ur, vt, divr, curl, undef)

Calculation of rotation and divergence from radial and tangential winds
divr =
curl =

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

radius [m]

double precision, intent(in) :: t(:)

angle [rad]

double precision, intent(in) :: ur(size(r),size(t))

Ur [m/s]

double precision, intent(in) :: vt(size(r),size(t))

Vt [m/s]

double precision, intent(out) :: divr(size(r),size(t))

divergence [1/s]

double precision, intent(out) :: curl(size(r),size(t))

rotation [1/s]

double precision, intent(in), optional :: undef

Undefined value

public subroutine rotate_thetad_tc(thetad_tc, Vx, Vy, undef)

Rotate horizontal winds in the east-west and north-south directions to the storm-relative direction.

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: thetad_tc

Angle of the direction from the radar to the storm center [rad]

double precision, intent(inout) :: Vx(:,:)

Horizontal wind component in the east-west direction [m/s]

double precision, intent(inout) :: Vy(size(Vx,1),size(Vx,2))

Horizontal wind component in the north-south direction [m/s]

double precision, intent(in), optional :: undef

Undefined value

public subroutine conv_d2r_1d(ival, oval)

Convert double to real

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: ival(:)

Input

real, intent(out) :: oval(size(ival))

Output

public subroutine conv_d2r_2d(ival, oval)

Convert double to real

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: ival(:,:)

Input

real, intent(out) :: oval(size(ival,1),size(ival,2))

Output

public subroutine conv_d2r_3d(ival, oval)

convert double to real

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: ival(:,:,:)

input array

real, intent(out) :: oval(size(ival,1),size(ival,2),size(ival,3))

output array

public subroutine conv_r2d_2d(ival, oval)

convert real to double

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: ival(:,:)

input array

double precision, intent(out) :: oval(size(ival,1),size(ival,2))

output array

public subroutine sum_1d(val, res, undef)

Calculation of sum for 1D variable

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: val(:)

input

double precision, intent(out) :: res

output

double precision, intent(in), optional :: undef

public subroutine add_2d(ioval, ival, undef)

add ival

Arguments

Type IntentOptional Attributes Name
double precision, intent(inout) :: ioval(:,:)

Base value

double precision, intent(in) :: ival(size(ioval,1),size(ioval,2))

added

double precision, intent(in), optional :: undef

Undefined value

public subroutine add_3d(ioval, ival, undef)

add ival

Arguments

Type IntentOptional Attributes Name
double precision, intent(inout) :: ioval(:,:,:)

Base value

double precision, intent(in) :: ival(size(ioval,1),size(ioval,2),size(ioval,3))

added

double precision, intent(in), optional :: undef

Undefined value

public subroutine subst_2d(ioval, ival, undef)

subtract ival

Arguments

Type IntentOptional Attributes Name
double precision, intent(inout) :: ioval(:,:)

Base value

double precision, intent(in) :: ival(size(ioval,1),size(ioval,2))

Subtracted

double precision, intent(in), optional :: undef

Undefined value

public subroutine subst_2d_r(ioval, ival, undef)

subtract ival

Arguments

Type IntentOptional Attributes Name
real, intent(inout) :: ioval(:,:)

Base value

real, intent(in) :: ival(size(ioval,1),size(ioval,2))

Subtracted value

real, intent(in), optional :: undef

Undefined value

public subroutine rearrange_3d_2d(val3d, val2d)

Rearrange 3d variable to 2d variable (k,i,j -> i*j,k)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: val3d(:,:,:)

Input

double precision, intent(out) :: val2d(size(val3d,2)*size(val3d,3),size(val3d,1))

Output

public subroutine rearrange_2d_1d(val2d, val1d)

Rearrange 2d variable to 1d variable (i,j -> i*j)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: val2d(:,:)

Input

double precision, intent(out) :: val1d(size(val2d,1)*size(val2d,2))

Output

public subroutine display_1val_max(val, undef, cout, vout)

Display the maximum of the array val

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: val(:,:)

Input 1

real, intent(in), optional :: undef

Undefined value

character(len=*), intent(out), optional :: cout

Maximum value by character

real, intent(out), optional :: vout

Maximum value by float

public subroutine display_2valdiff_max(val1, val2, undef, cout, vout)

Display the maximum of the difference between val1 and val2

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: val1(:,:)

Input 1

double precision, intent(in) :: val2(size(val1,1),size(val1,2))

Input 2

double precision, intent(in), optional :: undef

Undefined value

character(len=*), intent(out), optional :: cout

Maximum value by character

real, intent(out), optional :: vout

Maximum value by float

public subroutine stdout(message, routine_name, mtype)

Standard output for message

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message

output message

character(len=*), intent(in) :: routine_name

called routine name

integer, intent(in) :: mtype

message type 0: message, -1: error, 1: warning

public subroutine fp_gauss(c, d, x)

Gauss-Jordan method with fully pivotting (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: c(size(d),size(d))

Square matrix (array is the first elements)

double precision, intent(in) :: d(:)

Vector

double precision, intent(inout) :: x(size(d))

Vector for unknown variables

public subroutine fp_invert_mat(ax, xx)

Calculate the inverse "xx" for the matrix "ax" (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: ax(:,:)

Input matrix

double precision, intent(inout) :: xx(size(ax,1),size(ax,2))

Inverse

public subroutine tangent_conv_scal(x, y, xc, yc, u, r, theta, v, undef, undefg, stdopt)

Convert the Cartesian grid to polar grid with the origin of the storm center (from STPK) The procedure: (1) Define the given polar grid (r-theta) on the Cartesian grid (2) Search the 4 nearest points on the Cartesian grid (x-y) for each polar grid point (3) Performing the bilinear interpolation of the 4 values defined on the Cartesian grid to the polar grid.

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

X-coordinate on the Cartesian grid

double precision, intent(in) :: y(:)

Y-coordinate on the Cartesian grid

double precision, intent(in) :: xc

X-component of the storm center

double precision, intent(in) :: yc

Y-component of the storm center

double precision, intent(in) :: u(size(x),size(y))

Values defined on the Cartesian grid

double precision, intent(in) :: r(:)

R-coordinate on the polar grid with the origin (xc, yc).

double precision, intent(in) :: theta(:)

theta-coordinate of the polar grid with the origin (xc, yc) [rad]

double precision, intent(out) :: v(size(r),size(theta))

Values converted to the polar grid

double precision, intent(in), optional :: undef

Missing value for the outside of the polar grid area (default: -999.0)

double precision, intent(in), optional :: undefg

Missing value for the inside of the polar grid area (default: -999.0)

logical, intent(in), optional :: stdopt

Display debug messages. (default: .false. == No display)

public subroutine cart_conv_scal(r, theta, v, x, y, xc, yc, u, undef, undefg, stdopt)

Convert polar grid with the origin of the storm center to the Cartesian grid (from STPK) The procedure: (1) Define the given Cartesian grid (x-y) on the polar grid (2) Search the 4 nearest points on the polar grid for each Cartesian grid point (3) Performing the bilinear interpolation of the 4 values defined on the polar grid to the Cartesian grid.

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r(:)

R-coordinate on the polar grid with the origin (xc, yc).

double precision, intent(in) :: theta(:)

theta-coordinate of the polar grid with the origin (xc, yc) [rad]

double precision, intent(in) :: v(size(r),size(theta))

Values defined on the polar grid

double precision, intent(in) :: x(:)

X-coordinate on the Cartesian grid

double precision, intent(in) :: y(:)

Y-coordinate on the Cartesian grid

double precision, intent(in) :: xc

X-component of the storm center

double precision, intent(in) :: yc

Y-component of the storm center

double precision, intent(out) :: u(size(x),size(y))

Values converted to the Cartesian grid

double precision, intent(in), optional :: undef

Missing value for the outside of the Cartesian grid area (default: -999.0)

double precision, intent(in), optional :: undefg

Missing value for the inside of the Cartesian grid area (default: -999.0)

logical, intent(in), optional :: stdopt

Display debug messages. (default: .false. == No display)

public subroutine Mean_1d(x, ave, error, nc)

Average x

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

Input data

double precision, intent(inout) :: ave

Output mean value

double precision, intent(in), optional :: error

Missing value

integer, intent(inout), optional :: nc

Number of sampling data without error

public subroutine interpo_search_2d(x, y, pointx, pointy, i, j, undeff, stdopt)

Floor function for the real grid points (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

X-coordinate

double precision, intent(in) :: y(:)

Y-coordinate

double precision, intent(in) :: pointx

The X point in real

double precision, intent(in) :: pointy

The Y point in real

integer, intent(out) :: i

floor(pointx)

integer, intent(out) :: j

floor(pointy)

integer, intent(in), optional :: undeff

In case of (x(1)>pointx or y(1)>pointy), the value returned to i and j (default = 0)

logical, intent(in), optional :: stdopt

Display debug messages (default = .false. = Not display)

public subroutine interpo_search_1d(x, point, i, undeff, stdopt)

Floor function for the real grid points (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

X-coordinate

double precision, intent(in) :: point

The X point in real

integer, intent(out) :: i

floor(pointx)

integer, intent(in), optional :: undeff

In case of (x(1)>pointx or y(1)>pointy), the value returned to i and j (default = 0)

logical, intent(in), optional :: stdopt

Display debug messages (default = .false. = Not display)

public subroutine xy_2_rt(x, y, xc, yc, r, t)

Convert the Cartesian (x-y) grid to the polar (r-t) grid (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x

X-coordinate [m]

double precision, intent(in) :: y

Y-coordinate [m]

double precision, intent(in) :: xc

X-coordinate of the center on the polar grid

double precision, intent(in) :: yc

Y-coordinate of the center on the polar grid

double precision, intent(out) :: r

Radius [m]

double precision, intent(out) :: t

Angle [rad]

public subroutine rt_2_xy(r, t, x, y)

Convert the polar grid (r-t) to the Cartesian (x-y) grid (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r

Radius [m]

double precision, intent(in) :: t

Angle [rad]

double precision, intent(out) :: x

X-coordinate [m]

double precision, intent(out) :: y

Y-coordinate [m]

public subroutine interpolation_2d(x, y, z, point, val)

Perform bilinear interpolation to the "point" on the Cartesian (x-y) grid (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(2)

The nearest west and east points for "point"

double precision, intent(in) :: y(2)

The nearest south and north points for "point"

double precision, intent(in) :: z(2,2)

Values defined at (x,y). z(1,1) at x(1), y(1) z(1,2) at x(1), y(2) z(2,1) at x(2), y(1) z(2,2) at x(2), y(2)

double precision, intent(in) :: point(2)

The target point for the interpolation

double precision, intent(out) :: val

Interpolated value

public subroutine interpolation_1d(x, y, point, val)

Perform linear interpolation to the "point" on the Cartesian (x) grid (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(2)

The nearest west and east points for "point"

double precision, intent(in) :: y(2)

Values defined at x. y(1) at x(1) y(2) at x(2)

double precision, intent(in) :: point

The target point for the interpolation

double precision, intent(out) :: val

Interpolated value

public subroutine auto_interpolation_2d(x, y, r, q, u, v, undef, stdopt)

Automatic interpolation for 2d data (continuous running of interpolation_2d)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

reference grid 1

double precision, intent(in) :: y(:)

reference grid 2

double precision, intent(in) :: r(:)

target grid 1

double precision, intent(in) :: q(:)

target grid 2

double precision, intent(in) :: u(size(x),size(y))

reference data

double precision, intent(inout) :: v(size(r),size(q))

interpolated data

double precision, intent(in), optional :: undef

undefined value

logical, intent(in), optional :: stdopt

Display debug messages. (default: .false. == No display)

public subroutine auto_interpo_search_1d(x, point, i, undeff, stdopt)

continuous running of interpo_search_1d

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

gradual increasing array

double precision, intent(in) :: point(:)

searching points

integer, intent(inout) :: i(size(point))

floor for each "point"

integer, intent(in), optional :: undeff

In case of (x(1)>pointx), the value returned to i (default = 0)

logical, intent(in), optional :: stdopt

Display debug messages. (default: .false. == No display)

public subroutine auto_interpo_search_2d(x, y, pointx, pointy, i, j, undeff, stdopt)

continuous running of auto_interpo_search_1d

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

gradual increasing array 1

double precision, intent(in) :: y(:)

gradual increasing array 2

double precision, intent(in) :: pointx(:)

searching points for x

double precision, intent(in) :: pointy(:)

searching points for y

integer, intent(inout) :: i(size(pointx))

floor for pointx

integer, intent(inout) :: j(size(pointy))

floor for pointy

integer, intent(in), optional :: undeff

In case of (x(1)>pointx or y(1)>pointy), the value returned to i and j (default = 0)

logical, intent(in), optional :: stdopt

探索範囲が見つからない旨の標準出力を表示させないようにする.

public subroutine max_val_1d(var, mamv, undef)

Get the max value (from STPK)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: var(:)

Searched array

double precision, intent(inout) :: mamv

Max value in var

double precision, intent(in), optional :: undef

undefined value

public subroutine stand_devi(x, true_val, anor, undef)

Calculate RMSE of x for the "true_val" (from STPK)
Definition: RMSE

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

sampling data

double precision, intent(in) :: true_val

reference data

double precision, intent(out) :: anor

RMSE

double precision, intent(in), optional :: undef

missing value

public subroutine ll2rt(lon0, lat0, lon1, lat1, r, theta)

calculate radial and azimuthal location at (lon1,lat1) on the polar coordinate with the center of (lon0,lat0)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: lon0

the center longitude (rad)

double precision, intent(in) :: lat0

the center latitude (rad)

double precision, intent(in) :: lon1

target longitude (rad)

double precision, intent(in) :: lat1

target latitude (rad)

double precision, intent(inout) :: r

radial distance (m)

double precision, intent(inout) :: theta

azimuthal angle (rad)

public subroutine rt2ll(r, theta, lon0, lat0, lon, lat)

calculate (lon,lat) from radial and azimuthal grid (r,theta) on the polar coordinate with the origin of (lon0,lat0)

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: r

radial distance from (lon0,lat0) (m)

double precision, intent(in) :: theta

azimuthal angle from (lon0,lat0) (rad)

double precision, intent(in) :: lon0

longitude of the center on the polar coordinate (rad)

double precision, intent(in) :: lat0

latitude of the center on the polar coordinate (rad)

double precision, intent(inout) :: lon

target longitude (rad)

double precision, intent(inout) :: lat

target latitude (rad)

public subroutine read_file_text(fname, nx, ny, val, skip, forma, funit)

read ASCII file

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fname

file name in reading

integer, intent(in) :: nx

column number for fname

integer, intent(in) :: ny

line number for fname

character(len=*), intent(out) :: val(nx,ny)

read data

integer, intent(in), optional :: skip

line number for skipping from the head

character(len=*), intent(in), optional :: forma

Fortran format in reading

integer, intent(in), optional :: funit

file unit

public subroutine read_file_2d(file_name, nx, ny, rec_num, var, offset, funit)

read float data from 4-byte unformatted binary

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_name

file name

integer, intent(in) :: nx

data number in x

integer, intent(in) :: ny

data number in y

integer, intent(in) :: rec_num

record number for reading data

real, intent(out) :: var(nx,ny)
integer, intent(in), optional :: offset

offset in reading

integer, intent(in), optional :: funit

file unit

public subroutine read_file_3d(file_name, nx, ny, nz, rec_num, var, offset, funit)

read float data from 4-byte unformatted binary

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_name

file name

integer, intent(in) :: nx

data number in x

integer, intent(in) :: ny

data number in y

integer, intent(in) :: nz

data number in z

integer, intent(in) :: rec_num

record number for reading data

real, intent(out) :: var(nx,ny,nz)
integer, intent(in), optional :: offset

offset in reading

integer, intent(in), optional :: funit

file unit

public subroutine write_file_3d(file_name, nx, ny, nz, rec_num, var, mode, funit)

write float data from 4-byte unformatted binary

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_name

file name

integer, intent(in) :: nx

data number in x

integer, intent(in) :: ny

data number in y

integer, intent(in) :: nz

data number in z

integer, intent(in) :: rec_num

record number for reading data

real, intent(in) :: var(nx,ny,nz)

output data

character(len=*), intent(in), optional :: mode

option for output

integer, intent(in), optional :: funit

file unit

public subroutine write_file_2d(file_name, nx, ny, rec_num, var, mode, funit)

write float data from 4-byte unformatted binary

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: file_name

file name

integer, intent(in) :: nx

data number in x

integer, intent(in) :: ny

data number in y

integer, intent(in) :: rec_num

record number for reading data

real, intent(in) :: var(nx,ny)

output data

character(len=*), intent(in), optional :: mode

option for output

integer, intent(in), optional :: funit

file unit

public subroutine grad_1d(x, u, dudx, undef)

Calculate gradient of "u" in one dimension based on the 2nd order central differential approximation:

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

Axis point

double precision, intent(in) :: u(size(x))

Target variable

double precision, intent(out) :: dudx(size(x))

du/dx

double precision, intent(in) :: undef

undefined dudxue

public subroutine grad_2d(x, y, u, dudx, dudy, undef)

Calculate gradient of "u" in two dimensions based on the 2nd order central differential approximation:

Arguments

Type IntentOptional Attributes Name
double precision, intent(in) :: x(:)

Axis point 1

double precision, intent(in) :: y(:)

Axis point 2

double precision, intent(in) :: u(size(x),size(y))
double precision, intent(out) :: dudx(size(x),size(y))
double precision, intent(out) :: dudy(size(x),size(y))
double precision, intent(in), optional :: undef