PDAFomi_comp_dist2 Subroutine

public subroutine PDAFomi_comp_dist2(thisobs, coordsA, coordsB, distance2, verbose)

Compute square distance between two locations

This routine computes the distance between two locations. The computation can be for Cartesian grids with and without periodicity and for geographic coordinates. For Cartesian grids, the coordinats can be in any unit, while geographic coordinates must be provided in radians and the resulting distance will be in meters.

Choices for distance computation - disttype: 0: Cartesian distance in ncoord dimensions 1: Cartesian distance in ncoord dimensions with periodicity (Needs specification of domsize(ncoord)) 2: Aproximate geographic distance with horizontal coordinates in radians (-pi/+pi) 3: Geographic distance computation using haversine formula

Revision history: * 2019-06 - Lars Nerger - Initial code from restructuring observation routines * Later revisions - see repository log

Arguments

Type IntentOptional Attributes Name
type(obs_f), intent(in) :: thisobs
real, intent(in) :: coordsA(:)
real, intent(in) :: coordsB(:)
real, intent(out) :: distance2
integer, intent(in) :: verbose