public mjDate Djcl(double djm) throws palError {
        double f, d;
        long jd, n4, nd10;
        Status = 0;

        TRACE("Djcl");
        /* Check if date is acceptable */
        if ((djm <= -2395520.0) || (djm >= 1e9)) {
            Status = -1;
            throw new palError(Status, "Djcl: unacceptable date (before 4701BC March 1)");
        } else {

            /* Separate day and fraction */
            f = dmod(djm, 1.0);
            if (f < 0.0) {
                f += 1.0;
            }
            d = djm - f;
            d = dnint(d);

            /* Express day in Gregorian calendar */
            jd = (long) dnint(d) + 2400001;
            n4 = 4L * (jd + ((6L * ((4L * jd - 17918L) / 146097L)) / 4L + 1L) / 2L - 37L);
            nd10 = 10L * (((n4 - 237L) % 1461L) / 4L) + 5L;
            ENDTRACE("Djcl");
            try {
                mjDate date = new mjDate((int) (n4 / 1461L - 4712L),
                                         (int) (((nd10 / 306L + 2L) % 12L) + 1L),
                                         (int) ((nd10 % 306L) / 10L + 1L),
                                         f);
                return date;
            } catch (palError e) {
                throw e;
            }
        }
    }