Check distance in case of isotropic localization
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 coordinates can be in any unit, while geographic coordinates must be provided in radians and the resulting distance will be in meters. Finally, the routine checks whether the distance is not larger than the cut-off radius.
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 10-13: Variants of distance types 0-3, but particularly for 3 dimensions in which a 2+1 dimensional localization is applied (distance weighting only in the horizontal)
Revision history: * 2024-04 - Lars Nerger - Initial code based on PDAFomi_comp_dist2 * Later revisions - see repository log
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(obs_f), | intent(in) | :: | thisobs | |||
type(obs_l), | intent(in) | :: | thisobs_l | |||
real, | intent(in) | :: | coordsA(:) | |||
real, | intent(in) | :: | coordsB(:) | |||
real, | intent(out) | :: | distance2 | |||
logical, | intent(out) | :: | checkdist | |||
integer, | intent(in) | :: | verbose | |||
integer, | intent(inout) | :: | cnt_obs |