[iausofa] 01/02: New upstream version 20131202

Ole Streicher olebole-guest at moszumanska.debian.org
Mon Jan 6 13:57:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

olebole-guest pushed a commit to branch debian
in repository iausofa.

commit f895db9a19bb4971c6331da323f9cf3d32ce389b
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Wed Dec 4 09:18:25 2013 +0100

    New upstream version 20131202
---
 20120301_a/c/doc/board.lis                         |   33 -
 20120301_a/c/doc/board.pdf                         |   69 -
 20120301_a/c/doc/changes.lis                       |  107 -
 20120301_a/c/doc/changes.pdf                       |  Bin 3068 -> 0 bytes
 20120301_a/c/doc/consts.pdf                        |  Bin 1704 -> 0 bytes
 20120301_a/c/doc/contents.pdf                      |   70 -
 20120301_a/c/doc/copyr.pdf                         |  Bin 3657 -> 0 bytes
 20120301_a/c/doc/intro.pdf                         |  Bin 6936 -> 0 bytes
 20120301_a/c/doc/manual.pdf                        |  Bin 304394 -> 0 bytes
 20120301_a/c/doc/sofa_lib.pdf                      |  Bin 10823 -> 0 bytes
 20120301_a/c/doc/sofa_ts_c.pdf                     |  Bin 185068 -> 0 bytes
 20120301_a/c/doc/sofa_vml.pdf                      |  Bin 7038 -> 0 bytes
 20120301_a/c/doc/title.pdf                         |  Bin 1382 -> 0 bytes
 {20120301_a => 20131202}/c/00READ.ME               |    6 +-
 20131202/c/doc/board.lis                           |   35 +
 20131202/c/doc/board.pdf                           |  Bin 0 -> 1779 bytes
 20131202/c/doc/changes.lis                         |  161 +
 20131202/c/doc/changes.pdf                         |  Bin 0 -> 4797 bytes
 {20120301_a => 20131202}/c/doc/consts.lis          |    0
 20131202/c/doc/consts.pdf                          |  Bin 0 -> 1726 bytes
 {20120301_a => 20131202}/c/doc/contents.lis        |    4 +-
 20131202/c/doc/contents.pdf                        |  Bin 0 -> 1403 bytes
 {20120301_a => 20131202}/c/doc/copyr.lis           |    2 +-
 20131202/c/doc/copyr.pdf                           |  Bin 0 -> 3857 bytes
 {20120301_a => 20131202}/c/doc/intro.lis           |   43 +-
 20131202/c/doc/intro.pdf                           |  Bin 0 -> 7405 bytes
 {20120301_a => 20131202}/c/doc/manual.lis          | 4365 ++++++++++++++++++--
 20131202/c/doc/manual.pdf                          |  Bin 0 -> 467298 bytes
 20131202/c/doc/sofa_ast_c.pdf                      |  Bin 0 -> 325051 bytes
 20131202/c/doc/sofa_ast_summary.pdf                |  Bin 0 -> 41494 bytes
 {20120301_a => 20131202}/c/doc/sofa_lib.lis        |  163 +-
 20131202/c/doc/sofa_lib.pdf                        |  Bin 0 -> 14535 bytes
 {20120301_a => 20131202}/c/doc/sofa_pn.pdf         |  Bin 531373 -> 531525 bytes
 20131202/c/doc/sofa_ts_c.pdf                       |  Bin 0 -> 184634 bytes
 {20120301_a => 20131202}/c/doc/sofa_vml.lis        |    8 +-
 20131202/c/doc/sofa_vml.pdf                        |  Bin 0 -> 7660 bytes
 {20120301_a => 20131202}/c/doc/title.lis           |    8 +-
 20131202/c/doc/title.pdf                           |  Bin 0 -> 1489 bytes
 {20120301_a => 20131202}/c/src/a2af.c              |   10 +-
 {20120301_a => 20131202}/c/src/a2tf.c              |   12 +-
 20120301_a/c/src/tdbtt.c => 20131202/c/src/ab.c    |   99 +-
 {20120301_a => 20131202}/c/src/af2a.c              |   10 +-
 {20120301_a => 20131202}/c/src/anp.c               |   10 +-
 {20120301_a => 20131202}/c/src/anpm.c              |   10 +-
 20120301_a/c/src/pnm80.c => 20131202/c/src/apcg.c  |  135 +-
 .../c/src/pnm80.c => 20131202/c/src/apcg13.c       |  136 +-
 20120301_a/c/src/pnm80.c => 20131202/c/src/apci.c  |  144 +-
 .../c/src/eo06a.c => 20131202/c/src/apci13.c       |  151 +-
 20131202/c/src/apco.c                              |  306 ++
 20131202/c/src/apco13.c                            |  330 ++
 20131202/c/src/apcs.c                              |  275 ++
 .../c/src/pnm80.c => 20131202/c/src/apcs13.c       |  143 +-
 20120301_a/c/src/tf2d.c => 20131202/c/src/aper.c   |  119 +-
 .../c/src/c2t00b.c => 20131202/c/src/aper13.c      |  165 +-
 20131202/c/src/apio.c                              |  255 ++
 20131202/c/src/apio13.c                            |  301 ++
 .../c/src/prec76.c => 20131202/c/src/atci13.c      |  145 +-
 20120301_a/c/src/gst94.c => 20131202/c/src/atciq.c |  129 +-
 20131202/c/src/atciqn.c                            |  233 ++
 .../c/src/gd2gce.c => 20131202/c/src/atciqz.c      |  131 +-
 20131202/c/src/atco13.c                            |  285 ++
 .../c/src/pnm80.c => 20131202/c/src/atic13.c       |  108 +-
 20120301_a/c/src/fk5hz.c => 20131202/c/src/aticq.c |  191 +-
 20131202/c/src/aticqn.c                            |  279 ++
 20131202/c/src/atio13.c                            |  264 ++
 20131202/c/src/atioq.c                             |  285 ++
 20131202/c/src/atoc13.c                            |  275 ++
 20131202/c/src/atoi13.c                            |  270 ++
 20131202/c/src/atoiq.c                             |  299 ++
 {20120301_a => 20131202}/c/src/bi00.c              |   10 +-
 {20120301_a => 20131202}/c/src/bp00.c              |   25 +-
 {20120301_a => 20131202}/c/src/bp06.c              |   25 +-
 {20120301_a => 20131202}/c/src/bpn2xy.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2i00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2i00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2i06a.c            |   16 +-
 {20120301_a => 20131202}/c/src/c2ibpn.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2ixy.c             |   10 +-
 {20120301_a => 20131202}/c/src/c2ixys.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2s.c               |   10 +-
 {20120301_a => 20131202}/c/src/c2t00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2t00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2t06a.c            |   10 +-
 {20120301_a => 20131202}/c/src/c2tcio.c            |   12 +-
 {20120301_a => 20131202}/c/src/c2teqx.c            |   18 +-
 {20120301_a => 20131202}/c/src/c2tpe.c             |   10 +-
 {20120301_a => 20131202}/c/src/c2txy.c             |   10 +-
 {20120301_a => 20131202}/c/src/cal2jd.c            |   12 +-
 {20120301_a => 20131202}/c/src/cp.c                |   10 +-
 {20120301_a => 20131202}/c/src/cpv.c               |   10 +-
 {20120301_a => 20131202}/c/src/cr.c                |   10 +-
 {20120301_a => 20131202}/c/src/d2dtf.c             |   44 +-
 {20120301_a => 20131202}/c/src/d2tf.c              |   10 +-
 {20120301_a => 20131202}/c/src/dat.c               |   34 +-
 {20120301_a => 20131202}/c/src/dtdb.c              |   10 +-
 {20120301_a => 20131202}/c/src/dtf2d.c             |   47 +-
 {20120301_a => 20131202}/c/src/ee00.c              |    6 +-
 {20120301_a => 20131202}/c/src/ee00a.c             |    6 +-
 {20120301_a => 20131202}/c/src/ee00b.c             |    6 +-
 {20120301_a => 20131202}/c/src/ee06a.c             |    6 +-
 {20120301_a => 20131202}/c/src/eect00.c            |   10 +-
 {20120301_a => 20131202}/c/src/eform.c             |   10 +-
 {20120301_a => 20131202}/c/src/eo06a.c             |   12 +-
 {20120301_a => 20131202}/c/src/eors.c              |   10 +-
 {20120301_a => 20131202}/c/src/epb.c               |   25 +-
 {20120301_a => 20131202}/c/src/epb2jd.c            |   14 +-
 {20120301_a => 20131202}/c/src/epj.c               |   12 +-
 {20120301_a => 20131202}/c/src/epj2jd.c            |   16 +-
 {20120301_a => 20131202}/c/src/epv00.c             |   10 +-
 {20120301_a => 20131202}/c/src/eqeq94.c            |   11 +-
 {20120301_a => 20131202}/c/src/era00.c             |   10 +-
 {20120301_a => 20131202}/c/src/fad03.c             |   10 +-
 {20120301_a => 20131202}/c/src/fae03.c             |   10 +-
 {20120301_a => 20131202}/c/src/faf03.c             |   10 +-
 {20120301_a => 20131202}/c/src/faju03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fal03.c             |   10 +-
 {20120301_a => 20131202}/c/src/falp03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fama03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fame03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fane03.c            |   10 +-
 {20120301_a => 20131202}/c/src/faom03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fapa03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fasa03.c            |   10 +-
 {20120301_a => 20131202}/c/src/faur03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fave03.c            |   10 +-
 {20120301_a => 20131202}/c/src/fk52h.c             |   10 +-
 {20120301_a => 20131202}/c/src/fk5hip.c            |   10 +-
 {20120301_a => 20131202}/c/src/fk5hz.c             |   10 +-
 {20120301_a => 20131202}/c/src/fw2m.c              |   10 +-
 {20120301_a => 20131202}/c/src/fw2xy.c             |   15 +-
 {20120301_a => 20131202}/c/src/gc2gd.c             |   15 +-
 {20120301_a => 20131202}/c/src/gc2gde.c            |   10 +-
 {20120301_a => 20131202}/c/src/gd2gc.c             |   10 +-
 {20120301_a => 20131202}/c/src/gd2gce.c            |   10 +-
 {20120301_a => 20131202}/c/src/gmst00.c            |   10 +-
 {20120301_a => 20131202}/c/src/gmst06.c            |   10 +-
 {20120301_a => 20131202}/c/src/gmst82.c            |   18 +-
 {20120301_a => 20131202}/c/src/gst00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/gst00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/gst06.c             |   10 +-
 {20120301_a => 20131202}/c/src/gst06a.c            |   10 +-
 {20120301_a => 20131202}/c/src/gst94.c             |    6 +-
 {20120301_a => 20131202}/c/src/h2fk5.c             |   10 +-
 {20120301_a => 20131202}/c/src/hfk5z.c             |   10 +-
 {20120301_a => 20131202}/c/src/ir.c                |   10 +-
 {20120301_a => 20131202}/c/src/jd2cal.c            |   18 +-
 {20120301_a => 20131202}/c/src/jdcalf.c            |   10 +-
 20120301_a/c/src/gd2gce.c => 20131202/c/src/ld.c   |  131 +-
 20120301_a/c/src/pap.c => 20131202/c/src/ldn.c     |  154 +-
 20120301_a/c/src/pvdpv.c => 20131202/c/src/ldsun.c |   63 +-
 {20120301_a => 20131202}/c/src/makefile            |  126 +-
 {20120301_a => 20131202}/c/src/num00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/num00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/num06a.c            |   10 +-
 {20120301_a => 20131202}/c/src/numat.c             |   10 +-
 {20120301_a => 20131202}/c/src/nut00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/nut00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/nut06a.c            |   10 +-
 {20120301_a => 20131202}/c/src/nut80.c             |   10 +-
 {20120301_a => 20131202}/c/src/nutm80.c            |   10 +-
 {20120301_a => 20131202}/c/src/obl06.c             |   10 +-
 {20120301_a => 20131202}/c/src/obl80.c             |   10 +-
 {20120301_a => 20131202}/c/src/p06e.c              |   10 +-
 {20120301_a => 20131202}/c/src/p2pv.c              |   10 +-
 {20120301_a => 20131202}/c/src/p2s.c               |   10 +-
 {20120301_a => 20131202}/c/src/pap.c               |   10 +-
 {20120301_a => 20131202}/c/src/pas.c               |   10 +-
 {20120301_a => 20131202}/c/src/pb06.c              |   10 +-
 {20120301_a => 20131202}/c/src/pdp.c               |   10 +-
 {20120301_a => 20131202}/c/src/pfw06.c             |   10 +-
 {20120301_a => 20131202}/c/src/plan94.c            |   10 +-
 {20120301_a => 20131202}/c/src/pm.c                |   19 +-
 {20120301_a => 20131202}/c/src/pmat00.c            |   10 +-
 {20120301_a => 20131202}/c/src/pmat06.c            |   10 +-
 {20120301_a => 20131202}/c/src/pmat76.c            |   10 +-
 {20120301_a => 20131202}/c/src/pmp.c               |   10 +-
 20120301_a/c/src/pap.c => 20131202/c/src/pmpx.c    |  128 +-
 .../c/src/starpm.c => 20131202/c/src/pmsafe.c      |  161 +-
 {20120301_a => 20131202}/c/src/pn.c                |   10 +-
 {20120301_a => 20131202}/c/src/pn00.c              |   10 +-
 {20120301_a => 20131202}/c/src/pn00a.c             |   15 +-
 {20120301_a => 20131202}/c/src/pn00b.c             |   13 +-
 {20120301_a => 20131202}/c/src/pn06.c              |   14 +-
 {20120301_a => 20131202}/c/src/pn06a.c             |   13 +-
 {20120301_a => 20131202}/c/src/pnm00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/pnm00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/pnm06a.c            |   10 +-
 {20120301_a => 20131202}/c/src/pnm80.c             |   10 +-
 {20120301_a => 20131202}/c/src/pom00.c             |   10 +-
 {20120301_a => 20131202}/c/src/ppp.c               |   10 +-
 {20120301_a => 20131202}/c/src/ppsp.c              |   10 +-
 {20120301_a => 20131202}/c/src/pr00.c              |   10 +-
 {20120301_a => 20131202}/c/src/prec76.c            |   44 +-
 {20120301_a => 20131202}/c/src/pv2p.c              |   10 +-
 {20120301_a => 20131202}/c/src/pv2s.c              |   10 +-
 {20120301_a => 20131202}/c/src/pvdpv.c             |   10 +-
 {20120301_a => 20131202}/c/src/pvm.c               |   10 +-
 {20120301_a => 20131202}/c/src/pvmpv.c             |   10 +-
 {20120301_a => 20131202}/c/src/pvppv.c             |   10 +-
 {20120301_a => 20131202}/c/src/pvstar.c            |   10 +-
 20120301_a/c/src/tdbtt.c => 20131202/c/src/pvtob.c |  118 +-
 {20120301_a => 20131202}/c/src/pvu.c               |   10 +-
 {20120301_a => 20131202}/c/src/pvup.c              |   10 +-
 {20120301_a => 20131202}/c/src/pvxpv.c             |   10 +-
 {20120301_a => 20131202}/c/src/pxp.c               |   10 +-
 20131202/c/src/refco.c                             |  304 ++
 {20120301_a => 20131202}/c/src/rm2v.c              |   10 +-
 {20120301_a => 20131202}/c/src/rv2m.c              |   10 +-
 {20120301_a => 20131202}/c/src/rx.c                |   10 +-
 {20120301_a => 20131202}/c/src/rxp.c               |   10 +-
 {20120301_a => 20131202}/c/src/rxpv.c              |   10 +-
 {20120301_a => 20131202}/c/src/rxr.c               |   10 +-
 {20120301_a => 20131202}/c/src/ry.c                |   10 +-
 {20120301_a => 20131202}/c/src/rz.c                |   10 +-
 {20120301_a => 20131202}/c/src/s00.c               |   10 +-
 {20120301_a => 20131202}/c/src/s00a.c              |   16 +-
 {20120301_a => 20131202}/c/src/s00b.c              |   16 +-
 {20120301_a => 20131202}/c/src/s06.c               |   10 +-
 {20120301_a => 20131202}/c/src/s06a.c              |   10 +-
 {20120301_a => 20131202}/c/src/s2c.c               |   10 +-
 {20120301_a => 20131202}/c/src/s2p.c               |   10 +-
 {20120301_a => 20131202}/c/src/s2pv.c              |   10 +-
 {20120301_a => 20131202}/c/src/s2xpv.c             |   10 +-
 {20120301_a => 20131202}/c/src/sepp.c              |   10 +-
 {20120301_a => 20131202}/c/src/seps.c              |   10 +-
 {20120301_a => 20131202}/c/src/sofa.h              |  123 +-
 {20120301_a => 20131202}/c/src/sofam.h             |   63 +-
 {20120301_a => 20131202}/c/src/sp00.c              |   10 +-
 {20120301_a => 20131202}/c/src/starpm.c            |   12 +-
 {20120301_a => 20131202}/c/src/starpv.c            |   10 +-
 {20120301_a => 20131202}/c/src/sxp.c               |   10 +-
 {20120301_a => 20131202}/c/src/sxpv.c              |   12 +-
 {20120301_a => 20131202}/c/src/t_sofa_c.c          | 2644 ++++++++++--
 {20120301_a => 20131202}/c/src/taitt.c             |   10 +-
 {20120301_a => 20131202}/c/src/taiut1.c            |   10 +-
 {20120301_a => 20131202}/c/src/taiutc.c            |   81 +-
 {20120301_a => 20131202}/c/src/tcbtdb.c            |   10 +-
 {20120301_a => 20131202}/c/src/tcgtt.c             |   10 +-
 {20120301_a => 20131202}/c/src/tdbtcb.c            |   10 +-
 {20120301_a => 20131202}/c/src/tdbtt.c             |   10 +-
 {20120301_a => 20131202}/c/src/tf2a.c              |   10 +-
 {20120301_a => 20131202}/c/src/tf2d.c              |   10 +-
 {20120301_a => 20131202}/c/src/tr.c                |   10 +-
 {20120301_a => 20131202}/c/src/trxp.c              |   10 +-
 {20120301_a => 20131202}/c/src/trxpv.c             |   10 +-
 {20120301_a => 20131202}/c/src/tttai.c             |   10 +-
 {20120301_a => 20131202}/c/src/tttcg.c             |   10 +-
 {20120301_a => 20131202}/c/src/tttdb.c             |   10 +-
 {20120301_a => 20131202}/c/src/ttut1.c             |   10 +-
 {20120301_a => 20131202}/c/src/ut1tai.c            |   10 +-
 {20120301_a => 20131202}/c/src/ut1tt.c             |   10 +-
 {20120301_a => 20131202}/c/src/ut1utc.c            |   12 +-
 {20120301_a => 20131202}/c/src/utctai.c            |   61 +-
 {20120301_a => 20131202}/c/src/utcut1.c            |   26 +-
 {20120301_a => 20131202}/c/src/xy06.c              |   12 +-
 {20120301_a => 20131202}/c/src/xys00a.c            |   10 +-
 {20120301_a => 20131202}/c/src/xys00b.c            |   10 +-
 {20120301_a => 20131202}/c/src/xys06a.c            |   12 +-
 {20120301_a => 20131202}/c/src/zp.c                |   10 +-
 {20120301_a => 20131202}/c/src/zpv.c               |   10 +-
 {20120301_a => 20131202}/c/src/zr.c                |   10 +-
 261 files changed, 13627 insertions(+), 3174 deletions(-)

diff --git a/20120301_a/c/doc/board.lis b/20120301_a/c/doc/board.lis
deleted file mode 100644
index 2b88a0b..0000000
--- a/20120301_a/c/doc/board.lis
+++ /dev/null
@@ -1,33 +0,0 @@
-board.lis                                              2010 November 23
-
-
-
-IAU STANDARDS OF FUNDAMENTAL ASTRONOMY BOARD
-
-
-Current Membership
-
-   John Bangert           United States Naval Observatory
-   Steven Bell            Her Majesty's Nautical Almanac Office
-   Mark Calabretta        Australia Telescope National Facility
-   Nicole Capitaine       Paris Observatory
-   William Folkner        Jet Propulsion Laboratory
-   George Hobbs           Australia Telescope National Facility
-   Catherine Hohenkerk    Her Majesty's Nautical Almanac Office (Chair)
-   Wen-Jing Jin           Shanghai Observatory
-   Brian Luzum            United States Naval Observatory (IERS)
-   Zinovy Malkin          Pulkovo Observatory, St Petersburg
-   Jeffrey Percival       University of Wisconsin
-   Patrick Wallace        Rutherford Appleton Laboratory
-
-
-Past Members
-
-   Wim Brouw              University of Groningen
-   Anne-Marie Gontier     Paris Observatory
-   George Kaplan          United States Naval Observatory
-   Dennis McCarthy        United States Naval Observatory
-   Skip Newhall           Jet Propulsion Laboratory
-
-
-The e-mail for the Board chair is Catherine.Hohenkerk at ukho.gov.uk
diff --git a/20120301_a/c/doc/board.pdf b/20120301_a/c/doc/board.pdf
deleted file mode 100644
index 5cc360f..0000000
--- a/20120301_a/c/doc/board.pdf
+++ /dev/null
@@ -1,69 +0,0 @@
-%PDF-1.2
-%�쏢
-5 0 obj
-<</Length 6 0 R/Filter /FlateDecode>>
-stream
-x��T�N�@}�W� 7�x�H %��F�/c3��w�zm����DNՖb+q��9s��?C�mC���g�:-�g�<;��	ԏ(�A�|^������]V�[V�c��������9��q��<�R����3]R��N�$xr��z����s|�݁x�Koy��|�;�=���-x~�����0���ɑ�����6uXC��t���"���{��p���
P����;%,=�o�R3,Q�<�ɔh��0�V�Vg��[*��H�fw����(���
-��"b(O��0��j%"b�
-b�&�!J

Y�;�ȭA)��G:#�B+a$���b&"-�A2aQ(�!hx,����{!7����b��5!

��B�\n1Ԧ�6&m��:
����!ژL��ZǤ���W.x8
�(��ɮ
R����_
>~�c��?4>0���H��zg�\��j����J�&,�f�E!]�f�'ƄYvaX�u�?���ІL$�Z{%�X�W<#VR�B�I
�FD	ܣ��&
ˢt��#xY&��>��b,0�o�~%vN���F/�{z�jl�b�I�6����{J�){Y�������<X��f�A�w�J�$�u
��x�d?��%ƃ�����D�v�t��������
Q�M`V{��{�-�X�k]�E�pW���_�i��endstream
-endobj
-6 0 obj
-664
-endobj
-4 0 obj
-<</Type/Page/MediaBox [0 0 595 842]
-/Rotate 0/Parent 3 0 R
-/Resources<</ProcSet[/PDF /Text]
-/Font 8 0 R
->>
-/Contents 5 0 R
->>
-endobj
-3 0 obj
-<< /Type /Pages /Kids [
-4 0 R
-] /Count 1
->>
-endobj
-1 0 obj
-<</Type /Catalog /Pages 3 0 R
->>
-endobj
-8 0 obj
-<</R7
-7 0 R>>
-endobj
-7 0 obj
-<</BaseFont/Courier/Type/Font
-/Encoding 9 0 R/Subtype/Type1>>
-endobj
-9 0 obj
-<</Type/Encoding/Differences[
-45/minus]>>
-endobj
-2 0 obj
-<</Producer(GPL Ghostscript 9.01)
-/CreationDate(D:20120228103244Z00'00')
-/ModDate(D:20120228103244Z00'00')
-/Title(board.lis)
-/Author(Steve Bell)
-/Creator(a2ps version 4.13)>>endobj
-xref
-0 10
-0000000000 65535 f 
-0000000968 00000 n 
-0000001179 00000 n 
-0000000909 00000 n 
-0000000768 00000 n 
-0000000015 00000 n 
-0000000749 00000 n 
-0000001045 00000 n 
-0000001016 00000 n 
-0000001122 00000 n 
-trailer
-<< /Size 10 /Root 1 0 R /Info 2 0 R
-/ID [<0627CE186E198077CDDE4A5D6F7D2961><0627CE186E198077CDDE4A5D6F7D2961>]
->>
-startxref
-1368
-%%EOF
diff --git a/20120301_a/c/doc/changes.lis b/20120301_a/c/doc/changes.lis
deleted file mode 100644
index ec768be..0000000
--- a/20120301_a/c/doc/changes.lis
+++ /dev/null
@@ -1,107 +0,0 @@
-
-               SOFA - Issue: 2012-03-01
-               ========================
-               
-* The license terms and conditions have been changed slightly.  The
-  stipulation that modified versions must not bear names that have
-  the prefix "iau" or "sofa" has been clarified, and acknowledgement 
-  of SOFA has been downgraded to a request."
-
-SOFA ANSI C Library
--------------------
-
-Version number aligned with the Fortran version number to 9.
-
-Updated/changed routines
-------------------------
-
-dat.c         Leap second for 2012 June 30 added
-
-af2a          First argument changed from 'int s' to 'char s'
-tf2a          First argument changed from 'int s' to 'char s'
-tf2d          First argument changed from 'int s' to 'char s'
-d2dtf         First argument changed from 'char *scale' to 'const char *scale'
-dtf2d         First argument changed from 'char *scale' to 'const char *scale'
-
-t_sofa_c      Test program updated due to the above.
-
-sofa.h        Updated to reflect the changes listed above. 
-
-sofam.h       Note added that the constants defined in the file are 
-              used only in the context of the SOFA Software, and have
-              no official IAU status.
-              Reference Ellipsoids defined via symbols 
-              WGS84=1, GRS80=2 and WGS72=3. 
-
-Description of changes
-----------------------
-
-* In iauDat a leap second has been added for 2012 June 30.
-
-* In iauAf2a, iauTf2a and iauTf2d, the data type of the sign
-  argument has been changed to char, for clarity and for
-  consistency with the converse functions iauA2af, iauA2tf and
-  iauD2tf.
-  
-* The scale arguments of the C functions iauD2dtf and iauDtf2d have
-  been changed from char* to const char* to allow read-only strings
-  (in particular string literals) to be used without risking
-  compiler warnings.  Analogous changes have been made to the viv
-  and vvd functions inside the test program t_sofa_c.
-
-* In iauEform, iauGc2gd and iauGd2gc can use the symbols defined in
-  the sofam.h file for the reference ellipsoids WGS84=1, GRS80=2 and 
-  WGS72=3.
-
-Errata/updates to the ANSI C code
----------------------------------
-
-sofam.h       Function dsign(A,B) was only valid for +ve A.
-              The comment for the constant DS2R has been corrected.
-                                          
-Errata to documentation
------------------------
-
-d2tf.c
-dtdb.c
-nut06a.c
-p06e.c
-tdbtt.c
-ut1tai.c
-ut1tt.c
-
-Cosmetic changes
-----------------
-
-taitt.c
-taiut1.c
-taiutc.c
-tcbtdb.c
-tdbtcb.c
-tttai.c
-tttdb.c
-ttut1.c
-ut1utc.c
-
-
-Revisions - 2012/07/10
-======================
-
-Updated routines:
-----------------
-
-dat.c           The validation of the FD argument has been eased so as 
-                to include exactly 1.0 in the acceptable range.  
-
-plan94.c        It has been pointed out that the comments have the
-                dimensions of the PV-vector the wrong way round.
-
-                For pv double[3][2] planet p,v (heliocentric, J2000.0, AU,AU/d)
-
-                read pv double[2][3] planet p,v (heliocentric, J2000.0, AU,AU/d)
-
-ir.c            The array elements for these 5 routines are now set up
-rx.c            explicitly so as to improve efficiency.
-ry.c
-rz.c
-zr.c
diff --git a/20120301_a/c/doc/changes.pdf b/20120301_a/c/doc/changes.pdf
deleted file mode 100644
index 8c3f535..0000000
Binary files a/20120301_a/c/doc/changes.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/consts.pdf b/20120301_a/c/doc/consts.pdf
deleted file mode 100644
index 460072b..0000000
Binary files a/20120301_a/c/doc/consts.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/contents.pdf b/20120301_a/c/doc/contents.pdf
deleted file mode 100644
index bcd09c0..0000000
--- a/20120301_a/c/doc/contents.pdf
+++ /dev/null
@@ -1,70 +0,0 @@
-%PDF-1.2
-%�쏢
-5 0 obj
-<</Length 6 0 R/Filter /FlateDecode>>
-stream
-x���QO�0���)�Mx��+��q4&�|]��BWP���\�&�wI��뿗��
�ɚ�J������3�U�H��<��
->����8�4ţ8�i�`�$
�l�6Ttc*�~E�%��۠˥� XW��(�i?郜��Y��Y�R�d�e�n6��\ su���&i,ڋ��.�G�+�*g��	
��D5 ���
�
-I��#L����تL��^�
-�������Y��[��)����cu���fg����m�ެ��
F�
�̢S���B���*.���s}0�F.���4Tk�Ej,�3����6endstream
-endobj
-6 0 obj
-301
-endobj
-4 0 obj
-<</Type/Page/MediaBox [0 0 595 842]
-/Rotate 0/Parent 3 0 R
-/Resources<</ProcSet[/PDF /Text]
-/Font 8 0 R
->>
-/Contents 5 0 R
->>
-endobj
-3 0 obj
-<< /Type /Pages /Kids [
-4 0 R
-] /Count 1
->>
-endobj
-1 0 obj
-<</Type /Catalog /Pages 3 0 R
->>
-endobj
-8 0 obj
-<</R7
-7 0 R>>
-endobj
-7 0 obj
-<</BaseFont/Courier/Type/Font
-/Encoding 9 0 R/Subtype/Type1>>
-endobj
-9 0 obj
-<</Type/Encoding/Differences[
-45/minus]>>
-endobj
-2 0 obj
-<</Producer(GPL Ghostscript 9.01)
-/CreationDate(D:20120710094201+01'00')
-/ModDate(D:20120710094201+01'00')
-/Title(contents.lis)
-/Author(Steve Bell)
-/Creator(a2ps version 4.13)>>endobj
-xref
-0 10
-0000000000 65535 f 
-0000000605 00000 n 
-0000000816 00000 n 
-0000000546 00000 n 
-0000000405 00000 n 
-0000000015 00000 n 
-0000000386 00000 n 
-0000000682 00000 n 
-0000000653 00000 n 
-0000000759 00000 n 
-trailer
-<< /Size 10 /Root 1 0 R /Info 2 0 R
-/ID [<EEB85B919253280D40101CA03049849A><EEB85B919253280D40101CA03049849A>]
->>
-startxref
-1008
-%%EOF
diff --git a/20120301_a/c/doc/copyr.pdf b/20120301_a/c/doc/copyr.pdf
deleted file mode 100644
index 39d10ee..0000000
Binary files a/20120301_a/c/doc/copyr.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/intro.pdf b/20120301_a/c/doc/intro.pdf
deleted file mode 100644
index 1c8af1c..0000000
Binary files a/20120301_a/c/doc/intro.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/manual.pdf b/20120301_a/c/doc/manual.pdf
deleted file mode 100644
index 267b159..0000000
Binary files a/20120301_a/c/doc/manual.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/sofa_lib.pdf b/20120301_a/c/doc/sofa_lib.pdf
deleted file mode 100644
index d637812..0000000
Binary files a/20120301_a/c/doc/sofa_lib.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/sofa_ts_c.pdf b/20120301_a/c/doc/sofa_ts_c.pdf
deleted file mode 100644
index dfc988d..0000000
Binary files a/20120301_a/c/doc/sofa_ts_c.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/sofa_vml.pdf b/20120301_a/c/doc/sofa_vml.pdf
deleted file mode 100644
index fb5dd38..0000000
Binary files a/20120301_a/c/doc/sofa_vml.pdf and /dev/null differ
diff --git a/20120301_a/c/doc/title.pdf b/20120301_a/c/doc/title.pdf
deleted file mode 100644
index a5f0664..0000000
Binary files a/20120301_a/c/doc/title.pdf and /dev/null differ
diff --git a/20120301_a/c/00READ.ME b/20131202/c/00READ.ME
similarity index 94%
rename from 20120301_a/c/00READ.ME
rename to 20131202/c/00READ.ME
index c298d95..ef15911 100644
--- a/20120301_a/c/00READ.ME
+++ b/20131202/c/00READ.ME
@@ -1,8 +1,8 @@
 
-SOFA-Issue: 2012-03-01
+SOFA-Issue: 2013-12-02
 
 This is the IAU Standards of Fundamental Astronomy (SOFA) Libraries product, 
-issued on 2012-03-01.  The tag `SOFA-Issue' above defines this release and 
+issued on 2013-12-02.  The tag `SOFA-Issue' above defines this release and 
 differentiates it from previous or subsequent releases of the SOFA product.
 The 00READ.ME file must remain with this distribution set.
 
@@ -46,4 +46,4 @@ Notes:
     development environment to create the appropriate library or DLL.
 
 IAU SOFA Center
-2012/02/29
+2013/11/20
diff --git a/20131202/c/doc/board.lis b/20131202/c/doc/board.lis
new file mode 100644
index 0000000..60f8924
--- /dev/null
+++ b/20131202/c/doc/board.lis
@@ -0,0 +1,35 @@
+board.lis                                                 2013 October 8
+
+
+
+IAU STANDARDS OF FUNDAMENTAL ASTRONOMY BOARD
+
+
+Current Membership
+
+   John Bangert - United States Naval Observatory, retired
+   Steven Bell - Her Majesty's Nautical Almanac Office
+   Mark Calabretta - Australia Telescope National Facility, retired
+   Nicole Capitaine - Paris Observatory
+   William Folkner - Jet Propulsion Laboratory
+   Catherine Hohenkerk - Her Majesty's Nautical Almanac Office (Chair)
+   Li Jinling - Shanghai Astronomical Observatory
+   Brian Luzum - United States Naval Observatory (IERS)
+   Zinovy Malkin - Pulkovo Observatory, St Petersburg
+   Jeffrey Percival - University of Wisconsin
+   Scott Ransom - National Radio Astronomy Observatory
+   Patrick Wallace - RAL Space, retired
+
+
+Past Members
+
+   Wim Brouw              University of Groningen
+   Anne-Marie Gontier     Paris Observatory
+   George Hobbs           Australia Telescope National Facility
+   George Kaplan          United States Naval Observatory
+   Dennis McCarthy        United States Naval Observatory
+   Skip Newhall           Jet Propulsion Laboratory
+   Jin Wen-Jing           Shanghai Observatory
+
+
+The e-mail for the Board chair is Catherine.Hohenkerk at ukho.gov.uk
diff --git a/20131202/c/doc/board.pdf b/20131202/c/doc/board.pdf
new file mode 100644
index 0000000..5b09d1c
Binary files /dev/null and b/20131202/c/doc/board.pdf differ
diff --git a/20131202/c/doc/changes.lis b/20131202/c/doc/changes.lis
new file mode 100644
index 0000000..c82b3a8
--- /dev/null
+++ b/20131202/c/doc/changes.lis
@@ -0,0 +1,161 @@
+List of Changes for the 10th release of SOFA as of 2013 November 19.
+
+-+-----------------------------------------------------------------------------
+FORTRAN Files
+-+-----------------------------------------------------------------------------
+
+
+Date e-mailed  File          Short Reason
+
+2012 Sep  5    epv00.for     Comment - minor.
+2013 Aug 31    eqeq94.for    Comment - minor.
+2012 Sep  5    fk5hz.for     Comment - minor.
+2012 Sep  5    hfk5z.for     Comment - minor.
+2012 Sep  5    nutm80.for    Comment - minor.
+2012 Sep  5    plan94.for    Comment - minor.
+2012 Sep  5    pnm80.for     Comment - minor.
+2013 Apr 16    ut1utc.for    Comment - minor.
+2013 May 14    xys06a.for    Comment - corrected to IAU 2006/2000A.
+2013 May 29    dat.for       Minor.
+2013 Jul 26    dtf2d.for     Corrected due to bug with TAI->UTC 1960-1972.
+2013 Jul 26    d2dtf.for     Corrected due to bug with TAI->UTC 1960-1972.
+2013 Jul 26    utctai.for    Corrected due to bug with TAI->UTC 1960-1972
+2013 Aug 07    epb.for       Comment - minor.
+2013 Aug 12    utcut1.for    Comment - correction.
+2013 Aug 21    bp00.for      Minor - support argument re-use.
+2013 Aug 21    bp06.for      Minor - support argument re-use.
+2013 Aug 24    c2tcio.for    Comment - '(radians)' inserted.
+2013 Aug 24    c2teqx.for    Comment - '(radians)' inserted.
+2013 Sep 01    gc2gd.for     Minor - if error, ELONG now set to -1D9.
+2013 Sep 02    fw2xy.for     Comment - minor.
+2013 Sep 12    taiutc.for    Corrected due to bug with TAI->UTC 1960-1972
+2013 Oct 04    t_sofa_f.for  Updated.
+2013 Nov 14    pn06.for      Comment - correction.
+2013 Nov 19    prec76.for    Minor - consistency.
+
+-+----------------------------------------------------------------------
+ANSI C Files
+-+----------------------------------------------------------------------
+
+Date e-mailed  File          Short Reason
+
+2013 Jun 18    *.c           Inclusion of sofam.h was replaced with sofa.h
+                             which now includes sofam.h (all except ee00.c,
+                             ee00a.c, ee00b.c, ee06a.c & gst94.c).
+2013 Jun 18    gmst82.c      Comment - typographical.
+2013 Jun 18    starpm.c      Comment - typographical.
+2013 Jun 18    ut1utc.c      Comment - correction.
+2013 Jun 18    xys06a.c      Comment - corrected to IAU 2006/2000A.
+2013 Jun 18    c2i06a.c      Comment - typographical.
+2013 Jun 18    eo06a.c       Comment - typographical.
+2013 Jun 18    s00a.c        Comment - typographical.
+2013 Jun 18    s00b.c        Comment - typographical.
+2013 Jun 18    c2i06a.c      Comment - typographical.
+2013 Jul 26    dtf2d.c       Corrected due to bug with TAI->UTC 1960-1972.
+2013 Jul 26    d2dtf.c       Corrected due to bug with TAI->UTC 1960-1972.
+2013 Jul 31    a2tf.c        Comment - typographical.
+2013 Aug 07    cal2jd.c      Trivial.
+2013 Aug 13    epb2jd.c      Trivial.
+2013 Aug 07    epj2jd.c      Trivial.
+2013 Aug 07    epj.c         Comment - typographical.
+2013 Aug 07    jd2cal.c      Trivial.
+2013 Aug 07    pm.c          Trivial.
+2013 Aug 07    sxpv.c        Comment - correction.
+2013 Aug 12    utcut1.c      Comment - corrections.
+2013 Aug 21    dat.c         Minor.
+2013 Aug 21    bp00.c        Trivial - white space.
+2013 Aug 21    bp06.c        Minor - support argument re-use.
+2013 Aug 21    epb.c         Trivial.
+2013 Aug 24    c2tcio.c      Comment - '(radians)' inserted.
+2013 Aug 24    c2teqx.c      Comment - '(radians)' inserted.
+2013 Aug 31    eqeq94.c      Comment - routine missing from 'Called' list.
+2013 Aug 21    xy06.c        Trivial.
+2013 Aug 22    sofa.h        Updated and also now #includes sofam.h.
+2013 Aug 27    sofam.h       Updated.
+2013 Sep 1     gc2gd.c       Minor - elong now set to -1e9 on error.
+2013 Sep 2     fw2xy.c       Comment - correction.
+2013 Jul 26    utctai.c      Corrected due to bug with TAI->UTC 1960-1972.
+2013 Sep 12    taiutc.c      Corrected due to bug with TAI->UTC 1960-1972.
+2013 Oct 04    t_sofa_c.c    Updated.
+2013 Nov 14    pn00a.c       Comment - correction.
+2014 Nov 14    pn00b.c       Comment - correction.
+2014 Nov 14    pn06a.c       Comment - correction.
+2014 Nov 14    pn06.c        Comment - correction.
+2013 Nov 19    prec76.c      Minor - consistency.
+
+-+----------------------------------------------------------------------
+Documentation Files
+-+----------------------------------------------------------------------
+
+2012 Jul 20    sofa_pn.tex   Add note that in the example numerical values for
+2012 Jul 20    sofa_pn.pdf   polar motion and UT1-UTC are for illustration
+                             only.
+
+2013 Feb 12    sofa_ts.tex   Units information added since:
+                             1) In the equation for TCG in terms of TT in Sect.
+                                3.6.4, TCG and TT are in JD or MJD form, though
+                                that is not stated.
+                             2) In the equation for TDB in terms of TCB in
+                                Sect. 3.6.5 (which is taken straight from the 
+                                IAU resolution) TDB and TCB are in seconds, and
+                                that also is not stated.
+2013 Aug 23    sofa_ts.tex   Page 23 of the c version; the xyz array should be
+               sofa_ts_c.pdf dimensioned to 3.
+               sofa_ts_f.pdf
+
+2013 Apr 30    board.lis     George Hobbs, retired and Scott Ransom joined.
+               copyr.lis     Cosmetic change.
+               intro.lis     Changes to deal with adding new section.
+               sofa_lib.lis  Changes to deal with adding new section.
+
+n.b. Tex source files are not distributed.
+
+-+----------------------------------------------------------------------
+NEW FILES
+-+----------------------------------------------------------------------
+
+   33 x 2 .c & .f files + 3 pdf files
+
+  Astrometry
+     AB        apply stellar aberration
+     APCG      prepare for ICRS <-> GCRS, geocentric, special
+     APCG13    prepare for ICRS <-> GCRS, geocentric
+     APCI      prepare for ICRS <-> CIRS, terrestrial, special
+     APCI13    prepare for ICRS <-> CIRS, terrestrial
+     APCO      prepare for ICRS <-> observed, terrestrial, special
+     APCO13    prepare for ICRS <-> observed, terrestrial
+     APCS      prepare for ICRS <-> CIRS, space, special
+     APCS13    prepare for ICRS <-> CIRS, space
+     APER      insert ERA into context
+     APER13    update context for Earth rotation
+     APIO      prepare for CIRS <-> observed, terrestrial, special
+     APIO13    prepare for CIRS <-> observed, terrestrial
+     ATCI13    catalog -> CIRS
+     ATCIQ     quick ICRS -> CIRS
+     ATCIQN    quick ICRS -> CIRS, multiple deflections
+     ATCIQZ    quick astrometric ICRS -> CIRS
+     ATCO13    ICRS -> observed
+     ATIC13    CIRS -> ICRS
+     ATICQ     quick CIRS -> ICRS
+     ATICQN    quick CIRS -> ICRS, multiple deflections
+     ATIO13    CIRS -> observed
+     ATIOQ     quick CIRS -> observed
+     ATOC13    observed -> astrometric ICRS
+     ATOI13    observed -> CIRS
+     ATOIQ     quick observed -> CIRS
+     LD        light deflection by a single solar-system body
+     LDN       light deflection by multiple solar-system bodies
+     LDSUN     light deflection by the Sun
+     PMPX      apply proper motion and parallax
+     PVTOB     observatory position and velocity
+     REFCO     refraction constants
+
+  Star catalog conversions
+     PMSAFE    apply proper motion, with zero-parallax precautions
+
+CookBooks/Documentation
+    sofa_ast_f.pdf           SOFA Astrometry Tools, Fortran
+    sofa_ast_c.pdf           SOFA Astrometry Tools, ANSI C
+    sofa_ast_summary.pdf     2-page summary of Astrometry Tools
+
+CYH/SAB - 2013 November 20th.
diff --git a/20131202/c/doc/changes.pdf b/20131202/c/doc/changes.pdf
new file mode 100644
index 0000000..942b1ac
Binary files /dev/null and b/20131202/c/doc/changes.pdf differ
diff --git a/20120301_a/c/doc/consts.lis b/20131202/c/doc/consts.lis
similarity index 100%
rename from 20120301_a/c/doc/consts.lis
rename to 20131202/c/doc/consts.lis
diff --git a/20131202/c/doc/consts.pdf b/20131202/c/doc/consts.pdf
new file mode 100644
index 0000000..eddfce3
Binary files /dev/null and b/20131202/c/doc/consts.pdf differ
diff --git a/20120301_a/c/doc/contents.lis b/20131202/c/doc/contents.lis
similarity index 75%
rename from 20120301_a/c/doc/contents.lis
rename to 20131202/c/doc/contents.lis
index b9678c3..bc294f3 100644
--- a/20120301_a/c/doc/contents.lis
+++ b/20131202/c/doc/contents.lis
@@ -1,4 +1,4 @@
-contents.lis                                           2008 September 30
+contents.lis                                              2008 October 8
 
 
                              --------
@@ -22,4 +22,4 @@ contents.lis                                           2008 September 30
 
                  A2   Constants
 
-                 A3   SOFA Review Board membership
+                 A3   SOFA Board membership
diff --git a/20131202/c/doc/contents.pdf b/20131202/c/doc/contents.pdf
new file mode 100644
index 0000000..5649791
Binary files /dev/null and b/20131202/c/doc/contents.pdf differ
diff --git a/20120301_a/c/doc/copyr.lis b/20131202/c/doc/copyr.lis
similarity index 98%
rename from 20120301_a/c/doc/copyr.lis
rename to 20131202/c/doc/copyr.lis
index 172268d..4122c3b 100644
--- a/20120301_a/c/doc/copyr.lis
+++ b/20131202/c/doc/copyr.lis
@@ -47,7 +47,7 @@ and C versions.)
 *        of how the derived work is based upon, contains and/or differs
 *        from the original SOFA software.
 *
-*     c) The name(s) of all routine(s) in your derived work shall not
+*     c) The names of all routines in your derived work shall not
 *        include the prefix "iau" or "sofa" or trivial modifications
 *        thereof such as changes of case.
 *
diff --git a/20131202/c/doc/copyr.pdf b/20131202/c/doc/copyr.pdf
new file mode 100644
index 0000000..243d2b5
Binary files /dev/null and b/20131202/c/doc/copyr.pdf differ
diff --git a/20120301_a/c/doc/intro.lis b/20131202/c/doc/intro.lis
similarity index 85%
rename from 20120301_a/c/doc/intro.lis
rename to 20131202/c/doc/intro.lis
index b05a1a6..890edcc 100644
--- a/20120301_a/c/doc/intro.lis
+++ b/20131202/c/doc/intro.lis
@@ -1,4 +1,4 @@
-intro.lis                                               2010 September 5
+intro.lis                                                 2010 October 8
 
 
                   -------------------------------
@@ -9,21 +9,21 @@ intro.lis                                               2010 September 5
   SOFA stands for "Standards Of Fundamental Astronomy".  The SOFA
   software libraries are a collection of subprograms, in source-
   code form, which implement official IAU algorithms for fundamental-
-  astronomy computations.   The subprograms at present comprise 131
+  astronomy computations.   The subprograms at present comprise 164
   "astronomy" routines supported by 55 "vector/matrix" routines,
   available in both Fortran77 and C implementations.
 
 
 THE SOFA INITIATIVE
 
-SOFA is an IAU Service which operates under Division 1 (Fundamental
-Astronomy) and reports through Commission 19 (Rotation of the Earth).
+SOFA is an IAU Service which operates as a Standing Working Group under
+Division A (Fundamental Astronomy).
 
 The IAU set up the SOFA initiative at the 1994 General Assembly, to
 promulgate an authoritative set of fundamental-astronomy constants and
 algorithms.  At the subsequent General Assembly, in 1997, the
-appointment of a SOFA Review Board and the selection of a site for the
-SOFA Center (the outlet for SOFA products) were announced.
+appointment of a review board and the selection of a site for the SOFA
+Center (the outlet for SOFA products) were announced.
 
 The SOFA initiative was originally proposed by the IAU Working Group on
 Astronomical Standards (WGAS), under the chairmanship of
@@ -32,7 +32,7 @@ establish and maintain an accessible and authoritative set of constants,
 algorithms and procedures that implement standard models used in
 fundamental astronomy".  The SOFA Software Libraries implement the
 "algorithms" part of the SOFA initiative.  They were developed under the
-supervision of an international panel called the SOFA Review Board.  The
+supervision of an international panel called the SOFA Board.  The
 current membership of this panel is listed in an appendix.
 
 A feature of the original SOFA software proposals was that the products
@@ -48,12 +48,11 @@ visible as individual text files and will run on a variety of platforms.
 
 ALGORITHMS
 
-The SOFA Review Board's initial goal has been to create a set of
-callable subprograms.  Whether "subroutines" or "functions", they are
-all referred to simply as "routines".  They are designed for use by
-software developers wishing to write complete applications;  no
-runnable, free-standing applications are included in SOFA's present
-plans.
+The SOFA Board's initial goal has been to create a set of callable
+subprograms.  Whether "subroutines" or "functions", they are all
+referred to simply as "routines".  They are designed for use by software
+developers wishing to write complete applications;  no runnable, free-
+standing applications are included in SOFA's present plans.
 
 The algorithms are drawn from a variety of sources.  Because most of the
 routines so far developed have either been standard "text-book"
@@ -75,7 +74,7 @@ SCOPE
 The routines currently available are listed in the next two chapters of
 this document.
 
-The "astronomy" library comprises 131 routines (plus one obsolete
+The "astronomy" library comprises 164 routines (plus one obsolete
 Fortran routine that now appears under a revised name).  The areas
 addressed include calendars, time scales, ephemerides, precession-
 nutation, star space-motion, star catalog transformations and
@@ -130,7 +129,10 @@ detail what the routine does and how it is used.
 The file sofa_pn.pdf describes the SOFA tools for precession-nutation
 and other aspects of Earth attitude and includes example code and (see
 the appendix) diagrams showing the interrelationships between the
-routines supporting the latest (IAU 2006/2000A) models.
+routines supporting the latest (IAU 2006/2000A) models.  Four other
+documents introduce time scale transformations (sofa_ts_f.pdf and
+sofa_ts_c.pdf for Fortran and C users respectively) and astrometric
+transformations (sofa_ast_f.pdf and sofa_ast_c.pdf).
 
 
 PROGRAMMING LANGUAGES AND STANDARDS
@@ -175,12 +177,11 @@ encountered on some systems.
 COPYRIGHT ISSUES
 
 Copyright for all of the SOFA software and documentation is owned by the
-IAU SOFA Review Board.  The Software is made available free of charge
-for all classes of user, including commercial.  However, there are
-strict rules designed to avoid unauthorized variants coming into
-circulation.  It is permissible to distribute derived works and other
-modifications, but they must be clearly marked to avoid confusion with
-the SOFA originals.
+IAU SOFA Board.  The Software is made available free of charge for all
+classes of user, including commercial.  However, there are strict rules
+designed to avoid unauthorized variants coming into circulation.  It is
+permissible to distribute derived works and other modifications, but
+they must be clearly marked to avoid confusion with the SOFA originals.
 
 Further details are included in the block of comments which concludes
 every routine.  The text is also set out in an appendix to the present
diff --git a/20131202/c/doc/intro.pdf b/20131202/c/doc/intro.pdf
new file mode 100644
index 0000000..a1c1fa9
Binary files /dev/null and b/20131202/c/doc/intro.pdf differ
diff --git a/20120301_a/c/doc/manual.lis b/20131202/c/doc/manual.lis
similarity index 70%
rename from 20120301_a/c/doc/manual.lis
rename to 20131202/c/doc/manual.lis
index 8dd0e76..d1cad38 100644
--- a/20120301_a/c/doc/manual.lis
+++ b/20131202/c/doc/manual.lis
@@ -44,9 +44,7 @@
 
                    International Astronomical Union
 
-                   Division 1: Fundamental Astronomy
-
-                  Commission 19: Rotation of the Earth
+                   Division A: Fundamental Astronomy
 
 
                 Standards Of Fundamental Astronomy Board
@@ -55,11 +53,11 @@
 
 
 
-                               Release 9
+                               Release 10
 
-                              2012 March 1
+                             2013 October 31
 

-contents.lis                                           2008 September 30
+contents.lis                                              2008 October 8
 
 
                              --------
@@ -83,9 +81,9 @@ contents.lis                                           2008 September 30
 
                  A2   Constants
 
-                 A3   SOFA Review Board membership
+                 A3   SOFA Board membership
 

-intro.lis                                               2010 September 5
+intro.lis                                                 2010 October 8
 
 
                   -------------------------------
@@ -96,21 +94,21 @@ intro.lis                                               2010 September 5
   SOFA stands for "Standards Of Fundamental Astronomy".  The SOFA
   software libraries are a collection of subprograms, in source-
   code form, which implement official IAU algorithms for fundamental-
-  astronomy computations.   The subprograms at present comprise 131
+  astronomy computations.   The subprograms at present comprise 164
   "astronomy" routines supported by 55 "vector/matrix" routines,
   available in both Fortran77 and C implementations.
 
 
 THE SOFA INITIATIVE
 
-SOFA is an IAU Service which operates under Division 1 (Fundamental
-Astronomy) and reports through Commission 19 (Rotation of the Earth).
+SOFA is an IAU Service which operates as a Standing Working Group under
+Division A (Fundamental Astronomy).
 
 The IAU set up the SOFA initiative at the 1994 General Assembly, to
 promulgate an authoritative set of fundamental-astronomy constants and
 algorithms.  At the subsequent General Assembly, in 1997, the
-appointment of a SOFA Review Board and the selection of a site for the
-SOFA Center (the outlet for SOFA products) were announced.
+appointment of a review board and the selection of a site for the SOFA
+Center (the outlet for SOFA products) were announced.
 
 The SOFA initiative was originally proposed by the IAU Working Group on
 Astronomical Standards (WGAS), under the chairmanship of
@@ -119,7 +117,7 @@ establish and maintain an accessible and authoritative set of constants,
 algorithms and procedures that implement standard models used in
 fundamental astronomy".  The SOFA Software Libraries implement the
 "algorithms" part of the SOFA initiative.  They were developed under the
-supervision of an international panel called the SOFA Review Board.  The
+supervision of an international panel called the SOFA Board.  The
 current membership of this panel is listed in an appendix.
 
 A feature of the original SOFA software proposals was that the products
@@ -135,12 +133,11 @@ visible as individual text files and will run on a variety of platforms.
 
 ALGORITHMS
 
-The SOFA Review Board's initial goal has been to create a set of
-callable subprograms.  Whether "subroutines" or "functions", they are
-all referred to simply as "routines".  They are designed for use by
-software developers wishing to write complete applications;  no
-runnable, free-standing applications are included in SOFA's present
-plans.
+The SOFA Board's initial goal has been to create a set of callable
+subprograms.  Whether "subroutines" or "functions", they are all
+referred to simply as "routines".  They are designed for use by software
+developers wishing to write complete applications;  no runnable, free-
+standing applications are included in SOFA's present plans.
 
 The algorithms are drawn from a variety of sources.  Because most of the
 routines so far developed have either been standard "text-book"
@@ -162,7 +159,7 @@ SCOPE
 The routines currently available are listed in the next two chapters of
 this document.
 
-The "astronomy" library comprises 131 routines (plus one obsolete
+The "astronomy" library comprises 164 routines (plus one obsolete
 Fortran routine that now appears under a revised name).  The areas
 addressed include calendars, time scales, ephemerides, precession-
 nutation, star space-motion, star catalog transformations and
@@ -217,7 +214,10 @@ detail what the routine does and how it is used.
 The file sofa_pn.pdf describes the SOFA tools for precession-nutation
 and other aspects of Earth attitude and includes example code and (see
 the appendix) diagrams showing the interrelationships between the
-routines supporting the latest (IAU 2006/2000A) models.
+routines supporting the latest (IAU 2006/2000A) models.  Four other
+documents introduce time scale transformations (sofa_ts_f.pdf and
+sofa_ts_c.pdf for Fortran and C users respectively) and astrometric
+transformations (sofa_ast_f.pdf and sofa_ast_c.pdf).
 
 
 PROGRAMMING LANGUAGES AND STANDARDS
@@ -262,12 +262,11 @@ encountered on some systems.
 COPYRIGHT ISSUES
 
 Copyright for all of the SOFA software and documentation is owned by the
-IAU SOFA Review Board.  The Software is made available free of charge
-for all classes of user, including commercial.  However, there are
-strict rules designed to avoid unauthorized variants coming into
-circulation.  It is permissible to distribute derived works and other
-modifications, but they must be clearly marked to avoid confusion with
-the SOFA originals.
+IAU SOFA Board.  The Software is made available free of charge for all
+classes of user, including commercial.  However, there are strict rules
+designed to avoid unauthorized variants coming into circulation.  It is
+permissible to distribute derived works and other modifications, but
+they must be clearly marked to avoid confusion with the SOFA originals.
 
 Further details are included in the block of comments which concludes
 every routine.  The text is also set out in an appendix to the present
@@ -298,7 +297,7 @@ Resources for operating the SOFA Center are provided by Her Majesty's
 Nautical Almanac Office, operated by the United Kingdom Hydrographic
 Office.
 

-sofa_lib.lis                                            2010 September 5
+sofa_lib.lis                                            2013 November 19
 
                      ----------------------
                      SOFA Astronomy Library
@@ -309,9 +308,9 @@ PREFACE
 
 The routines described here comprise the SOFA astronomy library.  Their
 general appearance and coding style conforms to conventions agreed by
-the SOFA Review Board, and their functions, names and algorithms have
-been ratified by the Board.  Procedures for soliciting and agreeing
-additions to the library are still evolving.
+the SOFA Board, and their functions, names and algorithms have been
+ratified by the Board.  Procedures for soliciting and agreeing additions
+to the library are still evolving.
 
 
 PROGRAMMING LANGUAGES
@@ -355,12 +354,16 @@ the latter are described as "support routines".
 
 Using the library requires knowledge of positional astronomy and
 time-scales.  These topics are covered in "Explanatory Supplement to the
-Astronomical Almanac", P. Kenneth Seidelmann (ed.), University Science
-Books, 1992.  Recent developments are documented in the journals, and
-references to the relevant papers are given in the SOFA code as
-required.  The IERS Conventions are also an essential reference.  The
-routines concerned with Earth attitude (precession-nutation etc.) are
-described in the SOFA document sofa_pn.pdf.
+Astronomical Almanac", 3rd Edition,  Sean E. Urban &
+P. Kenneth Seidelmann (eds.), University Science Books, 2013.  Recent
+developments are documented in the scientific journals, and references
+to the relevant papers are given in the SOFA code as required.  The IERS
+Conventions are also an essential reference.  The routines concerned
+with Earth attitude (precession-nutation etc.) are described in the SOFA
+document sofa_pn.pdf.  Those concerned with transformations between
+different time scales are described in sofa_ts_f.pdf (Fortran) and
+sofa_ts_c.pdf (C).  Those concerned with astrometric transformations
+are described in sofa_ast_f.pdf (Fortran) and sofa_ast_c (C).
 
 
 ROUTINES
@@ -375,6 +378,41 @@ ROUTINES
      JD2CAL    Julian Date to Gregorian year, month, day, fraction
      JDCALF    Julian Date to Gregorian date for formatted output
 
+  Astrometry
+
+     AB        apply stellar aberration
+     APCG      prepare for ICRS <-> GCRS, geocentric, special
+     APCG13    prepare for ICRS <-> GCRS, geocentric
+     APCI      prepare for ICRS <-> CIRS, terrestrial, special
+     APCI13    prepare for ICRS <-> CIRS, terrestrial
+     APCO      prepare for ICRS <-> observed, terrestrial, special
+     APCO13    prepare for ICRS <-> observed, terrestrial
+     APCS      prepare for ICRS <-> CIRS, space, special
+     APCS13    prepare for ICRS <-> CIRS, space
+     APER      insert ERA into context
+     APER13    update context for Earth rotation
+     APIO      prepare for CIRS <-> observed, terrestrial, special
+     APIO13    prepare for CIRS <-> observed, terrestrial
+     ATCI13    catalog -> CIRS
+     ATCIQ     quick ICRS -> CIRS
+     ATCIQN    quick ICRS -> CIRS, multiple deflections
+     ATCIQZ    quick astrometric ICRS -> CIRS
+     ATCO13    ICRS -> observed
+     ATIC13    CIRS -> ICRS
+     ATICQ     quick CIRS -> ICRS
+     ATCIQN    quick CIRS -> ICRS, multiple deflections
+     ATIO13    CIRS -> observed
+     ATIOQ     quick CIRS -> observed
+     ATOC13    observed -> astrometric ICRS
+     ATOI13    observed -> CIRS
+     ATOIQ     quick observed -> CIRS
+     LD        light deflection by a single solar-system body
+     LDN       light deflection by multiple solar-system bodies
+     LDSUN     light deflection by the Sun
+     PMPX      apply proper motion and parallax
+     PVTOB     observatory position and velocity
+     REFCO     refraction constants
+
   Time scales
 
      D2DTF     format 2-part JD for output
@@ -513,7 +551,8 @@ ROUTINES
      FK5HZ     FK5 to Hipparcos assuming zero Hipparcos proper motion
      H2FK5     transform Hipparcos star data into the FK5 system
      HFK5Z     Hipparcos to FK5 assuming zero Hipparcos proper motion
-     STARPM    proper motion between two epochs
+     PMSAFE    apply proper motion, with zero-parallax precautions
+     STARPM    apply proper motion
 
   Geodetic/geocentric
 
@@ -531,6 +570,44 @@ ROUTINES
 
 CALLS: FORTRAN VERSION
 
+   CALL iau_AB     ( PNAT, V, S, BM1, PPR )
+   CALL iau_APCG   ( DATE1, DATE2, EB, EH, ASTROM )
+   CALL iau_APCG13 ( DATE1, DATE2, ASTROM )
+   CALL iau_APCI   ( DATE1, DATE2, EB, EH, X, Y, S, ASTROM )
+   CALL iau_APCI13 ( DATE1, DATE2, ASTROM, EO )
+   CALL iau_APCO   ( DATE1, DATE2, EB, EH, X, Y, S,
+  :                  THETA, ELONG, PHI, HM, XP, YP, SP,
+  :                  REFA, REFB, ASTROM )
+   CALL iau_APCO13 ( UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
+  :                  PHPA, TC, RH, WL, ASTROM, EO, J )
+   CALL iau_APCS   ( DATE1, DATE2, PV, EB, EH, ASTROM )
+   CALL iau_APCS13 ( DATE1, DATE2, PV, ASTROM )
+   CALL iau_APER   ( THETA, ASTROM )
+   CALL iau_APER13 ( UT11, UT12, ASTROM )
+   CALL iau_APIO   ( SP, THETA, ELONG, PHI, HM, XP, YP,
+  :                  REFA, REFB, ASTROM )
+   CALL iau_APIO13 ( UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
+  :                  PHPA, TC, RH, WL, ASTROM, J )
+   CALL iau_ATCI13 ( RC, DC, PR, PD, PX, RV, DATE1, DATE2, RI, DI, EO )
+   CALL iau_ATCIQ  ( RC, DC, PR, PD, PX, RV, ASTROM, RI, DI )
+   CALL iau_ATCIQN ( RC, DC, PR, PD, PX, RV, ASTROM, N, B, RI, DI )
+   CALL iau_ATCIQZ ( RC, DC, ASTROM, RI, DI )
+   CALL iau_ATCO13 ( RC, DC, PR, PD, PX, RV, UTC1, UTC2, DUT1, ELONG,
+  :                  PHI, HM, XP, YP, PHPA, TC, RH, WL,
+  :                  AOB, ZOB, HOB, DOB, ROB, EO, J )
+   CALL iau_ATIC13 ( RI, DI, DATE1, DATE2, RC, DC, EO )
+   CALL iau_ATICQ  ( RI, DI, ASTROM, RC, DC )
+   CALL iau_ATCIQN ( RI, DI, ASTROM, N, B, RC, DC )
+   CALL iau_ATIO13 ( RI, DI, UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
+                     PHPA, TC, RH, WL, AOB, ZOB, HOB, DOB, ROB, J )
+   CALL iau_ATIOQ  ( RI, DI, ASTROM, AOB, ZOB, HOB, DOB, ROB )
+   CALL iau_ATOC13 ( TYPE, OB1, OB2, UTC1, UTC2, DUT1,
+  :                  ELONG, PHI, HM, XP, YP, PHPA, TC, RH, WL,
+  :                  RC, DC, J )
+   CALL iau_ATOI13 ( TYPE, OB1, OB2, UTC1, UTC2, DUT1,
+  :                  ELONG, PHI, HM, XP, YP, PHPA, TC, RH, WL,
+  :                  RI, DI, J  )
+   CALL iau_ATOIQ  ( TYPE, OB1, OB2, ASTROM, RI, DI )
    CALL iau_BI00   ( DPSIBI, DEPSBI, DRA )
    CALL iau_BP00   ( DATE1, DATE2, RB, RP, RBP )
    CALL iau_BP06   ( DATE1, DATE2, RB, RP, RBP )
@@ -606,6 +683,9 @@ CALLS: FORTRAN VERSION
    CALL iau_HFK5Z  ( RH, DH, DATE1, DATE2, R5, D5, DR5, DD5 )
    CALL iau_JD2CAL ( DJ1, DJ2, IY, IM, ID, FD, J )
    CALL iau_JDCALF ( NDP, DJ1, DJ2, IYMDF, J )
+   CALL iau_LD     ( BM, P, Q, E, EM, DLIM, P1 )
+   CALL iau_LDN    ( N, B, OB, SC, SN )
+   CALL iau_LDSUN  ( P, E, EM, P1 )
    CALL iau_NUM00A ( DATE1, DATE2, RMATN )
    CALL iau_NUM00B ( DATE1, DATE2, RMATN )
    CALL iau_NUM06A ( DATE1, DATE2, RMATN )
@@ -623,6 +703,10 @@ CALLS: FORTRAN VERSION
    CALL iau_PMAT00 ( DATE1, DATE2, RBP )
    CALL iau_PMAT06 ( DATE1, DATE2, RBP )
    CALL iau_PMAT76 ( DATE1, DATE2, RMATP )
+   CALL iau_PMPX   ( RC, DC, PR, PD, PX, RV, PMT, POB, PCO )
+   CALL iau_PMSAFE ( RA1, DEC1, PMR1, PMD1, PX1, RV1,
+  :                  EP1A, EP1B, EP2A, EP2B,
+  :                  RA2, DEC2, PMR2, PMD2, PX2, RV2, J )
    CALL iau_PN00   ( DATE1, DATE2, DPSI, DEPS,
   :                  EPSA, RB, RP, RBP, RN, RBPN )
    CALL iau_PN00A  ( DATE1, DATE2,
@@ -632,7 +716,7 @@ CALLS: FORTRAN VERSION
    CALL iau_PN06   ( DATE1, DATE2, DPSI, DEPS,
   :                  EPSA, RB, RP, RBP, RN, RBPN )
    CALL iau_PN06A  ( DATE1, DATE2,
-                     DPSI, DEPS, RB, RP, RBP, RN, RBPN )
+  :                  DPSI, DEPS, RB, RP, RBP, RN, RBPN )
    CALL iau_PNM00A ( DATE1, DATE2, RBPN )
    CALL iau_PNM00B ( DATE1, DATE2, RBPN )
    CALL iau_PNM06A ( DATE1, DATE2, RNPB )
@@ -642,8 +726,10 @@ CALLS: FORTRAN VERSION
   :                  EPSA, CHIA, ZA, ZETAA, THETAA, PA, GAM, PHI, PSI )
    CALL iau_POM00  ( XP, YP, SP, RPOM )
    CALL iau_PR00   ( DATE1, DATE2, DPSIPR, DEPSPR )
-   CALL iau_PREC76 ( EP01, EP02, EP11, EP12, ZETA, Z, THETA )
+   CALL iau_PREC76 ( DATE01, DATE02, DATE11, DATE12, ZETA, Z, THETA )
    CALL iau_PVSTAR ( PV, RA, DEC, PMR, PMD, PX, RV, J )
+   CALL iau_PVTOB  ( ELONG, PHI, HM, XP, YP, SP, THETA, PV )
+   CALL iau_REFCO  ( PHPA, TC, RH, WL, REFA, REFB )
    D =  iau_S00    ( DATE1, DATE2, X, Y )
    D =  iau_S00A   ( DATE1, DATE2 )
    D =  iau_S00B   ( DATE1, DATE2 )
@@ -678,6 +764,44 @@ CALLS: FORTRAN VERSION
 
 CALLS: C VERSION
 
+       iauAb     ( pnat, v, s, bm1, ppr );
+       iauApcg   ( date1, date2, eb, eh, &astrom );
+       iauApcg13 ( date1, date2, &astrom );
+       iauApci   ( date1, date2, eb, eh, x, y, s, &astrom );
+       iauApci13 ( date1, date2, &astrom, &eo );
+       iauApco   ( date1, date2, eb, eh, x, y, s,
+                   theta, elong, phi, hm, xp, yp, sp,
+                   refa, refb, &astrom );
+   i = iauApco13 ( utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                   phpa, tc, rh, wl, &astrom, &eo );
+       iauApcs   ( date1, date2, pv, eb, eh, &astrom );
+       iauApcs13 ( date1, date2, pv, &astrom );
+       iauAper   ( theta, &astrom );
+       iauAper13 ( ut11, ut12, &astrom );
+       iauApio   ( sp, theta, elong, phi, hm, xp, yp, refa, refb,
+                   &astrom );
+   i = iauApio13 ( utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                   phpa, tc, rh, wl, &astrom );
+       iauAtci13 ( rc, dc, pr, pd, px, rv, date1, date2,
+                   &ri, &di, &eo );
+       iauAtciq  ( rc, dc, pr, pd, px, rv, &astrom, &ri, &di );
+       iauAtciqn ( rc, dc, pr, pd, px, rv, astrom, n, b, &ri, &di );
+       iauAtciqz ( rc, dc, &astrom, &ri, &di );
+   i = iauAtco13 ( rc, dc, pr, pd, px, rv, utc1, utc2, dut1,
+                   elong phi, hm, xp, yp, phpa, tc, rh, wl,
+                   aob, zob, hob, dob, rob, eo );
+       iauAtic13 ( ri, di, date1, date2, &rc, &dc, &eo );
+       iauAticq  ( ri, di, &astrom, &rc, &dc );
+       iauAtciqn ( ri, di, astrom, n, b, &rc, &dc );
+   i = iauAtio13 ( ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                   phpa, tc, rh, wl, aob, zob, hob, dob, rob );
+       iauAtioq  ( ri, di, &astrom, &aob, &zob, &hob, &dob, &rob );
+   i = iauAtoc13 ( type, ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &rc, &dc );
+   i = iauAtoi13 ( type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm,
+                   xp, yp, phpa, tc, rh, wl, &ri, &di  );
+       iauAtoiq  ( type, ob1, ob2, &astrom, &ri, &di );
        iauBi00   ( &dpsibi, &depsbi, &dra );
        iauBp00   ( date1, date2, rb, rp, rbp );
        iauBp06   ( date1, date2, rb, rp, rbp );
@@ -697,7 +821,6 @@ CALLS: C VERSION
        iauC2txy  ( tta, ttb, uta, utb, x, y, xp, yp, rc2t );
    i = iauCal2jd ( iy, im, id, &djm0, &djm );
    i = iauD2dtf  ( scale, ndp, d1, d2, &iy, &im, &id, ihmsf );
-
    i = iauDat    ( iy, im, id, fd, &deltat );
    d = iauDtdb   ( date1, date2, ut, elong, u, v );
    i = iauDtf2d  ( scale, iy, im, id, ihr, imn, sec, &d1, &d2 );
@@ -754,6 +877,9 @@ CALLS: C VERSION
                    &r5, &d5, &dr5, &dd5 );
    i = iauJd2cal ( dj1, dj2, &iy, &im, &id, &fd );
    i = iauJdcalf ( ndp, dj1, dj2, iymdf );
+       iauLd     ( bm, p, q, e, em, dlim, p1 );
+       iauLdn    ( n, b, ob, sc, sn );
+       iauLdsun  ( p, e, em, p1 );
        iauNum00a ( date1, date2, rmatn );
        iauNum00b ( date1, date2, rmatn );
        iauNum06a ( date1, date2, rmatn );
@@ -771,6 +897,10 @@ CALLS: C VERSION
        iauPmat00 ( date1, date2, rbp );
        iauPmat06 ( date1, date2, rbp );
        iauPmat76 ( date1, date2, rmatp );
+       iauPmpx   ( rc, dc, pr, pd, px, rv, pmt, pob, pco );
+   i = iauPmsafe ( ra1, dec1, pmr1, pmd1, px1, rv1,
+                   ep1a, ep1b, ep2a, ep2b,
+                   &ra2, &dec2, &pmr2, &pmd2, &px2, &rv2);
        iauPn00   ( date1, date2, dpsi, deps,
                    &epsa, rb, rp, rbp, rn, rbpn );
        iauPn00a  ( date1, date2,
@@ -791,8 +921,10 @@ CALLS: C VERSION
                    &gam, &phi, &psi );
        iauPom00  ( xp, yp, sp, rpom );
        iauPr00   ( date1, date2, &dpsipr, &depspr );
-       iauPrec76 ( ep01, ep02, ep11, ep12, &zeta, &z, &theta );
+       iauPrec76 ( date01, date02, date11, date12, &zeta, &z, &theta );
    i = iauPvstar ( pv, &ra, &dec, &pmr, &pmd, &px, &rv );
+       iauPvtob  ( elong, phi, hm, xp, yp, sp, theta, pv );
+       iauRefco  ( phpa, tc, rh, wl, refa, refb );
    d = iauS00    ( date1, date2, x, y );
    d = iauS00a   ( date1, date2 );
    d = iauS00b   ( date1, date2 );
@@ -824,7 +956,7 @@ CALLS: C VERSION
        iauXys00b ( date1, date2, &x, &y, &s );
        iauXys06a ( date1, date2, &x, &y, &s );
 

-sofa_vml.lis                                            2010 September 5
+sofa_vml.lis                                              2013 October 8
 
                    --------------------------
                    SOFA Vector/Matrix Library
@@ -834,9 +966,9 @@ PREFACE
 
 The routines described here comprise the SOFA vector/matrix library.
 Their general appearance and coding style conforms to conventions
-agreed by the SOFA Review Board, and their functions, names and
-algorithms have been ratified by the Board.  Procedures for
-soliciting and agreeing additions to the library are still evolving.
+agreed by the SOFA Board, and their functions, names and algorithms have
+been ratified by the Board.  Procedures for soliciting and agreeing
+additions to the library are still evolving.
 
 
 PROGRAMMING LANGUAGES
@@ -1200,67 +1332,2787 @@ void iauA2tf(int ndp, double angle, char *sign, int ihmsf[4])
 **   i a u A 2 t f
 **  - - - - - - - -
 **
-**  Decompose radians into hours, minutes, seconds, fraction.
+**  Decompose radians into hours, minutes, seconds, fraction.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**
+**  Status:  vector/matrix support function.
+**
+**  Given:
+**     ndp     int     resolution (Note 1)
+**     angle   double  angle in radians
+**
+**  Returned:
+**     sign    char    '+' or '-'
+**     ihmsf   int[4]  hours, minutes, seconds, fraction
+**
+**  Called:
+**     iauD2tf      decompose days to hms
+**
+**  Notes:
+**
+**  1) The argument ndp is interpreted as follows:
+**
+**     ndp         resolution
+**      :      ...0000 00 00
+**     -7         1000 00 00
+**     -6          100 00 00
+**     -5           10 00 00
+**     -4            1 00 00
+**     -3            0 10 00
+**     -2            0 01 00
+**     -1            0 00 10
+**      0            0 00 01
+**      1            0 00 00.1
+**      2            0 00 00.01
+**      3            0 00 00.001
+**      :            0 00 00.000...
+**
+**  2) The largest positive useful value for ndp is determined by the
+**     size of angle, the format of doubles on the target platform, and
+**     the risk of overflowing ihmsf[3].  On a typical platform, for
+**     angle up to 2pi, the available floating-point precision might
+**     correspond to ndp=12.  However, the practical limit is typically
+**     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
+**     only 16 bits.
+**
+**  3) The absolute value of angle may exceed 2pi.  In cases where it
+**     does not, it is up to the caller to test for and handle the
+**     case where angle is very nearly 2pi and rounds up to 24 hours,
+**     by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
+**
+*/
+

+
+
+void iauAb(double pnat[3], double v[3], double s, double bm1,
+           double ppr[3])
+/*
+**  - - - - - -
+**   i a u A b
+**  - - - - - -
+**
+**  Apply aberration to transform natural direction into proper
+**  direction.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**    pnat    double[3]   natural direction to the source (unit vector)
+**    v       double[3]   observer barycentric velocity in units of c
+**    s       double      distance between the Sun and the observer (au)
+**    bm1     double      sqrt(1-|v|^2): reciprocal of Lorenz factor
+**
+**  Returned:
+**    ppr     double[3]   proper direction to source (unit vector)
+**
+**  Notes:
+**
+**  1) The algorithm is based on Expr. (7.40) in the Explanatory
+**     Supplement (Urban & Seidelmann 2013), but with the following
+**     changes:
+**
+**     o  Rigorous rather than approximate normalization is applied.
+**
+**     o  The gravitational potential term from Expr. (7) in
+**        Klioner (2003) is added, taking into account only the Sun's
+**        contribution.  This has a maximum effect of about
+**        0.4 microarcsecond.
+**
+**  2) In almost all cases, the maximum accuracy will be limited by the
+**     supplied velocity.  For example, if the SOFA iauEpv00 function is
+**     used, errors of up to 5 microarcseconds could occur.
+**
+**  References:
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013).
+**
+**     Klioner, Sergei A., "A practical relativistic model for micro-
+**     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
+**
+**  Called:
+**     iauPdp       scalar product of two p-vectors
+**
+*/
+

+
+
+int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
+/*
+**  - - - - - - - -
+**   i a u A f 2 a
+**  - - - - - - - -
+**
+**  Convert degrees, arcminutes, arcseconds to radians.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     s         char    sign:  '-' = negative, otherwise positive
+**     ideg      int     degrees
+**     iamin     int     arcminutes
+**     asec      double  arcseconds
+**
+**  Returned:
+**     rad       double  angle in radians
+**
+**  Returned (function value):
+**               int     status:  0 = OK
+**                                1 = ideg outside range 0-359
+**                                2 = iamin outside range 0-59
+**                                3 = asec outside range 0-59.999...
+**
+**  Notes:
+**
+**  1)  The result is computed even if any of the range checks fail.
+**
+**  2)  Negative ideg, iamin and/or asec produce a warning status, but
+**      the absolute value is used in the conversion.
+**
+**  3)  If there are multiple errors, the status value reflects only the
+**      first, the smallest taking precedence.
+**
+*/
+

+
+
+double iauAnp(double a)
+/*
+**  - - - - - - -
+**   i a u A n p
+**  - - - - - - -
+**
+**  Normalize angle into the range 0 <= a < 2pi.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**
+**  Status:  vector/matrix support function.
+**
+**  Given:
+**     a        double     angle (radians)
+**
+**  Returned (function value):
+**              double     angle in range 0-2pi
+**
+*/
+

+
+
+double iauAnpm(double a)
+/*
+**  - - - - - - - -
+**   i a u A n p m
+**  - - - - - - - -
+**
+**  Normalize angle into the range -pi <= a < +pi.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**
+**  Status:  vector/matrix support function.
+**
+**  Given:
+**     a        double     angle (radians)
+**
+**  Returned (function value):
+**              double     angle in range +/-pi
+**
+*/
+

+
+
+void iauApcg(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p c g
+**  - - - - - - - -
+**
+**  For a geocentric observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and GCRS coordinates.
+**  The Earth ephemeris is supplied by the caller.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection and aberration parts of the astrometric
+**  transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     ebpv   double[2][3] Earth barycentric pos/vel (au, au/day)
+**     ehp    double[3]    Earth heliocentric position (au)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  4) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauApcs      astrometry parameters, ICRS-GCRS, space observer
+**
+*/
+

+
+
+void iauApcg13(double date1, double date2, iauASTROM *astrom)
+/*
+**  - - - - - - - - - -
+**   i a u A p c g 1 3
+**  - - - - - - - - - -
+**
+**  For a geocentric observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and GCRS coordinates.
+**  The caller supplies the date, and SOFA models are used to predict
+**  the Earth ephemeris.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection and aberration parts of the astrometric
+**  transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double     TDB as a 2-part...
+**     date2  double     ...Julian Date (Note 1)
+**
+**  Returned:
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) In cases where the caller wishes to supply his own Earth
+**     ephemeris, the function iauApcg can be used instead of the present
+**     function.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  5) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauEpv00     Earth position and velocity
+**     iauApcg      astrometry parameters, ICRS-GCRS, geocenter
+**
+*/
+

+
+
+void iauApci(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             double x, double y, double s,
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p c i
+**  - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and geocentric CIRS
+**  coordinates.  The Earth ephemeris and CIP/CIO are supplied by the
+**  caller.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection, aberration, and bias-precession-nutation
+**  parts of the astrometric transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     ebpv   double[2][3] Earth barycentric position/velocity (au, au/day)
+**     ehp    double[3]    Earth heliocentric position (au)
+**     x,y    double       CIP X,Y (components of unit vector)
+**     s      double       the CIO locator s (radians)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) In cases where the caller does not wish to provide the Earth
+**     ephemeris and CIP/CIO, the function iauApci13 can be used instead
+**     of the present function.  This computes the required quantities
+**     using other SOFA functions.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  5) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauApcg      astrometry parameters, ICRS-GCRS, geocenter
+**     iauC2ixys    celestial-to-intermediate matrix, given X,Y and s
+**
+*/
+

+
+
+void iauApci13(double date1, double date2,
+               iauASTROM *astrom, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A p c i 1 3
+**  - - - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and geocentric CIRS
+**  coordinates.  The caller supplies the date, and SOFA models are used
+**  to predict the Earth ephemeris and CIP/CIO.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection, aberration, and bias-precession-nutation
+**  parts of the astrometric transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double      TDB as a 2-part...
+**     date2  double      ...Julian Date (Note 1)
+**
+**  Returned:
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**     eo     double*     equation of the origins (ERA-GST)
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) In cases where the caller wishes to supply his own Earth
+**     ephemeris and CIP/CIO, the function iauApci can be used instead
+**     of the present function.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  5) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauEpv00     Earth position and velocity
+**     iauPnm06a    classical NPB matrix, IAU 2006/2000A
+**     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
+**     iauS06       the CIO locator s, given X,Y, IAU 2006
+**     iauApci      astrometry parameters, ICRS-CIRS
+**     iauEors      equation of the origins, given NPB matrix and s
+**
+*/
+

+
+
+void iauApco(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             double x, double y, double s, double theta,
+             double elong, double phi, double hm,
+             double xp, double yp, double sp,
+             double refa, double refb,
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p c o
+**  - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and observed
+**  coordinates.  The caller supplies the Earth ephemeris, the Earth
+**  rotation information and the refraction constants as well as the
+**  site coordinates.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     ebpv   double[2][3] Earth barycentric PV (au, au/day, Note 2)
+**     ehp    double[3]    Earth heliocentric P (au, Note 2)
+**     x,y    double       CIP X,Y (components of unit vector)
+**     s      double       the CIO locator s (radians)
+**     theta  double       Earth rotation angle (radians)
+**     elong  double       longitude (radians, east +ve, Note 3)
+**     phi    double       latitude (geodetic, radians, Note 3)
+**     hm     double       height above ellipsoid (m, geodetic, Note 3)
+**     xp,yp  double       polar motion coordinates (radians, Note 4)
+**     sp     double       the TIO locator s' (radians, Note 4)
+**     refa   double       refraction constant A (radians, Note 5)
+**     refb   double       refraction constant B (radians, Note 5)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) The vectors eb, eh, and all the astrom vectors, are with respect
+**     to BCRS axes.
+**
+**  3) The geographical coordinates are with respect to the WGS84
+**     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN
+**     CONVENTION:  the longitude required by the present function is
+**     right-handed, i.e. east-positive, in accordance with geographical
+**     convention.
+**
+**  4) xp and yp are the coordinates (in radians) of the Celestial
+**     Intermediate Pole with respect to the International Terrestrial
+**     Reference System (see IERS Conventions), measured along the
+**     meridians 0 and 90 deg west respectively.  sp is the TIO locator
+**     s', in radians, which positions the Terrestrial Intermediate
+**     Origin on the equator.  For many applications, xp, yp and
+**     (especially) sp can be set to zero.
+**
+**     Internally, the polar motion is stored in a form rotated onto the
+**     local meridian.
+**
+**  5) The refraction constants refa and refb are for use in a
+**     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
+**     (i.e. refracted) zenith distance and dZ is the amount of
+**     refraction.
+**
+**  6) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  7) In cases where the caller does not wish to provide the Earth
+**     Ephemeris, the Earth rotation information and refraction
+**     constants, the function iauApco13 can be used instead of the
+**     present function.  This starts from UTC and weather readings etc.
+**     and computes suitable values using other SOFA functions.
+**
+**  8) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  9) The context structure astrom produced by this function is used by
+**     iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauAper      astrometry parameters: update ERA
+**     iauC2ixys    celestial-to-intermediate matrix, given X,Y and s
+**     iauPvtob     position/velocity of terrestrial station
+**     iauTrxpv     product of transpose of r-matrix and pv-vector
+**     iauApcs      astrometry parameters, ICRS-GCRS, space observer
+**     iauCr        copy r-matrix
+**
+*/
+

+
+
+int iauApco13(double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              iauASTROM *astrom, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A p c o 1 3
+**  - - - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and observed
+**  coordinates.  The caller supplies UTC, site coordinates, ambient air
+**  conditions and observing wavelength, and SOFA models are used to
+**  obtain the Earth ephemeris, CIP/CIO and refraction constants.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection, aberration, and bias-precession-nutation
+**  parts of the ICRS/CIRS transformations.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     utc1   double     UTC as a 2-part...
+**     utc2   double     ...quasi Julian Date (Notes 1,2)
+**     dut1   double     UT1-UTC (seconds, Note 3)
+**     theta  double     Earth rotation angle (radians)
+**     elong  double     longitude (radians, east +ve, Note 4)
+**     phi    double     latitude (geodetic, radians, Note 4)
+**     hm     double     height above ellipsoid (m, geodetic, Notes 4,6)
+**     xp,yp  double     polar motion coordinates (radians, Note 5)
+**     phpa   double     pressure at the observer (hPa = mB, Note 6)
+**     tc     double     ambient temperature at the observer (deg C)
+**     rh     double     relative humidity at the observer (range 0-1)
+**     wl     double     wavelength (micrometers, Note 7)
+**
+**  Returned:
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**     eo     double*    equation of the origins (ERA-GST)
+**
+**  Returned (function value):
+**            int        status: +1 = dubious year (Note 2)
+**                                0 = OK
+**                               -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  2)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  3)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  4)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  5)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**      Internally, the polar motion is stored in a form rotated onto
+**      the local meridian.
+**
+**  6)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  7)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  8)  It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  9)  In cases where the caller wishes to supply his own Earth
+**      ephemeris, Earth rotation information and refraction constants,
+**      the function iauApco can be used instead of the present function.
+**
+**  10) This is one of several functions that inserts into the astrom
+**      structure star-independent parameters needed for the chain of
+**      astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**      The various functions support different classes of observer and
+**      portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**      Those with names ending in "13" use contemporary SOFA models to
+**      compute the various ephemerides.  The others accept ephemerides
+**      supplied by the caller.
+**
+**      The transformation from ICRS to GCRS covers space motion,
+**      parallax, light deflection, and aberration.  From GCRS to CIRS
+**      comprises frame bias and precession-nutation.  From CIRS to
+**      observed takes account of Earth rotation, polar motion, diurnal
+**      aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**      transformation), and atmospheric refraction.
+**
+**  11) The context structure astrom produced by this function is used
+**      by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauUtctai    UTC to TAI
+**     iauTaitt     TAI to TT
+**     iauUtcut1    UTC to UT1
+**     iauEpv00     Earth position and velocity
+**     iauPnm06a    classical NPB matrix, IAU 2006/2000A
+**     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
+**     iauS06       the CIO locator s, given X,Y, IAU 2006
+**     iauEra00     Earth rotation angle, IAU 2000
+**     iauSp00      the TIO locator s', IERS 2000
+**     iauRefco     refraction constants for given ambient conditions
+**     iauApco      astrometry parameters, ICRS-observed
+**     iauEors      equation of the origins, given NPB matrix and s
+**
+*/
+

+
+
+void iauApcs(double date1, double date2, double pv[2][3],
+             double ebpv[2][3], double ehp[3],
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p c s
+**  - - - - - - - -
+**
+**  For an observer whose geocentric position and velocity are known,
+**  prepare star-independent astrometry parameters for transformations
+**  between ICRS and GCRS.  The Earth ephemeris is supplied by the
+**  caller.
+**
+**  The parameters produced by this function are required in the space
+**  motion, parallax, light deflection and aberration parts of the
+**  astrometric transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     pv     double[2][3] observer's geocentric pos/vel (m, m/s)
+**     ebpv   double[2][3] Earth barycentric PV (au, au/day)
+**     ehp    double[3]    Earth heliocentric P (au)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) Providing separate arguments for (i) the observer's geocentric
+**     position and velocity and (ii) the Earth ephemeris is done for
+**     convenience in the geocentric, terrestrial and Earth orbit cases.
+**     For deep space applications it maybe more convenient to specify
+**     zero geocentric position and velocity and to supply the
+**     observer's position and velocity information directly instead of
+**     with respect to the Earth.  However, note the different units:
+**     m and m/s for the geocentric vectors, au and au/day for the
+**     heliocentric and barycentric vectors.
+**
+**  4) In cases where the caller does not wish to provide the Earth
+**     ephemeris, the function iauApcs13 can be used instead of the
+**     present function.  This computes the Earth ephemeris using the
+**     SOFA function iauEpv00.
+**
+**  5) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  6) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauCp        copy p-vector
+**     iauPm        modulus of p-vector
+**     iauPn        decompose p-vector into modulus and direction
+**     iauIr        initialize r-matrix to identity
+**
+*/
+

+
+
+void iauApcs13(double date1, double date2, double pv[2][3],
+               iauASTROM *astrom)
+/*
+**  - - - - - - - - - -
+**   i a u A p c s 1 3
+**  - - - - - - - - - -
+**
+**  For an observer whose geocentric position and velocity are known,
+**  prepare star-independent astrometry parameters for transformations
+**  between ICRS and GCRS.  The Earth ephemeris is from SOFA models.
+**
+**  The parameters produced by this function are required in the space
+**  motion, parallax, light deflection and aberration parts of the
+**  astrometric transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     pv     double[2][3] observer's geocentric pos/vel (Note 3)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) The observer's position and velocity pv are geocentric but with
+**     respect to BCRS axes, and in units of m and m/s.  No assumptions
+**     are made about proximity to the Earth, and the function can be
+**     used for deep space applications as well as Earth orbit and
+**     terrestrial.
+**
+**  4) In cases where the caller wishes to supply his own Earth
+**     ephemeris, the function iauApcs can be used instead of the present
+**     function.
+**
+**  5) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  6) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauEpv00     Earth position and velocity
+**     iauApcs      astrometry parameters, ICRS-GCRS, space observer
+**
+*/
+

+
+
+void iauAper(double theta, iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p e r
+**  - - - - - - - -
+**
+**  In the star-independent astrometry parameters, update only the
+**  Earth rotation angle, supplied by the caller explicitly.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     theta   double      Earth rotation angle (radians, Note 2)
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       not used
+**      eb     double[3]    not used
+**      eh     double[3]    not used
+**      em     double       not used
+**      v      double[3]    not used
+**      bm1    double       not used
+**      bpn    double[3][3] not used
+**      along  double       longitude + s' (radians)
+**      xpl    double       not used
+**      ypl    double       not used
+**      sphi   double       not used
+**      cphi   double       not used
+**      diurab double       not used
+**      eral   double       not used
+**      refa   double       not used
+**      refb   double       not used
+**
+**  Returned:
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) This function exists to enable sidereal-tracking applications to
+**     avoid wasteful recomputation of the bulk of the astrometry
+**     parameters:  only the Earth rotation is updated.
+**
+**  2) For targets expressed as equinox based positions, such as
+**     classical geocentric apparent (RA,Dec), the supplied theta can be
+**     Greenwich apparent sidereal time rather than Earth rotation
+**     angle.
+**
+**  3) The function iauAper13 can be used instead of the present
+**     function, and starts from UT1 rather than ERA itself.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+*/
+

+
+
+void iauAper13(double ut11, double ut12, iauASTROM *astrom)
+/*
+**  - - - - - - - - - -
+**   i a u A p e r 1 3
+**  - - - - - - - - - -
+**
+**  In the star-independent astrometry parameters, update only the
+**  Earth rotation angle.  The caller provides UT1, (n.b. not UTC).
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ut11    double      UT1 as a 2-part...
+**     ut12    double      ...Julian Date (Note 1)
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       not used
+**      eb     double[3]    not used
+**      eh     double[3]    not used
+**      em     double       not used
+**      v      double[3]    not used
+**      bm1    double       not used
+**      bpn    double[3][3] not used
+**      along  double       longitude + s' (radians)
+**      xpl    double       not used
+**      ypl    double       not used
+**      sphi   double       not used
+**      cphi   double       not used
+**      diurab double       not used
+**      eral   double       not used
+**      refa   double       not used
+**      refb   double       not used
+**
+**  Returned:
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
+**     apportioned in any convenient way between the arguments ut11 and
+**     ut12.  For example, JD(UT1)=2450123.7 could be expressed in any
+**     of these ways, among others:
+**
+**            ut11           ut12
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 and MJD methods are good compromises
+**     between resolution and convenience.  The date & time method is
+**     best matched to the algorithm used:  maximum precision is
+**     delivered when the ut11 argument is for 0hrs UT1 on the day in
+**     question and the ut12 argument lies in the range 0 to 1, or vice
+**     versa.
+**
+**  2) If the caller wishes to provide the Earth rotation angle itself,
+**     the function iauAper can be used instead.  One use of this
+**     technique is to substitute Greenwich apparent sidereal time and
+**     thereby to support equinox based transformations directly.
+**
+**  3) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  Called:
+**     iauAper      astrometry parameters: update ERA
+**     iauEra00     Earth rotation angle, IAU 2000
+**
+*/
+

+
+
+void iauApio(double sp, double theta,
+             double elong, double phi, double hm, double xp, double yp,
+             double refa, double refb,
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p i o
+**  - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between CIRS and observed
+**  coordinates.  The caller supplies the Earth orientation information
+**  and the refraction constants as well as the site coordinates.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     sp     double      the TIO locator s' (radians, Note 1)
+**     theta  double      Earth rotation angle (radians)
+**     elong  double      longitude (radians, east +ve, Note 2)
+**     phi    double      geodetic latitude (radians, Note 2)
+**     hm     double      height above ellipsoid (m, geodetic Note 2)
+**     xp,yp  double      polar motion coordinates (radians, Note 3)
+**     refa   double      refraction constant A (radians, Note 4)
+**     refb   double      refraction constant B (radians, Note 4)
+**
+**  Returned:
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Notes:
+**
+**  1) sp, the TIO locator s', is a tiny quantity needed only by the
+**     most precise applications.  It can either be set to zero or
+**     predicted using the SOFA function iauSp00.
+**
+**  2) The geographical coordinates are with respect to the WGS84
+**     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**     longitude required by the present function is east-positive
+**     (i.e. right-handed), in accordance with geographical convention.
+**
+**  3) The polar motion xp,yp can be obtained from IERS bulletins.  The
+**     values are the coordinates (in radians) of the Celestial
+**     Intermediate Pole with respect to the International Terrestrial
+**     Reference System (see IERS Conventions 2003), measured along the
+**     meridians 0 and 90 deg west respectively.  For many applications,
+**     xp and yp can be set to zero.
+**
+**     Internally, the polar motion is stored in a form rotated onto the
+**     local meridian.
+**
+**  4) The refraction constants refa and refb are for use in a
+**     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
+**     (i.e. refracted) zenith distance and dZ is the amount of
+**     refraction.
+**
+**  5) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  6) In cases where the caller does not wish to provide the Earth
+**     rotation information and refraction constants, the function
+**     iauApio13 can be used instead of the present function.  This
+**     starts from UTC and weather readings etc. and computes suitable
+**     values using other SOFA functions.
+**
+**  7) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  8) The context structure astrom produced by this function is used by
+**     iauAtioq and iauAtoiq.
+**
+**  Called:
+**     iauPvtob     position/velocity of terrestrial station
+**     iauAper      astrometry parameters: update ERA
+**
+*/
+

+
+
+int iauApio13(double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              iauASTROM *astrom)
+/*
+**  - - - - - - - - - -
+**   i a u A p i o 1 3
+**  - - - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between CIRS and observed
+**  coordinates.  The caller supplies UTC, site coordinates, ambient air
+**  conditions and observing wavelength.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     utc1   double      UTC as a 2-part...
+**     utc2   double      ...quasi Julian Date (Notes 1,2)
+**     dut1   double      UT1-UTC (seconds)
+**     elong  double      longitude (radians, east +ve, Note 3)
+**     phi    double      geodetic latitude (radians, Note 3)
+**     hm     double      height above ellipsoid (m, geodetic Notes 4,6)
+**     xp,yp  double      polar motion coordinates (radians, Note 5)
+**     phpa   double      pressure at the observer (hPa = mB, Note 6)
+**     tc     double      ambient temperature at the observer (deg C)
+**     rh     double      relative humidity at the observer (range 0-1)
+**     wl     double      wavelength (micrometers, Note 7)
+**
+**  Returned:
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned (function value):
+**            int         status: +1 = dubious year (Note 2)
+**                                 0 = OK
+**                                -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  2)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the future
+**      to be trusted.  See iauDat for further details.
+**
+**  3)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  4)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  5)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many applications,
+**      xp and yp can be set to zero.
+**
+**      Internally, the polar motion is stored in a form rotated onto
+**      the local meridian.
+**
+**  6)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to the
+**      pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  7)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  8)  It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  9)  In cases where the caller wishes to supply his own Earth
+**      rotation information and refraction constants, the function
+**      iauApc can be used instead of the present function.
+**
+**  10) This is one of several functions that inserts into the astrom
+**      structure star-independent parameters needed for the chain of
+**      astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**      The various functions support different classes of observer and
+**      portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**      Those with names ending in "13" use contemporary SOFA models to
+**      compute the various ephemerides.  The others accept ephemerides
+**      supplied by the caller.
+**
+**      The transformation from ICRS to GCRS covers space motion,
+**      parallax, light deflection, and aberration.  From GCRS to CIRS
+**      comprises frame bias and precession-nutation.  From CIRS to
+**      observed takes account of Earth rotation, polar motion, diurnal
+**      aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**      transformation), and atmospheric refraction.
+**
+**  11) The context structure astrom produced by this function is used
+**      by iauAtioq and iauAtoiq.
+**
+**  Called:
+**     iauUtctai    UTC to TAI
+**     iauTaitt     TAI to TT
+**     iauUtcut1    UTC to UT1
+**     iauSp00      the TIO locator s', IERS 2000
+**     iauEra00     Earth rotation angle, IAU 2000
+**     iauRefco     refraction constants for given ambient conditions
+**     iauApio      astrometry parameters, CIRS-observed
+**
+*/
+

+
+
+void iauAtci13(double rc, double dc,
+               double pr, double pd, double px, double rv,
+               double date1, double date2,
+               double *ri, double *di, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A t c i 1 3
+**  - - - - - - - - - -
+**
+**  Transform ICRS star data, epoch J2000.0, to CIRS.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc     double   ICRS right ascension at J2000.0 (radians, Note 1)
+**     dc     double   ICRS declination at J2000.0 (radians, Note 1)
+**     pr     double   RA proper motion (radians/year; Note 2)
+**     pd     double   Dec proper motion (radians/year)
+**     px     double   parallax (arcsec)
+**     rv     double   radial velocity (km/s, +ve if receding)
+**     date1  double   TDB as a 2-part...
+**     date2  double   ...Julian Date (Note 3)
+**
+**  Returned:
+**     ri,di  double*  CIRS geocentric RA,Dec (radians)
+**     eo     double*  equation of the origins (ERA-GST, Note 5)
+**
+**  Notes:
+**
+**  1) Star data for an epoch other than J2000.0 (for example from the
+**     Hipparcos catalog, which has an epoch of J1991.25) will require a
+**     preliminary call to iauPmsafe before use.
+**
+**  2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  3) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.8g could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.8g           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  4) The available accuracy is better than 1 milliarcsecond, limited
+**     mainly by the precession-nutation model that is used, namely
+**     IAU 2000A/2006.  Very close to solar system bodies, additional
+**     errors of up to several milliarcseconds can occur because of
+**     unmodeled light deflection;  however, the Sun's contribution is
+**     taken into account, to first order.  The accuracy limitations of
+**     the SOFA function iauEpv00 (used to compute Earth position and
+**     velocity) can contribute aberration errors of up to
+**     5 microarcseconds.  Light deflection at the Sun's limb is
+**     uncertain at the 0.4 mas level.
+**
+**  5) Should the transformation to (equinox based) apparent place be
+**     required rather than (CIO based) intermediate place, subtract the
+**     equation of the origins from the returned right ascension:
+**     RA = RI - EO. (The iauAnp function can then be applied, as
+**     required, to keep the result in the conventional 0-2pi range.)
+**
+**  Called:
+**     iauApci13    astrometry parameters, ICRS-CIRS, 2013
+**     iauAtciq     quick ICRS to CIRS
+**
+*/
+

+
+
+void iauAtciq(double rc, double dc,
+              double pr, double pd, double px, double rv,
+              iauASTROM *astrom, double *ri, double *di)
+/*
+**  - - - - - - - - -
+**   i a u A t c i q
+**  - - - - - - - - -
+**
+**  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
+**  star-independent astrometry parameters.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are to be transformed for one date.  The
+**  star-independent parameters can be obtained by calling one of the
+**  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
+**
+**  If the parallax and proper motions are zero the iauAtciqz function
+**  can be used instead.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double     ICRS RA,Dec at J2000.0 (radians)
+**     pr     double     RA proper motion (radians/year; Note 3)
+**     pd     double     Dec proper motion (radians/year)
+**     px     double     parallax (arcsec)
+**     rv     double     radial velocity (km/s, +ve if receding)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned:
+**     ri,di   double    CIRS RA,Dec (radians)
+**
+**  Notes:
+**
+**  1) All the vectors are with respect to BCRS axes.
+**
+**  2) Star data for an epoch other than J2000.0 (for example from the
+**     Hipparcos catalog, which has an epoch of J1991.25) will require a
+**     preliminary call to iauPmsafe before use.
+**
+**  3) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  Called:
+**     iauPmpx      proper motion and parallax
+**     iauLdsun     light deflection by the Sun
+**     iauAb        stellar aberration
+**     iauRxp       product of r-matrix and pv-vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
+**
+*/
+

+
+
+void iauAtciqn(double rc, double dc, double pr, double pd,
+               double px, double rv, iauASTROM *astrom,
+               int n, iauLDBODY b[], double *ri, double *di)
+/*
+**  - - - - - - - - - -
+**   i a u A t c i q n
+**  - - - - - - - - - -
+**
+**  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
+**  star-independent astrometry parameters plus a list of light-
+**  deflecting bodies.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are to be transformed for one date.  The
+**  star-independent parameters can be obtained by calling one of the
+**  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
+**
+**
+**  If the only light-deflecting body to be taken into account is the
+**  Sun, the iauAtciq function can be used instead.  If in addition the
+**  parallax and proper motions are zero, the iauAtciqz function can be
+**  used.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double       ICRS RA,Dec at J2000.0 (radians)
+**     pr     double       RA proper motion (radians/year; Note 3)
+**     pd     double       Dec proper motion (radians/year)
+**     px     double       parallax (arcsec)
+**     rv     double       radial velocity (km/s, +ve if receding)
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**      n     int           number of bodies (Note 3)
+**      b     iauLDBODY[n] data for each of the n bodies (Notes 3,4):
+**       bm    double        mass of the body (solar masses, Note 5)
+**       dl    double        deflection limiter (Note 6)
+**       pv    [2][3]        barycentric PV of the body (au, au/day)
+**
+**  Returned:
+**     ri,di   double    CIRS RA,Dec (radians)
+**
+**  Notes:
+**
+**  1) Star data for an epoch other than J2000.0 (for example from the
+**     Hipparcos catalog, which has an epoch of J1991.25) will require a
+**     preliminary call to iauPmsafe before use.
+**
+**  2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  3) The struct b contains n entries, one for each body to be
+**     considered.  If n = 0, no gravitational light deflection will be
+**     applied, not even for the Sun.
+**
+**  4) The struct b should include an entry for the Sun as well as for
+**     any planet or other body to be taken into account.  The entries
+**     should be in the order in which the light passes the body.
+**
+**  5) In the entry in the b struct for body i, the mass parameter
+**     b[i].bm can, as required, be adjusted in order to allow for such
+**     effects as quadrupole field.
+**
+**  6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
+**     the angular separation (in radians) between star and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.   Example values suitable for a terrestrial
+**     observer, together with masses, are as follows:
+**
+**        body i     b[i].bm        b[i].dl
+**
+**        Sun        1.0            6e-6
+**        Jupiter    0.00095435     3e-9
+**        Saturn     0.00028574     3e-10
+**
+**  7) For efficiency, validation of the contents of the b array is
+**     omitted.  The supplied masses must be greater than zero, the
+**     position and velocity vectors must be right, and the deflection
+**     limiter greater than zero.
+**
+**  Called:
+**     iauPmpx      proper motion and parallax
+**     iauLdn       light deflection by n bodies
+**     iauAb        stellar aberration
+**     iauRxp       product of r-matrix and pv-vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
+**
+*/
+

+
+
+void iauAtciqz(double rc, double dc, iauASTROM *astrom,
+               double *ri, double *di)
+/*
+**  - - - - - - - - - -
+**   i a u A t c i q z
+**  - - - - - - - - - -
+**
+**  Quick ICRS to CIRS transformation, given precomputed star-
+**  independent astrometry parameters, and assuming zero parallax and
+**  proper motion.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are to be transformed for one date.  The
+**  star-independent parameters can be obtained by calling one of the
+**  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
+**
+**  The corresponding function for the case of non-zero parallax and
+**  proper motion is iauAtciq.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double     ICRS astrometric RA,Dec (radians)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned:
+**     ri,di  double     CIRS RA,Dec (radians)
+**
+**  Note:
+**
+**     All the vectors are with respect to BCRS axes.
+**
+**  References:
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013).
+**
+**     Klioner, Sergei A., "A practical relativistic model for micro-
+**     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauLdsun     light deflection due to Sun
+**     iauAb        stellar aberration
+**     iauRxp       product of r-matrix and p-vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range +/- pi
+**
+*/
+

+
+
+int iauAtco13(double rc, double dc,
+              double pr, double pd, double px, double rv,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *aob, double *zob, double *hob,
+              double *dob, double *rob, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A t c o 1 3
+**  - - - - - - - - - -
+**
+**  ICRS RA,Dec to observed place.  The caller supplies UTC, site
+**  coordinates, ambient air conditions and observing wavelength.
+**
+**  SOFA models are used for the Earth ephemeris, bias-precession-
+**  nutation, Earth orientation and refraction.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double   ICRS right ascension at J2000.0 (radians, Note 1)
+**     pr     double   RA proper motion (radians/year; Note 2)
+**     pd     double   Dec proper motion (radians/year)
+**     px     double   parallax (arcsec)
+**     rv     double   radial velocity (km/s, +ve if receding)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 3-4)
+**     dut1   double   UT1-UTC (seconds, Note 5)
+**     elong  double   longitude (radians, east +ve, Note 6)
+**     phi    double   latitude (geodetic, radians, Note 6)
+**     hm     double   height above ellipsoid (m, geodetic, Notes 6,8)
+**     xp,yp  double   polar motion coordinates (radians, Note 7)
+**     phpa   double   pressure at the observer (hPa = mB, Note 8)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 9)
+**
+**  Returned:
+**     aob    double*  observed azimuth (radians: N=0,E=90)
+**     zob    double*  observed zenith distance (radians)
+**     hob    double*  observed hour angle (radians)
+**     dob    double*  observed declination (radians)
+**     rob    double*  observed right ascension (CIO-based, radians)
+**     eo     double*  equation of the origins (ERA-GST)
+**
+**  Returned (function value):
+**            int      status: +1 = dubious year (Note 4)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  Star data for an epoch other than J2000.0 (for example from the
+**      Hipparcos catalog, which has an epoch of J1991.25) will require
+**      a preliminary call to iauPmsafe before use.
+**
+**  2)  The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  3)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  4)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  5)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  6)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  7)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  8)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB),
+**      is available, an adequate estimate of hm can be obtained from
+**      the expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  9)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  10) The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted observed
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**      Without refraction, the complementary functions iauAtco13 and
+**      iauAtoc13 are self-consistent to better than 1 microarcsecond
+**      all over the celestial sphere.  With refraction included,
+**      consistency falls off at high zenith distances, but is still
+**      better than 0.05 arcsec at 85 degrees.
+**
+**  11) "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  12) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApco13    astrometry parameters, ICRS-observed, 2013
+**     iauAtciq     quick ICRS to CIRS
+**     iauAtioq     quick ICRS to observed
+**
+*/
+

+
+
+void iauAtic13(double ri, double di, double date1, double date2,
+               double *rc, double *dc, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A t i c 1 3
+**  - - - - - - - - - -
+**
+**  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri,di  double  CIRS geocentric RA,Dec (radians)
+**     date1  double  TDB as a 2-part...
+**     date2  double  ...Julian Date (Note 1)
+**
+**  Returned:
+**     rc,dc  double  ICRS astrometric RA,Dec (radians)
+**     eo     double  equation of the origins (ERA-GST, Note 4)
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) Iterative techniques are used for the aberration and light
+**     deflection corrections so that the functions iauAtic13 (or
+**     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
+**     even at the edge of the Sun's disk the discrepancy is only about
+**     1 nanoarcsecond.
+**
+**  3) The available accuracy is better than 1 milliarcsecond, limited
+**     mainly by the precession-nutation model that is used, namely
+**     IAU 2000A/2006.  Very close to solar system bodies, additional
+**     errors of up to several milliarcseconds can occur because of
+**     unmodeled light deflection;  however, the Sun's contribution is
+**     taken into account, to first order.  The accuracy limitations of
+**     the SOFA function iauEpv00 (used to compute Earth position and
+**     velocity) can contribute aberration errors of up to
+**     5 microarcseconds.  Light deflection at the Sun's limb is
+**     uncertain at the 0.4 mas level.
+**
+**  4) Should the transformation to (equinox based) J2000.0 mean place
+**     be required rather than (CIO based) ICRS coordinates, subtract the
+**     equation of the origins from the returned right ascension:
+**     RA = RI - EO.  (The iauAnp function can then be applied, as
+**     required, to keep the result in the conventional 0-2pi range.)
+**
+**  Called:
+**     iauApci13    astrometry parameters, ICRS-CIRS, 2013
+**     iauAticq     quick CIRS to ICRS astrometric
+**
+*/
+

+
+
+void iauAticq(double ri, double di, iauASTROM *astrom,
+              double *rc, double *dc)
+/*
+**  - - - - - - - - -
+**   i a u A t i c q
+**  - - - - - - - - -
+**
+**  Quick CIRS RA,Dec to ICRS astrometric place, given the star-
+**  independent astrometry parameters.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
+**  or iauApcs[13].
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri,di  double     CIRS RA,Dec (radians)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned:
+**     rc,dc  double     ICRS astrometric RA,Dec (radians)
+**
+**  Notes:
+**
+**  1) Only the Sun is taken into account in the light deflection
+**     correction.
+**
+**  2) Iterative techniques are used for the aberration and light
+**     deflection corrections so that the functions iauAtic13 (or
+**     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
+**     even at the edge of the Sun's disk the discrepancy is only about
+**     1 nanoarcsecond.
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauTrxp      product of transpose of r-matrix and p-vector
+**     iauZp        zero p-vector
+**     iauAb        stellar aberration
+**     iauLdsun     light deflection by the Sun
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range +/- pi
+**
+*/
+

+
+
+void iauAticqn(double ri, double di, iauASTROM *astrom,
+               int n, iauLDBODY b[], double *rc, double *dc)
+/*
+**  - - - - - - - - -
+**   i a u A t i c q n
+**  - - - - - - - - -
+**
+**  Quick CIRS to ICRS astrometric place transformation, given the star-
+**  independent astrometry parameters plus a list of light-deflecting
+**  bodies.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
+**  or iauApcs[13].
+*
+*  If the only light-deflecting body to be taken into account is the
+*  Sun, the iauAticq function can be used instead.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri,di  double      CIRS RA,Dec (radians)
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**      n     int           number of bodies (Note 3)
+**      b     iauLDBODY[n] data for each of the n bodies (Notes 3,4):
+**       bm    double       mass of the body (solar masses, Note 5)
+**       dl    double       deflection limiter (Note 6)
+**       pv    [2][3]       barycentric PV of the body (au, au/day)
+**
+**  Returned:
+**     rc,dc  double     ICRS astrometric RA,Dec (radians)
+**
+**  Notes:
+**
+**  1) Iterative techniques are used for the aberration and light
+**     deflection corrections so that the functions iauAticqn and
+**     iauAtciqn are accurate inverses; even at the edge of the Sun's
+**     disk the discrepancy is only about 1 nanoarcsecond.
+**
+**  2) If the only light-deflecting body to be taken into account is the
+**     Sun, the iauAticq function can be used instead.
+**
+**  3) The struct b contains n entries, one for each body to be
+**     considered.  If n = 0, no gravitational light deflection will be
+**     applied, not even for the Sun.
+**
+**  4) The struct b should include an entry for the Sun as well as for
+**     any planet or other body to be taken into account.  The entries
+**     should be in the order in which the light passes the body.
+**
+**  5) In the entry in the b struct for body i, the mass parameter
+**     b[i].bm can, as required, be adjusted in order to allow for such
+**     effects as quadrupole field.
+**
+**  6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
+**     the angular separation (in radians) between star and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.   Example values suitable for a terrestrial
+**     observer, together with masses, are as follows:
+**
+**        body i     b[i].bm        b[i].dl
+**
+**        Sun        1.0            6e-6
+**        Jupiter    0.00095435     3e-9
+**        Saturn     0.00028574     3e-10
+**
+**  7) For efficiency, validation of the contents of the b array is
+**     omitted.  The supplied masses must be greater than zero, the
+**     position and velocity vectors must be right, and the deflection
+**     limiter greater than zero.
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauTrxp      product of transpose of r-matrix and p-vector
+**     iauZp        zero p-vector
+**     iauAb        stellar aberration
+**     iauLdn       light deflection by n bodies
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range +/- pi
+**
+*/
+

+
+
+int iauAtio13(double ri, double di,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *aob, double *zob, double *hob,
+              double *dob, double *rob)
+/*
+**  - - - - - - - - - -
+**   i a u A t i o 1 3
+**  - - - - - - - - - -
+**
+**  CIRS RA,Dec to observed place.  The caller supplies UTC, site
+**  coordinates, ambient air conditions and observing wavelength.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri     double   CIRS right ascension (CIO-based, radians)
+**     di     double   CIRS declination (radians)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 1,2)
+**     dut1   double   UT1-UTC (seconds, Note 3)
+**     elong  double   longitude (radians, east +ve, Note 4)
+**     phi    double   geodetic latitude (radians, Note 4)
+**     hm     double   height above ellipsoid (m, geodetic Notes 4,6)
+**     xp,yp  double   polar motion coordinates (radians, Note 5)
+**     phpa   double   pressure at the observer (hPa = mB, Note 6)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 7)
+**
+**  Returned:
+**     aob    double*  observed azimuth (radians: N=0,E=90)
+**     zob    double*  observed zenith distance (radians)
+**     hob    double*  observed hour angle (radians)
+**     dob    double*  observed declination (radians)
+**     rob    double*  observed right ascension (CIO-based, radians)
+**
+**  Returned (function value):
+**            int      status: +1 = dubious year (Note 2)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  2)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  3)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  4)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  5)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  6)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  7)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  8)  "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  9)  The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted astrometric
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**  10) The complementary functions iauAtio13 and iauAtoi13 are self-
+**      consistent to better than 1 microarcsecond all over the
+**      celestial sphere.
+**
+**  11) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApio13    astrometry parameters, CIRS-observed, 2013
+**     iauAtioq     quick ICRS to observed
+**
+*/
+

+
+
+void iauAtioq(double ri, double di, iauASTROM *astrom,
+              double *aob, double *zob,
+              double *hob, double *dob, double *rob)
+/*
+**  - - - - - - - - -
+**   i a u A t i o q
+**  - - - - - - - - -
+**
+**  Quick CIRS to observed place transformation.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling iauApio[13] or iauApco[13].
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  vector/matrix support function.
+**  Status:  support function.
 **
 **  Given:
-**     ndp     int     resolution (Note 1)
-**     angle   double  angle in radians
+**     ri     double     CIRS right ascension
+**     di     double     CIRS declination
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
 **
 **  Returned:
-**     sign    char    '+' or '-'
-**     ihmsf   int[4]  hours, minutes, seconds, fraction
+**     aob    double     observed azimuth (radians: N=0,E=90)
+**     zob    double     observed zenith distance (radians)
+**     hob    double     observed hour angle (radians)
+**     dob    double     observed right ascension (CIO-based, radians)
+**
+**  Notes:
+**
+**  1) This function returns zenith distance rather than altitude in
+**     order to reflect the fact that no allowance is made for
+**     depression of the horizon.
+**
+**  2) The accuracy of the result is limited by the corrections for
+**     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**     Providing the meteorological parameters are known accurately and
+**     there are no gross local effects, the predicted observed
+**     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**     (radio) for a zenith distance of less than 70 degrees, better
+**     than 30 arcsec (optical or radio) at 85 degrees and better
+**     than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**     Without refraction, the complementary functions iauAtioq and
+**     iauAtoiq are self-consistent to better than 1 microarcsecond all
+**     over the celestial sphere.  With refraction included, consistency
+**     falls off at high zenith distances, but is still better than
+**     0.05 arcsec at 85 degrees.
+**
+**  3) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  4) The CIRS RA,Dec is obtained from a star catalog mean place by
+**     allowing for space motion, parallax, the Sun's gravitational lens
+**     effect, annual aberration and precession-nutation.  For star
+**     positions in the ICRS, these effects can be applied by means of
+**     the iauAtci13 (etc.) functions.  Starting from classical "mean
+**     place" systems, additional transformations will be needed first.
+**
+**  5) "Observed" Az,El means the position that would be seen by a
+**     perfect geodetically aligned theodolite.  This is obtained from
+**     the CIRS RA,Dec by allowing for Earth orientation and diurnal
+**     aberration, rotating from equator to horizon coordinates, and
+**     then adjusting for refraction.  The HA,Dec is obtained by
+**     rotating back into equatorial coordinates, and is the position
+**     that would be seen by a perfect equatorial with its polar axis
+**     aligned to the Earth's axis of rotation.  Finally, the RA is
+**     obtained by subtracting the HA from the local ERA.
+**
+**  6) The star-independent CIRS-to-observed-place parameters in ASTROM
+**     may be computed with iauApio[13] or iauApco[13].  If nothing has
+**     changed significantly except the time, iauAper[13] may be used to
+**     perform the requisite adjustment to the astrom structure.
 **
 **  Called:
-**     iauD2tf      decompose days to hms
-**
-**  Notes:
-**
-**  1) The argument ndp is interpreted as follows:
-**
-**     ndp         resolution
-**      :      ...0000 00 00
-**     -7         1000 00 00
-**     -6          100 00 00
-**     -5           10 00 00
-**     -4            1 00 00
-**     -3            0 10 00
-**     -2            0 01 00
-**     -1            0 00 10
-**      0            0 00 01
-**      1            0 00 00.1
-**      2            0 00 00.01
-**      3            0 00 00.001
-**      :            0 00 00.000...
-**
-**  2) The largest positive useful value for ndp is determined by the
-**     size of angle, the format of doubles on the target platform, and
-**     the risk of overflowing ihmsf[3].  On a typical platform, for
-**     angle up to 2pi, the available floating-point precision might
-**     correspond to ndp=12.  However, the practical limit is typically
-**     ndp=9, set by the capacity of a 32-bit int, or ndp=4 if int is
-**     only 16 bits.
-**
-**  3) The absolute value of angle may exceed 2pi.  In cases where it
-**     does not, it is up to the caller to test for and handle the
-**     case where angle is very nearly 2pi and rounds up to 24 hours,
-**     by testing for ihmsf[0]=24 and setting ihmsf(0-3) to zero.
+**     iauS2c       spherical coordinates to unit vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
 **
 */
 

 
 
-int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
+int iauAtoc13(const char *type, double ob1, double ob2,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *rc, double *dc)
 /*
-**  - - - - - - - -
-**   i a u A f 2 a
-**  - - - - - - - -
+**  - - - - - - - - - -
+**   i a u A t o c 1 3
+**  - - - - - - - - - -
 **
-**  Convert degrees, arcminutes, arcseconds to radians.
+**  Observed place at a groundbased site to to ICRS astrometric RA,Dec.
+**  The caller supplies UTC, site coordinates, ambient air conditions
+**  and observing wavelength.
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards of Fundamental Astronomy) software collection.
@@ -1268,75 +4120,374 @@ int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
 **  Status:  support function.
 **
 **  Given:
-**     s         char    sign:  '-' = negative, otherwise positive
-**     ideg      int     degrees
-**     iamin     int     arcminutes
-**     asec      double  arcseconds
+**     type   char[]   type of coordinates - "R", "H" or "A" (Notes 1,2)
+**     ob1    double   observed Az, HA or RA (radians; Az is N=0,E=90)
+**     ob2    double   observed ZD or Dec (radians)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 3,4)
+**     dut1   double   UT1-UTC (seconds, Note 5)
+**     elong  double   longitude (radians, east +ve, Note 6)
+**     phi    double   geodetic latitude (radians, Note 6)
+**     hm     double   height above ellipsoid (m, geodetic Notes 6,8)
+**     xp,yp  double   polar motion coordinates (radians, Note 7)
+**     phpa   double   pressure at the observer (hPa = mB, Note 8)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 9)
 **
 **  Returned:
-**     rad       double  angle in radians
+**     rc,dc  double   ICRS astrometric RA,Dec (radians)
 **
 **  Returned (function value):
-**               int     status:  0 = OK
-**                                1 = ideg outside range 0-359
-**                                2 = iamin outside range 0-59
-**                                3 = asec outside range 0-59.999...
-**
-**  Notes:
-**
-**  1)  The result is computed even if any of the range checks fail.
-**
-**  2)  Negative ideg, iamin and/or asec produce a warning status, but
-**      the absolute value is used in the conversion.
+**            int      status: +1 = dubious year (Note 4)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  2)  Only the first character of the type argument is significant.
+**      "R" or "r" indicates that ob1 and ob2 are the observed right
+**      ascension and declination;  "H" or "h" indicates that they are
+**      hour angle (west +ve) and declination;  anything else ("A" or
+**      "a" is recommended) indicates that ob1 and ob2 are azimuth
+**      (north zero, east 90 deg) and zenith distance.
+**
+**  3)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  4)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  5)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  6)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  7)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  8)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  9)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  10) The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted astrometric
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**      Without refraction, the complementary functions iauAtco13 and
+**      iauAtoc13 are self-consistent to better than 1 microarcsecond
+**      all over the celestial sphere.  With refraction included,
+**      consistency falls off at high zenith distances, but is still
+**      better than 0.05 arcsec at 85 degrees.
+**
+**  11) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
 **
-**  3)  If there are multiple errors, the status value reflects only the
-**      first, the smallest taking precedence.
+**  Called:
+**     iauApco13    astrometry parameters, ICRS-observed
+**     iauAtoiq     quick observed to CIRS
+**     iauAticq     quick CIRS to ICRS
 **
 */
 

 
 
-double iauAnp(double a)
+int iauAtoi13(const char *type, double ob1, double ob2,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *ri, double *di)
 /*
-**  - - - - - - -
-**   i a u A n p
-**  - - - - - - -
+**  - - - - - - - - - -
+**   i a u A t o i 1 3
+**  - - - - - - - - - -
 **
-**  Normalize angle into the range 0 <= a < 2pi.
+**  Observed place to CIRS.  The caller supplies UTC, site coordinates,
+**  ambient air conditions and observing wavelength.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  vector/matrix support function.
+**  Status:  support function.
 **
 **  Given:
-**     a        double     angle (radians)
+**     type   char[]   type of coordinates - "R", "H" or "A" (Notes 1,2)
+**     ob1    double   observed Az, HA or RA (radians; Az is N=0,E=90)
+**     ob2    double   observed ZD or Dec (radians)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 3,4)
+**     dut1   double   UT1-UTC (seconds, Note 5)
+**     elong  double   longitude (radians, east +ve, Note 6)
+**     phi    double   geodetic latitude (radians, Note 6)
+**     hm     double   height above the ellipsoid (meters, Notes 6,8)
+**     xp,yp  double   polar motion coordinates (radians, Note 7)
+**     phpa   double   pressure at the observer (hPa = mB, Note 8)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 9)
+**
+**  Returned:
+**     ri     double*  CIRS right ascension (CIO-based, radians)
+**     di     double*  CIRS declination (radians)
 **
 **  Returned (function value):
-**              double     angle in range 0-2pi
+**            int      status: +1 = dubious year (Note 2)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  2)  Only the first character of the type argument is significant.
+**      "R" or "r" indicates that ob1 and ob2 are the observed right
+**      ascension and declination;  "H" or "h" indicates that they are
+**      hour angle (west +ve) and declination;  anything else ("A" or
+**      "a" is recommended) indicates that ob1 and ob2 are azimuth
+**      (north zero, east 90 deg) and zenith distance.
+**
+**  3)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  4)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  5)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  6)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  7)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  8)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  9)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  10) The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted astrometric
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**      Without refraction, the complementary functions iauAtio13 and
+**      iauAtoi13 are self-consistent to better than 1 microarcsecond
+**      all over the celestial sphere.  With refraction included,
+**      consistency falls off at high zenith distances, but is still
+**      better than 0.05 arcsec at 85 degrees.
+**
+**  12) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApio13    astrometry parameters, CIRS-observed, 2013
+**     iauAtoiq     quick observed to CIRS
 **
 */
 

 
 
-double iauAnpm(double a)
+void iauAtoiq(const char *type,
+              double ob1, double ob2, iauASTROM *astrom,
+              double *ri, double *di)
 /*
-**  - - - - - - - -
-**   i a u A n p m
-**  - - - - - - - -
+**  - - - - - - - - -
+**   i a u A t o i q
+**  - - - - - - - - -
 **
-**  Normalize angle into the range -pi <= a < +pi.
+**  Quick observed place to CIRS, given the star-independent astrometry
+**  parameters.
 **
-**  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling iauApio[13] or iauApco[13].
 **
-**  Status:  vector/matrix support function.
+**  Status:  support function.
 **
 **  Given:
-**     a        double     angle (radians)
+**     type   char[]     type of coordinates: "R", "H" or "A" (Note 1)
+**     ob1    double     observed Az, HA or RA (radians; Az is N=0,E=90)
+**     ob2    double     observed ZD or Dec (radians)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
 **
-**  Returned (function value):
-**              double     angle in range +/-pi
+**  Returned:
+**     ri     double*    CIRS right ascension (CIO-based, radians)
+**     di     double*    CIRS declination (radians)
+**
+**  Notes:
+**
+**  1) "Observed" Az,El means the position that would be seen by a
+**     perfect geodetically aligned theodolite.  This is related to
+**     the observed HA,Dec via the standard rotation, using the geodetic
+**     latitude (corrected for polar motion), while the observed HA and
+**     RA are related simply through the Earth rotation angle and the
+**     site longitude.  "Observed" RA,Dec or HA,Dec thus means the
+**     position that would be seen by a perfect equatorial with its
+**     polar axis aligned to the Earth's axis of rotation.  By removing
+**     from the observed place the effects of atmospheric refraction and
+**     diurnal aberration, the CIRS RA,Dec is obtained.
+**
+**  2) Only the first character of the type argument is significant.
+**     "R" or "r" indicates that ob1 and ob2 are the observed right
+**     ascension and declination;  "H" or "h" indicates that they are
+**     hour angle (west +ve) and declination;  anything else ("A" or
+**     "a" is recommended) indicates that ob1 and ob2 are azimuth (north
+**     zero, east 90 deg) and zenith distance.  (Zenith distance is used
+**     rather than altitude in order to reflect the fact that no
+**     allowance is made for depression of the horizon.)
+**
+**  3) The accuracy of the result is limited by the corrections for
+**     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**     Providing the meteorological parameters are known accurately and
+**     there are no gross local effects, the predicted observed
+**     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**     (radio) for a zenith distance of less than 70 degrees, better
+**     than 30 arcsec (optical or radio) at 85 degrees and better than
+**     20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**     Without refraction, the complementary functions iauAtioq and
+**     iauAtoiq are self-consistent to better than 1 microarcsecond all
+**     over the celestial sphere.  With refraction included, consistency
+**     falls off at high zenith distances, but is still better than
+**     0.05 arcsec at 85 degrees.
+**
+**  4) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
 **
 */
 

@@ -1523,12 +4674,16 @@ void iauBp06(double date1, double date2,
 **  4) The matrix rbp transforms vectors from GCRS to mean of date by
 **     applying frame bias then precession.  It is the product rp x rb.
 **
+**  5) It is permissible to re-use the same array in the returned
+**     arguments.  The arrays are filled in the order given.
+**
 **  Called:
 **     iauPfw06     bias-precession F-W angles, IAU 2006
 **     iauFw2m      F-W angles to r-matrix
 **     iauPmat06    PB matrix, IAU 2006
 **     iauTr        transpose r-matrix
 **     iauRxr       product of two r-matrices
+**     iauCr        copy r-matrix
 **
 **  References:
 **
@@ -1740,7 +4895,7 @@ void iauC2i00b(double date1, double date2, double rc2i[3][3])
 void iauC2i06a(double date1, double date2, double rc2i[3][3])
 /*
 **  - - - - - - - - - -
-**   i a u _ c 2 i 0 6 a
+**   i a u C 2 i 0 6 a
 **  - - - - - - - - - -
 **
 **  Form the celestial-to-intermediate matrix for a given date using the
@@ -1793,8 +4948,8 @@ void iauC2i06a(double date1, double date2, double rc2i[3][3])
 **  Called:
 **     iauPnm06a    classical NPB matrix, IAU 2006/2000A
 **     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
-**     iauS06       the CIO locator s, Given X,Y, IAU 2006
-**     iauC2ixys    celestial-to-intermediate matrix, Given X,Y and s
+**     iauS06       the CIO locator s, given X,Y, IAU 2006
+**     iauC2ixys    celestial-to-intermediate matrix, given X,Y and s
 **
 **  References:
 **
@@ -2311,7 +5466,7 @@ void iauC2tcio(double rc2i[3][3], double era, double rpom[3][3],
 **
 **  Given:
 **     rc2i     double[3][3]    celestial-to-intermediate matrix
-**     era      double          Earth rotation angle
+**     era      double          Earth rotation angle (radians)
 **     rpom     double[3][3]    polar-motion matrix
 **
 **  Returned:
@@ -2371,12 +5526,12 @@ void iauC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
 **  Status:  support function.
 **
 **  Given:
-**     rbpn     double[3][3]    celestial-to-true matrix
-**     gst      double          Greenwich (apparent) Sidereal Time
-**     rpom     double[3][3]    polar-motion matrix
+**     rbpn   double[3][3]  celestial-to-true matrix
+**     gst    double        Greenwich (apparent) Sidereal Time (radians)
+**     rpom   double[3][3]  polar-motion matrix
 **
 **  Returned:
-**     rc2t     double[3][3]    celestial-to-terrestrial matrix (Note 2)
+**     rc2t   double[3][3]  celestial-to-terrestrial matrix (Note 2)
 **
 **  Notes:
 **
@@ -2781,10 +5936,13 @@ int iauD2dtf(const char *scale, int ndp, double d1, double d2,
 **  4) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The SOFA internal convention is that
 **     the quasi-JD day represents UTC days whether the length is 86399,
-**     86400 or 86401 SI seconds.
+**     86400 or 86401 SI seconds.  In the 1960-1972 era there were
+**     smaller jumps (in either direction) each time the linear UTC(TAI)
+**     expression was changed, and these "mini-leaps" are also included
+**     in the SOFA convention.
 **
 **  5) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  6) For calendar conventions and limitations, see iauCal2jd.
@@ -2876,8 +6034,8 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **     :     of statements that initialize the    :
 **     :     array "changes".                     :
 **     :                                          :
-**     :  2) The parameter IYV must be set to     :
-**     :     the current year.                    :
+**     :  2) The constant IYV must be set to the  :
+**     :     current year.                        :
 **     :                                          :
 **     :  3) The "Latest leap second" comment     :
 **     :     below must be set to the new leap    :
@@ -2927,13 +6085,13 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **     Because leap seconds cannot, in principle, be predicted in
 **     advance, a reliable check for dates beyond the valid range is
 **     impossible.  To guard against gross errors, a year five or more
-**     after the release year of the present function (see parameter
+**     after the release year of the present function (see the constant
 **     IYV) is considered dubious.  In this case a warning status is
 **     returned but the result is computed in the normal way.
 **
-**     For both too-early and too-late years, the warning status is
-**     j=+1.  This is distinct from the error status j=-1, which
-**     signifies a year so early that JD could not be computed.
+**     For both too-early and too-late years, the warning status is +1.
+**     This is distinct from the error status -1, which signifies a year
+**     so early that JD could not be computed.
 **
 **  2) If the specified date is for a day which ends with a leap second,
 **     the UTC-TAI value returned is for the period leading up to the
@@ -2949,14 +6107,14 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **  4) The fraction of day is used only for dates before the
 **     introduction of leap seconds, the first of which occurred at the
 **     end of 1971.  It is tested for validity (0 to 1 is the valid
-**     range) even if not used;  if invalid, zero is used and status
-**     j=-4 is returned.  For many applications, setting fd to zero is
+**     range) even if not used;  if invalid, zero is used and status -4
+**     is returned.  For many applications, setting fd to zero is
 **     acceptable;  the resulting error is always less than 3 ms (and
 **     occurs only pre-1972).
 **
 **  5) The status value returned in the case where there are multiple
 **     errors refers to the first error detected.  For example, if the
-**     month and day are 13 and 32 respectively, j=-2 (bad month)
+**     month and day are 13 and 32 respectively, status -2 (bad month)
 **     will be returned.
 **
 **  6) In cases where a valid result is not available, zero is returned.
@@ -2970,7 +6128,7 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **     the 1992 Explanatory Supplement.
 **
 **  Called:
-**     iauCal2jd    Gregorian calendar to Julian Day number
+**     iauCal2jd    Gregorian calendar to JD
 **
 */
 

@@ -3195,7 +6353,10 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 **  4) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The SOFA internal convention is that
 **     the quasi-JD day represents UTC days whether the length is 86399,
-**     86400 or 86401 SI seconds.
+**     86400 or 86401 SI seconds.  In the 1960-1972 era there were
+**     smaller jumps (in either direction) each time the linear UTC(TAI)
+**     expression was changed, and these "mini-leaps" are also included
+**     in the SOFA convention.
 **
 **  5) The warning status "time is after end of day" usually means that
 **     the sec argument is greater than 60.0.  However, in a day ending
@@ -3203,7 +6364,7 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 **     of a negative leap second).
 **
 **  6) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  7) Only in the case of continuous and regular time scales (TAI, TT,
@@ -3705,7 +6866,7 @@ double iauEo06a(double date1, double date2)
 **     iauPnm06a    classical NPB matrix, IAU 2006/2000A
 **     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
 **     iauS06       the CIO locator s, given X,Y, IAU 2006
-**     iauEors      equation of the origins, Given NPB matrix and s
+**     iauEors      equation of the origins, given NPB matrix and s
 **
 **  References:
 **
@@ -3783,12 +6944,12 @@ double iauEpb(double dj1, double dj2)
 **     The Julian Date is supplied in two pieces, in the usual SOFA
 **     manner, which is designed to preserve time resolution.  The
 **     Julian Date is available as a single number by adding dj1 and
-**     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
+**     dj2.  The maximum resolution is achieved if dj1 is 2451545.0
 **     (J2000.0).
 **
 **  Reference:
 **
-**     Lieske,J.H., 1979. Astron.Astrophys.,73,282.
+**     Lieske, J.H., 1979. Astron.Astrophys., 73, 282.
 **
 */
 

@@ -3808,7 +6969,7 @@ void iauEpb2jd(double epb, double *djm0, double *djm)
 **  Status:  support function.
 **
 **  Given:
-**     epb      double    Besselian Epoch (e.g. 1957.3D0)
+**     epb      double    Besselian Epoch (e.g. 1957.3)
 **
 **  Returned:
 **     djm0     double    MJD zero-point: always 2400000.5
@@ -3853,7 +7014,7 @@ double iauEpj(double dj1, double dj2)
 **     The Julian Date is supplied in two pieces, in the usual SOFA
 **     manner, which is designed to preserve time resolution.  The
 **     Julian Date is available as a single number by adding dj1 and
-**     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
+**     dj2.  The maximum resolution is achieved if dj1 is 2451545.0
 **     (J2000.0).
 **
 **  Reference:
@@ -3878,7 +7039,7 @@ void iauEpj2jd(double epj, double *djm0, double *djm)
 **  Status:  support function.
 **
 **  Given:
-**     epj      double    Julian Epoch (e.g. 1996.8D0)
+**     epj      double    Julian Epoch (e.g. 1996.8)
 **
 **  Returned:
 **     djm0     double    MJD zero-point: always 2400000.5
@@ -4047,6 +7208,7 @@ double iauEqeq94(double date1, double date2)
 **        Greenwich apparent ST = GMST + equation of the equinoxes
 **
 **  Called:
+**     iauAnpm      normalize angle into range +/- pi
 **     iauNut80     nutation, IAU 1980
 **     iauObl80     mean obliquity, IAU 1980
 **
@@ -4987,7 +8149,7 @@ void iauFw2xy(double gamb, double phib, double psi, double eps,
 **     eps      double    F-W angle epsilon (radians)
 **
 **  Returned:
-**     x,y      double    CIP X,Y ("radians")
+**     x,y      double    CIP unit vector X,Y
 **
 **  Notes:
 **
@@ -5010,7 +8172,8 @@ void iauFw2xy(double gamb, double phib, double psi, double eps,
 **
 **        NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
 **
-**     X,Y are elements (3,1) and (3,2) of the matrix.
+**     The returned values x,y are elements [2][0] and [2][1] of the
+**     matrix.  Near J2000.0, they are essentially angles in radians.
 **
 **  Called:
 **     iauFw2m      F-W angles to r-matrix
@@ -5044,7 +8207,7 @@ int iauGc2gd ( int n, double xyz[3],
 **     xyz     double[3]  geocentric vector (Note 2)
 **
 **  Returned:
-**     elong   double     longitude (radians, east +ve)
+**     elong   double     longitude (radians, east +ve, Note 3)
 **     phi     double     latitude (geodetic, radians, Note 3)
 **     height  double     height above ellipsoid (geodetic, Notes 2,3)
 **
@@ -5072,7 +8235,7 @@ int iauGc2gd ( int n, double xyz[3],
 **
 **  3) An error status -1 means that the identifier n is illegal.  An
 **     error status -2 is theoretically impossible.  In all error cases,
-**     phi and height are both set to -1e9.
+**     all three results are set to -1e9.
 **
 **  4) The inverse transformation is performed in the function iauGd2gc.
 **
@@ -5448,10 +8611,10 @@ double iauGmst82(double dj1, double dj2)
 **
 **             dj1            dj2
 **
-**         2450123.7D0        0D0        (JD method)
-**          2451545D0      -1421.3D0     (J2000 method)
-**         2400000.5D0     50123.2D0     (MJD method)
-**         2450123.5D0       0.2D0       (date & time method)
+**         2450123.7          0          (JD method)
+**          2451545        -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5         0.2         (date & time method)
 **
 **     The JD method is the most natural and convenient to use in
 **     cases where the loss of several decimal digits of resolution
@@ -6064,7 +9227,7 @@ int iauJd2cal(double dj1, double dj2,
 **  Notes:
 **
 **  1) The earliest valid date is -68569.5 (-4900 March 1).  The
-**     largest value accepted is 10^9.
+**     largest value accepted is 1e9.
 **
 **  2) The Julian Date is apportioned in any convenient way between
 **     the arguments dj1 and dj2.  For example, JD=2450123.7 could
@@ -6107,50 +9270,255 @@ int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4])
 **  Status:  support function.
 **
 **  Given:
-**     ndp       int      number of decimal places of days in fraction
-**     dj1,dj2   double   dj1+dj2 = Julian Date (Note 1)
+**     ndp       int      number of decimal places of days in fraction
+**     dj1,dj2   double   dj1+dj2 = Julian Date (Note 1)
+**
+**  Returned:
+**     iymdf     int[4]   year, month, day, fraction in Gregorian
+**                        calendar
+**
+**  Returned (function value):
+**               int      status:
+**                          -1 = date out of range
+**                           0 = OK
+**                          +1 = NDP not 0-9 (interpreted as 0)
+**
+**  Notes:
+**
+**  1) The Julian Date is apportioned in any convenient way between
+**     the arguments dj1 and dj2.  For example, JD=2450123.7 could
+**     be expressed in any of these ways, among others:
+**
+**             dj1            dj2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**  2) In early eras the conversion is from the "Proleptic Gregorian
+**     Calendar";  no account is taken of the date(s) of adoption of
+**     the Gregorian Calendar, nor is the AD/BC numbering convention
+**     observed.
+**
+**  3) Refer to the function iauJd2cal.
+**
+**  4) NDP should be 4 or less if internal overflows are to be
+**     avoided on machines which use 16-bit integers.
+**
+**  Called:
+**     iauJd2cal    JD to Gregorian calendar
+**
+**  Reference:
+**
+**     Explanatory Supplement to the Astronomical Almanac,
+**     P. Kenneth Seidelmann (ed), University Science Books (1992),
+**     Section 12.92 (p604).
+**
+*/
+

+
+
+void iauLd(double bm, double p[3], double q[3], double e[3],
+           double em, double dlim, double p1[3])
+/*
+**  - - - - - -
+**   i a u L d
+**  - - - - - -
+**
+**  Apply light deflection by a solar-system body, as part of
+**  transforming coordinate direction into natural direction.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     bm     double     mass of the gravitating body (solar masses)
+**     p      double[3]  direction from observer to source (unit vector)
+**     q      double[3]  direction from body to source (unit vector)
+**     e      double[3]  direction from body to observer (unit vector)
+**     em     double     distance from body to observer (au)
+**     dlim   double     deflection limiter (Note 4)
+**
+**  Returned:
+**     p1     double[3]  observer to deflected source (unit vector)
+**
+**  Notes:
+**
+**  1) The algorithm is based on Expr. (70) in Klioner (2003) and
+**     Expr. (7.63) in the Explanatory Supplement (Urban & Seidelmann
+**     2013), with some rearrangement to minimize the effects of machine
+**     precision.
+**
+**  2) The mass parameter bm can, as required, be adjusted in order to
+**     allow for such effects as quadrupole field.
+**
+**  3) The barycentric position of the deflecting body should ideally
+**     correspond to the time of closest approach of the light ray to
+**     the body.
+**
+**  4) The deflection limiter parameter dlim is phi^2/2, where phi is
+**     the angular separation (in radians) between source and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.
+**
+**  5) The returned vector p1 is not normalized, but the consequential
+**     departure from unit magnitude is always negligible.
+**
+**  6) The arguments p and p1 can be the same array.
+**
+**  7) To accumulate total light deflection taking into account the
+**     contributions from several bodies, call the present function for
+**     each body in succession, in decreasing order of distance from the
+**     observer.
+**
+**  8) For efficiency, validation is omitted.  The supplied vectors must
+**     be of unit magnitude, and the deflection limiter non-zero and
+**     positive.
+**
+**  References:
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013).
+**
+**     Klioner, Sergei A., "A practical relativistic model for micro-
+**     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
+**
+**  Called:
+**     iauPdp       scalar product of two p-vectors
+**     iauPxp       vector product of two p-vectors
+**
+*/
+

+
+
+void iauLdn(int n, iauLDBODY b[], double ob[3], double sc[3],
+            double sn[3])
+/*+
+**  - - - - - - -
+**   i a u L d n
+**  - - - - - - -
+**
+**  For a star, apply light deflection by multiple solar-system bodies,
+**  as part of transforming coordinate direction into natural direction.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     n    int           number of bodies (note 1)
+**     b    iauLDBODY[n]  data for each of the n bodies (Notes 1,2):
+**      bm   double         mass of the body (solar masses, Note 3)
+**      dl   double         deflection limiter (Note 4)
+**      pv   [2][3]         barycentric PV of the body (au, au/day)
+**     ob   double[3]     barycentric position of the observer (au)
+**     sc   double[3]     observer to star coord direction (unit vector)
+**
+**  Returned:
+**     sn    double[3]      observer to deflected star (unit vector)
+**
+**  1) The array b contains n entries, one for each body to be
+**     considered.  If n = 0, no gravitational light deflection will be
+**     applied, not even for the Sun.
+**
+**  2) The array b should include an entry for the Sun as well as for
+**     any planet or other body to be taken into account.  The entries
+**     should be in the order in which the light passes the body.
+**
+**  3) In the entry in the b array for body i, the mass parameter
+**     b[i].bm can, as required, be adjusted in order to allow for such
+**     effects as quadrupole field.
+**
+**  4) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
+**     the angular separation (in radians) between star and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.   Example values suitable for a terrestrial
+**     observer, together with masses, are as follows:
+**
+**        body i     b[i].bm        b[i].dl
+**
+**        Sun        1.0            6e-6
+**        Jupiter    0.00095435     3e-9
+**        Saturn     0.00028574     3e-10
+**
+**  5) For cases where the starlight passes the body before reaching the
+**     observer, the body is placed back along its barycentric track by
+**     the light time from that point to the observer.  For cases where
+**     the body is "behind" the observer no such shift is applied.  If
+**     a different treatment is preferred, the user has the option of
+**     instead using the iauLd function.  Similarly, iauLd can be used
+**     for cases where the source is nearby, not a star.
+**
+**  6) The returned vector sn is not normalized, but the consequential
+**     departure from unit magnitude is always negligible.
+**
+**  7) The arguments sc and sn can be the same array.
+**
+**  8) For efficiency, validation is omitted.  The supplied masses must
+**     be greater than zero, the position and velocity vectors must be
+**     right, and the deflection limiter greater than zero.
+**
+**  Reference:
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013), Section 7.2.4.
+**
+**  Called:
+**     iauCp        copy p-vector
+**     iauPdp       scalar product of two p-vectors
+**     iauPmp       p-vector minus p-vector
+**     iauPpsp      p-vector plus scaled p-vector
+**     iauPn        decompose p-vector into modulus and direction
+**     iauLd        light deflection by a solar-system body
+**
+*/
+

+
+
+void iauLdsun(double p[3], double e[3], double em, double p1[3])
+/*
+**  - - - - - - - - -
+**   i a u L d s u n
+**  - - - - - - - - -
+**
+**  Light deflection by the Sun.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     p      double[3]  direction from observer to source (unit vector)
+**     e      double[3]  direction from Sun to observer (unit vector)
+**     em     double     distance from Sun to observer (au)
 **
 **  Returned:
-**     iymdf     int[4]   year, month, day, fraction in Gregorian
-**                        calendar
-**
-**  Returned (function value):
-**               int      status:
-**                          -1 = date out of range
-**                           0 = OK
-**                          +1 = NDP not 0-9 (interpreted as 0)
+**     p1     double[3]  observer to deflected source (unit vector)
 **
 **  Notes:
 **
-**  1) The Julian Date is apportioned in any convenient way between
-**     the arguments dj1 and dj2.  For example, JD=2450123.7 could
-**     be expressed in any of these ways, among others:
-**
-**             dj1            dj2
-**
-**         2450123.7           0.0       (JD method)
-**         2451545.0       -1421.3       (J2000 method)
-**         2400000.5       50123.2       (MJD method)
-**         2450123.5           0.2       (date & time method)
-**
-**  2) In early eras the conversion is from the "Proleptic Gregorian
-**     Calendar";  no account is taken of the date(s) of adoption of
-**     the Gregorian Calendar, nor is the AD/BC numbering convention
-**     observed.
+**  1) The source is presumed to be sufficiently distant that its
+**     directions seen from the Sun and the observer are essentially
+**     the same.
 **
-**  3) Refer to the function iauJd2cal.
+**  2) The deflection is restrained when the angle between the star and
+**     the center of the Sun is less than about 9 arcsec, falling to
+**     zero for zero separation. (The chosen threshold is within the
+**     solar limb for all solar-system applications.)
 **
-**  4) NDP should be 4 or less if internal overflows are to be
-**     avoided on machines which use 16-bit integers.
+**  3) The arguments p and p1 can be the same array.
 **
 **  Called:
-**     iauJd2cal    JD to Gregorian calendar
-**
-**  Reference:
-**
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 12.92 (p604).
+**     iauLd        light deflection by a solar-system body
 **
 */
 

@@ -7827,6 +11195,175 @@ void iauPmp(double a[3], double b[3], double amb[3])
 

 
 
+void iauPmpx(double rc, double dc, double pr, double pd,
+             double px, double rv, double pmt, double pob[3],
+             double pco[3])
+/*
+**  - - - - - - - -
+**   i a u P m p x
+**  - - - - - - - -
+**
+**  Proper motion and parallax.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double     ICRS RA,Dec at catalog epoch (radians)
+**     pr     double     RA proper motion (radians/year; Note 1)
+**     pd     double     Dec proper motion (radians/year)
+**     px     double     parallax (arcsec)
+**     rv     double     radial velocity (km/s, +ve if receding)
+**     pmt    double     proper motion time interval (SSB, Julian years)
+**     pob    double[3]  SSB to observer vector (au)
+**
+**  Returned:
+**     pco    double[3]  coordinate direction (BCRS unit vector)
+**
+**  Notes:
+**
+**  1) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  2) The proper motion time interval is for when the starlight
+**     reaches the solar system barycenter.
+**
+**  3) To avoid the need for iteration, the Roemer effect (i.e. the
+**     small annual modulation of the proper motion coming from the
+**     changing light time) is applied approximately, using the
+**     direction of the star at the catalog epoch.
+**
+**  References:
+**
+**     1984 Astronomical Almanac, pp B39-B41.
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013), Section 7.2.
+**
+**  Called:
+**     iauPdp       scalar product of two p-vectors
+**     iauPn        decompose p-vector into modulus and direction
+**
+*/
+

+
+
+int iauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
+              double px1, double rv1,
+              double ep1a, double ep1b, double ep2a, double ep2b,
+              double *ra2, double *dec2, double *pmr2, double *pmd2,
+              double *px2, double *rv2)
+/*
+**  - - - - - - - - - -
+**   i a u P m s a f e
+**  - - - - - - - - - -
+**
+**  Star proper motion:  update star catalog data for space motion, with
+**  special handling to handle the zero parallax case.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ra1    double      right ascension (radians), before
+**     dec1   double      declination (radians), before
+**     pmr1   double      RA proper motion (radians/year), before
+**     pmd1   double      Dec proper motion (radians/year), before
+**     px1    double      parallax (arcseconds), before
+**     rv1    double      radial velocity (km/s, +ve = receding), before
+**     ep1a   double      "before" epoch, part A (Note 1)
+**     ep1b   double      "before" epoch, part B (Note 1)
+**     ep2a   double      "after" epoch, part A (Note 1)
+**     ep2b   double      "after" epoch, part B (Note 1)
+**
+**  Returned:
+**     ra2    double      right ascension (radians), after
+**     dec2   double      declination (radians), after
+**     pmr2   double      RA proper motion (radians/year), after
+**     pmd2   double      Dec proper motion (radians/year), after
+**     px2    double      parallax (arcseconds), after
+**     rv2    double      radial velocity (km/s, +ve = receding), after
+**
+**  Returned (function value):
+**            int         status:
+**                         -1 = system error (should not occur)
+**                          0 = no warnings or errors
+**                          1 = distance overridden (Note 6)
+**                          2 = excessive velocity (Note 7)
+**                          4 = solution didn't converge (Note 8)
+**                       else = binary logical OR of the above warnings
+**
+**  Notes:
+**
+**  1) The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are
+**     Julian Dates, apportioned in any convenient way between the two
+**     parts (A and B).  For example, JD(TDB)=2450123.7 could be
+**     expressed in any of these ways, among others:
+**
+**            epNa            epNb
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.
+**
+**  2) In accordance with normal star-catalog conventions, the object's
+**     right ascension and declination are freed from the effects of
+**     secular aberration.  The frame, which is aligned to the catalog
+**     equator and equinox, is Lorentzian and centered on the SSB.
+**
+**     The proper motions are the rate of change of the right ascension
+**     and declination at the catalog epoch and are in radians per TDB
+**     Julian year.
+**
+**     The parallax and radial velocity are in the same frame.
+**
+**  3) Care is needed with units.  The star coordinates are in radians
+**     and the proper motions in radians per Julian year, but the
+**     parallax is in arcseconds.
+**
+**  4) The RA proper motion is in terms of coordinate angle, not true
+**     angle.  If the catalog uses arcseconds for both RA and Dec proper
+**     motions, the RA proper motion will need to be divided by cos(Dec)
+**     before use.
+**
+**  5) Straight-line motion at constant speed, in the inertial frame, is
+**     assumed.
+**
+**  6) An extremely small (or zero or negative) parallax is overridden
+**     to ensure that the object is at a finite but very large distance,
+**     but not so large that the proper motion is equivalent to a large
+**     but safe speed (about 0.1c using the chosen constant).  A warning
+**     status of 1 is added to the status if this action has been taken.
+**
+**  7) If the space velocity is a significant fraction of c (see the
+**     constant VMAX in the function iauStarpv), it is arbitrarily set
+**     to zero.  When this action occurs, 2 is added to the status.
+**
+**  8) The relativistic adjustment carried out in the iauStarpv function
+**     involves an iterative calculation.  If the process fails to
+**     converge within a set number of iterations, 4 is added to the
+**     status.
+**
+**  Called:
+**     iauSeps      angle between two points
+**     iauStarpm    update star catalog data for space motion
+**
+*/
+

+
+
 void iauPn(double p[3], double *r, double u[3])
 /*
 **  - - - - - -
@@ -8047,8 +11584,9 @@ void iauPn00a(double date1, double date2,
 **      equinox of date.  It is the product rn x rbp, applying frame
 **      bias, precession and nutation in that order.
 **
-**  9)  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
-**      Pole are elements (3,1-3) of the matrix rbpn.
+**  9)  The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate
+**      Pole are elements (3,1-3) of the GCRS-to-true matrix,
+**      i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the order given.
@@ -8151,7 +11689,8 @@ void iauPn00b(double date1, double date2,
 **      bias, precession and nutation in that order.
 **
 **  9)  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
-**      Pole are elements (3,1-3) of the matrix rbpn.
+**      Pole are elements (3,1-3) of the GCRS-to-true matrix,
+**      i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the stated order.
@@ -8253,8 +11792,8 @@ void iauPn06(double date1, double date2, double dpsi, double deps,
 **      equinox of date.  It is the product rn x rbp, applying frame
 **      bias, precession and nutation in that order.
 **
-**  9)  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
-**      Pole are elements (3,1-3) of the matrix rbpn.
+**  9)  The X,Y,Z coordinates of the Celestial Intermediate Pole are
+**      elements (3,1-3) of the GCRS-to-true matrix, i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the stated order.
@@ -8352,7 +11891,8 @@ void iauPn06a(double date1, double date2,
 **      precession and nutation in that order.
 **
 **  9)  The X,Y,Z coordinates of the IAU 2006/2000A Celestial
-**      Intermediate Pole are elements (1,1-3) of the matrix rbpn.
+**      Intermediate Pole are elements (3,1-3) of the GCRS-to-true
+**      matrix, i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the stated order.
@@ -8803,7 +12343,7 @@ void iauPr00(double date1, double date2, double *dpsipr, double *depspr)
 

 
 
-void iauPrec76(double ep01, double ep02, double ep11, double ep12,
+void iauPrec76(double date01, double date02, double date11, double date12,
                double *zeta, double *z, double *theta)
 /*
 **  - - - - - - - - - -
@@ -8813,8 +12353,8 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **  IAU 1976 precession model.
 **
 **  This function forms the three Euler angles which implement general
-**  precession between two epochs, using the IAU 1976 model (as for
-**  the FK5 catalog).
+**  precession between two dates, using the IAU 1976 model (as for the
+**  FK5 catalog).
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards Of Fundamental Astronomy) software collection.
@@ -8822,22 +12362,22 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **  Status:  canonical model.
 **
 **  Given:
-**     ep01,ep02   double    TDB starting epoch (Note 1)
-**     ep11,ep12   double    TDB ending epoch (Note 1)
+**     date01,date02   double    TDB starting date (Note 1)
+**     date11,date12   double    TDB ending date (Note 1)
 **
 **  Returned:
-**     zeta        double    1st rotation: radians cw around z
-**     z           double    3rd rotation: radians cw around z
-**     theta       double    2nd rotation: radians ccw around y
+**     zeta            double    1st rotation: radians cw around z
+**     z               double    3rd rotation: radians cw around z
+**     theta           double    2nd rotation: radians ccw around y
 **
 **  Notes:
 **
-**  1) The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
-**     in any convenient way between the arguments epn1 and epn2.  For
-**     example, JD(TDB)=2450123.7 could be expressed in any of these
-**     ways, among others:
+**  1) The dates date01+date02 and date11+date12 are Julian Dates,
+**     apportioned in any convenient way between the arguments daten1
+**     and daten2.  For example, JD(TDB)=2450123.7 could be expressed in
+**     any of these ways, among others:
 **
-**             epn1          epn2
+**           daten1        daten2
 **
 **         2450123.7           0.0       (JD method)
 **         2451545.0       -1421.3       (J2000 method)
@@ -8850,7 +12390,7 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **     argument is handled internally and will deliver the optimum
 **     optimum resolution.  The MJD method and the date & time methods
 **     are both good compromises between resolution and convenience.
-**     The two epochs may be expressed using different methods, but at
+**     The two dates may be expressed using different methods, but at
 **     the risk of losing some resolution.
 **
 **  2) The accumulated precession angles zeta, z, theta are expressed
@@ -9172,6 +12712,76 @@ int iauPvstar(double pv[2][3], double *ra, double *dec,
 

 
 
+void iauPvtob(double elong, double phi, double hm,
+              double xp, double yp, double sp, double theta,
+              double pv[2][3])
+/*
+**  - - - - - - - - -
+**   i a u P v t o b
+**  - - - - - - - - -
+**
+**  Position and velocity of a terrestrial observing station.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     elong   double       longitude (radians, east +ve, Note 1)
+**     phi     double       latitude (geodetic, radians, Note 1)
+**     hm      double       height above ref. ellipsoid (geodetic, m)
+**     xp,yp   double       coordinates of the pole (radians, Note 2)
+**     sp      double       the TIO locator s' (radians, Note 2)
+**     theta   double       Earth rotation angle (radians, Note 3)
+**
+**  Returned:
+**     pv      double[2][3] position/velocity vector (m, m/s, CIRS)
+**
+**  Notes:
+**
+**  1) The terrestrial coordinates are with respect to the WGS84
+**     reference ellipsoid.
+**
+**  2) xp and yp are the coordinates (in radians) of the Celestial
+**     Intermediate Pole with respect to the International Terrestrial
+**     Reference System (see IERS Conventions), measured along the
+**     meridians 0 and 90 deg west respectively.  sp is the TIO locator
+**     s', in radians, which positions the Terrestrial Intermediate
+**     Origin on the equator.  For many applications, xp, yp and
+**     (especially) sp can be set to zero.
+**
+**  3) If theta is Greenwich apparent sidereal time instead of Earth
+**     rotation angle, the result is with respect to the true equator
+**     and equinox of date, i.e. with the x-axis at the equinox rather
+**     than the celestial intermediate origin.
+**
+**  4) The velocity units are meters per UT1 second, not per SI second.
+**     This is unlikely to have any practical consequences in the modern
+**     era.
+**
+**  5) No validation is performed on the arguments.  Error cases that
+**     could lead to arithmetic exceptions are trapped by the iauGd2gc
+**     function, and the result set to zeros.
+**
+**  References:
+**
+**     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
+**     IERS Technical Note No. 32, BKG (2004)
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013), Section 7.4.3.3.
+**
+**  Called:
+**     iauGd2gc     geodetic to geocentric transformation
+**     iauPom00     polar motion matrix
+**     iauTrxp      product of transpose of r-matrix and p-vector
+**
+*/
+

+
+
 void iauPvu(double dt, double pv[2][3], double upv[2][3])
 /*
 **  - - - - - - -
@@ -9307,6 +12917,160 @@ void iauPxp(double a[3], double b[3], double axb[3])
 

 
 
+void iauRefco(double phpa, double tc, double rh, double wl,
+              double *refa, double *refb)
+/*
+**  - - - - - - - - -
+**   i a u R e f c o
+**  - - - - - - - - -
+**
+**  Determine the constants A and B in the atmospheric refraction model
+**  dZ = A tan Z + B tan^3 Z.
+**
+**  Z is the "observed" zenith distance (i.e. affected by refraction)
+**  and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
+**  zenith distance.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**    phpa   double    pressure at the observer (hPa = millibar)
+**    tc     double    ambient temperature at the observer (deg C)
+**    rh     double    relative humidity at the observer (range 0-1)
+**    wl     double    wavelength (micrometers)
+**
+**  Returned:
+**    refa   double*   tan Z coefficient (radians)
+**    refb   double*   tan^3 Z coefficient (radians)
+**
+**  Notes:
+**
+**  1) The model balances speed and accuracy to give good results in
+**     applications where performance at low altitudes is not paramount.
+**     Performance is maintained across a range of conditions, and
+**     applies to both optical/IR and radio.
+**
+**  2) The model omits the effects of (i) height above sea level (apart
+**     from the reduced pressure itself), (ii) latitude (i.e. the
+**     flattening of the Earth), (iii) variations in tropospheric lapse
+**     rate and (iv) dispersive effects in the radio.
+**
+**     The model was tested using the following range of conditions:
+**
+**       lapse rates 0.0055, 0.0065, 0.0075 deg/meter
+**       latitudes 0, 25, 50, 75 degrees
+**       heights 0, 2500, 5000 meters ASL
+**       pressures mean for height -10% to +5% in steps of 5%
+**       temperatures -10 deg to +20 deg with respect to 280 deg at SL
+**       relative humidity 0, 0.5, 1
+**       wavelengths 0.4, 0.6, ... 2 micron, + radio
+**       zenith distances 15, 45, 75 degrees
+**
+**     The accuracy with respect to raytracing through a model
+**     atmosphere was as follows:
+**
+**                            worst         RMS
+**
+**       optical/IR           62 mas       8 mas
+**       radio               319 mas      49 mas
+**
+**     For this particular set of conditions:
+**
+**       lapse rate 0.0065 K/meter
+**       latitude 50 degrees
+**       sea level
+**       pressure 1005 mb
+**       temperature 280.15 K
+**       humidity 80%
+**       wavelength 5740 Angstroms
+**
+**     the results were as follows:
+**
+**       ZD       raytrace     iauRefco   Saastamoinen
+**
+**       10         10.27        10.27        10.27
+**       20         21.19        21.20        21.19
+**       30         33.61        33.61        33.60
+**       40         48.82        48.83        48.81
+**       45         58.16        58.18        58.16
+**       50         69.28        69.30        69.27
+**       55         82.97        82.99        82.95
+**       60        100.51       100.54       100.50
+**       65        124.23       124.26       124.20
+**       70        158.63       158.68       158.61
+**       72        177.32       177.37       177.31
+**       74        200.35       200.38       200.32
+**       76        229.45       229.43       229.42
+**       78        267.44       267.29       267.41
+**       80        319.13       318.55       319.10
+**
+**      deg        arcsec       arcsec       arcsec
+**
+**     The values for Saastamoinen's formula (which includes terms
+**     up to tan^5) are taken from Hohenkerk and Sinclair (1985).
+**
+**  3) A wl value in the range 0-100 selects the optical/IR case and is
+**     wavelength in micrometers.  Any value outside this range selects
+**     the radio case.
+**
+**  4) Outlandish input parameters are silently limited to
+**     mathematically safe values.  Zero pressure is permissible, and
+**     causes zeroes to be returned.
+**
+**  5) The algorithm draws on several sources, as follows:
+**
+**     a) The formula for the saturation vapour pressure of water as
+**        a function of temperature and temperature is taken from
+**        Equations (A4.5-A4.7) of Gill (1982).
+**
+**     b) The formula for the water vapour pressure, given the
+**        saturation pressure and the relative humidity, is from
+**        Crane (1976), Equation (2.5.5).
+**
+**     c) The refractivity of air is a function of temperature,
+**        total pressure, water-vapour pressure and, in the case
+**        of optical/IR, wavelength.  The formulae for the two cases are
+**        developed from Hohenkerk & Sinclair (1985) and Rueger (2002).
+**
+**     d) The formula for beta, the ratio of the scale height of the
+**        atmosphere to the geocentric distance of the observer, is
+**        an adaption of Equation (9) from Stone (1996).  The
+**        adaptations, arrived at empirically, consist of (i) a small
+**        adjustment to the coefficient and (ii) a humidity term for the
+**        radio case only.
+**
+**     e) The formulae for the refraction constants as a function of
+**        n-1 and beta are from Green (1987), Equation (4.31).
+**
+**  References:
+**
+**     Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral
+**     Atmosphere", Methods of Experimental Physics: Astrophysics 12B,
+**     Academic Press, 1976.
+**
+**     Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press,
+**     1982.
+**
+**     Green, R.M., "Spherical Astronomy", Cambridge University Press,
+**     1987.
+**
+**     Hohenkerk, C.Y., & Sinclair, A.T., NAO Technical Note No. 63,
+**     1985.
+**
+**     Rueger, J.M., "Refractive Index Formulae for Electronic Distance
+**     Measurement with Radio and Millimetre Waves", in Unisurv Report
+**     S-68, School of Surveying and Spatial Information Systems,
+**     University of New South Wales, Sydney, Australia, 2002.
+**
+**     Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996.
+**
+*/
+

+
+
 void iauRm2v(double r[3][3], double w[3])
 /*
 **  - - - - - - - -
@@ -9724,9 +13488,9 @@ double iauS00a(double date1, double date2)
 **     instead the IAU 2000B truncated model.
 **
 **  Called:
-**     iauPnm00a     classical NPB matrix, IAU 2000A
-**     iauBnp2xy     extract CIP X,Y from the BPN matrix
-**     iauS00        the CIO locator s, given X,Y, IAU 2000A
+**     iauPnm00a    classical NPB matrix, IAU 2000A
+**     iauBnp2xy    extract CIP X,Y from the BPN matrix
+**     iauS00       the CIO locator s, given X,Y, IAU 2000A
 **
 **  References:
 **
@@ -9802,9 +13566,9 @@ double iauS00b(double date1, double date2)
 **     accuracy and at some cost in speed.
 **
 **  Called:
-**     iauPnm00b     classical NPB matrix, IAU 2000B
-**     iauBnp2xy     extract CIP X,Y from the BPN matrix
-**     iauS00        the CIO locator s, given X,Y, IAU 2000A
+**     iauPnm00b    classical NPB matrix, IAU 2000B
+**     iauBnp2xy    extract CIP X,Y from the BPN matrix
+**     iauS00       the CIO locator s, given X,Y, IAU 2000A
 **
 **  References:
 **
@@ -10321,7 +14085,7 @@ int iauStarpm(double ra1, double dec1,
 **     this way, the status, initially zero, has 1 added to it.
 **
 **  7) If the space velocity is a significant fraction of c (see the
-**     constant VMAX in the function iauStarpv),  it is arbitrarily set
+**     constant VMAX in the function iauStarpv), it is arbitrarily set
 **     to zero.  When this action occurs, 2 is added to the status.
 **
 **  8) The relativistic adjustment carried out in the iauStarpv function
@@ -10509,7 +14273,7 @@ void iauSxpv(double s, double pv[2][3], double spv[2][3])
 **     spv     double[2][3]    s * pv
 **
 **  Note:
-**     It is permissible for pv and psv to be the same array
+**     It is permissible for pv and spv to be the same array
 **
 **  Called:
 **     iauS2xpv     multiply pv-vector by two scalars
@@ -10641,20 +14405,21 @@ int iauTaiutc(double tai1, double tai2, double *utc1, double *utc2)
 **  2) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The convention in the present
 **     function is that the JD day represents UTC days whether the
-**     length is 86399, 86400 or 86401 SI seconds.
+**     length is 86399, 86400 or 86401 SI seconds.  In the 1960-1972 era
+**     there were smaller jumps (in either direction) each time the
+**     linear UTC(TAI) expression was changed, and these "mini-leaps"
+**     are also included in the SOFA convention.
 **
 **  3) The function iauD2dtf can be used to transform the UTC quasi-JD
 **     into calendar date and clock time, including UTC leap second
 **     handling.
 **
 **  4) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  Called:
-**     iauJd2cal    JD to Gregorian calendar
-**     iauDat       delta(AT) = TAI-UTC
-**     iauCal2jd    Gregorian calendar to JD
+**     iauUtctai    UTC to TAI
 **
 **  References:
 **
@@ -11368,7 +15133,7 @@ int iauUt1utc(double ut11, double ut12, double dut1,
 **     handling.
 **
 **  5) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  Called:
@@ -11422,11 +15187,14 @@ int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
 **  2) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The convention in the present
 **     function is that the JD day represents UTC days whether the
-**     length is 86399, 86400 or 86401 SI seconds.
+**     length is 86399, 86400 or 86401 SI seconds.  In the 1960-1972 era
+**     there were smaller jumps (in either direction) each time the
+**     linear UTC(TAI) expression was changed, and these "mini-leaps"
+**     are also included in the SOFA convention.
 **
 **  3) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
-**     to be trusted.  See iauDat  for further details.
+**     introduction of the time scale or that are too far in the future
+**     to be trusted.  See iauDat for further details.
 **
 **  4) The function iauDtf2d converts from calendar date and time of day
 **     into 2-part Julian Date, and in the case of UTC implements the
@@ -11475,7 +15243,7 @@ int iauUtcut1(double utc1, double utc2, double dut1,
 **     ut11,ut12  double   UT1 as a 2-part Julian Date (Note 6)
 **
 **  Returned (function value):
-**                int      status: +1 = dubious year (Note 7)
+**                int      status: +1 = dubious year (Note 3)
 **                                  0 = OK
 **                                 -1 = unacceptable date
 **
@@ -11491,25 +15259,21 @@ int iauUtcut1(double utc1, double utc2, double dut1,
 **     length is 86399, 86400 or 86401 SI seconds.
 **
 **  3) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
-**     to be trusted.  See iauDat  for further details.
+**     introduction of the time scale or that are too far in the future
+**     to be trusted.  See iauDat for further details.
 **
-**  4) The function iauDtf2d  converts from calendar date and time of
+**  4) The function iauDtf2d converts from calendar date and time of
 **     day into 2-part Julian Date, and in the case of UTC implements
 **     the leap-second-ambiguity convention described above.
 **
 **  5) Delta UT1 can be obtained from tabulations provided by the
-**     International Earth Rotation and Reference Systems Service.  It
-**     It is the caller's responsibility to supply a DUT argument
+**     International Earth Rotation and Reference Systems Service.
+**     It is the caller's responsibility to supply a dut1 argument
 **     containing the UT1-UTC value that matches the given UTC.
 **
 **  6) The returned ut11,ut12 are such that their sum is the UT1 Julian
 **     Date.
 **
-**  7) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
-**     to be trusted.  See iauDat for further details.
-**
 **  References:
 **
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
@@ -11936,7 +15700,7 @@ and C versions.)
 *        of how the derived work is based upon, contains and/or differs
 *        from the original SOFA software.
 *
-*     c) The name(s) of all routine(s) in your derived work shall not
+*     c) The names of all routines in your derived work shall not
 *        include the prefix "iau" or "sofa" or trivial modifications
 *        thereof such as changes of case.
 *
@@ -12063,17 +15827,43 @@ file sofam.h.
 **
 **  Please note that the constants defined below are to be used only in
 **  the context of the SOFA software, and have no other official IAU
-**  status.
-**
-**  This revision:   2012 February 23
-**
-**  SOFA release 2012-03-01
-**
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
-*/
-
-#include "sofa.h"
-
+**  status.  In addition, self consistency is not guaranteed.
+**
+**  This revision:   2013 August 27
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+
+/* Star-independent astrometry parameters */
+typedef struct {
+   double pmt;        /* PM time interval (SSB, Julian years) */
+   double eb[3];      /* SSB to observer (vector, au) */
+   double eh[3];      /* Sun to observer (unit vector) */
+   double em;         /* distance from Sun to observer (au) */
+   double v[3];       /* barycentric observer velocity (vector, c) */
+   double bm1;        /* sqrt(1-|v|^2): reciprocal of Lorenz factor */
+   double bpn[3][3];  /* bias-precession-nutation matrix */
+   double along;      /* longitude + s' + dERA(DUT) (radians) */
+   double phi;        /* geodetic latitude (radians) */
+   double xpl;        /* polar motion xp wrt local meridian (radians) */
+   double ypl;        /* polar motion yp wrt local meridian (radians) */
+   double sphi;       /* sine of geodetic latitude */
+   double cphi;       /* cosine of geodetic latitude */
+   double diurab;     /* magnitude of diurnal aberration vector */
+   double eral;       /* "local" Earth rotation angle (radians) */
+   double refa;       /* refraction constant A (radians) */
+   double refb;       /* refraction constant B (radians) */
+} iauASTROM;
+/* (Vectors eb, eh, em and v are all with respect to BCRS axes.) */
+
+/* Body parameters for light deflection */
+typedef struct {
+   double bm;         /* mass of the body (solar masses) */
+   double dl;         /* deflection limiter (radians^2/2) */
+   double pv[2][3];   /* barycentric PV of the body (au, au/day) */
+} iauLDBODY;
 
 /* Pi */
 #define DPI (3.141592653589793238462643)
@@ -12081,6 +15871,9 @@ file sofam.h.
 /* 2Pi */
 #define D2PI (6.283185307179586476925287)
 
+/* Radians to degrees */
+#define DR2D (57.29577951308232087679815)
+
 /* Degrees to radians */
 #define DD2R (1.745329251994329576923691e-2)
 
@@ -12129,11 +15922,17 @@ file sofam.h.
 /* TT minus TAI (s) */
 #define TTMTAI (32.184)
 
-/* AU (m) */
+/* Astronomical unit (m) */
 #define DAU (149597870e3)
 
+/* Speed of light (m/s) */
+#define CMPS 299792458.0
+
+/* Light time for 1 au (s) */
+#define AULT 499.004782
+
 /* Speed of light (AU per day) */
-#define DC (DAYSEC / 499.004782)
+#define DC (DAYSEC / AULT)
 
 /* L_G = 1 - d(TT)/d(TCG) */
 #define ELG (6.969290134e-10)
@@ -12142,6 +15941,10 @@ file sofam.h.
 #define ELB (1.550519768e-8)
 #define TDB0 (-6.55e-5)
 
+/* Schwarzschild radius of the Sun (au) */
+/* = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
+#define SRS 1.97412574336e-8
+
 /* dint(A) - truncate to nearest whole number towards zero (double) */
 #define dint(A) ((A)<0.0?ceil(A):floor(A))
 
@@ -12151,6 +15954,12 @@ file sofam.h.
 /* dsign(A,B) - magnitude of A with sign of B (double) */
 #define dsign(A,B) ((B)<0.0?-fabs(A):fabs(A))
 
+/* max(A,B) - larger (most +ve) of two numbers (generic) */
+#define gmax(A,B) (((A)>(B))?(A):(B))
+
+/* min(A,B) - smaller (least +ve) of two numbers (generic) */
+#define gmin(A,B) (((A)<(B))?(A):(B))
+
 /* Reference ellipsoids */
 #define WGS84 1
 #define GRS80 2
@@ -12160,7 +15969,7 @@ file sofam.h.
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -12254,7 +16063,7 @@ file sofam.h.
 **
 **--------------------------------------------------------------------*/
 

-board.lis                                              2010 November 23
+board.lis                                                 2013 October 8
 
 
 
@@ -12263,27 +16072,29 @@ IAU STANDARDS OF FUNDAMENTAL ASTRONOMY BOARD
 
 Current Membership
 
-   John Bangert           United States Naval Observatory
-   Steven Bell            Her Majesty's Nautical Almanac Office
-   Mark Calabretta        Australia Telescope National Facility
-   Nicole Capitaine       Paris Observatory
-   William Folkner        Jet Propulsion Laboratory
-   George Hobbs           Australia Telescope National Facility
-   Catherine Hohenkerk    Her Majesty's Nautical Almanac Office (Chair)
-   Wen-Jing Jin           Shanghai Observatory
-   Brian Luzum            United States Naval Observatory (IERS)
-   Zinovy Malkin          Pulkovo Observatory, St Petersburg
-   Jeffrey Percival       University of Wisconsin
-   Patrick Wallace        Rutherford Appleton Laboratory
+   John Bangert - United States Naval Observatory, retired
+   Steven Bell - Her Majesty's Nautical Almanac Office
+   Mark Calabretta - Australia Telescope National Facility, retired
+   Nicole Capitaine - Paris Observatory
+   William Folkner - Jet Propulsion Laboratory
+   Catherine Hohenkerk - Her Majesty's Nautical Almanac Office (Chair)
+   Li Jinling - Shanghai Astronomical Observatory
+   Brian Luzum - United States Naval Observatory (IERS)
+   Zinovy Malkin - Pulkovo Observatory, St Petersburg
+   Jeffrey Percival - University of Wisconsin
+   Scott Ransom - National Radio Astronomy Observatory
+   Patrick Wallace - RAL Space, retired
 
 
 Past Members
 
    Wim Brouw              University of Groningen
    Anne-Marie Gontier     Paris Observatory
+   George Hobbs           Australia Telescope National Facility
    George Kaplan          United States Naval Observatory
    Dennis McCarthy        United States Naval Observatory
    Skip Newhall           Jet Propulsion Laboratory
+   Jin Wen-Jing           Shanghai Observatory
 
 
 The e-mail for the Board chair is Catherine.Hohenkerk at ukho.gov.uk
diff --git a/20131202/c/doc/manual.pdf b/20131202/c/doc/manual.pdf
new file mode 100644
index 0000000..22c03e7
Binary files /dev/null and b/20131202/c/doc/manual.pdf differ
diff --git a/20131202/c/doc/sofa_ast_c.pdf b/20131202/c/doc/sofa_ast_c.pdf
new file mode 100644
index 0000000..f19227a
Binary files /dev/null and b/20131202/c/doc/sofa_ast_c.pdf differ
diff --git a/20131202/c/doc/sofa_ast_summary.pdf b/20131202/c/doc/sofa_ast_summary.pdf
new file mode 100644
index 0000000..64b0657
Binary files /dev/null and b/20131202/c/doc/sofa_ast_summary.pdf differ
diff --git a/20120301_a/c/doc/sofa_lib.lis b/20131202/c/doc/sofa_lib.lis
similarity index 73%
rename from 20120301_a/c/doc/sofa_lib.lis
rename to 20131202/c/doc/sofa_lib.lis
index 27fe1e0..cba4139 100644
--- a/20120301_a/c/doc/sofa_lib.lis
+++ b/20131202/c/doc/sofa_lib.lis
@@ -1,4 +1,4 @@
-sofa_lib.lis                                            2010 September 5
+sofa_lib.lis                                            2013 November 19
 
                      ----------------------
                      SOFA Astronomy Library
@@ -9,9 +9,9 @@ PREFACE
 
 The routines described here comprise the SOFA astronomy library.  Their
 general appearance and coding style conforms to conventions agreed by
-the SOFA Review Board, and their functions, names and algorithms have
-been ratified by the Board.  Procedures for soliciting and agreeing
-additions to the library are still evolving.
+the SOFA Board, and their functions, names and algorithms have been
+ratified by the Board.  Procedures for soliciting and agreeing additions
+to the library are still evolving.
 
 
 PROGRAMMING LANGUAGES
@@ -55,12 +55,16 @@ the latter are described as "support routines".
 
 Using the library requires knowledge of positional astronomy and
 time-scales.  These topics are covered in "Explanatory Supplement to the
-Astronomical Almanac", P. Kenneth Seidelmann (ed.), University Science
-Books, 1992.  Recent developments are documented in the journals, and
-references to the relevant papers are given in the SOFA code as
-required.  The IERS Conventions are also an essential reference.  The
-routines concerned with Earth attitude (precession-nutation etc.) are
-described in the SOFA document sofa_pn.pdf.
+Astronomical Almanac", 3rd Edition,  Sean E. Urban &
+P. Kenneth Seidelmann (eds.), University Science Books, 2013.  Recent
+developments are documented in the scientific journals, and references
+to the relevant papers are given in the SOFA code as required.  The IERS
+Conventions are also an essential reference.  The routines concerned
+with Earth attitude (precession-nutation etc.) are described in the SOFA
+document sofa_pn.pdf.  Those concerned with transformations between
+different time scales are described in sofa_ts_f.pdf (Fortran) and
+sofa_ts_c.pdf (C).  Those concerned with astrometric transformations
+are described in sofa_ast_f.pdf (Fortran) and sofa_ast_c (C).
 
 
 ROUTINES
@@ -75,6 +79,41 @@ ROUTINES
      JD2CAL    Julian Date to Gregorian year, month, day, fraction
      JDCALF    Julian Date to Gregorian date for formatted output
 
+  Astrometry
+
+     AB        apply stellar aberration
+     APCG      prepare for ICRS <-> GCRS, geocentric, special
+     APCG13    prepare for ICRS <-> GCRS, geocentric
+     APCI      prepare for ICRS <-> CIRS, terrestrial, special
+     APCI13    prepare for ICRS <-> CIRS, terrestrial
+     APCO      prepare for ICRS <-> observed, terrestrial, special
+     APCO13    prepare for ICRS <-> observed, terrestrial
+     APCS      prepare for ICRS <-> CIRS, space, special
+     APCS13    prepare for ICRS <-> CIRS, space
+     APER      insert ERA into context
+     APER13    update context for Earth rotation
+     APIO      prepare for CIRS <-> observed, terrestrial, special
+     APIO13    prepare for CIRS <-> observed, terrestrial
+     ATCI13    catalog -> CIRS
+     ATCIQ     quick ICRS -> CIRS
+     ATCIQN    quick ICRS -> CIRS, multiple deflections
+     ATCIQZ    quick astrometric ICRS -> CIRS
+     ATCO13    ICRS -> observed
+     ATIC13    CIRS -> ICRS
+     ATICQ     quick CIRS -> ICRS
+     ATCIQN    quick CIRS -> ICRS, multiple deflections
+     ATIO13    CIRS -> observed
+     ATIOQ     quick CIRS -> observed
+     ATOC13    observed -> astrometric ICRS
+     ATOI13    observed -> CIRS
+     ATOIQ     quick observed -> CIRS
+     LD        light deflection by a single solar-system body
+     LDN       light deflection by multiple solar-system bodies
+     LDSUN     light deflection by the Sun
+     PMPX      apply proper motion and parallax
+     PVTOB     observatory position and velocity
+     REFCO     refraction constants
+
   Time scales
 
      D2DTF     format 2-part JD for output
@@ -213,7 +252,8 @@ ROUTINES
      FK5HZ     FK5 to Hipparcos assuming zero Hipparcos proper motion
      H2FK5     transform Hipparcos star data into the FK5 system
      HFK5Z     Hipparcos to FK5 assuming zero Hipparcos proper motion
-     STARPM    proper motion between two epochs
+     PMSAFE    apply proper motion, with zero-parallax precautions
+     STARPM    apply proper motion
 
   Geodetic/geocentric
 
@@ -231,6 +271,44 @@ ROUTINES
 
 CALLS: FORTRAN VERSION
 
+   CALL iau_AB     ( PNAT, V, S, BM1, PPR )
+   CALL iau_APCG   ( DATE1, DATE2, EB, EH, ASTROM )
+   CALL iau_APCG13 ( DATE1, DATE2, ASTROM )
+   CALL iau_APCI   ( DATE1, DATE2, EB, EH, X, Y, S, ASTROM )
+   CALL iau_APCI13 ( DATE1, DATE2, ASTROM, EO )
+   CALL iau_APCO   ( DATE1, DATE2, EB, EH, X, Y, S,
+  :                  THETA, ELONG, PHI, HM, XP, YP, SP,
+  :                  REFA, REFB, ASTROM )
+   CALL iau_APCO13 ( UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
+  :                  PHPA, TC, RH, WL, ASTROM, EO, J )
+   CALL iau_APCS   ( DATE1, DATE2, PV, EB, EH, ASTROM )
+   CALL iau_APCS13 ( DATE1, DATE2, PV, ASTROM )
+   CALL iau_APER   ( THETA, ASTROM )
+   CALL iau_APER13 ( UT11, UT12, ASTROM )
+   CALL iau_APIO   ( SP, THETA, ELONG, PHI, HM, XP, YP,
+  :                  REFA, REFB, ASTROM )
+   CALL iau_APIO13 ( UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
+  :                  PHPA, TC, RH, WL, ASTROM, J )
+   CALL iau_ATCI13 ( RC, DC, PR, PD, PX, RV, DATE1, DATE2, RI, DI, EO )
+   CALL iau_ATCIQ  ( RC, DC, PR, PD, PX, RV, ASTROM, RI, DI )
+   CALL iau_ATCIQN ( RC, DC, PR, PD, PX, RV, ASTROM, N, B, RI, DI )
+   CALL iau_ATCIQZ ( RC, DC, ASTROM, RI, DI )
+   CALL iau_ATCO13 ( RC, DC, PR, PD, PX, RV, UTC1, UTC2, DUT1, ELONG,
+  :                  PHI, HM, XP, YP, PHPA, TC, RH, WL,
+  :                  AOB, ZOB, HOB, DOB, ROB, EO, J )
+   CALL iau_ATIC13 ( RI, DI, DATE1, DATE2, RC, DC, EO )
+   CALL iau_ATICQ  ( RI, DI, ASTROM, RC, DC )
+   CALL iau_ATCIQN ( RI, DI, ASTROM, N, B, RC, DC )
+   CALL iau_ATIO13 ( RI, DI, UTC1, UTC2, DUT1, ELONG, PHI, HM, XP, YP,
+                     PHPA, TC, RH, WL, AOB, ZOB, HOB, DOB, ROB, J )
+   CALL iau_ATIOQ  ( RI, DI, ASTROM, AOB, ZOB, HOB, DOB, ROB )
+   CALL iau_ATOC13 ( TYPE, OB1, OB2, UTC1, UTC2, DUT1,
+  :                  ELONG, PHI, HM, XP, YP, PHPA, TC, RH, WL,
+  :                  RC, DC, J )
+   CALL iau_ATOI13 ( TYPE, OB1, OB2, UTC1, UTC2, DUT1,
+  :                  ELONG, PHI, HM, XP, YP, PHPA, TC, RH, WL,
+  :                  RI, DI, J  )
+   CALL iau_ATOIQ  ( TYPE, OB1, OB2, ASTROM, RI, DI )
    CALL iau_BI00   ( DPSIBI, DEPSBI, DRA )
    CALL iau_BP00   ( DATE1, DATE2, RB, RP, RBP )
    CALL iau_BP06   ( DATE1, DATE2, RB, RP, RBP )
@@ -306,6 +384,9 @@ CALLS: FORTRAN VERSION
    CALL iau_HFK5Z  ( RH, DH, DATE1, DATE2, R5, D5, DR5, DD5 )
    CALL iau_JD2CAL ( DJ1, DJ2, IY, IM, ID, FD, J )
    CALL iau_JDCALF ( NDP, DJ1, DJ2, IYMDF, J )
+   CALL iau_LD     ( BM, P, Q, E, EM, DLIM, P1 )
+   CALL iau_LDN    ( N, B, OB, SC, SN )
+   CALL iau_LDSUN  ( P, E, EM, P1 )
    CALL iau_NUM00A ( DATE1, DATE2, RMATN )
    CALL iau_NUM00B ( DATE1, DATE2, RMATN )
    CALL iau_NUM06A ( DATE1, DATE2, RMATN )
@@ -323,6 +404,10 @@ CALLS: FORTRAN VERSION
    CALL iau_PMAT00 ( DATE1, DATE2, RBP )
    CALL iau_PMAT06 ( DATE1, DATE2, RBP )
    CALL iau_PMAT76 ( DATE1, DATE2, RMATP )
+   CALL iau_PMPX   ( RC, DC, PR, PD, PX, RV, PMT, POB, PCO )
+   CALL iau_PMSAFE ( RA1, DEC1, PMR1, PMD1, PX1, RV1,
+  :                  EP1A, EP1B, EP2A, EP2B,
+  :                  RA2, DEC2, PMR2, PMD2, PX2, RV2, J )
    CALL iau_PN00   ( DATE1, DATE2, DPSI, DEPS,
   :                  EPSA, RB, RP, RBP, RN, RBPN )
    CALL iau_PN00A  ( DATE1, DATE2,
@@ -332,7 +417,7 @@ CALLS: FORTRAN VERSION
    CALL iau_PN06   ( DATE1, DATE2, DPSI, DEPS,
   :                  EPSA, RB, RP, RBP, RN, RBPN )
    CALL iau_PN06A  ( DATE1, DATE2,
-                     DPSI, DEPS, RB, RP, RBP, RN, RBPN )
+  :                  DPSI, DEPS, RB, RP, RBP, RN, RBPN )
    CALL iau_PNM00A ( DATE1, DATE2, RBPN )
    CALL iau_PNM00B ( DATE1, DATE2, RBPN )
    CALL iau_PNM06A ( DATE1, DATE2, RNPB )
@@ -342,8 +427,10 @@ CALLS: FORTRAN VERSION
   :                  EPSA, CHIA, ZA, ZETAA, THETAA, PA, GAM, PHI, PSI )
    CALL iau_POM00  ( XP, YP, SP, RPOM )
    CALL iau_PR00   ( DATE1, DATE2, DPSIPR, DEPSPR )
-   CALL iau_PREC76 ( EP01, EP02, EP11, EP12, ZETA, Z, THETA )
+   CALL iau_PREC76 ( DATE01, DATE02, DATE11, DATE12, ZETA, Z, THETA )
    CALL iau_PVSTAR ( PV, RA, DEC, PMR, PMD, PX, RV, J )
+   CALL iau_PVTOB  ( ELONG, PHI, HM, XP, YP, SP, THETA, PV )
+   CALL iau_REFCO  ( PHPA, TC, RH, WL, REFA, REFB )
    D =  iau_S00    ( DATE1, DATE2, X, Y )
    D =  iau_S00A   ( DATE1, DATE2 )
    D =  iau_S00B   ( DATE1, DATE2 )
@@ -378,6 +465,44 @@ CALLS: FORTRAN VERSION
 
 CALLS: C VERSION
 
+       iauAb     ( pnat, v, s, bm1, ppr );
+       iauApcg   ( date1, date2, eb, eh, &astrom );
+       iauApcg13 ( date1, date2, &astrom );
+       iauApci   ( date1, date2, eb, eh, x, y, s, &astrom );
+       iauApci13 ( date1, date2, &astrom, &eo );
+       iauApco   ( date1, date2, eb, eh, x, y, s,
+                   theta, elong, phi, hm, xp, yp, sp,
+                   refa, refb, &astrom );
+   i = iauApco13 ( utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                   phpa, tc, rh, wl, &astrom, &eo );
+       iauApcs   ( date1, date2, pv, eb, eh, &astrom );
+       iauApcs13 ( date1, date2, pv, &astrom );
+       iauAper   ( theta, &astrom );
+       iauAper13 ( ut11, ut12, &astrom );
+       iauApio   ( sp, theta, elong, phi, hm, xp, yp, refa, refb,
+                   &astrom );
+   i = iauApio13 ( utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                   phpa, tc, rh, wl, &astrom );
+       iauAtci13 ( rc, dc, pr, pd, px, rv, date1, date2,
+                   &ri, &di, &eo );
+       iauAtciq  ( rc, dc, pr, pd, px, rv, &astrom, &ri, &di );
+       iauAtciqn ( rc, dc, pr, pd, px, rv, astrom, n, b, &ri, &di );
+       iauAtciqz ( rc, dc, &astrom, &ri, &di );
+   i = iauAtco13 ( rc, dc, pr, pd, px, rv, utc1, utc2, dut1,
+                   elong phi, hm, xp, yp, phpa, tc, rh, wl,
+                   aob, zob, hob, dob, rob, eo );
+       iauAtic13 ( ri, di, date1, date2, &rc, &dc, &eo );
+       iauAticq  ( ri, di, &astrom, &rc, &dc );
+       iauAtciqn ( ri, di, astrom, n, b, &rc, &dc );
+   i = iauAtio13 ( ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                   phpa, tc, rh, wl, aob, zob, hob, dob, rob );
+       iauAtioq  ( ri, di, &astrom, &aob, &zob, &hob, &dob, &rob );
+   i = iauAtoc13 ( type, ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &rc, &dc );
+   i = iauAtoi13 ( type, ob1, ob2, utc1, utc2, dut1, elong, phi, hm,
+                   xp, yp, phpa, tc, rh, wl, &ri, &di  );
+       iauAtoiq  ( type, ob1, ob2, &astrom, &ri, &di );
        iauBi00   ( &dpsibi, &depsbi, &dra );
        iauBp00   ( date1, date2, rb, rp, rbp );
        iauBp06   ( date1, date2, rb, rp, rbp );
@@ -397,7 +522,6 @@ CALLS: C VERSION
        iauC2txy  ( tta, ttb, uta, utb, x, y, xp, yp, rc2t );
    i = iauCal2jd ( iy, im, id, &djm0, &djm );
    i = iauD2dtf  ( scale, ndp, d1, d2, &iy, &im, &id, ihmsf );
-
    i = iauDat    ( iy, im, id, fd, &deltat );
    d = iauDtdb   ( date1, date2, ut, elong, u, v );
    i = iauDtf2d  ( scale, iy, im, id, ihr, imn, sec, &d1, &d2 );
@@ -454,6 +578,9 @@ CALLS: C VERSION
                    &r5, &d5, &dr5, &dd5 );
    i = iauJd2cal ( dj1, dj2, &iy, &im, &id, &fd );
    i = iauJdcalf ( ndp, dj1, dj2, iymdf );
+       iauLd     ( bm, p, q, e, em, dlim, p1 );
+       iauLdn    ( n, b, ob, sc, sn );
+       iauLdsun  ( p, e, em, p1 );
        iauNum00a ( date1, date2, rmatn );
        iauNum00b ( date1, date2, rmatn );
        iauNum06a ( date1, date2, rmatn );
@@ -471,6 +598,10 @@ CALLS: C VERSION
        iauPmat00 ( date1, date2, rbp );
        iauPmat06 ( date1, date2, rbp );
        iauPmat76 ( date1, date2, rmatp );
+       iauPmpx   ( rc, dc, pr, pd, px, rv, pmt, pob, pco );
+   i = iauPmsafe ( ra1, dec1, pmr1, pmd1, px1, rv1,
+                   ep1a, ep1b, ep2a, ep2b,
+                   &ra2, &dec2, &pmr2, &pmd2, &px2, &rv2);
        iauPn00   ( date1, date2, dpsi, deps,
                    &epsa, rb, rp, rbp, rn, rbpn );
        iauPn00a  ( date1, date2,
@@ -491,8 +622,10 @@ CALLS: C VERSION
                    &gam, &phi, &psi );
        iauPom00  ( xp, yp, sp, rpom );
        iauPr00   ( date1, date2, &dpsipr, &depspr );
-       iauPrec76 ( ep01, ep02, ep11, ep12, &zeta, &z, &theta );
+       iauPrec76 ( date01, date02, date11, date12, &zeta, &z, &theta );
    i = iauPvstar ( pv, &ra, &dec, &pmr, &pmd, &px, &rv );
+       iauPvtob  ( elong, phi, hm, xp, yp, sp, theta, pv );
+       iauRefco  ( phpa, tc, rh, wl, refa, refb );
    d = iauS00    ( date1, date2, x, y );
    d = iauS00a   ( date1, date2 );
    d = iauS00b   ( date1, date2 );
diff --git a/20131202/c/doc/sofa_lib.pdf b/20131202/c/doc/sofa_lib.pdf
new file mode 100644
index 0000000..d6cc7fa
Binary files /dev/null and b/20131202/c/doc/sofa_lib.pdf differ
diff --git a/20120301_a/c/doc/sofa_pn.pdf b/20131202/c/doc/sofa_pn.pdf
similarity index 84%
rename from 20120301_a/c/doc/sofa_pn.pdf
rename to 20131202/c/doc/sofa_pn.pdf
index f3cd76c..aaf79fb 100644
Binary files a/20120301_a/c/doc/sofa_pn.pdf and b/20131202/c/doc/sofa_pn.pdf differ
diff --git a/20131202/c/doc/sofa_ts_c.pdf b/20131202/c/doc/sofa_ts_c.pdf
new file mode 100644
index 0000000..ad8fdc5
Binary files /dev/null and b/20131202/c/doc/sofa_ts_c.pdf differ
diff --git a/20120301_a/c/doc/sofa_vml.lis b/20131202/c/doc/sofa_vml.lis
similarity index 97%
rename from 20120301_a/c/doc/sofa_vml.lis
rename to 20131202/c/doc/sofa_vml.lis
index 336601e..3f68239 100644
--- a/20120301_a/c/doc/sofa_vml.lis
+++ b/20131202/c/doc/sofa_vml.lis
@@ -1,4 +1,4 @@
-sofa_vml.lis                                            2010 September 5
+sofa_vml.lis                                              2013 October 8
 
                    --------------------------
                    SOFA Vector/Matrix Library
@@ -8,9 +8,9 @@ PREFACE
 
 The routines described here comprise the SOFA vector/matrix library.
 Their general appearance and coding style conforms to conventions
-agreed by the SOFA Review Board, and their functions, names and
-algorithms have been ratified by the Board.  Procedures for
-soliciting and agreeing additions to the library are still evolving.
+agreed by the SOFA Board, and their functions, names and algorithms have
+been ratified by the Board.  Procedures for soliciting and agreeing
+additions to the library are still evolving.
 
 
 PROGRAMMING LANGUAGES
diff --git a/20131202/c/doc/sofa_vml.pdf b/20131202/c/doc/sofa_vml.pdf
new file mode 100644
index 0000000..7547e30
Binary files /dev/null and b/20131202/c/doc/sofa_vml.pdf differ
diff --git a/20120301_a/c/doc/title.lis b/20131202/c/doc/title.lis
similarity index 85%
rename from 20120301_a/c/doc/title.lis
rename to 20131202/c/doc/title.lis
index 16b616d..f47d38b 100644
--- a/20120301_a/c/doc/title.lis
+++ b/20131202/c/doc/title.lis
@@ -44,9 +44,7 @@
 
                    International Astronomical Union
 
-                   Division 1: Fundamental Astronomy
-
-                  Commission 19: Rotation of the Earth
+                   Division A: Fundamental Astronomy
 
 
                 Standards Of Fundamental Astronomy Board
@@ -55,6 +53,6 @@
 
 
 
-                               Release 9
+                               Release 10
 
-                              2012 March 1
+                             2013 October 31
diff --git a/20131202/c/doc/title.pdf b/20131202/c/doc/title.pdf
new file mode 100644
index 0000000..ef76cec
Binary files /dev/null and b/20131202/c/doc/title.pdf differ
diff --git a/20120301_a/c/src/a2af.c b/20131202/c/src/a2af.c
similarity index 97%
rename from 20120301_a/c/src/a2af.c
rename to 20131202/c/src/a2af.c
index a6ddfb9..4116d0a 100644
--- a/20120301_a/c/src/a2af.c
+++ b/20131202/c/src/a2af.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauA2af(int ndp, double angle, char *sign, int idmsf[4])
 /*
@@ -56,11 +56,11 @@ void iauA2af(int ndp, double angle, char *sign, int idmsf[4])
 **     case where angle is very nearly 2pi and rounds up to 360 degrees,
 **     by testing for idmsf[0]=360 and setting idmsf[0-3] to zero.
 **
-**  This revision:  2008 May 27
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Hours to degrees * radians to turns */
@@ -74,7 +74,7 @@ void iauA2af(int ndp, double angle, char *sign, int idmsf[4])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/a2tf.c b/20131202/c/src/a2tf.c
similarity index 96%
rename from 20120301_a/c/src/a2tf.c
rename to 20131202/c/src/a2tf.c
index ec068c6..78f5c6e 100644
--- a/20120301_a/c/src/a2tf.c
+++ b/20131202/c/src/a2tf.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauA2tf(int ndp, double angle, char *sign, int ihmsf[4])
 /*
@@ -54,13 +54,13 @@ void iauA2tf(int ndp, double angle, char *sign, int ihmsf[4])
 **  3) The absolute value of angle may exceed 2pi.  In cases where it
 **     does not, it is up to the caller to test for and handle the
 **     case where angle is very nearly 2pi and rounds up to 24 hours,
-**     by testing for ihmsf[0]=24 and setting ihmsf(0-3) to zero.
+**     by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 July 31
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Scale then use days to h,m,s function. */
@@ -70,7 +70,7 @@ void iauA2tf(int ndp, double angle, char *sign, int ihmsf[4])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tdbtt.c b/20131202/c/src/ab.c
similarity index 68%
copy from 20120301_a/c/src/tdbtt.c
copy to 20131202/c/src/ab.c
index b5d81fe..7e88f2e 100644
--- a/20120301_a/c/src/tdbtt.c
+++ b/20131202/c/src/ab.c
@@ -1,82 +1,88 @@
-#include "sofam.h"
+#include "sofa.h"
 
-int iauTdbtt(double tdb1, double tdb2, double dtr,
-             double *tt1, double *tt2 )
+void iauAb(double pnat[3], double v[3], double s, double bm1,
+           double ppr[3])
 /*
-**  - - - - - - - - -
-**   i a u T d b t t
-**  - - - - - - - - -
+**  - - - - - -
+**   i a u A b
+**  - - - - - -
 **
-**  Time scale transformation:  Barycentric Dynamical Time, TDB, to
-**  Terrestrial Time, TT.
+**  Apply aberration to transform natural direction into proper
+**  direction.
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  canonical.
+**  Status:  support function.
 **
 **  Given:
-**     tdb1,tdb2  double    TDB as a 2-part Julian Date
-**     dtr        double    TDB-TT in seconds
+**    pnat    double[3]   natural direction to the source (unit vector)
+**    v       double[3]   observer barycentric velocity in units of c
+**    s       double      distance between the Sun and the observer (au)
+**    bm1     double      sqrt(1-|v|^2): reciprocal of Lorenz factor
 **
 **  Returned:
-**     tt1,tt2    double    TT as a 2-part Julian Date
-**
-**  Returned (function value):
-**                int       status:  0 = OK
+**    ppr     double[3]   proper direction to source (unit vector)
 **
 **  Notes:
 **
-**  1) tdb1+tdb2 is Julian Date, apportioned in any convenient way
-**     between the two arguments, for example where tdb1 is the Julian
-**     Day Number and tdb2 is the fraction of a day.  The returned
-**     tt1,tt2 follow suit.
+**  1) The algorithm is based on Expr. (7.40) in the Explanatory
+**     Supplement (Urban & Seidelmann 2013), but with the following
+**     changes:
+**
+**     o  Rigorous rather than approximate normalization is applied.
 **
-**  2) The argument dtr represents the quasi-periodic component of the
-**     GR transformation between TT and TCB.  It is dependent upon the
-**     adopted solar-system ephemeris, and can be obtained by numerical
-**     integration, by interrogating a precomputed time ephemeris or by
-**     evaluating a model such as that implemented in the SOFA function
-**     iauDtdb.   The quantity is dominated by an annual term of 1.7 ms
-**     amplitude.
+**     o  The gravitational potential term from Expr. (7) in
+**        Klioner (2003) is added, taking into account only the Sun's
+**        contribution.  This has a maximum effect of about
+**        0.4 microarcsecond.
 **
-**  3) TDB is essentially the same as Teph, the time argument for the
-**     JPL solar system ephemerides.
+**  2) In almost all cases, the maximum accuracy will be limited by the
+**     supplied velocity.  For example, if the SOFA iauEpv00 function is
+**     used, errors of up to 5 microarcseconds could occur.
 **
 **  References:
 **
-**     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
-**     IERS Technical Note No. 32, BKG (2004)
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013).
 **
-**     IAU 2006 Resolution 3
+**     Klioner, Sergei A., "A practical relativistic model for micro-
+**     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
 **
-**  This revision:  2011 May 14
+**  Called:
+**     iauPdp       scalar product of two p-vectors
 **
-**  SOFA release 2012-03-01
+**  This revision:   2013 October 9
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  SOFA release 2013-12-02
 **
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double dtrd;
+   int i;
+   double pdv, w1, w2, r2, w, p[3], r;
 
 
-/* Result, safeguarding precision. */
-   dtrd = dtr / DAYSEC;
-   if ( tdb1 > tdb2 ) {
-      *tt1 = tdb1;
-      *tt2 = tdb2 - dtrd;
-   } else {
-      *tt1 = tdb1 - dtrd;
-      *tt2 = tdb2;
+   pdv = iauPdp(pnat, v);
+   w1 = 1.0 + pdv/(1.0 + bm1);
+   w2 = SRS/s;
+   r2 = 0.0;
+   for (i = 0; i < 3; i++) {
+      w = pnat[i]*bm1 + w1*v[i] + w2*(v[i] - pdv*pnat[i]);
+      p[i] = w;
+      r2 = r2 + w*w;
+   }
+   r = sqrt(r2);
+   for (i = 0; i < 3; i++) {
+      ppr[i] = p[i]/r;
    }
 
-/* Status (always OK). */
-   return 0;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -169,4 +175,5 @@ int iauTdbtt(double tdb1, double tdb2, double dtr,
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/af2a.c b/20131202/c/src/af2a.c
similarity index 97%
rename from 20120301_a/c/src/af2a.c
rename to 20131202/c/src/af2a.c
index e4353de..41fa37f 100644
--- a/20120301_a/c/src/af2a.c
+++ b/20131202/c/src/af2a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 #include <stdlib.h>
 
 int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
@@ -39,11 +39,11 @@ int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
 **  3)  If there are multiple errors, the status value reflects only the
 **      first, the smallest taking precedence.
 **
-**  This revision:  2012 February 13
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -61,7 +61,7 @@ int iauAf2a(char s, int ideg, int iamin, double asec, double *rad)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/anp.c b/20131202/c/src/anp.c
similarity index 96%
rename from 20120301_a/c/src/anp.c
rename to 20131202/c/src/anp.c
index 66c7d44..21f2628 100644
--- a/20120301_a/c/src/anp.c
+++ b/20131202/c/src/anp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauAnp(double a)
 /*
@@ -19,11 +19,11 @@ double iauAnp(double a)
 **  Returned (function value):
 **              double     angle in range 0-2pi
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double w;
@@ -36,7 +36,7 @@ double iauAnp(double a)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/anpm.c b/20131202/c/src/anpm.c
similarity index 96%
rename from 20120301_a/c/src/anpm.c
rename to 20131202/c/src/anpm.c
index 5fbe119..de94f75 100644
--- a/20120301_a/c/src/anpm.c
+++ b/20131202/c/src/anpm.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauAnpm(double a)
 /*
@@ -19,11 +19,11 @@ double iauAnpm(double a)
 **  Returned (function value):
 **              double     angle in range +/-pi
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double w;
@@ -36,7 +36,7 @@ double iauAnpm(double a)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pnm80.c b/20131202/c/src/apcg.c
similarity index 54%
copy from 20120301_a/c/src/pnm80.c
copy to 20131202/c/src/apcg.c
index ce1750e..bb8f939 100644
--- a/20120301_a/c/src/pnm80.c
+++ b/20131202/c/src/apcg.c
@@ -1,31 +1,57 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPnm80(double date1, double date2, double rmatpn[3][3])
+void iauApcg(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             iauASTROM *astrom)
 /*
-**  - - - - - - - - -
-**   i a u P n m 8 0
-**  - - - - - - - - -
+**  - - - - - - - -
+**   i a u A p c g
+**  - - - - - - - -
 **
-**  Form the matrix of precession/nutation for a given date, IAU 1976
-**  precession model, IAU 1980 nutation model.
+**  For a geocentric observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and GCRS coordinates.
+**  The Earth ephemeris is supplied by the caller.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection and aberration parts of the astrometric
+**  transformation chain.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     date1,date2    double         TDB date (Note 1)
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     ebpv   double[2][3] Earth barycentric pos/vel (au, au/day)
+**     ehp    double[3]    Earth heliocentric position (au)
 **
 **  Returned:
-**     rmatpn         double[3][3]   combined precession/nutation matrix
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
 **
 **  Notes:
 **
 **  1) The TDB date date1+date2 is a Julian Date, apportioned in any
 **     convenient way between the two arguments.  For example,
-**     JD(TDB)=2450123.7 could be expressed in any of these ways,
-**     among others:
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
 **
 **            date1          date2
 **
@@ -34,53 +60,73 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
 **
-**  2) The matrix operates in the sense V(date) = rmatpn * V(J2000),
-**     where the p-vector V(date) is with respect to the true equatorial
-**     triad of date date1+date2 and the p-vector V(J2000) is with
-**     respect to the mean equatorial triad of epoch J2000.0.
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
 **
-**  Called:
-**     iauPmat76    precession matrix, IAU 1976
-**     iauNutm80    nutation matrix, IAU 1980
-**     iauRxr       product of two r-matrices
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
 **
-**  Reference:
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
 **
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 3.3 (p145).
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
 **
-**  This revision:  2010 January 23
+**  4) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
 **
-**  SOFA release 2012-03-01
+**  Called:
+**     iauApcs      astrometry parameters, ICRS-GCRS, space observer
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double rmatp[3][3], rmatn[3][3];
+/* Geocentric observer */
+   double pv[2][3] = { { 0.0, 0.0, 0.0 },
+                       { 0.0, 0.0, 0.0 } };
 
 
-/* Precession matrix, J2000.0 to date. */
-   iauPmat76(date1, date2, rmatp);
+/* Compute the star-independent astrometry parameters. */
+   iauApcs(date1, date2, pv, ebpv, ehp, astrom);
 
-/* Nutation matrix. */
-   iauNutm80(date1, date2, rmatn);
-
-/* Combine the matrices:  PN = N x P. */
-   iauRxr(rmatn, rmatp, rmatpn);
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -173,4 +219,5 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/pnm80.c b/20131202/c/src/apcg13.c
similarity index 53%
copy from 20120301_a/c/src/pnm80.c
copy to 20131202/c/src/apcg13.c
index ce1750e..c860f16 100644
--- a/20120301_a/c/src/pnm80.c
+++ b/20131202/c/src/apcg13.c
@@ -1,31 +1,54 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPnm80(double date1, double date2, double rmatpn[3][3])
+void iauApcg13(double date1, double date2, iauASTROM *astrom)
 /*
-**  - - - - - - - - -
-**   i a u P n m 8 0
-**  - - - - - - - - -
+**  - - - - - - - - - -
+**   i a u A p c g 1 3
+**  - - - - - - - - - -
 **
-**  Form the matrix of precession/nutation for a given date, IAU 1976
-**  precession model, IAU 1980 nutation model.
+**  For a geocentric observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and GCRS coordinates.
+**  The caller supplies the date, and SOFA models are used to predict
+**  the Earth ephemeris.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection and aberration parts of the astrometric
+**  transformation chain.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     date1,date2    double         TDB date (Note 1)
+**     date1  double     TDB as a 2-part...
+**     date2  double     ...Julian Date (Note 1)
 **
 **  Returned:
-**     rmatpn         double[3][3]   combined precession/nutation matrix
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
 **
 **  Notes:
 **
 **  1) The TDB date date1+date2 is a Julian Date, apportioned in any
 **     convenient way between the two arguments.  For example,
-**     JD(TDB)=2450123.7 could be expressed in any of these ways,
-**     among others:
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
 **
 **            date1          date2
 **
@@ -34,53 +57,79 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
 **
-**  2) The matrix operates in the sense V(date) = rmatpn * V(J2000),
-**     where the p-vector V(date) is with respect to the true equatorial
-**     triad of date date1+date2 and the p-vector V(J2000) is with
-**     respect to the mean equatorial triad of epoch J2000.0.
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
 **
-**  Called:
-**     iauPmat76    precession matrix, IAU 1976
-**     iauNutm80    nutation matrix, IAU 1980
-**     iauRxr       product of two r-matrices
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) In cases where the caller wishes to supply his own Earth
+**     ephemeris, the function iauApcg can be used instead of the present
+**     function.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
 **
-**  Reference:
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
 **
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 3.3 (p145).
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
 **
-**  This revision:  2010 January 23
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
 **
-**  SOFA release 2012-03-01
+**  5) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Called:
+**     iauEpv00     Earth position and velocity
+**     iauApcg      astrometry parameters, ICRS-GCRS, geocenter
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double rmatp[3][3], rmatn[3][3];
-
+   double ehpv[2][3], ebpv[2][3];
 
-/* Precession matrix, J2000.0 to date. */
-   iauPmat76(date1, date2, rmatp);
 
-/* Nutation matrix. */
-   iauNutm80(date1, date2, rmatn);
+/* Earth barycentric & heliocentric position/velocity (au, au/d). */
+   (void) iauEpv00(date1, date2, ehpv, ebpv);
 
-/* Combine the matrices:  PN = N x P. */
-   iauRxr(rmatn, rmatp, rmatpn);
+/* Compute the star-independent astrometry parameters. */
+   iauApcg(date1, date2, ebpv, ehpv[0], astrom);
 
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -173,4 +222,5 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/pnm80.c b/20131202/c/src/apci.c
similarity index 51%
copy from 20120301_a/c/src/pnm80.c
copy to 20131202/c/src/apci.c
index ce1750e..fe09faa 100644
--- a/20120301_a/c/src/pnm80.c
+++ b/20131202/c/src/apci.c
@@ -1,31 +1,61 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPnm80(double date1, double date2, double rmatpn[3][3])
+void iauApci(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             double x, double y, double s,
+             iauASTROM *astrom)
 /*
-**  - - - - - - - - -
-**   i a u P n m 8 0
-**  - - - - - - - - -
+**  - - - - - - - -
+**   i a u A p c i
+**  - - - - - - - -
 **
-**  Form the matrix of precession/nutation for a given date, IAU 1976
-**  precession model, IAU 1980 nutation model.
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and geocentric CIRS
+**  coordinates.  The Earth ephemeris and CIP/CIO are supplied by the
+**  caller.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection, aberration, and bias-precession-nutation
+**  parts of the astrometric transformation chain.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     date1,date2    double         TDB date (Note 1)
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     ebpv   double[2][3] Earth barycentric position/velocity (au, au/day)
+**     ehp    double[3]    Earth heliocentric position (au)
+**     x,y    double       CIP X,Y (components of unit vector)
+**     s      double       the CIO locator s (radians)
 **
 **  Returned:
-**     rmatpn         double[3][3]   combined precession/nutation matrix
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
 **
 **  Notes:
 **
 **  1) The TDB date date1+date2 is a Julian Date, apportioned in any
 **     convenient way between the two arguments.  For example,
-**     JD(TDB)=2450123.7 could be expressed in any of these ways,
-**     among others:
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
 **
 **            date1          date2
 **
@@ -34,53 +64,78 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
 **
-**  2) The matrix operates in the sense V(date) = rmatpn * V(J2000),
-**     where the p-vector V(date) is with respect to the true equatorial
-**     triad of date date1+date2 and the p-vector V(J2000) is with
-**     respect to the mean equatorial triad of epoch J2000.0.
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
 **
-**  Called:
-**     iauPmat76    precession matrix, IAU 1976
-**     iauNutm80    nutation matrix, IAU 1980
-**     iauRxr       product of two r-matrices
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) In cases where the caller does not wish to provide the Earth
+**     ephemeris and CIP/CIO, the function iauApci13 can be used instead
+**     of the present function.  This computes the required quantities
+**     using other SOFA functions.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
 **
-**  Reference:
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
 **
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 3.3 (p145).
+**          functions         observer        transformation
 **
-**  This revision:  2010 January 23
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
 **
-**  SOFA release 2012-03-01
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  5) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauApcg      astrometry parameters, ICRS-GCRS, geocenter
+**     iauC2ixys    celestial-to-intermediate matrix, given X,Y and s
+**
+**  This revision:   2013 September 25
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double rmatp[3][3], rmatn[3][3];
 
+/* Star-independent astrometry parameters for geocenter. */
+   iauApcg(date1, date2, ebpv, ehp, astrom);
 
-/* Precession matrix, J2000.0 to date. */
-   iauPmat76(date1, date2, rmatp);
+/* CIO based BPN matrix. */
+   iauC2ixys(x, y, s, astrom->bpn);
 
-/* Nutation matrix. */
-   iauNutm80(date1, date2, rmatn);
-
-/* Combine the matrices:  PN = N x P. */
-   iauRxr(rmatn, rmatp, rmatpn);
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -173,4 +228,5 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/eo06a.c b/20131202/c/src/apci13.c
similarity index 51%
copy from 20120301_a/c/src/eo06a.c
copy to 20131202/c/src/apci13.c
index 04cc4da..1de1efa 100644
--- a/20120301_a/c/src/eo06a.c
+++ b/20131202/c/src/apci13.c
@@ -1,30 +1,56 @@
-#include "sofam.h"
+#include "sofa.h"
 
-double iauEo06a(double date1, double date2)
+void iauApci13(double date1, double date2,
+               iauASTROM *astrom, double *eo)
 /*
-**  - - - - - - - - -
-**   i a u E o 0 6 a
-**  - - - - - - - - -
+**  - - - - - - - - - -
+**   i a u A p c i 1 3
+**  - - - - - - - - - -
 **
-**  Equation of the origins, IAU 2006 precession and IAU 2000A nutation.
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and geocentric CIRS
+**  coordinates.  The caller supplies the date, and SOFA models are used
+**  to predict the Earth ephemeris and CIP/CIO.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection, aberration, and bias-precession-nutation
+**  parts of the astrometric transformation chain.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     date1,date2  double    TT as a 2-part Julian Date (Note 1)
-**
-**  Returned (function value):
-**                  double    equation of the origins in radians
+**     date1  double      TDB as a 2-part...
+**     date2  double      ...Julian Date (Note 1)
+**
+**  Returned:
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**     eo     double*     equation of the origins (ERA-GST)
 **
 **  Notes:
 **
-**  1) The TT date date1+date2 is a Julian Date, apportioned in any
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
 **     convenient way between the two arguments.  For example,
-**     JD(TT)=2450123.7 could be expressed in any of these ways,
-**     among others:
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
 **
 **            date1          date2
 **
@@ -33,59 +59,95 @@ double iauEo06a(double date1, double date2)
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) In cases where the caller wishes to supply his own Earth
+**     ephemeris and CIP/CIO, the function iauApci can be used instead
+**     of the present function.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
 **
-**  2) The equation of the origins is the distance between the true
-**     equinox and the celestial intermediate origin and, equivalently,
-**     the difference between Earth rotation angle and Greenwich
-**     apparent sidereal time (ERA-GST).  It comprises the precession
-**     (since J2000.0) in right ascension plus the equation of the
-**     equinoxes (including the small correction terms).
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  5) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
 **
 **  Called:
+**     iauEpv00     Earth position and velocity
 **     iauPnm06a    classical NPB matrix, IAU 2006/2000A
 **     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
 **     iauS06       the CIO locator s, given X,Y, IAU 2006
-**     iauEors      equation of the origins, Given NPB matrix and s
-**
-**  References:
-**
-**     Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
+**     iauApci      astrometry parameters, ICRS-CIRS
+**     iauEors      equation of the origins, given NPB matrix and s
 **
-**     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
+**  This revision:   2013 October 9
 **
-**  This revision:  2008 May 16
+**  SOFA release 2013-12-02
 **
-**  SOFA release 2012-03-01
-**
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double r[3][3], x, y, s, eo;
+   double ehpv[2][3], ebpv[2][3], r[3][3], x, y, s;
+
 
+/* Earth barycentric & heliocentric position/velocity (au, au/d). */
+   (void) iauEpv00(date1, date2, ehpv, ebpv);
 
-/* Classical nutation x precession x bias matrix. */
+/* Form the equinox based BPN matrix, IAU 2006/2000A. */
    iauPnm06a(date1, date2, r);
 
-/* Extract CIP coordinates. */
+/* Extract CIP X,Y. */
    iauBpn2xy(r, &x, &y);
 
-/* The CIO locator, s. */
+/* Obtain CIO locator s. */
    s = iauS06(date1, date2, x, y);
 
-/* Solve for the EO. */
-   eo = iauEors(r, s);
+/* Compute the star-independent astrometry parameters. */
+   iauApci(date1, date2, ebpv, ehpv[0], x, y, s, astrom);
 
-   return eo;
+/* Equation of the origins. */
+   *eo = iauEors(r, s);
+
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -178,4 +240,5 @@ double iauEo06a(double date1, double date2)
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20131202/c/src/apco.c b/20131202/c/src/apco.c
new file mode 100644
index 0000000..c91f19d
--- /dev/null
+++ b/20131202/c/src/apco.c
@@ -0,0 +1,306 @@
+#include "sofa.h"
+
+void iauApco(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             double x, double y, double s, double theta,
+             double elong, double phi, double hm,
+             double xp, double yp, double sp,
+             double refa, double refb,
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p c o
+**  - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and observed
+**  coordinates.  The caller supplies the Earth ephemeris, the Earth
+**  rotation information and the refraction constants as well as the
+**  site coordinates.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     ebpv   double[2][3] Earth barycentric PV (au, au/day, Note 2)
+**     ehp    double[3]    Earth heliocentric P (au, Note 2)
+**     x,y    double       CIP X,Y (components of unit vector)
+**     s      double       the CIO locator s (radians)
+**     theta  double       Earth rotation angle (radians)
+**     elong  double       longitude (radians, east +ve, Note 3)
+**     phi    double       latitude (geodetic, radians, Note 3)
+**     hm     double       height above ellipsoid (m, geodetic, Note 3)
+**     xp,yp  double       polar motion coordinates (radians, Note 4)
+**     sp     double       the TIO locator s' (radians, Note 4)
+**     refa   double       refraction constant A (radians, Note 5)
+**     refb   double       refraction constant B (radians, Note 5)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) The vectors eb, eh, and all the astrom vectors, are with respect
+**     to BCRS axes.
+**
+**  3) The geographical coordinates are with respect to the WGS84
+**     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN
+**     CONVENTION:  the longitude required by the present function is
+**     right-handed, i.e. east-positive, in accordance with geographical
+**     convention.
+**
+**  4) xp and yp are the coordinates (in radians) of the Celestial
+**     Intermediate Pole with respect to the International Terrestrial
+**     Reference System (see IERS Conventions), measured along the
+**     meridians 0 and 90 deg west respectively.  sp is the TIO locator
+**     s', in radians, which positions the Terrestrial Intermediate
+**     Origin on the equator.  For many applications, xp, yp and
+**     (especially) sp can be set to zero.
+**
+**     Internally, the polar motion is stored in a form rotated onto the
+**     local meridian.
+**
+**  5) The refraction constants refa and refb are for use in a
+**     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
+**     (i.e. refracted) zenith distance and dZ is the amount of
+**     refraction.
+**
+**  6) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  7) In cases where the caller does not wish to provide the Earth
+**     Ephemeris, the Earth rotation information and refraction
+**     constants, the function iauApco13 can be used instead of the
+**     present function.  This starts from UTC and weather readings etc.
+**     and computes suitable values using other SOFA functions.
+**
+**  8) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  9) The context structure astrom produced by this function is used by
+**     iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauAper      astrometry parameters: update ERA
+**     iauC2ixys    celestial-to-intermediate matrix, given X,Y and s
+**     iauPvtob     position/velocity of terrestrial station
+**     iauTrxpv     product of transpose of r-matrix and pv-vector
+**     iauApcs      astrometry parameters, ICRS-GCRS, space observer
+**     iauCr        copy r-matrix
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   double sl, cl, r[3][3], pvc[2][3], pv[2][3];
+
+
+/* Longitude with adjustment for TIO locator s'. */
+   astrom->along = elong + sp;
+
+/* Polar motion, rotated onto the local meridian. */
+   sl = sin(astrom->along);
+   cl = cos(astrom->along);
+   astrom->xpl = xp*cl - yp*sl;
+   astrom->ypl = xp*sl + yp*cl;
+
+/* Functions of latitude. */
+   astrom->sphi = sin(phi);
+   astrom->cphi = cos(phi);
+
+/* Refraction constants. */
+   astrom->refa = refa;
+   astrom->refb = refb;
+
+/* Local Earth rotation angle. */
+   iauAper(theta, astrom);
+
+/* Disable the (redundant) diurnal aberration step. */
+   astrom->diurab = 0.0;
+
+/* CIO based BPN matrix. */
+   iauC2ixys(x, y, s, r);
+
+/* Observer's geocentric position and velocity (m, m/s, CIRS). */
+   iauPvtob(elong, phi, hm, xp, yp, sp, theta, pvc);
+
+/* Rotate into GCRS. */
+   iauTrxpv(r, pvc, pv);
+
+/* ICRS <-> GCRS parameters. */
+   iauApcs(date1, date2, pv, ebpv, ehp, astrom);
+
+/* Store the CIO based BPN matrix. */
+   iauCr(r, astrom->bpn );
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/apco13.c b/20131202/c/src/apco13.c
new file mode 100644
index 0000000..9589f0e
--- /dev/null
+++ b/20131202/c/src/apco13.c
@@ -0,0 +1,330 @@
+#include "sofa.h"
+
+int iauApco13(double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              iauASTROM *astrom, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A p c o 1 3
+**  - - - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between ICRS and observed
+**  coordinates.  The caller supplies UTC, site coordinates, ambient air
+**  conditions and observing wavelength, and SOFA models are used to
+**  obtain the Earth ephemeris, CIP/CIO and refraction constants.
+**
+**  The parameters produced by this function are required in the
+**  parallax, light deflection, aberration, and bias-precession-nutation
+**  parts of the ICRS/CIRS transformations.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     utc1   double     UTC as a 2-part...
+**     utc2   double     ...quasi Julian Date (Notes 1,2)
+**     dut1   double     UT1-UTC (seconds, Note 3)
+**     theta  double     Earth rotation angle (radians)
+**     elong  double     longitude (radians, east +ve, Note 4)
+**     phi    double     latitude (geodetic, radians, Note 4)
+**     hm     double     height above ellipsoid (m, geodetic, Notes 4,6)
+**     xp,yp  double     polar motion coordinates (radians, Note 5)
+**     phpa   double     pressure at the observer (hPa = mB, Note 6)
+**     tc     double     ambient temperature at the observer (deg C)
+**     rh     double     relative humidity at the observer (range 0-1)
+**     wl     double     wavelength (micrometers, Note 7)
+**
+**  Returned:
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**     eo     double*    equation of the origins (ERA-GST)
+**
+**  Returned (function value):
+**            int        status: +1 = dubious year (Note 2)
+**                                0 = OK
+**                               -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  2)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  3)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  4)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  5)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**      Internally, the polar motion is stored in a form rotated onto
+**      the local meridian.
+**
+**  6)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  7)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  8)  It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  9)  In cases where the caller wishes to supply his own Earth
+**      ephemeris, Earth rotation information and refraction constants,
+**      the function iauApco can be used instead of the present function.
+**
+**  10) This is one of several functions that inserts into the astrom
+**      structure star-independent parameters needed for the chain of
+**      astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**      The various functions support different classes of observer and
+**      portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**      Those with names ending in "13" use contemporary SOFA models to
+**      compute the various ephemerides.  The others accept ephemerides
+**      supplied by the caller.
+**
+**      The transformation from ICRS to GCRS covers space motion,
+**      parallax, light deflection, and aberration.  From GCRS to CIRS
+**      comprises frame bias and precession-nutation.  From CIRS to
+**      observed takes account of Earth rotation, polar motion, diurnal
+**      aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**      transformation), and atmospheric refraction.
+**
+**  11) The context structure astrom produced by this function is used
+**      by iauAtioq, iauAtoiq, iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauUtctai    UTC to TAI
+**     iauTaitt     TAI to TT
+**     iauUtcut1    UTC to UT1
+**     iauEpv00     Earth position and velocity
+**     iauPnm06a    classical NPB matrix, IAU 2006/2000A
+**     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
+**     iauS06       the CIO locator s, given X,Y, IAU 2006
+**     iauEra00     Earth rotation angle, IAU 2000
+**     iauSp00      the TIO locator s', IERS 2000
+**     iauRefco     refraction constants for given ambient conditions
+**     iauApco      astrometry parameters, ICRS-observed
+**     iauEors      equation of the origins, given NPB matrix and s
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j;
+   double tai1, tai2, tt1, tt2, ut11, ut12, ehpv[2][3], ebpv[2][3],
+          r[3][3], x, y, s, theta, sp, refa, refb;
+
+
+/* UTC to other time scales. */
+   j = iauUtctai(utc1, utc2, &tai1, &tai2);
+   if ( j < 0 ) return -1;
+   j = iauTaitt(tai1, tai2, &tt1, &tt2);
+   j = iauUtcut1(utc1, utc2, dut1, &ut11, &ut12);
+   if ( j < 0 ) return -1;
+
+/* Earth barycentric & heliocentric position/velocity (au, au/d). */
+   (void) iauEpv00(tt1, tt2, ehpv, ebpv);
+
+/* Form the equinox based BPN matrix, IAU 2006/2000A. */
+   iauPnm06a(tt1, tt2, r);
+
+/* Extract CIP X,Y. */
+   iauBpn2xy(r, &x, &y);
+
+/* Obtain CIO locator s. */
+   s = iauS06(tt1, tt2, x, y);
+
+/* Earth rotation angle. */
+   theta = iauEra00(ut11, ut12);
+
+/* TIO locator s'. */
+   sp = iauSp00(tt1, tt2);
+
+/* Refraction constants A and B. */
+   iauRefco(phpa, tc, rh, wl, &refa, &refb);
+
+/* Compute the star-independent astrometry parameters. */
+   iauApco(tt1, tt2, ebpv, ehpv[0], x, y, s, theta,
+           elong, phi, hm, xp, yp, sp, refa, refb, astrom);
+
+/* Equation of the origins. */
+   *eo = iauEors(r, s);
+
+/* Return any warning status. */
+   return j;
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/apcs.c b/20131202/c/src/apcs.c
new file mode 100644
index 0000000..2b7940c
--- /dev/null
+++ b/20131202/c/src/apcs.c
@@ -0,0 +1,275 @@
+#include "sofa.h"
+
+void iauApcs(double date1, double date2, double pv[2][3],
+             double ebpv[2][3], double ehp[3],
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p c s
+**  - - - - - - - -
+**
+**  For an observer whose geocentric position and velocity are known,
+**  prepare star-independent astrometry parameters for transformations
+**  between ICRS and GCRS.  The Earth ephemeris is supplied by the
+**  caller.
+**
+**  The parameters produced by this function are required in the space
+**  motion, parallax, light deflection and aberration parts of the
+**  astrometric transformation chain.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     pv     double[2][3] observer's geocentric pos/vel (m, m/s)
+**     ebpv   double[2][3] Earth barycentric PV (au, au/day)
+**     ehp    double[3]    Earth heliocentric P (au)
+**
+**  Returned:
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
+**
+**  Notes:
+**
+**  1) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
+**
+**            date1          date2
+**
+**         2450123.7           0.0       (JD method)
+**         2451545.0       -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5           0.2       (date & time method)
+**
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) Providing separate arguments for (i) the observer's geocentric
+**     position and velocity and (ii) the Earth ephemeris is done for
+**     convenience in the geocentric, terrestrial and Earth orbit cases.
+**     For deep space applications it maybe more convenient to specify
+**     zero geocentric position and velocity and to supply the
+**     observer's position and velocity information directly instead of
+**     with respect to the Earth.  However, note the different units:
+**     m and m/s for the geocentric vectors, au and au/day for the
+**     heliocentric and barycentric vectors.
+**
+**  4) In cases where the caller does not wish to provide the Earth
+**     ephemeris, the function iauApcs13 can be used instead of the
+**     present function.  This computes the Earth ephemeris using the
+**     SOFA function iauEpv00.
+**
+**  5) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  6) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
+**
+**  Called:
+**     iauCp        copy p-vector
+**     iauPm        modulus of p-vector
+**     iauPn        decompose p-vector into modulus and direction
+**     iauIr        initialize r-matrix to identity
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+/* au/d to m/s */
+   const double AUDMS = DAU/DAYSEC;
+
+/* Light time for 1 AU (day) */
+   const double CR = AULT/DAYSEC;
+
+   int i;
+   double dp, dv, pb[3], vb[3], ph[3], v2, w;
+
+
+/* Time since reference epoch, years (for proper motion calculation). */
+   astrom->pmt = ( (date1 - DJ00) + date2 ) / DJY;
+
+/* Adjust Earth ephemeris to observer. */
+   for (i = 0; i < 3; i++) {
+      dp = pv[0][i] / DAU;
+      dv = pv[1][i] / AUDMS;
+      pb[i] = ebpv[0][i] + dp;
+      vb[i] = ebpv[1][i] + dv;
+      ph[i] = ehp[i] + dp;
+   }
+
+/* Barycentric position of observer (au). */
+   iauCp(pb, astrom->eb);
+
+/* Heliocentric direction and distance (unit vector and au). */
+   iauPn(ph, &astrom->em, astrom->eh);
+
+/* Barycentric vel. in units of c, and reciprocal of Lorenz factor. */
+   v2 = 0.0;
+   for (i = 0; i < 3; i++) {
+      w = vb[i] * CR;
+      astrom->v[i] = w;
+      v2 += w*w;
+   }
+   astrom->bm1 = sqrt(1.0 - v2);
+
+/* Reset the NPB matrix. */
+   iauIr(astrom->bpn);
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20120301_a/c/src/pnm80.c b/20131202/c/src/apcs13.c
similarity index 51%
copy from 20120301_a/c/src/pnm80.c
copy to 20131202/c/src/apcs13.c
index ce1750e..c64a5f4 100644
--- a/20120301_a/c/src/pnm80.c
+++ b/20131202/c/src/apcs13.c
@@ -1,31 +1,55 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPnm80(double date1, double date2, double rmatpn[3][3])
+void iauApcs13(double date1, double date2, double pv[2][3],
+               iauASTROM *astrom)
 /*
-**  - - - - - - - - -
-**   i a u P n m 8 0
-**  - - - - - - - - -
+**  - - - - - - - - - -
+**   i a u A p c s 1 3
+**  - - - - - - - - - -
 **
-**  Form the matrix of precession/nutation for a given date, IAU 1976
-**  precession model, IAU 1980 nutation model.
+**  For an observer whose geocentric position and velocity are known,
+**  prepare star-independent astrometry parameters for transformations
+**  between ICRS and GCRS.  The Earth ephemeris is from SOFA models.
+**
+**  The parameters produced by this function are required in the space
+**  motion, parallax, light deflection and aberration parts of the
+**  astrometric transformation chain.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     date1,date2    double         TDB date (Note 1)
+**     date1  double       TDB as a 2-part...
+**     date2  double       ...Julian Date (Note 1)
+**     pv     double[2][3] observer's geocentric pos/vel (Note 3)
 **
 **  Returned:
-**     rmatpn         double[3][3]   combined precession/nutation matrix
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       unchanged
+**      refa   double       unchanged
+**      refb   double       unchanged
 **
 **  Notes:
 **
 **  1) The TDB date date1+date2 is a Julian Date, apportioned in any
 **     convenient way between the two arguments.  For example,
-**     JD(TDB)=2450123.7 could be expressed in any of these ways,
-**     among others:
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
 **
 **            date1          date2
 **
@@ -34,53 +58,85 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
 **
-**  2) The matrix operates in the sense V(date) = rmatpn * V(J2000),
-**     where the p-vector V(date) is with respect to the true equatorial
-**     triad of date date1+date2 and the p-vector V(J2000) is with
-**     respect to the mean equatorial triad of epoch J2000.0.
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
 **
-**  Called:
-**     iauPmat76    precession matrix, IAU 1976
-**     iauNutm80    nutation matrix, IAU 1980
-**     iauRxr       product of two r-matrices
+**  2) All the vectors are with respect to BCRS axes.
+**
+**  3) The observer's position and velocity pv are geocentric but with
+**     respect to BCRS axes, and in units of m and m/s.  No assumptions
+**     are made about proximity to the Earth, and the function can be
+**     used for deep space applications as well as Earth orbit and
+**     terrestrial.
+**
+**  4) In cases where the caller wishes to supply his own Earth
+**     ephemeris, the function iauApcs can be used instead of the present
+**     function.
+**
+**  5) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
 **
-**  Reference:
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
 **
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 3.3 (p145).
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
 **
-**  This revision:  2010 January 23
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
 **
-**  SOFA release 2012-03-01
+**  6) The context structure astrom produced by this function is used by
+**     iauAtciq* and iauAticq*.
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Called:
+**     iauEpv00     Earth position and velocity
+**     iauApcs      astrometry parameters, ICRS-GCRS, space observer
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double rmatp[3][3], rmatn[3][3];
-
+   double ehpv[2][3], ebpv[2][3];
 
-/* Precession matrix, J2000.0 to date. */
-   iauPmat76(date1, date2, rmatp);
 
-/* Nutation matrix. */
-   iauNutm80(date1, date2, rmatn);
+/* Earth barycentric & heliocentric position/velocity (au, au/d). */
+   (void) iauEpv00(date1, date2, ehpv, ebpv);
 
-/* Combine the matrices:  PN = N x P. */
-   iauRxr(rmatn, rmatp, rmatpn);
+/* Compute the star-independent astrometry parameters. */
+   iauApcs(date1, date2, pv, ebpv, ehpv[0], astrom);
 
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -173,4 +229,5 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/tf2d.c b/20131202/c/src/aper.c
similarity index 54%
copy from 20120301_a/c/src/tf2d.c
copy to 20131202/c/src/aper.c
index e3bbe54..b966495 100644
--- a/20120301_a/c/src/tf2d.c
+++ b/20131202/c/src/aper.c
@@ -1,13 +1,13 @@
-#include "sofam.h"
-#include <stdlib.h>
+#include "sofa.h"
 
-int iauTf2d(char s, int ihour, int imin, double sec, double *days)
+void iauAper(double theta, iauASTROM *astrom)
 /*
 **  - - - - - - - -
-**   i a u T f 2 d
+**   i a u A p e r
 **  - - - - - - - -
 **
-**  Convert hours, minutes, seconds to days.
+**  In the star-independent astrometry parameters, update only the
+**  Earth rotation angle, supplied by the caller explicitly.
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards of Fundamental Astronomy) software collection.
@@ -15,53 +15,99 @@ int iauTf2d(char s, int ihour, int imin, double sec, double *days)
 **  Status:  support function.
 **
 **  Given:
-**     s         char    sign:  '-' = negative, otherwise positive
-**     ihour     int     hours
-**     imin      int     minutes
-**     sec       double  seconds
+**     theta   double      Earth rotation angle (radians, Note 2)
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       not used
+**      eb     double[3]    not used
+**      eh     double[3]    not used
+**      em     double       not used
+**      v      double[3]    not used
+**      bm1    double       not used
+**      bpn    double[3][3] not used
+**      along  double       longitude + s' (radians)
+**      xpl    double       not used
+**      ypl    double       not used
+**      sphi   double       not used
+**      cphi   double       not used
+**      diurab double       not used
+**      eral   double       not used
+**      refa   double       not used
+**      refb   double       not used
 **
 **  Returned:
-**     days      double  interval in days
-**
-**  Returned (function value):
-**               int     status:  0 = OK
-**                                1 = ihour outside range 0-23
-**                                2 = imin outside range 0-59
-**                                3 = sec outside range 0-59.999...
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       unchanged
+**      refb   double       unchanged
 **
 **  Notes:
 **
-**  1)  The result is computed even if any of the range checks fail.
+**  1) This function exists to enable sidereal-tracking applications to
+**     avoid wasteful recomputation of the bulk of the astrometry
+**     parameters:  only the Earth rotation is updated.
+**
+**  2) For targets expressed as equinox based positions, such as
+**     classical geocentric apparent (RA,Dec), the supplied theta can be
+**     Greenwich apparent sidereal time rather than Earth rotation
+**     angle.
+**
+**  3) The function iauAper13 can be used instead of the present
+**     function, and starts from UT1 rather than ERA itself.
+**
+**  4) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
 **
-**  2)  Negative ihour, imin and/or sec produce a warning status, but
-**      the absolute value is used in the conversion.
+**          functions         observer        transformation
 **
-**  3)  If there are multiple errors, the status value reflects only the
-**      first, the smallest taking precedence.
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
 **
-**  This revision:  2012 February 13
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
 **
-**  SOFA release 2012-03-01
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  This revision:   2013 September 25
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
+   astrom->eral = theta + astrom->along;
 
-/* Compute the interval. */
-   *days  = ( s == '-' ? -1.0 : 1.0 ) *
-            ( 60.0 * ( 60.0 * ( (double) abs(ihour) ) +
-                              ( (double) abs(imin) ) ) +
-                                         fabs(sec) ) / DAYSEC;
-
-/* Validate arguments and return status. */
-   if ( ihour < 0 || ihour > 23 ) return 1;
-   if ( imin < 0 || imin > 59 ) return 2;
-   if ( sec < 0.0 || sec >= 60.0 ) return 3;
-   return 0;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -154,4 +200,5 @@ int iauTf2d(char s, int ihour, int imin, double sec, double *days)
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/c2t00b.c b/20131202/c/src/aper13.c
similarity index 54%
copy from 20120301_a/c/src/c2t00b.c
copy to 20131202/c/src/aper13.c
index b6116ef..c1e217f 100644
--- a/20120301_a/c/src/c2t00b.c
+++ b/20131202/c/src/aper13.c
@@ -1,110 +1,132 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauC2t00b(double tta, double ttb, double uta, double utb,
-               double xp, double yp, double rc2t[3][3])
+void iauAper13(double ut11, double ut12, iauASTROM *astrom)
 /*
 **  - - - - - - - - - -
-**   i a u C 2 t 0 0 b
+**   i a u A p e r 1 3
 **  - - - - - - - - - -
 **
-**  Form the celestial to terrestrial matrix given the date, the UT1 and
-**  the polar motion, using the IAU 2000B nutation model.
+**  In the star-independent astrometry parameters, update only the
+**  Earth rotation angle.  The caller provides UT1, (n.b. not UTC).
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     tta,ttb  double         TT as a 2-part Julian Date (Note 1)
-**     uta,utb  double         UT1 as a 2-part Julian Date (Note 1)
-**     xp,yp    double         coordinates of the pole (radians, Note 2)
+**     ut11    double      UT1 as a 2-part...
+**     ut12    double      ...Julian Date (Note 1)
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       not used
+**      eb     double[3]    not used
+**      eh     double[3]    not used
+**      em     double       not used
+**      v      double[3]    not used
+**      bm1    double       not used
+**      bpn    double[3][3] not used
+**      along  double       longitude + s' (radians)
+**      xpl    double       not used
+**      ypl    double       not used
+**      sphi   double       not used
+**      cphi   double       not used
+**      diurab double       not used
+**      eral   double       not used
+**      refa   double       not used
+**      refb   double       not used
 **
 **  Returned:
-**     rc2t     double[3][3]   celestial-to-terrestrial matrix (Note 3)
+**     astrom  iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       unchanged
+**      xpl    double       unchanged
+**      ypl    double       unchanged
+**      sphi   double       unchanged
+**      cphi   double       unchanged
+**      diurab double       unchanged
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       unchanged
+**      refb   double       unchanged
 **
 **  Notes:
 **
-**  1) The TT and UT1 dates tta+ttb and uta+utb are Julian Dates,
-**     apportioned in any convenient way between the arguments uta and
-**     utb.  For example, JD(UT1)=2450123.7 could be expressed in any of
-**     these ways, among others:
+**  1) The UT1 date (n.b. not UTC) ut11+ut12 is a Julian Date,
+**     apportioned in any convenient way between the arguments ut11 and
+**     ut12.  For example, JD(UT1)=2450123.7 could be expressed in any
+**     of these ways, among others:
 **
-**             uta            utb
+**            ut11           ut12
 **
 **         2450123.7           0.0       (JD method)
 **         2451545.0       -1421.3       (J2000 method)
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution is
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
 **     acceptable.  The J2000 and MJD methods are good compromises
-**     between resolution and convenience.  In the case of uta,utb, the
-**     date & time method is best matched to the Earth rotation angle
-**     algorithm used:  maximum precision is delivered when the uta
-**     argument is for 0hrs UT1 on the day in question and the utb
-**     argument lies in the range 0 to 1, or vice versa.
-**
-**  2) The arguments xp and yp are the coordinates (in radians) of the
-**     Celestial Intermediate Pole with respect to the International
-**     Terrestrial Reference System (see IERS Conventions 2003),
-**     measured along the meridians to 0 and 90 deg west respectively.
-**
-**  3) The matrix rc2t transforms from celestial to terrestrial
-**     coordinates:
-**
-**        [TRS] = RPOM * R_3(ERA) * RC2I * [CRS]
-**
-**              = rc2t * [CRS]
-**
-**     where [CRS] is a vector in the Geocentric Celestial Reference
-**     System and [TRS] is a vector in the International Terrestrial
-**     Reference System (see IERS Conventions 2003), RC2I is the
-**     celestial-to-intermediate matrix, ERA is the Earth rotation
-**     angle and RPOM is the polar motion matrix.
-**
-**  4) The present function is faster, but slightly less accurate (about
-**     1 mas), than the iauC2t00a function.
+**     between resolution and convenience.  The date & time method is
+**     best matched to the algorithm used:  maximum precision is
+**     delivered when the ut11 argument is for 0hrs UT1 on the day in
+**     question and the ut12 argument lies in the range 0 to 1, or vice
+**     versa.
+**
+**  2) If the caller wishes to provide the Earth rotation angle itself,
+**     the function iauAper can be used instead.  One use of this
+**     technique is to substitute Greenwich apparent sidereal time and
+**     thereby to support equinox based transformations directly.
+**
+**  3) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
 **
 **  Called:
-**     iauC2i00b    celestial-to-intermediate matrix, IAU 2000B
+**     iauAper      astrometry parameters: update ERA
 **     iauEra00     Earth rotation angle, IAU 2000
-**     iauPom00     polar motion matrix
-**     iauC2tcio    form CIO-based celestial-to-terrestrial matrix
-**
-**  Reference:
 **
-**     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
-**     IERS Technical Note No. 32, BKG (2004)
+**  This revision:   2013 September 25
 **
-**  This revision:  2009 April 1
+**  SOFA release 2013-12-02
 **
-**  SOFA release 2012-03-01
-**
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double rc2i[3][3], era, rpom[3][3];
-
-
-/* Form the celestial-to-intermediate matrix for this TT (IAU 2000B). */
-   iauC2i00b(tta, ttb, rc2i);
-
-/* Predict the Earth rotation angle for this UT1. */
-   era = iauEra00(uta, utb);
+   iauAper(iauEra00(ut11,ut12), astrom);
 
-/* Form the polar motion matrix (neglecting s'). */
-   iauPom00(xp, yp, 0.0, rpom);
-
-/* Combine to form the celestial-to-terrestrial matrix. */
-   iauC2tcio(rc2i, era, rpom, rc2t);
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -197,4 +219,5 @@ void iauC2t00b(double tta, double ttb, double uta, double utb,
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20131202/c/src/apio.c b/20131202/c/src/apio.c
new file mode 100644
index 0000000..3c98fba
--- /dev/null
+++ b/20131202/c/src/apio.c
@@ -0,0 +1,255 @@
+#include "sofa.h"
+
+void iauApio(double sp, double theta,
+             double elong, double phi, double hm, double xp, double yp,
+             double refa, double refb,
+             iauASTROM *astrom)
+/*
+**  - - - - - - - -
+**   i a u A p i o
+**  - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between CIRS and observed
+**  coordinates.  The caller supplies the Earth orientation information
+**  and the refraction constants as well as the site coordinates.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     sp     double      the TIO locator s' (radians, Note 1)
+**     theta  double      Earth rotation angle (radians)
+**     elong  double      longitude (radians, east +ve, Note 2)
+**     phi    double      geodetic latitude (radians, Note 2)
+**     hm     double      height above ellipsoid (m, geodetic Note 2)
+**     xp,yp  double      polar motion coordinates (radians, Note 3)
+**     refa   double      refraction constant A (radians, Note 4)
+**     refb   double      refraction constant B (radians, Note 4)
+**
+**  Returned:
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Notes:
+**
+**  1) sp, the TIO locator s', is a tiny quantity needed only by the
+**     most precise applications.  It can either be set to zero or
+**     predicted using the SOFA function iauSp00.
+**
+**  2) The geographical coordinates are with respect to the WGS84
+**     reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**     longitude required by the present function is east-positive
+**     (i.e. right-handed), in accordance with geographical convention.
+**
+**  3) The polar motion xp,yp can be obtained from IERS bulletins.  The
+**     values are the coordinates (in radians) of the Celestial
+**     Intermediate Pole with respect to the International Terrestrial
+**     Reference System (see IERS Conventions 2003), measured along the
+**     meridians 0 and 90 deg west respectively.  For many applications,
+**     xp and yp can be set to zero.
+**
+**     Internally, the polar motion is stored in a form rotated onto the
+**     local meridian.
+**
+**  4) The refraction constants refa and refb are for use in a
+**     dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
+**     (i.e. refracted) zenith distance and dZ is the amount of
+**     refraction.
+**
+**  5) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  6) In cases where the caller does not wish to provide the Earth
+**     rotation information and refraction constants, the function
+**     iauApio13 can be used instead of the present function.  This
+**     starts from UTC and weather readings etc. and computes suitable
+**     values using other SOFA functions.
+**
+**  7) This is one of several functions that inserts into the astrom
+**     structure star-independent parameters needed for the chain of
+**     astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**     The various functions support different classes of observer and
+**     portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**     Those with names ending in "13" use contemporary SOFA models to
+**     compute the various ephemerides.  The others accept ephemerides
+**     supplied by the caller.
+**
+**     The transformation from ICRS to GCRS covers space motion,
+**     parallax, light deflection, and aberration.  From GCRS to CIRS
+**     comprises frame bias and precession-nutation.  From CIRS to
+**     observed takes account of Earth rotation, polar motion, diurnal
+**     aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**     transformation), and atmospheric refraction.
+**
+**  8) The context structure astrom produced by this function is used by
+**     iauAtioq and iauAtoiq.
+**
+**  Called:
+**     iauPvtob     position/velocity of terrestrial station
+**     iauAper      astrometry parameters: update ERA
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   double sl, cl, pv[2][3];
+
+
+/* Longitude with adjustment for TIO locator s'. */
+   astrom->along = elong + sp;
+
+/* Polar motion, rotated onto the local meridian. */
+   sl = sin(astrom->along);
+   cl = cos(astrom->along);
+   astrom->xpl = xp*cl - yp*sl;
+   astrom->ypl = xp*sl + yp*cl;
+
+/* Functions of latitude. */
+   astrom->sphi = sin(phi);
+   astrom->cphi = cos(phi);
+
+/* Observer's geocentric position and velocity (m, m/s, CIRS). */
+   iauPvtob(elong, phi, hm, xp, yp, sp, theta, pv);
+
+/* Magnitude of diurnal aberration vector. */
+   astrom->diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
+
+/* Refraction constants. */
+   astrom->refa = refa;
+   astrom->refb = refb;
+
+/* Local Earth rotation angle. */
+   iauAper(theta, astrom);
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/apio13.c b/20131202/c/src/apio13.c
new file mode 100644
index 0000000..22b9c6c
--- /dev/null
+++ b/20131202/c/src/apio13.c
@@ -0,0 +1,301 @@
+#include "sofa.h"
+
+int iauApio13(double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              iauASTROM *astrom)
+/*
+**  - - - - - - - - - -
+**   i a u A p i o 1 3
+**  - - - - - - - - - -
+**
+**  For a terrestrial observer, prepare star-independent astrometry
+**  parameters for transformations between CIRS and observed
+**  coordinates.  The caller supplies UTC, site coordinates, ambient air
+**  conditions and observing wavelength.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     utc1   double      UTC as a 2-part...
+**     utc2   double      ...quasi Julian Date (Notes 1,2)
+**     dut1   double      UT1-UTC (seconds)
+**     elong  double      longitude (radians, east +ve, Note 3)
+**     phi    double      geodetic latitude (radians, Note 3)
+**     hm     double      height above ellipsoid (m, geodetic Notes 4,6)
+**     xp,yp  double      polar motion coordinates (radians, Note 5)
+**     phpa   double      pressure at the observer (hPa = mB, Note 6)
+**     tc     double      ambient temperature at the observer (deg C)
+**     rh     double      relative humidity at the observer (range 0-1)
+**     wl     double      wavelength (micrometers, Note 7)
+**
+**  Returned:
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       unchanged
+**      eb     double[3]    unchanged
+**      eh     double[3]    unchanged
+**      em     double       unchanged
+**      v      double[3]    unchanged
+**      bm1    double       unchanged
+**      bpn    double[3][3] unchanged
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned (function value):
+**            int         status: +1 = dubious year (Note 2)
+**                                 0 = OK
+**                                -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  2)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the future
+**      to be trusted.  See iauDat for further details.
+**
+**  3)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  4)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  5)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many applications,
+**      xp and yp can be set to zero.
+**
+**      Internally, the polar motion is stored in a form rotated onto
+**      the local meridian.
+**
+**  6)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to the
+**      pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  7)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  8)  It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  9)  In cases where the caller wishes to supply his own Earth
+**      rotation information and refraction constants, the function
+**      iauApc can be used instead of the present function.
+**
+**  10) This is one of several functions that inserts into the astrom
+**      structure star-independent parameters needed for the chain of
+**      astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
+**
+**      The various functions support different classes of observer and
+**      portions of the transformation chain:
+**
+**          functions         observer        transformation
+**
+**       iauApcg iauApcg13    geocentric      ICRS <-> GCRS
+**       iauApci iauApci13    terrestrial     ICRS <-> CIRS
+**       iauApco iauApco13    terrestrial     ICRS <-> observed
+**       iauApcs iauApcs13    space           ICRS <-> GCRS
+**       iauAper iauAper13    terrestrial     update Earth rotation
+**       iauApio iauApio13    terrestrial     CIRS <-> observed
+**
+**      Those with names ending in "13" use contemporary SOFA models to
+**      compute the various ephemerides.  The others accept ephemerides
+**      supplied by the caller.
+**
+**      The transformation from ICRS to GCRS covers space motion,
+**      parallax, light deflection, and aberration.  From GCRS to CIRS
+**      comprises frame bias and precession-nutation.  From CIRS to
+**      observed takes account of Earth rotation, polar motion, diurnal
+**      aberration and parallax (unless subsumed into the ICRS <-> GCRS
+**      transformation), and atmospheric refraction.
+**
+**  11) The context structure astrom produced by this function is used
+**      by iauAtioq and iauAtoiq.
+**
+**  Called:
+**     iauUtctai    UTC to TAI
+**     iauTaitt     TAI to TT
+**     iauUtcut1    UTC to UT1
+**     iauSp00      the TIO locator s', IERS 2000
+**     iauEra00     Earth rotation angle, IAU 2000
+**     iauRefco     refraction constants for given ambient conditions
+**     iauApio      astrometry parameters, CIRS-observed
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j;
+   double tai1, tai2, tt1, tt2, ut11, ut12, sp, theta, refa, refb;
+
+
+/* UTC to other time scales. */
+   j = iauUtctai(utc1, utc2, &tai1, &tai2);
+   if ( j < 0 ) return -1;
+   j = iauTaitt(tai1, tai2, &tt1, &tt2);
+   j = iauUtcut1(utc1, utc2, dut1, &ut11, &ut12);
+   if ( j < 0 ) return -1;
+
+/* TIO locator s'. */
+   sp = iauSp00(tt1, tt2);
+
+/* Earth rotation angle. */
+   theta = iauEra00(ut11, ut12);
+
+/* Refraction constants A and B. */
+   iauRefco(phpa, tc, rh, wl, &refa, &refb);
+
+/* CIRS <-> observed astrometry parameters. */
+   iauApio(sp, theta, elong, phi, hm, xp, yp, refa, refb, astrom);
+
+/* Return any warning status. */
+   return j;
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20120301_a/c/src/prec76.c b/20131202/c/src/atci13.c
similarity index 59%
copy from 20120301_a/c/src/prec76.c
copy to 20131202/c/src/atci13.c
index c08700a..bf491c5 100644
--- a/20120301_a/c/src/prec76.c
+++ b/20131202/c/src/atci13.c
@@ -1,42 +1,51 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPrec76(double ep01, double ep02, double ep11, double ep12,
-               double *zeta, double *z, double *theta)
+void iauAtci13(double rc, double dc,
+               double pr, double pd, double px, double rv,
+               double date1, double date2,
+               double *ri, double *di, double *eo)
 /*
 **  - - - - - - - - - -
-**   i a u P r e c 7 6
+**   i a u A t c i 1 3
 **  - - - - - - - - - -
 **
-**  IAU 1976 precession model.
-**
-**  This function forms the three Euler angles which implement general
-**  precession between two epochs, using the IAU 1976 model (as for
-**  the FK5 catalog).
+**  Transform ICRS star data, epoch J2000.0, to CIRS.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  canonical model.
+**  Status:  support function.
 **
 **  Given:
-**     ep01,ep02   double    TDB starting epoch (Note 1)
-**     ep11,ep12   double    TDB ending epoch (Note 1)
+**     rc     double   ICRS right ascension at J2000.0 (radians, Note 1)
+**     dc     double   ICRS declination at J2000.0 (radians, Note 1)
+**     pr     double   RA proper motion (radians/year; Note 2)
+**     pd     double   Dec proper motion (radians/year)
+**     px     double   parallax (arcsec)
+**     rv     double   radial velocity (km/s, +ve if receding)
+**     date1  double   TDB as a 2-part...
+**     date2  double   ...Julian Date (Note 3)
 **
 **  Returned:
-**     zeta        double    1st rotation: radians cw around z
-**     z           double    3rd rotation: radians cw around z
-**     theta       double    2nd rotation: radians ccw around y
+**     ri,di  double*  CIRS geocentric RA,Dec (radians)
+**     eo     double*  equation of the origins (ERA-GST, Note 5)
 **
 **  Notes:
 **
-**  1) The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
-**     in any convenient way between the arguments epn1 and epn2.  For
-**     example, JD(TDB)=2450123.7 could be expressed in any of these
-**     ways, among others:
+**  1) Star data for an epoch other than J2000.0 (for example from the
+**     Hipparcos catalog, which has an epoch of J1991.25) will require a
+**     preliminary call to iauPmsafe before use.
+**
+**  2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
 **
-**             epn1          epn2
+**  3) The TDB date date1+date2 is a Julian Date, apportioned in any
+**     convenient way between the two arguments.  For example,
+**     JD(TDB)=2450123.8g could be expressed in any of these ways, among
+**     others:
 **
-**         2450123.7           0.0       (JD method)
+**            date1          date2
+**
+**         2450123.8g           0.0       (JD method)
 **         2451545.0       -1421.3       (J2000 method)
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
@@ -45,64 +54,57 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **     where the loss of several decimal digits of resolution is
 **     acceptable.  The J2000 method is best matched to the way the
 **     argument is handled internally and will deliver the optimum
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
-**     The two epochs may be expressed using different methods, but at
-**     the risk of losing some resolution.
-**
-**  2) The accumulated precession angles zeta, z, theta are expressed
-**     through canonical polynomials which are valid only for a limited
-**     time span.  In addition, the IAU 1976 precession rate is known to
-**     be imperfect.  The absolute accuracy of the present formulation
-**     is better than 0.1 arcsec from 1960AD to 2040AD, better than
-**     1 arcsec from 1640AD to 2360AD, and remains below 3 arcsec for
-**     the whole of the period 500BC to 3000AD.  The errors exceed
-**     10 arcsec outside the range 1200BC to 3900AD, exceed 100 arcsec
-**     outside 4200BC to 5600AD and exceed 1000 arcsec outside 6800BC to
-**     8200AD.
-**
-**  3) The three angles are returned in the conventional order, which
-**     is not the same as the order of the corresponding Euler
-**     rotations.  The precession matrix is
-**     R_3(-z) x R_2(+theta) x R_3(-zeta).
-**
-**  Reference:
-**
-**     Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations
-**     (6) & (7), p283.
-**
-**  This revision:  2009 December 17
-**
-**  SOFA release 2012-03-01
-**
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  4) The available accuracy is better than 1 milliarcsecond, limited
+**     mainly by the precession-nutation model that is used, namely
+**     IAU 2000A/2006.  Very close to solar system bodies, additional
+**     errors of up to several milliarcseconds can occur because of
+**     unmodeled light deflection;  however, the Sun's contribution is
+**     taken into account, to first order.  The accuracy limitations of
+**     the SOFA function iauEpv00 (used to compute Earth position and
+**     velocity) can contribute aberration errors of up to
+**     5 microarcseconds.  Light deflection at the Sun's limb is
+**     uncertain at the 0.4 mas level.
+**
+**  5) Should the transformation to (equinox based) apparent place be
+**     required rather than (CIO based) intermediate place, subtract the
+**     equation of the origins from the returned right ascension:
+**     RA = RI - EO. (The iauAnp function can then be applied, as
+**     required, to keep the result in the conventional 0-2pi range.)
+**
+**  Called:
+**     iauApci13    astrometry parameters, ICRS-CIRS, 2013
+**     iauAtciq     quick ICRS to CIRS
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double t0, t, tas2r, w;
-
-
-/* Interval between fundamental epoch J2000.0 and start epoch (JC). */
-   t0 = ((ep01 - DJ00) + ep02) / DJC;
+/* Star-independent astrometry parameters */
+   iauASTROM astrom;
 
-/* Interval over which precession required (JC). */
-   t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
 
-/* Euler angles. */
-   tas2r = t * DAS2R;
-   w = 2306.2181 + (1.39656 - 0.000139 * t0) * t0;
+/* The transformation parameters. */
+   iauApci13(date1, date2, &astrom, eo);
 
-   *zeta = (w + ((0.30188 - 0.000344 * t0) + 0.017998 * t) * t) * tas2r;
+/* ICRS (epoch J2000.0) to CIRS. */
+   iauAtciq(rc, dc, pr, pd, px, rv, &astrom, ri, di);
 
-   *z = (w + ((1.09468 + 0.000066 * t0) + 0.018203 * t) * t) * tas2r;
-
-   *theta = ((2004.3109 + (-0.85330 - 0.000217 * t0) * t0)
-          + ((-0.42665 - 0.000217 * t0) - 0.041833 * t) * t) * tas2r;
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -195,4 +197,5 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/gst94.c b/20131202/c/src/atciq.c
similarity index 57%
copy from 20120301_a/c/src/gst94.c
copy to 20131202/c/src/atciq.c
index 652f99f..e86c988 100644
--- a/20120301_a/c/src/gst94.c
+++ b/20131202/c/src/atciq.c
@@ -1,91 +1,105 @@
 #include "sofa.h"
 
-double iauGst94(double uta, double utb)
+void iauAtciq(double rc, double dc,
+              double pr, double pd, double px, double rv,
+              iauASTROM *astrom, double *ri, double *di)
 /*
 **  - - - - - - - - -
-**   i a u G s t 9 4
+**   i a u A t c i q
 **  - - - - - - - - -
 **
-**  Greenwich apparent sidereal time (consistent with IAU 1982/94
-**  resolutions).
+**  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
+**  star-independent astrometry parameters.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are to be transformed for one date.  The
+**  star-independent parameters can be obtained by calling one of the
+**  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
+**
+**  If the parallax and proper motions are zero the iauAtciqz function
+**  can be used instead.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     uta,utb    double    UT1 as a 2-part Julian Date (Notes 1,2)
-**
-**  Returned (function value):
-**                double    Greenwich apparent sidereal time (radians)
+**     rc,dc  double     ICRS RA,Dec at J2000.0 (radians)
+**     pr     double     RA proper motion (radians/year; Note 3)
+**     pd     double     Dec proper motion (radians/year)
+**     px     double     parallax (arcsec)
+**     rv     double     radial velocity (km/s, +ve if receding)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned:
+**     ri,di   double    CIRS RA,Dec (radians)
 **
 **  Notes:
 **
-**  1) The UT1 date uta+utb is a Julian Date, apportioned in any
-**     convenient way between the argument pair.  For example,
-**     JD=2450123.7 could be expressed in any of these ways, among
-**     others:
-**
-**             uta            utb
+**  1) All the vectors are with respect to BCRS axes.
 **
-**         2450123.7           0.0       (JD method)
-**         2451545.0       -1421.3       (J2000 method)
-**         2400000.5       50123.2       (MJD method)
-**         2450123.5           0.2       (date & time method)
+**  2) Star data for an epoch other than J2000.0 (for example from the
+**     Hipparcos catalog, which has an epoch of J1991.25) will require a
+**     preliminary call to iauPmsafe before use.
 **
-**     The JD method is the most natural and convenient to use in cases
-**     where the loss of several decimal digits of resolution is
-**     acceptable.  The J2000 and MJD methods are good compromises
-**     between resolution and convenience.  For UT, the date & time
-**     method is best matched to the algorithm that is used by the Earth
-**     Rotation Angle function, called internally:  maximum precision is
-**     delivered when the uta argument is for 0hrs UT1 on the day in
-**     question and the utb argument lies in the range 0 to 1, or vice
-**     versa.
-**
-**  2) The result is compatible with the IAU 1982 and 1994 resolutions,
-**     except that accuracy has been compromised for the sake of
-**     convenience in that UT is used instead of TDB (or TT) to compute
-**     the equation of the equinoxes.
-**
-**  3) This GAST must be used only in conjunction with contemporaneous
-**     IAU standards such as 1976 precession, 1980 obliquity and 1982
-**     nutation.  It is not compatible with the IAU 2000 resolutions.
-**
-**  4) The result is returned in the range 0 to 2pi.
+**  3) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
 **
 **  Called:
-**     iauGmst82    Greenwich mean sidereal time, IAU 1982
-**     iauEqeq94    equation of the equinoxes, IAU 1994
+**     iauPmpx      proper motion and parallax
+**     iauLdsun     light deflection by the Sun
+**     iauAb        stellar aberration
+**     iauRxp       product of r-matrix and pv-vector
+**     iauC2s       p-vector to spherical
 **     iauAnp       normalize angle into range 0 to 2pi
 **
-**  References:
-**
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992)
+**  This revision:   2013 October 9
 **
-**     IAU Resolution C7, Recommendation 3 (1994)
+**  SOFA release 2013-12-02
 **
-**  This revision:  2008 May 16
-**
-**  SOFA release 2012-03-01
-**
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double gmst82, eqeq94, gst;
+   double pco[3], pnat[3], ppr[3], pi[3], w;
+
+
+/* Proper motion and parallax, giving BCRS coordinate direction. */
+   iauPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco);
 
+/* Light deflection by the Sun, giving BCRS natural direction. */
+   iauLdsun(pco, astrom->eh, astrom->em, pnat);
 
-   gmst82 = iauGmst82(uta, utb);
-   eqeq94 = iauEqeq94(uta, utb);
-   gst = iauAnp(gmst82  + eqeq94);
+/* Aberration, giving GCRS proper direction. */
+   iauAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
 
-   return gst;
+/* Bias-precession-nutation, giving CIRS proper direction. */
+   iauRxp(astrom->bpn, ppr, pi);
+
+/* CIRS RA,Dec. */
+   iauC2s(pi, &w, di);
+   *ri = iauAnp(w);
+
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -178,4 +192,5 @@ double iauGst94(double uta, double utb)
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20131202/c/src/atciqn.c b/20131202/c/src/atciqn.c
new file mode 100644
index 0000000..df38a23
--- /dev/null
+++ b/20131202/c/src/atciqn.c
@@ -0,0 +1,233 @@
+#include "sofa.h"
+
+void iauAtciqn(double rc, double dc, double pr, double pd,
+               double px, double rv, iauASTROM *astrom,
+               int n, iauLDBODY b[], double *ri, double *di)
+/*
+**  - - - - - - - - - -
+**   i a u A t c i q n
+**  - - - - - - - - - -
+**
+**  Quick ICRS, epoch J2000.0, to CIRS transformation, given precomputed
+**  star-independent astrometry parameters plus a list of light-
+**  deflecting bodies.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are to be transformed for one date.  The
+**  star-independent parameters can be obtained by calling one of the
+**  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
+**
+**
+**  If the only light-deflecting body to be taken into account is the
+**  Sun, the iauAtciq function can be used instead.  If in addition the
+**  parallax and proper motions are zero, the iauAtciqz function can be
+**  used.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double       ICRS RA,Dec at J2000.0 (radians)
+**     pr     double       RA proper motion (radians/year; Note 3)
+**     pd     double       Dec proper motion (radians/year)
+**     px     double       parallax (arcsec)
+**     rv     double       radial velocity (km/s, +ve if receding)
+**     astrom iauASTROM*   star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**      n     int           number of bodies (Note 3)
+**      b     iauLDBODY[n] data for each of the n bodies (Notes 3,4):
+**       bm    double        mass of the body (solar masses, Note 5)
+**       dl    double        deflection limiter (Note 6)
+**       pv    [2][3]        barycentric PV of the body (au, au/day)
+**
+**  Returned:
+**     ri,di   double    CIRS RA,Dec (radians)
+**
+**  Notes:
+**
+**  1) Star data for an epoch other than J2000.0 (for example from the
+**     Hipparcos catalog, which has an epoch of J1991.25) will require a
+**     preliminary call to iauPmsafe before use.
+**
+**  2) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  3) The struct b contains n entries, one for each body to be
+**     considered.  If n = 0, no gravitational light deflection will be
+**     applied, not even for the Sun.
+**
+**  4) The struct b should include an entry for the Sun as well as for
+**     any planet or other body to be taken into account.  The entries
+**     should be in the order in which the light passes the body.
+**
+**  5) In the entry in the b struct for body i, the mass parameter
+**     b[i].bm can, as required, be adjusted in order to allow for such
+**     effects as quadrupole field.
+**
+**  6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
+**     the angular separation (in radians) between star and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.   Example values suitable for a terrestrial
+**     observer, together with masses, are as follows:
+**
+**        body i     b[i].bm        b[i].dl
+**
+**        Sun        1.0            6e-6
+**        Jupiter    0.00095435     3e-9
+**        Saturn     0.00028574     3e-10
+**
+**  7) For efficiency, validation of the contents of the b array is
+**     omitted.  The supplied masses must be greater than zero, the
+**     position and velocity vectors must be right, and the deflection
+**     limiter greater than zero.
+**
+**  Called:
+**     iauPmpx      proper motion and parallax
+**     iauLdn       light deflection by n bodies
+**     iauAb        stellar aberration
+**     iauRxp       product of r-matrix and pv-vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   double pco[3], pnat[3], ppr[3], pi[3], w;
+
+
+/* Proper motion and parallax, giving BCRS coordinate direction. */
+   iauPmpx(rc, dc, pr, pd, px, rv, astrom->pmt, astrom->eb, pco);
+
+/* Light deflection, giving BCRS natural direction. */
+   iauLdn(n, b, astrom->eb, pco, pnat);
+
+/* Aberration, giving GCRS proper direction. */
+   iauAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
+
+/* Bias-precession-nutation, giving CIRS proper direction. */
+   iauRxp(astrom->bpn, ppr, pi);
+
+/* CIRS RA,Dec. */
+   iauC2s(pi, &w, di);
+   *ri = iauAnp(w);
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20120301_a/c/src/gd2gce.c b/20131202/c/src/atciqz.c
similarity index 59%
copy from 20120301_a/c/src/gd2gce.c
copy to 20131202/c/src/atciqz.c
index a745d3c..177cff9 100644
--- a/20120301_a/c/src/gd2gce.c
+++ b/20131202/c/src/atciqz.c
@@ -1,14 +1,23 @@
-#include "sofam.h"
+#include "sofa.h"
 
-int iauGd2gce ( double a, double f, double elong, double phi,
-                double height, double xyz[3] )
+void iauAtciqz(double rc, double dc, iauASTROM *astrom,
+               double *ri, double *di)
 /*
 **  - - - - - - - - - -
-**   i a u G d 2 g c e
+**   i a u A t c i q z
 **  - - - - - - - - - -
 **
-**  Transform geodetic coordinates to geocentric for a reference
-**  ellipsoid of specified form.
+**  Quick ICRS to CIRS transformation, given precomputed star-
+**  independent astrometry parameters, and assuming zero parallax and
+**  proper motion.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are to be transformed for one date.  The
+**  star-independent parameters can be obtained by calling one of the
+**  functions iauApci[13], iauApcg[13], iauApco[13] or iauApcs[13].
+**
+**  The corresponding function for the case of non-zero parallax and
+**  proper motion is iauAtciq.
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards of Fundamental Astronomy) software collection.
@@ -16,82 +25,80 @@ int iauGd2gce ( double a, double f, double elong, double phi,
 **  Status:  support function.
 **
 **  Given:
-**     a       double     equatorial radius (Notes 1,4)
-**     f       double     flattening (Notes 2,4)
-**     elong   double     longitude (radians, east +ve)
-**     phi     double     latitude (geodetic, radians, Note 4)
-**     height  double     height above ellipsoid (geodetic, Notes 3,4)
+**     rc,dc  double     ICRS astrometric RA,Dec (radians)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
 **
 **  Returned:
-**     xyz     double[3]  geocentric vector (Note 3)
-**
-**  Returned (function value):
-**             int        status:  0 = OK
-**                                -1 = illegal case (Note 4)
-**  Notes:
-**
-**  1) The equatorial radius, a, can be in any units, but meters is
-**     the conventional choice.
-**
-**  2) The flattening, f, is (for the Earth) a value around 0.00335,
-**     i.e. around 1/298.
-**
-**  3) The equatorial radius, a, and the height, height, must be
-**     given in the same units, and determine the units of the
-**     returned geocentric vector, xyz.
+**     ri,di  double     CIRS RA,Dec (radians)
 **
-**  4) No validation is performed on individual arguments.  The error
-**     status -1 protects against (unrealistic) cases that would lead
-**     to arithmetic exceptions.  If an error occurs, xyz is unchanged.
+**  Note:
 **
-**  5) The inverse transformation is performed in the function
-**     iauGc2gde.
-**
-**  6) The transformation for a standard ellipsoid (such as WGS84) can
-**     more conveniently be performed by calling iauGd2gc,  which uses a
-**     numerical code to identify the required a and f values.
+**     All the vectors are with respect to BCRS axes.
 **
 **  References:
 **
-**     Green, R.M., Spherical Astronomy, Cambridge University Press,
-**     (1985) Section 4.5, p96.
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013).
+**
+**     Klioner, Sergei A., "A practical relativistic model for micro-
+**     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
 **
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 4.22, p202.
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauLdsun     light deflection due to Sun
+**     iauAb        stellar aberration
+**     iauRxp       product of r-matrix and p-vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range +/- pi
 **
-**  This revision:  2012 February 23
+**  This revision:   2013 October 9
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double sp, cp, w, d, ac, as, r;
+   double pco[3], pnat[3], ppr[3], pi[3], w;
+
+
+/* BCRS coordinate direction (unit vector). */
+   iauS2c(rc, dc, pco);
+
+/* Light deflection by the Sun, giving BCRS natural direction. */
+   iauLdsun(pco, astrom->eh, astrom->em, pnat);
 
+/* Aberration, giving GCRS proper direction. */
+   iauAb(pnat, astrom->v, astrom->em, astrom->bm1, ppr);
 
-/* Functions of geodetic latitude. */
-   sp = sin(phi);
-   cp = cos(phi);
-   w = 1.0 - f;
-   w = w * w;
-   d = cp*cp + w*sp*sp;
-   if ( d <= 0.0 ) return -1;
-   ac = a / sqrt(d);
-   as = w * ac;
+/* Bias-precession-nutation, giving CIRS proper direction. */
+   iauRxp(astrom->bpn, ppr, pi);
 
-/* Geocentric vector. */
-   r = (ac + height) * cp;
-   xyz[0] = r * cos(elong);
-   xyz[1] = r * sin(elong);
-   xyz[2] = (as + height) * sp;
+/* CIRS RA,Dec. */
+   iauC2s(pi, &w, di);
+   *ri = iauAnp(w);
 
-/* Success. */
-   return 0;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20131202/c/src/atco13.c b/20131202/c/src/atco13.c
new file mode 100644
index 0000000..167896e
--- /dev/null
+++ b/20131202/c/src/atco13.c
@@ -0,0 +1,285 @@
+#include "sofa.h"
+
+int iauAtco13(double rc, double dc,
+              double pr, double pd, double px, double rv,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *aob, double *zob, double *hob,
+              double *dob, double *rob, double *eo)
+/*
+**  - - - - - - - - - -
+**   i a u A t c o 1 3
+**  - - - - - - - - - -
+**
+**  ICRS RA,Dec to observed place.  The caller supplies UTC, site
+**  coordinates, ambient air conditions and observing wavelength.
+**
+**  SOFA models are used for the Earth ephemeris, bias-precession-
+**  nutation, Earth orientation and refraction.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     rc,dc  double   ICRS right ascension at J2000.0 (radians, Note 1)
+**     pr     double   RA proper motion (radians/year; Note 2)
+**     pd     double   Dec proper motion (radians/year)
+**     px     double   parallax (arcsec)
+**     rv     double   radial velocity (km/s, +ve if receding)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 3-4)
+**     dut1   double   UT1-UTC (seconds, Note 5)
+**     elong  double   longitude (radians, east +ve, Note 6)
+**     phi    double   latitude (geodetic, radians, Note 6)
+**     hm     double   height above ellipsoid (m, geodetic, Notes 6,8)
+**     xp,yp  double   polar motion coordinates (radians, Note 7)
+**     phpa   double   pressure at the observer (hPa = mB, Note 8)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 9)
+**
+**  Returned:
+**     aob    double*  observed azimuth (radians: N=0,E=90)
+**     zob    double*  observed zenith distance (radians)
+**     hob    double*  observed hour angle (radians)
+**     dob    double*  observed declination (radians)
+**     rob    double*  observed right ascension (CIO-based, radians)
+**     eo     double*  equation of the origins (ERA-GST)
+**
+**  Returned (function value):
+**            int      status: +1 = dubious year (Note 4)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  Star data for an epoch other than J2000.0 (for example from the
+**      Hipparcos catalog, which has an epoch of J1991.25) will require
+**      a preliminary call to iauPmsafe before use.
+**
+**  2)  The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
+**
+**  3)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  4)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  5)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  6)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  7)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  8)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB),
+**      is available, an adequate estimate of hm can be obtained from
+**      the expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  9)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  10) The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted observed
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**      Without refraction, the complementary functions iauAtco13 and
+**      iauAtoc13 are self-consistent to better than 1 microarcsecond
+**      all over the celestial sphere.  With refraction included,
+**      consistency falls off at high zenith distances, but is still
+**      better than 0.05 arcsec at 85 degrees.
+**
+**  11) "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  12) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApco13    astrometry parameters, ICRS-observed, 2013
+**     iauAtciq     quick ICRS to CIRS
+**     iauAtioq     quick ICRS to observed
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j;
+   iauASTROM astrom;
+   double ri, di;
+
+
+/* Star-independent astrometry parameters. */
+   j = iauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl, &astrom, eo);
+
+/* Abort if bad UTC. */
+   if ( j < 0 ) return j;
+
+/* Transform ICRS to CIRS. */
+   iauAtciq(rc, dc, pr, pd, px, rv, &astrom, &ri, &di);
+
+/* Transform CIRS to observed. */
+   iauAtioq(ri, di, &astrom, aob, zob, hob, dob, rob);
+
+/* Return OK/warning status. */
+   return j;
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20120301_a/c/src/pnm80.c b/20131202/c/src/atic13.c
similarity index 62%
copy from 20120301_a/c/src/pnm80.c
copy to 20131202/c/src/atic13.c
index ce1750e..272e887 100644
--- a/20120301_a/c/src/pnm80.c
+++ b/20131202/c/src/atic13.c
@@ -1,31 +1,34 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPnm80(double date1, double date2, double rmatpn[3][3])
+void iauAtic13(double ri, double di, double date1, double date2,
+               double *rc, double *dc, double *eo)
 /*
-**  - - - - - - - - -
-**   i a u P n m 8 0
-**  - - - - - - - - -
+**  - - - - - - - - - -
+**   i a u A t i c 1 3
+**  - - - - - - - - - -
 **
-**  Form the matrix of precession/nutation for a given date, IAU 1976
-**  precession model, IAU 1980 nutation model.
+**  Transform star RA,Dec from geocentric CIRS to ICRS astrometric.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     date1,date2    double         TDB date (Note 1)
+**     ri,di  double  CIRS geocentric RA,Dec (radians)
+**     date1  double  TDB as a 2-part...
+**     date2  double  ...Julian Date (Note 1)
 **
 **  Returned:
-**     rmatpn         double[3][3]   combined precession/nutation matrix
+**     rc,dc  double  ICRS astrometric RA,Dec (radians)
+**     eo     double  equation of the origins (ERA-GST, Note 4)
 **
 **  Notes:
 **
 **  1) The TDB date date1+date2 is a Julian Date, apportioned in any
 **     convenient way between the two arguments.  For example,
-**     JD(TDB)=2450123.7 could be expressed in any of these ways,
-**     among others:
+**     JD(TDB)=2450123.7 could be expressed in any of these ways, among
+**     others:
 **
 **            date1          date2
 **
@@ -34,53 +37,67 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
-**
-**  2) The matrix operates in the sense V(date) = rmatpn * V(J2000),
-**     where the p-vector V(date) is with respect to the true equatorial
-**     triad of date date1+date2 and the p-vector V(J2000) is with
-**     respect to the mean equatorial triad of epoch J2000.0.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.  For most
+**     applications of this function the choice will not be at all
+**     critical.
+**
+**     TT can be used instead of TDB without any significant impact on
+**     accuracy.
+**
+**  2) Iterative techniques are used for the aberration and light
+**     deflection corrections so that the functions iauAtic13 (or
+**     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
+**     even at the edge of the Sun's disk the discrepancy is only about
+**     1 nanoarcsecond.
+**
+**  3) The available accuracy is better than 1 milliarcsecond, limited
+**     mainly by the precession-nutation model that is used, namely
+**     IAU 2000A/2006.  Very close to solar system bodies, additional
+**     errors of up to several milliarcseconds can occur because of
+**     unmodeled light deflection;  however, the Sun's contribution is
+**     taken into account, to first order.  The accuracy limitations of
+**     the SOFA function iauEpv00 (used to compute Earth position and
+**     velocity) can contribute aberration errors of up to
+**     5 microarcseconds.  Light deflection at the Sun's limb is
+**     uncertain at the 0.4 mas level.
+**
+**  4) Should the transformation to (equinox based) J2000.0 mean place
+**     be required rather than (CIO based) ICRS coordinates, subtract the
+**     equation of the origins from the returned right ascension:
+**     RA = RI - EO.  (The iauAnp function can then be applied, as
+**     required, to keep the result in the conventional 0-2pi range.)
 **
 **  Called:
-**     iauPmat76    precession matrix, IAU 1976
-**     iauNutm80    nutation matrix, IAU 1980
-**     iauRxr       product of two r-matrices
-**
-**  Reference:
-**
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 3.3 (p145).
+**     iauApci13    astrometry parameters, ICRS-CIRS, 2013
+**     iauAticq     quick CIRS to ICRS astrometric
 **
-**  This revision:  2010 January 23
+**  This revision:   2013 October 9
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double rmatp[3][3], rmatn[3][3];
+/* Star-independent astrometry parameters */
+   iauASTROM astrom;
 
 
-/* Precession matrix, J2000.0 to date. */
-   iauPmat76(date1, date2, rmatp);
+/* Star-independent astrometry parameters. */
+   iauApci13(date1, date2, &astrom, eo);
 
-/* Nutation matrix. */
-   iauNutm80(date1, date2, rmatn);
+/* CIRS to ICRS astrometric. */
+   iauAticq(ri, di, &astrom, rc, dc);
 
-/* Combine the matrices:  PN = N x P. */
-   iauRxr(rmatn, rmatp, rmatpn);
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -173,4 +190,5 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/fk5hz.c b/20131202/c/src/aticq.c
similarity index 53%
copy from 20120301_a/c/src/fk5hz.c
copy to 20131202/c/src/aticq.c
index 45f96a4..8913dbf 100644
--- a/20120301_a/c/src/fk5hz.c
+++ b/20131202/c/src/aticq.c
@@ -1,120 +1,150 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauFk5hz(double r5, double d5, double date1, double date2,
-              double *rh, double *dh)
+void iauAticq(double ri, double di, iauASTROM *astrom,
+              double *rc, double *dc)
 /*
 **  - - - - - - - - -
-**   i a u F k 5 h z
+**   i a u A t i c q
 **  - - - - - - - - -
 **
-**  Transform an FK5 (J2000.0) star position into the system of the
-**  Hipparcos catalogue, assuming zero Hipparcos proper motion.
+**  Quick CIRS RA,Dec to ICRS astrometric place, given the star-
+**  independent astrometry parameters.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
+**  or iauApcs[13].
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     r5           double   FK5 RA (radians), equinox J2000.0, at date
-**     d5           double   FK5 Dec (radians), equinox J2000.0, at date
-**     date1,date2  double   TDB date (Notes 1,2)
+**     ri,di  double     CIRS RA,Dec (radians)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
 **
 **  Returned:
-**     rh           double   Hipparcos RA (radians)
-**     dh           double   Hipparcos Dec (radians)
+**     rc,dc  double     ICRS astrometric RA,Dec (radians)
 **
 **  Notes:
 **
-**  1) This function converts a star position from the FK5 system to
-**     the Hipparcos system, in such a way that the Hipparcos proper
-**     motion is zero.  Because such a star has, in general, a non-zero
-**     proper motion in the FK5 system, the function requires the date
-**     at which the position in the FK5 system was determined.
-**
-**  2) The TT date date1+date2 is a Julian Date, apportioned in any
-**     convenient way between the two arguments.  For example,
-**     JD(TT)=2450123.7 could be expressed in any of these ways,
-**     among others:
-**
-**            date1          date2
-**
-**         2450123.7           0.0       (JD method)
-**         2451545.0       -1421.3       (J2000 method)
-**         2400000.5       50123.2       (MJD method)
-**         2450123.5           0.2       (date & time method)
-**
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
-**
-**  3) The FK5 to Hipparcos transformation is modeled as a pure
-**     rotation and spin;  zonal errors in the FK5 catalogue are not
-**     taken into account.
-**
-**  4) The position returned by this function is in the Hipparcos
-**     reference system but at date date1+date2.
+**  1) Only the Sun is taken into account in the light deflection
+**     correction.
 **
-**  5) See also iauFk52h, iauH2fk5, iauHfk5z.
+**  2) Iterative techniques are used for the aberration and light
+**     deflection corrections so that the functions iauAtic13 (or
+**     iauAticq) and iauAtci13 (or iauAtciq) are accurate inverses;
+**     even at the edge of the Sun's disk the discrepancy is only about
+**     1 nanoarcsecond.
 **
 **  Called:
 **     iauS2c       spherical coordinates to unit vector
-**     iauFk5hip    FK5 to Hipparcos rotation and spin
-**     iauSxp       multiply p-vector by scalar
-**     iauRv2m      r-vector to r-matrix
 **     iauTrxp      product of transpose of r-matrix and p-vector
-**     iauPxp       vector product of two p-vectors
+**     iauZp        zero p-vector
+**     iauAb        stellar aberration
+**     iauLdsun     light deflection by the Sun
 **     iauC2s       p-vector to spherical
-**     iauAnp       normalize angle into range 0 to 2pi
+**     iauAnp       normalize angle into range +/- pi
 **
-**  Reference:
+**  This revision:   2013 October 9
 **
-**     F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
+**  SOFA release 2013-12-02
 **
-**  This revision:  2009 December 17
-**
-**  SOFA release 2012-03-01
-**
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double t, p5e[3], r5h[3][3], s5h[3], vst[3], rst[3][3], p5[3],
-          ph[3], w;
-
+   int j, i;
+   double pi[3], ppr[3], pnat[3], pco[3], w, d[3], before[3], r2, r,
+          after[3];
 
-/* Interval from given date to fundamental epoch J2000.0 (JY). */
-   t = - ((date1 - DJ00) + date2) / DJY;
 
-/* FK5 barycentric position vector. */
-   iauS2c(r5, d5, p5e);
+/* CIRS RA,Dec to Cartesian. */
+   iauS2c(ri, di, pi);
 
-/* FK5 to Hipparcos orientation matrix and spin vector. */
-   iauFk5hip(r5h, s5h);
+/* Bias-precession-nutation, giving GCRS proper direction. */
+   iauTrxp(astrom->bpn, pi, ppr);
 
-/* Accumulated Hipparcos wrt FK5 spin over that interval. */
-   iauSxp(t, s5h, vst);
+/* Aberration, giving GCRS natural direction. */
+   iauZp(d);
+   for (j = 0; j < 2; j++) {
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         w = ppr[i] - d[i];
+         before[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         before[i] /= r;
+      }
+      iauAb(before, astrom->v, astrom->em, astrom->bm1, after);
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         d[i] = after[i] - before[i];
+         w = ppr[i] - d[i];
+         pnat[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         pnat[i] /= r;
+      }
+   }
 
-/* Express the accumulated spin as a rotation matrix. */
-   iauRv2m(vst, rst);
+/* Light deflection by the Sun, giving BCRS coordinate direction. */
+   iauZp(d);
+   for (j = 0; j < 5; j++) {
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         w = pnat[i] - d[i];
+         before[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         before[i] /= r;
+      }
+      iauLdsun(before, astrom->eh, astrom->em, after);
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         d[i] = after[i] - before[i];
+         w = pnat[i] - d[i];
+         pco[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         pco[i] /= r;
+      }
+   }
 
-/* Derotate the vector's FK5 axes back to date. */
-   iauTrxp(rst, p5e, p5);
+/* ICRS astrometric RA,Dec. */
+   iauC2s(pco, &w, dc);
+   *rc = iauAnp(w);
 
-/* Rotate the vector into the Hipparcos system. */
-   iauRxp(r5h, p5, ph);
-
-/* Hipparcos vector to spherical. */
-   iauC2s(ph, &w, dh);
-   *rh = iauAnp(w);
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -207,4 +237,5 @@ void iauFk5hz(double r5, double d5, double date1, double date2,
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20131202/c/src/aticqn.c b/20131202/c/src/aticqn.c
new file mode 100644
index 0000000..55a7afa
--- /dev/null
+++ b/20131202/c/src/aticqn.c
@@ -0,0 +1,279 @@
+#include "sofa.h"
+
+void iauAticqn(double ri, double di, iauASTROM *astrom,
+               int n, iauLDBODY b[], double *rc, double *dc)
+/*
+**  - - - - - - - - -
+**   i a u A t i c q n
+**  - - - - - - - - -
+**
+**  Quick CIRS to ICRS astrometric place transformation, given the star-
+**  independent astrometry parameters plus a list of light-deflecting
+**  bodies.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling one of the functions iauApci[13], iauApcg[13], iauApco[13]
+**  or iauApcs[13].
+*
+*  If the only light-deflecting body to be taken into account is the
+*  Sun, the iauAticq function can be used instead.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri,di  double      CIRS RA,Dec (radians)
+**     astrom iauASTROM*  star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**      n     int           number of bodies (Note 3)
+**      b     iauLDBODY[n] data for each of the n bodies (Notes 3,4):
+**       bm    double       mass of the body (solar masses, Note 5)
+**       dl    double       deflection limiter (Note 6)
+**       pv    [2][3]       barycentric PV of the body (au, au/day)
+**
+**  Returned:
+**     rc,dc  double     ICRS astrometric RA,Dec (radians)
+**
+**  Notes:
+**
+**  1) Iterative techniques are used for the aberration and light
+**     deflection corrections so that the functions iauAticqn and
+**     iauAtciqn are accurate inverses; even at the edge of the Sun's
+**     disk the discrepancy is only about 1 nanoarcsecond.
+**
+**  2) If the only light-deflecting body to be taken into account is the
+**     Sun, the iauAticq function can be used instead.
+**
+**  3) The struct b contains n entries, one for each body to be
+**     considered.  If n = 0, no gravitational light deflection will be
+**     applied, not even for the Sun.
+**
+**  4) The struct b should include an entry for the Sun as well as for
+**     any planet or other body to be taken into account.  The entries
+**     should be in the order in which the light passes the body.
+**
+**  5) In the entry in the b struct for body i, the mass parameter
+**     b[i].bm can, as required, be adjusted in order to allow for such
+**     effects as quadrupole field.
+**
+**  6) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
+**     the angular separation (in radians) between star and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.   Example values suitable for a terrestrial
+**     observer, together with masses, are as follows:
+**
+**        body i     b[i].bm        b[i].dl
+**
+**        Sun        1.0            6e-6
+**        Jupiter    0.00095435     3e-9
+**        Saturn     0.00028574     3e-10
+**
+**  7) For efficiency, validation of the contents of the b array is
+**     omitted.  The supplied masses must be greater than zero, the
+**     position and velocity vectors must be right, and the deflection
+**     limiter greater than zero.
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauTrxp      product of transpose of r-matrix and p-vector
+**     iauZp        zero p-vector
+**     iauAb        stellar aberration
+**     iauLdn       light deflection by n bodies
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range +/- pi
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j, i;
+   double pi[3], ppr[3], pnat[3], pco[3], w, d[3], before[3], r2, r,
+          after[3];
+
+
+/* CIRS RA,Dec to Cartesian. */
+   iauS2c(ri, di, pi);
+
+/* Bias-precession-nutation, giving GCRS proper direction. */
+   iauTrxp(astrom->bpn, pi, ppr);
+
+/* Aberration, giving GCRS natural direction. */
+   iauZp(d);
+   for (j = 0; j < 2; j++) {
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         w = ppr[i] - d[i];
+         before[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         before[i] /= r;
+      }
+      iauAb(before, astrom->v, astrom->em, astrom->bm1, after);
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         d[i] = after[i] - before[i];
+         w = ppr[i] - d[i];
+         pnat[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         pnat[i] /= r;
+      }
+   }
+
+/* Light deflection, giving BCRS coordinate direction. */
+   iauZp(d);
+   for (j = 0; j < 5; j++) {
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         w = pnat[i] - d[i];
+         before[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         before[i] /= r;
+      }
+      iauLdn(n, b, astrom->eb, before, after);
+      r2 = 0.0;
+      for (i = 0; i < 3; i++) {
+         d[i] = after[i] - before[i];
+         w = pnat[i] - d[i];
+         pco[i] = w;
+         r2 += w*w;
+      }
+      r = sqrt(r2);
+      for (i = 0; i < 3; i++) {
+         pco[i] /= r;
+      }
+   }
+
+/* ICRS astrometric RA,Dec. */
+   iauC2s(pco, &w, dc);
+   *rc = iauAnp(w);
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/atio13.c b/20131202/c/src/atio13.c
new file mode 100644
index 0000000..34da04b
--- /dev/null
+++ b/20131202/c/src/atio13.c
@@ -0,0 +1,264 @@
+#include "sofa.h"
+
+int iauAtio13(double ri, double di,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *aob, double *zob, double *hob,
+              double *dob, double *rob)
+/*
+**  - - - - - - - - - -
+**   i a u A t i o 1 3
+**  - - - - - - - - - -
+**
+**  CIRS RA,Dec to observed place.  The caller supplies UTC, site
+**  coordinates, ambient air conditions and observing wavelength.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri     double   CIRS right ascension (CIO-based, radians)
+**     di     double   CIRS declination (radians)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 1,2)
+**     dut1   double   UT1-UTC (seconds, Note 3)
+**     elong  double   longitude (radians, east +ve, Note 4)
+**     phi    double   geodetic latitude (radians, Note 4)
+**     hm     double   height above ellipsoid (m, geodetic Notes 4,6)
+**     xp,yp  double   polar motion coordinates (radians, Note 5)
+**     phpa   double   pressure at the observer (hPa = mB, Note 6)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 7)
+**
+**  Returned:
+**     aob    double*  observed azimuth (radians: N=0,E=90)
+**     zob    double*  observed zenith distance (radians)
+**     hob    double*  observed hour angle (radians)
+**     dob    double*  observed declination (radians)
+**     rob    double*  observed right ascension (CIO-based, radians)
+**
+**  Returned (function value):
+**            int      status: +1 = dubious year (Note 2)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  2)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  3)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  4)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  5)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  6)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  7)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  8)  "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  9)  The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted astrometric
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**  10) The complementary functions iauAtio13 and iauAtoi13 are self-
+**      consistent to better than 1 microarcsecond all over the
+**      celestial sphere.
+**
+**  11) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApio13    astrometry parameters, CIRS-observed, 2013
+**     iauAtioq     quick ICRS to observed
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j;
+   iauASTROM astrom;
+
+
+/* Star-independent astrometry parameters for CIRS->observed. */
+   j = iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl, &astrom);
+
+/* Abort if bad UTC. */
+   if ( j < 0 ) return j;
+
+/* Transform CIRS to observed. */
+   iauAtioq(ri, di, &astrom, aob, zob, hob, dob, rob);
+
+/* Return OK/warning status. */
+   return j;
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/atioq.c b/20131202/c/src/atioq.c
new file mode 100644
index 0000000..afbe0c7
--- /dev/null
+++ b/20131202/c/src/atioq.c
@@ -0,0 +1,285 @@
+#include "sofa.h"
+
+void iauAtioq(double ri, double di, iauASTROM *astrom,
+              double *aob, double *zob,
+              double *hob, double *dob, double *rob)
+/*
+**  - - - - - - - - -
+**   i a u A t i o q
+**  - - - - - - - - -
+**
+**  Quick CIRS to observed place transformation.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling iauApio[13] or iauApco[13].
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     ri     double     CIRS right ascension
+**     di     double     CIRS declination
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned:
+**     aob    double     observed azimuth (radians: N=0,E=90)
+**     zob    double     observed zenith distance (radians)
+**     hob    double     observed hour angle (radians)
+**     dob    double     observed right ascension (CIO-based, radians)
+**
+**  Notes:
+**
+**  1) This function returns zenith distance rather than altitude in
+**     order to reflect the fact that no allowance is made for
+**     depression of the horizon.
+**
+**  2) The accuracy of the result is limited by the corrections for
+**     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**     Providing the meteorological parameters are known accurately and
+**     there are no gross local effects, the predicted observed
+**     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**     (radio) for a zenith distance of less than 70 degrees, better
+**     than 30 arcsec (optical or radio) at 85 degrees and better
+**     than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**     Without refraction, the complementary functions iauAtioq and
+**     iauAtoiq are self-consistent to better than 1 microarcsecond all
+**     over the celestial sphere.  With refraction included, consistency
+**     falls off at high zenith distances, but is still better than
+**     0.05 arcsec at 85 degrees.
+**
+**  3) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  4) The CIRS RA,Dec is obtained from a star catalog mean place by
+**     allowing for space motion, parallax, the Sun's gravitational lens
+**     effect, annual aberration and precession-nutation.  For star
+**     positions in the ICRS, these effects can be applied by means of
+**     the iauAtci13 (etc.) functions.  Starting from classical "mean
+**     place" systems, additional transformations will be needed first.
+**
+**  5) "Observed" Az,El means the position that would be seen by a
+**     perfect geodetically aligned theodolite.  This is obtained from
+**     the CIRS RA,Dec by allowing for Earth orientation and diurnal
+**     aberration, rotating from equator to horizon coordinates, and
+**     then adjusting for refraction.  The HA,Dec is obtained by
+**     rotating back into equatorial coordinates, and is the position
+**     that would be seen by a perfect equatorial with its polar axis
+**     aligned to the Earth's axis of rotation.  Finally, the RA is
+**     obtained by subtracting the HA from the local ERA.
+**
+**  6) The star-independent CIRS-to-observed-place parameters in ASTROM
+**     may be computed with iauApio[13] or iauApco[13].  If nothing has
+**     changed significantly except the time, iauAper[13] may be used to
+**     perform the requisite adjustment to the astrom structure.
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
+**
+**  This revision:   2013 October 18
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+/* Minimum cos(alt) and sin(alt) for refraction purposes */
+   const double CELMIN = 1e-6;
+   const double SELMIN = 0.05;
+
+   double v[3], x, y, z, xhd, yhd, zhd, f, xhdt, yhdt, zhdt,
+          xaet, yaet, zaet, azobs, r, tz, w, del, cosdel,
+          xaeo, yaeo, zaeo, zdobs, hmobs, dcobs, raobs;
+
+/*--------------------------------------------------------------------*/
+
+/* CIRS RA,Dec to Cartesian -HA,Dec. */
+   iauS2c(ri-astrom->eral, di, v);
+   x = v[0];
+   y = v[1];
+   z = v[2];
+
+/* Polar motion. */
+   xhd = x + astrom->xpl*z;
+   yhd = y - astrom->ypl*z;
+   zhd = z - astrom->xpl*x + astrom->ypl*y;
+
+/* Diurnal aberration. */
+   f = ( 1.0 - astrom->diurab*yhd );
+   xhdt = f * xhd;
+   yhdt = f * ( yhd + astrom->diurab );
+   zhdt = f * zhd;
+
+/* Cartesian -HA,Dec to Cartesian Az,El (S=0,E=90). */
+   xaet = astrom->sphi*xhdt - astrom->cphi*zhdt;
+   yaet = yhdt;
+   zaet = astrom->cphi*xhdt + astrom->sphi*zhdt;
+
+/* Azimuth (N=0,E=90). */
+   azobs = ( xaet != 0.0 || yaet != 0.0 ) ? atan2(yaet,-xaet) : 0.0;
+
+/* ---------- */
+/* Refraction */
+/* ---------- */
+
+/* Cosine and sine of altitude, with precautions. */
+   r = sqrt(xaet*xaet + yaet*yaet);
+   r = r > CELMIN ? r : CELMIN;
+   z = zaet > SELMIN ? zaet : SELMIN;
+
+/* A*tan(z)+B*tan^3(z) model, with Newton-Raphson correction. */
+   tz = r/z;
+   w = astrom->refb*tz*tz;
+   del = ( astrom->refa + w ) * tz /
+         ( 1.0 + ( astrom->refa + 3.0*w ) / ( z*z ) );
+
+/* Apply the change, giving observed vector. */
+   cosdel = 1.0 - del*del/2.0;
+   f = cosdel - del*z/r;
+   xaeo = xaet*f;
+   yaeo = yaet*f;
+   zaeo = cosdel*zaet + del*r;
+
+/* Observed ZD. */
+   zdobs = atan2(sqrt(xaeo*xaeo+yaeo*yaeo), zaeo);
+
+/* Az/El vector to HA,Dec vector (both right-handed). */
+   v[0] = astrom->sphi*xaeo + astrom->cphi*zaeo;
+   v[1] = yaeo;
+   v[2] = - astrom->cphi*xaeo + astrom->sphi*zaeo;
+
+/* To spherical -HA,Dec. */
+   iauC2s ( v, &hmobs, &dcobs );
+
+/* Right ascension (with respect to CIO). */
+   raobs = astrom->eral + hmobs;
+
+/* Return the results. */
+   *aob = iauAnp(azobs);
+   *zob = zdobs;
+   *hob = -hmobs;
+   *dob = dcobs;
+   *rob = iauAnp(raobs);
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/atoc13.c b/20131202/c/src/atoc13.c
new file mode 100644
index 0000000..83f6d41
--- /dev/null
+++ b/20131202/c/src/atoc13.c
@@ -0,0 +1,275 @@
+#include "sofa.h"
+
+int iauAtoc13(const char *type, double ob1, double ob2,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *rc, double *dc)
+/*
+**  - - - - - - - - - -
+**   i a u A t o c 1 3
+**  - - - - - - - - - -
+**
+**  Observed place at a groundbased site to to ICRS astrometric RA,Dec.
+**  The caller supplies UTC, site coordinates, ambient air conditions
+**  and observing wavelength.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     type   char[]   type of coordinates - "R", "H" or "A" (Notes 1,2)
+**     ob1    double   observed Az, HA or RA (radians; Az is N=0,E=90)
+**     ob2    double   observed ZD or Dec (radians)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 3,4)
+**     dut1   double   UT1-UTC (seconds, Note 5)
+**     elong  double   longitude (radians, east +ve, Note 6)
+**     phi    double   geodetic latitude (radians, Note 6)
+**     hm     double   height above ellipsoid (m, geodetic Notes 6,8)
+**     xp,yp  double   polar motion coordinates (radians, Note 7)
+**     phpa   double   pressure at the observer (hPa = mB, Note 8)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 9)
+**
+**  Returned:
+**     rc,dc  double   ICRS astrometric RA,Dec (radians)
+**
+**  Returned (function value):
+**            int      status: +1 = dubious year (Note 4)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  2)  Only the first character of the type argument is significant.
+**      "R" or "r" indicates that ob1 and ob2 are the observed right
+**      ascension and declination;  "H" or "h" indicates that they are
+**      hour angle (west +ve) and declination;  anything else ("A" or
+**      "a" is recommended) indicates that ob1 and ob2 are azimuth
+**      (north zero, east 90 deg) and zenith distance.
+**
+**  3)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  4)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  5)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  6)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  7)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  8)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  9)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  10) The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted astrometric
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**      Without refraction, the complementary functions iauAtco13 and
+**      iauAtoc13 are self-consistent to better than 1 microarcsecond
+**      all over the celestial sphere.  With refraction included,
+**      consistency falls off at high zenith distances, but is still
+**      better than 0.05 arcsec at 85 degrees.
+**
+**  11) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApco13    astrometry parameters, ICRS-observed
+**     iauAtoiq     quick observed to CIRS
+**     iauAticq     quick CIRS to ICRS
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j;
+   iauASTROM astrom;
+   double eo, ri, di;
+
+
+/* Star-independent astrometry parameters. */
+   j = iauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl, &astrom, &eo);
+
+/* Abort if bad UTC. */
+   if ( j < 0 ) return j;
+
+/* Transform observed to CIRS. */
+   iauAtoiq(type, ob1, ob2, &astrom, &ri, &di);
+
+/* Transform CIRS to ICRS. */
+   iauAticq(ri, di, &astrom, rc, dc);
+
+/* Return OK/warning status. */
+   return j;
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/atoi13.c b/20131202/c/src/atoi13.c
new file mode 100644
index 0000000..3edb2b3
--- /dev/null
+++ b/20131202/c/src/atoi13.c
@@ -0,0 +1,270 @@
+#include "sofa.h"
+
+int iauAtoi13(const char *type, double ob1, double ob2,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tc, double rh, double wl,
+              double *ri, double *di)
+/*
+**  - - - - - - - - - -
+**   i a u A t o i 1 3
+**  - - - - - - - - - -
+**
+**  Observed place to CIRS.  The caller supplies UTC, site coordinates,
+**  ambient air conditions and observing wavelength.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**     type   char[]   type of coordinates - "R", "H" or "A" (Notes 1,2)
+**     ob1    double   observed Az, HA or RA (radians; Az is N=0,E=90)
+**     ob2    double   observed ZD or Dec (radians)
+**     utc1   double   UTC as a 2-part...
+**     utc2   double   ...quasi Julian Date (Notes 3,4)
+**     dut1   double   UT1-UTC (seconds, Note 5)
+**     elong  double   longitude (radians, east +ve, Note 6)
+**     phi    double   geodetic latitude (radians, Note 6)
+**     hm     double   height above the ellipsoid (meters, Notes 6,8)
+**     xp,yp  double   polar motion coordinates (radians, Note 7)
+**     phpa   double   pressure at the observer (hPa = mB, Note 8)
+**     tc     double   ambient temperature at the observer (deg C)
+**     rh     double   relative humidity at the observer (range 0-1)
+**     wl     double   wavelength (micrometers, Note 9)
+**
+**  Returned:
+**     ri     double*  CIRS right ascension (CIO-based, radians)
+**     di     double*  CIRS declination (radians)
+**
+**  Returned (function value):
+**            int      status: +1 = dubious year (Note 2)
+**                              0 = OK
+**                             -1 = unacceptable date
+**
+**  Notes:
+**
+**  1)  "Observed" Az,ZD means the position that would be seen by a
+**      perfect geodetically aligned theodolite.  (Zenith distance is
+**      used rather than altitude in order to reflect the fact that no
+**      allowance is made for depression of the horizon.)  This is
+**      related to the observed HA,Dec via the standard rotation, using
+**      the geodetic latitude (corrected for polar motion), while the
+**      observed HA and RA are related simply through the Earth rotation
+**      angle and the site longitude.  "Observed" RA,Dec or HA,Dec thus
+**      means the position that would be seen by a perfect equatorial
+**      with its polar axis aligned to the Earth's axis of rotation.
+**
+**  2)  Only the first character of the type argument is significant.
+**      "R" or "r" indicates that ob1 and ob2 are the observed right
+**      ascension and declination;  "H" or "h" indicates that they are
+**      hour angle (west +ve) and declination;  anything else ("A" or
+**      "a" is recommended) indicates that ob1 and ob2 are azimuth
+**      (north zero, east 90 deg) and zenith distance.
+**
+**  3)  utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
+**      convenient way between the two arguments, for example where utc1
+**      is the Julian Day Number and utc2 is the fraction of a day.
+**
+**      However, JD cannot unambiguously represent UTC during a leap
+**      second unless special measures are taken.  The convention in the
+**      present function is that the JD day represents UTC days whether
+**      the length is 86399, 86400 or 86401 SI seconds.
+**
+**      Applications should use the function iauDtf2d to convert from
+**      calendar date and time of day into 2-part quasi Julian Date, as
+**      it implements the leap-second-ambiguity convention just
+**      described.
+**
+**  4)  The warning status "dubious year" flags UTCs that predate the
+**      introduction of the time scale or that are too far in the
+**      future to be trusted.  See iauDat for further details.
+**
+**  5)  UT1-UTC is tabulated in IERS bulletins.  It increases by exactly
+**      one second at the end of each positive UTC leap second,
+**      introduced in order to keep UT1-UTC within +/- 0.9s.  n.b. This
+**      practice is under review, and in the future UT1-UTC may grow
+**      essentially without limit.
+**
+**  6)  The geographical coordinates are with respect to the WGS84
+**      reference ellipsoid.  TAKE CARE WITH THE LONGITUDE SIGN:  the
+**      longitude required by the present function is east-positive
+**      (i.e. right-handed), in accordance with geographical convention.
+**
+**  7)  The polar motion xp,yp can be obtained from IERS bulletins.  The
+**      values are the coordinates (in radians) of the Celestial
+**      Intermediate Pole with respect to the International Terrestrial
+**      Reference System (see IERS Conventions 2003), measured along the
+**      meridians 0 and 90 deg west respectively.  For many
+**      applications, xp and yp can be set to zero.
+**
+**  8)  If hm, the height above the ellipsoid of the observing station
+**      in meters, is not known but phpa, the pressure in hPa (=mB), is
+**      available, an adequate estimate of hm can be obtained from the
+**      expression
+**
+**            hm = -29.3 * tsl * log ( phpa / 1013.25 );
+**
+**      where tsl is the approximate sea-level air temperature in K
+**      (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
+**      52).  Similarly, if the pressure phpa is not known, it can be
+**      estimated from the height of the observing station, hm, as
+**      follows:
+**
+**            phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
+**
+**      Note, however, that the refraction is nearly proportional to
+**      the pressure and that an accurate phpa value is important for
+**      precise work.
+**
+**  9)  The argument wl specifies the observing wavelength in
+**      micrometers.  The transition from optical to radio is assumed to
+**      occur at 100 micrometers (about 3000 GHz).
+**
+**  10) The accuracy of the result is limited by the corrections for
+**      refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**      Providing the meteorological parameters are known accurately and
+**      there are no gross local effects, the predicted astrometric
+**      coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**      (radio) for a zenith distance of less than 70 degrees, better
+**      than 30 arcsec (optical or radio) at 85 degrees and better
+**      than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**      Without refraction, the complementary functions iauAtio13 and
+**      iauAtoi13 are self-consistent to better than 1 microarcsecond
+**      all over the celestial sphere.  With refraction included,
+**      consistency falls off at high zenith distances, but is still
+**      better than 0.05 arcsec at 85 degrees.
+**
+**  12) It is advisable to take great care with units, as even unlikely
+**      values of the input parameters are accepted and processed in
+**      accordance with the models used.
+**
+**  Called:
+**     iauApio13    astrometry parameters, CIRS-observed, 2013
+**     iauAtoiq     quick observed to CIRS
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int j;
+   iauASTROM astrom;
+
+
+/* Star-independent astrometry parameters for CIRS->observed. */
+   j = iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl, &astrom);
+
+/* Abort if bad UTC. */
+   if ( j < 0 ) return j;
+
+/* Transform observed to CIRS. */
+   iauAtoiq(type, ob1, ob2, &astrom, ri, di);
+
+/* Return OK/warning status. */
+   return j;
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20131202/c/src/atoiq.c b/20131202/c/src/atoiq.c
new file mode 100644
index 0000000..9fdab24
--- /dev/null
+++ b/20131202/c/src/atoiq.c
@@ -0,0 +1,299 @@
+#include "sofa.h"
+
+void iauAtoiq(const char *type,
+              double ob1, double ob2, iauASTROM *astrom,
+              double *ri, double *di)
+/*
+**  - - - - - - - - -
+**   i a u A t o i q
+**  - - - - - - - - -
+**
+**  Quick observed place to CIRS, given the star-independent astrometry
+**  parameters.
+**
+**  Use of this function is appropriate when efficiency is important and
+**  where many star positions are all to be transformed for one date.
+**  The star-independent astrometry parameters can be obtained by
+**  calling iauApio[13] or iauApco[13].
+**
+**  Status:  support function.
+**
+**  Given:
+**     type   char[]     type of coordinates: "R", "H" or "A" (Note 1)
+**     ob1    double     observed Az, HA or RA (radians; Az is N=0,E=90)
+**     ob2    double     observed ZD or Dec (radians)
+**     astrom iauASTROM* star-independent astrometry parameters:
+**      pmt    double       PM time interval (SSB, Julian years)
+**      eb     double[3]    SSB to observer (vector, au)
+**      eh     double[3]    Sun to observer (unit vector)
+**      em     double       distance from Sun to observer (au)
+**      v      double[3]    barycentric observer velocity (vector, c)
+**      bm1    double       sqrt(1-|v|^2): reciprocal of Lorenz factor
+**      bpn    double[3][3] bias-precession-nutation matrix
+**      along  double       longitude + s' (radians)
+**      xpl    double       polar motion xp wrt local meridian (radians)
+**      ypl    double       polar motion yp wrt local meridian (radians)
+**      sphi   double       sine of geodetic latitude
+**      cphi   double       cosine of geodetic latitude
+**      diurab double       magnitude of diurnal aberration vector
+**      eral   double       "local" Earth rotation angle (radians)
+**      refa   double       refraction constant A (radians)
+**      refb   double       refraction constant B (radians)
+**
+**  Returned:
+**     ri     double*    CIRS right ascension (CIO-based, radians)
+**     di     double*    CIRS declination (radians)
+**
+**  Notes:
+**
+**  1) "Observed" Az,El means the position that would be seen by a
+**     perfect geodetically aligned theodolite.  This is related to
+**     the observed HA,Dec via the standard rotation, using the geodetic
+**     latitude (corrected for polar motion), while the observed HA and
+**     RA are related simply through the Earth rotation angle and the
+**     site longitude.  "Observed" RA,Dec or HA,Dec thus means the
+**     position that would be seen by a perfect equatorial with its
+**     polar axis aligned to the Earth's axis of rotation.  By removing
+**     from the observed place the effects of atmospheric refraction and
+**     diurnal aberration, the CIRS RA,Dec is obtained.
+**
+**  2) Only the first character of the type argument is significant.
+**     "R" or "r" indicates that ob1 and ob2 are the observed right
+**     ascension and declination;  "H" or "h" indicates that they are
+**     hour angle (west +ve) and declination;  anything else ("A" or
+**     "a" is recommended) indicates that ob1 and ob2 are azimuth (north
+**     zero, east 90 deg) and zenith distance.  (Zenith distance is used
+**     rather than altitude in order to reflect the fact that no
+**     allowance is made for depression of the horizon.)
+**
+**  3) The accuracy of the result is limited by the corrections for
+**     refraction, which use a simple A*tan(z) + B*tan^3(z) model.
+**     Providing the meteorological parameters are known accurately and
+**     there are no gross local effects, the predicted observed
+**     coordinates should be within 0.05 arcsec (optical) or 1 arcsec
+**     (radio) for a zenith distance of less than 70 degrees, better
+**     than 30 arcsec (optical or radio) at 85 degrees and better than
+**     20 arcmin (optical) or 30 arcmin (radio) at the horizon.
+**
+**     Without refraction, the complementary functions iauAtioq and
+**     iauAtoiq are self-consistent to better than 1 microarcsecond all
+**     over the celestial sphere.  With refraction included, consistency
+**     falls off at high zenith distances, but is still better than
+**     0.05 arcsec at 85 degrees.
+**
+**  4) It is advisable to take great care with units, as even unlikely
+**     values of the input parameters are accepted and processed in
+**     accordance with the models used.
+**
+**  Called:
+**     iauS2c       spherical coordinates to unit vector
+**     iauC2s       p-vector to spherical
+**     iauAnp       normalize angle into range 0 to 2pi
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int c;
+   double c1, c2, sphi, cphi, ce, xaeo, yaeo, zaeo, v[3],
+          xmhdo, ymhdo, zmhdo, az, sz, zdo, refa, refb, tz, dref,
+          zdt, xaet, yaet, zaet, xmhda, ymhda, zmhda,
+          f, xhd, yhd, zhd, xpl, ypl, w, hma;
+
+
+/* Coordinate type. */
+   c = (int) type[0];
+
+/* Coordinates. */
+   c1 = ob1;
+   c2 = ob2;
+
+/* Sin, cos of latitude. */
+   sphi = astrom->sphi;
+   cphi = astrom->cphi;
+
+/* Standardize coordinate type. */
+   if ( c == 'r' || c == 'R' ) {
+      c = 'R';
+   } else if ( c == 'h' || c == 'H' ) {
+      c = 'H';
+   } else {
+      c = 'A';
+   }
+
+/* If Az,ZD, convert to Cartesian (S=0,E=90). */
+   if ( c == 'A' ) {
+      ce = sin(c2);
+      xaeo = - cos(c1) * ce;
+      yaeo = sin(c1) * ce;
+      zaeo = cos(c2);
+
+   } else {
+
+   /* If RA,Dec, convert to HA,Dec. */
+      if ( c == 'R' ) c1 = astrom->eral - c1;
+
+   /* To Cartesian -HA,Dec. */
+      iauS2c ( -c1, c2, v );
+      xmhdo = v[0];
+      ymhdo = v[1];
+      zmhdo = v[2];
+
+   /* To Cartesian Az,El (S=0,E=90). */
+      xaeo = sphi*xmhdo - cphi*zmhdo;
+      yaeo = ymhdo;
+      zaeo = cphi*xmhdo + sphi*zmhdo;
+   }
+
+/* Azimuth (S=0,E=90). */
+   az = ( xaeo != 0.0 || yaeo != 0.0 ) ? atan2(yaeo,xaeo) : 0.0;
+
+/* Sine of observed ZD, and observed ZD. */
+   sz = sqrt ( xaeo*xaeo + yaeo*yaeo );
+   zdo = atan2 ( sz, zaeo );
+
+/*
+** Refraction
+** ----------
+*/
+
+/* Fast algorithm using two constant model. */
+   refa = astrom->refa;
+   refb = astrom->refb;
+   tz = sz / zaeo;
+   dref = ( refa + refb*tz*tz ) * tz;
+   zdt = zdo + dref;
+
+/* To Cartesian Az,ZD. */
+   ce = sin(zdt);
+   xaet = cos(az) * ce;
+   yaet = sin(az) * ce;
+   zaet = cos(zdt);
+
+/* Cartesian Az,ZD to Cartesian -HA,Dec. */
+   xmhda = sphi*xaet + cphi*zaet;
+   ymhda = yaet;
+   zmhda = - cphi*xaet + sphi*zaet;
+
+/* Diurnal aberration. */
+   f = ( 1.0 + astrom->diurab*ymhda );
+   xhd = f * xmhda;
+   yhd = f * ( ymhda - astrom->diurab );
+   zhd = f * zmhda;
+
+/* Polar motion. */
+   xpl = astrom->xpl;
+   ypl = astrom->ypl;
+   w = xpl*xhd - ypl*yhd + zhd;
+   v[0] = xhd - xpl*w;
+   v[1] = yhd + ypl*w;
+   v[2] = w - ( xpl*xpl + ypl*ypl ) * zhd;
+
+/* To spherical -HA,Dec. */
+   iauC2s(v, &hma, di);
+
+/* Right ascension. */
+   *ri = iauAnp(astrom->eral + hma);
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20120301_a/c/src/bi00.c b/20131202/c/src/bi00.c
similarity index 97%
rename from 20120301_a/c/src/bi00.c
rename to 20131202/c/src/bi00.c
index fff915e..7f72d06 100644
--- a/20120301_a/c/src/bi00.c
+++ b/20131202/c/src/bi00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauBi00(double *dpsibi, double *depsbi, double *dra)
 /*
@@ -46,11 +46,11 @@ void iauBi00(double *dpsibi, double *depsbi, double *dra)
 **     2002.  The MHB2000 code itself was obtained on 9th September 2002
 **     from ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A.
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* The frame bias corrections in longitude and obliquity */
@@ -70,7 +70,7 @@ void iauBi00(double *dpsibi, double *depsbi, double *dra)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/bp00.c b/20131202/c/src/bp00.c
similarity index 95%
rename from 20120301_a/c/src/bp00.c
rename to 20131202/c/src/bp00.c
index 0f506c2..c3d3958 100644
--- a/20120301_a/c/src/bp00.c
+++ b/20131202/c/src/bp00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauBp00(double date1, double date2,
              double rb[3][3], double rp[3][3], double rbp[3][3])
@@ -75,19 +75,18 @@ void iauBp00(double date1, double date2,
 **     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
 **          intermediate origin" (CIO) by IAU 2006 Resolution 2.
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 August 21
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* J2000.0 obliquity (Lieske et al. 1977) */
    const double EPS0 = 84381.448 * DAS2R;
 
-   double t, dpsibi, depsbi;
-   double dra0, psia77, oma77, chia, dpsipr, depspr, psia, oma,
-          rbw[3][3];
+   double t, dpsibi, depsbi, dra0, psia77, oma77, chia,
+          dpsipr, depspr, psia, oma, rbw[3][3];
 
 
 /* Interval between fundamental epoch J2000.0 and current date (JC). */
@@ -102,23 +101,23 @@ void iauBp00(double date1, double date2,
    chia   = (  10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * DAS2R;
 
 /* Apply IAU 2000 precession corrections. */
-   iauPr00(date1, date2, &dpsipr,  &depspr);
+   iauPr00(date1, date2, &dpsipr, &depspr);
    psia = psia77 + dpsipr;
    oma  = oma77  + depspr;
 
 /* Frame bias matrix: GCRS to J2000.0. */
    iauIr(rbw);
    iauRz(dra0, rbw);
-   iauRy(dpsibi * sin(EPS0), rbw);
+   iauRy(dpsibi*sin(EPS0), rbw);
    iauRx(-depsbi, rbw);
    iauCr(rbw, rb);
 
 /* Precession matrix: J2000.0 to mean of date. */
    iauIr(rp);
-   iauRx(EPS0,  rp);
+   iauRx(EPS0, rp);
    iauRz(-psia, rp);
-   iauRx(-oma,  rp);
-   iauRz(chia,  rp);
+   iauRx(-oma, rp);
+   iauRz(chia, rp);
 
 /* Bias-precession matrix: GCRS to mean of date. */
    iauRxr(rp, rbw, rbp);
@@ -127,7 +126,7 @@ void iauBp00(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/bp06.c b/20131202/c/src/bp06.c
similarity index 93%
rename from 20120301_a/c/src/bp06.c
rename to 20131202/c/src/bp06.c
index 04bbb59..fd24027 100644
--- a/20120301_a/c/src/bp06.c
+++ b/20131202/c/src/bp06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauBp06(double date1, double date2,
              double rb[3][3], double rp[3][3], double rbp[3][3])
@@ -52,12 +52,16 @@ void iauBp06(double date1, double date2,
 **  4) The matrix rbp transforms vectors from GCRS to mean of date by
 **     applying frame bias then precession.  It is the product rp x rb.
 **
+**  5) It is permissible to re-use the same array in the returned
+**     arguments.  The arrays are filled in the order given.
+**
 **  Called:
 **     iauPfw06     bias-precession F-W angles, IAU 2006
 **     iauFw2m      F-W angles to r-matrix
 **     iauPmat06    PB matrix, IAU 2006
 **     iauTr        transpose r-matrix
 **     iauRxr       product of two r-matrices
+**     iauCr        copy r-matrix
 **
 **  References:
 **
@@ -65,32 +69,35 @@ void iauBp06(double date1, double date2,
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 August 21
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double gamb, phib, psib, epsa, rbt[3][3];
+   double gamb, phib, psib, epsa, rbpw[3][3], rbt[3][3];
 
 
 /* B matrix. */
    iauPfw06(DJM0, DJM00, &gamb, &phib, &psib, &epsa);
    iauFw2m(gamb, phib, psib, epsa, rb);
 
-/* PxB matrix. */
-   iauPmat06(date1, date2, rbp);
+/* PxB matrix (temporary). */
+   iauPmat06(date1, date2, rbpw);
 
 /* P matrix. */
    iauTr(rb, rbt);
-   iauRxr(rbp, rbt, rp);
+   iauRxr(rbpw, rbt, rp);
+
+/* PxB matrix. */
+   iauCr(rbpw, rbp);
 
    return;
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/bpn2xy.c b/20131202/c/src/bpn2xy.c
similarity index 97%
rename from 20120301_a/c/src/bpn2xy.c
rename to 20131202/c/src/bpn2xy.c
index c64b38e..ac823da 100644
--- a/20120301_a/c/src/bpn2xy.c
+++ b/20131202/c/src/bpn2xy.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauBpn2xy(double rbpn[3][3], double *x, double *y)
 /*
@@ -39,11 +39,11 @@ void iauBpn2xy(double rbpn[3][3], double *x, double *y)
 **     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
 **          intermediate origin" (CIO) by IAU 2006 Resolution 2.
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Extract the X,Y coordinates. */
@@ -54,7 +54,7 @@ void iauBpn2xy(double rbpn[3][3], double *x, double *y)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2i00a.c b/20131202/c/src/c2i00a.c
similarity index 97%
rename from 20120301_a/c/src/c2i00a.c
rename to 20131202/c/src/c2i00a.c
index 936c010..77c4a86 100644
--- a/20120301_a/c/src/c2i00a.c
+++ b/20131202/c/src/c2i00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2i00a(double date1, double date2, double rc2i[3][3])
 /*
@@ -73,11 +73,11 @@ void iauC2i00a(double date1, double date2, double rc2i[3][3])
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3];
@@ -93,7 +93,7 @@ void iauC2i00a(double date1, double date2, double rc2i[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2i00b.c b/20131202/c/src/c2i00b.c
similarity index 97%
rename from 20120301_a/c/src/c2i00b.c
rename to 20131202/c/src/c2i00b.c
index 24a48d3..15f583e 100644
--- a/20120301_a/c/src/c2i00b.c
+++ b/20131202/c/src/c2i00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2i00b(double date1, double date2, double rc2i[3][3])
 /*
@@ -73,11 +73,11 @@ void iauC2i00b(double date1, double date2, double rc2i[3][3])
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3];
@@ -93,7 +93,7 @@ void iauC2i00b(double date1, double date2, double rc2i[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2i06a.c b/20131202/c/src/c2i06a.c
similarity index 95%
rename from 20120301_a/c/src/c2i06a.c
rename to 20131202/c/src/c2i06a.c
index 3ed93cc..f20d090 100644
--- a/20120301_a/c/src/c2i06a.c
+++ b/20131202/c/src/c2i06a.c
@@ -1,9 +1,9 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2i06a(double date1, double date2, double rc2i[3][3])
 /*
 **  - - - - - - - - - -
-**   i a u _ c 2 i 0 6 a
+**   i a u C 2 i 0 6 a
 **  - - - - - - - - - -
 **
 **  Form the celestial-to-intermediate matrix for a given date using the
@@ -56,19 +56,19 @@ void iauC2i06a(double date1, double date2, double rc2i[3][3])
 **  Called:
 **     iauPnm06a    classical NPB matrix, IAU 2006/2000A
 **     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
-**     iauS06       the CIO locator s, Given X,Y, IAU 2006
-**     iauC2ixys    celestial-to-intermediate matrix, Given X,Y and s
+**     iauS06       the CIO locator s, given X,Y, IAU 2006
+**     iauC2ixys    celestial-to-intermediate matrix, given X,Y and s
 **
 **  References:
 **
 **     McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG
 **
-**  This revision:  2008 May 13
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3], x, y, s;
@@ -90,7 +90,7 @@ void iauC2i06a(double date1, double date2, double rc2i[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2ibpn.c b/20131202/c/src/c2ibpn.c
similarity index 97%
rename from 20120301_a/c/src/c2ibpn.c
rename to 20131202/c/src/c2ibpn.c
index ff0ebe7..65e3a4a 100644
--- a/20120301_a/c/src/c2ibpn.c
+++ b/20131202/c/src/c2ibpn.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2ibpn(double date1, double date2, double rbpn[3][3],
                double rc2i[3][3])
@@ -76,11 +76,11 @@ void iauC2ibpn(double date1, double date2, double rbpn[3][3],
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, y;
@@ -96,7 +96,7 @@ void iauC2ibpn(double date1, double date2, double rbpn[3][3],
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2ixy.c b/20131202/c/src/c2ixy.c
similarity index 97%
rename from 20120301_a/c/src/c2ixy.c
rename to 20131202/c/src/c2ixy.c
index 3c53b40..da32a35 100644
--- a/20120301_a/c/src/c2ixy.c
+++ b/20131202/c/src/c2ixy.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2ixy(double date1, double date2, double x, double y,
               double rc2i[3][3])
@@ -70,11 +70,11 @@ void iauC2ixy(double date1, double date2, double x, double y,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 
 {
@@ -85,7 +85,7 @@ void iauC2ixy(double date1, double date2, double x, double y,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2ixys.c b/20131202/c/src/c2ixys.c
similarity index 97%
rename from 20120301_a/c/src/c2ixys.c
rename to 20131202/c/src/c2ixys.c
index 6c5b650..90b3cf2 100644
--- a/20120301_a/c/src/c2ixys.c
+++ b/20131202/c/src/c2ixys.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2ixys(double x, double y, double s, double rc2i[3][3])
 /*
@@ -52,11 +52,11 @@ void iauC2ixys(double x, double y, double s, double rc2i[3][3])
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 11
+**  This revision:  2008 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r2, e, d;
@@ -77,7 +77,7 @@ void iauC2ixys(double x, double y, double s, double rc2i[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2s.c b/20131202/c/src/c2s.c
similarity index 96%
rename from 20120301_a/c/src/c2s.c
rename to 20131202/c/src/c2s.c
index 02e5128..1e005f2 100644
--- a/20120301_a/c/src/c2s.c
+++ b/20131202/c/src/c2s.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2s(double p[3], double *theta, double *phi)
 /*
@@ -28,11 +28,11 @@ void iauC2s(double p[3], double *theta, double *phi)
 **
 **  3) At either pole, zero theta is returned.
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, y, z, d2;
@@ -50,7 +50,7 @@ void iauC2s(double p[3], double *theta, double *phi)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2t00a.c b/20131202/c/src/c2t00a.c
similarity index 98%
rename from 20120301_a/c/src/c2t00a.c
rename to 20131202/c/src/c2t00a.c
index ecd5fef..f6d43e4 100644
--- a/20120301_a/c/src/c2t00a.c
+++ b/20131202/c/src/c2t00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2t00a(double tta, double ttb, double uta, double utb,
                double xp, double yp, double rc2t[3][3])
@@ -79,11 +79,11 @@ void iauC2t00a(double tta, double ttb, double uta, double utb,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 April 1
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rc2i[3][3], era, sp, rpom[3][3];
@@ -108,7 +108,7 @@ void iauC2t00a(double tta, double ttb, double uta, double utb,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2t00b.c b/20131202/c/src/c2t00b.c
similarity index 97%
rename from 20120301_a/c/src/c2t00b.c
rename to 20131202/c/src/c2t00b.c
index b6116ef..285e3d4 100644
--- a/20120301_a/c/src/c2t00b.c
+++ b/20131202/c/src/c2t00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2t00b(double tta, double ttb, double uta, double utb,
                double xp, double yp, double rc2t[3][3])
@@ -78,11 +78,11 @@ void iauC2t00b(double tta, double ttb, double uta, double utb,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 April 1
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rc2i[3][3], era, rpom[3][3];
@@ -104,7 +104,7 @@ void iauC2t00b(double tta, double ttb, double uta, double utb,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2t06a.c b/20131202/c/src/c2t06a.c
similarity index 97%
rename from 20120301_a/c/src/c2t06a.c
rename to 20131202/c/src/c2t06a.c
index 2b60eae..438945f 100644
--- a/20120301_a/c/src/c2t06a.c
+++ b/20131202/c/src/c2t06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2t06a(double tta, double ttb, double uta, double utb,
                double xp, double yp, double rc2t[3][3])
@@ -77,11 +77,11 @@ void iauC2t06a(double tta, double ttb, double uta, double utb,
 **     McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG
 **
-**  This revision:  2009 April 1
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rc2i[3][3], era, sp, rpom[3][3];
@@ -106,7 +106,7 @@ void iauC2t06a(double tta, double ttb, double uta, double utb,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2tcio.c b/20131202/c/src/c2tcio.c
similarity index 96%
rename from 20120301_a/c/src/c2tcio.c
rename to 20131202/c/src/c2tcio.c
index 71320a0..f567103 100644
--- a/20120301_a/c/src/c2tcio.c
+++ b/20131202/c/src/c2tcio.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2tcio(double rc2i[3][3], double era, double rpom[3][3],
                double rc2t[3][3])
@@ -18,7 +18,7 @@ void iauC2tcio(double rc2i[3][3], double era, double rpom[3][3],
 **
 **  Given:
 **     rc2i     double[3][3]    celestial-to-intermediate matrix
-**     era      double          Earth rotation angle
+**     era      double          Earth rotation angle (radians)
 **     rpom     double[3][3]    polar-motion matrix
 **
 **  Returned:
@@ -57,11 +57,11 @@ void iauC2tcio(double rc2i[3][3], double era, double rpom[3][3],
 **     McCarthy, D. D., Petit, G. (eds.), 2004, IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 August 24
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r[3][3];
@@ -76,7 +76,7 @@ void iauC2tcio(double rc2i[3][3], double era, double rpom[3][3],
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2teqx.c b/20131202/c/src/c2teqx.c
similarity index 93%
rename from 20120301_a/c/src/c2teqx.c
rename to 20131202/c/src/c2teqx.c
index 9632ca4..5f7f0b1 100644
--- a/20120301_a/c/src/c2teqx.c
+++ b/20131202/c/src/c2teqx.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
                double rc2t[3][3])
@@ -17,12 +17,12 @@ void iauC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
 **  Status:  support function.
 **
 **  Given:
-**     rbpn     double[3][3]    celestial-to-true matrix
-**     gst      double          Greenwich (apparent) Sidereal Time
-**     rpom     double[3][3]    polar-motion matrix
+**     rbpn   double[3][3]  celestial-to-true matrix
+**     gst    double        Greenwich (apparent) Sidereal Time (radians)
+**     rpom   double[3][3]  polar-motion matrix
 **
 **  Returned:
-**     rc2t     double[3][3]    celestial-to-terrestrial matrix (Note 2)
+**     rc2t   double[3][3]  celestial-to-terrestrial matrix (Note 2)
 **
 **  Notes:
 **
@@ -57,11 +57,11 @@ void iauC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 August 24
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r[3][3];
@@ -76,7 +76,7 @@ void iauC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2tpe.c b/20131202/c/src/c2tpe.c
similarity index 98%
rename from 20120301_a/c/src/c2tpe.c
rename to 20131202/c/src/c2tpe.c
index 281cd93..65fb21b 100644
--- a/20120301_a/c/src/c2tpe.c
+++ b/20131202/c/src/c2tpe.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2tpe(double tta, double ttb, double uta, double utb,
               double dpsi, double deps, double xp, double yp,
@@ -88,11 +88,11 @@ void iauC2tpe(double tta, double ttb, double uta, double utb,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 April 1
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3],
@@ -121,7 +121,7 @@ void iauC2tpe(double tta, double ttb, double uta, double utb,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/c2txy.c b/20131202/c/src/c2txy.c
similarity index 98%
rename from 20120301_a/c/src/c2txy.c
rename to 20131202/c/src/c2txy.c
index 5ee1280..0afaff6 100644
--- a/20120301_a/c/src/c2txy.c
+++ b/20131202/c/src/c2txy.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauC2txy(double tta, double ttb, double uta, double utb,
               double x, double y, double xp, double yp,
@@ -84,11 +84,11 @@ void iauC2txy(double tta, double ttb, double uta, double utb,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 April 1
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rc2i[3][3], era, sp, rpom[3][3];
@@ -113,7 +113,7 @@ void iauC2txy(double tta, double ttb, double uta, double utb,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/cal2jd.c b/20131202/c/src/cal2jd.c
similarity index 97%
rename from 20120301_a/c/src/cal2jd.c
rename to 20131202/c/src/cal2jd.c
index 0d6c154..93185f7 100644
--- a/20120301_a/c/src/cal2jd.c
+++ b/20131202/c/src/cal2jd.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauCal2jd(int iy, int im, int id, double *djm0, double *djm)
 /*
@@ -48,11 +48,11 @@ int iauCal2jd(int iy, int im, int id, double *djm0, double *djm)
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 12.92 (p604).
 **
-**  This revision:  2009 October 19
+**  This revision:  2013 August 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int j, ly, my;
@@ -82,7 +82,7 @@ int iauCal2jd(int iy, int im, int id, double *djm0, double *djm)
 /* Return result. */
    my = (im - 14) / 12;
    iypmy = (long) (iy + my);
-   *djm0 = 2400000.5;
+   *djm0 = DJM0;
    *djm = (double)((1461L * (iypmy + 4800L)) / 4L
                  + (367L * (long) (im - 2 - 12 * my)) / 12L
                  - (3L * ((iypmy + 4900L) / 100L)) / 4L
@@ -93,7 +93,7 @@ int iauCal2jd(int iy, int im, int id, double *djm0, double *djm)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/cp.c b/20131202/c/src/cp.c
similarity index 96%
rename from 20120301_a/c/src/cp.c
rename to 20131202/c/src/cp.c
index 1c13587..d54f365 100644
--- a/20120301_a/c/src/cp.c
+++ b/20131202/c/src/cp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauCp(double p[3], double c[3])
 /*
@@ -19,11 +19,11 @@ void iauCp(double p[3], double c[3])
 **  Returned:
 **     c        double[3]     copy
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    c[0] = p[0];
@@ -34,7 +34,7 @@ void iauCp(double p[3], double c[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/cpv.c b/20131202/c/src/cpv.c
similarity index 96%
rename from 20120301_a/c/src/cpv.c
rename to 20131202/c/src/cpv.c
index 2f9698b..9798f1e 100644
--- a/20120301_a/c/src/cpv.c
+++ b/20131202/c/src/cpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauCpv(double pv[2][3], double c[2][3])
 /*
@@ -22,11 +22,11 @@ void iauCpv(double pv[2][3], double c[2][3])
 **  Called:
 **     iauCp        copy p-vector
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauCp(pv[0], c[0]);
@@ -36,7 +36,7 @@ void iauCpv(double pv[2][3], double c[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/cr.c b/20131202/c/src/cr.c
similarity index 96%
rename from 20120301_a/c/src/cr.c
rename to 20131202/c/src/cr.c
index 9c4ee7e..ca1b008 100644
--- a/20120301_a/c/src/cr.c
+++ b/20131202/c/src/cr.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauCr(double r[3][3], double c[3][3])
 /*
@@ -22,11 +22,11 @@ void iauCr(double r[3][3], double c[3][3])
 **  Called:
 **     iauCp        copy p-vector
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauCp(r[0], c[0]);
@@ -37,7 +37,7 @@ void iauCr(double r[3][3], double c[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/d2dtf.c b/20131202/c/src/d2dtf.c
similarity index 88%
rename from 20120301_a/c/src/d2dtf.c
rename to 20131202/c/src/d2dtf.c
index f84ac3f..4e0a8da 100644
--- a/20120301_a/c/src/d2dtf.c
+++ b/20131202/c/src/d2dtf.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 #include <string.h>
 
 int iauD2dtf(const char *scale, int ndp, double d1, double d2,
@@ -60,10 +60,13 @@ int iauD2dtf(const char *scale, int ndp, double d1, double d2,
 **  4) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The SOFA internal convention is that
 **     the quasi-JD day represents UTC days whether the length is 86399,
-**     86400 or 86401 SI seconds.
+**     86400 or 86401 SI seconds.  In the 1960-1972 era there were
+**     smaller jumps (in either direction) each time the linear UTC(TAI)
+**     expression was changed, and these "mini-leaps" are also included
+**     in the SOFA convention.
 **
 **  5) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  6) For calendar conventions and limitations, see iauCal2jd.
@@ -73,17 +76,17 @@ int iauD2dtf(const char *scale, int ndp, double d1, double d2,
 **     iauD2tf      decompose days to hms
 **     iauDat       delta(AT) = TAI-UTC
 **
-**  This revision:  2012 February 12
+**  This revision:  2013 July 26
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int leap;
    char s;
    int iy1, im1, id1, js, iy2, im2, id2, ihmsf1[4], i;
-   double a1, b1, fd, dat1, w, dat2, ddt;
+   double a1, b1, fd, dat0, dat12, w, dat24, dleap;
 
 
 /* The two-part JD. */
@@ -92,27 +95,34 @@ int iauD2dtf(const char *scale, int ndp, double d1, double d2,
 
 /* Provisional calendar date. */
    js = iauJd2cal(a1, b1, &iy1, &im1, &id1, &fd);
-   if ( js ) return js < 0 ? -1 : js;
+   if ( js ) return -1;
 
 /* Is this a leap second day? */
    leap = 0;
    if ( ! strcmp(scale,"UTC") ) {
 
-   /* TAI-UTC today. */
-      js = iauDat(iy1, im1, id1, fd, &dat1);
+   /* TAI-UTC at 0h today. */
+      js = iauDat(iy1, im1, id1, 0.0, &dat0);
       if ( js < 0 ) return -1;
 
-   /* TAI-UTC tomorrow (at noon, to avoid rounding effects). */
+   /* TAI-UTC at 12h today (to detect drift). */
+      js = iauDat(iy1, im1, id1, 0.5, &dat12);
+      if ( js < 0 ) return -1;
+
+   /* TAI-UTC at 0h tomorrow (to detect jumps). */
       js = iauJd2cal(a1+1.5, b1-fd, &iy2, &im2, &id2, &w);
-      js = iauDat(iy2, im2, id2, 0.0, &dat2);
+      if ( js ) return -1;
+      js = iauDat(iy2, im2, id2, 0.0, &dat24);
       if ( js < 0 ) return -1;
 
-   /* The change in TAI-UTC (seconds). */
-      ddt = dat2 - dat1;
+   /* Any sudden change in TAI-UTC (seconds). */
+      dleap = dat24 - (2.0*dat12 - dat0);
 
    /* If leap second day, scale the fraction of a day into SI. */
-      leap = fabs(ddt) > 0.5;
-      if (leap) fd += fd * ddt/DAYSEC;
+      leap = (dleap != 0.0);
+      if (leap) fd += fd * dleap/DAYSEC;
+
+   /* End of UTC-specific actions. */
    }
 
 /* Provisional time of day. */
@@ -160,7 +170,7 @@ int iauD2dtf(const char *scale, int ndp, double d1, double d2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/d2tf.c b/20131202/c/src/d2tf.c
similarity index 97%
rename from 20120301_a/c/src/d2tf.c
rename to 20131202/c/src/d2tf.c
index d887f34..16dea5e 100644
--- a/20120301_a/c/src/d2tf.c
+++ b/20131202/c/src/d2tf.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauD2tf(int ndp, double days, char *sign, int ihmsf[4])
 /*
@@ -53,11 +53,11 @@ void iauD2tf(int ndp, double days, char *sign, int ihmsf[4])
 **     case where days is very nearly 1.0 and rounds up to 24 hours,
 **     by testing for ihmsf[0]=24 and setting ihmsf[0-3] to zero.
 **
-**  This revision:  2008 May 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int nrs, n;
@@ -114,7 +114,7 @@ void iauD2tf(int ndp, double days, char *sign, int ihmsf[4])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/dat.c b/20131202/c/src/dat.c
similarity index 94%
rename from 20120301_a/c/src/dat.c
rename to 20131202/c/src/dat.c
index 2441131..cbbf4f6 100644
--- a/20120301_a/c/src/dat.c
+++ b/20131202/c/src/dat.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauDat(int iy, int im, int id, double fd, double *deltat )
 /*
@@ -21,8 +21,8 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **     :     of statements that initialize the    :
 **     :     array "changes".                     :
 **     :                                          :
-**     :  2) The parameter IYV must be set to     :
-**     :     the current year.                    :
+**     :  2) The constant IYV must be set to the  :
+**     :     current year.                        :
 **     :                                          :
 **     :  3) The "Latest leap second" comment     :
 **     :     below must be set to the new leap    :
@@ -72,13 +72,13 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **     Because leap seconds cannot, in principle, be predicted in
 **     advance, a reliable check for dates beyond the valid range is
 **     impossible.  To guard against gross errors, a year five or more
-**     after the release year of the present function (see parameter
+**     after the release year of the present function (see the constant
 **     IYV) is considered dubious.  In this case a warning status is
 **     returned but the result is computed in the normal way.
 **
-**     For both too-early and too-late years, the warning status is
-**     j=+1.  This is distinct from the error status j=-1, which
-**     signifies a year so early that JD could not be computed.
+**     For both too-early and too-late years, the warning status is +1.
+**     This is distinct from the error status -1, which signifies a year
+**     so early that JD could not be computed.
 **
 **  2) If the specified date is for a day which ends with a leap second,
 **     the UTC-TAI value returned is for the period leading up to the
@@ -94,14 +94,14 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **  4) The fraction of day is used only for dates before the
 **     introduction of leap seconds, the first of which occurred at the
 **     end of 1971.  It is tested for validity (0 to 1 is the valid
-**     range) even if not used;  if invalid, zero is used and status
-**     j=-4 is returned.  For many applications, setting fd to zero is
+**     range) even if not used;  if invalid, zero is used and status -4
+**     is returned.  For many applications, setting fd to zero is
 **     acceptable;  the resulting error is always less than 3 ms (and
 **     occurs only pre-1972).
 **
 **  5) The status value returned in the case where there are multiple
 **     errors refers to the first error detected.  For example, if the
-**     month and day are 13 and 32 respectively, j=-2 (bad month)
+**     month and day are 13 and 32 respectively, status -2 (bad month)
 **     will be returned.
 **
 **  6) In cases where a valid result is not available, zero is returned.
@@ -115,17 +115,17 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 **     the 1992 Explanatory Supplement.
 **
 **  Called:
-**     iauCal2jd    Gregorian calendar to Julian Day number
+**     iauCal2jd    Gregorian calendar to JD
 **
-**  This revision:  2012 June 14
+**  This revision:  2013 August 21
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Release year for this version of iauDat */
-#define IYV (2012)
+   enum { IYV = 2013};
 
 /* Reference dates (MJD) and drift rates (s/day), pre leap seconds */
    static const double drift[][2] = {
@@ -146,7 +146,7 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
    };
 
 /* Number of Delta(AT) expressions before leap seconds were introduced */
-#define NERA1 ((int) (sizeof drift / sizeof (double) / 2))
+   enum { NERA1 = (int) (sizeof drift / sizeof (double) / 2) };
 
 /* Dates and Delta(AT)s */
    static const struct {
@@ -243,7 +243,7 @@ int iauDat(int iy, int im, int id, double fd, double *deltat )
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/dtdb.c b/20131202/c/src/dtdb.c
similarity index 99%
rename from 20120301_a/c/src/dtdb.c
rename to 20131202/c/src/dtdb.c
index 0048dbe..e857560 100644
--- a/20120301_a/c/src/dtdb.c
+++ b/20131202/c/src/dtdb.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauDtdb(double date1, double date2,
                double ut, double elong, double u, double v)
@@ -162,11 +162,11 @@ double iauDtdb(double date1, double date2,
 **     Simon, J.L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G. & Laskar, J., Astron.Astrophys., 282, 663-683 (1994).
 **
-**  This revision:  2012 February 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, tsol, w, elsun, emsun, d, elj, els, wt, w0, w1, w2, w3, w4,
@@ -1167,7 +1167,7 @@ double iauDtdb(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/dtf2d.c b/20131202/c/src/dtf2d.c
similarity index 87%
rename from 20120301_a/c/src/dtf2d.c
rename to 20131202/c/src/dtf2d.c
index 949c6cc..1390626 100644
--- a/20120301_a/c/src/dtf2d.c
+++ b/20131202/c/src/dtf2d.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 #include <string.h>
 
 int iauDtf2d(const char *scale, int iy, int im, int id,
@@ -54,7 +54,10 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 **  4) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The SOFA internal convention is that
 **     the quasi-JD day represents UTC days whether the length is 86399,
-**     86400 or 86401 SI seconds.
+**     86400 or 86401 SI seconds.  In the 1960-1972 era there were
+**     smaller jumps (in either direction) each time the linear UTC(TAI)
+**     expression was changed, and these "mini-leaps" are also included
+**     in the SOFA convention.
 **
 **  5) The warning status "time is after end of day" usually means that
 **     the sec argument is greater than 60.0.  However, in a day ending
@@ -62,7 +65,7 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 **     of a negative leap second).
 **
 **  6) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  7) Only in the case of continuous and regular time scales (TAI, TT,
@@ -77,15 +80,15 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 **     iauDat       delta(AT) = TAI-UTC
 **     iauJd2cal    JD to Gregorian calendar
 **
-**  This revision:  2012 February 12
+**  This revision:  2013 July 26
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int js, iy2, im2, id2;
-   double dj, w, day, seclim, dat1, dat2, ddt, time;
+   double dj, w, day, seclim, dat0, dat12, dat24, dleap, time;
 
 
 /* Today's Julian Day Number. */
@@ -95,29 +98,33 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 
 /* Day length and final minute length in seconds (provisional). */
    day = DAYSEC;
-   seclim = 60;
+   seclim = 60.0;
 
 /* Deal with the UTC leap second case. */
    if ( ! strcmp(scale,"UTC") ) {
 
-   /* TAI-UTC today. */
-      js = iauDat(iy, im, id, 0.0, &dat1);
+   /* TAI-UTC at 0h today. */
+      js = iauDat(iy, im, id, 0.0, &dat0);
       if ( js < 0 ) return js;
 
-   /* TAI-UTC tomorrow. */
-      js = iauJd2cal ( dj, 1.0, &iy2, &im2, &id2, &w);
+   /* TAI-UTC at 12h today (to detect drift). */
+      js = iauDat(iy, im, id, 0.5, &dat12);
+      if ( js < 0 ) return js;
+
+   /* TAI-UTC at 0h tomorrow (to detect jumps). */
+      js = iauJd2cal ( dj, 1.5, &iy2, &im2, &id2, &w);
       if ( js ) return js;
-      js = iauDat(iy2, im2, id2, 0.0, &dat2);
+      js = iauDat(iy2, im2, id2, 0.0, &dat24);
       if ( js < 0 ) return js;
 
-   /* The change in TAI-UTC (seconds). */
-      ddt = dat2 - dat1;
+   /* Any sudden change in TAI-UTC between today and tomorrow. */
+      dleap = dat24 - (2.0*dat12 - dat0);
 
    /* If leap second day, correct the day and final minute lengths. */
-      if ( fabs(ddt) > 0.5 ) {
-         day += ddt;
-         if ( ihr == 23 && imn == 59 ) seclim += ddt;
-      }
+      day += dleap;
+      if ( ihr == 23 && imn == 59 ) seclim += dleap;
+
+   /* End of UTC-specific actions. */
    }
 
 /* Validate the time. */
@@ -150,7 +157,7 @@ int iauDtf2d(const char *scale, int iy, int im, int id,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ee00.c b/20131202/c/src/ee00.c
similarity index 98%
rename from 20120301_a/c/src/ee00.c
rename to 20131202/c/src/ee00.c
index 2bacd79..c1efeec 100644
--- a/20120301_a/c/src/ee00.c
+++ b/20131202/c/src/ee00.c
@@ -67,9 +67,9 @@ double iauEe00(double date1, double date2, double epsa, double dpsi)
 **
 **  This revision:  2008 May 16
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double ee;
@@ -82,7 +82,7 @@ double iauEe00(double date1, double date2, double epsa, double dpsi)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ee00a.c b/20131202/c/src/ee00a.c
similarity index 98%
rename from 20120301_a/c/src/ee00a.c
rename to 20131202/c/src/ee00a.c
index 75d4f57..3579acc 100644
--- a/20120301_a/c/src/ee00a.c
+++ b/20131202/c/src/ee00a.c
@@ -65,9 +65,9 @@ double iauEe00a(double date1, double date2)
 **
 **  This revision:  2008 May 16
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsipr, depspr, epsa, dpsi, deps, ee;
@@ -89,7 +89,7 @@ double iauEe00a(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ee00b.c b/20131202/c/src/ee00b.c
similarity index 98%
rename from 20120301_a/c/src/ee00b.c
rename to 20131202/c/src/ee00b.c
index cd7d485..668cdaf 100644
--- a/20120301_a/c/src/ee00b.c
+++ b/20131202/c/src/ee00b.c
@@ -71,9 +71,9 @@ double iauEe00b(double date1, double date2)
 **
 **  This revision:  2008 May 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsipr, depspr, epsa, dpsi, deps, ee;
@@ -95,7 +95,7 @@ double iauEe00b(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ee06a.c b/20131202/c/src/ee06a.c
similarity index 98%
rename from 20120301_a/c/src/ee06a.c
rename to 20131202/c/src/ee06a.c
index 5cea946..cd2cc76 100644
--- a/20120301_a/c/src/ee06a.c
+++ b/20131202/c/src/ee06a.c
@@ -57,9 +57,9 @@ double iauEe06a(double date1, double date2)
 **
 **  This revision:  2008 May 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gst06a, gmst06, ee;
@@ -76,7 +76,7 @@ double iauEe06a(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/eect00.c b/20131202/c/src/eect00.c
similarity index 98%
rename from 20120301_a/c/src/eect00.c
rename to 20131202/c/src/eect00.c
index 2396dc5..bf3d781 100644
--- a/20120301_a/c/src/eect00.c
+++ b/20131202/c/src/eect00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEect00(double date1, double date2)
 /*
@@ -96,11 +96,11 @@ double iauEect00(double date1, double date2)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Time since J2000.0, in Julian centuries */
@@ -236,7 +236,7 @@ double iauEect00(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/eform.c b/20131202/c/src/eform.c
similarity index 97%
rename from 20120301_a/c/src/eform.c
rename to 20131202/c/src/eform.c
index d9b25d8..11f34e0 100644
--- a/20120301_a/c/src/eform.c
+++ b/20131202/c/src/eform.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauEform ( int n, double *a, double *f )
 /*
@@ -60,11 +60,11 @@ int iauEform ( int n, double *a, double *f )
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     p220.
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -100,7 +100,7 @@ int iauEform ( int n, double *a, double *f )
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/eo06a.c b/20131202/c/src/eo06a.c
similarity index 96%
rename from 20120301_a/c/src/eo06a.c
rename to 20131202/c/src/eo06a.c
index 04cc4da..fbd9809 100644
--- a/20120301_a/c/src/eo06a.c
+++ b/20131202/c/src/eo06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEo06a(double date1, double date2)
 /*
@@ -51,7 +51,7 @@ double iauEo06a(double date1, double date2)
 **     iauPnm06a    classical NPB matrix, IAU 2006/2000A
 **     iauBpn2xy    extract CIP X,Y coordinates from NPB matrix
 **     iauS06       the CIO locator s, given X,Y, IAU 2006
-**     iauEors      equation of the origins, Given NPB matrix and s
+**     iauEors      equation of the origins, given NPB matrix and s
 **
 **  References:
 **
@@ -59,11 +59,11 @@ double iauEo06a(double date1, double date2)
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r[3][3], x, y, s, eo;
@@ -85,7 +85,7 @@ double iauEo06a(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/eors.c b/20131202/c/src/eors.c
similarity index 97%
rename from 20120301_a/c/src/eors.c
rename to 20131202/c/src/eors.c
index 0c119b0..bf7dbe9 100644
--- a/20120301_a/c/src/eors.c
+++ b/20131202/c/src/eors.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEors(double rnpb[3][3], double s)
 /*
@@ -38,11 +38,11 @@ double iauEors(double rnpb[3][3], double s)
 **
 **     Wallace, P. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, ax, xs, ys, zs, p, q, eo;
@@ -62,7 +62,7 @@ double iauEors(double rnpb[3][3], double s)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/epb.c b/20131202/c/src/epb.c
similarity index 92%
rename from 20120301_a/c/src/epb.c
rename to 20131202/c/src/epb.c
index 4b1008e..b09b688 100644
--- a/20120301_a/c/src/epb.c
+++ b/20131202/c/src/epb.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEpb(double dj1, double dj2)
 /*
@@ -24,33 +24,28 @@ double iauEpb(double dj1, double dj2)
 **     The Julian Date is supplied in two pieces, in the usual SOFA
 **     manner, which is designed to preserve time resolution.  The
 **     Julian Date is available as a single number by adding dj1 and
-**     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
+**     dj2.  The maximum resolution is achieved if dj1 is 2451545.0
 **     (J2000.0).
 **
 **  Reference:
 **
-**     Lieske,J.H., 1979. Astron.Astrophys.,73,282.
+**     Lieske, J.H., 1979. Astron.Astrophys., 73, 282.
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 August 21
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-/* J2000.0 minus B1900.0 (2415019.81352) in Julian days */
-   static const double D1900 = 36524.68648;
+/* J2000.0-B1900.0 (2415019.81352) in days */
+   const double D1900 = 36524.68648;
 
-   double epb;
-
-
-   epb = 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
-
-   return epb;
+   return 1900.0 + ((dj1 - DJ00) + (dj2 + D1900)) / DTY;
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/epb2jd.c b/20131202/c/src/epb2jd.c
similarity index 95%
rename from 20120301_a/c/src/epb2jd.c
rename to 20131202/c/src/epb2jd.c
index e86f88b..ebaa1d4 100644
--- a/20120301_a/c/src/epb2jd.c
+++ b/20131202/c/src/epb2jd.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauEpb2jd(double epb, double *djm0, double *djm)
 /*
@@ -14,7 +14,7 @@ void iauEpb2jd(double epb, double *djm0, double *djm)
 **  Status:  support function.
 **
 **  Given:
-**     epb      double    Besselian Epoch (e.g. 1957.3D0)
+**     epb      double    Besselian Epoch (e.g. 1957.3)
 **
 **  Returned:
 **     djm0     double    MJD zero-point: always 2400000.5
@@ -31,21 +31,21 @@ void iauEpb2jd(double epb, double *djm0, double *djm)
 **
 **     Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 August 13
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   *djm0 = 2400000.5;
+   *djm0 = DJM0;
    *djm  =   15019.81352 + (epb - 1900.0) * DTY;
 
    return;
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/epj.c b/20131202/c/src/epj.c
similarity index 96%
rename from 20120301_a/c/src/epj.c
rename to 20131202/c/src/epj.c
index b94b201..cfd2363 100644
--- a/20120301_a/c/src/epj.c
+++ b/20131202/c/src/epj.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEpj(double dj1, double dj2)
 /*
@@ -24,18 +24,18 @@ double iauEpj(double dj1, double dj2)
 **     The Julian Date is supplied in two pieces, in the usual SOFA
 **     manner, which is designed to preserve time resolution.  The
 **     Julian Date is available as a single number by adding dj1 and
-**     dj2.  The maximum resolution is achieved if dj1 is 2451545D0
+**     dj2.  The maximum resolution is achieved if dj1 is 2451545.0
 **     (J2000.0).
 **
 **  Reference:
 **
 **     Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 August 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double epj;
@@ -47,7 +47,7 @@ double iauEpj(double dj1, double dj2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/epj2jd.c b/20131202/c/src/epj2jd.c
similarity index 94%
rename from 20120301_a/c/src/epj2jd.c
rename to 20131202/c/src/epj2jd.c
index 41ed251..e841dab 100644
--- a/20120301_a/c/src/epj2jd.c
+++ b/20131202/c/src/epj2jd.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauEpj2jd(double epj, double *djm0, double *djm)
 /*
@@ -14,7 +14,7 @@ void iauEpj2jd(double epj, double *djm0, double *djm)
 **  Status:  support function.
 **
 **  Given:
-**     epj      double    Julian Epoch (e.g. 1996.8D0)
+**     epj      double    Julian Epoch (e.g. 1996.8)
 **
 **  Returned:
 **     djm0     double    MJD zero-point: always 2400000.5
@@ -31,21 +31,21 @@ void iauEpj2jd(double epj, double *djm0, double *djm)
 **
 **     Lieske, J.H., 1979, Astron.Astrophys. 73, 282.
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 August 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   *djm0 = 2400000.5;
-   *djm  =   51544.5 + (epj - 2000.0) * 365.25;
+   *djm0 = DJM0;
+   *djm  = DJM00 + (epj - 2000.0) * 365.25;
 
    return;
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/epv00.c b/20131202/c/src/epv00.c
similarity index 99%
rename from 20120301_a/c/src/epv00.c
rename to 20131202/c/src/epv00.c
index df322a4..84ab43c 100644
--- a/20120301_a/c/src/epv00.c
+++ b/20131202/c/src/epv00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauEpv00(double date1, double date2,
              double pvh[2][3], double pvb[2][3])
@@ -99,11 +99,11 @@ int iauEpv00(double date1, double date2,
 **  5) It is permissible to use the same array for pvh and pvb, which
 **     will receive the barycentric values.
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /*
@@ -2543,7 +2543,7 @@ int iauEpv00(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/eqeq94.c b/20131202/c/src/eqeq94.c
similarity index 96%
rename from 20120301_a/c/src/eqeq94.c
rename to 20131202/c/src/eqeq94.c
index 0b7e05c..cafecd4 100644
--- a/20120301_a/c/src/eqeq94.c
+++ b/20131202/c/src/eqeq94.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEqeq94(double date1, double date2)
 /*
@@ -45,6 +45,7 @@ double iauEqeq94(double date1, double date2)
 **        Greenwich apparent ST = GMST + equation of the equinoxes
 **
 **  Called:
+**     iauAnpm      normalize angle into range +/- pi
 **     iauNut80     nutation, IAU 1980
 **     iauObl80     mean obliquity, IAU 1980
 **
@@ -55,11 +56,11 @@ double iauEqeq94(double date1, double date2)
 **     Capitaine, N. & Gontier, A.-M., 1993, Astron. Astrophys., 275,
 **     645-650.
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 August 31
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t,  om,  dpsi,  deps,  eps0, ee;
@@ -85,7 +86,7 @@ double iauEqeq94(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/era00.c b/20131202/c/src/era00.c
similarity index 97%
rename from 20120301_a/c/src/era00.c
rename to 20131202/c/src/era00.c
index ab24fee..881e636 100644
--- a/20120301_a/c/src/era00.c
+++ b/20131202/c/src/era00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauEra00(double dj1, double dj2)
 /*
@@ -59,11 +59,11 @@ double iauEra00(double dj1, double dj2)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double d1, d2, t, f, theta;
@@ -90,7 +90,7 @@ double iauEra00(double dj1, double dj2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fad03.c b/20131202/c/src/fad03.c
similarity index 97%
rename from 20120301_a/c/src/fad03.c
rename to 20131202/c/src/fad03.c
index 30a336a..5537c41 100644
--- a/20120301_a/c/src/fad03.c
+++ b/20131202/c/src/fad03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFad03(double t)
 /*
@@ -36,11 +36,11 @@ double iauFad03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -57,7 +57,7 @@ double iauFad03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fae03.c b/20131202/c/src/fae03.c
similarity index 97%
rename from 20120301_a/c/src/fae03.c
rename to 20131202/c/src/fae03.c
index 73efe65..efab08d 100644
--- a/20120301_a/c/src/fae03.c
+++ b/20131202/c/src/fae03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFae03(double t)
 /*
@@ -39,11 +39,11 @@ double iauFae03(double t)
 **     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
 **     Astron.Astrophys.Supp.Ser. 135, 111
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -56,7 +56,7 @@ double iauFae03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/faf03.c b/20131202/c/src/faf03.c
similarity index 97%
rename from 20120301_a/c/src/faf03.c
rename to 20131202/c/src/faf03.c
index 3a5cd61..67aee24 100644
--- a/20120301_a/c/src/faf03.c
+++ b/20131202/c/src/faf03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFaf03(double t)
 /*
@@ -37,11 +37,11 @@ double iauFaf03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -60,7 +60,7 @@ double iauFaf03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/faju03.c b/20131202/c/src/faju03.c
similarity index 97%
rename from 20120301_a/c/src/faju03.c
rename to 20131202/c/src/faju03.c
index d815e63..fa62b48 100644
--- a/20120301_a/c/src/faju03.c
+++ b/20131202/c/src/faju03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFaju03(double t)
 /*
@@ -39,11 +39,11 @@ double iauFaju03(double t)
 **     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
 **     Astron.Astrophys.Supp.Ser. 135, 111
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -56,7 +56,7 @@ double iauFaju03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fal03.c b/20131202/c/src/fal03.c
similarity index 97%
rename from 20120301_a/c/src/fal03.c
rename to 20131202/c/src/fal03.c
index 48987e9..1dcd2bd 100644
--- a/20120301_a/c/src/fal03.c
+++ b/20131202/c/src/fal03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFal03(double t)
 /*
@@ -36,11 +36,11 @@ double iauFal03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -57,7 +57,7 @@ double iauFal03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/falp03.c b/20131202/c/src/falp03.c
similarity index 97%
rename from 20120301_a/c/src/falp03.c
rename to 20131202/c/src/falp03.c
index cde82d5..14b27f7 100644
--- a/20120301_a/c/src/falp03.c
+++ b/20131202/c/src/falp03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFalp03(double t)
 /*
@@ -36,11 +36,11 @@ double iauFalp03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -57,7 +57,7 @@ double iauFalp03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fama03.c b/20131202/c/src/fama03.c
similarity index 97%
rename from 20120301_a/c/src/fama03.c
rename to 20131202/c/src/fama03.c
index 78c8c20..4bc6908 100644
--- a/20120301_a/c/src/fama03.c
+++ b/20131202/c/src/fama03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFama03(double t)
 /*
@@ -39,11 +39,11 @@ double iauFama03(double t)
 **     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
 **     Astron.Astrophys.Supp.Ser. 135, 111
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -56,7 +56,7 @@ double iauFama03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fame03.c b/20131202/c/src/fame03.c
similarity index 97%
rename from 20120301_a/c/src/fame03.c
rename to 20131202/c/src/fame03.c
index 80d2c3b..7eebb51 100644
--- a/20120301_a/c/src/fame03.c
+++ b/20131202/c/src/fame03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFame03(double t)
 /*
@@ -39,11 +39,11 @@ double iauFame03(double t)
 **     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
 **     Astron.Astrophys.Supp.Ser. 135, 111
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -56,7 +56,7 @@ double iauFame03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fane03.c b/20131202/c/src/fane03.c
similarity index 97%
rename from 20120301_a/c/src/fane03.c
rename to 20131202/c/src/fane03.c
index a6e1870..7cda9dc 100644
--- a/20120301_a/c/src/fane03.c
+++ b/20131202/c/src/fane03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFane03(double t)
 /*
@@ -36,11 +36,11 @@ double iauFane03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -53,7 +53,7 @@ double iauFane03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/faom03.c b/20131202/c/src/faom03.c
similarity index 97%
rename from 20120301_a/c/src/faom03.c
rename to 20131202/c/src/faom03.c
index ab47ec4..6274738 100644
--- a/20120301_a/c/src/faom03.c
+++ b/20131202/c/src/faom03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFaom03(double t)
 /*
@@ -36,11 +36,11 @@ double iauFaom03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -58,7 +58,7 @@ double iauFaom03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fapa03.c b/20131202/c/src/fapa03.c
similarity index 97%
rename from 20120301_a/c/src/fapa03.c
rename to 20131202/c/src/fapa03.c
index d8d9b5c..d46b029 100644
--- a/20120301_a/c/src/fapa03.c
+++ b/20131202/c/src/fapa03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFapa03(double t)
 /*
@@ -40,11 +40,11 @@ double iauFapa03(double t)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -57,7 +57,7 @@ double iauFapa03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fasa03.c b/20131202/c/src/fasa03.c
similarity index 97%
rename from 20120301_a/c/src/fasa03.c
rename to 20131202/c/src/fasa03.c
index 5ee3097..f55248d 100644
--- a/20120301_a/c/src/fasa03.c
+++ b/20131202/c/src/fasa03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFasa03(double t)
 /*
@@ -39,11 +39,11 @@ double iauFasa03(double t)
 **     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
 **     Astron.Astrophys.Supp.Ser. 135, 111
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -56,7 +56,7 @@ double iauFasa03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/faur03.c b/20131202/c/src/faur03.c
similarity index 97%
rename from 20120301_a/c/src/faur03.c
rename to 20131202/c/src/faur03.c
index 821bf56..c6ded04 100644
--- a/20120301_a/c/src/faur03.c
+++ b/20131202/c/src/faur03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFaur03(double t)
 /*
@@ -36,11 +36,11 @@ double iauFaur03(double t)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J. 1994, Astron.Astrophys. 282, 663-683
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -53,7 +53,7 @@ double iauFaur03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fave03.c b/20131202/c/src/fave03.c
similarity index 97%
rename from 20120301_a/c/src/fave03.c
rename to 20131202/c/src/fave03.c
index 6cf1003..83c66e0 100644
--- a/20120301_a/c/src/fave03.c
+++ b/20131202/c/src/fave03.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauFave03(double t)
 /*
@@ -39,11 +39,11 @@ double iauFave03(double t)
 **     Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M. 1999,
 **     Astron.Astrophys.Supp.Ser. 135, 111
 **
-**  This revision:  2009 December 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double a;
@@ -56,7 +56,7 @@ double iauFave03(double t)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fk52h.c b/20131202/c/src/fk52h.c
similarity index 97%
rename from 20120301_a/c/src/fk52h.c
rename to 20131202/c/src/fk52h.c
index 7b34315..ba80225 100644
--- a/20120301_a/c/src/fk52h.c
+++ b/20131202/c/src/fk52h.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauFk52h(double r5, double d5,
               double dr5, double dd5, double px5, double rv5,
@@ -58,11 +58,11 @@ void iauFk52h(double r5, double d5,
 **
 **     F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int i;
@@ -97,7 +97,7 @@ void iauFk52h(double r5, double d5,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fk5hip.c b/20131202/c/src/fk5hip.c
similarity index 97%
rename from 20120301_a/c/src/fk5hip.c
rename to 20131202/c/src/fk5hip.c
index d96b732..cc524db 100644
--- a/20120301_a/c/src/fk5hip.c
+++ b/20131202/c/src/fk5hip.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauFk5hip(double r5h[3][3], double s5h[3])
 /*
@@ -41,11 +41,11 @@ void iauFk5hip(double r5h[3][3], double s5h[3])
 **
 **     F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
 **
-**  This revision:  2009 March 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double v[3];
@@ -80,7 +80,7 @@ void iauFk5hip(double r5h[3][3], double s5h[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fk5hz.c b/20131202/c/src/fk5hz.c
similarity index 97%
rename from 20120301_a/c/src/fk5hz.c
rename to 20131202/c/src/fk5hz.c
index 45f96a4..f92d92a 100644
--- a/20120301_a/c/src/fk5hz.c
+++ b/20131202/c/src/fk5hz.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauFk5hz(double r5, double d5, double date1, double date2,
               double *rh, double *dh)
@@ -74,11 +74,11 @@ void iauFk5hz(double r5, double d5, double date1, double date2,
 **
 **     F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, p5e[3], r5h[3][3], s5h[3], vst[3], rst[3][3], p5[3],
@@ -114,7 +114,7 @@ void iauFk5hz(double r5, double d5, double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fw2m.c b/20131202/c/src/fw2m.c
similarity index 97%
rename from 20120301_a/c/src/fw2m.c
rename to 20131202/c/src/fw2m.c
index caef4bc..a0a989a 100644
--- a/20120301_a/c/src/fw2m.c
+++ b/20131202/c/src/fw2m.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauFw2m(double gamb, double phib, double psi, double eps,
              double r[3][3])
@@ -70,11 +70,11 @@ void iauFw2m(double gamb, double phib, double psi, double eps,
 **
 **     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Construct the matrix. */
@@ -88,7 +88,7 @@ void iauFw2m(double gamb, double phib, double psi, double eps,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/fw2xy.c b/20131202/c/src/fw2xy.c
similarity index 94%
rename from 20120301_a/c/src/fw2xy.c
rename to 20131202/c/src/fw2xy.c
index caaf49c..5310566 100644
--- a/20120301_a/c/src/fw2xy.c
+++ b/20131202/c/src/fw2xy.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauFw2xy(double gamb, double phib, double psi, double eps,
               double *x, double *y)
@@ -21,7 +21,7 @@ void iauFw2xy(double gamb, double phib, double psi, double eps,
 **     eps      double    F-W angle epsilon (radians)
 **
 **  Returned:
-**     x,y      double    CIP X,Y ("radians")
+**     x,y      double    CIP unit vector X,Y
 **
 **  Notes:
 **
@@ -44,7 +44,8 @@ void iauFw2xy(double gamb, double phib, double psi, double eps,
 **
 **        NxPxB = R_1(-epsA).R_3(-psi).R_1(phib).R_3(gamb)
 **
-**     X,Y are elements (3,1) and (3,2) of the matrix.
+**     The returned values x,y are elements [2][0] and [2][1] of the
+**     matrix.  Near J2000.0, they are essentially angles in radians.
 **
 **  Called:
 **     iauFw2m      F-W angles to r-matrix
@@ -54,11 +55,11 @@ void iauFw2xy(double gamb, double phib, double psi, double eps,
 **
 **     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 September 2
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r[3][3];
@@ -74,7 +75,7 @@ void iauFw2xy(double gamb, double phib, double psi, double eps,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gc2gd.c b/20131202/c/src/gc2gd.c
similarity index 95%
rename from 20120301_a/c/src/gc2gd.c
rename to 20131202/c/src/gc2gd.c
index e4f5c38..f5510e0 100644
--- a/20120301_a/c/src/gc2gd.c
+++ b/20131202/c/src/gc2gd.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauGc2gd ( int n, double xyz[3],
                double *elong, double *phi, double *height )
@@ -20,7 +20,7 @@ int iauGc2gd ( int n, double xyz[3],
 **     xyz     double[3]  geocentric vector (Note 2)
 **
 **  Returned:
-**     elong   double     longitude (radians, east +ve)
+**     elong   double     longitude (radians, east +ve, Note 3)
 **     phi     double     latitude (geodetic, radians, Note 3)
 **     height  double     height above ellipsoid (geodetic, Notes 2,3)
 **
@@ -48,7 +48,7 @@ int iauGc2gd ( int n, double xyz[3],
 **
 **  3) An error status -1 means that the identifier n is illegal.  An
 **     error status -2 is theoretically impossible.  In all error cases,
-**     phi and height are both set to -1e9.
+**     all three results are set to -1e9.
 **
 **  4) The inverse transformation is performed in the function iauGd2gc.
 **
@@ -56,11 +56,11 @@ int iauGc2gd ( int n, double xyz[3],
 **     iauEform     Earth reference ellipsoids
 **     iauGc2gde    geocentric to geodetic transformation, general
 **
-**  This revision:  2012 Febuary 23
+**  This revision:  2013 September 1
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int j;
@@ -78,6 +78,7 @@ int iauGc2gd ( int n, double xyz[3],
 
 /* Deal with any errors. */
    if ( j < 0 ) {
+      *elong = -1e9;
       *phi = -1e9;
       *height = -1e9;
    }
@@ -87,7 +88,7 @@ int iauGc2gd ( int n, double xyz[3],
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gc2gde.c b/20131202/c/src/gc2gde.c
similarity index 98%
rename from 20120301_a/c/src/gc2gde.c
rename to 20131202/c/src/gc2gde.c
index 359ef76..cfd248f 100644
--- a/20120301_a/c/src/gc2gde.c
+++ b/20131202/c/src/gc2gde.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauGc2gde ( double a, double f, double xyz[3],
                 double *elong, double *phi, double *height )
@@ -61,11 +61,11 @@ int iauGc2gde ( double a, double f, double xyz[3],
 **     coordinates accelerated by Halley's method", J.Geodesy (2006)
 **     79: 689-693
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double aeps2, e2, e4t, ec2, ec, b, x, y, z, p2, absz, p, s0, pn, zc,
@@ -153,7 +153,7 @@ int iauGc2gde ( double a, double f, double xyz[3],
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gd2gc.c b/20131202/c/src/gd2gc.c
similarity index 97%
rename from 20120301_a/c/src/gd2gc.c
rename to 20131202/c/src/gd2gc.c
index 5483059..6479641 100644
--- a/20120301_a/c/src/gd2gc.c
+++ b/20131202/c/src/gd2gc.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauGd2gc ( int n, double elong, double phi, double height,
                double xyz[3] )
@@ -59,11 +59,11 @@ int iauGd2gc ( int n, double elong, double phi, double height,
 **     iauGd2gce    geodetic to geocentric transformation, general
 **     iauZp        zero p-vector
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int j;
@@ -87,7 +87,7 @@ int iauGd2gc ( int n, double elong, double phi, double height,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gd2gce.c b/20131202/c/src/gd2gce.c
similarity index 97%
copy from 20120301_a/c/src/gd2gce.c
copy to 20131202/c/src/gd2gce.c
index a745d3c..45432bc 100644
--- a/20120301_a/c/src/gd2gce.c
+++ b/20131202/c/src/gd2gce.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauGd2gce ( double a, double f, double elong, double phi,
                 double height, double xyz[3] )
@@ -60,11 +60,11 @@ int iauGd2gce ( double a, double f, double elong, double phi,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 4.22, p202.
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double sp, cp, w, d, ac, as, r;
@@ -91,7 +91,7 @@ int iauGd2gce ( double a, double f, double elong, double phi,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gmst00.c b/20131202/c/src/gmst00.c
similarity index 97%
rename from 20120301_a/c/src/gmst00.c
rename to 20131202/c/src/gmst00.c
index 23ae265..fe2f53f 100644
--- a/20120301_a/c/src/gmst00.c
+++ b/20131202/c/src/gmst00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGmst00(double uta, double utb, double tta, double ttb)
 /*
@@ -73,11 +73,11 @@ double iauGmst00(double uta, double utb, double tta, double ttb)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 March 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, gmst;
@@ -99,7 +99,7 @@ double iauGmst00(double uta, double utb, double tta, double ttb)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gmst06.c b/20131202/c/src/gmst06.c
similarity index 97%
rename from 20120301_a/c/src/gmst06.c
rename to 20131202/c/src/gmst06.c
index 619569f..739b5af 100644
--- a/20120301_a/c/src/gmst06.c
+++ b/20131202/c/src/gmst06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGmst06(double uta, double utb, double tta, double ttb)
 /*
@@ -63,11 +63,11 @@ double iauGmst06(double uta, double utb, double tta, double ttb)
 **     Capitaine, N., Wallace, P.T. & Chapront, J., 2005,
 **     Astron.Astrophys. 432, 355
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, gmst;
@@ -90,7 +90,7 @@ double iauGmst06(double uta, double utb, double tta, double ttb)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gmst82.c b/20131202/c/src/gmst82.c
similarity index 95%
rename from 20120301_a/c/src/gmst82.c
rename to 20131202/c/src/gmst82.c
index cd7e4e1..941544c 100644
--- a/20120301_a/c/src/gmst82.c
+++ b/20131202/c/src/gmst82.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGmst82(double dj1, double dj2)
 /*
@@ -28,10 +28,10 @@ double iauGmst82(double dj1, double dj2)
 **
 **             dj1            dj2
 **
-**         2450123.7D0        0D0        (JD method)
-**          2451545D0      -1421.3D0     (J2000 method)
-**         2400000.5D0     50123.2D0     (MJD method)
-**         2450123.5D0       0.2D0       (date & time method)
+**         2450123.7          0          (JD method)
+**          2451545        -1421.3       (J2000 method)
+**         2400000.5       50123.2       (MJD method)
+**         2450123.5         0.2         (date & time method)
 **
 **     The JD method is the most natural and convenient to use in
 **     cases where the loss of several decimal digits of resolution
@@ -65,11 +65,11 @@ double iauGmst82(double dj1, double dj2)
 **
 **     Aoki et al., Astron. Astrophys. 105, 359-361 (1982).
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Coefficients of IAU 1982 GMST-UT1 model */
@@ -105,7 +105,7 @@ double iauGmst82(double dj1, double dj2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gst00a.c b/20131202/c/src/gst00a.c
similarity index 97%
rename from 20120301_a/c/src/gst00a.c
rename to 20131202/c/src/gst00a.c
index 6f50c14..09b1ce0 100644
--- a/20120301_a/c/src/gst00a.c
+++ b/20131202/c/src/gst00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGst00a(double uta, double utb, double tta, double ttb)
 /*
@@ -74,11 +74,11 @@ double iauGst00a(double uta, double utb, double tta, double ttb)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gmst00, ee00a, gst;
@@ -92,7 +92,7 @@ double iauGst00a(double uta, double utb, double tta, double ttb)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gst00b.c b/20131202/c/src/gst00b.c
similarity index 97%
rename from 20120301_a/c/src/gst00b.c
rename to 20131202/c/src/gst00b.c
index 66b8e3d..11bcda1 100644
--- a/20120301_a/c/src/gst00b.c
+++ b/20131202/c/src/gst00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGst00b(double uta, double utb)
 /*
@@ -82,11 +82,11 @@ double iauGst00b(double uta, double utb)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gmst00, ee00b, gst;
@@ -100,7 +100,7 @@ double iauGst00b(double uta, double utb)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gst06.c b/20131202/c/src/gst06.c
similarity index 97%
rename from 20120301_a/c/src/gst06.c
rename to 20131202/c/src/gst06.c
index 3c35e74..967617b 100644
--- a/20120301_a/c/src/gst06.c
+++ b/20131202/c/src/gst06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGst06(double uta, double utb, double tta, double ttb,
                 double rnpb[3][3])
@@ -69,11 +69,11 @@ double iauGst06(double uta, double utb, double tta, double ttb,
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, y, s, era, eors, gst;
@@ -94,7 +94,7 @@ double iauGst06(double uta, double utb, double tta, double ttb,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gst06a.c b/20131202/c/src/gst06a.c
similarity index 97%
rename from 20120301_a/c/src/gst06a.c
rename to 20131202/c/src/gst06a.c
index 7b5c542..98c25da 100644
--- a/20120301_a/c/src/gst06a.c
+++ b/20131202/c/src/gst06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauGst06a(double uta, double utb, double tta, double ttb)
 /*
@@ -65,11 +65,11 @@ double iauGst06a(double uta, double utb, double tta, double ttb)
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rnpb[3][3], gst;
@@ -85,7 +85,7 @@ double iauGst06a(double uta, double utb, double tta, double ttb)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gst94.c b/20131202/c/src/gst94.c
similarity index 98%
rename from 20120301_a/c/src/gst94.c
rename to 20131202/c/src/gst94.c
index 652f99f..c9e33c3 100644
--- a/20120301_a/c/src/gst94.c
+++ b/20131202/c/src/gst94.c
@@ -69,9 +69,9 @@ double iauGst94(double uta, double utb)
 **
 **  This revision:  2008 May 16
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gmst82, eqeq94, gst;
@@ -85,7 +85,7 @@ double iauGst94(double uta, double utb)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/h2fk5.c b/20131202/c/src/h2fk5.c
similarity index 97%
rename from 20120301_a/c/src/h2fk5.c
rename to 20131202/c/src/h2fk5.c
index 4cfc04a..f4b9799 100644
--- a/20120301_a/c/src/h2fk5.c
+++ b/20131202/c/src/h2fk5.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauH2fk5(double rh, double dh,
               double drh, double ddh, double pxh, double rvh,
@@ -60,11 +60,11 @@ void iauH2fk5(double rh, double dh,
 **
 **     F.Mignard & M.Froeschle, Astron. Astrophys. 354, 732-739 (2000).
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int i;
@@ -102,7 +102,7 @@ void iauH2fk5(double rh, double dh,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/hfk5z.c b/20131202/c/src/hfk5z.c
similarity index 98%
rename from 20120301_a/c/src/hfk5z.c
rename to 20131202/c/src/hfk5z.c
index 5104771..cc7c710 100644
--- a/20120301_a/c/src/hfk5z.c
+++ b/20131202/c/src/hfk5z.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauHfk5z(double rh, double dh, double date1, double date2,
               double *r5, double *d5, double *dr5, double *dd5)
@@ -79,11 +79,11 @@ void iauHfk5z(double rh, double dh, double date1, double date2,
 **
 **     F.Mignard & M.Froeschle, 2000, Astron.Astrophys. 354, 732-739.
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, ph[3], r5h[3][3], s5h[3], sh[3], vst[3],
@@ -129,7 +129,7 @@ void iauHfk5z(double rh, double dh, double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ir.c b/20131202/c/src/ir.c
similarity index 96%
rename from 20120301_a/c/src/ir.c
rename to 20131202/c/src/ir.c
index f34008e..48efa37 100644
--- a/20120301_a/c/src/ir.c
+++ b/20131202/c/src/ir.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauIr(double r[3][3])
 /*
@@ -16,11 +16,11 @@ void iauIr(double r[3][3])
 **  Returned:
 **     r       double[3][3]    r-matrix
 **
-**  This revision:  2012 April 3
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    r[0][0] = 1.0;
@@ -37,7 +37,7 @@ void iauIr(double r[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/jd2cal.c b/20131202/c/src/jd2cal.c
similarity index 95%
rename from 20120301_a/c/src/jd2cal.c
rename to 20131202/c/src/jd2cal.c
index 0b788ec..d1f30be 100644
--- a/20120301_a/c/src/jd2cal.c
+++ b/20131202/c/src/jd2cal.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauJd2cal(double dj1, double dj2,
               int *iy, int *im, int *id, double *fd)
@@ -31,7 +31,7 @@ int iauJd2cal(double dj1, double dj2,
 **  Notes:
 **
 **  1) The earliest valid date is -68569.5 (-4900 March 1).  The
-**     largest value accepted is 10^9.
+**     largest value accepted is 1e9.
 **
 **  2) The Julian Date is apportioned in any convenient way between
 **     the arguments dj1 and dj2.  For example, JD=2450123.7 could
@@ -55,16 +55,16 @@ int iauJd2cal(double dj1, double dj2,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 12.92 (p604).
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Minimum and maximum allowed JD */
-   static const double djmin = -68569.5;
-   static const double djmax = 1e9;
+   const double DJMIN = -68569.5;
+   const double DJMAX = 1e9;
 
    long jd, l, n, i, k;
    double dj, d1, d2, f1, f2, f, d;
@@ -72,7 +72,7 @@ int iauJd2cal(double dj1, double dj2,
 
 /* Verify date is acceptable. */
    dj = dj1 + dj2;
-   if (dj < djmin || dj > djmax) return -1;
+   if (dj < DJMIN || dj > DJMAX) return -1;
 
 /* Copy the date, big then small, and re-align to midnight. */
    if (dj1 >= dj2) {
@@ -109,7 +109,7 @@ int iauJd2cal(double dj1, double dj2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/jdcalf.c b/20131202/c/src/jdcalf.c
similarity index 97%
rename from 20120301_a/c/src/jdcalf.c
rename to 20131202/c/src/jdcalf.c
index 1a64ae7..9d942a9 100644
--- a/20120301_a/c/src/jdcalf.c
+++ b/20131202/c/src/jdcalf.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4])
 /*
@@ -60,11 +60,11 @@ int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4])
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 12.92 (p604).
 **
-**  This revision:  2010 July 27
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int j, js;
@@ -115,7 +115,7 @@ int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/gd2gce.c b/20131202/c/src/ld.c
similarity index 59%
rename from 20120301_a/c/src/gd2gce.c
rename to 20131202/c/src/ld.c
index a745d3c..3205f00 100644
--- a/20120301_a/c/src/gd2gce.c
+++ b/20131202/c/src/ld.c
@@ -1,14 +1,14 @@
-#include "sofam.h"
+#include "sofa.h"
 
-int iauGd2gce ( double a, double f, double elong, double phi,
-                double height, double xyz[3] )
+void iauLd(double bm, double p[3], double q[3], double e[3],
+           double em, double dlim, double p1[3])
 /*
-**  - - - - - - - - - -
-**   i a u G d 2 g c e
-**  - - - - - - - - - -
+**  - - - - - -
+**   i a u L d
+**  - - - - - -
 **
-**  Transform geodetic coordinates to geocentric for a reference
-**  ellipsoid of specified form.
+**  Apply light deflection by a solar-system body, as part of
+**  transforming coordinate direction into natural direction.
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards of Fundamental Astronomy) software collection.
@@ -16,82 +16,97 @@ int iauGd2gce ( double a, double f, double elong, double phi,
 **  Status:  support function.
 **
 **  Given:
-**     a       double     equatorial radius (Notes 1,4)
-**     f       double     flattening (Notes 2,4)
-**     elong   double     longitude (radians, east +ve)
-**     phi     double     latitude (geodetic, radians, Note 4)
-**     height  double     height above ellipsoid (geodetic, Notes 3,4)
+**     bm     double     mass of the gravitating body (solar masses)
+**     p      double[3]  direction from observer to source (unit vector)
+**     q      double[3]  direction from body to source (unit vector)
+**     e      double[3]  direction from body to observer (unit vector)
+**     em     double     distance from body to observer (au)
+**     dlim   double     deflection limiter (Note 4)
 **
 **  Returned:
-**     xyz     double[3]  geocentric vector (Note 3)
+**     p1     double[3]  observer to deflected source (unit vector)
 **
-**  Returned (function value):
-**             int        status:  0 = OK
-**                                -1 = illegal case (Note 4)
 **  Notes:
 **
-**  1) The equatorial radius, a, can be in any units, but meters is
-**     the conventional choice.
+**  1) The algorithm is based on Expr. (70) in Klioner (2003) and
+**     Expr. (7.63) in the Explanatory Supplement (Urban & Seidelmann
+**     2013), with some rearrangement to minimize the effects of machine
+**     precision.
 **
-**  2) The flattening, f, is (for the Earth) a value around 0.00335,
-**     i.e. around 1/298.
+**  2) The mass parameter bm can, as required, be adjusted in order to
+**     allow for such effects as quadrupole field.
 **
-**  3) The equatorial radius, a, and the height, height, must be
-**     given in the same units, and determine the units of the
-**     returned geocentric vector, xyz.
+**  3) The barycentric position of the deflecting body should ideally
+**     correspond to the time of closest approach of the light ray to
+**     the body.
 **
-**  4) No validation is performed on individual arguments.  The error
-**     status -1 protects against (unrealistic) cases that would lead
-**     to arithmetic exceptions.  If an error occurs, xyz is unchanged.
+**  4) The deflection limiter parameter dlim is phi^2/2, where phi is
+**     the angular separation (in radians) between source and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.
 **
-**  5) The inverse transformation is performed in the function
-**     iauGc2gde.
+**  5) The returned vector p1 is not normalized, but the consequential
+**     departure from unit magnitude is always negligible.
 **
-**  6) The transformation for a standard ellipsoid (such as WGS84) can
-**     more conveniently be performed by calling iauGd2gc,  which uses a
-**     numerical code to identify the required a and f values.
+**  6) The arguments p and p1 can be the same array.
+**
+**  7) To accumulate total light deflection taking into account the
+**     contributions from several bodies, call the present function for
+**     each body in succession, in decreasing order of distance from the
+**     observer.
+**
+**  8) For efficiency, validation is omitted.  The supplied vectors must
+**     be of unit magnitude, and the deflection limiter non-zero and
+**     positive.
 **
 **  References:
 **
-**     Green, R.M., Spherical Astronomy, Cambridge University Press,
-**     (1985) Section 4.5, p96.
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013).
+**
+**     Klioner, Sergei A., "A practical relativistic model for micro-
+**     arcsecond astrometry in space", Astr. J. 125, 1580-1597 (2003).
 **
-**     Explanatory Supplement to the Astronomical Almanac,
-**     P. Kenneth Seidelmann (ed), University Science Books (1992),
-**     Section 4.22, p202.
+**  Called:
+**     iauPdp       scalar product of two p-vectors
+**     iauPxp       vector product of two p-vectors
 **
-**  This revision:  2012 February 23
+**  This revision:   2013 October 9
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double sp, cp, w, d, ac, as, r;
+   int i;
+   double qpe[3], qdqpe, w, eq[3], peq[3];
+
+
+/* q . (q + e). */
+   for (i = 0; i < 3; i++) {
+      qpe[i] = q[i] + e[i];
+   }
+   qdqpe = iauPdp(q, qpe);
 
+/* 2 x G x bm / ( em x c^2 x ( q . (q + e) ) ). */
+   w = bm * SRS / em / gmax(qdqpe,dlim);
 
-/* Functions of geodetic latitude. */
-   sp = sin(phi);
-   cp = cos(phi);
-   w = 1.0 - f;
-   w = w * w;
-   d = cp*cp + w*sp*sp;
-   if ( d <= 0.0 ) return -1;
-   ac = a / sqrt(d);
-   as = w * ac;
+/* p x (e x q). */
+   iauPxp(e, q, eq);
+   iauPxp(p, eq, peq);
 
-/* Geocentric vector. */
-   r = (ac + height) * cp;
-   xyz[0] = r * cos(elong);
-   xyz[1] = r * sin(elong);
-   xyz[2] = (as + height) * sp;
+/* Apply the deflection. */
+   for (i = 0; i < 3; i++) {
+      p1[i] = p[i] + w*peq[i];
+   }
 
-/* Success. */
-   return 0;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pap.c b/20131202/c/src/ldn.c
similarity index 52%
copy from 20120301_a/c/src/pap.c
copy to 20131202/c/src/ldn.c
index aca9e96..d6d9751 100644
--- a/20120301_a/c/src/pap.c
+++ b/20131202/c/src/ldn.c
@@ -1,99 +1,134 @@
-#include "sofam.h"
+#include "sofa.h"
 
-double iauPap(double a[3], double b[3])
-/*
+void iauLdn(int n, iauLDBODY b[], double ob[3], double sc[3],
+            double sn[3])
+/*+
 **  - - - - - - -
-**   i a u P a p
+**   i a u L d n
 **  - - - - - - -
 **
-**  Position-angle from two p-vectors.
+**  For a star, apply light deflection by multiple solar-system bodies,
+**  as part of transforming coordinate direction into natural direction.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  vector/matrix support function.
+**  Status:  support function.
 **
 **  Given:
-**     a      double[3]  direction of reference point
-**     b      double[3]  direction of point whose PA is required
+**     n    int           number of bodies (note 1)
+**     b    iauLDBODY[n]  data for each of the n bodies (Notes 1,2):
+**      bm   double         mass of the body (solar masses, Note 3)
+**      dl   double         deflection limiter (Note 4)
+**      pv   [2][3]         barycentric PV of the body (au, au/day)
+**     ob   double[3]     barycentric position of the observer (au)
+**     sc   double[3]     observer to star coord direction (unit vector)
 **
-**  Returned (function value):
-**            double     position angle of b with respect to a (radians)
+**  Returned:
+**     sn    double[3]      observer to deflected star (unit vector)
 **
-**  Notes:
+**  1) The array b contains n entries, one for each body to be
+**     considered.  If n = 0, no gravitational light deflection will be
+**     applied, not even for the Sun.
 **
-**  1) The result is the position angle, in radians, of direction b with
-**     respect to direction a.  It is in the range -pi to +pi.  The
-**     sense is such that if b is a small distance "north" of a the
-**     position angle is approximately zero, and if b is a small
-**     distance "east" of a the position angle is approximately +pi/2.
+**  2) The array b should include an entry for the Sun as well as for
+**     any planet or other body to be taken into account.  The entries
+**     should be in the order in which the light passes the body.
 **
-**  2) The vectors a and b need not be of unit length.
+**  3) In the entry in the b array for body i, the mass parameter
+**     b[i].bm can, as required, be adjusted in order to allow for such
+**     effects as quadrupole field.
 **
-**  3) Zero is returned if the two directions are the same or if either
-**     vector is null.
+**  4) The deflection limiter parameter b[i].dl is phi^2/2, where phi is
+**     the angular separation (in radians) between star and body at
+**     which limiting is applied.  As phi shrinks below the chosen
+**     threshold, the deflection is artificially reduced, reaching zero
+**     for phi = 0.   Example values suitable for a terrestrial
+**     observer, together with masses, are as follows:
 **
-**  4) If vector a is at a pole, the result is ill-defined.
+**        body i     b[i].bm        b[i].dl
+**
+**        Sun        1.0            6e-6
+**        Jupiter    0.00095435     3e-9
+**        Saturn     0.00028574     3e-10
+**
+**  5) For cases where the starlight passes the body before reaching the
+**     observer, the body is placed back along its barycentric track by
+**     the light time from that point to the observer.  For cases where
+**     the body is "behind" the observer no such shift is applied.  If
+**     a different treatment is preferred, the user has the option of
+**     instead using the iauLd function.  Similarly, iauLd can be used
+**     for cases where the source is nearby, not a star.
+**
+**  6) The returned vector sn is not normalized, but the consequential
+**     departure from unit magnitude is always negligible.
+**
+**  7) The arguments sc and sn can be the same array.
+**
+**  8) For efficiency, validation is omitted.  The supplied masses must
+**     be greater than zero, the position and velocity vectors must be
+**     right, and the deflection limiter greater than zero.
+**
+**  Reference:
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013), Section 7.2.4.
 **
 **  Called:
-**     iauPn        decompose p-vector into modulus and direction
-**     iauPm        modulus of p-vector
-**     iauPxp       vector product of two p-vectors
-**     iauPmp       p-vector minus p-vector
+**     iauCp        copy p-vector
 **     iauPdp       scalar product of two p-vectors
+**     iauPmp       p-vector minus p-vector
+**     iauPpsp      p-vector plus scaled p-vector
+**     iauPn        decompose p-vector into modulus and direction
+**     iauLd        light deflection by a solar-system body
 **
-**  This revision:  2008 May 25
+**  This revision:   2013 October 9
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double am, au[3], bm, st, ct, xa, ya, za, eta[3], xi[3], a2b[3], pa;
+/* Light time for 1 AU (days) */
+   const double CR = AULT/DAYSEC;
 
+   int i;
+   double  v[3], dt, ev[3], em, e[3];
 
-/* Modulus and direction of the a vector. */
-   iauPn(a, &am, au);
 
-/* Modulus of the b vector. */
-   bm = iauPm(b);
+/* Star direction prior to deflection. */
+   iauCp(sc, sn);
 
-/* Deal with the case of a null vector. */
-   if ((am == 0.0) || (bm == 0.0)) {
-      st = 0.0;
-      ct = 1.0;
-   } else {
+/* Body by body. */
+   for ( i = 0; i < n; i++ ) {
 
-   /* The "north" axis tangential from a (arbitrary length). */
-      xa = a[0];
-      ya = a[1];
-      za = a[2];
-      eta[0] = -xa * za;
-      eta[1] = -ya * za;
-      eta[2] =  xa*xa + ya*ya;
+   /* Body to observer vector at epoch of observation (au). */
+      iauPmp ( ob, b[i].pv[0], v );
 
-   /* The "east" axis tangential from a (same length). */
-      iauPxp(eta, au, xi);
+   /* Minus the time since the light passed the body (days). */
+      dt = iauPdp(sn,v) * CR;
 
-   /* The vector from a to b. */
-      iauPmp(b, a, a2b);
+   /* Neutralize if the star is "behind" the observer. */
+      dt = gmin(dt, 0.0);
 
-   /* Resolve into components along the north and east axes. */
-      st = iauPdp(a2b, xi);
-      ct = iauPdp(a2b, eta);
+   /* Backtrack the body to the time the light was passing the body. */
+      iauPpsp(v, -dt, b[i].pv[1], ev);
 
-   /* Deal with degenerate cases. */
-      if ((st == 0.0) && (ct == 0.0)) ct = 1.0;
-   }
+   /* Body to observer vector as magnitude and direction. */
+      iauPn(ev, &em, e);
 
-/* Position angle. */
-   pa = atan2(st, ct);
+   /* Apply light deflection for this body. */
+      iauLd ( b[i].bm, sn, sn, e, em, b[i].dl, sn );
 
-   return pa;
+   /* Next body. */
+   }
+
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -186,4 +221,5 @@ double iauPap(double a[3], double b[3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/pvdpv.c b/20131202/c/src/ldsun.c
similarity index 78%
copy from 20120301_a/c/src/pvdpv.c
copy to 20131202/c/src/ldsun.c
index dbe0b2e..ec6f137 100644
--- a/20120301_a/c/src/pvdpv.c
+++ b/20131202/c/src/ldsun.c
@@ -1,62 +1,56 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPvdpv(double a[2][3], double b[2][3], double adb[2])
+void iauLdsun(double p[3], double e[3], double em, double p1[3])
 /*
 **  - - - - - - - - -
-**   i a u P v d p v
+**   i a u L d s u n
 **  - - - - - - - - -
 **
-**  Inner (=scalar=dot) product of two pv-vectors.
+**  Light deflection by the Sun.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  vector/matrix support function.
+**  Status:  support function.
 **
 **  Given:
-**     a        double[2][3]      first pv-vector
-**     b        double[2][3]      second pv-vector
+**     p      double[3]  direction from observer to source (unit vector)
+**     e      double[3]  direction from Sun to observer (unit vector)
+**     em     double     distance from Sun to observer (au)
 **
 **  Returned:
-**     adb      double[2]         a . b (see note)
+**     p1     double[3]  observer to deflected source (unit vector)
 **
-**  Note:
+**  Notes:
 **
-**     If the position and velocity components of the two pv-vectors are
-**     ( ap, av ) and ( bp, bv ), the result, a . b, is the pair of
-**     numbers ( ap . bp , ap . bv + av . bp ).  The two numbers are the
-**     dot-product of the two p-vectors and its derivative.
+**  1) The source is presumed to be sufficiently distant that its
+**     directions seen from the Sun and the observer are essentially
+**     the same.
+**
+**  2) The deflection is restrained when the angle between the star and
+**     the center of the Sun is less than about 9 arcsec, falling to
+**     zero for zero separation. (The chosen threshold is within the
+**     solar limb for all solar-system applications.)
+**
+**  3) The arguments p and p1 can be the same array.
 **
 **  Called:
-**     iauPdp       scalar product of two p-vectors
+**     iauLd        light deflection by a solar-system body
 **
-**  This revision:  2008 May 22
+**  This revision:   2013 August 30
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double adbd, addb;
-
-
-/* a . b = constant part of result. */
-   adb[0] = iauPdp(a[0], b[0]);
+   iauLd(1.0, p, p, e, em, 1e-9, p1);
 
-/* a . bdot */
-   adbd = iauPdp(a[0], b[1]);
-
-/* adot . b */
-   addb = iauPdp(a[1], b[0]);
-
-/* Velocity part of result. */
-   adb[1] = adbd + addb;
-
-   return;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -149,4 +143,5 @@ void iauPvdpv(double a[2][3], double b[2][3], double adb[2])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/makefile b/20131202/c/src/makefile
similarity index 85%
rename from 20120301_a/c/src/makefile
rename to 20131202/c/src/makefile
index f0d9ef7..48b4596 100644
--- a/20120301_a/c/src/makefile
+++ b/20131202/c/src/makefile
@@ -27,13 +27,13 @@
 #
 #    Also:
 #      make all           same as make
-#      make deinstall     deinstall the library
+#      make uninstall     deinstall the library and header files
 #      make check         test the build
 #      make installcheck  same as make test
-#      make distclean     clean up and deinstall
-#      make realclean     same as make clean
+#      make distclean     delete all generated binaries
+#      make realclean     same as distclean
 #
-# Last revision:   2010 September 7
+# Last revision:   2013 September 2
 #
 # Copyright International Astronomical Union.  All rights reserved.
 #
@@ -91,11 +91,38 @@ SOFA_INC_NAMES = sofa.h sofam.h
 SOFA_INC = $(SOFA_INC_DIR)sofa.h $(SOFA_INC_DIR)sofam.h
 
 # The list of SOFA/C library object files.
+
 SOFA_OBS = iauA2af.o \
            iauA2tf.o \
+           iauAb.o \
            iauAf2a.o \
            iauAnp.o \
            iauAnpm.o \
+           iauApcg.o \
+           iauApcg13.o \
+           iauApci.o \
+           iauApci13.o \
+           iauApco.o \
+           iauApco13.o \
+           iauApcs.o \
+           iauApcs13.o \
+           iauAper.o \
+           iauAper13.o \
+           iauApio.o \
+           iauApio13.o \
+           iauAtci13.o \
+           iauAtciq.o \
+           iauAtciqn.o \
+           iauAtciqz.o \
+           iauAtco13.o \
+           iauAtic13.o \
+           iauAticq.o \
+           iauAticqn.o \
+           iauAtio13.o \
+           iauAtioq.o \
+           iauAtoc13.o \
+           iauAtoi13.o \
+           iauAtoiq.o \
            iauBi00.o \
            iauBp00.o \
            iauBp06.o \
@@ -174,6 +201,9 @@ SOFA_OBS = iauA2af.o \
            iauIr.o \
            iauJd2cal.o \
            iauJdcalf.o \
+           iauLd.o \
+           iauLdn.o \
+           iauLdsun.o \
            iauNum00a.o \
            iauNum00b.o \
            iauNum06a.o \
@@ -199,6 +229,8 @@ SOFA_OBS = iauA2af.o \
            iauPmat06.o \
            iauPmat76.o \
            iauPmp.o \
+           iauPmpx.o \
+           iauPmsafe.o \
            iauPn.o \
            iauPn00.o \
            iauPn00a.o \
@@ -221,10 +253,12 @@ SOFA_OBS = iauA2af.o \
            iauPvmpv.o \
            iauPvppv.o \
            iauPvstar.o \
+           iauPvtob.o \
            iauPvu.o \
            iauPvup.o \
            iauPvxpv.o \
            iauPxp.o \
+           iauRefco.o \
            iauRm2v.o \
            iauRv2m.o \
            iauRx.o \
@@ -296,30 +330,28 @@ install $(SOFA_LIB) : $(INSTALL_DIRS) $(SOFA_LIB_NAME) $(SOFA_INC)
 	cp $(SOFA_LIB_NAME) $(SOFA_LIB_DIR)
 
 # Deinstall the library and header files.
-deinstall:
-	rm -f $(SOFA_LIB) $(SOFA_INC)
+uninstall:
+	- $(RM) $(SOFA_LIB) $(SOFA_INC)
 
 # Test the build.
 check: $(SOFA_TEST_NAME) $(SOFA_INC_NAMES) $(SOFA_LIB_NAME)
 	$(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) $(SOFA_LIB_NAME) \
         -lm -o $(SOFA_TEST)
 	./$(SOFA_TEST)
-	rm -f $(SOFA_TEST)
 
 # Test the installed library.
 installcheck test: $(SOFA_TEST_NAME) $(SOFA_INC) $(SOFA_LIB)
 	$(CCOMPC) $(CFLAGX) $(SOFA_TEST_NAME) -I$(SOFA_INC_DIR) \
         -L$(SOFA_LIB_DIR) -lsofa_c -lm -o $(SOFA_TEST)
 	./$(SOFA_TEST)
-	rm -f $(SOFA_TEST)
 
-# Local clean up.
-clean realclean:
-	rm -f $(SOFA_OBS) $(SOFA_LIB_NAME)
+# Delete object files.
+clean :
+	- $(RM) $(SOFA_OBS)
 
-# Clean up and deinstall.
-distclean:
-	rm -f $(SOFA_OBS) $(SOFA_LIB_NAME) $(SOFA_INC) $(SOFA_LIB)
+# Delete all generated binaries in the current directory.
+realclean distclean : clean
+	- $(RM) $(SOFA_LIB_NAME) $(SOFA_TEST)
 
 # Create the installation directories if not already present.
 $(INSTALL_DIRS):
@@ -341,12 +373,64 @@ iauA2af.o   : a2af.c   sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ a2af.c
 iauA2tf.o   : a2tf.c   sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ a2tf.c
+iauAb.o     : ab.c     sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ ab.c
 iauAf2a.o   : af2a.c   sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ af2a.c
 iauAnp.o    : anp.c    sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ anp.c
 iauAnpm.o   : anpm.c   sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ anpm.c
+iauApcg.o   : apcg.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apcg.c
+iauApcg13.o : apcg13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apcg13.c
+iauApci.o   : apci.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apci.c
+iauApci13.o : apci13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apci13.c
+iauApco.o   : apco.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apco.c
+iauApco13.o : apco13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apco13.c
+iauApcs.o   : apcs.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apcs.c
+iauApcs13.o : apcs13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apcs13.c
+iauAper.o   : aper.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ aper.c
+iauAper13.o : aper13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ aper13.c
+iauApio.o   : apio.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apio.c
+iauApio13.o : apio13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ apio13.c
+iauAtci13.o : atci13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atci13.c
+iauAtciq.o  : atciq.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atciq.c
+iauAtciqn.o : atciqn.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atciqn.c
+iauAtciqz.o : atciqz.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atciqz.c
+iauAtco13.o : atco13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atco13.c
+iauAtic13.o : atic13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atic13.c
+iauAticq.o  : aticq.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ aticq.c
+iauAticqn.o : aticqn.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ aticqn.c
+iauAtio13.o : atio13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atio13.c
+iauAtioq.o  : atioq.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atioq.c
+iauAtoc13.o : atoc13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atoc13.c
+iauAtoi13.o : atoi13.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atoi13.c
+iauAtoiq.o  : atoiq.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ atoiq.c
 iauBi00.o   : bi00.c   sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ bi00.c
 iauBp00.o   : bp00.c   sofa.h sofam.h
@@ -503,6 +587,12 @@ iauJd2cal.o : jd2cal.c sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ jd2cal.c
 iauJdcalf.o : jdcalf.c sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ jdcalf.c
+iauLd.o     : ld.c     sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ ld.c
+iauLdn.o    : ldn.c    sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ ldn.c
+iauLdsun.o  : ldsun.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ ldsun.c
 iauNum00a.o : num00a.c sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ num00a.c
 iauNum00b.o : num00b.c sofa.h sofam.h
@@ -553,6 +643,10 @@ iauPmat76.o : pmat76.c sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pmat76.c
 iauPmp.o    : pmp.c    sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pmp.c
+iauPmpx.o   : pmpx.c   sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ pmpx.c
+iauPmsafe.o : pmsafe.c sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ pmsafe.c
 iauPn.o     : pn.c     sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pn.c
 iauPn00.o   : pn00.c   sofa.h sofam.h
@@ -597,6 +691,8 @@ iauPvppv.o  : pvppv.c  sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pvppv.c
 iauPvstar.o : pvstar.c sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pvstar.c
+iauPvtob.o  : pvtob.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ pvtob.c
 iauPvu.o    : pvu.c    sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pvu.c
 iauPvup.o   : pvup.c   sofa.h sofam.h
@@ -605,6 +701,8 @@ iauPvxpv.o  : pvxpv.c  sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pvxpv.c
 iauPxp.o    : pxp.c    sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ pxp.c
+iauRefco.o  : refco.c  sofa.h sofam.h
+	$(CCOMPC) $(CFLAGF) -o $@ refco.c
 iauRm2v.o   : rm2v.c   sofa.h sofam.h
 	$(CCOMPC) $(CFLAGF) -o $@ rm2v.c
 iauRv2m.o   : rv2m.c   sofa.h sofam.h
diff --git a/20120301_a/c/src/num00a.c b/20131202/c/src/num00a.c
similarity index 97%
rename from 20120301_a/c/src/num00a.c
rename to 20131202/c/src/num00a.c
index 4d8cba0..ed9ffc3 100644
--- a/20120301_a/c/src/num00a.c
+++ b/20131202/c/src/num00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNum00a(double date1, double date2, double rmatn[3][3])
 /*
@@ -57,11 +57,11 @@ void iauNum00a(double date1, double date2, double rmatn[3][3])
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 3.222-3 (p114).
 **
-**  This revision:  2008 May 12
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rbpn[3][3];
@@ -75,7 +75,7 @@ void iauNum00a(double date1, double date2, double rmatn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/num00b.c b/20131202/c/src/num00b.c
similarity index 97%
rename from 20120301_a/c/src/num00b.c
rename to 20131202/c/src/num00b.c
index 38f4bcb..cbae034 100644
--- a/20120301_a/c/src/num00b.c
+++ b/20131202/c/src/num00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNum00b(double date1, double date2, double rmatn[3][3])
 /*
@@ -57,11 +57,11 @@ void iauNum00b(double date1, double date2, double rmatn[3][3])
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 3.222-3 (p114).
 **
-**  This revision:  2008 May 12
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rbpn[3][3];
@@ -75,7 +75,7 @@ void iauNum00b(double date1, double date2, double rmatn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/num06a.c b/20131202/c/src/num06a.c
similarity index 97%
rename from 20120301_a/c/src/num06a.c
rename to 20131202/c/src/num06a.c
index c903f30..8570350 100644
--- a/20120301_a/c/src/num06a.c
+++ b/20131202/c/src/num06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNum06a(double date1, double date2, double rmatn[3][3])
 /*
@@ -56,11 +56,11 @@ void iauNum06a(double date1, double date2, double rmatn[3][3])
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 3.222-3 (p114).
 **
-**  This revision:  2008 May 12
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double eps, dp, de;
@@ -79,7 +79,7 @@ void iauNum06a(double date1, double date2, double rmatn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/numat.c b/20131202/c/src/numat.c
similarity index 97%
rename from 20120301_a/c/src/numat.c
rename to 20131202/c/src/numat.c
index 846f7c8..68674f8 100644
--- a/20120301_a/c/src/numat.c
+++ b/20131202/c/src/numat.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNumat(double epsa, double dpsi, double deps, double rmatn[3][3])
 /*
@@ -46,11 +46,11 @@ void iauNumat(double epsa, double dpsi, double deps, double rmatn[3][3])
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 3.222-3 (p114).
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Build the rotation matrix. */
@@ -63,7 +63,7 @@ void iauNumat(double epsa, double dpsi, double deps, double rmatn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/nut00a.c b/20131202/c/src/nut00a.c
similarity index 99%
rename from 20120301_a/c/src/nut00a.c
rename to 20131202/c/src/nut00a.c
index 6742ed1..83b1093 100644
--- a/20120301_a/c/src/nut00a.c
+++ b/20131202/c/src/nut00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNut00a(double date1, double date2, double *dpsi, double *deps)
 /*
@@ -153,11 +153,11 @@ void iauNut00a(double date1, double date2, double *dpsi, double *deps)
 **     Wallace, P.T., "Software for Implementing the IAU 2000
 **     Resolutions", in IERS Workshop 5.1 (2002)
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int i;
@@ -2001,7 +2001,7 @@ void iauNut00a(double date1, double date2, double *dpsi, double *deps)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/nut00b.c b/20131202/c/src/nut00b.c
similarity index 99%
rename from 20120301_a/c/src/nut00b.c
rename to 20131202/c/src/nut00b.c
index 6dd89e5..0b845d9 100644
--- a/20120301_a/c/src/nut00b.c
+++ b/20131202/c/src/nut00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNut00b(double date1, double date2, double *dpsi, double *deps)
 /*
@@ -121,11 +121,11 @@ void iauNut00b(double date1, double date2, double *dpsi, double *deps)
 **     Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M.,
 **     Francou, G., Laskar, J., Astron.Astrophys. 282, 663-683 (1994)
 **
-**  This revision:  2010 September 4
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, el, elp, f, d, om, arg, dp, de, sarg, carg,
@@ -326,7 +326,7 @@ void iauNut00b(double date1, double date2, double *dpsi, double *deps)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/nut06a.c b/20131202/c/src/nut06a.c
similarity index 97%
rename from 20120301_a/c/src/nut06a.c
rename to 20131202/c/src/nut06a.c
index 2dfe939..3cd7ff7 100644
--- a/20120301_a/c/src/nut06a.c
+++ b/20131202/c/src/nut06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNut06a(double date1, double date2, double *dpsi, double *deps)
 /*
@@ -77,11 +77,11 @@ void iauNut06a(double date1, double date2, double *dpsi, double *deps)
 **     Wallace, P.T., "Software for Implementing the IAU 2000
 **     Resolutions", in IERS Workshop 5.1 (2002)
 **
-**  This revision:  2011 April 3
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, fj2, dp, de;
@@ -104,7 +104,7 @@ void iauNut06a(double date1, double date2, double *dpsi, double *deps)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/nut80.c b/20131202/c/src/nut80.c
similarity index 98%
rename from 20120301_a/c/src/nut80.c
rename to 20131202/c/src/nut80.c
index 510c71e..c1b34d6 100644
--- a/20120301_a/c/src/nut80.c
+++ b/20131202/c/src/nut80.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNut80(double date1, double date2, double *dpsi, double *deps)
 /*
@@ -53,11 +53,11 @@ void iauNut80(double date1, double date2, double *dpsi, double *deps)
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 3.222 (p111).
 **
-**  This revision:  2008 September 30
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, el, elp, f, d, om, dp, de, arg, s, c;
@@ -279,7 +279,7 @@ void iauNut80(double date1, double date2, double *dpsi, double *deps)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/nutm80.c b/20131202/c/src/nutm80.c
similarity index 97%
rename from 20120301_a/c/src/nutm80.c
rename to 20131202/c/src/nutm80.c
index baee06e..4166cfa 100644
--- a/20120301_a/c/src/nutm80.c
+++ b/20131202/c/src/nutm80.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauNutm80(double date1, double date2, double rmatn[3][3])
 /*
@@ -50,11 +50,11 @@ void iauNutm80(double date1, double date2, double rmatn[3][3])
 **     iauObl80     mean obliquity, IAU 1980
 **     iauNumat     form nutation matrix
 **
-**  This revision:  2008 May 12
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsi, deps, epsa;
@@ -71,7 +71,7 @@ void iauNutm80(double date1, double date2, double rmatn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/obl06.c b/20131202/c/src/obl06.c
similarity index 97%
rename from 20120301_a/c/src/obl06.c
rename to 20131202/c/src/obl06.c
index f94acf8..33c10a3 100644
--- a/20120301_a/c/src/obl06.c
+++ b/20131202/c/src/obl06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauObl06(double date1, double date2)
 /*
@@ -47,11 +47,11 @@ double iauObl06(double date1, double date2)
 **
 **     Hilton, J. et al., 2006, Celest.Mech.Dyn.Astron. 94, 351
 **
-**  This revision:  2009 March 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, eps0;
@@ -72,7 +72,7 @@ double iauObl06(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/obl80.c b/20131202/c/src/obl80.c
similarity index 97%
rename from 20120301_a/c/src/obl80.c
rename to 20131202/c/src/obl80.c
index 27ea3c7..46a8f6f 100644
--- a/20120301_a/c/src/obl80.c
+++ b/20131202/c/src/obl80.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauObl80(double date1, double date2)
 /*
@@ -49,11 +49,11 @@ double iauObl80(double date1, double date2)
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Expression 3.222-1 (p114).
 **
-**  This revision:  2009 March 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, eps0;
@@ -72,7 +72,7 @@ double iauObl80(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/p06e.c b/20131202/c/src/p06e.c
similarity index 98%
rename from 20120301_a/c/src/p06e.c
rename to 20131202/c/src/p06e.c
index 5b6f8cb..1b069e0 100644
--- a/20120301_a/c/src/p06e.c
+++ b/20131202/c/src/p06e.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauP06e(double date1, double date2,
              double *eps0, double *psia, double *oma, double *bpa,
@@ -125,11 +125,11 @@ void iauP06e(double date1, double date2,
 **  Called:
 **     iauObl06     mean obliquity, IAU 2006
 **
-**  This revision:  2011 December 6
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t;
@@ -275,7 +275,7 @@ void iauP06e(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/p2pv.c b/20131202/c/src/p2pv.c
similarity index 96%
rename from 20120301_a/c/src/p2pv.c
rename to 20131202/c/src/p2pv.c
index 39b14ac..0cbeb60 100644
--- a/20120301_a/c/src/p2pv.c
+++ b/20131202/c/src/p2pv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauP2pv(double p[3], double pv[2][3])
 /*
@@ -23,11 +23,11 @@ void iauP2pv(double p[3], double pv[2][3])
 **     iauCp        copy p-vector
 **     iauZp        zero p-vector
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauCp(p, pv[0]);
@@ -37,7 +37,7 @@ void iauP2pv(double p[3], double pv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/p2s.c b/20131202/c/src/p2s.c
similarity index 96%
rename from 20120301_a/c/src/p2s.c
rename to 20131202/c/src/p2s.c
index 2cd4157..21e9c9b 100644
--- a/20120301_a/c/src/p2s.c
+++ b/20131202/c/src/p2s.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauP2s(double p[3], double *theta, double *phi, double *r)
 /*
@@ -31,11 +31,11 @@ void iauP2s(double p[3], double *theta, double *phi, double *r)
 **     iauC2s       p-vector to spherical
 **     iauPm        modulus of p-vector
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauC2s(p, theta, phi);
@@ -45,7 +45,7 @@ void iauP2s(double p[3], double *theta, double *phi, double *r)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pap.c b/20131202/c/src/pap.c
similarity index 97%
copy from 20120301_a/c/src/pap.c
copy to 20131202/c/src/pap.c
index aca9e96..2582125 100644
--- a/20120301_a/c/src/pap.c
+++ b/20131202/c/src/pap.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauPap(double a[3], double b[3])
 /*
@@ -42,11 +42,11 @@ double iauPap(double a[3], double b[3])
 **     iauPmp       p-vector minus p-vector
 **     iauPdp       scalar product of two p-vectors
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double am, au[3], bm, st, ct, xa, ya, za, eta[3], xi[3], a2b[3], pa;
@@ -93,7 +93,7 @@ double iauPap(double a[3], double b[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pas.c b/20131202/c/src/pas.c
similarity index 97%
rename from 20120301_a/c/src/pas.c
rename to 20131202/c/src/pas.c
index bfc744a..c066c57 100644
--- a/20120301_a/c/src/pas.c
+++ b/20131202/c/src/pas.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauPas(double al, double ap, double bl, double bp)
 /*
@@ -31,11 +31,11 @@ double iauPas(double al, double ap, double bl, double bp)
 **
 **  2) Zero is returned if the two points are coincident.
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dl, x, y, pa;
@@ -50,7 +50,7 @@ double iauPas(double al, double ap, double bl, double bp)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pb06.c b/20131202/c/src/pb06.c
similarity index 97%
rename from 20120301_a/c/src/pb06.c
rename to 20131202/c/src/pb06.c
index 4f84af6..9f4327e 100644
--- a/20120301_a/c/src/pb06.c
+++ b/20131202/c/src/pb06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPb06(double date1, double date2,
              double *bzeta, double *bz, double *btheta)
@@ -68,11 +68,11 @@ void iauPb06(double date1, double date2,
 **     iauPmat06    PB matrix, IAU 2006
 **     iauRz        rotate around Z-axis
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r[3][3], r31, r32;
@@ -98,7 +98,7 @@ void iauPb06(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pdp.c b/20131202/c/src/pdp.c
similarity index 96%
rename from 20120301_a/c/src/pdp.c
rename to 20131202/c/src/pdp.c
index 0a34948..f34a146 100644
--- a/20120301_a/c/src/pdp.c
+++ b/20131202/c/src/pdp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauPdp(double a[3], double b[3])
 /*
@@ -20,11 +20,11 @@ double iauPdp(double a[3], double b[3])
 **  Returned (function value):
 **            double        a . b
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double w;
@@ -38,7 +38,7 @@ double iauPdp(double a[3], double b[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pfw06.c b/20131202/c/src/pfw06.c
similarity index 97%
rename from 20120301_a/c/src/pfw06.c
rename to 20131202/c/src/pfw06.c
index b842627..d6b800a 100644
--- a/20120301_a/c/src/pfw06.c
+++ b/20131202/c/src/pfw06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPfw06(double date1, double date2,
               double *gamb, double *phib, double *psib, double *epsa)
@@ -78,11 +78,11 @@ void iauPfw06(double date1, double date2,
 **  Called:
 **     iauObl06     mean obliquity, IAU 2006
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t;
@@ -119,7 +119,7 @@ void iauPfw06(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/plan94.c b/20131202/c/src/plan94.c
similarity index 99%
rename from 20120301_a/c/src/plan94.c
rename to 20131202/c/src/plan94.c
index 635d971..b55576b 100644
--- a/20120301_a/c/src/plan94.c
+++ b/20131202/c/src/plan94.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauPlan94(double date1, double date2, int np, double pv[2][3])
 /*
@@ -162,11 +162,11 @@ int iauPlan94(double date1, double date2, int np, double pv[2][3])
 **              Chapront-Touze, M., Francou, G., and Laskar, J.,
 **              Astron. Astrophys. 282, 663 (1994).
 **
-**  This revision:  2012 March 8
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Gaussian constant */
@@ -468,7 +468,7 @@ int iauPlan94(double date1, double date2, int np, double pv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pm.c b/20131202/c/src/pm.c
similarity index 94%
rename from 20120301_a/c/src/pm.c
rename to 20131202/c/src/pm.c
index 23c06dd..1affefa 100644
--- a/20120301_a/c/src/pm.c
+++ b/20131202/c/src/pm.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauPm(double p[3])
 /*
@@ -19,25 +19,18 @@ double iauPm(double p[3])
 **  Returned (function value):
 **            double        modulus
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double w;
-
-
-   w  = sqrt( p[0] * p[0]
-            + p[1] * p[1]
-            + p[2] * p[2] );
-
-   return w;
+   return sqrt( p[0]*p[0] + p[1]*p[1] + p[2]*p[2] );
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pmat00.c b/20131202/c/src/pmat00.c
similarity index 97%
rename from 20120301_a/c/src/pmat00.c
rename to 20131202/c/src/pmat00.c
index f63f0f8..f7f8f57 100644
--- a/20120301_a/c/src/pmat00.c
+++ b/20131202/c/src/pmat00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPmat00(double date1, double date2, double rbp[3][3])
 /*
@@ -55,11 +55,11 @@ void iauPmat00(double date1, double date2, double rbp[3][3])
 **     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
 **     (2000)
 **
-**  This revision:  2009 December 21
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rb[3][3], rp[3][3];
@@ -72,7 +72,7 @@ void iauPmat00(double date1, double date2, double rbp[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pmat06.c b/20131202/c/src/pmat06.c
similarity index 97%
rename from 20120301_a/c/src/pmat06.c
rename to 20131202/c/src/pmat06.c
index ecb9d97..6aa837a 100644
--- a/20120301_a/c/src/pmat06.c
+++ b/20131202/c/src/pmat06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPmat06(double date1, double date2, double rbp[3][3])
 /*
@@ -56,11 +56,11 @@ void iauPmat06(double date1, double date2, double rbp[3][3])
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2009 December 21
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gamb, phib, psib, epsa;
@@ -76,7 +76,7 @@ void iauPmat06(double date1, double date2, double rbp[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pmat76.c b/20131202/c/src/pmat76.c
similarity index 97%
rename from 20120301_a/c/src/pmat76.c
rename to 20131202/c/src/pmat76.c
index 304c6d6..e40285d 100644
--- a/20120301_a/c/src/pmat76.c
+++ b/20131202/c/src/pmat76.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPmat76(double date1, double date2, double rmatp[3][3])
 /*
@@ -71,11 +71,11 @@ void iauPmat76(double date1, double date2, double rmatp[3][3])
 **
 **     Kaplan,G.H., 1981. USNO circular no. 163, pA2.
 **
-**  This revision:  2009 December 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double zeta, z, theta, wmat[3][3];
@@ -95,7 +95,7 @@ void iauPmat76(double date1, double date2, double rmatp[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pmp.c b/20131202/c/src/pmp.c
similarity index 96%
rename from 20120301_a/c/src/pmp.c
rename to 20131202/c/src/pmp.c
index b691cd9..1f0a19d 100644
--- a/20120301_a/c/src/pmp.c
+++ b/20131202/c/src/pmp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPmp(double a[3], double b[3], double amb[3])
 /*
@@ -24,11 +24,11 @@ void iauPmp(double a[3], double b[3], double amb[3])
 **     It is permissible to re-use the same array for any of the
 **     arguments.
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    amb[0] = a[0] - b[0];
@@ -39,7 +39,7 @@ void iauPmp(double a[3], double b[3], double amb[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pap.c b/20131202/c/src/pmpx.c
similarity index 64%
rename from 20120301_a/c/src/pap.c
rename to 20131202/c/src/pmpx.c
index aca9e96..98267d4 100644
--- a/20120301_a/c/src/pap.c
+++ b/20131202/c/src/pmpx.c
@@ -1,99 +1,104 @@
-#include "sofam.h"
+#include "sofa.h"
 
-double iauPap(double a[3], double b[3])
+void iauPmpx(double rc, double dc, double pr, double pd,
+             double px, double rv, double pmt, double pob[3],
+             double pco[3])
 /*
-**  - - - - - - -
-**   i a u P a p
-**  - - - - - - -
+**  - - - - - - - -
+**   i a u P m p x
+**  - - - - - - - -
 **
-**  Position-angle from two p-vectors.
+**  Proper motion and parallax.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  vector/matrix support function.
+**  Status:  support function.
 **
 **  Given:
-**     a      double[3]  direction of reference point
-**     b      double[3]  direction of point whose PA is required
+**     rc,dc  double     ICRS RA,Dec at catalog epoch (radians)
+**     pr     double     RA proper motion (radians/year; Note 1)
+**     pd     double     Dec proper motion (radians/year)
+**     px     double     parallax (arcsec)
+**     rv     double     radial velocity (km/s, +ve if receding)
+**     pmt    double     proper motion time interval (SSB, Julian years)
+**     pob    double[3]  SSB to observer vector (au)
 **
-**  Returned (function value):
-**            double     position angle of b with respect to a (radians)
+**  Returned:
+**     pco    double[3]  coordinate direction (BCRS unit vector)
 **
 **  Notes:
 **
-**  1) The result is the position angle, in radians, of direction b with
-**     respect to direction a.  It is in the range -pi to +pi.  The
-**     sense is such that if b is a small distance "north" of a the
-**     position angle is approximately zero, and if b is a small
-**     distance "east" of a the position angle is approximately +pi/2.
+**  1) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
 **
-**  2) The vectors a and b need not be of unit length.
+**  2) The proper motion time interval is for when the starlight
+**     reaches the solar system barycenter.
 **
-**  3) Zero is returned if the two directions are the same or if either
-**     vector is null.
+**  3) To avoid the need for iteration, the Roemer effect (i.e. the
+**     small annual modulation of the proper motion coming from the
+**     changing light time) is applied approximately, using the
+**     direction of the star at the catalog epoch.
 **
-**  4) If vector a is at a pole, the result is ill-defined.
+**  References:
+**
+**     1984 Astronomical Almanac, pp B39-B41.
+**
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013), Section 7.2.
 **
 **  Called:
-**     iauPn        decompose p-vector into modulus and direction
-**     iauPm        modulus of p-vector
-**     iauPxp       vector product of two p-vectors
-**     iauPmp       p-vector minus p-vector
 **     iauPdp       scalar product of two p-vectors
+**     iauPn        decompose p-vector into modulus and direction
 **
-**  This revision:  2008 May 25
+**  This revision:   2013 October 9
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double am, au[3], bm, st, ct, xa, ya, za, eta[3], xi[3], a2b[3], pa;
+/* Km/s to au/year */
+   const double VF = DAYSEC*DJM/DAU;
 
+/* Light time for 1 au, Julian years */
+   const double AULTY = AULT/DAYSEC/DJY;
 
-/* Modulus and direction of the a vector. */
-   iauPn(a, &am, au);
+   int i;
+   double sr, cr, sd, cd, x, y, z, p[3], dt, pxr, w, pdz, pm[3];
 
-/* Modulus of the b vector. */
-   bm = iauPm(b);
 
-/* Deal with the case of a null vector. */
-   if ((am == 0.0) || (bm == 0.0)) {
-      st = 0.0;
-      ct = 1.0;
-   } else {
+/* Spherical coordinates to unit vector (and useful functions). */
+   sr = sin(rc);
+   cr = cos(rc);
+   sd = sin(dc);
+   cd = cos(dc);
+   p[0] = x = cr*cd;
+   p[1] = y = sr*cd;
+   p[2] = z = sd;
 
-   /* The "north" axis tangential from a (arbitrary length). */
-      xa = a[0];
-      ya = a[1];
-      za = a[2];
-      eta[0] = -xa * za;
-      eta[1] = -ya * za;
-      eta[2] =  xa*xa + ya*ya;
+/* Proper motion time interval (y) including Roemer effect. */
+   dt = pmt + iauPdp(p,pob)*AULTY;
 
-   /* The "east" axis tangential from a (same length). */
-      iauPxp(eta, au, xi);
+/* Space motion (radians per year). */
+   pxr = px * DAS2R;
+   w = VF * rv * pxr;
+   pdz = pd * z;
+   pm[0] = - pr*y - pdz*cr + w*x;
+   pm[1] =   pr*x - pdz*sr + w*y;
+   pm[2] =   pd*cd + w*z;
 
-   /* The vector from a to b. */
-      iauPmp(b, a, a2b);
-
-   /* Resolve into components along the north and east axes. */
-      st = iauPdp(a2b, xi);
-      ct = iauPdp(a2b, eta);
-
-   /* Deal with degenerate cases. */
-      if ((st == 0.0) && (ct == 0.0)) ct = 1.0;
+/* Coordinate direction of star (unit vector, BCRS). */
+   for (i = 0; i < 3; i++) {
+      p[i] += dt*pm[i] - pxr*pob[i];
    }
+   iauPn(p, &w, pco);
 
-/* Position angle. */
-   pa = atan2(st, ct);
-
-   return pa;
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -186,4 +191,5 @@ double iauPap(double a[3], double b[3])
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/starpm.c b/20131202/c/src/pmsafe.c
similarity index 61%
copy from 20120301_a/c/src/starpm.c
copy to 20131202/c/src/pmsafe.c
index ba9e4c3..955d0c4 100644
--- a/20120301_a/c/src/starpm.c
+++ b/20131202/c/src/pmsafe.c
@@ -1,71 +1,72 @@
-#include "sofam.h"
+#include "sofa.h"
 
-int iauStarpm(double ra1, double dec1,
-              double pmr1, double pmd1, double px1, double rv1,
+int iauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
+              double px1, double rv1,
               double ep1a, double ep1b, double ep2a, double ep2b,
-              double *ra2, double *dec2,
-              double *pmr2, double *pmd2, double *px2, double *rv2)
+              double *ra2, double *dec2, double *pmr2, double *pmd2,
+              double *px2, double *rv2)
 /*
 **  - - - - - - - - - -
-**   i a u S t a r p m
+**   i a u P m s a f e
 **  - - - - - - - - - -
 **
-**  Star proper motion:  update star catalog data for space motion.
+**  Star proper motion:  update star catalog data for space motion, with
+**  special handling to handle the zero parallax case.
 **
 **  This function is part of the International Astronomical Union's
-**  SOFA (Standards Of Fundamental Astronomy) software collection.
+**  SOFA (Standards of Fundamental Astronomy) software collection.
 **
 **  Status:  support function.
 **
 **  Given:
-**     ra1    double     right ascension (radians), before
-**     dec1   double     declination (radians), before
-**     pmr1   double     RA proper motion (radians/year), before
-**     pmd1   double     Dec proper motion (radians/year), before
-**     px1    double     parallax (arcseconds), before
-**     rv1    double     radial velocity (km/s, +ve = receding), before
-**     ep1a   double     "before" epoch, part A (Note 1)
-**     ep1b   double     "before" epoch, part B (Note 1)
-**     ep2a   double     "after" epoch, part A (Note 1)
-**     ep2b   double     "after" epoch, part B (Note 1)
+**     ra1    double      right ascension (radians), before
+**     dec1   double      declination (radians), before
+**     pmr1   double      RA proper motion (radians/year), before
+**     pmd1   double      Dec proper motion (radians/year), before
+**     px1    double      parallax (arcseconds), before
+**     rv1    double      radial velocity (km/s, +ve = receding), before
+**     ep1a   double      "before" epoch, part A (Note 1)
+**     ep1b   double      "before" epoch, part B (Note 1)
+**     ep2a   double      "after" epoch, part A (Note 1)
+**     ep2b   double      "after" epoch, part B (Note 1)
 **
 **  Returned:
-**     ra2    double     right ascension (radians), after
-**     dec2   double     declination (radians), after
-**     pmr2   double     RA proper motion (radians/year), after
-**     pmd2   double     Dec proper motion (radians/year), after
-**     px2    double     parallax (arcseconds), after
-**     rv2    double     radial velocity (km/s, +ve = receding), after
+**     ra2    double      right ascension (radians), after
+**     dec2   double      declination (radians), after
+**     pmr2   double      RA proper motion (radians/year), after
+**     pmd2   double      Dec proper motion (radians/year), after
+**     px2    double      parallax (arcseconds), after
+**     rv2    double      radial velocity (km/s, +ve = receding), after
 **
 **  Returned (function value):
-**            int        status:
-**                          -1 = system error (should not occur)
-**                           0 = no warnings or errors
-**                           1 = distance overridden (Note 6)
-**                           2 = excessive velocity (Note 7)
-**                           4 = solution didn't converge (Note 8)
-**                        else = binary logical OR of the above warnings
+**            int         status:
+**                         -1 = system error (should not occur)
+**                          0 = no warnings or errors
+**                          1 = distance overridden (Note 6)
+**                          2 = excessive velocity (Note 7)
+**                          4 = solution didn't converge (Note 8)
+**                       else = binary logical OR of the above warnings
 **
 **  Notes:
 **
-**  1) The starting and ending TDB dates ep1a+ep1b and ep2a+ep2b are
+**  1) The starting and ending TDB epochs ep1a+ep1b and ep2a+ep2b are
 **     Julian Dates, apportioned in any convenient way between the two
 **     parts (A and B).  For example, JD(TDB)=2450123.7 could be
 **     expressed in any of these ways, among others:
 **
-**             epna          epnb
+**            epNa            epNb
 **
 **         2450123.7           0.0       (JD method)
 **         2451545.0       -1421.3       (J2000 method)
 **         2400000.5       50123.2       (MJD method)
 **         2450123.5           0.2       (date & time method)
 **
-**     The JD method is the most natural and convenient to use in
-**     cases where the loss of several decimal digits of resolution
-**     is acceptable.  The J2000 method is best matched to the way
-**     the argument is handled internally and will deliver the
-**     optimum resolution.  The MJD method and the date & time methods
-**     are both good compromises between resolution and convenience.
+**     The JD method is the most natural and convenient to use in cases
+**     where the loss of several decimal digits of resolution is
+**     acceptable.  The J2000 method is best matched to the way the
+**     argument is handled internally and will deliver the optimum
+**     resolution.  The MJD method and the date & time methods are both
+**     good compromises between resolution and convenience.
 **
 **  2) In accordance with normal star-catalog conventions, the object's
 **     right ascension and declination are freed from the effects of
@@ -87,17 +88,17 @@ int iauStarpm(double ra1, double dec1,
 **     motions, the RA proper motion will need to be divided by cos(Dec)
 **     before use.
 **
-**  5) Straight-line motion at constant speed, in the inertial frame,
-**     is assumed.
+**  5) Straight-line motion at constant speed, in the inertial frame, is
+**     assumed.
 **
-**  6) An extremely small (or zero or negative) parallax is interpreted
-**     to mean that the object is on the "celestial sphere", the radius
-**     of which is an arbitrary (large) value (see the iauStarpv
-**     function for the value used).  When the distance is overridden in
-**     this way, the status, initially zero, has 1 added to it.
+**  6) An extremely small (or zero or negative) parallax is overridden
+**     to ensure that the object is at a finite but very large distance,
+**     but not so large that the proper motion is equivalent to a large
+**     but safe speed (about 0.1c using the chosen constant).  A warning
+**     status of 1 is added to the status if this action has been taken.
 **
 **  7) If the space velocity is a significant fraction of c (see the
-**     constant VMAX in the function iauStarpv),  it is arbitrarily set
+**     constant VMAX in the function iauStarpv), it is arbitrarily set
 **     to zero.  When this action occurs, 2 is added to the status.
 **
 **  8) The relativistic adjustment carried out in the iauStarpv function
@@ -106,60 +107,51 @@ int iauStarpm(double ra1, double dec1,
 **     status.
 **
 **  Called:
-**     iauStarpv    star catalog data to space motion pv-vector
-**     iauPvu       update a pv-vector
-**     iauPdp       scalar product of two p-vectors
-**     iauPvstar    space motion pv-vector to star catalog data
+**     iauSeps      angle between two points
+**     iauStarpm    update star catalog data for space motion
 **
-**  This revision:  2008 May 16
+**  This revision:   2013 October 9
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double pv1[2][3], tl1, dt, pv[2][3], r2, rdv, v2, c2mv2, tl2,
-          pv2[2][3];
-   int j1, j2, j;
 
+/* Minimum allowed parallax (arcsec) */
+   const double PXMIN = 5e-7;
 
-/* RA,Dec etc. at the "before" epoch to space motion pv-vector. */
-   j1 = iauStarpv(ra1, dec1, pmr1, pmd1, px1, rv1, pv1);
+/* Factor giving maximum allowed transverse speed of about 1% c */
+   const double F = 326.0;
 
-/* Light time when observed (days). */
-   tl1 = iauPm(pv1[0]) / DC;
+   int jpx, j;
+   double pm, px1a;
 
-/* Time interval, "before" to "after" (days). */
-   dt = (ep2a - ep1a) + (ep2b - ep1b);
 
-/* Move star along track from the "before" observed position to the */
-/* "after" geometric position. */
-   iauPvu(dt + tl1, pv1, pv);
+/* Proper motion in one year (radians). */
+   pm = iauSeps(ra1, dec1, ra1+pmr1, dec1+pmd1);
 
-/* From this geometric position, deduce the observed light time (days) */
-/* at the "after" epoch (with theoretically unneccessary error check). */
-   r2 = iauPdp(pv[0], pv[0]);
-   rdv = iauPdp(pv[0], pv[1]);
-   v2 = iauPdp(pv[1], pv[1]);
-   c2mv2 = DC*DC - v2;
-   if (c2mv2 <=  0) return -1;
-   tl2 = (-rdv + sqrt(rdv*rdv + c2mv2*r2)) / c2mv2;
+/* Override the parallax to reduce the chances of a warning status. */
+   jpx = 0;
+   px1a = px1;
+   pm *= F;
+   if (px1a < pm) {jpx = 1; px1a = pm;}
+   if (px1a < PXMIN) {jpx = 1; px1a = PXMIN;}
 
-/* Move the position along track from the observed place at the */
-/* "before" epoch to the observed place at the "after" epoch. */
-   iauPvu(dt + (tl1 - tl2), pv1, pv2);
-
-/* Space motion pv-vector to RA,Dec etc. at the "after" epoch. */
-   j2 = iauPvstar(pv2, ra2, dec2, pmr2, pmd2, px2, rv2);
-
-/* Final status. */
-   j = (j2 == 0) ? j1 : -1;
+/* Carry out the transformation using the modified parallax. */
+   j = iauStarpm(ra1, dec1, pmr1, pmd1, px1a, rv1,
+                 ep1a, ep1b, ep2a, ep2b,
+                 ra2, dec2, pmr2, pmd2, px2, rv2);
 
+/* Revise and return the status. */
+   if (! j%2) j += jpx;
    return j;
 
+/* Finished. */
+
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -252,4 +244,5 @@ int iauStarpm(double ra1, double dec1,
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/pn.c b/20131202/c/src/pn.c
similarity index 97%
rename from 20120301_a/c/src/pn.c
rename to 20131202/c/src/pn.c
index 37401f7..a2e1487 100644
--- a/20120301_a/c/src/pn.c
+++ b/20131202/c/src/pn.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPn(double p[3], double *r, double u[3])
 /*
@@ -33,11 +33,11 @@ void iauPn(double p[3], double *r, double u[3])
 **     iauZp        zero p-vector
 **     iauSxp       multiply p-vector by scalar
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double w;
@@ -63,7 +63,7 @@ void iauPn(double p[3], double *r, double u[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pn00.c b/20131202/c/src/pn00.c
similarity index 98%
rename from 20120301_a/c/src/pn00.c
rename to 20131202/c/src/pn00.c
index 6ae880c..609d35c 100644
--- a/20120301_a/c/src/pn00.c
+++ b/20131202/c/src/pn00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPn00(double date1, double date2, double dpsi, double deps,
              double *epsa,
@@ -100,11 +100,11 @@ void iauPn00(double date1, double date2, double dpsi, double deps,
 **     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
 **          intermediate origin" (CIO) by IAU 2006 Resolution 2.
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsipr, depspr, rbpw[3][3], rnw[3][3];
@@ -131,7 +131,7 @@ void iauPn00(double date1, double date2, double dpsi, double deps,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pn00a.c b/20131202/c/src/pn00a.c
similarity index 96%
rename from 20120301_a/c/src/pn00a.c
rename to 20131202/c/src/pn00a.c
index 0245962..f77def5 100644
--- a/20120301_a/c/src/pn00a.c
+++ b/20131202/c/src/pn00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPn00a(double date1, double date2,
               double *dpsi, double *deps, double *epsa,
@@ -79,8 +79,9 @@ void iauPn00a(double date1, double date2,
 **      equinox of date.  It is the product rn x rbp, applying frame
 **      bias, precession and nutation in that order.
 **
-**  9)  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
-**      Pole are elements (3,1-3) of the matrix rbpn.
+**  9)  The X,Y,Z coordinates of the IAU 2000A Celestial Intermediate
+**      Pole are elements (3,1-3) of the GCRS-to-true matrix,
+**      i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the order given.
@@ -99,11 +100,11 @@ void iauPn00a(double date1, double date2,
 **     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
 **          intermediate origin" (CIO) by IAU 2006 Resolution 2.
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 November 14
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Nutation. */
@@ -116,7 +117,7 @@ void iauPn00a(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pn00b.c b/20131202/c/src/pn00b.c
similarity index 97%
rename from 20120301_a/c/src/pn00b.c
rename to 20131202/c/src/pn00b.c
index a35cd51..c13b56f 100644
--- a/20120301_a/c/src/pn00b.c
+++ b/20131202/c/src/pn00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPn00b(double date1, double date2,
               double *dpsi, double *deps, double *epsa,
@@ -80,7 +80,8 @@ void iauPn00b(double date1, double date2,
 **      bias, precession and nutation in that order.
 **
 **  9)  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
-**      Pole are elements (3,1-3) of the matrix rbpn.
+**      Pole are elements (3,1-3) of the GCRS-to-true matrix,
+**      i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the stated order.
@@ -99,11 +100,11 @@ void iauPn00b(double date1, double date2,
 **     n.b. The celestial ephemeris origin (CEO) was renamed "celestial
 **          intermediate origin" (CIO) by IAU 2006 Resolution 2.
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 November 13
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Nutation. */
@@ -116,7 +117,7 @@ void iauPn00b(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pn06.c b/20131202/c/src/pn06.c
similarity index 96%
rename from 20120301_a/c/src/pn06.c
rename to 20131202/c/src/pn06.c
index 1eb92ef..6d51016 100644
--- a/20120301_a/c/src/pn06.c
+++ b/20131202/c/src/pn06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPn06(double date1, double date2, double dpsi, double deps,
              double *epsa,
@@ -79,8 +79,8 @@ void iauPn06(double date1, double date2, double dpsi, double deps,
 **      equinox of date.  It is the product rn x rbp, applying frame
 **      bias, precession and nutation in that order.
 **
-**  9)  The X,Y,Z coordinates of the IAU 2000B Celestial Intermediate
-**      Pole are elements (3,1-3) of the matrix rbpn.
+**  9)  The X,Y,Z coordinates of the Celestial Intermediate Pole are
+**      elements (3,1-3) of the GCRS-to-true matrix, i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the stated order.
@@ -98,11 +98,11 @@ void iauPn06(double date1, double date2, double dpsi, double deps,
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 November 14
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gamb, phib, psib, eps, r1[3][3], r2[3][3], rt[3][3];
@@ -141,7 +141,7 @@ void iauPn06(double date1, double date2, double dpsi, double deps,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pn06a.c b/20131202/c/src/pn06a.c
similarity index 96%
rename from 20120301_a/c/src/pn06a.c
rename to 20131202/c/src/pn06a.c
index e70cfdc..c6e601f 100644
--- a/20120301_a/c/src/pn06a.c
+++ b/20131202/c/src/pn06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPn06a(double date1, double date2,
               double *dpsi, double *deps, double *epsa,
@@ -76,7 +76,8 @@ void iauPn06a(double date1, double date2,
 **      precession and nutation in that order.
 **
 **  9)  The X,Y,Z coordinates of the IAU 2006/2000A Celestial
-**      Intermediate Pole are elements (1,1-3) of the matrix rbpn.
+**      Intermediate Pole are elements (3,1-3) of the GCRS-to-true
+**      matrix, i.e. rbpn[2][0-2].
 **
 **  10) It is permissible to re-use the same array in the returned
 **      arguments.  The arrays are filled in the stated order.
@@ -89,11 +90,11 @@ void iauPn06a(double date1, double date2,
 **
 **     Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855
 **
-**  This revision:  2009 December 18
+**  This revision:  2013 November 13
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Nutation. */
@@ -106,7 +107,7 @@ void iauPn06a(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pnm00a.c b/20131202/c/src/pnm00a.c
similarity index 97%
rename from 20120301_a/c/src/pnm00a.c
rename to 20131202/c/src/pnm00a.c
index d899d65..aac691e 100644
--- a/20120301_a/c/src/pnm00a.c
+++ b/20131202/c/src/pnm00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPnm00a(double date1, double date2, double rbpn[3][3])
 /*
@@ -58,11 +58,11 @@ void iauPnm00a(double date1, double date2, double rbpn[3][3])
 **     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
 **     (2000)
 **
-**  This revision:  2009 December 21
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3];
@@ -75,7 +75,7 @@ void iauPnm00a(double date1, double date2, double rbpn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pnm00b.c b/20131202/c/src/pnm00b.c
similarity index 97%
rename from 20120301_a/c/src/pnm00b.c
rename to 20131202/c/src/pnm00b.c
index c0136b0..15af898 100644
--- a/20120301_a/c/src/pnm00b.c
+++ b/20131202/c/src/pnm00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPnm00b(double date1, double date2, double rbpn[3][3])
 /*
@@ -58,11 +58,11 @@ void iauPnm00b(double date1, double date2, double rbpn[3][3])
 **     24th General Assembly, Manchester, UK.  Resolutions B1.3, B1.6.
 **     (2000)
 **
-**  This revision:  2009 December 21
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dpsi, deps, epsa, rb[3][3], rp[3][3], rbp[3][3], rn[3][3];
@@ -75,7 +75,7 @@ void iauPnm00b(double date1, double date2, double rbpn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pnm06a.c b/20131202/c/src/pnm06a.c
similarity index 97%
rename from 20120301_a/c/src/pnm06a.c
rename to 20131202/c/src/pnm06a.c
index 8085742..f4e310e 100644
--- a/20120301_a/c/src/pnm06a.c
+++ b/20131202/c/src/pnm06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPnm06a(double date1, double date2, double rnpb[3][3])
 /*
@@ -55,11 +55,11 @@ void iauPnm06a(double date1, double date2, double rnpb[3][3])
 **
 **     Capitaine, N. & Wallace, P.T., 2006, Astron.Astrophys. 450, 855.
 **
-**  This revision:  2009 December 21
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double gamb, phib, psib, epsa, dp, de;
@@ -78,7 +78,7 @@ void iauPnm06a(double date1, double date2, double rnpb[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pnm80.c b/20131202/c/src/pnm80.c
similarity index 97%
rename from 20120301_a/c/src/pnm80.c
rename to 20131202/c/src/pnm80.c
index ce1750e..55ba545 100644
--- a/20120301_a/c/src/pnm80.c
+++ b/20131202/c/src/pnm80.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPnm80(double date1, double date2, double rmatpn[3][3])
 /*
@@ -57,11 +57,11 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 **     P. Kenneth Seidelmann (ed), University Science Books (1992),
 **     Section 3.3 (p145).
 **
-**  This revision:  2010 January 23
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rmatp[3][3], rmatn[3][3];
@@ -80,7 +80,7 @@ void iauPnm80(double date1, double date2, double rmatpn[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pom00.c b/20131202/c/src/pom00.c
similarity index 97%
rename from 20120301_a/c/src/pom00.c
rename to 20131202/c/src/pom00.c
index 33f7dc4..e46c1a1 100644
--- a/20120301_a/c/src/pom00.c
+++ b/20131202/c/src/pom00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPom00(double xp, double yp, double sp, double rpom[3][3])
 /*
@@ -51,11 +51,11 @@ void iauPom00(double xp, double yp, double sp, double rpom[3][3])
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -69,7 +69,7 @@ void iauPom00(double xp, double yp, double sp, double rpom[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ppp.c b/20131202/c/src/ppp.c
similarity index 96%
rename from 20120301_a/c/src/ppp.c
rename to 20131202/c/src/ppp.c
index b065f90..afc3180 100644
--- a/20120301_a/c/src/ppp.c
+++ b/20131202/c/src/ppp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPpp(double a[3], double b[3], double apb[3])
 /*
@@ -24,11 +24,11 @@ void iauPpp(double a[3], double b[3], double apb[3])
 **     It is permissible to re-use the same array for any of the
 **     arguments.
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    apb[0] = a[0] + b[0];
@@ -39,7 +39,7 @@ void iauPpp(double a[3], double b[3], double apb[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ppsp.c b/20131202/c/src/ppsp.c
similarity index 96%
rename from 20120301_a/c/src/ppsp.c
rename to 20131202/c/src/ppsp.c
index 80aa9b4..51c31ce 100644
--- a/20120301_a/c/src/ppsp.c
+++ b/20131202/c/src/ppsp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPpsp(double a[3], double s, double b[3], double apsb[3])
 /*
@@ -28,11 +28,11 @@ void iauPpsp(double a[3], double s, double b[3], double apsb[3])
 **     iauSxp       multiply p-vector by scalar
 **     iauPpp       p-vector plus p-vector
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double sb[3];
@@ -48,7 +48,7 @@ void iauPpsp(double a[3], double s, double b[3], double apsb[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pr00.c b/20131202/c/src/pr00.c
similarity index 97%
rename from 20120301_a/c/src/pr00.c
rename to 20131202/c/src/pr00.c
index 4a32a61..248986b 100644
--- a/20120301_a/c/src/pr00.c
+++ b/20131202/c/src/pr00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPr00(double date1, double date2, double *dpsipr, double *depspr)
 /*
@@ -71,11 +71,11 @@ void iauPr00(double date1, double date2, double *dpsipr, double *depspr)
 **     Wallace, P.T., "Software for Implementing the IAU 2000
 **     Resolutions", in IERS Workshop 5.1 (2002).
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t;
@@ -96,7 +96,7 @@ void iauPr00(double date1, double date2, double *dpsipr, double *depspr)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/prec76.c b/20131202/c/src/prec76.c
similarity index 85%
rename from 20120301_a/c/src/prec76.c
rename to 20131202/c/src/prec76.c
index c08700a..727036d 100644
--- a/20120301_a/c/src/prec76.c
+++ b/20131202/c/src/prec76.c
@@ -1,6 +1,6 @@
-#include "sofam.h"
+#include "sofa.h"
 
-void iauPrec76(double ep01, double ep02, double ep11, double ep12,
+void iauPrec76(double date01, double date02, double date11, double date12,
                double *zeta, double *z, double *theta)
 /*
 **  - - - - - - - - - -
@@ -10,8 +10,8 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **  IAU 1976 precession model.
 **
 **  This function forms the three Euler angles which implement general
-**  precession between two epochs, using the IAU 1976 model (as for
-**  the FK5 catalog).
+**  precession between two dates, using the IAU 1976 model (as for the
+**  FK5 catalog).
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards Of Fundamental Astronomy) software collection.
@@ -19,22 +19,22 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **  Status:  canonical model.
 **
 **  Given:
-**     ep01,ep02   double    TDB starting epoch (Note 1)
-**     ep11,ep12   double    TDB ending epoch (Note 1)
+**     date01,date02   double    TDB starting date (Note 1)
+**     date11,date12   double    TDB ending date (Note 1)
 **
 **  Returned:
-**     zeta        double    1st rotation: radians cw around z
-**     z           double    3rd rotation: radians cw around z
-**     theta       double    2nd rotation: radians ccw around y
+**     zeta            double    1st rotation: radians cw around z
+**     z               double    3rd rotation: radians cw around z
+**     theta           double    2nd rotation: radians ccw around y
 **
 **  Notes:
 **
-**  1) The epochs ep01+ep02 and ep11+ep12 are Julian Dates, apportioned
-**     in any convenient way between the arguments epn1 and epn2.  For
-**     example, JD(TDB)=2450123.7 could be expressed in any of these
-**     ways, among others:
+**  1) The dates date01+date02 and date11+date12 are Julian Dates,
+**     apportioned in any convenient way between the arguments daten1
+**     and daten2.  For example, JD(TDB)=2450123.7 could be expressed in
+**     any of these ways, among others:
 **
-**             epn1          epn2
+**           daten1        daten2
 **
 **         2450123.7           0.0       (JD method)
 **         2451545.0       -1421.3       (J2000 method)
@@ -47,7 +47,7 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **     argument is handled internally and will deliver the optimum
 **     optimum resolution.  The MJD method and the date & time methods
 **     are both good compromises between resolution and convenience.
-**     The two epochs may be expressed using different methods, but at
+**     The two dates may be expressed using different methods, but at
 **     the risk of losing some resolution.
 **
 **  2) The accumulated precession angles zeta, z, theta are expressed
@@ -71,21 +71,21 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 **     Lieske, J.H., 1979, Astron.Astrophys. 73, 282, equations
 **     (6) & (7), p283.
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 November 19
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t0, t, tas2r, w;
 
 
-/* Interval between fundamental epoch J2000.0 and start epoch (JC). */
-   t0 = ((ep01 - DJ00) + ep02) / DJC;
+/* Interval between fundamental epoch J2000.0 and start date (JC). */
+   t0 = ((date01 - DJ00) + date02) / DJC;
 
 /* Interval over which precession required (JC). */
-   t = ((ep11 - ep01) + (ep12 - ep02)) / DJC;
+   t = ((date11 - date01) + (date12 - date02)) / DJC;
 
 /* Euler angles. */
    tas2r = t * DAS2R;
@@ -102,7 +102,7 @@ void iauPrec76(double ep01, double ep02, double ep11, double ep12,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pv2p.c b/20131202/c/src/pv2p.c
similarity index 96%
rename from 20120301_a/c/src/pv2p.c
rename to 20131202/c/src/pv2p.c
index dff3afc..25e535b 100644
--- a/20120301_a/c/src/pv2p.c
+++ b/20131202/c/src/pv2p.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPv2p(double pv[2][3], double p[3])
 /*
@@ -22,11 +22,11 @@ void iauPv2p(double pv[2][3], double p[3])
 **  Called:
 **     iauCp        copy p-vector
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauCp(pv[0], p);
@@ -35,7 +35,7 @@ void iauPv2p(double pv[2][3], double p[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pv2s.c b/20131202/c/src/pv2s.c
similarity index 97%
rename from 20120301_a/c/src/pv2s.c
rename to 20131202/c/src/pv2s.c
index 1c52c03..763d8d9 100644
--- a/20120301_a/c/src/pv2s.c
+++ b/20131202/c/src/pv2s.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPv2s(double pv[2][3],
              double *theta, double *phi, double *r,
@@ -39,11 +39,11 @@ void iauPv2s(double pv[2][3],
 **  2) If the position is a pole, theta, td and pd are indeterminate.
 **     In such cases zeroes are returned for all three.
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, y, z, xd, yd, zd, rxy2, rxy, r2, rtrue, rw, xyp;
@@ -98,7 +98,7 @@ void iauPv2s(double pv[2][3],
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvdpv.c b/20131202/c/src/pvdpv.c
similarity index 97%
rename from 20120301_a/c/src/pvdpv.c
rename to 20131202/c/src/pvdpv.c
index dbe0b2e..8b8c7e2 100644
--- a/20120301_a/c/src/pvdpv.c
+++ b/20131202/c/src/pvdpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvdpv(double a[2][3], double b[2][3], double adb[2])
 /*
@@ -30,11 +30,11 @@ void iauPvdpv(double a[2][3], double b[2][3], double adb[2])
 **  Called:
 **     iauPdp       scalar product of two p-vectors
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double adbd, addb;
@@ -56,7 +56,7 @@ void iauPvdpv(double a[2][3], double b[2][3], double adb[2])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvm.c b/20131202/c/src/pvm.c
similarity index 96%
rename from 20120301_a/c/src/pvm.c
rename to 20131202/c/src/pvm.c
index 3561c87..af8e28b 100644
--- a/20120301_a/c/src/pvm.c
+++ b/20131202/c/src/pvm.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvm(double pv[2][3], double *r, double *s)
 /*
@@ -23,11 +23,11 @@ void iauPvm(double pv[2][3], double *r, double *s)
 **  Called:
 **     iauPm        modulus of p-vector
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Distance. */
@@ -40,7 +40,7 @@ void iauPvm(double pv[2][3], double *r, double *s)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvmpv.c b/20131202/c/src/pvmpv.c
similarity index 96%
rename from 20120301_a/c/src/pvmpv.c
rename to 20131202/c/src/pvmpv.c
index 740d54a..eedb5fc 100644
--- a/20120301_a/c/src/pvmpv.c
+++ b/20131202/c/src/pvmpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvmpv(double a[2][3], double b[2][3], double amb[2][3])
 /*
@@ -27,11 +27,11 @@ void iauPvmpv(double a[2][3], double b[2][3], double amb[2][3])
 **  Called:
 **     iauPmp       p-vector minus p-vector
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauPmp(a[0], b[0], amb[0]);
@@ -41,7 +41,7 @@ void iauPvmpv(double a[2][3], double b[2][3], double amb[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvppv.c b/20131202/c/src/pvppv.c
similarity index 96%
rename from 20120301_a/c/src/pvppv.c
rename to 20131202/c/src/pvppv.c
index 60d9a98..238dc9a 100644
--- a/20120301_a/c/src/pvppv.c
+++ b/20131202/c/src/pvppv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvppv(double a[2][3], double b[2][3], double apb[2][3])
 /*
@@ -27,11 +27,11 @@ void iauPvppv(double a[2][3], double b[2][3], double apb[2][3])
 **  Called:
 **     iauPpp       p-vector plus p-vector
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauPpp(a[0], b[0], apb[0]);
@@ -41,7 +41,7 @@ void iauPvppv(double a[2][3], double b[2][3], double apb[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvstar.c b/20131202/c/src/pvstar.c
similarity index 98%
rename from 20120301_a/c/src/pvstar.c
rename to 20131202/c/src/pvstar.c
index e804602..7e4e645 100644
--- a/20120301_a/c/src/pvstar.c
+++ b/20131202/c/src/pvstar.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauPvstar(double pv[2][3], double *ra, double *dec,
               double *pmr, double *pmd, double *px, double *rv)
@@ -98,11 +98,11 @@ int iauPvstar(double pv[2][3], double *ra, double *dec,
 **
 **     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
 **
-**  This revision:  2008 May 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double r, x[3], vr, ur[3], vt, ut[3], bett, betr, d, w, del,
@@ -161,7 +161,7 @@ int iauPvstar(double pv[2][3], double *ra, double *dec,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tdbtt.c b/20131202/c/src/pvtob.c
similarity index 60%
copy from 20120301_a/c/src/tdbtt.c
copy to 20131202/c/src/pvtob.c
index b5d81fe..5451620 100644
--- a/20120301_a/c/src/tdbtt.c
+++ b/20131202/c/src/pvtob.c
@@ -1,82 +1,113 @@
-#include "sofam.h"
+#include "sofa.h"
 
-int iauTdbtt(double tdb1, double tdb2, double dtr,
-             double *tt1, double *tt2 )
+void iauPvtob(double elong, double phi, double hm,
+              double xp, double yp, double sp, double theta,
+              double pv[2][3])
 /*
 **  - - - - - - - - -
-**   i a u T d b t t
+**   i a u P v t o b
 **  - - - - - - - - -
 **
-**  Time scale transformation:  Barycentric Dynamical Time, TDB, to
-**  Terrestrial Time, TT.
+**  Position and velocity of a terrestrial observing station.
 **
 **  This function is part of the International Astronomical Union's
 **  SOFA (Standards of Fundamental Astronomy) software collection.
 **
-**  Status:  canonical.
+**  Status:  support function.
 **
 **  Given:
-**     tdb1,tdb2  double    TDB as a 2-part Julian Date
-**     dtr        double    TDB-TT in seconds
+**     elong   double       longitude (radians, east +ve, Note 1)
+**     phi     double       latitude (geodetic, radians, Note 1)
+**     hm      double       height above ref. ellipsoid (geodetic, m)
+**     xp,yp   double       coordinates of the pole (radians, Note 2)
+**     sp      double       the TIO locator s' (radians, Note 2)
+**     theta   double       Earth rotation angle (radians, Note 3)
 **
 **  Returned:
-**     tt1,tt2    double    TT as a 2-part Julian Date
-**
-**  Returned (function value):
-**                int       status:  0 = OK
+**     pv      double[2][3] position/velocity vector (m, m/s, CIRS)
 **
 **  Notes:
 **
-**  1) tdb1+tdb2 is Julian Date, apportioned in any convenient way
-**     between the two arguments, for example where tdb1 is the Julian
-**     Day Number and tdb2 is the fraction of a day.  The returned
-**     tt1,tt2 follow suit.
+**  1) The terrestrial coordinates are with respect to the WGS84
+**     reference ellipsoid.
+**
+**  2) xp and yp are the coordinates (in radians) of the Celestial
+**     Intermediate Pole with respect to the International Terrestrial
+**     Reference System (see IERS Conventions), measured along the
+**     meridians 0 and 90 deg west respectively.  sp is the TIO locator
+**     s', in radians, which positions the Terrestrial Intermediate
+**     Origin on the equator.  For many applications, xp, yp and
+**     (especially) sp can be set to zero.
+**
+**  3) If theta is Greenwich apparent sidereal time instead of Earth
+**     rotation angle, the result is with respect to the true equator
+**     and equinox of date, i.e. with the x-axis at the equinox rather
+**     than the celestial intermediate origin.
 **
-**  2) The argument dtr represents the quasi-periodic component of the
-**     GR transformation between TT and TCB.  It is dependent upon the
-**     adopted solar-system ephemeris, and can be obtained by numerical
-**     integration, by interrogating a precomputed time ephemeris or by
-**     evaluating a model such as that implemented in the SOFA function
-**     iauDtdb.   The quantity is dominated by an annual term of 1.7 ms
-**     amplitude.
+**  4) The velocity units are meters per UT1 second, not per SI second.
+**     This is unlikely to have any practical consequences in the modern
+**     era.
 **
-**  3) TDB is essentially the same as Teph, the time argument for the
-**     JPL solar system ephemerides.
+**  5) No validation is performed on the arguments.  Error cases that
+**     could lead to arithmetic exceptions are trapped by the iauGd2gc
+**     function, and the result set to zeros.
 **
 **  References:
 **
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**     IAU 2006 Resolution 3
+**     Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
+**     the Astronomical Almanac, 3rd ed., University Science Books
+**     (2013), Section 7.4.3.3.
 **
-**  This revision:  2011 May 14
+**  Called:
+**     iauGd2gc     geodetic to geocentric transformation
+**     iauPom00     polar motion matrix
+**     iauTrxp      product of transpose of r-matrix and p-vector
 **
-**  SOFA release 2012-03-01
+**  This revision:   2013 October 9
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  SOFA release 2013-12-02
 **
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
-   double dtrd;
+/* Earth rotation rate in radians per UT1 second */
+   const double OM = 1.00273781191135448 * D2PI / DAYSEC;
+
+   double xyzm[3], rpm[3][3], xyz[3], x, y, z, s, c;
+
 
+/* Geodetic to geocentric transformation (WGS84). */
+   (void) iauGd2gc(1, elong, phi, hm, xyzm);
 
-/* Result, safeguarding precision. */
-   dtrd = dtr / DAYSEC;
-   if ( tdb1 > tdb2 ) {
-      *tt1 = tdb1;
-      *tt2 = tdb2 - dtrd;
-   } else {
-      *tt1 = tdb1 - dtrd;
-      *tt2 = tdb2;
-   }
+/* Polar motion and TIO position. */
+   iauPom00(xp, yp, sp, rpm);
+   iauTrxp(rpm, xyzm, xyz);
+   x = xyz[0];
+   y = xyz[1];
+   z = xyz[2];
 
-/* Status (always OK). */
-   return 0;
+/* Functions of ERA. */
+   s = sin(theta);
+   c = cos(theta);
+
+/* Position. */
+   pv[0][0] = c*x - s*y;
+   pv[0][1] = s*x + c*y;
+   pv[0][2] = z;
+
+/* Velocity. */
+   pv[1][0] = OM * ( -s*x - c*y );
+   pv[1][1] = OM * (  c*x - s*y );
+   pv[1][2] = 0.0;
+
+/* Finished. */
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
@@ -169,4 +200,5 @@ int iauTdbtt(double tdb1, double tdb2, double dtr,
 **                 United Kingdom
 **
 **--------------------------------------------------------------------*/
+
 }
diff --git a/20120301_a/c/src/pvu.c b/20131202/c/src/pvu.c
similarity index 96%
rename from 20120301_a/c/src/pvu.c
rename to 20131202/c/src/pvu.c
index d6f5811..c7d8989 100644
--- a/20120301_a/c/src/pvu.c
+++ b/20131202/c/src/pvu.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvu(double dt, double pv[2][3], double upv[2][3])
 /*
@@ -33,11 +33,11 @@ void iauPvu(double dt, double pv[2][3], double upv[2][3])
 **     iauPpsp      p-vector plus scaled p-vector
 **     iauCp        copy p-vector
 **
-**  This revision:  2008 November 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauPpsp(pv[0], dt, pv[1], upv[0]);
@@ -47,7 +47,7 @@ void iauPvu(double dt, double pv[2][3], double upv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvup.c b/20131202/c/src/pvup.c
similarity index 96%
rename from 20120301_a/c/src/pvup.c
rename to 20131202/c/src/pvup.c
index e9b3137..a72c080 100644
--- a/20120301_a/c/src/pvup.c
+++ b/20131202/c/src/pvup.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvup(double dt, double pv[2][3], double p[3])
 /*
@@ -27,11 +27,11 @@ void iauPvup(double dt, double pv[2][3], double p[3])
 **
 **  2) The time units of dt must match those of the velocity.
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    p[0] = pv[0][0] + dt * pv[1][0];
@@ -42,7 +42,7 @@ void iauPvup(double dt, double pv[2][3], double p[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pvxpv.c b/20131202/c/src/pvxpv.c
similarity index 97%
rename from 20120301_a/c/src/pvxpv.c
rename to 20131202/c/src/pvxpv.c
index 7b17208..63f999d 100644
--- a/20120301_a/c/src/pvxpv.c
+++ b/20131202/c/src/pvxpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPvxpv(double a[2][3], double b[2][3], double axb[2][3])
 /*
@@ -35,11 +35,11 @@ void iauPvxpv(double a[2][3], double b[2][3], double axb[2][3])
 **     iauPxp       vector product of two p-vectors
 **     iauPpp       p-vector plus p-vector
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double wa[2][3], wb[2][3], axbd[3], adxb[3];
@@ -61,7 +61,7 @@ void iauPvxpv(double a[2][3], double b[2][3], double axb[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/pxp.c b/20131202/c/src/pxp.c
similarity index 96%
rename from 20120301_a/c/src/pxp.c
rename to 20131202/c/src/pxp.c
index b0a70b9..88dcfd2 100644
--- a/20120301_a/c/src/pxp.c
+++ b/20131202/c/src/pxp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauPxp(double a[3], double b[3], double axb[3])
 /*
@@ -24,11 +24,11 @@ void iauPxp(double a[3], double b[3], double axb[3])
 **     It is permissible to re-use the same array for any of the
 **     arguments.
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double xa, ya, za, xb, yb, zb;
@@ -48,7 +48,7 @@ void iauPxp(double a[3], double b[3], double axb[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20131202/c/src/refco.c b/20131202/c/src/refco.c
new file mode 100644
index 0000000..af0247e
--- /dev/null
+++ b/20131202/c/src/refco.c
@@ -0,0 +1,304 @@
+#include "sofa.h"
+
+void iauRefco(double phpa, double tc, double rh, double wl,
+              double *refa, double *refb)
+/*
+**  - - - - - - - - -
+**   i a u R e f c o
+**  - - - - - - - - -
+**
+**  Determine the constants A and B in the atmospheric refraction model
+**  dZ = A tan Z + B tan^3 Z.
+**
+**  Z is the "observed" zenith distance (i.e. affected by refraction)
+**  and dZ is what to add to Z to give the "topocentric" (i.e. in vacuo)
+**  zenith distance.
+**
+**  This function is part of the International Astronomical Union's
+**  SOFA (Standards of Fundamental Astronomy) software collection.
+**
+**  Status:  support function.
+**
+**  Given:
+**    phpa   double    pressure at the observer (hPa = millibar)
+**    tc     double    ambient temperature at the observer (deg C)
+**    rh     double    relative humidity at the observer (range 0-1)
+**    wl     double    wavelength (micrometers)
+**
+**  Returned:
+**    refa   double*   tan Z coefficient (radians)
+**    refb   double*   tan^3 Z coefficient (radians)
+**
+**  Notes:
+**
+**  1) The model balances speed and accuracy to give good results in
+**     applications where performance at low altitudes is not paramount.
+**     Performance is maintained across a range of conditions, and
+**     applies to both optical/IR and radio.
+**
+**  2) The model omits the effects of (i) height above sea level (apart
+**     from the reduced pressure itself), (ii) latitude (i.e. the
+**     flattening of the Earth), (iii) variations in tropospheric lapse
+**     rate and (iv) dispersive effects in the radio.
+**
+**     The model was tested using the following range of conditions:
+**
+**       lapse rates 0.0055, 0.0065, 0.0075 deg/meter
+**       latitudes 0, 25, 50, 75 degrees
+**       heights 0, 2500, 5000 meters ASL
+**       pressures mean for height -10% to +5% in steps of 5%
+**       temperatures -10 deg to +20 deg with respect to 280 deg at SL
+**       relative humidity 0, 0.5, 1
+**       wavelengths 0.4, 0.6, ... 2 micron, + radio
+**       zenith distances 15, 45, 75 degrees
+**
+**     The accuracy with respect to raytracing through a model
+**     atmosphere was as follows:
+**
+**                            worst         RMS
+**
+**       optical/IR           62 mas       8 mas
+**       radio               319 mas      49 mas
+**
+**     For this particular set of conditions:
+**
+**       lapse rate 0.0065 K/meter
+**       latitude 50 degrees
+**       sea level
+**       pressure 1005 mb
+**       temperature 280.15 K
+**       humidity 80%
+**       wavelength 5740 Angstroms
+**
+**     the results were as follows:
+**
+**       ZD       raytrace     iauRefco   Saastamoinen
+**
+**       10         10.27        10.27        10.27
+**       20         21.19        21.20        21.19
+**       30         33.61        33.61        33.60
+**       40         48.82        48.83        48.81
+**       45         58.16        58.18        58.16
+**       50         69.28        69.30        69.27
+**       55         82.97        82.99        82.95
+**       60        100.51       100.54       100.50
+**       65        124.23       124.26       124.20
+**       70        158.63       158.68       158.61
+**       72        177.32       177.37       177.31
+**       74        200.35       200.38       200.32
+**       76        229.45       229.43       229.42
+**       78        267.44       267.29       267.41
+**       80        319.13       318.55       319.10
+**
+**      deg        arcsec       arcsec       arcsec
+**
+**     The values for Saastamoinen's formula (which includes terms
+**     up to tan^5) are taken from Hohenkerk and Sinclair (1985).
+**
+**  3) A wl value in the range 0-100 selects the optical/IR case and is
+**     wavelength in micrometers.  Any value outside this range selects
+**     the radio case.
+**
+**  4) Outlandish input parameters are silently limited to
+**     mathematically safe values.  Zero pressure is permissible, and
+**     causes zeroes to be returned.
+**
+**  5) The algorithm draws on several sources, as follows:
+**
+**     a) The formula for the saturation vapour pressure of water as
+**        a function of temperature and temperature is taken from
+**        Equations (A4.5-A4.7) of Gill (1982).
+**
+**     b) The formula for the water vapour pressure, given the
+**        saturation pressure and the relative humidity, is from
+**        Crane (1976), Equation (2.5.5).
+**
+**     c) The refractivity of air is a function of temperature,
+**        total pressure, water-vapour pressure and, in the case
+**        of optical/IR, wavelength.  The formulae for the two cases are
+**        developed from Hohenkerk & Sinclair (1985) and Rueger (2002).
+**
+**     d) The formula for beta, the ratio of the scale height of the
+**        atmosphere to the geocentric distance of the observer, is
+**        an adaption of Equation (9) from Stone (1996).  The
+**        adaptations, arrived at empirically, consist of (i) a small
+**        adjustment to the coefficient and (ii) a humidity term for the
+**        radio case only.
+**
+**     e) The formulae for the refraction constants as a function of
+**        n-1 and beta are from Green (1987), Equation (4.31).
+**
+**  References:
+**
+**     Crane, R.K., Meeks, M.L. (ed), "Refraction Effects in the Neutral
+**     Atmosphere", Methods of Experimental Physics: Astrophysics 12B,
+**     Academic Press, 1976.
+**
+**     Gill, Adrian E., "Atmosphere-Ocean Dynamics", Academic Press,
+**     1982.
+**
+**     Green, R.M., "Spherical Astronomy", Cambridge University Press,
+**     1987.
+**
+**     Hohenkerk, C.Y., & Sinclair, A.T., NAO Technical Note No. 63,
+**     1985.
+**
+**     Rueger, J.M., "Refractive Index Formulae for Electronic Distance
+**     Measurement with Radio and Millimetre Waves", in Unisurv Report
+**     S-68, School of Surveying and Spatial Information Systems,
+**     University of New South Wales, Sydney, Australia, 2002.
+**
+**     Stone, Ronald C., P.A.S.P. 108, 1051-1058, 1996.
+**
+**  This revision:   2013 October 9
+**
+**  SOFA release 2013-12-02
+**
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
+*/
+{
+   int optic;
+   double p, t, r, w, ps, pw, tk, wlsq, gamma, beta;
+
+
+/* Decide whether optical/IR or radio case:  switch at 100 microns. */
+   optic = ( wl <= 100.0 );
+
+/* Restrict parameters to safe values. */
+   t = gmax ( tc, -150.0 );
+   t = gmin ( t, 200.0 );
+   p = gmax ( phpa, 0.0 );
+   p = gmin ( p, 10000.0 );
+   r = gmax ( rh, 0.0 );
+   r = gmin ( r, 1.0 );
+   w = gmax ( wl, 0.1 );
+   w = gmin ( w, 1e6 );
+
+/* Water vapour pressure at the observer. */
+   if ( p > 0.0 ) {
+      ps = pow ( 10.0, ( 0.7859 + 0.03477*t ) /
+                          ( 1.0 + 0.00412*t ) ) *
+                 ( 1.0 + p * ( 4.5e-6 + 6e-10*t*t )  );
+      pw = r * ps / ( 1.0 - (1.0-r)*ps/p );
+   } else {
+      pw = 0.0;
+   }
+
+/* Refractive index minus 1 at the observer. */
+   tk = t + 273.15;
+   if ( optic ) {
+      wlsq = w * w;
+      gamma = ( ( 77.53484e-6 +
+                 ( 4.39108e-7 + 3.666e-9/wlsq ) / wlsq ) * p
+                    - 11.2684e-6*pw ) / tk;
+   } else {
+      gamma = ( 77.6890e-6*p - ( 6.3938e-6 - 0.375463/tk ) * pw ) / tk;
+   }
+
+/* Formula for beta from Stone, with empirical adjustments. */
+   beta = 4.4474e-6 * tk;
+   if ( ! optic ) beta -= 0.0074 * pw * beta;
+
+/* Refraction constants from Green. */
+   *refa = gamma * ( 1.0 - beta );
+   *refb = - gamma * ( beta - gamma / 2.0 );
+
+/* Finished. */
+
+/*----------------------------------------------------------------------
+**
+**  Copyright (C) 2013
+**  Standards Of Fundamental Astronomy Board
+**  of the International Astronomical Union.
+**
+**  =====================
+**  SOFA Software License
+**  =====================
+**
+**  NOTICE TO USER:
+**
+**  BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
+**  CONDITIONS WHICH APPLY TO ITS USE.
+**
+**  1. The Software is owned by the IAU SOFA Board ("SOFA").
+**
+**  2. Permission is granted to anyone to use the SOFA software for any
+**     purpose, including commercial applications, free of charge and
+**     without payment of royalties, subject to the conditions and
+**     restrictions listed below.
+**
+**  3. You (the user) may copy and distribute SOFA source code to others,
+**     and use and adapt its code and algorithms in your own software,
+**     on a world-wide, royalty-free basis.  That portion of your
+**     distribution that does not consist of intact and unchanged copies
+**     of SOFA source code files is a "derived work" that must comply
+**     with the following requirements:
+**
+**     a) Your work shall be marked or carry a statement that it
+**        (i) uses routines and computations derived by you from
+**        software provided by SOFA under license to you; and
+**        (ii) does not itself constitute software provided by and/or
+**        endorsed by SOFA.
+**
+**     b) The source code of your derived work must contain descriptions
+**        of how the derived work is based upon, contains and/or differs
+**        from the original SOFA software.
+**
+**     c) The names of all routines in your derived work shall not
+**        include the prefix "iau" or "sofa" or trivial modifications
+**        thereof such as changes of case.
+**
+**     d) The origin of the SOFA components of your derived work must
+**        not be misrepresented;  you must not claim that you wrote the
+**        original software, nor file a patent application for SOFA
+**        software or algorithms embedded in the SOFA software.
+**
+**     e) These requirements must be reproduced intact in any source
+**        distribution and shall apply to anyone to whom you have
+**        granted a further right to modify the source code of your
+**        derived work.
+**
+**     Note that, as originally distributed, the SOFA software is
+**     intended to be a definitive implementation of the IAU standards,
+**     and consequently third-party modifications are discouraged.  All
+**     variations, no matter how minor, must be explicitly marked as
+**     such, as explained above.
+**
+**  4. You shall not cause the SOFA software to be brought into
+**     disrepute, either by misuse, or use for inappropriate tasks, or
+**     by inappropriate modification.
+**
+**  5. The SOFA software is provided "as is" and SOFA makes no warranty
+**     as to its use or performance.   SOFA does not and cannot warrant
+**     the performance or results which the user may obtain by using the
+**     SOFA software.  SOFA makes no warranties, express or implied, as
+**     to non-infringement of third party rights, merchantability, or
+**     fitness for any particular purpose.  In no event will SOFA be
+**     liable to the user for any consequential, incidental, or special
+**     damages, including any lost profits or lost savings, even if a
+**     SOFA representative has been advised of such damages, or for any
+**     claim by any third party.
+**
+**  6. The provision of any version of the SOFA software under the terms
+**     and conditions specified herein does not imply that future
+**     versions will also be made available under the same terms and
+**     conditions.
+*
+**  In any published work or commercial product which uses the SOFA
+**  software directly, acknowledgement (see www.iausofa.org) is
+**  appreciated.
+**
+**  Correspondence concerning SOFA software should be addressed as
+**  follows:
+**
+**      By email:  sofa at ukho.gov.uk
+**      By post:   IAU SOFA Center
+**                 HM Nautical Almanac Office
+**                 UK Hydrographic Office
+**                 Admiralty Way, Taunton
+**                 Somerset, TA1 2DN
+**                 United Kingdom
+**
+**--------------------------------------------------------------------*/
+
+}
diff --git a/20120301_a/c/src/rm2v.c b/20131202/c/src/rm2v.c
similarity index 97%
rename from 20120301_a/c/src/rm2v.c
rename to 20131202/c/src/rm2v.c
index 839c5a1..8a689cd 100644
--- a/20120301_a/c/src/rm2v.c
+++ b/20131202/c/src/rm2v.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRm2v(double r[3][3], double w[3])
 /*
@@ -34,11 +34,11 @@ void iauRm2v(double r[3][3], double w[3])
 **  3) The reference frame rotates clockwise as seen looking along
 **     the rotation vector from the origin.
 **
-**  This revision:  2010 August 27
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, y, z, s2, c2, phi, f;
@@ -65,7 +65,7 @@ void iauRm2v(double r[3][3], double w[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/rv2m.c b/20131202/c/src/rv2m.c
similarity index 97%
rename from 20120301_a/c/src/rv2m.c
rename to 20131202/c/src/rv2m.c
index ae39fb7..088ea86 100644
--- a/20120301_a/c/src/rv2m.c
+++ b/20131202/c/src/rv2m.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRv2m(double w[3], double r[3][3])
 /*
@@ -31,11 +31,11 @@ void iauRv2m(double w[3], double r[3][3])
 **  3) The reference frame rotates clockwise as seen looking along the
 **     rotation vector from the origin.
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double x, y, z, phi, s, c, f;
@@ -72,7 +72,7 @@ void iauRv2m(double w[3], double r[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/rx.c b/20131202/c/src/rx.c
similarity index 97%
rename from 20120301_a/c/src/rx.c
rename to 20131202/c/src/rx.c
index 7803d4b..8bbfff9 100644
--- a/20120301_a/c/src/rx.c
+++ b/20131202/c/src/rx.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRx(double phi, double r[3][3])
 /*
@@ -33,11 +33,11 @@ void iauRx(double phi, double r[3][3])
 **         (                               )
 **         (  0   - sin(phi)   + cos(phi)  )
 **
-**  This revision:  2012 April 3
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double s, c, a10, a11, a12, a20, a21, a22;
@@ -64,7 +64,7 @@ void iauRx(double phi, double r[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/rxp.c b/20131202/c/src/rxp.c
similarity index 96%
rename from 20120301_a/c/src/rxp.c
rename to 20131202/c/src/rxp.c
index bb43c3c..300550c 100644
--- a/20120301_a/c/src/rxp.c
+++ b/20131202/c/src/rxp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRxp(double r[3][3], double p[3], double rp[3])
 /*
@@ -26,11 +26,11 @@ void iauRxp(double r[3][3], double p[3], double rp[3])
 **  Called:
 **     iauCp        copy p-vector
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double w, wrp[3];
@@ -53,7 +53,7 @@ void iauRxp(double r[3][3], double p[3], double rp[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/rxpv.c b/20131202/c/src/rxpv.c
similarity index 96%
rename from 20120301_a/c/src/rxpv.c
rename to 20131202/c/src/rxpv.c
index cae5664..e0d9cd6 100644
--- a/20120301_a/c/src/rxpv.c
+++ b/20131202/c/src/rxpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRxpv(double r[3][3], double pv[2][3], double rpv[2][3])
 /*
@@ -26,11 +26,11 @@ void iauRxpv(double r[3][3], double pv[2][3], double rpv[2][3])
 **  Called:
 **     iauRxp       product of r-matrix and p-vector
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauRxp(r, pv[0], rpv[0]);
@@ -40,7 +40,7 @@ void iauRxpv(double r[3][3], double pv[2][3], double rpv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/rxr.c b/20131202/c/src/rxr.c
similarity index 96%
rename from 20120301_a/c/src/rxr.c
rename to 20131202/c/src/rxr.c
index ba93540..21684bd 100644
--- a/20120301_a/c/src/rxr.c
+++ b/20131202/c/src/rxr.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRxr(double a[3][3], double b[3][3], double atb[3][3])
 /*
@@ -27,11 +27,11 @@ void iauRxr(double a[3][3], double b[3][3], double atb[3][3])
 **  Called:
 **     iauCr        copy r-matrix
 **
-**  This revision:  2008 November 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int i, j, k;
@@ -53,7 +53,7 @@ void iauRxr(double a[3][3], double b[3][3], double atb[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ry.c b/20131202/c/src/ry.c
similarity index 97%
rename from 20120301_a/c/src/ry.c
rename to 20131202/c/src/ry.c
index 19734ec..a4b1ff9 100644
--- a/20120301_a/c/src/ry.c
+++ b/20131202/c/src/ry.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRy(double theta, double r[3][3])
 /*
@@ -33,11 +33,11 @@ void iauRy(double theta, double r[3][3])
 **         (                                        )
 **         (  + sin(theta)     0      + cos(theta)  )
 **
-**  This revision:  2012 April 3
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double s, c, a00, a01, a02, a20, a21, a22;
@@ -64,7 +64,7 @@ void iauRy(double theta, double r[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/rz.c b/20131202/c/src/rz.c
similarity index 97%
rename from 20120301_a/c/src/rz.c
rename to 20131202/c/src/rz.c
index 1a6122a..9baa6ae 100644
--- a/20120301_a/c/src/rz.c
+++ b/20131202/c/src/rz.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauRz(double psi, double r[3][3])
 /*
@@ -33,11 +33,11 @@ void iauRz(double psi, double r[3][3])
 **         (                                 )
 **         (       0            0         1  )
 **
-**  This revision:  2012 April 3
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double s, c, a00, a01, a02, a10, a11, a12;
@@ -64,7 +64,7 @@ void iauRz(double psi, double r[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s00.c b/20131202/c/src/s00.c
similarity index 98%
rename from 20120301_a/c/src/s00.c
rename to 20131202/c/src/s00.c
index 47b7ad9..41a19ef 100644
--- a/20120301_a/c/src/s00.c
+++ b/20131202/c/src/s00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauS00(double date1, double date2, double x, double y)
 /*
@@ -81,11 +81,11 @@ double iauS00(double date1, double date2, double x, double y)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Time since J2000.0, in Julian centuries */
@@ -325,7 +325,7 @@ double iauS00(double date1, double date2, double x, double y)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s00a.c b/20131202/c/src/s00a.c
similarity index 95%
rename from 20120301_a/c/src/s00a.c
rename to 20131202/c/src/s00a.c
index c4162c4..a0a6254 100644
--- a/20120301_a/c/src/s00a.c
+++ b/20131202/c/src/s00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauS00a(double date1, double date2)
 /*
@@ -57,9 +57,9 @@ double iauS00a(double date1, double date2)
 **     instead the IAU 2000B truncated model.
 **
 **  Called:
-**     iauPnm00a     classical NPB matrix, IAU 2000A
-**     iauBnp2xy     extract CIP X,Y from the BPN matrix
-**     iauS00        the CIO locator s, given X,Y, IAU 2000A
+**     iauPnm00a    classical NPB matrix, IAU 2000A
+**     iauBnp2xy    extract CIP X,Y from the BPN matrix
+**     iauS00       the CIO locator s, given X,Y, IAU 2000A
 **
 **  References:
 **
@@ -74,11 +74,11 @@ double iauS00a(double date1, double date2)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3], x, y, s;
@@ -97,7 +97,7 @@ double iauS00a(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s00b.c b/20131202/c/src/s00b.c
similarity index 95%
rename from 20120301_a/c/src/s00b.c
rename to 20131202/c/src/s00b.c
index 8293b8f..8a3ff58 100644
--- a/20120301_a/c/src/s00b.c
+++ b/20131202/c/src/s00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauS00b(double date1, double date2)
 /*
@@ -57,9 +57,9 @@ double iauS00b(double date1, double date2)
 **     accuracy and at some cost in speed.
 **
 **  Called:
-**     iauPnm00b     classical NPB matrix, IAU 2000B
-**     iauBnp2xy     extract CIP X,Y from the BPN matrix
-**     iauS00        the CIO locator s, given X,Y, IAU 2000A
+**     iauPnm00b    classical NPB matrix, IAU 2000B
+**     iauBnp2xy    extract CIP X,Y from the BPN matrix
+**     iauS00       the CIO locator s, given X,Y, IAU 2000A
 **
 **  References:
 **
@@ -74,11 +74,11 @@ double iauS00b(double date1, double date2)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3], x, y, s;
@@ -97,7 +97,7 @@ double iauS00b(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s06.c b/20131202/c/src/s06.c
similarity index 98%
rename from 20120301_a/c/src/s06.c
rename to 20131202/c/src/s06.c
index 68d43d2..c781ee4 100644
--- a/20120301_a/c/src/s06.c
+++ b/20131202/c/src/s06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauS06(double date1, double date2, double x, double y)
 /*
@@ -78,11 +78,11 @@ double iauS06(double date1, double date2, double x, double y)
 **     McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG
 **
-**  This revision:  2009 December 17
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Time since J2000.0, in Julian centuries */
@@ -322,7 +322,7 @@ double iauS06(double date1, double date2, double x, double y)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s06a.c b/20131202/c/src/s06a.c
similarity index 97%
rename from 20120301_a/c/src/s06a.c
rename to 20131202/c/src/s06a.c
index 3b209bf..d04d6f6 100644
--- a/20120301_a/c/src/s06a.c
+++ b/20131202/c/src/s06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauS06a(double date1, double date2)
 /*
@@ -76,11 +76,11 @@ double iauS06a(double date1, double date2)
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2010 January 18
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rnpb[3][3], x, y, s;
@@ -99,7 +99,7 @@ double iauS06a(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s2c.c b/20131202/c/src/s2c.c
similarity index 96%
rename from 20120301_a/c/src/s2c.c
rename to 20131202/c/src/s2c.c
index 535756f..3bbc81d 100644
--- a/20120301_a/c/src/s2c.c
+++ b/20131202/c/src/s2c.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauS2c(double theta, double phi, double c[3])
 /*
@@ -20,11 +20,11 @@ void iauS2c(double theta, double phi, double c[3])
 **  Returned:
 **     c        double[3]    direction cosines
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double cp;
@@ -39,7 +39,7 @@ void iauS2c(double theta, double phi, double c[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s2p.c b/20131202/c/src/s2p.c
similarity index 96%
rename from 20120301_a/c/src/s2p.c
rename to 20131202/c/src/s2p.c
index 0abb56c..6d1cfd4 100644
--- a/20120301_a/c/src/s2p.c
+++ b/20131202/c/src/s2p.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauS2p(double theta, double phi, double r, double p[3])
 /*
@@ -25,11 +25,11 @@ void iauS2p(double theta, double phi, double r, double p[3])
 **     iauS2c       spherical coordinates to unit vector
 **     iauSxp       multiply p-vector by scalar
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double u[3];
@@ -42,7 +42,7 @@ void iauS2p(double theta, double phi, double r, double p[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s2pv.c b/20131202/c/src/s2pv.c
similarity index 97%
rename from 20120301_a/c/src/s2pv.c
rename to 20131202/c/src/s2pv.c
index 2f20a04..611eb5f 100644
--- a/20120301_a/c/src/s2pv.c
+++ b/20131202/c/src/s2pv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauS2pv(double theta, double phi, double r,
              double td, double pd, double rd,
@@ -26,11 +26,11 @@ void iauS2pv(double theta, double phi, double r,
 **  Returned:
 **     pv       double[2][3]    pv-vector
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double st, ct, sp, cp, rcp, x, y, rpd, w;
@@ -57,7 +57,7 @@ void iauS2pv(double theta, double phi, double r,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/s2xpv.c b/20131202/c/src/s2xpv.c
similarity index 96%
rename from 20120301_a/c/src/s2xpv.c
rename to 20131202/c/src/s2xpv.c
index a2577e5..280cfb5 100644
--- a/20120301_a/c/src/s2xpv.c
+++ b/20131202/c/src/s2xpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauS2xpv(double s1, double s2, double pv[2][3], double spv[2][3])
 /*
@@ -27,11 +27,11 @@ void iauS2xpv(double s1, double s2, double pv[2][3], double spv[2][3])
 **  Called:
 **     iauSxp       multiply p-vector by scalar
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauSxp(s1, pv[0], spv[0]);
@@ -41,7 +41,7 @@ void iauS2xpv(double s1, double s2, double pv[2][3], double spv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/sepp.c b/20131202/c/src/sepp.c
similarity index 97%
rename from 20120301_a/c/src/sepp.c
rename to 20131202/c/src/sepp.c
index 4bee435..513da29 100644
--- a/20120301_a/c/src/sepp.c
+++ b/20131202/c/src/sepp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauSepp(double a[3], double b[3])
 /*
@@ -35,11 +35,11 @@ double iauSepp(double a[3], double b[3])
 **     iauPm        modulus of p-vector
 **     iauPdp       scalar product of two p-vectors
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double axb[3], ss, cs, s;
@@ -59,7 +59,7 @@ double iauSepp(double a[3], double b[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/seps.c b/20131202/c/src/seps.c
similarity index 97%
rename from 20120301_a/c/src/seps.c
rename to 20131202/c/src/seps.c
index 839e9f9..d35b3a1 100644
--- a/20120301_a/c/src/seps.c
+++ b/20131202/c/src/seps.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauSeps(double al, double ap, double bl, double bp)
 /*
@@ -26,11 +26,11 @@ double iauSeps(double al, double ap, double bl, double bp)
 **     iauS2c       spherical coordinates to unit vector
 **     iauSepp      angular separation between two p-vectors
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double ac[3], bc[3], s;
@@ -47,7 +47,7 @@ double iauSeps(double al, double ap, double bl, double bp)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/sofa.h b/20131202/c/src/sofa.h
similarity index 76%
rename from 20120301_a/c/src/sofa.h
rename to 20131202/c/src/sofa.h
index 43e08dc..9d0087c 100644
--- a/20120301_a/c/src/sofa.h
+++ b/20131202/c/src/sofa.h
@@ -11,13 +11,14 @@
 **  This file is part of the International Astronomical Union's
 **  SOFA (Standards Of Fundamental Astronomy) software collection.
 **
-**  This revision:   2012 February 23
+**  This revision:   2013 August 22
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 
+#include "sofam.h"
 #include "math.h"
 
 #ifdef __cplusplus
@@ -34,6 +35,112 @@ int iauJd2cal(double dj1, double dj2,
                      int *iy, int *im, int *id, double *fd);
 int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4]);
 
+/* Astronomy/Astrometry */
+void iauAb(double pnat[3], double v[3], double s, double bm1,
+           double ppr[3]);
+void iauApcg(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             iauASTROM *astrom);
+void iauApcg13(double date1, double date2, iauASTROM *astrom);
+void iauApci(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             double x, double y, double s,
+             iauASTROM *astrom);
+void iauApci13(double date1, double date2,
+               iauASTROM *astrom, double *eo);
+void iauApco(double date1, double date2,
+             double ebpv[2][3], double ehp[3],
+             double x, double y, double s, double theta,
+             double elong, double phi, double hm,
+             double xp, double yp, double sp,
+             double refa, double refb,
+             iauASTROM *astrom);
+int iauApco13(double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tk, double rh, double wl,
+              iauASTROM *astrom, double *eo);
+void iauApcs(double date1, double date2, double pv[2][3],
+             double ebpv[2][3], double ehp[3],
+             iauASTROM *astrom);
+void iauApcs13(double date1, double date2, double pv[2][3],
+               iauASTROM *astrom);
+void iauAper(double theta, iauASTROM *astrom);
+void iauAper13(double ut11, double ut12, iauASTROM *astrom);
+void iauApio(double sp, double theta,
+             double elong, double phi, double hm, double xp, double yp,
+             double refa, double refb,
+             iauASTROM *astrom);
+int iauApio13(double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tk, double rh, double wl,
+              iauASTROM *astrom);
+void iauAtci13(double rc, double dc,
+               double pr, double pd, double px, double rv,
+               double date1, double date2,
+               double *ri, double *di, double *eo);
+void iauAtciq(double rc, double dc, double pr, double pd,
+              double px, double rv, iauASTROM *astrom,
+              double *ri, double *di);
+void iauAtciqn(double rc, double dc, double pr, double pd,
+               double px, double rv, iauASTROM *astrom,
+               int n, iauLDBODY b[], double *ri, double *di);
+void iauAtciqz(double rc, double dc, iauASTROM *astrom,
+               double *ri, double *di);
+int iauAtco13(double rc, double dc,
+              double pr, double pd, double px, double rv,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tk, double rh, double wl,
+              double *aob, double *zob, double *hob,
+              double *dob, double *rob, double *eo);
+void iauAtic13(double ri, double di,
+               double date1, double date2,
+               double *rc, double *dc, double *eo);
+void iauAticq(double ri, double di, iauASTROM *astrom,
+              double *rc, double *dc);
+void iauAticqn(double ri, double di, iauASTROM *astrom,
+               int n, iauLDBODY b[], double *rc, double *dc);
+int iauAtio13(double ri, double di,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tk, double rh, double wl,
+              double *aob, double *zob, double *hob,
+              double *dob, double *rob);
+void iauAtioq(double ri, double di, iauASTROM *astrom,
+              double *aob, double *zob,
+              double *hob, double *dob, double *rob);
+int iauAtoc13(const char *type, double ob1, double ob2,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tk, double rh, double wl,
+              double *rc, double *dc);
+int iauAtoi13(const char *type, double ob1, double ob2,
+              double utc1, double utc2, double dut1,
+              double elong, double phi, double hm, double xp, double yp,
+              double phpa, double tk, double rh, double wl,
+              double *ri, double *di);
+void iauAtoiq(const char *type,
+              double ob1, double ob2, iauASTROM *astrom,
+              double *ri, double *di);
+void iauLd(double bm, double p[3], double q[3], double e[3],
+           double em, double dlim, double p1[3]);
+void iauLdn(int n, iauLDBODY b[], double ob[3], double sc[3],
+            double sn[3]);
+void iauLdsun(double p[3], double e[3], double em, double p1[3]);
+void iauPmpx(double rc, double dc, double pr, double pd,
+             double px, double rv, double pmt, double vob[3],
+             double pco[3]);
+int iauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
+              double px1, double rv1,
+              double ep1a, double ep1b, double ep2a, double ep2b,
+              double *ra2, double *dec2, double *pmr2, double *pmd2,
+              double *px2, double *rv2);
+void iauPvtob(double elong, double phi, double hm,
+              double xp, double yp, double sp, double theta,
+              double pv[2][3]);
+void iauRefco(double phpa, double tk, double rh, double wl,
+              double *refa, double *refb);
+
 /* Astronomy/Ephemerides */
 int iauEpv00(double date1, double date2,
              double pvh[2][3], double pvb[2][3]);
@@ -177,6 +284,10 @@ double iauGst06a(double uta, double utb, double tta, double ttb);
 double iauGst94(double uta, double utb);
 
 /* Astronomy/SpaceMotion */
+int iauPmsafe(double ra1, double dec1, double pmr1, double pmd1,
+              double px1, double rv1, double ep1a, double ep1b,
+              double ep2a, double ep2b, double *ra2, double *dec2,
+              double *pmr2, double *pmd2, double *px2, double *rv2);
 int iauPvstar(double pv[2][3], double *ra, double *dec,
               double *pmr, double *pmd, double *px, double *rv);
 int iauStarpv(double ra, double dec,
@@ -203,7 +314,7 @@ int iauStarpm(double ra1, double dec1,
               double *ra2, double *dec2,
               double *pmr2, double *pmd2, double *px2, double *rv2);
 
-/* Astronomy/Geodetic/Geocentric */
+/* Astronomy/GeodeticGeocentric */
 int iauEform(int n, double *a, double *f);
 int iauGc2gd(int n, double xyz[3],
              double *elong, double *phi, double *height);
@@ -213,6 +324,8 @@ int iauGd2gc(int n, double elong, double phi, double height,
              double xyz[3]);
 int iauGd2gce(double a, double f,
               double elong, double phi, double height, double xyz[3]);
+void iauPvtob(double elong, double phi, double height, double xp,
+              double yp, double sp, double theta, double pv[2][3]);
 
 /* Astronomy/Timescales */
 int iauD2dtf(const char *scale, int ndp, double d1, double d2,
@@ -334,7 +447,7 @@ void iauSxpv(double s, double pv[2][3], double spv[2][3]);
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/sofam.h b/20131202/c/src/sofam.h
similarity index 74%
rename from 20120301_a/c/src/sofam.h
rename to 20131202/c/src/sofam.h
index a6fce72..3a52a89 100644
--- a/20120301_a/c/src/sofam.h
+++ b/20131202/c/src/sofam.h
@@ -13,17 +13,43 @@
 **
 **  Please note that the constants defined below are to be used only in
 **  the context of the SOFA software, and have no other official IAU
-**  status.
+**  status.  In addition, self consistency is not guaranteed.
 **
-**  This revision:   2012 February 23
+**  This revision:   2013 August 27
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 
-#include "sofa.h"
-
+/* Star-independent astrometry parameters */
+typedef struct {
+   double pmt;        /* PM time interval (SSB, Julian years) */
+   double eb[3];      /* SSB to observer (vector, au) */
+   double eh[3];      /* Sun to observer (unit vector) */
+   double em;         /* distance from Sun to observer (au) */
+   double v[3];       /* barycentric observer velocity (vector, c) */
+   double bm1;        /* sqrt(1-|v|^2): reciprocal of Lorenz factor */
+   double bpn[3][3];  /* bias-precession-nutation matrix */
+   double along;      /* longitude + s' + dERA(DUT) (radians) */
+   double phi;        /* geodetic latitude (radians) */
+   double xpl;        /* polar motion xp wrt local meridian (radians) */
+   double ypl;        /* polar motion yp wrt local meridian (radians) */
+   double sphi;       /* sine of geodetic latitude */
+   double cphi;       /* cosine of geodetic latitude */
+   double diurab;     /* magnitude of diurnal aberration vector */
+   double eral;       /* "local" Earth rotation angle (radians) */
+   double refa;       /* refraction constant A (radians) */
+   double refb;       /* refraction constant B (radians) */
+} iauASTROM;
+/* (Vectors eb, eh, em and v are all with respect to BCRS axes.) */
+
+/* Body parameters for light deflection */
+typedef struct {
+   double bm;         /* mass of the body (solar masses) */
+   double dl;         /* deflection limiter (radians^2/2) */
+   double pv[2][3];   /* barycentric PV of the body (au, au/day) */
+} iauLDBODY;
 
 /* Pi */
 #define DPI (3.141592653589793238462643)
@@ -31,6 +57,9 @@
 /* 2Pi */
 #define D2PI (6.283185307179586476925287)
 
+/* Radians to degrees */
+#define DR2D (57.29577951308232087679815)
+
 /* Degrees to radians */
 #define DD2R (1.745329251994329576923691e-2)
 
@@ -79,11 +108,17 @@
 /* TT minus TAI (s) */
 #define TTMTAI (32.184)
 
-/* AU (m) */
+/* Astronomical unit (m) */
 #define DAU (149597870e3)
 
+/* Speed of light (m/s) */
+#define CMPS 299792458.0
+
+/* Light time for 1 au (s) */
+#define AULT 499.004782
+
 /* Speed of light (AU per day) */
-#define DC (DAYSEC / 499.004782)
+#define DC (DAYSEC / AULT)
 
 /* L_G = 1 - d(TT)/d(TCG) */
 #define ELG (6.969290134e-10)
@@ -92,6 +127,10 @@
 #define ELB (1.550519768e-8)
 #define TDB0 (-6.55e-5)
 
+/* Schwarzschild radius of the Sun (au) */
+/* = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */
+#define SRS 1.97412574336e-8
+
 /* dint(A) - truncate to nearest whole number towards zero (double) */
 #define dint(A) ((A)<0.0?ceil(A):floor(A))
 
@@ -101,6 +140,12 @@
 /* dsign(A,B) - magnitude of A with sign of B (double) */
 #define dsign(A,B) ((B)<0.0?-fabs(A):fabs(A))
 
+/* max(A,B) - larger (most +ve) of two numbers (generic) */
+#define gmax(A,B) (((A)>(B))?(A):(B))
+
+/* min(A,B) - smaller (least +ve) of two numbers (generic) */
+#define gmin(A,B) (((A)<(B))?(A):(B))
+
 /* Reference ellipsoids */
 #define WGS84 1
 #define GRS80 2
@@ -110,7 +155,7 @@
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/sp00.c b/20131202/c/src/sp00.c
similarity index 97%
rename from 20120301_a/c/src/sp00.c
rename to 20131202/c/src/sp00.c
index 1c9e318..f1e49d8 100644
--- a/20120301_a/c/src/sp00.c
+++ b/20131202/c/src/sp00.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 double iauSp00(double date1, double date2)
 /*
@@ -52,11 +52,11 @@ double iauSp00(double date1, double date2)
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 24
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double t, sp;
@@ -72,7 +72,7 @@ double iauSp00(double date1, double date2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/starpm.c b/20131202/c/src/starpm.c
similarity index 97%
rename from 20120301_a/c/src/starpm.c
rename to 20131202/c/src/starpm.c
index ba9e4c3..892ed06 100644
--- a/20120301_a/c/src/starpm.c
+++ b/20131202/c/src/starpm.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauStarpm(double ra1, double dec1,
               double pmr1, double pmd1, double px1, double rv1,
@@ -97,7 +97,7 @@ int iauStarpm(double ra1, double dec1,
 **     this way, the status, initially zero, has 1 added to it.
 **
 **  7) If the space velocity is a significant fraction of c (see the
-**     constant VMAX in the function iauStarpv),  it is arbitrarily set
+**     constant VMAX in the function iauStarpv), it is arbitrarily set
 **     to zero.  When this action occurs, 2 is added to the status.
 **
 **  8) The relativistic adjustment carried out in the iauStarpv function
@@ -111,11 +111,11 @@ int iauStarpm(double ra1, double dec1,
 **     iauPdp       scalar product of two p-vectors
 **     iauPvstar    space motion pv-vector to star catalog data
 **
-**  This revision:  2008 May 16
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double pv1[2][3], tl1, dt, pv[2][3], r2, rdv, v2, c2mv2, tl2,
@@ -159,7 +159,7 @@ int iauStarpm(double ra1, double dec1,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/starpv.c b/20131202/c/src/starpv.c
similarity index 98%
rename from 20120301_a/c/src/starpv.c
rename to 20131202/c/src/starpv.c
index 696c01a..1436fb2 100644
--- a/20120301_a/c/src/starpv.c
+++ b/20131202/c/src/starpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauStarpv(double ra, double dec,
               double pmr, double pmd, double px, double rv,
@@ -118,11 +118,11 @@ int iauStarpv(double ra, double dec,
 **
 **     Stumpff, P., 1985, Astron.Astrophys. 144, 232-240.
 **
-**  This revision:  2009 July 6
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 /* Smallest allowed parallax */
@@ -218,7 +218,7 @@ int iauStarpv(double ra, double dec,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/sxp.c b/20131202/c/src/sxp.c
similarity index 96%
rename from 20120301_a/c/src/sxp.c
rename to 20131202/c/src/sxp.c
index f0f2862..2988470 100644
--- a/20120301_a/c/src/sxp.c
+++ b/20131202/c/src/sxp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauSxp(double s, double p[3], double sp[3])
 /*
@@ -23,11 +23,11 @@ void iauSxp(double s, double p[3], double sp[3])
 **  Note:
 **     It is permissible for p and sp to be the same array.
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    sp[0] = s * p[0];
@@ -38,7 +38,7 @@ void iauSxp(double s, double p[3], double sp[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/sxpv.c b/20131202/c/src/sxpv.c
similarity index 95%
rename from 20120301_a/c/src/sxpv.c
rename to 20131202/c/src/sxpv.c
index ae2b2bc..52013de 100644
--- a/20120301_a/c/src/sxpv.c
+++ b/20131202/c/src/sxpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauSxpv(double s, double pv[2][3], double spv[2][3])
 /*
@@ -21,16 +21,16 @@ void iauSxpv(double s, double pv[2][3], double spv[2][3])
 **     spv     double[2][3]    s * pv
 **
 **  Note:
-**     It is permissible for pv and psv to be the same array
+**     It is permissible for pv and spv to be the same array
 **
 **  Called:
 **     iauS2xpv     multiply pv-vector by two scalars
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 August 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauS2xpv(s, s, pv, spv);
@@ -39,7 +39,7 @@ void iauSxpv(double s, double pv[2][3], double spv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/t_sofa_c.c b/20131202/c/src/t_sofa_c.c
similarity index 67%
rename from 20120301_a/c/src/t_sofa_c.c
rename to 20131202/c/src/t_sofa_c.c
index 94b557b..cca834f 100644
--- a/20120301_a/c/src/t_sofa_c.c
+++ b/20131202/c/src/t_sofa_c.c
@@ -1,6 +1,5 @@
 #include <stdio.h>
-#include "sofa.h"
-#include "sofam.h"
+#include <sofa.h>
 
 static int verbose = 0;
 
@@ -18,11 +17,11 @@ static int verbose = 0;
 **
 **  All messages go to stdout.
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 November 7
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 
 static void viv(int ival, int ivalok,
@@ -43,9 +42,9 @@ static void viv(int ival, int ivalok,
 **     test     char[]       name of individual test
 **
 **  Given and returned:
-**     status   int          set to FALSE if test fails
+**     status   int          set to TRUE if test fails
 **
-**  This revision:  2012 February 12
+**  This revision:  2013 August 7
 */
 {
    if (ival != ivalok) {
@@ -56,7 +55,7 @@ static void viv(int ival, int ivalok,
       printf("%s passed: %s want %d got %d\n",
                     func, test, ivalok, ival);
    }
-   return;
+
 }
 
 static void vvd(double val, double valok, double dval,
@@ -78,9 +77,9 @@ static void vvd(double val, double valok, double dval,
 **     test     char[]       name of individual test
 **
 **  Given and returned:
-**     status   int          set to FALSE if test fails
+**     status   int          set to TRUE if test fails
 **
-**  This revision:  2012 February 12
+**  This revision:  2013 August 7
 */
 {
    double a, f;   /* absolute and fractional error */
@@ -96,7 +95,7 @@ static void vvd(double val, double valok, double dval,
       printf("%s passed: %s want %.20g got %.20g\n",
              func, test, valok, val);
    }
-   return;
+
 }
 
 static void t_a2af(int *status)
@@ -108,11 +107,11 @@ static void t_a2af(int *status)
 **  Test iauA2af function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauA2af, viv
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    int idmsf[4];
@@ -139,11 +138,11 @@ static void t_a2tf(int *status)
 **  Test iauA2tf function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauA2tf, viv
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    int ihmsf[4];
@@ -161,6 +160,42 @@ static void t_a2tf(int *status)
 
 }
 
+static void t_ab(int *status)
+/*
+**  - - - - -
+**   t _ a b
+**  - - - - -
+**
+**  Test iauAb function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAb, vvd
+**
+**  This revision:  2013 October 1
+*/
+{
+   double pnat[3], v[3], s, bm1, ppr[3];
+
+
+   pnat[0] = -0.76321968546737951;
+   pnat[1] = -0.60869453983060384;
+   pnat[2] = -0.21676408580639883;
+   v[0] =  2.1044018893653786e-5;
+   v[1] = -8.9108923304429319e-5;
+   v[2] = -3.8633714797716569e-5;
+   s = 0.99980921395708788;
+   bm1 = 0.99999999506209258;
+
+   iauAb(pnat, v, s, bm1, ppr);
+
+   vvd(ppr[0], -0.7631631094219556269, 1e-12, "iauAb", "1", status);
+   vvd(ppr[1], -0.6087553082505590832, 1e-12, "iauAb", "2", status);
+   vvd(ppr[2], -0.2167926269368471279, 1e-12, "iauAb", "3", status);
+
+}
+
 static void t_af2a(int *status)
 /*
 **  - - - - - - -
@@ -170,11 +205,11 @@ static void t_af2a(int *status)
 **  Test iauAf2a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauAf2a, viv
 **
-**  This revision:  2010 September 6
+**  This revision:  2013 August 7
 */
 {
    double a;
@@ -197,11 +232,11 @@ static void t_anp(int *status)
 **  Test iauAnp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauAnp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    vvd(iauAnp(-0.1), 6.183185307179586477, 1e-12, "iauAnp", "", status);
@@ -216,16 +251,1503 @@ static void t_anpm(int *status)
 **  Test iauAnpm function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauAnpm, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    vvd(iauAnpm(-4.0), 2.283185307179586477, 1e-12, "iauAnpm", "", status);
 }
 
+static void t_apcg(int *status)
+/*
+**  - - - - - - -
+**   t _ a p c g
+**  - - - - - - -
+**
+**  Test iauApcg function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApcg, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, ebpv[2][3], ehp[3];
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   ebpv[0][0] =  0.901310875;
+   ebpv[0][1] = -0.417402664;
+   ebpv[0][2] = -0.180982288;
+   ebpv[1][0] =  0.00742727954;
+   ebpv[1][1] =  0.0140507459;
+   ebpv[1][2] =  0.00609045792;
+   ehp[0] =  0.903358544;
+   ehp[1] = -0.415395237;
+   ehp[2] = -0.180084014;
+
+   iauApcg(date1, date2, ebpv, ehp, &astrom);
+
+   vvd(astrom.pmt, 12.65133794027378508, 1e-11,
+                   "iauApcg", "pmt", status);
+   vvd(astrom.eb[0], 0.901310875, 1e-12,
+                     "iauApcg", "eb(1)", status);
+   vvd(astrom.eb[1], -0.417402664, 1e-12,
+                     "iauApcg", "eb(2)", status);
+   vvd(astrom.eb[2], -0.180982288, 1e-12,
+                     "iauApcg", "eb(3)", status);
+   vvd(astrom.eh[0], 0.8940025429324143045, 1e-12,
+                     "iauApcg", "eh(1)", status);
+   vvd(astrom.eh[1], -0.4110930268679817955, 1e-12,
+                     "iauApcg", "eh(2)", status);
+   vvd(astrom.eh[2], -0.1782189004872870264, 1e-12,
+                     "iauApcg", "eh(3)", status);
+   vvd(astrom.em, 1.010465295811013146, 1e-12,
+                  "iauApcg", "em", status);
+   vvd(astrom.v[0], 0.4289638897813379954e-4, 1e-16,
+                    "iauApcg", "v(1_", status);
+   vvd(astrom.v[1], 0.8115034021720941898e-4, 1e-16,
+                    "iauApcg", "v(2)", status);
+   vvd(astrom.v[2], 0.3517555123437237778e-4, 1e-16,
+                    "iauApcg", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999951686013336, 1e-12,
+                   "iauApcg", "bm1", status);
+   vvd(astrom.bpn[0][0], 1.0, 0.0,
+                         "iauApcg", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0.0, 0.0,
+                         "iauApcg", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0.0, 0.0,
+                         "iauApcg", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], 0.0, 0.0,
+                         "iauApcg", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 1.0, 0.0,
+                         "iauApcg", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], 0.0, 0.0,
+                         "iauApcg", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], 0.0, 0.0,
+                         "iauApcg", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0.0, 0.0,
+                         "iauApcg", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 1.0, 0.0,
+                         "iauApcg", "bpn(3,3)", status);
+
+}
+
+static void t_apcg13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a p c g 1 3
+**  - - - - - - - - -
+**
+**  Test iauApcg13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApcg13, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2;
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+
+   iauApcg13(date1, date2, &astrom);
+
+   vvd(astrom.pmt, 12.65133794027378508, 1e-11,
+                   "iauApcg13", "pmt", status);
+   vvd(astrom.eb[0], 0.9013108747340644755, 1e-12,
+                   "iauApcg13", "eb(1)", status);
+   vvd(astrom.eb[1], -0.4174026640406119957, 1e-12,
+                   "iauApcg13", "eb(2)", status);
+   vvd(astrom.eb[2], -0.1809822877867817771, 1e-12,
+                   "iauApcg13", "eb(3)", status);
+   vvd(astrom.eh[0], 0.8940025429255499549, 1e-12,
+                   "iauApcg13", "eh(1)", status);
+   vvd(astrom.eh[1], -0.4110930268331896318, 1e-12,
+                   "iauApcg13", "eh(2)", status);
+   vvd(astrom.eh[2], -0.1782189006019749850, 1e-12,
+                   "iauApcg13", "eh(3)", status);
+   vvd(astrom.em, 1.010465295964664178, 1e-12,
+                   "iauApcg13", "em", status);
+   vvd(astrom.v[0], 0.4289638897157027528e-4, 1e-16,
+                   "iauApcg13", "v(1)", status);
+   vvd(astrom.v[1], 0.8115034002544663526e-4, 1e-16,
+                   "iauApcg13", "v(2)", status);
+   vvd(astrom.v[2], 0.3517555122593144633e-4, 1e-16,
+                   "iauApcg13", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999951686013498, 1e-12,
+                   "iauApcg13", "bm1", status);
+   vvd(astrom.bpn[0][0], 1.0, 0.0,
+                         "iauApcg13", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0.0, 0.0,
+                         "iauApcg13", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0.0, 0.0,
+                         "iauApcg13", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], 0.0, 0.0,
+                         "iauApcg13", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 1.0, 0.0,
+                         "iauApcg13", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], 0.0, 0.0,
+                         "iauApcg13", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], 0.0, 0.0,
+                         "iauApcg13", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0.0, 0.0,
+                         "iauApcg13", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 1.0, 0.0,
+                         "iauApcg13", "bpn(3,3)", status);
+
+}
+
+static void t_apci(int *status)
+/*
+**  - - - - - - -
+**   t _ a p c i
+**  - - - - - - -
+**
+**  Test iauApci function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, ebpv[2][3], ehp[3], x, y, s;
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   ebpv[0][0] =  0.901310875;
+   ebpv[0][1] = -0.417402664;
+   ebpv[0][2] = -0.180982288;
+   ebpv[1][0] =  0.00742727954;
+   ebpv[1][1] =  0.0140507459;
+   ebpv[1][2] =  0.00609045792;
+   ehp[0] =  0.903358544;
+   ehp[1] = -0.415395237;
+   ehp[2] = -0.180084014;
+   x =  0.0013122272;
+   y = -2.92808623e-5;
+   s =  3.05749468e-8;
+
+   iauApci(date1, date2, ebpv, ehp, x, y, s, &astrom);
+
+   vvd(astrom.pmt, 12.65133794027378508, 1e-11,
+                   "iauApci", "pmt", status);
+   vvd(astrom.eb[0], 0.901310875, 1e-12,
+                     "iauApci", "eb(1)", status);
+   vvd(astrom.eb[1], -0.417402664, 1e-12,
+                     "iauApci", "eb(2)", status);
+   vvd(astrom.eb[2], -0.180982288, 1e-12,
+                     "iauApci", "eb(3)", status);
+   vvd(astrom.eh[0], 0.8940025429324143045, 1e-12,
+                     "iauApci", "eh(1)", status);
+   vvd(astrom.eh[1], -0.4110930268679817955, 1e-12,
+                     "iauApci", "eh(2)", status);
+   vvd(astrom.eh[2], -0.1782189004872870264, 1e-12,
+                     "iauApci", "eh(3)", status);
+   vvd(astrom.em, 1.010465295811013146, 1e-12,
+                  "iauApci", "em", status);
+   vvd(astrom.v[0], 0.4289638897813379954e-4, 1e-16,
+                    "iauApci", "v(1)", status);
+   vvd(astrom.v[1], 0.8115034021720941898e-4, 1e-16,
+                    "iauApci", "v(2)", status);
+   vvd(astrom.v[2], 0.3517555123437237778e-4, 1e-16,
+                    "iauApci", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999951686013336, 1e-12,
+                   "iauApci", "bm1", status);
+   vvd(astrom.bpn[0][0], 0.9999991390295159156, 1e-12,
+                         "iauApci", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0.4978650072505016932e-7, 1e-12,
+                         "iauApci", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0.1312227200000000000e-2, 1e-12,
+                         "iauApci", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], -0.1136336653771609630e-7, 1e-12,
+                         "iauApci", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 0.9999999995713154868, 1e-12,
+                         "iauApci", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], -0.2928086230000000000e-4, 1e-12,
+                         "iauApci", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], -0.1312227200895260194e-2, 1e-12,
+                         "iauApci", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0.2928082217872315680e-4, 1e-12,
+                         "iauApci", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 0.9999991386008323373, 1e-12,
+                         "iauApci", "bpn(3,3)", status);
+
+}
+
+static void t_apci13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a p c i 1 3
+**  - - - - - - - - -
+**
+**  Test iauApci13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci13, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, eo;
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+
+   iauApci13(date1, date2, &astrom, &eo);
+
+   vvd(astrom.pmt, 12.65133794027378508, 1e-11,
+                   "iauApci13", "pmt", status);
+   vvd(astrom.eb[0], 0.9013108747340644755, 1e-12,
+                     "iauApci13", "eb(1)", status);
+   vvd(astrom.eb[1], -0.4174026640406119957, 1e-12,
+                     "iauApci13", "eb(2)", status);
+   vvd(astrom.eb[2], -0.1809822877867817771, 1e-12,
+                     "iauApci13", "eb(3)", status);
+   vvd(astrom.eh[0], 0.8940025429255499549, 1e-12,
+                     "iauApci13", "eh(1)", status);
+   vvd(astrom.eh[1], -0.4110930268331896318, 1e-12,
+                     "iauApci13", "eh(2)", status);
+   vvd(astrom.eh[2], -0.1782189006019749850, 1e-12,
+                     "iauApci13", "eh(3)", status);
+   vvd(astrom.em, 1.010465295964664178, 1e-12,
+                  "iauApci13", "em", status);
+   vvd(astrom.v[0], 0.4289638897157027528e-4, 1e-16,
+                    "iauApci13", "v(1)", status);
+   vvd(astrom.v[1], 0.8115034002544663526e-4, 1e-16,
+                    "iauApci13", "v(2)", status);
+   vvd(astrom.v[2], 0.3517555122593144633e-4, 1e-16,
+                    "iauApci13", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999951686013498, 1e-12,
+                   "iauApci13", "bm1", status);
+   vvd(astrom.bpn[0][0], 0.9999992060376761710, 1e-12,
+                         "iauApci13", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0.4124244860106037157e-7, 1e-12,
+                         "iauApci13", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0.1260128571051709670e-2, 1e-12,
+                         "iauApci13", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], -0.1282291987222130690e-7, 1e-12,
+                         "iauApci13", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 0.9999999997456835325, 1e-12,
+                         "iauApci13", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], -0.2255288829420524935e-4, 1e-12,
+                         "iauApci13", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], -0.1260128571661374559e-2, 1e-12,
+                         "iauApci13", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0.2255285422953395494e-4, 1e-12,
+                         "iauApci13", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 0.9999992057833604343, 1e-12,
+                         "iauApci13", "bpn(3,3)", status);
+   vvd(eo, -0.2900618712657375647e-2, 1e-12,
+           "iauApci13", "eo", status);
+
+}
+
+static void t_apco(int *status)
+/*
+**  - - - - - - -
+**   t _ a p c o
+**  - - - - - - -
+**
+**  Test iauApco function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApco, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, ebpv[2][3], ehp[3], x, y, s,
+          theta, elong, phi, hm, xp, yp, sp, refa, refb;
+   iauASTROM astrom;
+
+
+   date1 = 2456384.5;
+   date2 = 0.970031644;
+   ebpv[0][0] = -0.974170438;
+   ebpv[0][1] = -0.211520082;
+   ebpv[0][2] = -0.0917583024;
+   ebpv[1][0] = 0.00364365824;
+   ebpv[1][1] = -0.0154287319;
+   ebpv[1][2] = -0.00668922024;
+   ehp[0] = -0.973458265;
+   ehp[1] = -0.209215307;
+   ehp[2] = -0.0906996477;
+   x = 0.0013122272;
+   y = -2.92808623e-5;
+   s = 3.05749468e-8;
+   theta = 3.14540971;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   sp = -3.01974337e-11;
+   refa = 0.000201418779;
+   refb = -2.36140831e-7;
+
+   iauApco(date1, date2, ebpv, ehp, x, y, s,
+           theta, elong, phi, hm, xp, yp, sp,
+           refa, refb, &astrom);
+
+   vvd(astrom.pmt, 13.25248468622587269, 1e-11,
+                   "iauApco", "pmt", status);
+   vvd(astrom.eb[0], -0.9741827110630897003, 1e-12,
+                     "iauApco", "eb(1)", status);
+   vvd(astrom.eb[1], -0.2115130190135014340, 1e-12,
+                     "iauApco", "eb(2)", status);
+   vvd(astrom.eb[2], -0.09179840186968295686, 1e-12,
+                     "iauApco", "eb(3)", status);
+   vvd(astrom.eh[0], -0.9736425571689670428, 1e-12,
+                     "iauApco", "eh(1)", status);
+   vvd(astrom.eh[1], -0.2092452125848862201, 1e-12,
+                     "iauApco", "eh(2)", status);
+   vvd(astrom.eh[2], -0.09075578152261439954, 1e-12,
+                     "iauApco", "eh(3)", status);
+   vvd(astrom.em, 0.9998233241710617934, 1e-12,
+                  "iauApco", "em", status);
+   vvd(astrom.v[0], 0.2078704985147609823e-4, 1e-16,
+                    "iauApco", "v(1)", status);
+   vvd(astrom.v[1], -0.8955360074407552709e-4, 1e-16,
+                    "iauApco", "v(2)", status);
+   vvd(astrom.v[2], -0.3863338980073114703e-4, 1e-16,
+                    "iauApco", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999950277561600, 1e-12,
+                   "iauApco", "bm1", status);
+   vvd(astrom.bpn[0][0], 0.9999991390295159156, 1e-12,
+                         "iauApco", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0.4978650072505016932e-7, 1e-12,
+                         "iauApco", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0.1312227200000000000e-2, 1e-12,
+                         "iauApco", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], -0.1136336653771609630e-7, 1e-12,
+                         "iauApco", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 0.9999999995713154868, 1e-12,
+                         "iauApco", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], -0.2928086230000000000e-4, 1e-12,
+                         "iauApco", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], -0.1312227200895260194e-2, 1e-12,
+                         "iauApco", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0.2928082217872315680e-4, 1e-12,
+                         "iauApco", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 0.9999991386008323373, 1e-12,
+                         "iauApco", "bpn(3,3)", status);
+   vvd(astrom.along, -0.5278008060301974337, 1e-12,
+                     "iauApco", "along", status);
+   vvd(astrom.xpl, 0.1133427418174939329e-5, 1e-17,
+                   "iauApco", "xpl", status);
+   vvd(astrom.ypl, 0.1453347595745898629e-5, 1e-17,
+                   "iauApco", "ypl", status);
+   vvd(astrom.sphi, -0.9440115679003211329, 1e-12,
+                    "iauApco", "sphi", status);
+   vvd(astrom.cphi, 0.3299123514971474711, 1e-12,
+                    "iauApco", "cphi", status);
+   vvd(astrom.diurab, 0, 0,
+                      "iauApco", "diurab", status);
+   vvd(astrom.eral, 2.617608903969802566, 1e-12,
+                    "iauApco", "eral", status);
+   vvd(astrom.refa, 0.2014187790000000000e-3, 1e-15,
+                    "iauApco", "refa", status);
+   vvd(astrom.refb, -0.2361408310000000000e-6, 1e-18,
+                    "iauApco", "refb", status);
+
+}
+
+static void t_apco13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a p c o 1 3
+**  - - - - - - - - -
+**
+**  Test iauApco13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApco13, vvd, viv
+**
+**  This revision:  2013 October 4
+*/
+{
+   double utc1, utc2, dut1, elong, phi, hm, xp, yp,
+          phpa, tc, rh, wl, eo;
+   iauASTROM astrom;
+   int j;
+
+
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+
+   j = iauApco13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl, &astrom, &eo);
+
+   vvd(astrom.pmt, 13.25248468622475727, 1e-11,
+                   "iauApco13", "pmt", status);
+   vvd(astrom.eb[0], -0.9741827107321449445, 1e-12,
+                   "iauApco13", "eb(1)", status);
+   vvd(astrom.eb[1], -0.2115130190489386190, 1e-12,
+                     "iauApco13", "eb(2)", status);
+   vvd(astrom.eb[2], -0.09179840189515518726, 1e-12,
+                     "iauApco13", "eb(3)", status);
+   vvd(astrom.eh[0], -0.9736425572586866640, 1e-12,
+                     "iauApco13", "eh(1)", status);
+   vvd(astrom.eh[1], -0.2092452121602867431, 1e-12,
+                     "iauApco13", "eh(2)", status);
+   vvd(astrom.eh[2], -0.09075578153903832650, 1e-12,
+                     "iauApco13", "eh(3)", status);
+   vvd(astrom.em, 0.9998233240914558422, 1e-12,
+                  "iauApco13", "em", status);
+   vvd(astrom.v[0], 0.2078704986751370303e-4, 1e-16,
+                    "iauApco13", "v(1)", status);
+   vvd(astrom.v[1], -0.8955360100494469232e-4, 1e-16,
+                    "iauApco13", "v(2)", status);
+   vvd(astrom.v[2], -0.3863338978840051024e-4, 1e-16,
+                    "iauApco13", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999950277561368, 1e-12,
+                   "iauApco13", "bm1", status);
+   vvd(astrom.bpn[0][0], 0.9999991390295147999, 1e-12,
+                         "iauApco13", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0.4978650075315529277e-7, 1e-12,
+                         "iauApco13", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0.001312227200850293372, 1e-12,
+                         "iauApco13", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], -0.1136336652812486604e-7, 1e-12,
+                         "iauApco13", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 0.9999999995713154865, 1e-12,
+                         "iauApco13", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], -0.2928086230975367296e-4, 1e-12,
+                         "iauApco13", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], -0.001312227201745553566, 1e-12,
+                         "iauApco13", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0.2928082218847679162e-4, 1e-12,
+                         "iauApco13", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 0.9999991386008312212, 1e-12,
+                         "iauApco13", "bpn(3,3)", status);
+   vvd(astrom.along, -0.5278008060301974337, 1e-12,
+                     "iauApco13", "along", status);
+   vvd(astrom.xpl, 0.1133427418174939329e-5, 1e-17,
+                   "iauApco13", "xpl", status);
+   vvd(astrom.ypl, 0.1453347595745898629e-5, 1e-17,
+                   "iauApco13", "ypl", status);
+   vvd(astrom.sphi, -0.9440115679003211329, 1e-12,
+                    "iauApco13", "sphi", status);
+   vvd(astrom.cphi, 0.3299123514971474711, 1e-12,
+                    "iauApco13", "cphi", status);
+   vvd(astrom.diurab, 0, 0,
+                      "iauApco13", "diurab", status);
+   vvd(astrom.eral, 2.617608909189066140, 1e-12,
+                    "iauApco13", "eral", status);
+   vvd(astrom.refa, 0.2014187785940396921e-3, 1e-15,
+                    "iauApco13", "refa", status);
+   vvd(astrom.refb, -0.2361408314943696227e-6, 1e-18,
+                    "iauApco13", "refb", status);
+   vvd(eo, -0.003020548354802412839, 1e-14,
+           "iauApco13", "eo", status);
+   viv(j, 0, "iauApco13", "j", status);
+
+}
+
+static void t_apcs(int *status)
+/*
+**  - - - - - - -
+**   t _ a p c s
+**  - - - - - - -
+**
+**  Test iauApcs function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApcs, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, pv[2][3], ebpv[2][3], ehp[3];
+   iauASTROM astrom;
+
+
+   date1 = 2456384.5;
+   date2 = 0.970031644;
+   pv[0][0] = -1836024.09;
+   pv[0][1] = 1056607.72;
+   pv[0][2] = -5998795.26;
+   pv[1][0] = -77.0361767;
+   pv[1][1] = -133.310856;
+   pv[1][2] = 0.0971855934;
+   ebpv[0][0] = -0.974170438;
+   ebpv[0][1] = -0.211520082;
+   ebpv[0][2] = -0.0917583024;
+   ebpv[1][0] = 0.00364365824;
+   ebpv[1][1] = -0.0154287319;
+   ebpv[1][2] = -0.00668922024;
+   ehp[0] = -0.973458265;
+   ehp[1] = -0.209215307;
+   ehp[2] = -0.0906996477;
+
+   iauApcs(date1, date2, pv, ebpv, ehp, &astrom);
+
+   vvd(astrom.pmt, 13.25248468622587269, 1e-11,
+                   "iauApcs", "pmt", status);
+   vvd(astrom.eb[0], -0.9741827110630456169, 1e-12,
+                     "iauApcs", "eb(1)", status);
+   vvd(astrom.eb[1], -0.2115130190136085494, 1e-12,
+                     "iauApcs", "eb(2)", status);
+   vvd(astrom.eb[2], -0.09179840186973175487, 1e-12,
+                     "iauApcs", "eb(3)", status);
+   vvd(astrom.eh[0], -0.9736425571689386099, 1e-12,
+                     "iauApcs", "eh(1)", status);
+   vvd(astrom.eh[1], -0.2092452125849967195, 1e-12,
+                     "iauApcs", "eh(2)", status);
+   vvd(astrom.eh[2], -0.09075578152266466572, 1e-12,
+                     "iauApcs", "eh(3)", status);
+   vvd(astrom.em, 0.9998233241710457140, 1e-12,
+                  "iauApcs", "em", status);
+   vvd(astrom.v[0], 0.2078704985513566571e-4, 1e-16,
+                    "iauApcs", "v(1)", status);
+   vvd(astrom.v[1], -0.8955360074245006073e-4, 1e-16,
+                    "iauApcs", "v(2)", status);
+   vvd(astrom.v[2], -0.3863338980073572719e-4, 1e-16,
+                    "iauApcs", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999950277561601, 1e-12,
+                   "iauApcs", "bm1", status);
+   vvd(astrom.bpn[0][0], 1, 0,
+                         "iauApcs", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0, 0,
+                         "iauApcs", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0, 0,
+                         "iauApcs", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], 0, 0,
+                         "iauApcs", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 1, 0,
+                         "iauApcs", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], 0, 0,
+                         "iauApcs", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], 0, 0,
+                         "iauApcs", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0, 0,
+                         "iauApcs", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 1, 0,
+                         "iauApcs", "bpn(3,3)", status);
+
+}
+
+static void t_apcs13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a p c s 1 3
+**  - - - - - - - - -
+**
+**  Test iauApcs13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApcs13, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, pv[2][3];
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   pv[0][0] = -6241497.16;
+   pv[0][1] = 401346.896;
+   pv[0][2] = -1251136.04;
+   pv[1][0] = -29.264597;
+   pv[1][1] = -455.021831;
+   pv[1][2] = 0.0266151194;
+
+   iauApcs13(date1, date2, pv, &astrom);
+
+   vvd(astrom.pmt, 12.65133794027378508, 1e-11,
+                   "iauApcs13", "pmt", status);
+   vvd(astrom.eb[0], 0.9012691529023298391, 1e-12,
+                     "iauApcs13", "eb(1)", status);
+   vvd(astrom.eb[1], -0.4173999812023068781, 1e-12,
+                     "iauApcs13", "eb(2)", status);
+   vvd(astrom.eb[2], -0.1809906511146821008, 1e-12,
+                     "iauApcs13", "eb(3)", status);
+   vvd(astrom.eh[0], 0.8939939101759726824, 1e-12,
+                     "iauApcs13", "eh(1)", status);
+   vvd(astrom.eh[1], -0.4111053891734599955, 1e-12,
+                     "iauApcs13", "eh(2)", status);
+   vvd(astrom.eh[2], -0.1782336880637689334, 1e-12,
+                     "iauApcs13", "eh(3)", status);
+   vvd(astrom.em, 1.010428384373318379, 1e-12,
+                  "iauApcs13", "em", status);
+   vvd(astrom.v[0], 0.4279877278327626511e-4, 1e-16,
+                    "iauApcs13", "v(1)", status);
+   vvd(astrom.v[1], 0.7963255057040027770e-4, 1e-16,
+                    "iauApcs13", "v(2)", status);
+   vvd(astrom.v[2], 0.3517564000441374759e-4, 1e-16,
+                    "iauApcs13", "v(3)", status);
+   vvd(astrom.bm1, 0.9999999952947981330, 1e-12,
+                   "iauApcs13", "bm1", status);
+   vvd(astrom.bpn[0][0], 1, 0,
+                         "iauApcs13", "bpn(1,1)", status);
+   vvd(astrom.bpn[1][0], 0, 0,
+                         "iauApcs13", "bpn(2,1)", status);
+   vvd(astrom.bpn[2][0], 0, 0,
+                         "iauApcs13", "bpn(3,1)", status);
+   vvd(astrom.bpn[0][1], 0, 0,
+                         "iauApcs13", "bpn(1,2)", status);
+   vvd(astrom.bpn[1][1], 1, 0,
+                         "iauApcs13", "bpn(2,2)", status);
+   vvd(astrom.bpn[2][1], 0, 0,
+                         "iauApcs13", "bpn(3,2)", status);
+   vvd(astrom.bpn[0][2], 0, 0,
+                         "iauApcs13", "bpn(1,3)", status);
+   vvd(astrom.bpn[1][2], 0, 0,
+                         "iauApcs13", "bpn(2,3)", status);
+   vvd(astrom.bpn[2][2], 1, 0,
+                         "iauApcs13", "bpn(3,3)", status);
+
+}
+
+static void t_aper(int *status)
+/*
+**  - - - - - - -
+**   t _ a p e r
+**  - - - - - - -
+*
+**  Test iauAper function.
+*
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+*
+**  Called:  iauAper, vvd
+*
+**  This revision:  2013 October 3
+*/
+{
+   double theta;
+   iauASTROM astrom;
+
+
+   astrom.along = 1.234;
+   theta = 5.678;
+
+   iauAper(theta, &astrom);
+
+   vvd(astrom.eral, 6.912000000000000000, 1e-12,
+                    "iauAper", "pmt", status);
+
+}
+
+static void t_aper13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a p e r 1 3
+**  - - - - - - - - -
+**
+**  Test iauAper13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAper13, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double ut11, ut12;
+   iauASTROM astrom;
+
+
+   astrom.along = 1.234;
+   ut11 = 2456165.5;
+   ut12 = 0.401182685;
+
+   iauAper13(ut11, ut12, &astrom);
+
+   vvd(astrom.eral, 3.316236661789694933, 1e-12,
+                    "iauAper13", "pmt", status);
+
+}
+
+static void t_apio(int *status)
+/*
+**  - - - - - - -
+**   t _ a p i o
+**  - - - - - - -
+**
+**  Test iauApio function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApio, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double sp, theta, elong, phi, hm, xp, yp, refa, refb;
+   iauASTROM astrom;
+
+
+   sp = -3.01974337e-11;
+   theta = 3.14540971;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   refa = 0.000201418779;
+   refb = -2.36140831e-7;
+
+   iauApio(sp, theta, elong, phi, hm, xp, yp, refa, refb, &astrom);
+
+   vvd(astrom.along, -0.5278008060301974337, 1e-12,
+                     "iauApio", "along", status);
+   vvd(astrom.xpl, 0.1133427418174939329e-5, 1e-17,
+                   "iauApio", "xpl", status);
+   vvd(astrom.ypl, 0.1453347595745898629e-5, 1e-17,
+                   "iauApio", "ypl", status);
+   vvd(astrom.sphi, -0.9440115679003211329, 1e-12,
+                    "iauApio", "sphi", status);
+   vvd(astrom.cphi, 0.3299123514971474711, 1e-12,
+                    "iauApio", "cphi", status);
+   vvd(astrom.diurab, 0.5135843661699913529e-6, 1e-12,
+                      "iauApio", "diurab", status);
+   vvd(astrom.eral, 2.617608903969802566, 1e-12,
+                    "iauApio", "eral", status);
+   vvd(astrom.refa, 0.2014187790000000000e-3, 1e-15,
+                    "iauApio", "refa", status);
+   vvd(astrom.refb, -0.2361408310000000000e-6, 1e-18,
+                    "iauApio", "refb", status);
+
+}
+
+static void t_apio13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a p i o 1 3
+**  - - - - - - - - -
+**
+**  Test iauApio13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApio13, vvd, viv
+**
+**  This revision:  2013 October 4
+*/
+{
+   double utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl;
+   int j;
+   iauASTROM astrom;
+
+
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+
+   j = iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl, &astrom);
+
+   vvd(astrom.along, -0.5278008060301974337, 1e-12,
+                     "iauApio13", "along", status);
+   vvd(astrom.xpl, 0.1133427418174939329e-5, 1e-17,
+                   "iauApio13", "xpl", status);
+   vvd(astrom.ypl, 0.1453347595745898629e-5, 1e-17,
+                   "iauApio13", "ypl", status);
+   vvd(astrom.sphi, -0.9440115679003211329, 1e-12,
+                    "iauApio13", "sphi", status);
+   vvd(astrom.cphi, 0.3299123514971474711, 1e-12,
+                    "iauApio13", "cphi", status);
+   vvd(astrom.diurab, 0.5135843661699913529e-6, 1e-12,
+                      "iauApio13", "diurab", status);
+   vvd(astrom.eral, 2.617608909189066140, 1e-12,
+                    "iauApio13", "eral", status);
+   vvd(astrom.refa, 0.2014187785940396921e-3, 1e-15,
+                    "iauApio13", "refa", status);
+   vvd(astrom.refb, -0.2361408314943696227e-6, 1e-18,
+                    "iauApio13", "refb", status);
+   viv(j, 0, "iauApio13", "j", status);
+
+}
+
+static void t_atci13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t c i 1 3
+**  - - - - - - - - -
+**
+**  Test iauAtci13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAtci13, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double rc, dc, pr, pd, px, rv, date1, date2, ri, di, eo;
+
+
+   rc = 2.71;
+   dc = 0.174;
+   pr = 1e-5;
+   pd = 5e-6;
+   px = 0.1;
+   rv = 55.0;
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+
+   iauAtci13(rc, dc, pr, pd, px, rv, date1, date2, &ri, &di, &eo);
+
+   vvd(ri, 2.710121572969038991, 1e-12,
+           "iauAtci13", "ri", status);
+   vvd(di, 0.1729371367218230438, 1e-12,
+           "iauAtci13", "di", status);
+   vvd(eo, -0.002900618712657375647, 1e-14,
+           "iauAtci13", "eo", status);
+
+}
+
+static void t_atciq(int *status)
+/*
+**  - - - - - - - -
+**   t _ a t c i q
+**  - - - - - - - -
+**
+**  Test iauAtciq function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci13, iauAtciq, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, eo, rc, dc, pr, pd, px, rv, ri, di;
+   iauASTROM astrom;
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   iauApci13(date1, date2, &astrom, &eo);
+   rc = 2.71;
+   dc = 0.174;
+   pr = 1e-5;
+   pd = 5e-6;
+   px = 0.1;
+   rv = 55.0;
+
+   iauAtciq(rc, dc, pr, pd, px, rv, &astrom, &ri, &di);
+
+   vvd(ri, 2.710121572969038991, 1e-12, "iauAtciq", "ri", status);
+   vvd(di, 0.1729371367218230438, 1e-12, "iauAtciq", "di", status);
+
+}
+
+static void t_atciqn(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t c i q n
+**  - - - - - - - - -
+**
+**  Test iauAtciqn function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci13, iauAtciqn, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   iauLDBODY b[3];
+   double date1, date2, eo, rc, dc, pr, pd, px, rv, ri, di;
+   iauASTROM astrom;
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   iauApci13(date1, date2, &astrom, &eo);
+   rc = 2.71;
+   dc = 0.174;
+   pr = 1e-5;
+   pd = 5e-6;
+   px = 0.1;
+   rv = 55.0;
+   b[0].bm = 0.00028574;
+   b[0].dl = 3e-10;
+   b[0].pv[0][0] = -7.81014427;
+   b[0].pv[0][1] = -5.60956681;
+   b[0].pv[0][2] = -1.98079819;
+   b[0].pv[1][0] =  0.0030723249;
+   b[0].pv[1][1] = -0.00406995477;
+   b[0].pv[1][2] = -0.00181335842;
+   b[1].bm = 0.00095435;
+   b[1].dl = 3e-9;
+   b[1].pv[0][0] =  0.738098796;
+   b[1].pv[0][1] =  4.63658692;
+   b[1].pv[0][2] =  1.9693136;
+   b[1].pv[1][0] = -0.00755816922;
+   b[1].pv[1][1] =  0.00126913722;
+   b[1].pv[1][2] =  0.000727999001;
+   b[2].bm = 1.0;
+   b[2].dl = 6e-6;
+   b[2].pv[0][0] = -0.000712174377;
+   b[2].pv[0][1] = -0.00230478303;
+   b[2].pv[0][2] = -0.00105865966;
+   b[2].pv[1][0] =  6.29235213e-6;
+   b[2].pv[1][1] = -3.30888387e-7;
+   b[2].pv[1][2] = -2.96486623e-7;
+
+   iauAtciqn ( rc, dc, pr, pd, px, rv, &astrom, 3, b, &ri, &di);
+
+   vvd(ri, 2.710122008105325582, 1e-12, "iauAtciqn", "ri", status);
+   vvd(di, 0.1729371916491459122, 1e-12, "iauAtciqn", "di", status);
+
+}
+
+static void t_atciqz(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t c i q z
+**  - - - - - - - - -
+**
+**  Test iauAtciqz function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci13, iauAtciqz, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, eo, rc, dc, ri, di;
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   iauApci13(date1, date2, &astrom, &eo);
+   rc = 2.71;
+   dc = 0.174;
+
+   iauAtciqz(rc, dc, &astrom, &ri, &di);
+
+   vvd(ri, 2.709994899247599271, 1e-12, "iauAtciqz", "ri", status);
+   vvd(di, 0.1728740720983623469, 1e-12, "iauAtciqz", "di", status);
+
+}
+
+static void t_atco13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t c o 1 3
+**  - - - - - - - - -
+**
+**  Test iauAtco13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAtco13, vvd, viv
+**
+**  This revision:  2013 October 4
+*/
+{
+   double rc, dc, pr, pd, px, rv, utc1, utc2, dut1,
+          elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+          aob, zob, hob, dob, rob, eo;
+   int j;
+
+
+   rc = 2.71;
+   dc = 0.174;
+   pr = 1e-5;
+   pd = 5e-6;
+   px = 0.1;
+   rv = 55.0;
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+
+   j = iauAtco13(rc, dc, pr, pd, px, rv,
+                 utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                 phpa, tc, rh, wl,
+                 &aob, &zob, &hob, &dob, &rob, &eo);
+
+   vvd(aob, 0.09251774485358230653, 1e-12, "iauAtco13", "aob", status);
+   vvd(zob, 1.407661405256767021, 1e-12, "iauAtco13", "zob", status);
+   vvd(hob, -0.09265154431403157925, 1e-12, "iauAtco13", "hob", status);
+   vvd(dob, 0.1716626560075591655, 1e-12, "iauAtco13", "dob", status);
+   vvd(rob, 2.710260453503097719, 1e-12, "iauAtco13", "rob", status);
+   vvd(eo, -0.003020548354802412839, 1e-14, "iauAtco13", "eo", status);
+   viv(j, 0, "iauAtco13", "j", status);
+
+}
+
+static void t_atic13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t i c 1 3
+**  - - - - - - - - -
+**
+**  Test iauAtic13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAtic13, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double ri, di, date1, date2, rc, dc, eo;
+
+
+   ri = 2.710121572969038991;
+   di = 0.1729371367218230438;
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+
+   iauAtic13(ri, di, date1, date2, &rc, &dc, &eo);
+
+   vvd(rc, 2.710126504531374930, 1e-12, "iauAtic13", "rc", status);
+   vvd(dc, 0.1740632537628342320, 1e-12, "iauAtic13", "dc", status);
+   vvd(eo, -0.002900618712657375647, 1e-14, "iauAtic13", "eo", status);
+
+}
+
+static void t_aticq(int *status)
+/*
+**  - - - - - - - -
+**   t _ a t i c q
+**  - - - - - - - -
+**
+**  Test iauAticq function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci13, iauAticq, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, eo, ri, di, rc, dc;
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   iauApci13(date1, date2, &astrom, &eo);
+   ri = 2.710121572969038991;
+   di = 0.1729371367218230438;
+
+   iauAticq(ri, di, &astrom, &rc, &dc);
+
+   vvd(rc, 2.710126504531374930, 1e-12, "iauAticq", "rc", status);
+   vvd(dc, 0.1740632537628342320, 1e-12, "iauAticq", "dc", status);
+
+}
+
+static void t_aticqn(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t i c q n
+**  - - - - - - - - -
+**
+**  Test iauAticqn function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApci13, iauAticqn, vvd
+**
+**  This revision:  2013 October 3
+*/
+{
+   double date1, date2, eo, ri, di, rc, dc;
+   iauLDBODY b[3];
+   iauASTROM astrom;
+
+
+   date1 = 2456165.5;
+   date2 = 0.401182685;
+   iauApci13(date1, date2, &astrom, &eo);
+   ri = 2.709994899247599271;
+   di = 0.1728740720983623469;
+   b[0].bm = 0.00028574;
+   b[0].dl = 3e-10;
+   b[0].pv[0][0] = -7.81014427;
+   b[0].pv[0][1] = -5.60956681;
+   b[0].pv[0][2] = -1.98079819;
+   b[0].pv[1][0] =  0.0030723249;
+   b[0].pv[1][1] = -0.00406995477;
+   b[0].pv[1][2] = -0.00181335842;
+   b[1].bm = 0.00095435;
+   b[1].dl = 3e-9;
+   b[1].pv[0][0] =  0.738098796;
+   b[1].pv[0][1] =  4.63658692;
+   b[1].pv[0][2] =  1.9693136;
+   b[1].pv[1][0] = -0.00755816922;
+   b[1].pv[1][1] =  0.00126913722;
+   b[1].pv[1][2] =  0.000727999001;
+   b[2].bm = 1.0;
+   b[2].dl = 6e-6;
+   b[2].pv[0][0] = -0.000712174377;
+   b[2].pv[0][1] = -0.00230478303;
+   b[2].pv[0][2] = -0.00105865966;
+   b[2].pv[1][0] =  6.29235213e-6;
+   b[2].pv[1][1] = -3.30888387e-7;
+   b[2].pv[1][2] = -2.96486623e-7;
+
+   iauAticqn(ri, di, &astrom, 3, b, &rc, &dc);
+
+   vvd(rc, 2.709999575032685412, 1e-12, "iauAtciqn", "rc", status);
+   vvd(dc, 0.1739999656317778034, 1e-12, "iauAtciqn", "dc", status);
+
+}
+
+static void t_atio13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t i o 1 3
+**  - - - - - - - - -
+**
+**  Test iauAtio13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAtio13, vvd, viv
+**
+**  This revision:  2013 October 3
+*/
+{
+   double ri, di, utc1, utc2, dut1, elong, phi, hm, xp, yp,
+          phpa, tc, rh, wl, aob, zob, hob, dob, rob;
+   int j;
+
+
+   ri = 2.710121572969038991;
+   di = 0.1729371367218230438;
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+
+   j = iauAtio13(ri, di, utc1, utc2, dut1, elong, phi, hm,
+                 xp, yp, phpa, tc, rh, wl,
+                 &aob, &zob, &hob, &dob, &rob);
+
+   vvd(aob, 0.09233952224794989993, 1e-12, "iauAtio13", "aob", status);
+   vvd(zob, 1.407758704513722461, 1e-12, "iauAtio13", "zob", status);
+   vvd(hob, -0.09247619879782006106, 1e-12, "iauAtio13", "hob", status);
+   vvd(dob, 0.1717653435758265198, 1e-12, "iauAtio13", "dob", status);
+   vvd(rob, 2.710085107986886201, 1e-12, "iauAtio13", "rob", status);
+   viv(j, 0, "iauAtio13", "j", status);
+
+}
+
+static void t_atioq(int *status)
+/*
+**  - - - - - - - -
+**   t _ a t i o q
+**  - - - - - - - -
+**
+**  Test iauAtioq function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauApio13, iauAtioq, vvd, viv
+**
+**  This revision:  2013 October 4
+*/
+{
+   double utc1, utc2, dut1, elong, phi, hm, xp, yp,
+          phpa, tc, rh, wl, ri, di, aob, zob, hob, dob, rob;
+   iauASTROM astrom;
+
+
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+   (void) iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                    phpa, tc, rh, wl, &astrom);
+   ri = 2.710121572969038991;
+   di = 0.1729371367218230438;
+
+   iauAtioq(ri, di, &astrom, &aob, &zob, &hob, &dob, &rob);
+
+   vvd(aob, 0.09233952224794989993, 1e-12, "iauAtioq", "aob", status);
+   vvd(zob, 1.407758704513722461, 1e-12, "iauAtioq", "zob", status);
+   vvd(hob, -0.09247619879782006106, 1e-12, "iauAtioq", "hob", status);
+   vvd(dob, 0.1717653435758265198, 1e-12, "iauAtioq", "dob", status);
+   vvd(rob, 2.710085107986886201, 1e-12, "iauAtioq", "rob", status);
+
+}
+
+static void t_atoc13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t o c 1 3
+**  - - - - - - - - -
+**
+**  Test iauAtoc13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAtoc13, vvd, viv
+**
+**  This revision:  2013 October 3
+*/
+{
+   double utc1, utc2, dut1,
+          elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+          ob1, ob2, rc, dc;
+   int j;
+
+
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+
+   ob1 = 2.710085107986886201;
+   ob2 = 0.1717653435758265198;
+   j = iauAtoc13 ( "R", ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &rc, &dc);
+   vvd(rc, 2.709956744661000609, 1e-12, "iauAtoc13", "R/rc", status);
+   vvd(dc, 0.1741696500895398562, 1e-12, "iauAtoc13", "R/dc", status);
+   viv(j, 0, "iauAtoc13", "R/j", status);
+
+   ob1 = -0.09247619879782006106;
+   ob2 = 0.1717653435758265198;
+   j = iauAtoc13 ( "H", ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &rc, &dc);
+   vvd(rc, 2.709956744661000609, 1e-12, "iauAtoc13", "H/rc", status);
+   vvd(dc, 0.1741696500895398562, 1e-12, "iauAtoc13", "H/dc", status);
+   viv(j, 0, "iauAtoc13", "H/j", status);
+
+   ob1 = 0.09233952224794989993;
+   ob2 = 1.407758704513722461;
+   j = iauAtoc13 ( "A", ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &rc, &dc);
+   vvd(rc, 2.709956744661000609, 1e-12, "iauAtoc13", "A/rc", status);
+   vvd(dc, 0.1741696500895398565, 1e-12, "iauAtoc13", "A/dc", status);
+   viv(j, 0, "iauAtoc13", "A/j", status);
+
+}
+
+static void t_atoi13(int *status)
+/*
+**  - - - - - - - - -
+**   t _ a t o i 1 3
+**  - - - - - - - - -
+**
+**  Test iauAtoi13 function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauAtoi13, vvd, viv
+**
+**  This revision:  2013 October 3
+*/
+{
+   double utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+          ob1, ob2, ri, di;
+   int j;
+
+
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+
+   ob1 = 2.710085107986886201;
+   ob2 = 0.1717653435758265198;
+   j = iauAtoi13 ( "R", ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &ri, &di);
+   vvd(ri, 2.710121574449135955, 1e-12, "iauAtoi13", "R/ri", status);
+   vvd(di, 0.1729371839114567725, 1e-12, "iauAtoi13", "R/di", status);
+   viv(j, 0, "iauAtoi13", "R/J", status);
+
+   ob1 = -0.09247619879782006106;
+   ob2 = 0.1717653435758265198;
+   j = iauAtoi13 ( "H", ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &ri, &di);
+   vvd(ri, 2.710121574449135955, 1e-12, "iauAtoi13", "H/ri", status);
+   vvd(di, 0.1729371839114567725, 1e-12, "iauAtoi13", "H/di", status);
+   viv(j, 0, "iauAtoi13", "H/J", status);
+
+   ob1 = 0.09233952224794989993;
+   ob2 = 1.407758704513722461;
+   j = iauAtoi13 ( "A", ob1, ob2, utc1, utc2, dut1,
+                   elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+                   &ri, &di);
+   vvd(ri, 2.710121574449135955, 1e-12, "iauAtoi13", "A/ri", status);
+   vvd(di, 0.1729371839114567728, 1e-12, "iauAtoi13", "A/di", status);
+   viv(j, 0, "iauAtoi13", "A/J", status);
+
+}
+
+static void t_atoiq(int *status)
+/*
+**  - - - - - - - -
+**   t _ a t o i q
+**  - - - - - - - -
+*
+**  Test iauAtoiq function.
+*
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+*
+**  Called:  iauApio13, iauAtoiq, vvd
+*
+**  This revision:  2013 October 4
+*/
+{
+   double utc1, utc2, dut1, elong, phi, hm, xp, yp, phpa, tc, rh, wl,
+          ob1, ob2, ri, di;
+   iauASTROM astrom;
+
+
+   utc1 = 2456384.5;
+   utc2 = 0.969254051;
+   dut1 = 0.1550675;
+   elong = -0.527800806;
+   phi = -1.2345856;
+   hm = 2738.0;
+   xp = 2.47230737e-7;
+   yp = 1.82640464e-6;
+   phpa = 731.0;
+   tc = 12.8;
+   rh = 0.59;
+   wl = 0.55;
+   (void) iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
+                    phpa, tc, rh, wl, &astrom);
+
+   ob1 = 2.710085107986886201;
+   ob2 = 0.1717653435758265198;
+   iauAtoiq("R", ob1, ob2, &astrom, &ri, &di);
+   vvd(ri, 2.710121574449135955, 1e-12,
+           "iauAtoiq", "R/ri", status);
+   vvd(di, 0.1729371839114567725, 1e-12,
+           "iauAtoiq", "R/di", status);
+
+   ob1 = -0.09247619879782006106;
+   ob2 = 0.1717653435758265198;
+   iauAtoiq("H", ob1, ob2, &astrom, &ri, &di);
+   vvd(ri, 2.710121574449135955, 1e-12,
+           "iauAtoiq", "H/ri", status);
+   vvd(di, 0.1729371839114567725, 1e-12,
+           "iauAtoiq", "H/di", status);
+
+   ob1 = 0.09233952224794989993;
+   ob2 = 1.407758704513722461;
+   iauAtoiq("A", ob1, ob2, &astrom, &ri, &di);
+   vvd(ri, 2.710121574449135955, 1e-12,
+           "iauAtoiq", "A/ri", status);
+   vvd(di, 0.1729371839114567728, 1e-12,
+           "iauAtoiq", "A/di", status);
+
+}
+
 static void t_bi00(int *status)
 /*
 **  - - - - - - -
@@ -235,11 +1757,11 @@ static void t_bi00(int *status)
 **  Test iauBi00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauBi00, vvd
 **
-**  This revision:  2009 November 4
+**  This revision:  2013 August 7
 */
 {
    double dpsibi, depsbi, dra;
@@ -263,11 +1785,11 @@ static void t_bp00(int *status)
 **  Test iauBp00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauBp00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rb[3][3], rp[3][3], rbp[3][3];
@@ -342,11 +1864,11 @@ static void t_bp06(int *status)
 **  Test iauBp06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauBp06, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rb[3][3], rp[3][3], rbp[3][3];
@@ -421,11 +1943,11 @@ static void t_bpn2xy(int *status)
 **  Test iauBpn2xy function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauBpn2xy, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double rbpn[3][3], x, y;
@@ -459,11 +1981,11 @@ static void t_c2i00a(int *status)
 **  Test iauC2i00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2i00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rc2i[3][3];
@@ -503,11 +2025,11 @@ static void t_c2i00b(int *status)
 **  Test iauC2i00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2i00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rc2i[3][3];
@@ -547,11 +2069,11 @@ static void t_c2i06a(int *status)
 **  Test iauC2i06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2i06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rc2i[3][3];
@@ -591,11 +2113,11 @@ static void t_c2ibpn(int *status)
 **  Test iauC2ibpn function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2ibpn, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rbpn[3][3], rc2i[3][3];
@@ -647,11 +2169,11 @@ static void t_c2ixy(int *status)
 **  Test iauC2ixy function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2ixy, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, rc2i[3][3];
@@ -694,11 +2216,11 @@ static void t_c2ixys(int *status)
 **  Test iauC2ixys function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2ixys, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, s, rc2i[3][3];
@@ -742,11 +2264,11 @@ static void t_c2s(int *status)
 **  Test iauC2s function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2s, vvd
 **
-**  This revision:  2008 May 27
+**  This revision:  2013 August 7
 */
 {
    double p[3], theta, phi;
@@ -772,11 +2294,11 @@ static void t_c2t00a(int *status)
 **  Test iauC2t00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2t00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double tta, ttb, uta, utb, xp, yp, rc2t[3][3];
@@ -823,11 +2345,11 @@ static void t_c2t00b(int *status)
 **  Test iauC2t00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2t00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double tta, ttb, uta, utb, xp, yp, rc2t[3][3];
@@ -874,11 +2396,11 @@ static void t_c2t06a(int *status)
 **  Test iauC2t06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2t06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double tta, ttb, uta, utb, xp, yp, rc2t[3][3];
@@ -925,11 +2447,11 @@ static void t_c2tcio(int *status)
 **  Test iauC2tcio function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2tcio, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rc2i[3][3], era, rpom[3][3], rc2t[3][3];
@@ -996,11 +2518,11 @@ static void t_c2teqx(int *status)
 **  Test iauC2teqx function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2teqx, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rbpn[3][3], gst, rpom[3][3], rc2t[3][3];
@@ -1066,11 +2588,11 @@ static void t_c2tpe(int *status)
 **  Test iauC2tpe function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2tpe, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double tta, ttb, uta, utb, dpsi, deps, xp, yp, rc2t[3][3];
@@ -1119,11 +2641,11 @@ static void t_c2txy(int *status)
 **  Test iauC2txy function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauC2txy, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double tta, ttb, uta, utb, x, y, xp, yp, rc2t[3][3];
@@ -1172,11 +2694,11 @@ static void t_cal2jd(int *status)
 **  Test iauCal2jd function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauCal2jd, vvd, viv
 **
-**  This revision:  2008 May 27
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -1201,11 +2723,11 @@ static void t_cp(int *status)
 **  Test iauCp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauCp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double p[3], c[3];
@@ -1231,11 +2753,11 @@ static void t_cpv(int *status)
 **  Test iauCpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauCpv, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], c[2][3];
@@ -1270,11 +2792,11 @@ static void t_cr(int *status)
 **  Test iauCr function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauCr, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], c[3][3];
@@ -1316,11 +2838,11 @@ static void t_d2dtf(int *status )
 **  Test iauD2dtf function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauD2dtf, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    int j, iy, im, id, ihmsf[4];
@@ -1348,11 +2870,11 @@ static void t_d2tf(int *status)
 **  Test iauD2tf function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauD2tf, viv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    int ihmsf[4];
@@ -1379,11 +2901,11 @@ static void t_dat(int *status)
 **  Test iauDat function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauDat, vvd, viv
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -1411,11 +2933,11 @@ static void t_dtdb(int *status)
 **  Test iauDtdb function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauDtdb, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dtdb;
@@ -1436,11 +2958,11 @@ static void t_dtf2d(int *status)
 **  Test iauDtf2d function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauDtf2d, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double u1, u2;
@@ -1463,11 +2985,11 @@ static void t_ee00(int *status)
 **  Test iauEe00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEe00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double epsa, dpsi, ee;
@@ -1491,11 +3013,11 @@ static void t_ee00a(int *status)
 **  Test iauEe00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEe00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double ee;
@@ -1516,11 +3038,11 @@ static void t_ee00b(int *status)
 **  Test iauEe00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEe00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double ee;
@@ -1541,11 +3063,11 @@ static void t_ee06a(int *status)
 **  Test iauEe06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEe06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double ee;
@@ -1565,11 +3087,11 @@ static void t_eect00(int *status)
 **  Test iauEect00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEect00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double eect;
@@ -1590,11 +3112,11 @@ static void t_eform(int *status)
 **  Test iauEform function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEform, viv, vvd
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -1635,11 +3157,11 @@ static void t_eo06a(int *status)
 **  Test iauEo06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEo06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double eo;
@@ -1660,11 +3182,11 @@ static void t_eors(int *status)
 **  Test iauEors function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEors, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rnpb[3][3], s, eo;
@@ -1699,11 +3221,11 @@ static void t_epb(int *status)
 **  Test iauEpb function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEpb, vvd
 **
-**  This revision:  2008 May 27
+**  This revision:  2013 August 7
 */
 {
    double epb;
@@ -1724,11 +3246,11 @@ static void t_epb2jd(int *status)
 **  Test iauEpb2jd function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEpb2jd, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double epb, djm0, djm;
@@ -1752,11 +3274,11 @@ static void t_epj(int *status)
 **  Test iauEpj function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEpj, vvd
 **
-**  This revision:  2008 May 27
+**  This revision:  2013 August 7
 */
 {
    double epj;
@@ -1777,11 +3299,11 @@ static void t_epj2jd(int *status)
 **  Test iauEpj2jd function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEpj2jd, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double epj, djm0, djm;
@@ -1805,11 +3327,11 @@ static void t_epv00(int *status)
 **  Test iauEpv00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called: iauEpv00, vvd, viv
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double pvh[2][3], pvb[2][3];
@@ -1859,11 +3381,11 @@ static void t_eqeq94(int *status)
 **  Test iauEqeq94 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEqeq94, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double eqeq;
@@ -1884,11 +3406,11 @@ static void t_era00(int *status)
 **  Test iauEra00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauEra00, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double era00;
@@ -1909,11 +3431,11 @@ static void t_fad03(int *status)
 **  Test iauFad03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFad03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFad03(0.80), 1.946709205396925672, 1e-12,
@@ -1929,11 +3451,11 @@ static void t_fae03(int *status)
 **  Test iauFae03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFae03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFae03(0.80), 1.744713738913081846, 1e-12,
@@ -1949,11 +3471,11 @@ static void t_faf03(int *status)
 **  Test iauFaf03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFaf03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFaf03(0.80), 0.2597711366745499518, 1e-12,
@@ -1969,11 +3491,11 @@ static void t_faju03(int *status)
 **  Test iauFaju03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFaju03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFaju03(0.80), 5.275711665202481138, 1e-12,
@@ -1989,11 +3511,11 @@ static void t_fal03(int *status)
 **  Test iauFal03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFal03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFal03(0.80), 5.132369751108684150, 1e-12,
@@ -2009,11 +3531,11 @@ static void t_falp03(int *status)
 **  Test iauFalp03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFalp03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFalp03(0.80), 6.226797973505507345, 1e-12,
@@ -2029,11 +3551,11 @@ static void t_fama03(int *status)
 **  Test iauFama03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFama03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFama03(0.80), 3.275506840277781492, 1e-12,
@@ -2049,11 +3571,11 @@ static void t_fame03(int *status)
 **  Test iauFame03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFame03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFame03(0.80), 5.417338184297289661, 1e-12,
@@ -2069,11 +3591,11 @@ static void t_fane03(int *status)
 **  Test iauFane03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFane03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFane03(0.80), 2.079343830860413523, 1e-12,
@@ -2089,11 +3611,11 @@ static void t_faom03(int *status)
 **  Test iauFaom03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFaom03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFaom03(0.80), -5.973618440951302183, 1e-12,
@@ -2109,11 +3631,11 @@ static void t_fapa03(int *status)
 **  Test iauFapa03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFapa03, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFapa03(0.80), 0.1950884762240000000e-1, 1e-12,
@@ -2129,11 +3651,11 @@ static void t_fasa03(int *status)
 **  Test iauFasa03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFasa03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFasa03(0.80), 5.371574539440827046, 1e-12,
@@ -2149,11 +3671,11 @@ static void t_faur03(int *status)
 **  Test iauFaur03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFaur03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFaur03(0.80), 5.180636450180413523, 1e-12,
@@ -2169,11 +3691,11 @@ static void t_fave03(int *status)
 **  Test iauFave03 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFave03, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    vvd(iauFave03(0.80), 3.424900460533758000, 1e-12,
@@ -2189,11 +3711,11 @@ static void t_fk52h(int *status)
 **  Test iauFk52h function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFk52h, vvd
 **
-**  This revision:  2009 November 6
+**  This revision:  2013 August 7
 */
 {
    double r5, d5, dr5, dd5, px5, rv5, rh, dh, drh, ddh, pxh, rvh;
@@ -2233,11 +3755,11 @@ static void t_fk5hip(int *status)
 **  Test iauFk5hip function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFk5hip, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r5h[3][3], s5h[3];
@@ -2281,11 +3803,11 @@ static void t_fk5hz(int *status)
 **  Test iauFk5hz function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFk5hz, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double r5, d5, rh, dh;
@@ -2310,11 +3832,11 @@ static void t_fw2m(int *status)
 **  Test iauFw2m function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFw2m, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double gamb, phib, psi, eps, r[3][3];
@@ -2359,11 +3881,11 @@ static void t_fw2xy(int *status)
 **  Test iauFw2xy function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauFw2xy, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double gamb, phib, psi, eps, x, y;
@@ -2390,11 +3912,11 @@ static void t_gc2gd(int *status)
 **  Test iauGc2gd function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGc2gd, viv, vvd
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -2440,11 +3962,11 @@ static void t_gc2gde(int *status)
 **  Test iauGc2gde function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGc2gde, viv, vvd
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -2469,11 +3991,11 @@ static void t_gd2gc(int *status)
 **  Test iauGd2gc function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGd2gc, viv, vvd
 **
-**  This revision:  2012 February 23
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -2519,11 +4041,11 @@ static void t_gd2gce(int *status)
 **  Test iauGd2gce function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGd2gce, viv, vvd
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    int j;
@@ -2548,11 +4070,11 @@ static void t_gmst00(int *status)
 **  Test iauGmst00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGmst00, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2573,11 +4095,11 @@ static void t_gmst06(int *status)
 **  Test iauGmst06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGmst06, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2598,11 +4120,11 @@ static void t_gmst82(int *status)
 **  Test iauGmst82 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGmst82, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2623,11 +4145,11 @@ static void t_gst00a(int *status)
 **  Test iauGst00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGst00a, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2648,11 +4170,11 @@ static void t_gst00b(int *status)
 **  Test iauGst00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGst00b, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2673,11 +4195,11 @@ static void t_gst06(int *status)
 **  Test iauGst06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGst06, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rnpb[3][3], theta;
@@ -2710,11 +4232,11 @@ static void t_gst06a(int *status)
 **  Test iauGst06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGst06a, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2735,11 +4257,11 @@ static void t_gst94(int *status)
 **  Test iauGst94 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauGst94, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double theta;
@@ -2760,11 +4282,11 @@ static void t_h2fk5(int *status)
 **  Test iauH2fk5 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauH2fk5, vvd
 **
-**  This revision:  2009 November 6
+**  This revision:  2013 August 7
 */
 {
    double rh, dh, drh, ddh, pxh, rvh, r5, d5, dr5, dd5, px5, rv5;
@@ -2804,11 +4326,11 @@ static void t_hfk5z(int *status)
 **  Test iauHfk5z function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauHfk5z, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double rh, dh, r5, d5, dr5, dd5;
@@ -2840,11 +4362,11 @@ static void t_ir(int *status)
 **  Test iauIr function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauIr, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3];
@@ -2887,11 +4409,11 @@ static void t_jd2cal(int *status)
 **  Test iauJd2cal function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauJd2cal, viv, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double dj1, dj2, fd;
@@ -2920,11 +4442,11 @@ static void t_jdcalf(int *status)
 **  Test iauJdcalf function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauJdcalf, viv
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double dj1, dj2;
@@ -2945,6 +4467,151 @@ static void t_jdcalf(int *status)
 
 }
 
+static void t_ld(int *status)
+/*
+**  - - - - -
+**   t _ l d
+**  - - - - -
+**
+**  Test iauLd function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauLd, vvd
+*
+**  This revision:  2013 October 2
+*/
+{
+   double bm, p[3], q[3], e[3], em, dlim, p1[3];
+
+
+   bm = 0.00028574;
+   p[0] = -0.763276255;
+   p[1] = -0.608633767;
+   p[2] = -0.216735543;
+   q[0] = -0.763276255;
+   q[1] = -0.608633767;
+   q[2] = -0.216735543;
+   e[0] = 0.76700421;
+   e[1] = 0.605629598;
+   e[2] = 0.211937094;
+   em = 8.91276983;
+   dlim = 3e-10;
+
+   iauLd(bm, p, q, e, em, dlim, p1);
+
+   vvd(p1[0], -0.7632762548968159627, 1e-12,
+               "iauLd", "1", status);
+   vvd(p1[1], -0.6086337670823762701, 1e-12,
+               "iauLd", "2", status);
+   vvd(p1[2], -0.2167355431320546947, 1e-12,
+               "iauLd", "3", status);
+
+}
+
+static void t_ldn(int *status)
+/*
+**  - - - - - -
+**   t _ l d n
+**  - - - - - -
+**
+**  Test iauLdn function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauLdn, vvd
+**
+**  This revision:  2013 October 2
+*/
+{
+   int n;
+   iauLDBODY b[3];
+   double ob[3], sc[3], sn[3];
+
+
+   n = 3;
+   b[0].bm = 0.00028574;
+   b[0].dl = 3e-10;
+   b[0].pv[0][0] = -7.81014427;
+   b[0].pv[0][1] = -5.60956681;
+   b[0].pv[0][2] = -1.98079819;
+   b[0].pv[1][0] =  0.0030723249;
+   b[0].pv[1][1] = -0.00406995477;
+   b[0].pv[1][2] = -0.00181335842;
+   b[1].bm = 0.00095435;
+   b[1].dl = 3e-9;
+   b[1].pv[0][0] =  0.738098796;
+   b[1].pv[0][1] =  4.63658692;
+   b[1].pv[0][2] =  1.9693136;
+   b[1].pv[1][0] = -0.00755816922;
+   b[1].pv[1][1] =  0.00126913722;
+   b[1].pv[1][2] =  0.000727999001;
+   b[2].bm = 1.0;
+   b[2].dl = 6e-6;
+   b[2].pv[0][0] = -0.000712174377;
+   b[2].pv[0][1] = -0.00230478303;
+   b[2].pv[0][2] = -0.00105865966;
+   b[2].pv[1][0] =  6.29235213e-6;
+   b[2].pv[1][1] = -3.30888387e-7;
+   b[2].pv[1][2] = -2.96486623e-7;
+   ob[0] =  -0.974170437;
+   ob[1] =  -0.2115201;
+   ob[2] =  -0.0917583114;
+   sc[0] =  -0.763276255;
+   sc[1] =  -0.608633767;
+   sc[2] =  -0.216735543;
+
+   iauLdn(n, b, ob, sc, sn);
+
+   vvd(sn[0], -0.7632762579693333866, 1e-12,
+               "iauLdn", "1", status);
+   vvd(sn[1], -0.6086337636093002660, 1e-12,
+               "iauLdn", "2", status);
+   vvd(sn[2], -0.2167355420646328159, 1e-12,
+               "iauLdn", "3", status);
+
+}
+
+static void t_ldsun(int *status)
+/*
+**  - - - - - - - -
+**   t _ l d s u n
+**  - - - - - - - -
+**
+**  Test iauLdsun function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauLdsun, vvd
+**
+**  This revision:  2013 October 2
+*/
+{
+   double p[3], e[3], em, p1[3];
+
+
+   p[0] = -0.763276255;
+   p[1] = -0.608633767;
+   p[2] = -0.216735543;
+   e[0] = -0.973644023;
+   e[1] = -0.20925523;
+   e[2] = -0.0907169552;
+   em = 0.999809214;
+
+   iauLdsun(p, e, em, p1);
+
+   vvd(p1[0], -0.7632762580731413169, 1e-12,
+               "iauLdsun", "1", status);
+   vvd(p1[1], -0.6086337635262647900, 1e-12,
+               "iauLdsun", "2", status);
+   vvd(p1[2], -0.2167355419322321302, 1e-12,
+               "iauLdsun", "3", status);
+
+}
+
 static void t_num00a(int *status)
 /*
 **  - - - - - - - - -
@@ -2954,11 +4621,11 @@ static void t_num00a(int *status)
 **  Test iauNum00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNum00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rmatn[3][3];
@@ -2998,11 +4665,11 @@ static void t_num00b(int *status)
 **  Test iauNum00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNum00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
     double rmatn[3][3];
@@ -3041,11 +4708,11 @@ static void t_num06a(int *status)
 **  Test iauNum06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNum06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
     double rmatn[3][3];
@@ -3084,11 +4751,11 @@ static void t_numat(int *status)
 **  Test iauNumat function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNumat, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double epsa, dpsi, deps, rmatn[3][3];
@@ -3132,11 +4799,11 @@ static void t_nut00a(int *status)
 **  Test iauNut00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNut00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps;
@@ -3160,11 +4827,11 @@ static void t_nut00b(int *status)
 **  Test iauNut00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNut00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps;
@@ -3188,11 +4855,11 @@ static void t_nut06a(int *status)
 **  Test iauNut06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNut06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps;
@@ -3216,11 +4883,11 @@ static void t_nut80(int *status)
 **  Test iauNut80 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNut80, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps;
@@ -3244,11 +4911,11 @@ static void t_nutm80(int *status)
 **  Test iauNutm80 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauNutm80, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double rmatn[3][3];
@@ -3288,11 +4955,11 @@ static void t_obl06(int *status)
 **  Test iauObl06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauObl06, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    vvd(iauObl06(2400000.5, 54388.0), 0.4090749229387258204, 1e-14,
@@ -3308,11 +4975,11 @@ static void t_obl80(int *status)
 **  Test iauObl80 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauObl80, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double eps0;
@@ -3333,11 +5000,11 @@ static void t_p06e(int *status)
 **  Test iauP06e function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauP06e, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
     double eps0, psia, oma, bpa, bqa, pia, bpia,
@@ -3392,11 +5059,11 @@ static void t_p2pv(int *status)
 **  Test iauP2pv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauP2pv, vvd
 **
-**  This revision:  2008 May 26
+**  This revision:  2013 August 7
 */
 {
    double p[3], pv[2][3];
@@ -3435,11 +5102,11 @@ static void t_p2s(int *status)
 **  Test iauP2s function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauP2s, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double p[3], theta, phi, r;
@@ -3466,11 +5133,11 @@ static void t_pap(int *status)
 **  Test iauPap function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPap, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    double a[3], b[3], theta;
@@ -3499,11 +5166,11 @@ static void t_pas(int *status)
 **  Test iauPas function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPas, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    double al, ap, bl, bp, theta;
@@ -3529,11 +5196,11 @@ static void t_pb06(int *status)
 **  Test iauPb06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPb06, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double bzeta, bz, btheta;
@@ -3559,11 +5226,11 @@ static void t_pdp(int *status)
 **  Test iauPdp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPdp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[3], b[3], adb;
@@ -3592,11 +5259,11 @@ static void t_pfw06(int *status)
 **  Test iauPfw06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPfw06, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double gamb, phib, psib, epsa;
@@ -3624,11 +5291,11 @@ static void t_plan94(int *status)
 **  Test iauPlan94 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
-**  Called:  iauPlan94, VVD, VIV
+**  Called:  iauPlan94, vvd, viv
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 October 2
 */
 {
    double pv[2][3];
@@ -3698,11 +5365,11 @@ static void t_pmat00(int *status)
 **  Test iauPmat00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPmat00, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double rbp[3][3];
@@ -3742,11 +5409,11 @@ static void t_pmat06(int *status)
 **  Test iauPmat06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPmat06, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double rbp[3][3];
@@ -3786,11 +5453,11 @@ static void t_pmat76(int *status)
 **  Test iauPmat76 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPmat76, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rmatp[3][3];
@@ -3830,11 +5497,11 @@ static void t_pm(int *status)
 **  Test iauPm function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPm, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double p[3], r;
@@ -3859,11 +5526,11 @@ static void t_pmp(int *status)
 **  Test iauPmp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPmp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[3], b[3], amb[3];
@@ -3885,6 +5552,99 @@ static void t_pmp(int *status)
 
 }
 
+static void t_pmpx(int *status)
+/*
+**  - - - - - - -
+**   t _ p m p x
+**  - - - - - - -
+**
+**  Test iauPmpx function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauPmpx, vvd
+**
+**  This revision:  2013 October 2
+*/
+{
+   double rc, dc, pr, pd, px, rv, pmt, pob[3], pco[3];
+
+
+   rc = 1.234;
+   dc = 0.789;
+   pr = 1e-5;
+   pd = -2e-5;
+   px = 1e-2;
+   rv = 10.0;
+   pmt = 8.75;
+   pob[0] = 0.9;
+   pob[1] = 0.4;
+   pob[2] = 0.1;
+
+   iauPmpx(rc, dc, pr, pd, px, rv, pmt, pob, pco);
+
+   vvd(pco[0], 0.2328137623960308440, 1e-12,
+               "iauPmpx", "1", status);
+   vvd(pco[1], 0.6651097085397855317, 1e-12,
+               "iauPmpx", "2", status);
+   vvd(pco[2], 0.7095257765896359847, 1e-12,
+               "iauPmpx", "3", status);
+
+}
+
+static void t_pmsafe(int *status)
+/*
+**  - - - - - - - - -
+**   t _ p m s a f e
+**  - - - - - - - - -
+**
+**  Test iauPmsafe function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauPmsafe, vvd, viv
+**
+**  This revision:  2013 October 2
+*/
+{
+   int j;
+   double ra1, dec1, pmr1, pmd1, px1, rv1, ep1a, ep1b, ep2a, ep2b,
+          ra2, dec2, pmr2, pmd2, px2, rv2;
+
+
+   ra1 = 1.234;
+   dec1 = 0.789;
+   pmr1 = 1e-5;
+   pmd1 = -2e-5;
+   px1 = 1e-2;
+   rv1 = 10.0;
+   ep1a = 2400000.5;
+   ep1b = 48348.5625;
+   ep2a = 2400000.5;
+   ep2b = 51544.5;
+
+   j = iauPmsafe(ra1, dec1, pmr1, pmd1, px1, rv1,
+                 ep1a, ep1b, ep2a, ep2b,
+                 &ra2, &dec2, &pmr2, &pmd2, &px2, &rv2);
+
+   vvd(ra2, 1.234087484501017061, 1e-12,
+            "iauPmsafe", "ra2", status);
+   vvd(dec2, 0.7888249982450468574, 1e-12,
+            "iauPmsafe", "dec2", status);
+   vvd(pmr2, 0.9996457663586073988e-5, 1e-12,
+             "iauPmsafe", "pmr2", status);
+   vvd(pmd2, -0.2000040085106737816e-4, 1e-16,
+             "iauPmsafe", "pmd2", status);
+   vvd(px2, 0.9999997295356765185e-2, 1e-12,
+            "iauPmsafe", "px2", status);
+   vvd(rv2, 10.38468380113917014, 1e-10,
+            "iauPmsafe", "rv2", status);
+   viv ( j, 0, "iauPmsafe", "j", status);
+
+}
+
 static void t_pn(int *status)
 /*
 **  - - - - -
@@ -3894,11 +5654,11 @@ static void t_pn(int *status)
 **  Test iauPn function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPn, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double p[3], r, u[3];
@@ -3927,11 +5687,11 @@ static void t_pn00(int *status)
 **  Test iauPn00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPn00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps, epsa,
@@ -4062,11 +5822,11 @@ static void t_pn00a(int *status)
 **  Test iauPn00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPn00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps, epsa,
@@ -4198,11 +5958,11 @@ static void t_pn00b(int *status)
 **  Test iauPn00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPn00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps, epsa,
@@ -4334,11 +6094,11 @@ static void t_pn06a(int *status)
 **  Test iauPn06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPn06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps, epsa;
@@ -4470,11 +6230,11 @@ static void t_pn06(int *status)
 **  Test iauPn06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPn06, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsi, deps, epsa,
@@ -4605,11 +6365,11 @@ static void t_pnm00a(int *status)
 **  Test iauPnm00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPnm00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rbpn[3][3];
@@ -4649,11 +6409,11 @@ static void t_pnm00b(int *status)
 **  Test iauPnm00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPnm00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rbpn[3][3];
@@ -4693,11 +6453,11 @@ static void t_pnm06a(int *status)
 **  Test iauPnm06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPnm06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rbpn[3][3];
@@ -4737,11 +6497,11 @@ static void t_pnm80(int *status)
 **  Test iauPnm80 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPnm80, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double rmatpn[3][3];
@@ -4781,11 +6541,11 @@ static void t_pom00(int *status)
 **  Test iauPom00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPom00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double xp, yp, sp, rpom[3][3];
@@ -4829,11 +6589,11 @@ static void t_ppp(int *status)
 **  Test iauPpp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPpp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[3], b[3], apb[3];
@@ -4864,11 +6624,11 @@ static void t_ppsp(int *status)
 **  Test iauPpsp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPpsp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[3], s, b[3], apsb[3];
@@ -4901,11 +6661,11 @@ static void t_pr00(int *status)
 **  Test iauPr00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPr00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double dpsipr, depspr;
@@ -4928,11 +6688,11 @@ static void t_prec76(int *status)
 **  Test iauPrec76 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPrec76, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double ep01, ep02, ep11, ep12, zeta, z, theta;
@@ -4963,11 +6723,11 @@ static void t_pv2p(int *status)
 **  Test iauPv2p function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPv2p, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], p[3];
@@ -4998,11 +6758,11 @@ static void t_pv2s(int *status)
 **  Test iauPv2s function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPv2s, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], theta, phi, r, td, pd, rd;
@@ -5036,11 +6796,11 @@ static void t_pvdpv(int *status)
 **  Test iauPvdpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvdpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[2][3], b[2][3], adb[2];
@@ -5078,11 +6838,11 @@ static void t_pvm(int *status)
 **  Test iauPvm function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvm, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], r, s;
@@ -5112,11 +6872,11 @@ static void t_pvmpv(int *status)
 **  Test iauPvmpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvmpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[2][3], b[2][3], amb[2][3];
@@ -5159,11 +6919,11 @@ static void t_pvppv(int *status)
 **  Test iauPvppv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvppv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[2][3], b[2][3], apb[2][3];
@@ -5206,11 +6966,11 @@ static void t_pvstar(int *status)
 **  Test iauPvstar function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvstar, vvd, viv
 **
-**  This revision:  2009 November 6
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], ra, dec, pmr, pmd, px, rv;
@@ -5238,6 +6998,50 @@ static void t_pvstar(int *status)
 
 }
 
+static void t_pvtob(int *status)
+/*
+**  - - - - - - - -
+**   t _ p v t o b
+**  - - - - - - - -
+**
+**  Test iauPvtob function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauPvtob, vvd
+**
+**  This revision:  2013 October 2
+*/
+{
+   double elong, phi, hm, xp, yp, sp, theta, pv[2][3];
+
+
+   elong = 2.0;
+   phi = 0.5;
+   hm = 3000.0;
+   xp = 1e-6;
+   yp = -0.5e-6;
+   sp = 1e-8;
+   theta = 5.0;
+
+   iauPvtob(elong, phi, hm, xp, yp, sp, theta, pv);
+
+   vvd(pv[0][0], 4225081.367071159207, 1e-5,
+                 "iauPvtob", "p(1)", status);
+   vvd(pv[0][1], 3681943.215856198144, 1e-5,
+                 "iauPvtob", "p(2)", status);
+   vvd(pv[0][2], 3041149.399241260785, 1e-5,
+                 "iauPvtob", "p(3)", status);
+   vvd(pv[1][0], -268.4915389365998787, 1e-9,
+                 "iauPvtob", "v(1)", status);
+   vvd(pv[1][1], 308.0977983288903123, 1e-9,
+                 "iauPvtob", "v(2)", status);
+   vvd(pv[1][2], 0, 0,
+                 "iauPvtob", "v(3)", status);
+
+}
+
 static void t_pvu(int *status)
 /*
 **  - - - - - -
@@ -5247,11 +7051,11 @@ static void t_pvu(int *status)
 **  Test iauPvu function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvu, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], upv[2][3];
@@ -5292,11 +7096,11 @@ static void t_pvup(int *status)
 **  Test iauPvup function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvup, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3], p[3];
@@ -5327,11 +7131,11 @@ static void t_pvxpv(int *status)
 **  Test iauPvxpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPvxpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[2][3], b[2][3], axb[2][3];
@@ -5374,11 +7178,11 @@ static void t_pxp(int *status)
 **  Test iauPxp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauPxp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[3], b[3], axb[3];
@@ -5400,6 +7204,39 @@ static void t_pxp(int *status)
 
 }
 
+static void t_refco(int *status)
+/*
+**  - - - - - - - -
+**   t _ r e f c o
+**  - - - - - - - -
+**
+**  Test iauRefco function.
+**
+**  Returned:
+**     status    int         FALSE = success, TRUE = fail
+**
+**  Called:  iauRefco, vvd
+**
+**  This revision:  2013 October 2
+*/
+{
+   double phpa, tc, rh, wl, refa, refb;
+
+
+   phpa = 800.0;
+   tc = 10.0;
+   rh = 0.9;
+   wl = 0.4;
+
+   iauRefco(phpa, tc, rh, wl, &refa, &refb);
+
+   vvd(refa, 0.2264949956241415009e-3, 1e-15,
+             "iauRefco", "refa", status);
+   vvd(refb, -0.2598658261729343970e-6, 1e-18,
+             "iauRefco", "refb", status);
+
+}
+
 static void t_rm2v(int *status)
 /*
 **  - - - - - - -
@@ -5409,11 +7246,11 @@ static void t_rm2v(int *status)
 **  Test iauRm2v function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRm2v, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], w[3];
@@ -5448,11 +7285,11 @@ static void t_rv2m(int *status)
 **  Test iauRv2m function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRv2m, vvd
 **
-**  This revision:  2008 May 27
+**  This revision:  2013 August 7
 */
 {
    double w[3], r[3][3];
@@ -5487,11 +7324,11 @@ static void t_rx(int *status)
 **  Test iauRx function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRx, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double phi, r[3][3];
@@ -5536,11 +7373,11 @@ static void t_rxp(int *status)
 **  Test iauRxp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRxp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], p[3], rp[3];
@@ -5579,11 +7416,11 @@ static void t_rxpv(int *status)
 **  Test iauRxpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRxpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], pv[2][3], rpv[2][3];
@@ -5631,11 +7468,11 @@ static void t_rxr(int *status)
 **  Test iauRxr function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRxr, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double a[3][3], b[3][3], atb[3][3];
@@ -5690,11 +7527,11 @@ static void t_ry(int *status)
 **  Test iauRy function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRy, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double theta, r[3][3];
@@ -5739,11 +7576,11 @@ static void t_rz(int *status)
 **  Test iauRz function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauRz, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double psi, r[3][3];
@@ -5788,11 +7625,11 @@ static void t_s00a(int *status)
 **  Test iauS00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double s;
@@ -5813,11 +7650,11 @@ static void t_s00b(int *status)
 **  Test iauS00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double s;
@@ -5838,11 +7675,11 @@ static void t_s00(int *status)
 **  Test iauS00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS00, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, s;
@@ -5866,11 +7703,11 @@ static void t_s06a(int *status)
 **  Test iauS06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double s;
@@ -5891,11 +7728,11 @@ static void t_s06(int *status)
 **  Test iauS06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS06, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, s;
@@ -5919,11 +7756,11 @@ static void t_s2c(int *status)
 **  Test iauS2c function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS2c, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double c[3];
@@ -5946,11 +7783,11 @@ static void t_s2p(int *status)
 **  Test iauS2p function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS2p, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    double p[3];
@@ -5973,11 +7810,11 @@ static void t_s2pv(int *status)
 **  Test iauS2pv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS2pv, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3];
@@ -6007,11 +7844,11 @@ static void t_s2xpv(int *status)
 **  Test iauS2xpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauS2xpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double s1, s2, pv[2][3], spv[2][3];
@@ -6049,11 +7886,11 @@ static void t_sepp(int *status)
 **  Test iauSepp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauSepp, vvd
 **
-**  This revision:  2008 November 29
+**  This revision:  2013 August 7
 */
 {
    double a[3], b[3], s;
@@ -6082,11 +7919,11 @@ static void t_seps(int *status)
 **  Test iauSeps function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauSeps, vvd
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 August 7
 */
 {
    double al, ap, bl, bp, s;
@@ -6113,11 +7950,11 @@ static void t_sp00(int *status)
 **  Test iauSp00 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauSp00, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    vvd(iauSp00(2400000.5, 52541.0),
@@ -6134,11 +7971,11 @@ static void t_starpm(int *status)
 **  Test iauStarpm function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauStarpm, vvd, viv
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double ra1, dec1, pmr1, pmd1, px1, rv1;
@@ -6183,11 +8020,11 @@ static void t_starpv(int *status)
 **  Test iauStarpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauStarpv, vvd, viv
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double ra, dec, pmr, pmd, px, rv, pv[2][3];
@@ -6230,11 +8067,11 @@ static void t_sxp(int *status)
 **  Test iauSxp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauSxp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double s, p[3], sp[3];
@@ -6264,11 +8101,11 @@ static void t_sxpv(int *status)
 **  Test iauSxpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauSxpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double s, pv[2][3], spv[2][3];
@@ -6305,11 +8142,11 @@ static void t_taitt(int *status)
 **  Test iauTaitt function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTaitt, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double t1, t2;
@@ -6333,11 +8170,11 @@ static void t_taiut1(int *status)
 **  Test iauTaiut1 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTaiut1, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double u1, u2;
@@ -6356,7 +8193,7 @@ static void t_taiutc(int *status)
 /*
 **  - - - - - - - - -
 **   t _ t a i u t c
-**  - - - - - - - - - - - -
+**  - - - - - - - - -
 **
 **  Test iauTaiutc function.
 **
@@ -6365,7 +8202,7 @@ static void t_taiutc(int *status)
 **
 **  Called:  iauTaiutc, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 October 3
 */
 {
    double u1, u2;
@@ -6389,11 +8226,11 @@ static void t_tcbtdb(int *status)
 **  Test iauTcbtdb function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTcbtdb, vvd, viv
 **
-**  This revision:  2010 September 6
+**  This revision:  2013 August 7
 */
 {
    double b1, b2;
@@ -6417,11 +8254,11 @@ static void t_tcgtt(int *status)
 **  Test iauTcgtt function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTcgtt, vvd, viv
 **
-**  This revision:  2010 September g
+**  This revision:  2013 August 7
 */
 {
    double t1, t2;
@@ -6445,11 +8282,11 @@ static void t_tdbtcb(int *status)
 **  Test iauTdbtcb function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTdbtcb, vvd, viv
 **
-**  This revision:  2010 September 6
+**  This revision:  2013 August 7
 */
 {
    double b1, b2;
@@ -6473,11 +8310,11 @@ static void t_tdbtt(int *status)
 **  Test iauTdbtt function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTdbtt, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double t1, t2;
@@ -6501,11 +8338,11 @@ static void t_tf2a(int *status)
 **  Test iauTf2a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTf2a, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double a;
@@ -6528,11 +8365,11 @@ static void t_tf2d(int *status)
 **  Test iauTf2d function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTf2d, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double d;
@@ -6555,11 +8392,11 @@ static void t_tr(int *status)
 **  Test iauTr function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTr, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], rt[3][3];
@@ -6602,11 +8439,11 @@ static void t_trxp(int *status)
 **  Test iauTrxp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTrxp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], p[3], trp[3];
@@ -6645,11 +8482,11 @@ static void t_trxpv(int *status)
 **  Test iauTrxpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTrxpv, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3], pv[2][3], trpv[2][3];
@@ -6696,11 +8533,11 @@ static void t_tttai(int *status)
 **  Test iauTttai function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTttai, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double a1, a2;
@@ -6724,11 +8561,11 @@ static void t_tttcg(int *status)
 **  Test iauTttcg function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTttcg, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double g1, g2;
@@ -6752,11 +8589,11 @@ static void t_tttdb(int *status)
 **  Test iauTttdb function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTttdb, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double b1, b2;
@@ -6780,11 +8617,11 @@ static void t_ttut1(int *status)
 **  Test iauTtut1 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauTtut1, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double u1, u2;
@@ -6808,11 +8645,11 @@ static void t_ut1tai(int *status)
 **  Test iauUt1tai function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauUt1tai, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double a1, a2;
@@ -6829,18 +8666,18 @@ static void t_ut1tai(int *status)
 
 static void t_ut1tt(int *status)
 /*
-**  - - - - - - - - - - -
+**  - - - - - - - -
 **   t _ u t 1 t t
-**  - - - - - - - - - - -
+**  - - - - - - - -
 **
 **  Test iauUt1tt function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauUt1tt, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 October 3
 */
 {
    double t1, t2;
@@ -6864,11 +8701,11 @@ static void t_ut1utc(int *status)
 **  Test iauUt1utc function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauUt1utc, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double u1, u2;
@@ -6892,11 +8729,11 @@ static void t_utctai(int *status)
 **  Test iauUtctai function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauUtctai, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double u1, u2;
@@ -6920,11 +8757,11 @@ static void t_utcut1(int *status)
 **  Test iauUtcut1 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauUtcut1, vvd, viv
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 August 7
 */
 {
    double u1, u2;
@@ -6948,11 +8785,11 @@ static void t_xy06(int *status)
 **  Test iauXy06 function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauXy06, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y;
@@ -6974,11 +8811,11 @@ static void t_xys00a(int *status)
 **  Test iauXys00a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauXys00a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, s;
@@ -7001,11 +8838,11 @@ static void t_xys00b(int *status)
 **  Test iauXys00b function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauXys00b, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, s;
@@ -7028,11 +8865,11 @@ static void t_xys06a(int *status)
 **  Test iauXys06a function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauXys06a, vvd
 **
-**  This revision:  2008 November 28
+**  This revision:  2013 August 7
 */
 {
    double x, y, s;
@@ -7055,11 +8892,11 @@ static void t_zp(int *status)
 **  Test iauZp function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauZp, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double p[3];
@@ -7086,11 +8923,11 @@ static void t_zpv(int *status)
 **  Test iauZpv function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauZpv, vvd
 **
-**  This revision:  2008 May 25
+**  This revision:  2013 August 7
 */
 {
    double pv[2][3];
@@ -7125,11 +8962,11 @@ static void t_zr(int *status)
 **  Test iauZr function.
 **
 **  Returned:
-**     status    int         TRUE = success, FALSE = fail
+**     status    int         FALSE = success, TRUE = fail
 **
 **  Called:  iauZr, vvd
 **
-**  This revision:  2008 November 30
+**  This revision:  2013 August 7
 */
 {
    double r[3][3];
@@ -7169,7 +9006,7 @@ int main(int argc, char *argv[])
 **   m a i n
 **  - - - - -
 **
-**  This revision:  2010 September 7
+**  This revision:  2013 October 3
 */
 {
    int status;
@@ -7187,9 +9024,35 @@ int main(int argc, char *argv[])
 /* Test all of the SOFA functions. */
    t_a2af(&status);
    t_a2tf(&status);
+   t_ab(&status);
    t_af2a(&status);
    t_anp(&status);
    t_anpm(&status);
+   t_apcg(&status);
+   t_apcg13(&status);
+   t_apci(&status);
+   t_apci13(&status);
+   t_apco(&status);
+   t_apco13(&status);
+   t_apcs(&status);
+   t_apcs13(&status);
+   t_aper(&status);
+   t_aper13(&status);
+   t_apio(&status);
+   t_apio13(&status);
+   t_atci13(&status);
+   t_atciq(&status);
+   t_atciqn(&status);
+   t_atciqz(&status);
+   t_atco13(&status);
+   t_atic13(&status);
+   t_aticq(&status);
+   t_aticqn(&status);
+   t_atio13(&status);
+   t_atioq(&status);
+   t_atoc13(&status);
+   t_atoi13(&status);
+   t_atoiq(&status);
    t_bi00(&status);
    t_bp00(&status);
    t_bp06(&status);
@@ -7268,6 +9131,9 @@ int main(int argc, char *argv[])
    t_ir(&status);
    t_jd2cal(&status);
    t_jdcalf(&status);
+   t_ld(&status);
+   t_ldn(&status);
+   t_ldsun(&status);
    t_num00a(&status);
    t_num00b(&status);
    t_num06a(&status);
@@ -7293,6 +9159,8 @@ int main(int argc, char *argv[])
    t_pmat76(&status);
    t_pm(&status);
    t_pmp(&status);
+   t_pmpx(&status);
+   t_pmsafe(&status);
    t_pn(&status);
    t_pn00(&status);
    t_pn00a(&status);
@@ -7315,10 +9183,12 @@ int main(int argc, char *argv[])
    t_pvmpv(&status);
    t_pvppv(&status);
    t_pvstar(&status);
+   t_pvtob(&status);
    t_pvu(&status);
    t_pvup(&status);
    t_pvxpv(&status);
    t_pxp(&status);
+   t_refco(&status);
    t_rm2v(&status);
    t_rv2m(&status);
    t_rx(&status);
diff --git a/20120301_a/c/src/taitt.c b/20131202/c/src/taitt.c
similarity index 97%
rename from 20120301_a/c/src/taitt.c
rename to 20131202/c/src/taitt.c
index 16c314a..bddc888 100644
--- a/20120301_a/c/src/taitt.c
+++ b/20131202/c/src/taitt.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTaitt(double tai1, double tai2, double *tt1, double *tt2)
 /*
@@ -38,11 +38,11 @@ int iauTaitt(double tai1, double tai2, double *tt1, double *tt2)
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -64,7 +64,7 @@ int iauTaitt(double tai1, double tai2, double *tt1, double *tt2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/taiut1.c b/20131202/c/src/taiut1.c
similarity index 97%
rename from 20120301_a/c/src/taiut1.c
rename to 20131202/c/src/taiut1.c
index f6a59c3..13ad423 100644
--- a/20120301_a/c/src/taiut1.c
+++ b/20131202/c/src/taiut1.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTaiut1(double tai1, double tai2, double dta,
               double *ut11, double *ut12)
@@ -40,11 +40,11 @@ int iauTaiut1(double tai1, double tai2, double dta,
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 **
 */
 {
@@ -66,7 +66,7 @@ int iauTaiut1(double tai1, double tai2, double dta,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/taiutc.c b/20131202/c/src/taiutc.c
similarity index 78%
rename from 20120301_a/c/src/taiutc.c
rename to 20131202/c/src/taiutc.c
index 13910d0..3fb33f2 100644
--- a/20120301_a/c/src/taiutc.c
+++ b/20131202/c/src/taiutc.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTaiutc(double tai1, double tai2, double *utc1, double *utc2)
 /*
@@ -37,20 +37,21 @@ int iauTaiutc(double tai1, double tai2, double *utc1, double *utc2)
 **  2) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The convention in the present
 **     function is that the JD day represents UTC days whether the
-**     length is 86399, 86400 or 86401 SI seconds.
+**     length is 86399, 86400 or 86401 SI seconds.  In the 1960-1972 era
+**     there were smaller jumps (in either direction) each time the
+**     linear UTC(TAI) expression was changed, and these "mini-leaps"
+**     are also included in the SOFA convention.
 **
 **  3) The function iauD2dtf can be used to transform the UTC quasi-JD
 **     into calendar date and clock time, including UTC leap second
 **     handling.
 **
 **  4) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  Called:
-**     iauJd2cal    JD to Gregorian calendar
-**     iauDat       delta(AT) = TAI-UTC
-**     iauCal2jd    Gregorian calendar to JD
+**     iauUtctai    UTC to TAI
 **
 **  References:
 **
@@ -60,16 +61,16 @@ int iauTaiutc(double tai1, double tai2, double *utc1, double *utc2)
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 September 12
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int big1;
-   int i, iy, im, id, js;
-   double a1, a2, d1, dats1, d2, fd, ddats, dats2, datd, as1, as2, da;
+   int i, j;
+   double a1, a2, u1, u2, g1, g2;
 
 
 /* Put the two parts of the TAI into big-first order. */
@@ -82,61 +83,37 @@ int iauTaiutc(double tai1, double tai2, double *utc1, double *utc2)
       a2 = tai1;
    }
 
-/* See if the TAI can possibly be in a leap-second day. */
-   d1 = a1;
-   dats1 = 0.0;
-   for ( i = -1; i <= 3; i++ ) {
-      d2 = a2 + (double) i;
-      if ( iauJd2cal(d1, d2, &iy, &im, &id, &fd) ) return -1;
-      js = iauDat(iy, im, id, 0.0, &dats2);
-      if ( js < 0 ) return -1;
-      if ( i == -1 ) dats1 = dats2;
-      ddats = dats2 - dats1;
-      datd = dats1 / DAYSEC;
-      if ( fabs(ddats) >= 0.5 ) {
+/* Initial guess for UTC. */
+   u1 = a1;
+   u2 = a2;
 
-      /* Yes.  Get TAI for the start of the UTC day that */
-      /* ends in a leap. */
-         if ( iauCal2jd(iy, im, id, &d1, &d2) ) return -1;
-         as1 = d1;
-         as2 = d2 - 1.0 + datd;
+/* Iterate (though in most cases just once is enough). */
+   for ( i = 0; i < 3; i++ ) {
 
-      /* Is the TAI after this point? */
-         da = a1 - as1;
-         da = da + ( a2 - as2 );
-         if ( da > 0 ) {
+   /* Guessed UTC to TAI. */
+      j = iauUtctai(u1, u2, &g1, &g2);
+      if ( j < 0 ) return j;
 
-         /* Yes:  fraction of the current UTC day that has elapsed. */
-            fd = da * DAYSEC / ( DAYSEC + ddats );
-
-         /* Ramp TAI-UTC to bring about SOFA's JD(UTC) convention. */
-            datd += ddats * ( fd <= 1.0 ? fd : 1.0 ) / DAYSEC;
-         }
-
-      /* Done. */
-         break;
-      }
-      dats1 = dats2;
+   /* Adjust guessed UTC. */
+      u2 += a1 - g1;
+      u2 += a2 - g2;
    }
 
-/* Subtract the (possibly adjusted) TAI-UTC from TAI to give UTC. */
-   a2 -= datd;
-
 /* Return the UTC result, preserving the TAI order. */
    if ( big1 ) {
-      *utc1 = a1;
-      *utc2 = a2;
+      *utc1 = u1;
+      *utc2 = u2;
    } else {
-      *utc1 = a2;
-      *utc2 = a1;
+      *utc1 = u2;
+      *utc2 = u1;
    }
 
 /* Status. */
-   return js;
+   return j;
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tcbtdb.c b/20131202/c/src/tcbtdb.c
similarity index 97%
rename from 20120301_a/c/src/tcbtdb.c
rename to 20131202/c/src/tcbtdb.c
index 1a80592..887ad98 100644
--- a/20120301_a/c/src/tcbtdb.c
+++ b/20131202/c/src/tcbtdb.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2)
 /*
@@ -52,11 +52,11 @@ int iauTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2)
 **
 **     IAU 2006 Resolution B3
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -86,7 +86,7 @@ int iauTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tcgtt.c b/20131202/c/src/tcgtt.c
similarity index 97%
rename from 20120301_a/c/src/tcgtt.c
rename to 20131202/c/src/tcgtt.c
index 85b86d9..8c22682 100644
--- a/20120301_a/c/src/tcgtt.c
+++ b/20131202/c/src/tcgtt.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTcgtt(double tcg1, double tcg2, double *tt1, double *tt2)
 /*
@@ -37,11 +37,11 @@ int iauTcgtt(double tcg1, double tcg2, double *tt1, double *tt2)
 **
 **     IAU 2000 Resolution B1.9
 **
-**  This revision:  2010 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -63,7 +63,7 @@ int iauTcgtt(double tcg1, double tcg2, double *tt1, double *tt2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tdbtcb.c b/20131202/c/src/tdbtcb.c
similarity index 97%
rename from 20120301_a/c/src/tdbtcb.c
rename to 20131202/c/src/tdbtcb.c
index 35d5ded..138be01 100644
--- a/20120301_a/c/src/tdbtcb.c
+++ b/20131202/c/src/tdbtcb.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2)
 /*
@@ -52,11 +52,11 @@ int iauTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2)
 **
 **     IAU 2006 Resolution B3
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -91,7 +91,7 @@ int iauTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tdbtt.c b/20131202/c/src/tdbtt.c
similarity index 97%
rename from 20120301_a/c/src/tdbtt.c
rename to 20131202/c/src/tdbtt.c
index b5d81fe..0b2b6cd 100644
--- a/20120301_a/c/src/tdbtt.c
+++ b/20131202/c/src/tdbtt.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTdbtt(double tdb1, double tdb2, double dtr,
              double *tt1, double *tt2 )
@@ -50,11 +50,11 @@ int iauTdbtt(double tdb1, double tdb2, double dtr,
 **
 **     IAU 2006 Resolution 3
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 **
 */
 {
@@ -76,7 +76,7 @@ int iauTdbtt(double tdb1, double tdb2, double dtr,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tf2a.c b/20131202/c/src/tf2a.c
similarity index 97%
rename from 20120301_a/c/src/tf2a.c
rename to 20131202/c/src/tf2a.c
index 4059f90..6e495a9 100644
--- a/20120301_a/c/src/tf2a.c
+++ b/20131202/c/src/tf2a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 #include <stdlib.h>
 
 int iauTf2a(char s, int ihour, int imin, double sec, double *rad)
@@ -39,11 +39,11 @@ int iauTf2a(char s, int ihour, int imin, double sec, double *rad)
 **  3)  If there are multiple errors, the status value reflects only the
 **      first, the smallest taking precedence.
 **
-**  This revision:  2012 February 13
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -61,7 +61,7 @@ int iauTf2a(char s, int ihour, int imin, double sec, double *rad)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tf2d.c b/20131202/c/src/tf2d.c
similarity index 97%
rename from 20120301_a/c/src/tf2d.c
rename to 20131202/c/src/tf2d.c
index e3bbe54..49458cc 100644
--- a/20120301_a/c/src/tf2d.c
+++ b/20131202/c/src/tf2d.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 #include <stdlib.h>
 
 int iauTf2d(char s, int ihour, int imin, double sec, double *days)
@@ -39,11 +39,11 @@ int iauTf2d(char s, int ihour, int imin, double sec, double *days)
 **  3)  If there are multiple errors, the status value reflects only the
 **      first, the smallest taking precedence.
 **
-**  This revision:  2012 February 13
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -61,7 +61,7 @@ int iauTf2d(char s, int ihour, int imin, double sec, double *days)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tr.c b/20131202/c/src/tr.c
similarity index 96%
rename from 20120301_a/c/src/tr.c
rename to 20131202/c/src/tr.c
index 56c93eb..8c6fd54 100644
--- a/20120301_a/c/src/tr.c
+++ b/20131202/c/src/tr.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauTr(double r[3][3], double rt[3][3])
 /*
@@ -25,11 +25,11 @@ void iauTr(double r[3][3], double rt[3][3])
 **  Called:
 **     iauCr        copy r-matrix
 **
-**  This revision:  2008 May 22
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double wm[3][3];
@@ -47,7 +47,7 @@ void iauTr(double r[3][3], double rt[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/trxp.c b/20131202/c/src/trxp.c
similarity index 96%
rename from 20120301_a/c/src/trxp.c
rename to 20131202/c/src/trxp.c
index 948ca39..1468a9d 100644
--- a/20120301_a/c/src/trxp.c
+++ b/20131202/c/src/trxp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauTrxp(double r[3][3], double p[3], double trp[3])
 /*
@@ -27,11 +27,11 @@ void iauTrxp(double r[3][3], double p[3], double trp[3])
 **     iauTr        transpose r-matrix
 **     iauRxp       product of r-matrix and p-vector
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double tr[3][3];
@@ -47,7 +47,7 @@ void iauTrxp(double r[3][3], double p[3], double trp[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/trxpv.c b/20131202/c/src/trxpv.c
similarity index 96%
rename from 20120301_a/c/src/trxpv.c
rename to 20131202/c/src/trxpv.c
index 9f4156a..2eb5a01 100644
--- a/20120301_a/c/src/trxpv.c
+++ b/20131202/c/src/trxpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauTrxpv(double r[3][3], double pv[2][3], double trpv[2][3])
 /*
@@ -27,11 +27,11 @@ void iauTrxpv(double r[3][3], double pv[2][3], double trpv[2][3])
 **     iauTr        transpose r-matrix
 **     iauRxpv      product of r-matrix and pv-vector
 **
-**  This revision:  2008 October 28
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double tr[3][3];
@@ -47,7 +47,7 @@ void iauTrxpv(double r[3][3], double pv[2][3], double trpv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tttai.c b/20131202/c/src/tttai.c
similarity index 97%
rename from 20120301_a/c/src/tttai.c
rename to 20131202/c/src/tttai.c
index 0139442..49d49ba 100644
--- a/20120301_a/c/src/tttai.c
+++ b/20131202/c/src/tttai.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTttai(double tt1, double tt2, double *tai1, double *tai2)
 /*
@@ -38,11 +38,11 @@ int iauTttai(double tt1, double tt2, double *tai1, double *tai2)
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -64,7 +64,7 @@ int iauTttai(double tt1, double tt2, double *tai1, double *tai2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tttcg.c b/20131202/c/src/tttcg.c
similarity index 97%
rename from 20120301_a/c/src/tttcg.c
rename to 20131202/c/src/tttcg.c
index 124ff22..45f30c9 100644
--- a/20120301_a/c/src/tttcg.c
+++ b/20131202/c/src/tttcg.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTttcg(double tt1, double tt2, double *tcg1, double *tcg2)
 /*
@@ -37,11 +37,11 @@ int iauTttcg(double tt1, double tt2, double *tcg1, double *tcg2)
 **
 **     IAU 2000 Resolution B1.9
 **
-**  This revision:  2010 May 13
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
@@ -66,7 +66,7 @@ int iauTttcg(double tt1, double tt2, double *tcg1, double *tcg2)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/tttdb.c b/20131202/c/src/tttdb.c
similarity index 97%
rename from 20120301_a/c/src/tttdb.c
rename to 20131202/c/src/tttdb.c
index a8e611e..24baeae 100644
--- a/20120301_a/c/src/tttdb.c
+++ b/20131202/c/src/tttdb.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTttdb(double tt1, double tt2, double dtr,
              double *tdb1, double *tdb2)
@@ -50,11 +50,11 @@ int iauTttdb(double tt1, double tt2, double dtr,
 **
 **     IAU 2006 Resolution 3
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dtrd;
@@ -75,7 +75,7 @@ int iauTttdb(double tt1, double tt2, double dtr,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ttut1.c b/20131202/c/src/ttut1.c
similarity index 97%
rename from 20120301_a/c/src/ttut1.c
rename to 20131202/c/src/ttut1.c
index 3b1a3d8..9705943 100644
--- a/20120301_a/c/src/ttut1.c
+++ b/20131202/c/src/ttut1.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauTtut1(double tt1, double tt2, double dt,
              double *ut11, double *ut12)
@@ -39,11 +39,11 @@ int iauTtut1(double tt1, double tt2, double dt,
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dtd;
@@ -64,7 +64,7 @@ int iauTtut1(double tt1, double tt2, double dt,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ut1tai.c b/20131202/c/src/ut1tai.c
similarity index 97%
rename from 20120301_a/c/src/ut1tai.c
rename to 20131202/c/src/ut1tai.c
index 3779ccc..9c5b36b 100644
--- a/20120301_a/c/src/ut1tai.c
+++ b/20131202/c/src/ut1tai.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauUt1tai(double ut11, double ut12, double dta,
               double *tai1, double *tai2)
@@ -40,11 +40,11 @@ int iauUt1tai(double ut11, double ut12, double dta,
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dtad;
@@ -65,7 +65,7 @@ int iauUt1tai(double ut11, double ut12, double dta,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ut1tt.c b/20131202/c/src/ut1tt.c
similarity index 97%
rename from 20120301_a/c/src/ut1tt.c
rename to 20131202/c/src/ut1tt.c
index 3b53f51..5a3f43e 100644
--- a/20120301_a/c/src/ut1tt.c
+++ b/20131202/c/src/ut1tt.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauUt1tt(double ut11, double ut12, double dt,
              double *tt1, double *tt2)
@@ -39,11 +39,11 @@ int iauUt1tt(double ut11, double ut12, double dt,
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double dtd;
@@ -64,7 +64,7 @@ int iauUt1tt(double ut11, double ut12, double dt,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/ut1utc.c b/20131202/c/src/ut1utc.c
similarity index 97%
rename from 20120301_a/c/src/ut1utc.c
rename to 20131202/c/src/ut1utc.c
index e8789df..3dc8cda 100644
--- a/20120301_a/c/src/ut1utc.c
+++ b/20131202/c/src/ut1utc.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauUt1utc(double ut11, double ut12, double dut1,
               double *utc1, double *utc2)
@@ -51,7 +51,7 @@ int iauUt1utc(double ut11, double ut12, double dut1,
 **     handling.
 **
 **  5) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
+**     introduction of the time scale or that are too far in the future
 **     to be trusted.  See iauDat for further details.
 **
 **  Called:
@@ -67,11 +67,11 @@ int iauUt1utc(double ut11, double ut12, double dut1,
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2011 May 14
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int big1;
@@ -147,7 +147,7 @@ int iauUt1utc(double ut11, double ut12, double dut1,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/utctai.c b/20131202/c/src/utctai.c
similarity index 81%
rename from 20120301_a/c/src/utctai.c
rename to 20131202/c/src/utctai.c
index 2215b0c..1b1ee75 100644
--- a/20120301_a/c/src/utctai.c
+++ b/20131202/c/src/utctai.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
 /*
@@ -34,11 +34,14 @@ int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
 **  2) JD cannot unambiguously represent UTC during a leap second unless
 **     special measures are taken.  The convention in the present
 **     function is that the JD day represents UTC days whether the
-**     length is 86399, 86400 or 86401 SI seconds.
+**     length is 86399, 86400 or 86401 SI seconds.  In the 1960-1972 era
+**     there were smaller jumps (in either direction) each time the
+**     linear UTC(TAI) expression was changed, and these "mini-leaps"
+**     are also included in the SOFA convention.
 **
 **  3) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
-**     to be trusted.  See iauDat  for further details.
+**     introduction of the time scale or that are too far in the future
+**     to be trusted.  See iauDat for further details.
 **
 **  4) The function iauDtf2d converts from calendar date and time of day
 **     into 2-part Julian Date, and in the case of UTC implements the
@@ -60,17 +63,17 @@ int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
 **     Explanatory Supplement to the Astronomical Almanac,
 **     P. Kenneth Seidelmann (ed), University Science Books (1992)
 **
-**  This revision:  2010 September 10
+**  This revision:  2013 July 26
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 **
 */
 {
    int big1;
-   int iy, im, id, js, iyt, imt, idt;
-   double u1, u2, fd, dats, fdt, datst, ddat, z1, z2, a2;
+   int iy, im, id, j, iyt, imt, idt;
+   double u1, u2, fd, dat0, dat12, w, dat24, dlod, dleap, z1, z2, a2;
 
 
 /* Put the two parts of the UTC into big-first order. */
@@ -83,19 +86,31 @@ int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
       u2 = utc1;
    }
 
-/* Get TAI-UTC now. */
-   if ( iauJd2cal(u1, u2, &iy, &im, &id, &fd) ) return -1;
-   js = iauDat(iy, im, id, fd, &dats);
-   if ( js < 0 ) return -1;
+/* Get TAI-UTC at 0h today. */
+   j = iauJd2cal(u1, u2, &iy, &im, &id, &fd);
+   if ( j ) return j;
+   j = iauDat(iy, im, id, 0.0, &dat0);
+   if ( j < 0 ) return j;
 
-/* Get TAI-UTC tomorrow. */
-   if ( iauJd2cal(u1+1.5, u2-fd, &iyt, &imt, &idt, &fdt) ) return -1;
-   js = iauDat(iyt, imt, idt, fdt, &datst);
-   if ( js < 0 ) return -1;
+/* Get TAI-UTC at 12h today (to detect drift). */
+   j = iauDat(iy, im, id, 0.5, &dat12);
+   if ( j < 0 ) return j;
 
-/* If today ends in a leap second, scale the fraction into SI days. */
-   ddat = datst - dats;
-   if ( fabs(ddat) > 0.5 ) fd += fd * ddat / DAYSEC;
+/* Get TAI-UTC at 0h tomorrow (to detect jumps). */
+   j = iauJd2cal(u1+1.5, u2-fd, &iyt, &imt, &idt, &w);
+   if ( j ) return j;
+   j = iauDat(iyt, imt, idt, 0.0, &dat24);
+   if ( j < 0 ) return j;
+
+/* Separate TAI-UTC change into per-day (DLOD) and any jump (DLEAP). */
+   dlod = 2.0 * (dat12 - dat0);
+   dleap = dat24 - (dat0 + dlod);
+
+/* Remove any scaling applied to spread leap into preceding day. */
+   fd *= (DAYSEC+dleap)/DAYSEC;
+
+/* Scale from (pre-1972) UTC seconds to SI seconds. */
+   fd *= (DAYSEC+dlod)/DAYSEC;
 
 /* Today's calendar date to 2-part JD. */
    if ( iauCal2jd(iy, im, id, &z1, &z2) ) return -1;
@@ -103,7 +118,7 @@ int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
 /* Assemble the TAI result, preserving the UTC split and order. */
    a2 = z1 - u1;
    a2 += z2;
-   a2 += fd + dats / DAYSEC;
+   a2 += fd + dat0/DAYSEC;
    if ( big1 ) {
       *tai1 = u1;
       *tai2 = a2;
@@ -113,11 +128,11 @@ int iauUtctai(double utc1, double utc2, double *tai1, double *tai2)
    }
 
 /* Status. */
-   return js;
+   return j;
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/utcut1.c b/20131202/c/src/utcut1.c
similarity index 91%
rename from 20120301_a/c/src/utcut1.c
rename to 20131202/c/src/utcut1.c
index 42eba17..2a47102 100644
--- a/20120301_a/c/src/utcut1.c
+++ b/20131202/c/src/utcut1.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 int iauUtcut1(double utc1, double utc2, double dut1,
               double *ut11, double *ut12)
@@ -23,7 +23,7 @@ int iauUtcut1(double utc1, double utc2, double dut1,
 **     ut11,ut12  double   UT1 as a 2-part Julian Date (Note 6)
 **
 **  Returned (function value):
-**                int      status: +1 = dubious year (Note 7)
+**                int      status: +1 = dubious year (Note 3)
 **                                  0 = OK
 **                                 -1 = unacceptable date
 **
@@ -39,25 +39,21 @@ int iauUtcut1(double utc1, double utc2, double dut1,
 **     length is 86399, 86400 or 86401 SI seconds.
 **
 **  3) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
-**     to be trusted.  See iauDat  for further details.
+**     introduction of the time scale or that are too far in the future
+**     to be trusted.  See iauDat for further details.
 **
-**  4) The function iauDtf2d  converts from calendar date and time of
+**  4) The function iauDtf2d converts from calendar date and time of
 **     day into 2-part Julian Date, and in the case of UTC implements
 **     the leap-second-ambiguity convention described above.
 **
 **  5) Delta UT1 can be obtained from tabulations provided by the
-**     International Earth Rotation and Reference Systems Service.  It
-**     It is the caller's responsibility to supply a DUT argument
+**     International Earth Rotation and Reference Systems Service.
+**     It is the caller's responsibility to supply a dut1 argument
 **     containing the UT1-UTC value that matches the given UTC.
 **
 **  6) The returned ut11,ut12 are such that their sum is the UT1 Julian
 **     Date.
 **
-**  7) The warning status "dubious year" flags UTCs that predate the
-**     introduction of the time scale and that are too far in the future
-**     to be trusted.  See iauDat for further details.
-**
 **  References:
 **
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
@@ -72,11 +68,11 @@ int iauUtcut1(double utc1, double utc2, double dut1,
 **     iauUtctai    UTC to TAI
 **     iauTaiut1    TAI to UT1
 **
-**  This revision:  2010 May 16
+**  This revision:  2013 August 12
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    int iy, im, id, js, jw;
@@ -105,7 +101,7 @@ int iauUtcut1(double utc1, double utc2, double dut1,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/xy06.c b/20131202/c/src/xy06.c
similarity index 99%
rename from 20120301_a/c/src/xy06.c
rename to 20131202/c/src/xy06.c
index 09084d1..629ba3a 100644
--- a/20120301_a/c/src/xy06.c
+++ b/20131202/c/src/xy06.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauXy06(double date1, double date2, double *x, double *y)
 /*
@@ -90,16 +90,16 @@ void iauXy06(double date1, double date2, double *x, double *y)
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2009 October 16
+**  This revision:  2013 August 21
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
 
 /* Maximum power of T in the polynomials for X and Y */
-#define MAXPT (5)
+   enum { MAXPT = 5 };
 
 /* Polynomial coefficients (arcsec, X then Y). */
    static const double xyp[2][MAXPT+1] = {
@@ -2712,7 +2712,7 @@ void iauXy06(double date1, double date2, double *x, double *y)
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/xys00a.c b/20131202/c/src/xys00a.c
similarity index 97%
rename from 20120301_a/c/src/xys00a.c
rename to 20131202/c/src/xys00a.c
index 57f8607..3d79636 100644
--- a/20120301_a/c/src/xys00a.c
+++ b/20131202/c/src/xys00a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauXys00a(double date1, double date2,
                double *x, double *y, double *s)
@@ -64,11 +64,11 @@ void iauXys00a(double date1, double date2,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 12
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3];
@@ -87,7 +87,7 @@ void iauXys00a(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/xys00b.c b/20131202/c/src/xys00b.c
similarity index 97%
rename from 20120301_a/c/src/xys00b.c
rename to 20131202/c/src/xys00b.c
index 1f4f2b0..294e393 100644
--- a/20120301_a/c/src/xys00b.c
+++ b/20131202/c/src/xys00b.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauXys00b(double date1, double date2,
                double *x, double *y, double *s)
@@ -64,11 +64,11 @@ void iauXys00b(double date1, double date2,
 **     McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
 **     IERS Technical Note No. 32, BKG (2004)
 **
-**  This revision:  2008 May 12
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3];
@@ -87,7 +87,7 @@ void iauXys00b(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/xys06a.c b/20131202/c/src/xys06a.c
similarity index 96%
rename from 20120301_a/c/src/xys06a.c
rename to 20131202/c/src/xys06a.c
index f892054..5502ae6 100644
--- a/20120301_a/c/src/xys06a.c
+++ b/20131202/c/src/xys06a.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauXys06a(double date1, double date2,
                double *x, double *y, double *s)
@@ -64,17 +64,17 @@ void iauXys06a(double date1, double date2,
 **
 **     Wallace, P.T. & Capitaine, N., 2006, Astron.Astrophys. 459, 981
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    double rbpn[3][3];
 
 
-/* Form the bias-precession-nutation matrix, IAU 2000A. */
+/* Form the bias-precession-nutation matrix, IAU 2006/2000A. */
    iauPnm06a(date1, date2, rbpn);
 
 /* Extract X,Y. */
@@ -87,7 +87,7 @@ void iauXys06a(double date1, double date2,
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/zp.c b/20131202/c/src/zp.c
similarity index 96%
rename from 20120301_a/c/src/zp.c
rename to 20131202/c/src/zp.c
index a07504f..3168ea5 100644
--- a/20120301_a/c/src/zp.c
+++ b/20131202/c/src/zp.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauZp(double p[3])
 /*
@@ -16,11 +16,11 @@ void iauZp(double p[3])
 **  Returned:
 **     p        double[3]      p-vector
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    p[0] = 0.0;
@@ -31,7 +31,7 @@ void iauZp(double p[3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/zpv.c b/20131202/c/src/zpv.c
similarity index 96%
rename from 20120301_a/c/src/zpv.c
rename to 20131202/c/src/zpv.c
index c725fb4..68daeb7 100644
--- a/20120301_a/c/src/zpv.c
+++ b/20131202/c/src/zpv.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauZpv(double pv[2][3])
 /*
@@ -19,11 +19,11 @@ void iauZpv(double pv[2][3])
 **  Called:
 **     iauZp        zero p-vector
 **
-**  This revision:  2008 May 11
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    iauZp(pv[0]);
@@ -33,7 +33,7 @@ void iauZpv(double pv[2][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **
diff --git a/20120301_a/c/src/zr.c b/20131202/c/src/zr.c
similarity index 96%
rename from 20120301_a/c/src/zr.c
rename to 20131202/c/src/zr.c
index c6df0f9..a24ff4d 100644
--- a/20120301_a/c/src/zr.c
+++ b/20131202/c/src/zr.c
@@ -1,4 +1,4 @@
-#include "sofam.h"
+#include "sofa.h"
 
 void iauZr(double r[3][3])
 /*
@@ -16,11 +16,11 @@ void iauZr(double r[3][3])
 **  Returned:
 **     r        double[3][3]    r-matrix
 **
-**  This revision:  2012 April 3
+**  This revision:  2013 June 18
 **
-**  SOFA release 2012-03-01
+**  SOFA release 2013-12-02
 **
-**  Copyright (C) 2012 IAU SOFA Board.  See notes at end.
+**  Copyright (C) 2013 IAU SOFA Board.  See notes at end.
 */
 {
    r[0][0] = 0.0;
@@ -37,7 +37,7 @@ void iauZr(double r[3][3])
 
 /*----------------------------------------------------------------------
 **
-**  Copyright (C) 2012
+**  Copyright (C) 2013
 **  Standards Of Fundamental Astronomy Board
 **  of the International Astronomical Union.
 **

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/iausofa.git



More information about the debian-science-commits mailing list