pr2000.f 3.51 KB
      subroutine pr2000 (day,p,ier)
c*
c***********************************************************************
c*
c*          "Copyright [c] CNES 98 - tous droits reserves"
c*          **********************************************
c*
c*PRO MAGLIB
c*
c*VER 99.03.31 - V 1.0
c*VER 01.06.05 - V 2.0
c*VER 03.01.06 - V 2.1
c*
c*AUT spec. ESOC - juin 1995
c*AUT ref: The astronomical almanac 1985 page b18.
c*AUT port. CISI
c*
c*ROL Theme : Astronomie et calcul d'orbite
c*ROL         Calcul de la matrice de precession du repere geocentrique 
c*ROL         moyen 2000 au repere moyen de la date.
c*ROL         (ref: the astronomical almanac 1985 page b18.)
c*ROL         L'ordre de calcul est le suivant :
c*ROL         r(moyen de la date) = p(,) * r(2000)
c*ROL         avec  p(3,3) matrice de precession    
c
c*PAR day (I) : date julienne ref 2000 (a partir de 01/01/2000)
c*
c*PAR p   (O) : matrice de precession
c*
c*PAR ier (O) : code de retour
c*
c*NOT ier     : sans objet
c*
c*INF utilise : sans objet
c*
c*HST version 1.0 - 99.03.31 - creation de la maglib au CDPP
c*HST version 2.0 - 01.06.05 - correction de commentaires de code
c*HST version 2.1 - 03.01.06 - corrections en compilation avec g77
c*
c***********************************************************************
c*
      implicit none
c
c     ---------------------------------
c*FON Declaration identificateur rcs_id
c     ---------------------------------
c
      character rcs_id*100
c
c     --------------------------
c*FON Declaration des parametres
c     --------------------------
c
      double precision day
      double precision p(3,3)
      integer ier
c
c     ---------------------------------
c*FON Declaration des variables locales
c     ---------------------------------
c
      double precision t
      double precision gz,za,th
      double precision cgz,sgz,cza,sza,cth,sth    
c*LOC Variables de travail intermediaires
c
      SAVE
c
c     ---------------------------------
c*FON Affectation identificateur rcs_id
c     ---------------------------------
c
      data rcs_id /"
     >$Id$"/
c
c     ******************
c     Debut de programme
c     ******************
c
      ier = 0
c
c     ----------------------------------------------------------
c*FON convert to standard epoch j2000.0 = 2000 jan 1 at 12:00:00
c     ----------------------------------------------------------
c
      t = day - 0.5d0
c
c     -------------------------------------------------------------------
c*FON gz = greek z(a), za = z(a), th = theta, according to the reference.
c*FON original, with tjc = (day - 0.5d0) / 36525.d0  in julian centuries:
c*FON gz = rad * tjc * (0.6406161d0 + tjc * (839.d-7 + tjc * 5.d-6))
c*FON za = gz + rad * tjc * tjc * (2202.d-7 + tjc * 1.d-7)
c*FON th = rad * tjc * (0.5567530d0 - tjc * (1185.d-7 + tjc * 116.d-7))
c     -------------------------------------------------------------------
c
      gz = t * (0.3061153d-6 + t * (0.10976d-14 + t * 0.179d-20))
      za = gz + t * t * (0.2881d-14 + t * 0.358d-22)
      th = t * (0.2660417d-6 - t * (0.1550d-14 + t * 0.41549d-20))
c
      cgz = cos(gz)
      sgz = sin(gz)
      cza = cos(za)
      sza = sin(za)
      cth = cos(th)
      sth = sin(th)
      p(1,1) =  cgz * cza * cth - sgz * sza
      p(1,2) = -sgz * cza * cth - cgz * sza
      p(1,3) = -cza * sth
      p(2,1) =  cgz * sza * cth + sgz * cza
      p(2,2) = -sgz * sza * cth + cgz * cza
      p(2,3) = -sza * sth
      p(3,1) =  cgz * sth
      p(3,2) = -sgz* sth
      p(3,3) =  cth
c
c     ****************
c     Fin de programme
c     ****************
c
      return
      end