source: trunk/LMDZ.COMMON/libf/evolution/generalorbit.f @ 3470

Last change on this file since 3470 was 3470, checked in by evos, 4 weeks ago

we added the option to use NS dynamical subsurface ice in the model to more realisticly calculate the amount of ice in the subsurface and therfore the subsurface thermal inertia

File size: 1.6 KB
Line 
1C=============================================================
2C Subroutine to return distance, longitude, and declination of
3C the sun in planetocentric coordinates from orbital elements
4C
5C INPUTS: 
6C edays = time since perihelion (earth days)
7C a = semimajor axis (AU)
8C ecc = eccentricity
9C omega = Ls of perihelion, relative to equinox (radians)
10C eps = obliquity (radians)
11C
12C OUTPUTS:
13C Ls = areocentric longitude (radians)
14C dec = planetocentric solar declination (radians)
15C r = heliocentric distance (AU)
16C=============================================================
17
18      SUBROUTINE generalorbit(edays,a,ecc,omega,eps,Ls,dec,r)
19      implicit none
20      real*8 edays,a,ecc,omega,eps  ! input
21      real*8 Ls,dec,! output
22      real*8 pi,d2r
23      parameter (pi=3.1415926535897932,d2r=pi/180.d0)
24      integer j
25      real*8 M,E,nu,T,Eold
26
27c     T = orbital period (days)
28      T = sqrt(4*pi**2/(6.674e-11*1.989e30)*(a*149.598e9)**3)/86400.
29
30c     M = mean anomaly (radians)
31      M = 2.*pi*edays/! M=0 at perihelion
32
33c     E = eccentric anomaly
34c     solve M = E - ecc*sin(E) by newton method
35      E = M
36      do j=1,10
37         Eold = E
38         E = E - (E - ecc*sin(E) - M)/(1.-ecc*cos(E))
39         if (abs(E-Eold)<1.e-8) exit
40      enddo
41
42c     nu = true anomaly
43      !nu = acos(cos(E)-ecc/(1.-ecc*cos(E)))
44      !nu = sqrt(1-ecc^2)*sin(E)/(1.-ecc*cos(E))
45      !nu = atan(sqrt(1-ecc^2)*sin(E)/(1-cos(E)))
46      nu = 2.*atan(sqrt((1.+ecc)/(1.-ecc))*tan(E/2.))
47
48      !r = a*(1.-ecc**2)/(1.+ecc*cos(nu))
49      r = a*(1-ecc*cos(E))
50      Ls = mod(nu + omega,2.*pi)   
51      dec = asin(sin(eps)*sin(Ls))
52
53      END
54
Note: See TracBrowser for help on using the repository browser.