source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/libf/phystd/iniorbit.F @ 222

Last change on this file since 222 was 222, checked in by ymipsl, 10 years ago

Creating temporary dynamico/lmdz/saturn branche

YM

File size: 3.3 KB
Line 
1      SUBROUTINE iniorbit
2     $     (papoastr,pperiastr,pyear_day,pperi_day,pobliq)
3      IMPLICIT NONE
4
5c=======================================================================
6c
7c   Auteur:
8c   -------
9c     Frederic Hourdin      22 Fevrier 1991
10c
11c   Objet:
12c   ------
13c    Initialisation du sous programme orbite qui calcule
14c    a une date donnee de l'annee de duree year_day commencant
15c    a l'equinoxe de printemps et dont le periastre se situe
16c    a la date peri_day, la distance au soleil et la declinaison.
17c
18c   Interface:
19c   ----------
20c   - Doit etre appele avant d'utiliser orbite.
21c   - initialise une partie du common planete.h
22c
23c   Arguments:
24c   ----------
25c
26c   Input:
27c   ------
28c   apoastr       \   apoastron and periastron of the orbit in AU
29c   periastr      /   
30c
31c=======================================================================
32
33c-----------------------------------------------------------------------
34c   Declarations:
35c   -------------
36
37#include "planete.h"
38#include "comcstfi.h"
39
40c   Arguments:
41c   ----------
42
43      REAL papoastr,pperiastr,pyear_day,pperi_day,pobliq
44
45c   Local:
46c   ------
47
48      REAL zxref,zanom,zz,zx0,zdx
49      INTEGER iter
50
51c-----------------------------------------------------------------------
52
53      pi=2.*asin(1.)
54
55      apoastr =papoastr
56      periastr=pperiastr
57      year_day=pyear_day
58      obliquit=pobliq
59      peri_day=pperi_day
60
61
62      !!!! SPARADRAP TEMPORAIRE !!!!
63      !!!! SPARADRAP TEMPORAIRE !!!!
64      !!!! We hope that all cases are above 25 Mkm [OK with Gliese 581d]
65      IF ( apoastr .gt. 25.) THEN
66        PRINT*,'!!!!! WARNING !!!!!'
67        PRINT*,'!!!!! YOU ARE ABOUT TO WITNESS A DIRT HACK !!!!!'
68        PRINT*,'This must be an old start file.'
69        PRINT*,'The code changed 19/03/2012: we now use AU.'
70        PRINT*,'So I am assuming units are in Mkm here'
71        PRINT*,'and I am performing a conversion towards AU.'
72        periastr = periastr / 149.598 ! Mkm to AU
73        apoastr = apoastr / 149.598 ! Mkm to AU
74      ENDIF
75      !!!! SPARADRAP TEMPORAIRE !!!!
76      !!!! SPARADRAP TEMPORAIRE !!!!
77
78 
79      PRINT*,'Periastron in AU  ',periastr
80      PRINT*,'Apoastron in AU  ',apoastr 
81      PRINT*,'Obliquity in degrees  :',obliquit
82
83
84      e_elips=(apoastr-periastr)/(periastr+apoastr)
85      p_elips=0.5*(periastr+apoastr)*(1-e_elips*e_elips)
86
87      print*,'e_elips',e_elips
88      print*,'p_elips',p_elips
89
90c-----------------------------------------------------------------------
91c calcul de l'angle polaire et de la distance au soleil :
92c -------------------------------------------------------
93
94c  calcul de l'zanomalie moyenne
95
96      zz=(year_day-pperi_day)/year_day
97      zanom=2.*pi*(zz-nint(zz))
98      zxref=abs(zanom)
99      PRINT*,'zanom  ',zanom
100
101c  resolution de l'equation horaire  zx0 - e * sin (zx0) = zxref
102c  methode de Newton
103
104      zx0=zxref+e_elips*sin(zxref)
105      DO 110 iter=1,100
106         zdx=-(zx0-e_elips*sin(zx0)-zxref)/(1.-e_elips*cos(zx0))
107         if(abs(zdx).le.(1.e-12)) goto 120
108         zx0=zx0+zdx
109110   continue
110120   continue
111      zx0=zx0+zdx
112      if(zanom.lt.0.) zx0=-zx0
113      PRINT*,'zx0   ',zx0
114
115c zteta est la longitude solaire
116
117      timeperi=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.))
118      PRINT*,'Solar longitude of periastron timeperi = ',timeperi
119
120      RETURN
121      END
Note: See TracBrowser for help on using the repository browser.