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

 deghms takes as input the right ascension and declination in degrees 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 degrees
   d:     declination in degrees

 Output:
   radec: resulting output string
