source: LMDZ6/branches/Amaury_dev/libf/phylmd/iniorbit.F90 @ 5157

Last change on this file since 5157 was 5144, checked in by abarral, 7 weeks ago

Put YOMCST.h into modules

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
File size: 2.7 KB
Line 
1SUBROUTINE iniorbit(paphelie, pperiheli, pyear_day, pperi_day, pobliq)
2  USE lmdz_planete, ONLY: aphelie, periheli, year_day, peri_day, obliquit, timeperi, e_elips, p_elips, unitastr
3  USE lmdz_yomcst
4
5  IMPLICIT NONE
6
7  ! =======================================================================
8
9  ! Auteur:
10  ! -------
11  ! Frederic Hourdin      22 Fevrier 1991
12
13  ! Objet:
14  ! ------
15  ! Initialisation du sous programme orbite qui calcule
16  ! a une date donnee de l'annee de duree year_day commencant
17  ! a l'equinoxe de printemps et dont le perihelie se situe
18  ! a la date peri_day, la distance au soleil et la declinaison.
19
20  ! Interface:
21  ! ----------
22  ! - Doit etre appele avant d'utiliser orbite.
23  ! - initialise une partie du module lmdz_planete.f90
24
25  ! Arguments:
26  ! ----------
27
28  ! Input:
29  ! ------
30  ! aphelie       \   aphelie et perihelie de l'orbite
31  ! periheli      /   en millions de kilometres.
32
33  ! =======================================================================
34
35  ! Arguments:
36  ! ----------
37
38  REAL paphelie, pperiheli, pyear_day, pperi_day, pobliq
39
40  ! Local:
41  ! ------
42
43  REAL zxref, zanom, zz, zx0, zdx, pi
44  INTEGER iter
45
46  ! -----------------------------------------------------------------------
47
48  pi = 2. * asin(1.)
49
50  aphelie = paphelie
51  periheli = pperiheli
52  year_day = pyear_day
53  obliquit = pobliq
54  peri_day = pperi_day
55
56  PRINT *, 'Perihelie en Mkm  ', periheli
57  PRINT *, 'Aphelie  en Mkm   ', aphelie
58  PRINT *, 'obliquite en degres  :', obliquit
59  PRINT *, 'Jours dans l annee : ', year_day
60  PRINT *, 'Date perihelie : ', peri_day
61  unitastr = 149.597870
62  e_elips = (aphelie - periheli) / (periheli + aphelie)
63  p_elips = 0.5 * (periheli + aphelie) * (1 - e_elips * e_elips) / unitastr
64
65  PRINT *, 'e_elips', e_elips
66  PRINT *, 'p_elips', p_elips
67
68  ! -----------------------------------------------------------------------
69  ! calcul de l'angle polaire et de la distance au soleil :
70  ! -------------------------------------------------------
71
72  ! calcul de l'zanomalie moyenne
73
74  zz = (year_day - pperi_day) / year_day
75  zanom = 2. * pi * (zz - nint(zz))
76  zxref = abs(zanom)
77  PRINT *, 'zanom  ', zanom
78
79  ! resolution de l'equation horaire  zx0 - e * sin (zx0) = zxref
80  ! methode de Newton
81
82  zx0 = zxref + r_ecc * sin(zxref)
83  DO iter = 1, 100
84    zdx = -(zx0 - r_ecc * sin(zx0) - zxref) / (1. - r_ecc * cos(zx0))
85    IF (abs(zdx)<=(1.E-12)) GO TO 120
86    zx0 = zx0 + zdx
87  END DO
88  120 CONTINUE
89  zx0 = zx0 + zdx
90  IF (zanom<0.) zx0 = -zx0
91  PRINT *, 'zx0   ', zx0
92
93  ! zteta est la longitude solaire
94
95  timeperi = 2. * atan(sqrt((1. + r_ecc) / (1. - r_ecc)) * tan(zx0 / 2.))
96  PRINT *, 'longitude solaire du perihelie timeperi = ', timeperi
97
98END SUBROUTINE iniorbit
Note: See TracBrowser for help on using the repository browser.