public static function Apco13($utc1, $utc2, $dut1, $elong, $phi, $hm, $xp,
          $yp, $phpa, $tc, $rh, $wl, iauASTROM &$astrom, &$eo) {

    $j;
    $tai1;
    $tai2;
    $tt1;
    $tt2;
    $ut11;
    $ut12;
    $ehpv = [];
    $ebpv = [];
    $r    = [];
    $x;
    $y;
    $s;
    $theta;
    $sp;
    $refa;
    $refb;

    /* UTC to other time scales. */
    $j = IAU::Utctai($utc1, $utc2, $tai1, $tai2);
    if ($j < 0)
      return -1;
    $j = IAU::Taitt($tai1, $tai2, $tt1, $tt2);
    $j = IAU::Utcut1($utc1, $utc2, $dut1, $ut11, $ut12);
    if ($j < 0)
      return -1;

    /* Earth barycentric & heliocentric position/velocity (au, au/d). */
    IAU::Epv00($tt1, $tt2, $ehpv, $ebpv);

    /* Form the equinox based BPN matrix, IAU 2006/2000A. */
    IAU::Pnm06a($tt1, $tt2, $r);

    /* Extract CIP X,Y. */
    IAU::Bpn2xy($r, $x, $y);

    /* Obtain CIO locator s. */
    $s = IAU::S06($tt1, $tt2, $x, $y);

    /* Earth rotation angle. */
    $theta = IAU::Era00($ut11, $ut12);

    /* TIO locator s'. */
    $sp = IAU::Sp00($tt1, $tt2);

    /* Refraction constants A and B. */
    IAU::Refco($phpa, $tc, $rh, $wl, $refa, $refb);

    /* Compute the star-independent astrometry parameters. */
    IAU::Apco($tt1, $tt2, $ebpv, $ehpv[0], $x, $y, $s, $theta, $elong, $phi, $hm,
            $xp, $yp, $sp, $refa, $refb, $astrom);

    /* Equation of the origins. */
    $eo = IAU::Eors($r, $s);

    /* Return any warning status. */
    return $j;

    /* Finished. */
  }