source: trunk/LMDZ.PLUTO/libf/phypluto/iniorbit.F @ 3506

Last change on this file since 3506 was 3504, checked in by afalco, 2 weeks ago

Pluto: print only on master process.
AF

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