public static JulianDate jauCal2jd(int iy, int im, int id) throws JSOFAIllegalParameter
    {
       int ly, my;
       long iypmy;
       double djm0, djm;

    /* Earliest year allowed (4800BC) */
       final int IYMIN = -4799;

    /* Month lengths in days */
       final int mtab[]
                         = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};


    /* Validate year and month. */
       if (iy < IYMIN) throw new JSOFAIllegalParameter("bad year", -1);
       if (im < 1 || im > 12) throw new JSOFAIllegalParameter("bad month", -2);

    /* If February in a leap year, 1, otherwise 0. */
       ly = ((im == 2) &&(iy%4 == 0) && (iy%100 != 0 || (iy%400 == 0)))?1:0;

    /* Validate day, taking into account leap years. */
       if ( (id < 1) || (id > (mtab[im-1] + ly))) {
    }

    /* Return result. */
       my = (im - 14) / 12;
       iypmy = (long) (iy + my);
       djm0 = DJM0;
       djm = (double)((1461L * (iypmy + 4800L)) / 4L
                     + (367L * (long) (im - 2 - 12 * my)) / 12L
                     - (3L * ((iypmy + 4900L) / 100L)) / 4L
                     + (long) id - 2432076L);

    /* Return status. */
       return new JulianDate(djm0, djm);

        }