FORTRAN Generation
(/./ftp/cats/VII/273)

Conversion of standardized ReadMe file for file /./ftp/cats/VII/273 into FORTRAN code for loading all data files into arrays.

Note that special values are assigned to unknown or unspecified numbers (also called NULL numbers); when necessary, the coordinate components making up the right ascension and declination are converted into floating-point numbers representing these angles in degrees.



      program load_ReadMe
C=============================================================================
C  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2018-Apr-25
C=============================================================================
*  This code was generated from the ReadMe file documenting a catalogue
*  according to the "Standard for Documentation of Astronomical Catalogues"
*  currently in use by the Astronomical Data Centers (CDS, ADC, A&A)
*  (see full documentation at URL http://vizier.u-strasbg.fr/doc/catstd.htx)
*  Please report problems or questions to   
C=============================================================================

      implicit none
*  Unspecified or NULL values, generally corresponding to blank columns,
*  are assigned one of the following special values:
*     rNULL__    for unknown or NULL floating-point values
*     iNULL__    for unknown or NULL   integer      values
      real*4     rNULL__
      integer*4  iNULL__
      parameter  (rNULL__=--2147483648.)  	! NULL real number
      parameter  (iNULL__=(-2147483647-1))	! NULL int  number
      integer    idig			! testing NULL number

C=============================================================================
Cat. VII/273            The Half Million Quasars (HMQ) catalogue       (Flesch, 2015)
*================================================================================
*The Half Million Quasars (HMQ) catalogue.
*     Flesch E.W.
*    <Pub. Astron. Soc. Australia 32, 10 (2015)>
*   =2015PASA...32...10F
*   =2015yCat.7273....0F
C=============================================================================

C  Internal variables

      integer*4 i__

c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

C  Declarations for 'hmq.dat'	! The Half Million Quasars catalogue

      integer*4 nr__
      parameter (nr__=510764)	! Number of records
      character*182 ar__   	! Full-size record

C  J2000 position composed of: RAdeg DEdeg
      real*8        RAdeg      (nr__) ! (deg) Right ascension (J2000) (1)
      real*8        DEdeg      (nr__) ! (deg) Declination (J2000) (1)
      character*25  Name       (nr__) ! ID from the literature
      character*1   Cl         (nr__) ! [ABKQq] Classification of object (2)
      character*3   Assoc      (nr__) ! [2RX ] Summary of associations for object (3)
      real*4        Rmag       (nr__) ! (mag) ?=- Red optical magnitude (4)
      real*4        Bmag       (nr__) ! (mag) ?=- Blue optical magnitude (4)
      character*3   Comment    (nr__) ! Comment on optical object (5)
      character*1   R          (nr__) ! [1nx-] Red optical PSF class (6)
      character*1   B          (nr__) ! [1nx-] Blue optical PSF class (6)
      real*4        z          (nr__) ! ? Redshift from the literature (7)
      integer*4     r_Name     (nr__) ! ? Reference for name, in refs.dat file
      integer*4     r_z        (nr__) ! ? Reference for redshift, in refs.dat file
      character*22  XName      (nr__) ! X-ray ID, if any (9)
      character*22  RName      (nr__) ! Radio ID, if any (9)
      character*22  Lobe1      (nr__) ! Radio lobe ID or extra R/X ID, if any (9)
      character*22  Lobe2      (nr__) ! Radio lobe ID or extra X-ray ID, if any (9)
*Note (1): These are to 7 decimals which is too precise, but which accomodates a
*     miniscule round-up which prevents inadvertent truncation by the user when
*     converting to sexagesimal.
*Note (2): Classification of object as follows:
*     Q = QSO from the literature, broad-line unresolved. 424748 of these.
*     A = AGN, extended/Seyferts/low-luminosity. 26623 of these.
*     B = BL Lac object, 1595 of these.
*     q = high-confidence photometric QSO from SDSS NBCKDE/XDQSO, 25015 of these.
*     K = type II objects, 32783 of these included for user reference.
*Note (3): Summary of associations for object as follows:
*     R = Radio association displayed.
*     X = X-ray association displayed.
*     2 = Double radio lobes displayed (declared by data-driven algorithm)
*Note (4): Optical data is from the APM (http://www.ast.cam.ac.uk/~mike/apmcat),
*     USNO-A & USNO-B (http://www.nofs.navy.mil), and the SDSS (http://sdss.org).
*     APM/USNO-A magnitudes have been recalibrated from the original values as
*     documented in QORG (2004A&A...427..387F, Cat. J/A+A/427/387), so such
*     USNO-A magnitudes are often used in preference to USNO-B.
*     APM galaxies < mag 17.0 are usually shown too bright due to PSF modelling.
*   Note: many SDSS magnitudes are extinction-"corrected" ~0.3mag brighter than
*   photometry.
*Note (5): Comment on optical object as follows:
*     p = optical magnitudes are POSS-I O (violet 4100{AA}) and E (red 6500{AA}).
*         These are preferred because O is well-offset from E, and these plates
*         were always taken on the same night, thus the red-blue color is
*         correct even for variable objects.
*     j = blue magnitude is SERC J (Bj 4800{AA} blue-green) from the POSS-II or
*         UKST surveys.  Red-blue color is less reliable because the plates were
*         taken in different epochs, i.e. years apart.
*     g = blue magnitude is SDSS green 4900{AA}.
*     u = blue magnitude is SDSS ultraviolet 3850{AA}.
*     b = blue magnitude is Vega 4400{AA}.
*     v = red magnitude is visual, ie, white, 5500{AA} midpoint.
*     i = red magnitude is infrared 7500{AA}.
*     z = red magnitude is infrared z 8500{AA}.
*     k = red magnitude is infrared k 22000{AA}.
*     (not v/i/z/k) = standard red color 6500{AA}.
*     + = variability nominally(*) detected for both red & blue.
*     m = proper motion nominally(*) detected.
*     a = object is an SDSS galaxy with AGN subclass.  If also BROADLINE then
*         HMQ class is 'A', otherwise 'K' (see note 2).
*     ? = identification uncertain (quasar may be located elsewhere).
*
*  (*) from USNO-B or Flesch & Hardcastle, 2004A&A...427..387F, section A.1 end
*Note (6): The APM, USNO-B, and SDSS provide PSF class, albeit using different
*     criteria. These are shown here as follows:
*     - = point source / stellar PSF (APM notation: -1, here truncated)
*     1 = fuzzy / galaxy shape       (APM notation: 1 and some 2)
*     n = no PSF available, whether borderline or too faint to tell, etc.
*     x = not seen in this color (fainter than plate depth, or confused, etc.)
*Note (7): Photometric redshifts are rounded to 0.1 z.
*Note (9): Four columns of Radio/X-ray detections are presented:
*   * 1st column: best X-ray detection (i.e. highest probability association).
*   * 2nd column: best core Radio detection.
*   * 3rd column: a radio lobe if the associations (see note 3) show a "2",
*                 otherwise this is an additional radio or X-ray detection.
*   * 4th column: a radio lobe if the associations (see note 3) show a "2",
*                 otherwise this is an additional X-ray detection.
*
*     Legend of Radio/X-ray detections and catalog home pages:
*    FIRST: VLA FIRST survey, 13Jun05 version, http://sundog.stsci.edu
*     NVSS: NRAO VLA sky survey, http://www.cv.nrao.edu/nvss
*    SUMSS: Sydney U. Molonglo, http://www.physics.usyd.edu.au/sifa/Main/SUMSS
*     MGPS: Molonglo galactic plane survey, same attribution as SUMSS
*    ROSAT: catalogs home page: www.mpe.mpg.de/xray/wave/rosat/catalogue for:
*         : 1RXH = ROSAT HRI (high resolution imager)
*         : 1RXS = ROSAT RASS (all-sky survey, both bright & faint)
*         : 2RXP/2RXF = ROSAT PSPC (position sensitive proportional counter)
*     1WGA: White, Giommi & Angelini, wgacat.gsfc.nasa.gov/wgacat/wgacat.html
*      CXO: Chandra Source Catalog, http://cxc.cfa.harvard.edu/csc
*     CXOX: XAssist Chandra source list, http://xassist.pha.jhu.edu/zope/xassist
*     3XMM: XMM-Newton, http://xmm.esac.esa.int/xsa
*    XMMSL: XMM-Newton Slew survey, http://xmm.esac.esa.int/xsa
*     XMMX: XAssist XMM-Newton source list, xassist.pha.jhu.edu/zope/xassist
*    1SXPS: Swift X-ray Point Source catalog, http://www.swift.ac.uk/1SXPS
*
*     Optical field solutions are calculated from the raw source positions of
*     all these catalogs as described in my ARXA paper (2010PASA...27..283F,
*     Cat. V/134).

c - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

C  Declarations for 'refs.dat'	! References

      integer*4 nr__1
      parameter (nr__1=2171)	! Number of records
      character*159 ar__1  	! Full-size record

      integer*4     Ref        (nr__1) ! [1/2171] Reference number
      integer*4     NName      (nr__1) ! ? Count of times used as a citation for the
*                                    name. (excluding type 2) (1)
      integer*4     Nz         (nr__1) ! ? Count of times used as a citation for the
*                                    redshift. (excl. type 2) (1)
      character*19  BibCode    (nr__1) ! BibCode
      character*120 Details    (nr__1) ! Standard authors list, year, journal volume &
*                                  page, and sometimes a brief description or
*                                  website
*Note (1): The citation for the classification (e.g., that the object is a
*  quasar) can be from either the name or redshift citation.

C=============================================================================

C  Loading file 'hmq.dat'	! The Half Million Quasars catalogue

C  Format for file interpretation

    1 format(
     +  F11.7,1X,F11.7,2X,A25,1X,A1,A3,1X,F4.1,1X,F4.1,1X,A3,1X,A1,1X,
     +  A1,1X,F6.3,1X,I4,1X,I4,1X,A22,1X,A22,1X,A22,1X,A22)

C  Effective file loading

      open(unit=1,status='old',file=
     +'hmq.dat')
      write(6,*) '....Loading file: hmq.dat'
      do i__=1,510764
        read(1,'(A182)')ar__
        read(ar__,1)
     +  RAdeg(i__),DEdeg(i__),Name(i__),Cl(i__),Assoc(i__),Rmag(i__),
     +  Bmag(i__),Comment(i__),R(i__),B(i__),z(i__),r_Name(i__),
     +  r_z(i__),XName(i__),RName(i__),Lobe1(i__),Lobe2(i__)
        if (idig(ar__(57:60)).EQ.0) Rmag(i__) =  rNULL__
        if (idig(ar__(62:65)).EQ.0) Bmag(i__) =  rNULL__
        if(ar__(75:80) .EQ. '') z(i__) = rNULL__
        if(ar__(82:85) .EQ. '') r_Name(i__) = iNULL__
        if(ar__(87:90) .EQ. '') r_z(i__) = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg(i__),DEdeg(i__),Name(i__),Cl(i__),Assoc(i__),Rmag(i__),
     +  Bmag(i__),Comment(i__),R(i__),B(i__),z(i__),r_Name(i__),
     +  r_z(i__),XName(i__),RName(i__),Lobe1(i__),Lobe2(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

C=============================================================================

C  Loading file 'refs.dat'	! References

C  Format for file interpretation

    2 format(I4,1X,I6,1X,I6,1X,A19,1X,A120)

C  Effective file loading

      open(unit=1,status='old',file=
     +'refs.dat')
      write(6,*) '....Loading file: refs.dat'
      do i__=1,2171
        read(1,'(A159)')ar__1
        read(ar__1,2)
     +  Ref(i__),NName(i__),Nz(i__),BibCode(i__),Details(i__)
        if(ar__1(6:11) .EQ. '') NName(i__) = iNULL__
        if(ar__1(13:18) .EQ. '') Nz(i__) = iNULL__
c    ..............Just test output...........
        write(6,2)
     +  Ref(i__),NName(i__),Nz(i__),BibCode(i__),Details(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

C=============================================================================
      stop
      end

C Locate position of first digit in string; or return 0
      integer function idig(c)
      character*(*) c
      character*1 c1
      integer lc,i
      lc=len(c)
      idig=0
      do i=1,lc
         if(c(i:i).ne.' ') go to 1
      end do
    1 if(i.gt.lc) return
      c1=c(i:i)
      if(c1.eq.'.'.or.c1.eq.'-'.or.c1.eq.'+') i=i+1
      if(i.gt.lc) return
      c1=c(i:i)
      if(c1.ge.'0'.and.c1.le.'9') idig=i
      return
      end