source: trunk/LMDZ.GENERIC/libf/phystd/iniorbit.F @ 2613

Last change on this file since 2613 was 2243, checked in by jvatant, 5 years ago

Get rid of the old 'sparadrap' in iniorbit.F assuming Mkm instead of AU if periastre or apostre gt 25, (otherwise Neptune is a pb)
Everybody should be using AU, that's all.
--JVO

File size: 2.1 KB
RevLine 
[135]1      SUBROUTINE iniorbit
[253]2     $     (papoastr,pperiastr,pyear_day,pperi_day,pobliq)
[1308]3     
4      USE planete_mod, only: apoastr, periastr, year_day, obliquit,
5     &                       peri_day, e_elips, p_elips, timeperi
[1384]6      use comcstfi_mod, only: pi
[135]7      IMPLICIT NONE
8
[1384]9!=======================================================================
10! Initialisation of orbital parameters (stored in planete_h module)
11!=======================================================================
[135]12
13c   Arguments:
14c   ----------
15
[1384]16      REAL,INTENT(IN) :: papoastr,pperiastr,pyear_day,pperi_day,pobliq
[135]17
18c   Local:
19c   ------
20
21      REAL zxref,zanom,zz,zx0,zdx
22      INTEGER iter
23
24c-----------------------------------------------------------------------
25
26      pi=2.*asin(1.)
27
[253]28      apoastr =papoastr
29      periastr=pperiastr
[135]30      year_day=pyear_day
31      obliquit=pobliq
32      peri_day=pperi_day
33
[1384]34      PRINT*,'iniorbit: Periastron in AU  ',periastr
35      PRINT*,'iniorbit: Apoastron in AU  ',apoastr
36      PRINT*,'iniorbit: Obliquity in degrees  :',obliquit
[590]37
38
[253]39      e_elips=(apoastr-periastr)/(periastr+apoastr)
[590]40      p_elips=0.5*(periastr+apoastr)*(1-e_elips*e_elips)
[135]41
[1384]42      print*,'iniorbit: e_elips',e_elips
43      print*,'iniorbit: p_elips',p_elips
[135]44
[1384]45!-----------------------------------------------------------------------
46! compute polar angle and distance to the Sun:
47! -------------------------------------------------------
[135]48
[1384]49!  compute mean anomaly zanom
[135]50
51      zz=(year_day-pperi_day)/year_day
52      zanom=2.*pi*(zz-nint(zz))
53      zxref=abs(zanom)
[1384]54      PRINT*,'iniorbit: zanom  ',zanom
[135]55
[1384]56!  solve equation  zx0 - e * sin (zx0) = zxref for eccentric anomaly zx0
57!  using Newton method
[135]58
59      zx0=zxref+e_elips*sin(zxref)
[1384]60      DO iter=1,100
[135]61         zdx=-(zx0-e_elips*sin(zx0)-zxref)/(1.-e_elips*cos(zx0))
[1384]62         if(abs(zdx).le.(1.e-12)) exit
[135]63         zx0=zx0+zdx
[1384]64      ENDDO
65
[135]66      zx0=zx0+zdx
67      if(zanom.lt.0.) zx0=-zx0
[1384]68      PRINT*,'iniorbit: zx0   ',zx0
[135]69
70      timeperi=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.))
[1384]71      PRINT*,'iniorbit: Perihelion solar long. Ls (deg)=',
72     &       360.-timeperi*180./pi
[135]73
74      END
Note: See TracBrowser for help on using the repository browser.