source: trunk/LMDZ.GENERIC/libf/phystd/iniorbit.F @ 2733

Last change on this file since 2733 was 2243, checked in by jvatant, 5 years ago

Get rid of the old 'sparadrap' in iniorbit.F assuming Mkm instead of AU if periastre or apostre gt 25, (otherwise Neptune is a pb)
Everybody should be using AU, that's all.
--JVO

File size: 2.1 KB
Line 
1      SUBROUTINE iniorbit
2     $     (papoastr,pperiastr,pyear_day,pperi_day,pobliq)
3     
4      USE planete_mod, only: apoastr, periastr, year_day, obliquit,
5     &                       peri_day, e_elips, p_elips, timeperi
6      use comcstfi_mod, only: pi
7      IMPLICIT NONE
8
9!=======================================================================
10! Initialisation of orbital parameters (stored in planete_h module)
11!=======================================================================
12
13c   Arguments:
14c   ----------
15
16      REAL,INTENT(IN) :: papoastr,pperiastr,pyear_day,pperi_day,pobliq
17
18c   Local:
19c   ------
20
21      REAL zxref,zanom,zz,zx0,zdx
22      INTEGER iter
23
24c-----------------------------------------------------------------------
25
26      pi=2.*asin(1.)
27
28      apoastr =papoastr
29      periastr=pperiastr
30      year_day=pyear_day
31      obliquit=pobliq
32      peri_day=pperi_day
33
34      PRINT*,'iniorbit: Periastron in AU  ',periastr
35      PRINT*,'iniorbit: Apoastron in AU  ',apoastr
36      PRINT*,'iniorbit: Obliquity in degrees  :',obliquit
37
38
39      e_elips=(apoastr-periastr)/(periastr+apoastr)
40      p_elips=0.5*(periastr+apoastr)*(1-e_elips*e_elips)
41
42      print*,'iniorbit: e_elips',e_elips
43      print*,'iniorbit: p_elips',p_elips
44
45!-----------------------------------------------------------------------
46! compute polar angle and distance to the Sun:
47! -------------------------------------------------------
48
49!  compute mean anomaly zanom
50
51      zz=(year_day-pperi_day)/year_day
52      zanom=2.*pi*(zz-nint(zz))
53      zxref=abs(zanom)
54      PRINT*,'iniorbit: zanom  ',zanom
55
56!  solve equation  zx0 - e * sin (zx0) = zxref for eccentric anomaly zx0
57!  using Newton method
58
59      zx0=zxref+e_elips*sin(zxref)
60      DO iter=1,100
61         zdx=-(zx0-e_elips*sin(zx0)-zxref)/(1.-e_elips*cos(zx0))
62         if(abs(zdx).le.(1.e-12)) exit
63         zx0=zx0+zdx
64      ENDDO
65
66      zx0=zx0+zdx
67      if(zanom.lt.0.) zx0=-zx0
68      PRINT*,'iniorbit: zx0   ',zx0
69
70      timeperi=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.))
71      PRINT*,'iniorbit: Perihelion solar long. Ls (deg)=',
72     &       360.-timeperi*180./pi
73
74      END
Note: See TracBrowser for help on using the repository browser.