The TELEMAC-MASCARET system  trunk
latitu.f
Go to the documentation of this file.
1 ! *****************
2  SUBROUTINE latitu
3 ! *****************
4 !
5  &(ydist,coslat,sinlat,lambd0,y,npoin)
6 !
7 !***********************************************************************
8 ! BIEF V7P1
9 !***********************************************************************
10 !
11 !brief COMPUTES THE ARRAYS THAT DEPEND ON THE LATITUDE
12 !+ OF THE GIVEN POINT.
13 !
14 !history J-M HERVOUET (LNH)
15 !+ 10/01/95
16 !+ V5P1
17 !+ First version.
18 !
19 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
20 !+ 13/07/2010
21 !+ V6P0
22 !+ Translation of French comments within the FORTRAN sources into
23 !+ English comments
24 !
25 !history N.DURAND (HRW), S.E.BOURBAN (HRW)
26 !+ 21/08/2010
27 !+ V6P0
28 !+ Creation of DOXYGEN tags for automated documentation and
29 !+ cross-referencing of the FORTRAN sources
30 !
31 !history C-T PHAM (R&D, LNHE)
32 !+ 17/01/2013
33 !+ V6P3
34 !+ More precise value of Earth radius.
35 !
36 !history M.S.TURNBULL (HRW)
37 !+ 24/09/2015
38 !+ V7P1
39 !+ Correction to the computation of the Y in spherical coordinates.
40 !
41 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42 !| COSLAT |<--| COSINUS OF LAMBDA0
43 !| LAMBD0 |-->| LATITUDE OF ORIGIN POINT
44 !| NPOIN |-->| NUMBER OF POINTS
45 !| SINLAT |<--| SINUS OF LAMBDA0
46 !| Y |-->| ORDINATES OF POINTS IN THE MESH
47 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 !
50  IMPLICIT NONE
51 !
52 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
53 !
54  INTEGER , INTENT(IN) :: NPOIN
55  DOUBLE PRECISION, INTENT(IN) :: Y(npoin)
56  DOUBLE PRECISION, INTENT(INOUT) :: YDIST(npoin)
57  DOUBLE PRECISION, INTENT(INOUT) :: COSLAT(npoin),SINLAT(npoin)
58  DOUBLE PRECISION, INTENT(IN) :: LAMBD0
59 !
60 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
61 !
62  INTEGER I
63 !
64  DOUBLE PRECISION LB2RAD,R,SURR,PISUR4,PISUR2,XLAMB
65 !
66  INTRINSIC tan,atan,sin,cos,exp
67 !
68 !-----------------------------------------------------------------------
69 !
70 ! EARTH RADIUS
71 !
72  r = 6370000.d0
73  surr = 1.d0 / r
74 !
75 !-----------------------------------------------------------------------
76 !
77  pisur4 = atan(1.d0)
78  pisur2 = pisur4 + pisur4
79 !
80 ! LAMBD0/2 IN RADIANS
81 !
82  lb2rad = lambd0 * pisur4 / 90.d0
83 !
84 ! 1/COS(LAMBDA),COS(LAMBDA),SIN(LAMBDA)
85 !
86  DO i = 1 , npoin
87 !
88  xlamb = 2.d0* atan(exp(y(i)*surr)*tan(lb2rad+pisur4))-pisur2
89  ydist(i) = xlamb * r
90  coslat(i) = cos(xlamb)
91  sinlat(i) = sin(xlamb)
92 !
93  ENDDO
94 !
95 !-----------------------------------------------------------------------
96 !
97  RETURN
98  END
subroutine latitu(YDIST, COSLAT, SINLAT, LAMBD0, Y, NPOIN)
Definition: latitu.f:7