[135] | 1 | SUBROUTINE iniorbit |
---|
[253] | 2 | $ (papoastr,pperiastr,pyear_day,pperi_day,pobliq) |
---|
[135] | 3 | IMPLICIT NONE |
---|
| 4 | |
---|
| 5 | c======================================================================= |
---|
| 6 | c |
---|
| 7 | c Auteur: |
---|
| 8 | c ------- |
---|
| 9 | c Frederic Hourdin 22 Fevrier 1991 |
---|
| 10 | c |
---|
| 11 | c Objet: |
---|
| 12 | c ------ |
---|
| 13 | c Initialisation du sous programme orbite qui calcule |
---|
| 14 | c a une date donnee de l'annee de duree year_day commencant |
---|
[253] | 15 | c a l'equinoxe de printemps et dont le periastre se situe |
---|
[135] | 16 | c a la date peri_day, la distance au soleil et la declinaison. |
---|
| 17 | c |
---|
| 18 | c Interface: |
---|
| 19 | c ---------- |
---|
| 20 | c - Doit etre appele avant d'utiliser orbite. |
---|
| 21 | c - initialise une partie du common planete.h |
---|
| 22 | c |
---|
| 23 | c Arguments: |
---|
| 24 | c ---------- |
---|
| 25 | c |
---|
| 26 | c Input: |
---|
| 27 | c ------ |
---|
[590] | 28 | c apoastr \ apoastron and periastron of the orbit in AU |
---|
| 29 | c periastr / |
---|
[135] | 30 | c |
---|
| 31 | c======================================================================= |
---|
| 32 | |
---|
| 33 | c----------------------------------------------------------------------- |
---|
| 34 | c Declarations: |
---|
| 35 | c ------------- |
---|
| 36 | |
---|
| 37 | #include "planete.h" |
---|
| 38 | #include "comcstfi.h" |
---|
| 39 | |
---|
| 40 | c Arguments: |
---|
| 41 | c ---------- |
---|
| 42 | |
---|
[253] | 43 | REAL papoastr,pperiastr,pyear_day,pperi_day,pobliq |
---|
[135] | 44 | |
---|
| 45 | c Local: |
---|
| 46 | c ------ |
---|
| 47 | |
---|
| 48 | REAL zxref,zanom,zz,zx0,zdx |
---|
| 49 | INTEGER iter |
---|
| 50 | |
---|
| 51 | c----------------------------------------------------------------------- |
---|
| 52 | |
---|
| 53 | pi=2.*asin(1.) |
---|
| 54 | |
---|
[253] | 55 | apoastr =papoastr |
---|
| 56 | periastr=pperiastr |
---|
[135] | 57 | year_day=pyear_day |
---|
| 58 | obliquit=pobliq |
---|
| 59 | peri_day=pperi_day |
---|
| 60 | |
---|
[590] | 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 |
---|
[253] | 81 | PRINT*,'Obliquity in degrees :',obliquit |
---|
[590] | 82 | |
---|
| 83 | |
---|
[253] | 84 | e_elips=(apoastr-periastr)/(periastr+apoastr) |
---|
[590] | 85 | p_elips=0.5*(periastr+apoastr)*(1-e_elips*e_elips) |
---|
[135] | 86 | |
---|
| 87 | print*,'e_elips',e_elips |
---|
| 88 | print*,'p_elips',p_elips |
---|
| 89 | |
---|
| 90 | c----------------------------------------------------------------------- |
---|
| 91 | c calcul de l'angle polaire et de la distance au soleil : |
---|
| 92 | c ------------------------------------------------------- |
---|
| 93 | |
---|
| 94 | c 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 | |
---|
| 101 | c resolution de l'equation horaire zx0 - e * sin (zx0) = zxref |
---|
| 102 | c 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 |
---|
| 109 | 110 continue |
---|
| 110 | 120 continue |
---|
| 111 | zx0=zx0+zdx |
---|
| 112 | if(zanom.lt.0.) zx0=-zx0 |
---|
| 113 | PRINT*,'zx0 ',zx0 |
---|
| 114 | |
---|
| 115 | c zteta est la longitude solaire |
---|
| 116 | |
---|
| 117 | timeperi=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.)) |
---|
[253] | 118 | PRINT*,'Solar longitude of periastron timeperi = ',timeperi |
---|
[135] | 119 | |
---|
| 120 | RETURN |
---|
| 121 | END |
---|