%N radhms %F $MIR/src/subs/deghms.for
%D Write out ra and dec in hms/dms from input in radians
%P bpw
%: coordinates
%B
      subroutine radhms ( a, d, radec )
      double precision a, d
      character*(*)    radec

 radhms takes as input the right ascension and declination in radians and
 constructs the string 'hh mm ss.ss sdd mm ss.ss'.
 characters 1 through 12 correspond to ra, 13 through 24 to dec.
 Care is taken that hours are between 0 and 24, minutes and seconds between
 0 and 60. I.e. ra=0 60 00.0 can not occur.
 Further, if minutes or seconds are less than 10, an extra 0 is added, i.e.
 9 minutes is written as 09 minutes.
 Finally, if hours or degrees are less than 10, there is no extra space, i.e.
 1 hours comes out as 'ra=1 00 00.0', not 'ra= 1 00 00.0' and -1 degree comes
 out as 'dec=-1 00 00.0', not 'dec=- 1 00 00.0'.

 Input:
   a:     right ascension in radians
   d:     declination in radians

 Output:
   radec: resulting output string
