cdm/src/main/java/ucar/nc2/dataset/conv/Cosmic1Convention.java
public double[] execute(double[] eci, double julian) {
    double Xi = eci[0];
    double Yi = eci[1];
    double Zi = eci[2];

    double c, s;
    double GHA;

    double[] ecef = new double[3];
    //Compute GHAD
    /* System generated locals */
    double d__1, d__2, d__3;

    /* Local variables */
    double tsec, tday, gmst, t, omega, tfrac, tu, dat;

    /*     INPUT IS TIME "secondsSince1970" IN SECONDS AND "TDAY" */
    /*     WHICH IS WHOLE DAYS FROM 1970 JAN 1 0H */
    /*     THE OUTPUT IS GREENWICH HOUR ANGLE IN DEGREES */
    /*     XOMEGA IS ROTATION RATE IN DEGREES/SEC */

    /*     FOR COMPATABILITY */

    tday = (double) ((int) (julian / 86400.));
    tsec = julian - tday * 86400;

    /*     THE NUMBER OF DAYS FROM THE J2000 EPOCH */
    /*     TO 1970 JAN 1 0H UT1 IS -10957.5 */
    t = tday - (float) 10957.5;
    tfrac = tsec / 86400.;
    dat = t;
    tu = dat / 36525.;

    /* Computing 2nd power */
    d__1 = tu;

    /* Computing 3rd power */
    d__2 = tu;
    d__3 = d__2;
    gmst = tu * 8640184.812866 + 24110.54841 + d__1 * d__1 * .093104
            - d__3 * (d__2 * d__2) * 6.2e-6;

    /*     COMPUTE THE EARTH'S ROTATION RATE */
    /* Computing 2nd power */
    d__1 = tu;
    omega = tu * 5.098097e-6 + 86636.55536790872 - d__1 * d__1 * 5.09e-10;

    /*     COMPUTE THE GMST AND GHA */
    //  da is earth nutation - currently unused
    double da = 0.0;
    gmst = gmst + omega * tfrac + da * RTD * 86400. / 360.;
    gmst = gmst % 86400;
    if (gmst < 0.) {
      gmst += 86400.;
    }
    gmst = gmst / 86400. * 360.;
    //ghan = gmst;
    //  returns gha in radians
    gmst = gmst * DTR;
    GHA = gmst;

    //RotateZ
    c = Math.cos(GHA);
    s = Math.sin(GHA);
    double X = c * Xi + s * Yi;
    double Y = -s * Xi + c * Yi;

    //Set outputs
    ecef[0] = X;
    ecef[1] = Y;
    ecef[2] = Zi;

    return ecef;
  }
public double[] execute(double[] eci, double julian) {
    double Xi = eci[0];
    double Yi = eci[1];
    double Zi = eci[2];

    double c, s;
    double GHA;

    double[] ecef = new double[3];
    //Compute GHAD
    /* System generated locals */
    double d__1, d__2, d__3;

    /* Local variables */
    double tsec, tday, gmst, t, omega, tfrac, tu, dat;

    /*     INPUT IS TIME "secondsSince1970" IN SECONDS AND "TDAY" */
    /*     WHICH IS WHOLE DAYS FROM 1970 JAN 1 0H */
    /*     THE OUTPUT IS GREENWICH HOUR ANGLE IN DEGREES */
    /*     XOMEGA IS ROTATION RATE IN DEGREES/SEC */

    /*     FOR COMPATABILITY */

    tday = (double) ((int) (julian / 86400.));
    tsec = julian - tday * 86400;

    /*     THE NUMBER OF DAYS FROM THE J2000 EPOCH */
    /*     TO 1970 JAN 1 0H UT1 IS -10957.5 */
    t = tday - (float) 10957.5;
    tfrac = tsec / 86400.;
    dat = t;
    tu = dat / 36525.;

    /* Computing 2nd power */
    d__1 = tu;

    /* Computing 3rd power */
    d__2 = tu;
    d__3 = d__2;
    gmst = tu * 8640184.812866 + 24110.54841 + d__1 * d__1 * .093104
            - d__3 * (d__2 * d__2) * 6.2e-6;

    /*     COMPUTE THE EARTH'S ROTATION RATE */
    /* Computing 2nd power */
    d__1 = tu;
    omega = tu * 5.098097e-6 + 86636.55536790872 - d__1 * d__1 * 5.09e-10;

    /*     COMPUTE THE GMST AND GHA */
    //  da is earth nutation - currently unused
    double da = 0.0;
    gmst = gmst + omega * tfrac + da * RTD * 86400. / 360.;
    gmst = gmst % 86400;
    if (gmst < 0.) {
      gmst += 86400.;
    }
    gmst = gmst / 86400. * 360.;
    //ghan = gmst;
    //  returns gha in radians
    gmst = gmst * DTR;
    GHA = gmst;

    //RotateZ
    c = Math.cos(GHA);
    s = Math.sin(GHA);
    double X = c * Xi + s * Yi;
    double Y = -s * Xi + c * Yi;

    //Set outputs
    ecef[0] = X;
    ecef[1] = Y;
    ecef[2] = Zi;

    return ecef;
  }
_more_

@param eci    _more_
@param julian _more_
@return _more_