	SUBROUTINE JAPET(DAY,I,R)

C	SOUS PROGRAMME DE CALCUL DES COORDONNEES DIFFERENTIELLES 
C	RECTILIGNES EQUATORIALES B1950.0 DE MIMAS PAR RAPPORT A
C	LA PLANETE SATURNE
C	EN ENTREE :
C	*    DAY= DATE JULIENNE OBSERVATION EN JOUR FRACTIONNAIRE
C	*      I= INDICE DE LA THEORIE DU MOUVEMENT DU SATELLITE
C	ADOPTEE POUR CHAQUE ELEMENT ORBITAL ET PETITE VARIATION
C	        =1 G.STRUVE(1930)
C	        =2 (Ne pas utiliser)
C	        =3 (Ne pas utiliser)
C	        =4 (Ne pas utiliser)
C	        =5 (Ne pas utiliser)
C	        =6 A.T.SINCLAIR(1974)
C	        =7 G.DOURNEAU(1987)
C	EN SORTIE :
C	*   R (K) = COORDONNEES RECTILIGNES EQUATORIALES B1950.0 
C	R(K=1,3)=DX,XY,DZ PAR RAPPORT A LA PLANETE SATURNE EN U.A. 

C	TRANSMISSIONS PAR COMMON A ETIQUETTE
C	*  COMMON/BLKJAVAL : ELEMENTS ORBITAUX DE JAPET

	IMPLICIT REAL*8(A-H,O-Z)
	CHARACTER*8 NOMSAT(8),NOM(8,24)
	DIMENSION EL(8,24),E0(8),AN(8),OMEGJ0(8),
	1 GPI0(8),EX(8),AI(8),AA(8),OMEGJV(8),GPIV(8), 
	1 OMEG50C(8), ANGI50C(8), OMEG50V(8), ANGI50V(8), 
	1 EXV(8), AIV(8), OMEGJV2(8), OMEGJV3(8), AIV2(8), 
	1 AIV3(8),R(3)
	COMMON/BLKPI/PI,DPI,DEGRAD,RADEG
	COMMON/BLKDAT/DATE50,DATE2000,ANJBES
	COMMON/BLKJAVAL/E0,AN,OMEGJ0,GPI0,EX,AI,AA,OMEGJV,GPIV,
	1 OMEG50C,ANGI50C,OMEG50V,ANGI50V,
	2 EXV,AIV,OMEGJV2,OMEGJV3,AIV2,AIV3
	COMMON/BLKTIVAL/EL6(8,24)

	EQUIVALENCE (EL(1,1),E0(1))

	DATA DS/9.538937D0/
	DATA SAN/0.03346D0/

C 	Fin des datas 
	
	DD = DAY-2409786.0
	DT50 = (DAY-DATE50)/36525.
	TC = DD/36525.	
	TC2 = TC*TC
	TC3 = TC2*TC
	TG = (DAY-2415020.0)/36525.
	ALS = (267.263+1222.114*TG) * DEGRAD
	GPIS = (91.796+0.562*TG) * DEGRAD

	IF ((I-1)*(I-2)*(I-4)*(I-5).EQ.0)THEN	!	theorie de struve

	TS = (DAY-2415020.)/36525.
	SEX=0.05589232-0.00034550*TS
	SANOM=175.4762+1221.5515*TS
	SANOM=(DMOD(SANOM,360.D0))*DEGRAD
	SI=(2.4925-0.0039*TS)*DEGRAD
	SOM=(112.79039+0.8732*TS)*DEGRAD
	CALL DANNO(DAY,DATE50,SOM,SI,SOM,SI,AR1,AR2,AR3,AR4)
	SLONG=DMOD(ALS,DPI)

	ELSE IF ((I-3)*(I-6)*(I-7).EQ.0)THEN

	TETA = (4.367-0.195*TG) * DEGRAD
	GTETA = (146.819-3.918*TG) * DEGRAD
	ALT = (261.319+22.576974*(DAY-2411368.0)) * DEGRAD
	GPIT = (277.102+0.001389*(DAY-2411368.0)) * DEGRAD
	PHI = (60.470+1.521*TG) * DEGRAD
	GPHI = (205.055-2.091*TG) * DEGRAD

	END IF	
	
	OMEG50 = (OMEG50C(I)+OMEG50V(I)*DT50) * DEGRAD
	ANGI50 = (ANGI50C(I)+ANGI50V(I)*DT50) * DEGRAD
	CALL DANNO (DATE50, DATE50, OMEG50, ANGI50, OMEG0, ANGI0, ANGN0,
	1 ANGJ0, POMEG0, DOM0)
	ALJ = (E0(I)+AN(I)*DD) * DEGRAD
	ALJ=DMOD(ALJ,DPI)
	IF(ALJ.LT.0)ALJ=ALJ+DPI
	GPIJ = (GPI0(I)+GPIV(I)*TC) * DEGRAD
	GPIJ=DMOD(GPIJ,DPI)
	IF(GPIJ.LT.0)GPIJ=GPIJ+DPI
	OMEGJ = (OMEGJ0(I)+OMEGJV(I)*TC+OMEGJV2(I)*TC2+OMEGJV3(I)*TC3)
	1 * DEGRAD
	OMEGJ=DMOD(OMEGJ,DPI)
	IF(OMEGJ.LT.0)OMEGJ=OMEGJ+DPI
	EX1 = EX(I) + EXV(I) * TC
	AIR = (AI(I)+AIV(I)*TC+AIV2(I)*TC2+AIV3(I)*TC3) * DEGRAD
	AAR=AA(I)*DS*DEGRAD/3600.

	IF ((I-1)*(I-2)*(I-4)*(I-5).EQ.0)THEN	!	Theorie de STRUVE

	TJ=OMEGJ-SOM
	CALL FORTRI(AIR,TJ,SI,GGAM,GTETA,GPSI,SOM)
	GPSI=DMOD(GPSI,DPI)
	N0SN=SAN/AN(I)

C	CALCUL DES PERTURBATIONS SOLAIRES.METHODE A.E.SUPL.P.375
C	EXPRESSIONS AVEC B TIREES DE GARCIA P.687

	CORALJ=-3.*N0SN*(SEX*SIN(SANOM)+3.*SEX*SEX*SIN(SANOM+SANOM)/4.+
	1 15.*EX1*EX1*SIN(2.*(SLONG-GPIJ))/16.+
	2 3.*SIN(GGAM)*SIN(GGAM)*SIN(2.*(SLONG-GTETA))/16.)
	COROMEGJ = 3. * N0SN * SIN(GGAM) * SIN(2.*SLONG-2.*GTETA+GPSI)/
	1 (8.*SIN(AIR))
	CORI = 3. * N0SN * SIN(GGAM) * COS(2.*SLONG-2.*GTETA+GPSI)/8.
	CORGPIJ = 15.* N0SN * SIN(2.*(SLONG-GPIJ))/8.
	CORE = 15. * N0SN *EX1 * COS(2.*(SLONG-GPIJ))/8.
	CORA=0.

	ELSE IF((I-3)*(I-6)*(I-7).EQ.0) THEN	!	Theorie de SINCLAIR

	PG = GPIJ-OMEGJ-TETA	!	CORRECTIONS SINCLAIR
	PG1 = GPIJ-OMEGJ-PHI
	PLS = ALS-GPIS
	PLS = DMOD(PLS,DPI)
	IF (PLS.LT.0)PLS=PLS+DPI
	PGS = GPIS-GTETA
	PLT = ALT-GPIT
	PLT = DMOD(PLT,DPI)
	IF (PLT.LT.0)PLT=PLT+DPI
	PGT = GPIT-GPHI
	PGT = DMOD(PGT,DPI)
	IF (PGT.LT.0)PGT=PGT+DPI
	PL = ALJ-GPIJ
	PL  = DMOD(PL ,DPI)
	IF(PL.LT.0)PL=PL+DPI
C
C Calcul des perturbations par la methode de Sinclair corrigees des coquilles de l'article de 1974 (1985)
C
	CORA = AAR * (7.87*COS(2.*(PL+PG-PLS-PGS))+98.79*COS(PL+PG1-PLT
	1 -PGT)) * 1.D-05
	CORE = (-140.97*COS(PG1-PGT)+37.33*COS(2.*(PLS+PGS-PG))+11.80
	1 *COS(PL+2.*(PG-PLS-PGS))+24.08*COS(PL)+28.49*COS(2.*PL+PG1-PLT
	1 -PGT)+61.90*COS(PLT+PGT-PG1)) * 1.D-05
	CORI = (0.04204*COS(2.*(PLS+PGS)+TETA)+0.00235*COS(PL+PG1+PLT+PGT
	1 +PHI)+0.00360*COS(PL+PG1-PLT-PGT+PHI)) * DEGRAD
	CORALJ = (-0.04299*SIN(PL+PG1-PLT-PGT)-0.00789*SIN(2.*(PL+PG-PLS
	1 -PGS))-0.06312*SIN(PLS)-0.00295*SIN(PLS+PLS)-0.02231*SIN(2.*(PLS
	1 +PGS))+0.00650*SIN(2.*(PLS+PGS)+TETA)) * DEGRAD
	CORGPIJ = (0.08077*SIN(PG1-PGT)+0.02139*SIN(2.*(PLS+PGS-PG))
	1 -0.00676*SIN(PL+2.*(PG-PLS-PGS))+0.01380*SIN(PL)+0.01632*SIN(PL+
	1 PL+PG1-PLT-PGT)+0.03547*SIN(PLT+PGT-PG1)) * DEGRAD / EX1
	COROMEGJ = (0.04204*SIN(2.*(PLS+PGS)+TETA)+0.00235*SIN(PL+PG1+PLT
	1 +PGT+PHI)+0.00358*SIN(PL+PG1-PLT-PGT+PHI)) * DEGRAD/SIN(AIR)

	END IF	! 	I

	AAC = AAR + CORA
	EXC = EX1 + CORE
	AIC = AIR + CORI
	ALC = ALJ +CORALJ
	GPIC = GPIJ + CORGPIJ
	OMEGC = OMEGJ + COROMEGJ
	PLC=ALC-GPIC
	PLC  = DMOD(PLC ,DPI)
	IF(PLC.LT.0)PLC=PLC+DPI
C
C Calcul de teta et gamma
C
	CALL ECOREQAN(OMEGC, AIC, GPIC, OMEG0, ANGI0, POMEG0 ,
	1 TETAJC, AIJ, PIJ)
	CALL EECR(AAC, EXC, AIJ, TETAJC, PIJ, PLC, R)
	CALL ROTA(R, 0.D0, -ANGJ0, -ANGN0)	
	RETURN
	END
