source: codes/icosagcm/branches/SATURN_DYNAMICO/LMDZ.COMMON/config/ppsrc/phys/iniorbit.f @ 224

Last change on this file since 224 was 224, checked in by ymipsl, 10 years ago
File size: 4.2 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!-----------------------------------------------------------------------
38! INCLUDE planet.h
39
40      COMMON/planet/apoastr,periastr,year_day,peri_day,                 &
41     &       obliquit,nres,                                             &
42     &       z0,lmixmin,emin_turb,coefvis,coefir,                       &
43     &       timeperi,e_elips,p_elips
44
45      real apoastr,periastr,year_day,peri_day,                          &
46     &     obliquit,nres,                                               &
47     &     z0,lmixmin,emin_turb,coefvis,coefir,                         &
48     &       timeperi,e_elips,p_elips
49     
50
51!-----------------------------------------------------------------------
52!-----------------------------------------------------------------------
53! INCLUDE "comcstfi.h"
54
55      common/comcstfi/pi,rad,g,r,cpp,rcp,dtphys,daysec,mugaz,omeg
56      common/comcstfi/avocado!,molrad,visc
57     
58      real pi,rad,g,r,cpp,rcp,dtphys,daysec,mugaz,omeg
59      real avocado!,molrad,visc
60
61
62c   Arguments:
63c   ----------
64
65      REAL papoastr,pperiastr,pyear_day,pperi_day,pobliq
66
67c   Local:
68c   ------
69
70      REAL zxref,zanom,zz,zx0,zdx
71      INTEGER iter
72
73c-----------------------------------------------------------------------
74
75      pi=2.*asin(1.)
76
77      apoastr =papoastr
78      periastr=pperiastr
79      year_day=pyear_day
80      obliquit=pobliq
81      peri_day=pperi_day
82
83
84      !!!! SPARADRAP TEMPORAIRE !!!!
85      !!!! SPARADRAP TEMPORAIRE !!!!
86      !!!! We hope that all cases are above 25 Mkm [OK with Gliese 581d]
87      IF ( apoastr .gt. 25.) THEN
88        PRINT*,'!!!!! WARNING !!!!!'
89        PRINT*,'!!!!! YOU ARE ABOUT TO WITNESS A DIRT HACK !!!!!'
90        PRINT*,'This must be an old start file.'
91        PRINT*,'The code changed 19/03/2012: we now use AU.'
92        PRINT*,'So I am assuming units are in Mkm here'
93        PRINT*,'and I am performing a conversion towards AU.'
94        periastr = periastr / 149.598 ! Mkm to AU
95        apoastr = apoastr / 149.598 ! Mkm to AU
96      ENDIF
97      !!!! SPARADRAP TEMPORAIRE !!!!
98      !!!! SPARADRAP TEMPORAIRE !!!!
99
100 
101      PRINT*,'Periastron in AU  ',periastr
102      PRINT*,'Apoastron in AU  ',apoastr 
103      PRINT*,'Obliquity in degrees  :',obliquit
104
105
106      e_elips=(apoastr-periastr)/(periastr+apoastr)
107      p_elips=0.5*(periastr+apoastr)*(1-e_elips*e_elips)
108
109      print*,'e_elips',e_elips
110      print*,'p_elips',p_elips
111
112c-----------------------------------------------------------------------
113c calcul de l'angle polaire et de la distance au soleil :
114c -------------------------------------------------------
115
116c  calcul de l'zanomalie moyenne
117
118      zz=(year_day-pperi_day)/year_day
119      zanom=2.*pi*(zz-nint(zz))
120      zxref=abs(zanom)
121      PRINT*,'zanom  ',zanom
122
123c  resolution de l'equation horaire  zx0 - e * sin (zx0) = zxref
124c  methode de Newton
125
126      zx0=zxref+e_elips*sin(zxref)
127      DO 110 iter=1,100
128         zdx=-(zx0-e_elips*sin(zx0)-zxref)/(1.-e_elips*cos(zx0))
129         if(abs(zdx).le.(1.e-12)) goto 120
130         zx0=zx0+zdx
131110   continue
132120   continue
133      zx0=zx0+zdx
134      if(zanom.lt.0.) zx0=-zx0
135      PRINT*,'zx0   ',zx0
136
137c zteta est la longitude solaire
138
139      timeperi=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.))
140      PRINT*,'Solar longitude of periastron timeperi = ',timeperi
141
142      RETURN
143      END
Note: See TracBrowser for help on using the repository browser.