/[lmdze]/trunk/dyn3d/dist_sphe.f
ViewVC logotype

Annotation of /trunk/dyn3d/dist_sphe.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 214 - (hide annotations)
Wed Mar 22 13:40:27 2017 UTC (7 years, 2 months ago) by guez
Original Path: trunk/Sources/dyn3d/dist_sphe.f
File size: 1461 byte(s)
fluxlat, not yfluxlat, should be set to 0 at the beginning of
clmain. So fluxlat is defined for a given type of surface even if
there is no point of this type at the current time step.

fluxlat is defined at each time step in physiq, no need for the save
attribute.

1 guez 212 module dist_sphe_m
2    
3     ! From grid_atob.F, v 1.1.1.1 2004/05/19 12:53:05
4    
5     IMPLICIT none
6    
7     contains
8    
9     SUBROUTINE dist_sphe(rf_lon, rf_lat, rlon, rlat, im, jm, distance)
10    
11     ! Auteur: Laurent Li (le 30 decembre 1996)
12    
13     ! Ce programme calcule la distance minimale (selon le grand cercle)
14     ! entre deux points sur la terre
15    
16 guez 214 use nr_util, only: pi
17    
18 guez 212 INTEGER, intent(in):: im, jm ! dimensions
19     REAL, intent(in):: rf_lon ! longitude du point de reference (degres)
20     REAL, intent(in):: rf_lat ! latitude du point de reference (degres)
21     REAL, intent(in):: rlon(im), rlat(jm) ! longitude et latitude des points
22    
23     REAL, intent(out):: distance(im, jm) ! distances en metre
24    
25     REAL rlon1, rlat1
26     REAL rlon2, rlat2
27     REAL dist
28 guez 214 REAL pa, pb, p
29 guez 212
30     REAL radius
31     PARAMETER (radius=6371229.)
32     integer i, j
33    
34     !---------------------------------------------------------------------
35    
36     DO j = 1, jm
37     DO i = 1, im
38     rlon1=rf_lon
39     rlat1=rf_lat
40     rlon2=rlon(i)
41     rlat2=rlat(j)
42     pa = pi/2.0 - rlat1*pi/180.0 ! dist. entre pole n et point a
43     pb = pi/2.0 - rlat2*pi/180.0 ! dist. entre pole n et point b
44     p = (rlon1-rlon2)*pi/180.0 ! angle entre a et b (leurs meridiens)
45    
46     dist = ACOS(COS(pa)*COS(pb) + SIN(pa)*SIN(pb)*COS(p))
47     dist = radius * dist
48     distance(i, j) = dist
49     end DO
50     end DO
51    
52     END SUBROUTINE dist_sphe
53    
54     end module dist_sphe_m

  ViewVC Help
Powered by ViewVC 1.1.21