13 |
! Ce programme calcule la distance minimale (selon le grand cercle) |
! Ce programme calcule la distance minimale (selon le grand cercle) |
14 |
! entre deux points sur la terre |
! entre deux points sur la terre |
15 |
|
|
16 |
|
use nr_util, only: pi |
17 |
|
|
18 |
INTEGER, intent(in):: im, jm ! dimensions |
INTEGER, intent(in):: im, jm ! dimensions |
19 |
REAL, intent(in):: rf_lon ! longitude du point de reference (degres) |
REAL, intent(in):: rf_lon ! longitude du point de reference (degres) |
20 |
REAL, intent(in):: rf_lat ! latitude du point de reference (degres) |
REAL, intent(in):: rf_lat ! latitude du point de reference (degres) |
25 |
REAL rlon1, rlat1 |
REAL rlon1, rlat1 |
26 |
REAL rlon2, rlat2 |
REAL rlon2, rlat2 |
27 |
REAL dist |
REAL dist |
28 |
REAL pa, pb, p, pi |
REAL pa, pb, p |
29 |
|
|
30 |
REAL radius |
REAL radius |
31 |
PARAMETER (radius=6371229.) |
PARAMETER (radius=6371229.) |
33 |
|
|
34 |
!--------------------------------------------------------------------- |
!--------------------------------------------------------------------- |
35 |
|
|
|
pi = 4.0 * ATAN(1.0) |
|
|
|
|
36 |
DO j = 1, jm |
DO j = 1, jm |
37 |
DO i = 1, im |
DO i = 1, im |
|
|
|
38 |
rlon1=rf_lon |
rlon1=rf_lon |
39 |
rlat1=rf_lat |
rlat1=rf_lat |
40 |
rlon2=rlon(i) |
rlon2=rlon(i) |
46 |
dist = ACOS(COS(pa)*COS(pb) + SIN(pa)*SIN(pb)*COS(p)) |
dist = ACOS(COS(pa)*COS(pb) + SIN(pa)*SIN(pb)*COS(p)) |
47 |
dist = radius * dist |
dist = radius * dist |
48 |
distance(i, j) = dist |
distance(i, j) = dist |
|
|
|
49 |
end DO |
end DO |
50 |
end DO |
end DO |
51 |
|
|