source: trunk/LMDZ.MARS/libf/phymars/call_dayperi.F @ 3739

Last change on this file since 3739 was 3739, checked in by emillour, 7 weeks ago

Mars PCM:
Code tidying: put routines in modules, remove useless "return" statements, etc.
EM

File size: 1.3 KB
Line 
1      module call_dayperi_mod
2     
3      implicit none
4     
5      contains
6     
7c *******************************************************
8      subroutine call_dayperi(Lsperi,e_elips,dayperi,year_day)
9      IMPLICIT NONE
10
11c=======================================================================
12c
13c   Objet:
14c   ------
15c   Computing the Martian date (number of sols since Ls=0 = spring
16c   equinox) at perihelion
17c
18c   Arguments:
19c   ----------
20c
21c   Input:
22c   ------
23c   Lsperi        ! Solar longitude (Ls) of perihelion (rad)
24c   e_elips       ! Excentricity
25c   real year_day ! Number of sols per Mars year
26c
27c   output
28c   ------
29c   dayperi       ! Martian date at perihelion (sol)
30
31c-----------------------------------------------------------------------
32
33c arguments:
34c ----------
35       real Lsperi, e_elips, dayperi
36       real year_day ! Number of sols per Mars year
37
38c      Local
39       real x1, x2,pi
40
41
42       pi=2.*asin(1.)
43
44       x1 = sqrt( (1-e_elips)/(1+e_elips) )
45       x2 = e_elips*sqrt(1-e_elips**2)
46
47       dayperi = 0.5*(year_day/pi)*
48     &   ( 2*atan(x1*tan(0.5*Lsperi))
49     &     -x2*sin(Lsperi)/(1+e_elips*cos(Lsperi)) )
50       if (dayperi < 0) dayperi=dayperi+year_day
51
52       end subroutine call_dayperi
53       
54       end module call_dayperi_mod
Note: See TracBrowser for help on using the repository browser.