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

Last change on this file since 253 was 227, checked in by milmd, 10 years ago

Last LMDZ version (1315) with OpenMP directives and other stuff

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