      subroutine ssd_init
        use ssd, only: glue_init
        ml_external ssd_init
        call glue_init()
      end subroutine


      subroutine ssd_run_diffcor(obsdata,nobs,&
            iod_q_au,&
            iod_e,&
            iod_i_deg,&
            iod_node_deg,&
            iod_arg_peri_deg,&
            iod_time_peri_mjd,&
            iod_epoch_mjd,&
            out_q_au,&
            out_e,&
            out_i_deg,&
            out_node_deg,&
            out_arg_peri_deg,&
            out_time_peri_mjd,&
            out_mag,&
            out_epoch_mjd,&
            out_residual,&
            out_covariance,&
            out_converge_code,&
            exterrcod)
        use constants_mod, only: wp
        use ssd, only: glue_run_diffcor
        ml_external ssd_run_diffcor
        character (len=*) :: obsdata
        integer :: nobs
        real (kind=wp) :: iod_q_au
        real (kind=wp) :: iod_e
        real (kind=wp) :: iod_i_deg
        real (kind=wp) :: iod_node_deg
        real (kind=wp) :: iod_arg_peri_deg
        real (kind=wp) :: iod_time_peri_mjd
        real (kind=wp) :: iod_epoch_mjd
        real (kind=wp) :: out_q_au
        real (kind=wp) :: out_e
        real (kind=wp) :: out_i_deg
        real (kind=wp) :: out_node_deg
        real (kind=wp) :: out_arg_peri_deg
        real (kind=wp) :: out_time_peri_mjd
        real (kind=wp) :: out_mag
        real (kind=wp) :: out_epoch_mjd
        real (kind=wp) :: out_residual
        real (kind=wp) :: out_covariance(21)
        integer :: out_converge_code
        integer :: exterrcod

        call glue_run_diffcor(obsdata,nobs,&
            iod_q_au,&
            iod_e,&
            iod_i_deg,&
            iod_node_deg,&
            iod_arg_peri_deg,&
            iod_time_peri_mjd,&
            iod_epoch_mjd,&

            out_q_au,&
            out_e,&
            out_i_deg,&
            out_node_deg,&
            out_arg_peri_deg,&
            out_time_peri_mjd,&
            out_mag,&
            out_epoch_mjd,&
            out_residual,&
            out_covariance,&
            out_converge_code,&
            exterrcod)

        end subroutine
