public static double jauDat(int iy, int im, int id, double fd ) throws JSOFAIllegalParameter, JSOFAInternalError
    {

    /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
      final double drift[][] = {
          { 37300.0, 0.0012960 },
          { 37300.0, 0.0012960 },
          { 37300.0, 0.0012960 },
          { 37665.0, 0.0011232 },
          { 37665.0, 0.0011232 },
          { 38761.0, 0.0012960 },
          { 38761.0, 0.0012960 },
          { 38761.0, 0.0012960 },
          { 38761.0, 0.0012960 },
          { 38761.0, 0.0012960 },
          { 38761.0, 0.0012960 },
          { 38761.0, 0.0012960 },
          { 39126.0, 0.0025920 },
          { 39126.0, 0.0025920 }
       };

    /* Number of Delta(AT) expressions before leap seconds were introduced */
    final int NERA1 = drift.length;


    /* Number of Delta(AT) changes */
       final int NDAT = leapSeconds.length;

    /* Miscellaneous local variables */
       int i, m;
       double da, djm;


    /* Initialize the result to zero. */
       double deltat = da = 0.0;

    /* If invalid fraction of a day, set error status and give up. */
       if (fd < 0.0 || fd > 1.0) throw new JSOFAIllegalParameter("bad day fraction", -4);

    /* Convert the date into an MJD. */
       JulianDate jd = jauCal2jd(iy, im, id);
       djm = jd.djm1;

    /* If pre-UTC year, set warning status and give up. */
       if (iy < leapSeconds[0].iyear) throw new JSOFAInternalError("year before UTC start", 1);

    /* If suspiciously late year, set warning status but proceed. */
       if (iy > IYV + 5) {
    }

    /* Combine year and month to form a date-ordered integer... */
       m = 12*iy + im;

    /* ...and use it to find the preceding table entry. */
       for (i = NDAT-1; i >=0; i--) {
          if (m >= (12 * leapSeconds[i].iyear + leapSeconds[i].month)) break;
       }

    /* Get the Delta(AT). */
       da = leapSeconds[i].delat;

    /* If pre-1972, adjust for drift. */
       if (i < NERA1) da += (djm + fd - drift[i][0]) * drift[i][1];

    /* Return the Delta(AT) value. */
       deltat = da;

    /* Return the value. */
       return deltat;

        }