C $Id: ic_gse_to_hseb.f,v 1.2 1998/07/24 21:54:33 asc Exp $
CCCC
	subroutine IC_GSE_TO_HSEB (ORB_POS_TIME, 
     1                            TRANSFORM_MATRIX,DERIV_MATRIX,
     2                            VELOCITY_REQ,
     3                            STATUS,
     4                            trans_pos_vec)
C
	implicit none
C
C*  Calling parameters
C
	integer*4   ORB_POS_TIME(2) !time or orb vector, YYYYDDD, milli of day
	real*8	    TRANSFORM_MATRIX(3,3) !transformation matrix
	real*8      DERIV_MATRIX(3,3) !time derivative of transformation matrix
	integer*4   VELOCITY_REQ !flag to compute derivative matrix
	integer*4   STATUS  !Status of getting the transformation matrix
        REAL*8      TRANS_POS_VEC(3)  !TRANSFORMATION OF POSITION ARRAY (3 X 1)
	integer*4   I, J 
C
	REAL*8      SUN_POS(3), SUN_VEL(3)
C
	REAL*8      R
C
C*  START EXECUTABLE
C
	call icss_pos_of_sun (ORB_POS_TIME,SUN_POS,SUN_VEL,STATUS)
	R = DSQRT(SUN_POS(1)*SUN_POS(1)+SUN_POS(2)*SUN_POS(2)+
     1         SUN_POS(3)*SUN_POS(3))
C	
	TRANS_POS_VEC(1) = R
	TRANS_POS_VEC(2) = 0.D0
	TRANS_POS_VEC(3) = 0.D0
C
	TRANSFORM_MATRIX(1,1) = -1.D0
	TRANSFORM_MATRIX(1,2) =  0.D0
	TRANSFORM_MATRIX(1,3) =  0.D0

	TRANSFORM_MATRIX(2,1) =  0.D0
	TRANSFORM_MATRIX(2,2) = -1.D0
	TRANSFORM_MATRIX(2,3) =  0.D0

	TRANSFORM_MATRIX(3,1) =  0.D0
	TRANSFORM_MATRIX(3,2) =  0.D0
	TRANSFORM_MATRIX(3,3) =  1.D0
C
        IF ( VELOCITY_REQ .GT. 0 ) THEN
	  DO J=1,3
	    DO  I=1,3
	      DERIV_MATRIX(I,J)=0.0d0
	    ENDDO
	  ENDDO
	ENDIF
C
	RETURN
C
 	end



















