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