[1992] | 1 | SUBROUTINE solarlong(pday, psollong, pdist_sol) |
---|
[1201] | 2 | |
---|
[1992] | 3 | USE ioipsl |
---|
[2311] | 4 | USE print_control_mod, ONLY: lunout |
---|
[1201] | 5 | |
---|
[5285] | 6 | USE yomcst_mod_h |
---|
[5300] | 7 | USE planete_mod_h |
---|
[5274] | 8 | IMPLICIT NONE |
---|
[1201] | 9 | |
---|
[1992] | 10 | ! ======================================================================= |
---|
[1201] | 11 | |
---|
[1992] | 12 | ! Objet: |
---|
| 13 | ! ------ |
---|
[1201] | 14 | |
---|
[1992] | 15 | ! Calcul de la distance soleil-planete et de la declinaison |
---|
| 16 | ! en fonction du jour de l'annee. |
---|
[1201] | 17 | |
---|
| 18 | |
---|
[1992] | 19 | ! Methode: |
---|
| 20 | ! -------- |
---|
[1201] | 21 | |
---|
[1992] | 22 | ! Calcul complet de l'elipse |
---|
[1201] | 23 | |
---|
[1992] | 24 | ! Interface: |
---|
| 25 | ! ---------- |
---|
[1201] | 26 | |
---|
[1992] | 27 | ! Uncommon comprenant les parametres orbitaux. |
---|
[1201] | 28 | |
---|
[1992] | 29 | ! Arguments: |
---|
| 30 | ! ---------- |
---|
[1201] | 31 | |
---|
[1992] | 32 | ! Input: |
---|
| 33 | ! ------ |
---|
| 34 | ! pday jour de l'annee (le jour 0 correspondant a l'equinoxe) |
---|
| 35 | ! lwrite clef logique pour sorties de controle |
---|
[1201] | 36 | |
---|
[1992] | 37 | ! Output: |
---|
| 38 | ! ------- |
---|
| 39 | ! pdist_sol distance entre le soleil et la planete |
---|
| 40 | ! ( en unite astronomique pour utiliser la constante |
---|
| 41 | ! solaire terrestre 1370 Wm-2 ) |
---|
| 42 | ! pdecli declinaison ( en radians ) |
---|
[1201] | 43 | |
---|
[1992] | 44 | ! ======================================================================= |
---|
| 45 | ! arguments: |
---|
| 46 | ! ---------- |
---|
[1201] | 47 | |
---|
[1992] | 48 | REAL pday, pdist_sol, pdecli, psollong |
---|
| 49 | LOGICAL lwrite |
---|
[1201] | 50 | |
---|
[1992] | 51 | ! Local: |
---|
| 52 | ! ------ |
---|
[1201] | 53 | |
---|
[1992] | 54 | REAL zanom, xref, zx0, zdx, zteta, zz, pi |
---|
| 55 | INTEGER iter |
---|
| 56 | REAL :: pyear_day, pperi_day |
---|
| 57 | REAL :: jd_eq, jd_peri |
---|
| 58 | LOGICAL, SAVE :: first = .TRUE. |
---|
| 59 | !$OMP THREADPRIVATE(first) |
---|
[1201] | 60 | |
---|
[1992] | 61 | ! ----------------------------------------------------------------------- |
---|
| 62 | ! calcul de l'angle polaire et de la distance au soleil : |
---|
| 63 | ! ------------------------------------------------------- |
---|
[1201] | 64 | |
---|
[1992] | 65 | ! Initialisation eventuelle: |
---|
| 66 | IF (first) THEN |
---|
| 67 | CALL ioget_calendar(pyear_day) |
---|
| 68 | CALL ymds2ju(2000, 3, 21, 0., jd_eq) |
---|
| 69 | CALL ymds2ju(2001, 1, 4, 0., jd_peri) |
---|
| 70 | pperi_day = jd_peri - jd_eq |
---|
| 71 | pperi_day = r_peri + 180. |
---|
| 72 | WRITE (lunout, *) ' Number of days in a year = ', pyear_day |
---|
| 73 | ! call iniorbit(249.22,206.66,669.,485.,25.2) |
---|
| 74 | CALL iniorbit(152.59, 146.61, pyear_day, pperi_day, r_incl) |
---|
| 75 | first = .FALSE. |
---|
| 76 | END IF |
---|
[1201] | 77 | |
---|
[1992] | 78 | ! calcul de l'zanomalie moyenne |
---|
[1201] | 79 | |
---|
[1992] | 80 | zz = (pday-peri_day)/year_day |
---|
| 81 | pi = 2.*asin(1.) |
---|
| 82 | zanom = 2.*pi*(zz-nint(zz)) |
---|
| 83 | xref = abs(zanom) |
---|
| 84 | |
---|
| 85 | ! resolution de l'equation horaire zx0 - e * sin (zx0) = xref |
---|
| 86 | ! methode de Newton |
---|
| 87 | |
---|
| 88 | ! zx0=xref+e_elips*sin(xref) |
---|
| 89 | zx0 = xref + r_ecc*sin(xref) |
---|
| 90 | DO iter = 1, 10 |
---|
| 91 | ! zdx=-(zx0-e_elips*sin(zx0)-xref)/(1.-e_elips*cos(zx0)) |
---|
| 92 | zdx = -(zx0-r_ecc*sin(zx0)-xref)/(1.-r_ecc*cos(zx0)) |
---|
| 93 | IF (abs(zdx)<=(1.E-7)) GO TO 120 |
---|
| 94 | zx0 = zx0 + zdx |
---|
| 95 | END DO |
---|
| 96 | 120 CONTINUE |
---|
| 97 | zx0 = zx0 + zdx |
---|
| 98 | IF (zanom<0.) zx0 = -zx0 |
---|
| 99 | |
---|
| 100 | ! zteta est la longitude solaire |
---|
| 101 | |
---|
| 102 | ! zteta=2.*atan(sqrt((1.+e_elips)/(1.-e_elips))*tan(zx0/2.)) |
---|
| 103 | zteta = 2.*atan(sqrt((1.+r_ecc)/(1.-r_ecc))*tan(zx0/2.)) |
---|
| 104 | |
---|
| 105 | psollong = zteta - timeperi |
---|
| 106 | |
---|
| 107 | IF (psollong<0.) psollong = psollong + 2.*pi |
---|
| 108 | IF (psollong>2.*pi) psollong = psollong - 2.*pi |
---|
| 109 | |
---|
| 110 | psollong = psollong*180./pi |
---|
| 111 | |
---|
| 112 | ! distance soleil |
---|
| 113 | |
---|
| 114 | pdist_sol = (1-r_ecc*r_ecc)/(1+r_ecc*cos(pi/180.*(psollong- & |
---|
| 115 | (r_peri+180.0)))) |
---|
| 116 | ! pdist_sol = (1-e_elips*e_elips) |
---|
| 117 | ! & /(1+e_elips*COS(pi/180.*(psollong-(R_peri+180.0)))) |
---|
| 118 | ! ----------------------------------------------------------------------- |
---|
| 119 | ! sorties eventuelles: |
---|
| 120 | ! --------------------- |
---|
| 121 | |
---|
| 122 | ! IF (lwrite) THEN |
---|
| 123 | ! PRINT*,'jour de l"annee :',pday |
---|
| 124 | ! PRINT*,'distance au soleil (en unite astronomique) :',pdist_sol |
---|
| 125 | ! PRINT*,'declinaison (en degres) :',pdecli*180./pi |
---|
| 126 | ! ENDIF |
---|
| 127 | |
---|
| 128 | RETURN |
---|
| 129 | END SUBROUTINE solarlong |
---|