CDS.headStuff2 FORTRAN Generation
()

Conversion of standardized ReadMe file for catalog 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 2024-Apr-26
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. V/147          The SDSS Photometric Catalogue, Release 12          (Alam+, 2015)
*================================================================================
*The SDSS Photometric Catalogue, Data Release 12 (DR12)
*     Alam S. et al.
*    <Astrophys. J. Suppl. Ser. 219, 12 (2015)>
*    =2015ApJS..219...12A
*    =2016yCat.5147....0A
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'sdss12.sam'	! *Sample output of the SDSS photometric catalog

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

C  Position composed of: RAdeg DEdeg
      real*8        RAdeg      (nr__) ! (deg) Right Ascension of the object (ICRS)
*                                   at Epoch="ObsDate" (ra)
      real*8        DEdeg      (nr__) ! (deg) Declination of the object (ICRS)
*                                   at Epoch="ObsDate" (dec)
      integer*4     mode       (nr__) ! [1/2] 1: primary  (469,053,874 sources),
*                                   2: secondary (324,960,094 sources)
      character*1   q_mode     (nr__) ! [+] '+' indicates clean photometry
*                                   (310,190,812 sources with mode 1+) (clean)
      integer*4     class      (nr__) ! Type of object (3=galaxy, 6=star) (1)
      character*19  SDSS12     (nr__) ! SDSS-DR12 name, based on J2000 position
      character*1   m_SDSS12   (nr__) ! [*] The asterisk indicates that 2 different
*                                   SDSS objects share the same SDSS12 name
      character*20  SDSS_ID    (nr__) ! [0-9 -] SDSS object identifier (2)
      integer*8     objID      (nr__) ! SDSS unique object identifier (2)
      character*15  Sp_ID      (nr__) ! ? Spectroscopic Plate-MJD-Fiber identifier (7)
      integer*8     SpObjID    (nr__) ! Pointer to the spectrum of object, or 0 (7)
      integer*8     parentID   (nr__) ! Pointer to parent (if object deblended)
      integer*8     flags      (nr__) ! Photo Object Attribute flags (3)
      integer*4     Status     (nr__) ! Hexadecimal status (4)
      real*4        e_RAdeg    (nr__) ! (arcsec) [0/51703] Mean error on RAdeg (raErr)
      real*4        e_DEdeg    (nr__) ! (arcsec) [0/20301] Mean error on DEdeg (decErr)
      real*8        ObsDate    (nr__) ! (yr) Mean Observation date (6)
      integer*4     Q          (nr__) ! [1/3] Quality of the observation:
*                                  1=bad 2=acceptable 3=good
      real*4        umag       (nr__) ! (mag) [4/38]? Model magnitude in u filter, AB scale
*                                   (u) (5)
      real*4        e_umag     (nr__) ! (mag) ? Mean error on umag (err_u)
      real*4        gmag       (nr__) ! (mag) [5/40]? Model magnitude in g filter, AB scale
*                                   (g) (5)
      real*4        e_gmag     (nr__) ! (mag) ? Mean error on gmag (err_g)
      real*4        rmag       (nr__) ! (mag) [4/39]? Model magnitude in r filter, AB scale
*                                   (r) (5)
      real*4        e_rmag     (nr__) ! (mag) ? Mean error on rmag (err_r)
      real*4        imag       (nr__) ! (mag) [3/40]? Model magnitude in i filter, AB scale
*                                   (i) (5)
      real*4        e_imag     (nr__) ! (mag) ? Mean error on imag (err_i)
      real*4        zmag       (nr__) ! (mag) [3/38]? Model magnitude in z filter, AB scale
*                                   (z) (5)
      real*4        e_zmag     (nr__) ! (mag) ? Mean error on zmag (err_z)
*--------------------------------------------------------------------------------
      real*8        zsp        (nr__) ! [-0.02/7.1]? Spectroscopic redshift
*                                   (when SpObjID>0) (7)
      real*8        e_zsp      (nr__) ! ? Mean error on zsp (negative for bad fit) (7)
      integer*4     f_zsp      (nr__) ! [0/196]? "zwarning" flag (9)
      real*8        Vdisp      (nr__) ! (km/s) [0/850]? Velocity dispersion (velDisp)
      real*4        e_Vdisp    (nr__) ! (km/s) ? Mean error on Vdisp (velDispErr)
      character*4   spInst     (nr__) ! ? Spectral instrument used (SDSS or BOSS)
*                                    (instrument)
      character*19  spType     (nr__) ! ? Source type (sourceType) (10)
      character*6   spCl       (nr__) ! ? Spectroscopic class: GALAXY, QSO,
*                                    STAR
      character*21  subCl      (nr__) ! ? Spectroscopic subclass (subClass) (11)
      real*4        spS_N      (nr__) ! [0/132]? Median signal-to-noise over all good
*                                    pixels (snMedian)
*--------------------------------------------------------------------------------
      integer*8     uFlags     (nr__) ! Detection flags, u band (flags_u) (3)
      integer*4     us         (nr__) ! 0=notStar, 1=Star in u band (probPSF_u)
      integer*4     uc         (nr__) ! [0/6] Phototype in u band, 6=Star (type_u) (1)
      real*8        uDate      (nr__) ! (yr) Date of observation in u band (6)
      real*4        u_mag      (nr__) ! (mag) [4/38]? Model magnitude in u' filter (= umag)
*                                    (5)
      real*4        e_u_mag    (nr__) ! (mag) ? Mean error on u'mag (= e_umag)
      real*4        upmag      (nr__) ! (mag) [5/34]? PSF magnitude in u band (psfMag_u)
      real*4        e_upmag    (nr__) ! (mag) ? Mean error on upmag (psfMagErr_u)
      real*4        uPmag_1    (nr__) ! (mag) [3/43]? Petrosian magnitude in u band
*                                    (petroMag_u)
      real*4        e_uPmag_1  (nr__) ! (mag) ? Mean error on  uPmag (petroMagErr_u)
      real*8        uPrad      (nr__) ! (arcsec) [0/260]? Petrosian radius in u band
*                                    (petroRad_u)
      real*8        e_uPrad    (nr__) ! (arcsec) ?=-1000 Mean error in uPrad (petroRadErr_u)
      real*4        uoRA       (nr__) ! (arcsec) ? Offset of u position along RA (offsetRa_u)
      real*4        uoDE       (nr__) ! (arcsec) ? Offset of u position along Dec
*                                     (offsetDec_u)
      real*8        udVrad     (nr__) ! (arcsec) ? de Vaucouleurs fit radius, u band
*                                     (deVRad_u)
      real*8        udVell     (nr__) ! (arcsec) ? de Vaucouleurs fit ellipt, u band
*                                     (1-deVAB_u)
      real*4        uPA        (nr__) ! (deg) ? Position angle of dVrad in u band
*                                     (deVPhi_u)
*--------------------------------------------------------------------------------
      integer*8     gFlags     (nr__) ! Detection flags, g band (flags_g) (3)
      integer*4     gs         (nr__) ! 0=notStar, 1=Star in g band (probPSF_g)
      integer*4     gc         (nr__) ! Phototype in g band, 6=Star (type_g) (1)
      real*8        gDate      (nr__) ! (yr) Date of observation in g band (6)
      real*4        g_mag      (nr__) ! (mag) [5/39]? Model magnitude in g' filter (= gmag)
*                                     (5)
      real*4        e_g_mag    (nr__) ! (mag) ? Mean error on g'mag (= e_gmag)
      real*4        gpmag      (nr__) ! (mag) [5/37]? PSF magnitude in g band (psfMag_g)
      real*4        e_gpmag    (nr__) ! (mag) ? Mean error on gpmag (psfMagErr_g)
      real*4        gPmag_1    (nr__) ! (mag) [4/46]? Petrosian magnitude in g band
*                                     (petroMag_g)
      real*4        e_gPmag_1  (nr__) ! (mag) ? Mean error on  gPmag (petroMagErr_g)
      real*8        gPrad      (nr__) ! (arcsec) ? Petrosian radius in g band (petroRad_g)
      real*8        e_gPrad    (nr__) ! (arcsec) ?=-1000 Mean error in gPrad (petroRadErr_g)
      real*4        goRA       (nr__) ! (arcsec) ? Offset of g position along RA (offsetRa_g)
      real*4        goDE       (nr__) ! (arcsec) ? Offset of g position along Dec
*                                      (offsetDec_g)
      real*8        gdVrad     (nr__) ! (arcsec) ? de Vaucouleurs fit radius, g band
*                                      (deVRad_g)
      real*8        gdVell     (nr__) ! (arcsec) ? de Vaucouleurs fit ellipt, g band
*                                      (1-deVAB_g)
      real*4        gPA        (nr__) ! (deg) ? Position angle of dVrad in g band
*                                      (deVPhi_g)
*--------------------------------------------------------------------------------
      integer*8     rFlags     (nr__) ! Detection flags, r band (flags_r) (3)
      integer*4     rs         (nr__) ! 0=notStar, 1=Star in r band (probPSF_r)
      integer*4     rc         (nr__) ! Phototype in r band, 6=Star (type_r) (1)
      real*8        rDate      (nr__) ! (yr) Date of observation in r band (6)
      real*4        r_mag      (nr__) ! (mag) [4/39]? Model magnitude in r' filter (= rmag)
*                                      (5)
      real*4        e_r_mag    (nr__) ! (mag) ? Mean error on r'mag (= e_rmag)
      real*4        rpmag      (nr__) ! (mag) [4/33]? PSF magnitude in r band (psfMag_r)
      real*4        e_rpmag    (nr__) ! (mag) ? Mean error on rpmag (psfMagErr_r)
      real*4        rPmag_1    (nr__) ! (mag) [4/43]? Petrosian magnitude in r band
*                                      (petroMag_r)
      real*4        e_rPmag_1  (nr__) ! (mag) ? Mean error on  rPmag (petroMagErr_r)
      real*8        rPrad      (nr__) ! (arcsec) ? Petrosian radius in r band (petroRad_r)
      real*8        e_rPrad    (nr__) ! (arcsec) ?=-1000 Mean error in rPrad (petroRadErr_r)
      real*4        roRA       (nr__) ! (arcsec) ? Offset of r position along RA (offsetRa_r)
      real*4        roDE       (nr__) ! (arcsec) ? Offset of r position along Dec
*                                       (offsetDec_r)
      real*8        rdVrad     (nr__) ! (arcsec) ? de Vaucouleurs fit radius, r band
*                                       (deVRad_r)
      real*8        rdVell     (nr__) ! (arcsec) ? de Vaucouleurs fit ellipt, r band
*                                       (1-deVAB_r)
      real*4        rPA        (nr__) ! (deg) ? Position angle of dVrad in r band
*                                       (deVPhi_r)
*--------------------------------------------------------------------------------
      integer*8     iFlags     (nr__) ! Detection flags, i band (flags_i) (3)
      integer*4     is         (nr__) ! 0=notStar, 1=Star in i band (probPSF_i)
      integer*4     ic         (nr__) ! Phototype in i band, 6=Star (type_i) (1)
      real*8        iDate      (nr__) ! (yr) Date of observation in i band (6)
      real*4        i_mag      (nr__) ! (mag) [3/40]? Model magnitude in i' filter (= imag)
*                                       (5)
      real*4        e_i_mag    (nr__) ! (mag) ? Mean error on i'mag (= e_imag)
      real*4        ipmag      (nr__) ! (mag) [3/34]? PSF magnitude in i band (psfMag_i)
      real*4        e_ipmag    (nr__) ! (mag) ? Mean error on ipmag (psfMagErr_i)
      real*4        iPmag_1    (nr__) ! (mag) [3/45]? Petrosian magnitude in i band
*                                       (petroMag_i)
      real*4        e_iPmag_1  (nr__) ! (mag) ? Mean error on  iPmag (petroMagErr_i)
      real*8        iPrad      (nr__) ! (arcsec) ? Petrosian radius in i band (petroRad_i)
      real*8        e_iPrad    (nr__) ! (arcsec) ?=-1000 Mean error in iPrad (petroRadErr_i)
      real*4        ioRA       (nr__) ! (arcsec) ? Offset of i position along RA (offsetRa_i)
      real*4        ioDE       (nr__) ! (arcsec) ? Offset of i position along Dec
*                                       (offsetDec_i)
      real*8        idVrad     (nr__) ! (arcsec) ? de Vaucouleurs fit radius, i band
*                                       (deVRad_i)
      real*8        idVell     (nr__) ! (arcsec) ? de Vaucouleurs fit ellipt, i band
*                                       (1-deVAB_i)
      real*4        iPA        (nr__) ! (deg) ? Position angle of dVrad in i band
*                                       (deVPhi_i)
*--------------------------------------------------------------------------------
      integer*8     zFlags     (nr__) ! Detection flags, z band (flags_z) (3)
      integer*4     zs         (nr__) ! 0=notStar, 1=Star in z band (probPSF_z)
      integer*4     zc         (nr__) ! Phototype in z band, 6=Star (type_z) (1)
      real*8        zDate      (nr__) ! (yr) Date of observation in z band (6)
      real*4        z_mag      (nr__) ! (mag) [3/38]? Model magnitude in z filter (= zmag)
*                                       (5)
      real*4        e_z_mag    (nr__) ! (mag) ? Mean error on z'mag (= e_zmag)
      real*4        zpmag      (nr__) ! (mag) [3/32]? PSF magnitude in z band (psfMag_z)
      real*4        e_zpmag    (nr__) ! (mag) ? Mean error on zpmag (psfMagErr_z)
      real*4        zPmag_1    (nr__) ! (mag) [3/42]? Petrosian magnitude in z band
*                                       (petroMag_z)
      real*4        e_zPmag_1  (nr__) ! (mag) ? Mean error on  zPmag (petroMagErr_z)
      real*8        zPrad      (nr__) ! (arcsec) ? Petrosian radius in z band (petroRad_z)
      real*8        e_zPrad    (nr__) ! (arcsec) ?=-1000 Mean error in zPrad (petroRadErr_z)
      real*4        zoRA       (nr__) ! (arcsec) ? Offset of z position along RA (offsetRa_z)
      real*4        zoDE       (nr__) ! (arcsec) ? Offset of z position along Dec
*                                       (offsetDec_z)
      real*8        zdVrad     (nr__) ! (arcsec) ? de Vaucouleurs fit radius, z band
*                                      (deVRad_z)
      real*8        zdVell     (nr__) ! (arcsec) ? de Vaucouleurs fit ellipt, z band
*                                     (1-deVAB_z)
      real*4        zPA        (nr__) ! (deg) ? Position angle of dVrad in z band
*                                   (deVPhi_z)
*--------------------------------------------------------------------------------
      real*8        pmRA       (nr__) ! (mas/yr) [-6121/4129]? Proper motion along Right
*                                   Ascension (pmRa) (8)
      real*4        e_pmRA     (nr__) ! (mas/yr) ? Mean error on pmRA (pmRaErr) (8)
      real*8        pmDE       (nr__) ! (mas/yr) [-4846/4437]? Proper motion along Declination
*                                   (pmDec) (8)
      real*4        e_pmDE     (nr__) ! (mas/yr) ? Mean error on pmDE (pmDecErr) (8)
      real*8        sigRA      (nr__) ! (mas) [0/8662]? RMS residual of proper motion fit
*                                   in RA (8)
      real*4        sigDE      (nr__) ! (mas) [0/10625]? RMS residual of proper motion fit
*                                   in Dec (8)
      integer*4     M          (nr__) ! [1/4]?=-1 Number of USNO-B objects matched
*                                   within 1arcsec (match) (8)
      integer*4     N          (nr__) ! [4/6]?=-1 Number of detections used in the pm
*                                   fit, including SDSS (nFit) (8)
      real*4        g_O        (nr__) ! ? Magnitude from O plate recalibrated to g (8)
      real*4        r_E        (nr__) ! ? Magnitude from E plate recalibrated to r (8)
      real*4        g_J        (nr__) ! ? Magnitude from J plate recalibrated to g (8)
      real*4        r_F        (nr__) ! ? Magnitude from F plate recalibrated to r (8)
      real*4        i_N        (nr__) ! ? Magnitude from N plate recalibrated to i (8)
      real*8        zph        (nr__) ! [-9999/]? Photometric redshift; estimated
*                                   by robust fit to nearest neighbors in
*                                   a reference set (12)
      real*8        e_zph      (nr__) ! [-9999/]? Estimated error of the
*                                   photometric redshift (zErr) (12)
      real*4        v_zph_     (nr__) ! [0.009/0.9]? average redshift of the nearest
*                                   neighbors; if significantly different from
*                                   zph this might be a better estimate than zph
*                                   (nnAvgZ)
      real*8        chi2       (nr__) ! ? Chi-square value for the minimum
*                                   chi-square template fit (chisq_zph)
      real*8        u_Mag_1    (nr__) ! (mag) [-644/4]? rest frame u' absolute magnitude
*                                   (absMagU)
      real*8        g_Mag_1    (nr__) ! (mag) [-472/3]? rest frame g' absolute magnitude
*                                   (absMagG)
      real*8        r_Mag_1    (nr__) ! (mag) [-351/3]? rest frame r' absolute magnitude
*                                   (absMagR)
      real*8        i_Mag_1    (nr__) ! (mag) [-271/7]? rest frame i' absolute magnitude
*                                   (absMagI)
      real*8        z_Mag_1    (nr__) ! (mag) [-199/3]? rest frame z' absolute magnitude
*                                   (absMagZ)
*Note (1): The type (class) is numbered as follows:
*      0 = Unknown: Object type is not known.
*      1 = Cosmic-ray track (not used).
*      2 = Defect (not used)
*      3 = Galaxy: An extended object composed of many stars and other matter
*          (208,478,448 with mode=1 occurrences)
*      4 = Ghost: Object created by reflected or refracted light. (not used)
*      5 = KnownObject: Object came from some other catalog (not yet used)
*      6 = Star: A a self-luminous gaseous celestial body
*          (260,562,744 with mode=1 occurrences)
*      7 = Trail: A satellite or asteroid or meteor trail. (not yet used)
*      8 = Sky: Blank sky spectrogram (no objects in this arcsecond area).
*      9 = NotAType (not used)
*Note (2): The SDSS identifier is composed of the 5 numbers run, rerun
*     (301), camcol (1-6), field (11-1001) and object (1-16000). The SDSS-ID
*     is written run-rerun-cam-field-obj (5 numbers and 4 dashes). The objID
*     is also combined from these numbers (the <<n operator represents the
*     left shift of n bits, i.e. a multiplication by 2^n):
*     objID = skyVersion<<59 + rerun<<48 + run<<32 + camcol<<29
*           + field<<16 + obj
*     (in the case of DR8-9, skyVersion=2 and rerun=301, i.e. objID is in the
*     range 1237645472596754432-1237926947573465087
*     (hexa 112d000000000000-112dffffffffffff).
*Note (3): flags written in hexadecimal, full description available at
*   http://skyserver.sdss.org/dr12/en/help/browser/browser.aspx#\
*   &&history=search+PhotoFlags
* ------------------------------------------------------------------------------
* 0000000000000001 = CANONICAL_CENTER   Measurements used the center in r*
* 0000000000000002 = BRIGHT             Object detected in bright object-finding
* 0000000000000004 = EDGE               Object is too close to edge of frame
* 0000000000000008 = BLENDED            Multiple peaks detected
* 0000000000000010 = CHILD              Product of deblending a BLENDED object.
* 0000000000000020 = PEAKCENTER         Position of peak pixel rather than ML
* 0000000000000040 = NODEBLEND          No deblending attempted on BLENDED object
* 0000000000000080 = NOPROFILE          Radial profile could not be estimated
* 0000000000000100 = NOPETRO            No valid Petrosian radius found
* 0000000000000200 = MANYPETRO          More than one Petrosian radius found.
* 0000000000000400 = NOPETRO_BIG        Petrosian radius beyond radial profile.
* 0000000000000800 = DEBLENDTOOMANY_PEAKS More than 25 peaks in this object
* 0000000000001000 = COSMIC_RAY         Contains a pixel part of a cosmic ray.
* 0000000000002000 = MANYR50            More than one 50% light radius.
* 0000000000004000 = MANYR90            More than one 90% light radius.
* 0000000000008000 = BAD_RADIAL         Some points in radial profile S/N<0
* 0000000000010000 = INCOMPLETE_PROFILE Petrosian radius intersects frame edge
* 0000000000020000 = INTERP             Pixel(s) determined by interpolation.
* 0000000000040000 = SATURATED          Saturated pixel(s)
* 0000000000080000 = NOTCHECKED         Not checked for local peaks
* 0000000000100000 = SUBTRACTED         BRIGHT object, wings subtracted
* 0000000000200000 = NOSTOKES           No measured Stokes params
* 0000000000400000 = BADSKY             Sky level so bad that highest pixel <0.
* 0000000000800000 = PETROFAINT         Petrosian radius(es) rejected for low SB
* 0000000001000000 = TOO_LARGE          Object too large to measure its profile
* 0000000002000000 = DEBLENDEDASPSF   Deblender treated obj as PSF
* 0000000004000000 = DEBLEND_PRUNED     At least one child was removed
* 0000000008000000 = ELLIPFAINT         Object center fainter than the isophote
* 0000000010000000 = BINNED1            Object detected in 1x1 binned image
* 0000000020000000 = BINNED2            Object detected in 2x2 binned image
* 0000000040000000 = BINNED4            Object detected in 4x4 binned image
* 0000000080000000 = MOVED              Possibly moving object
* 0000000100000000 = DEBLENDEDASMOVING A MOVED object treated as moving.
* 0000000200000000 = NODEBLEND_MOVING    A MOVED object not treated as moving.
* 0000000400000000 = TOOFEWDETECTIONS Too few detections to deblend as moving.
* 0000000800000000 = BADMOVINGFIT     Moving fit too poor to be believable.
* 0000001000000000 = STATIONARY         Object consistent with being stationary.
* 0000002000000000 = PEAKSTOOCLOSE    Some peaks merged into a single peak.
* 0000004000000000 = MEDIAN_CENTER      Center given is of median-smoothed image.
* 0000008000000000 = LOCAL_EDGE         Center too close to an edge.
* 0000010000000000 = BADCOUNTSERROR   Too few good pixels, error underestimated
* 0000020000000000 = BADMOVINGFIT_CHILD Moving child's velocity fit too poor
* 0000040000000000 = DEBLENDUNASSIGNEDFLUX  After deblending flux not assigned
* 0000080000000000 = SATUR_CENTER        Center is close to saturated pixel(s)
* 0000100000000000 = INTERP_CENTER       Center is close to interpolated pixel(s)
* 0000200000000000 = DEBLENDEDATEDGE   Object close to edge was deblended
* 0000400000000000 = DEBLEND_NOPEAK      No detected peak within this child
* 0000800000000000 = PSFFLUXINTERP     PSF flux from interpolated pixels > 20%
* 0001000000000000 = TOOFEWGOOD_DETECTIONS Too few good detections
* 0002000000000000 = CENTEROFFAIMAGE   At least one peak's center lay off image
* 0004000000000000 = DEBLEND_DEGENERATE  Identical candidate children, 1 retained
* 0008000000000000 = BRIGHTESTGALAXYCHILD Brightest member classified as galaxy
* 0010000000000000 = CANONICAL_BAND       Band chosen as 'Canonical', generally r
* 0020000000000000 = AMOMENT_FAINT        Object too faint to measure moments
* 0040000000000000 = AMOMENT_SHIFT        Centroid shift too large
* 0080000000000000 = AMOMENT_MAXITER      Maximum number of iterations exceeded
* 0100000000000000 = MAYBE_CR             Object could actually be a cosmic ray
* 0200000000000000 = MAYBE_EGHOST         Object could actually be a ghost
* 0400000000000000 = NOTCHECKED_CENTER    Object center in a region not searched
* 0800000000000000 = OBJECT2HASSATUR_DN Trails included in estimated flux.
* 1000000000000020 = OBJECT2DEBLENDPEEPHOLE Deblend modified by peephole
* 2000000000000020 = GROWN_MERGED         Growing led to a merger
* 4000000000000020 = HAS_CENTER           Object has a canonical center
* 8000000000000020 = RESERVED             Not used
* ------------------------------------------------------------------------------
*Note (4): status flags written in hexadecimal, full description available at
* http://skyserver.sdss3.org/dr9/en/help/browser/enum.asp?n=ResolveStatus
* Identical in http://skyserver.sdss.org/dr12/en/help/browser/browser.aspx#\
*              &&history=search+ResolveStatus
* ------------------------------------------------------------------------------
* 00000001 = RUN_PRIMARY      Object status set in reference to its own run
* 00000002 = RUN_RAMP         Object in what would be the overlap area of a field
* 00000004 = RUN_OVERLAPONLY  Object only appears in the overlap between 2 fields
* 00000008 = RUN_IGNORE       Bright or parent object that should be ignored
* 00000010 = RUN_EDGE         Object near lowest or highest column
* 00000020 = RUN_DUPLICATE    Duplicate measurements of same pixels in 2 fields
* 00000100 = SURVEY_PRIMARY   Primary observation within survey (mode=1)
* 00000200 = SURVEY_BEST      Best observation in full survey, but not primary.
* 00000400 = SURVEY_SECONDARY Repeat (independent) observation (mode=2)
* 00000800 = SURVEY_BADFIELD  In field with score=0
* 00001000 = SURVEY_EDGE      Not kept as secondary
* ------------------------------------------------------------------------------
*Note (5):
*     The response curves of the SDSS filters (u g r i z) can be found on
*     the SDSS pages: http://www.sdss.org/dr5/instruments/imager/index.html
*     The central wavelength and FWHM are:
*     -----------------------------------------------
*      (nm)      u'      g'      r'      i'      z'
*     -----------------------------------------------
*     lambda   354.3    477.0   623.1   762.5   913.4
*     FWHM      56.7    138.7   137.3   152.6    95.0
*     -----------------------------------------------
*     Note that the ugriz magnitudes are not exactly on the AB scale
*     for the u-band (uAB=umag-0.04) and z-band (zAB=zmag+0.02)
*     (http://www.sdss.org/DR7/algorithms/fluxcal.html)
*Note (6): column from the "Fields" table.
*     Dates of the observations for each colour, and their average.
*Note (7): column from the "SpecObjAll" table. The "SpObjID" is composed
*     of plate + mjd + fiber + run2d with formula (the <<n operator
*     represents the left shift of n bits, i.e. a multiplication by 2^n):
*     SpObjID = (plate<<50)+((mjd-50000)<<24)+(fiber<<38)+(run2d<<10)
*Note (8): column from the "ProperMotions" table.
*Note (9): the "zwarning" flag is a number made of the following bits:
*   1 (20) = sky fiber
*   2 (21) = too little wavelength coverage
*   4 (22) = chi-squared of best fit is too close to that of second best
*   8 (23) = synthetic spectrum is negative
*  16 (24) = fraction of points more than 5 sigma away from best model
*              is too large (>5%)
*  32 (25) = chi-squared minimum at edge of the redshift fitting range
*  64 (26) = a QSO line exhibits negative emission (triggered only in QSO
*              spectra if CIV, CIII, MgII, Hbeta, or Halpha has
*              lineArea+3*(lineArea)<0)
* 128 (27) = the fiber was unplugged, so no spectrum obtained
*  See http://skyserver.sdss.org/dr12/en/help/browser/browser.aspx#\
*      &&history=search+SpeczWarning
*Note (10): the spectroscopic Source types are summarized in the
*      "type9.htx" file; see also the SDSS DR12 help:
*      http://skyserver.sdss.org/dr12/en/help/browser/browser.aspx#\
*      &history=enum+AncillaryTarget1+E
*Note (11): the spectroscopic subclass includes:
*   * for GALAXY classes: BROADLINE, STARFORMING, STARBURST, AGN
*   * for STAR classes: MK spectral sub-classes, CV=Catataclysmic Variable,
*     Carbon stars (Carbon, Carbon_lines), white dwarfs (WD, WDcooler,
*     WDhotter, WDmagnetic, CarbonWD, CalciumWD)
*Note (12): If zErr=-9999, the fit failed, but the neighbors' average redshift
*           might still be available.

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

C  Loading file 'sdss12.sam'	! *Sample output of the SDSS photometric catalog

C  Format for file interpretation

    1 format(
     +  F10.6,1X,F10.6,1X,I1,1X,A1,1X,I1,1X,A19,1X,A1,1X,A20,1X,I19,
     +  1X,A15,1X,I19,1X,I19,1X,I19,1X,I4,1X,F5.3,1X,F5.3,1X,F9.4,1X,
     +  I1,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,
     +  F5.3,1X,F6.3,1X,F5.3,1X,F8.5,1X,F7.5,1X,I3,1X,F10.6,1X,F6.3,
     +  1X,A4,1X,A19,1X,A6,1X,A21,1X,F6.2,1X,I19,1X,I1,1X,I1,1X,F9.4,
     +  1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F7.3,1X,
     +  F9.3,1X,F6.2,1X,F6.2,1X,F7.3,1X,F7.3,1X,F5.1,1X,I19,1X,I1,1X,
     +  I1,1X,F9.4,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,
     +  F7.3,1X,F9.3,1X,F6.2,1X,F6.2,1X,F7.3,1X,F7.3,1X,F5.1,1X,I19,
     +  1X,I1,1X,I1,1X,F9.4,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F7.3,1X,F9.3,1X,F6.2,1X,F6.2,1X,F7.3,1X,F7.3,1X,
     +  F5.1,1X,I19,1X,I1,1X,I1,1X,F9.4,1X,F6.3,1X,F6.3,1X,F6.3,1X,
     +  F6.3,1X,F6.3,1X,F6.3,1X,F7.3,1X,F9.3,1X,F6.2,1X,F6.2,1X,F7.3,
     +  1X,F7.3,1X,F5.1,1X,I19,1X,I1,1X,I1,1X,F9.4,1X,F6.3,1X,F6.3,1X,
     +  F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F7.3,1X,F9.3,1X,F6.2,1X,F6.2,
     +  1X,F7.3,1X,F7.3,1X,F5.1,1X,F7.1,1X,F6.1,1X,F7.1,1X,F6.1,1X,
     +  F7.2,1X,F6.2,1X,I2,1X,I2,1X,F4.1,1X,F4.1,1X,F4.1,1X,F4.1,1X,
     +  F4.1,1X,F10.4,1X,F10.4,1X,F6.4,1X,F7.3,1X,F8.3,1X,F8.3,1X,
     +  F8.3,1X,F8.3,1X,F8.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'sdss12.sam')
      write(6,*) '....Loading file: sdss12.sam'
      do i__=1,1000
        read(1,'(A1168)')ar__
        read(ar__,1)
     +  RAdeg(i__),DEdeg(i__),mode(i__),q_mode(i__),class(i__),
     +  SDSS12(i__),m_SDSS12(i__),SDSS_ID(i__),objID(i__),Sp_ID(i__),
     +  SpObjID(i__),parentID(i__),flags(i__),Status(i__),
     +  e_RAdeg(i__),e_DEdeg(i__),ObsDate(i__),Q(i__),umag(i__),
     +  e_umag(i__),gmag(i__),e_gmag(i__),rmag(i__),e_rmag(i__),
     +  imag(i__),e_imag(i__),zmag(i__),e_zmag(i__),zsp(i__),
     +  e_zsp(i__),f_zsp(i__),Vdisp(i__),e_Vdisp(i__),spInst(i__),
     +  spType(i__),spCl(i__),subCl(i__),spS_N(i__),uFlags(i__),
     +  us(i__),uc(i__),uDate(i__),u_mag(i__),e_u_mag(i__),upmag(i__),
     +  e_upmag(i__),uPmag_1(i__),e_uPmag_1(i__),uPrad(i__),
     +  e_uPrad(i__),uoRA(i__),uoDE(i__),udVrad(i__),udVell(i__),
     +  uPA(i__),gFlags(i__),gs(i__),gc(i__),gDate(i__),g_mag(i__),
     +  e_g_mag(i__),gpmag(i__),e_gpmag(i__),gPmag_1(i__),
     +  e_gPmag_1(i__),gPrad(i__),e_gPrad(i__),goRA(i__),goDE(i__),
     +  gdVrad(i__),gdVell(i__),gPA(i__),rFlags(i__),rs(i__),rc(i__),
     +  rDate(i__),r_mag(i__),e_r_mag(i__),rpmag(i__),e_rpmag(i__),
     +  rPmag_1(i__),e_rPmag_1(i__),rPrad(i__),e_rPrad(i__),roRA(i__),
     +  roDE(i__),rdVrad(i__),rdVell(i__),rPA(i__),iFlags(i__),
     +  is(i__),ic(i__),iDate(i__),i_mag(i__),e_i_mag(i__),ipmag(i__),
     +  e_ipmag(i__),iPmag_1(i__),e_iPmag_1(i__),iPrad(i__),
     +  e_iPrad(i__),ioRA(i__),ioDE(i__),idVrad(i__),idVell(i__),
     +  iPA(i__),zFlags(i__),zs(i__),zc(i__),zDate(i__),z_mag(i__),
     +  e_z_mag(i__),zpmag(i__),e_zpmag(i__),zPmag_1(i__),
     +  e_zPmag_1(i__),zPrad(i__),e_zPrad(i__),zoRA(i__),zoDE(i__),
     +  zdVrad(i__),zdVell(i__),zPA(i__),pmRA(i__),e_pmRA(i__),
     +  pmDE(i__),e_pmDE(i__),sigRA(i__),sigDE(i__),M(i__),N(i__),
     +  g_O(i__),r_E(i__),g_J(i__),r_F(i__),i_N(i__),zph(i__),
     +  e_zph(i__),v_zph_(i__),chi2(i__),u_Mag_1(i__),g_Mag_1(i__),
     +  r_Mag_1(i__),i_Mag_1(i__),z_Mag_1(i__)
        if(ar__(197:202) .EQ. '') umag(i__) = rNULL__
        if(ar__(204:208) .EQ. '') e_umag(i__) = rNULL__
        if(ar__(210:215) .EQ. '') gmag(i__) = rNULL__
        if(ar__(217:221) .EQ. '') e_gmag(i__) = rNULL__
        if(ar__(223:228) .EQ. '') rmag(i__) = rNULL__
        if(ar__(230:234) .EQ. '') e_rmag(i__) = rNULL__
        if(ar__(236:241) .EQ. '') imag(i__) = rNULL__
        if(ar__(243:247) .EQ. '') e_imag(i__) = rNULL__
        if(ar__(249:254) .EQ. '') zmag(i__) = rNULL__
        if(ar__(256:260) .EQ. '') e_zmag(i__) = rNULL__
        if(ar__(262:269) .EQ. '') zsp(i__) = rNULL__
        if(ar__(271:277) .EQ. '') e_zsp(i__) = rNULL__
        if(ar__(279:281) .EQ. '') f_zsp(i__) = iNULL__
        if(ar__(283:292) .EQ. '') Vdisp(i__) = rNULL__
        if(ar__(294:299) .EQ. '') e_Vdisp(i__) = rNULL__
        if(ar__(355:360) .EQ. '') spS_N(i__) = rNULL__
        if(ar__(396:401) .EQ. '') u_mag(i__) = rNULL__
        if(ar__(403:408) .EQ. '') e_u_mag(i__) = rNULL__
        if(ar__(410:415) .EQ. '') upmag(i__) = rNULL__
        if(ar__(417:422) .EQ. '') e_upmag(i__) = rNULL__
        if(ar__(424:429) .EQ. '') uPmag_1(i__) = rNULL__
        if(ar__(431:436) .EQ. '') e_uPmag_1(i__) = rNULL__
        if(ar__(438:444) .EQ. '') uPrad(i__) = rNULL__
        if(ar__(456:461) .EQ. '') uoRA(i__) = rNULL__
        if(ar__(463:468) .EQ. '') uoDE(i__) = rNULL__
        if(ar__(470:476) .EQ. '') udVrad(i__) = rNULL__
        if(ar__(478:484) .EQ. '') udVell(i__) = rNULL__
        if(ar__(486:490) .EQ. '') uPA(i__) = rNULL__
        if(ar__(526:531) .EQ. '') g_mag(i__) = rNULL__
        if(ar__(533:538) .EQ. '') e_g_mag(i__) = rNULL__
        if(ar__(540:545) .EQ. '') gpmag(i__) = rNULL__
        if(ar__(547:552) .EQ. '') e_gpmag(i__) = rNULL__
        if(ar__(554:559) .EQ. '') gPmag_1(i__) = rNULL__
        if(ar__(561:566) .EQ. '') e_gPmag_1(i__) = rNULL__
        if(ar__(568:574) .EQ. '') gPrad(i__) = rNULL__
        if(ar__(586:591) .EQ. '') goRA(i__) = rNULL__
        if(ar__(593:598) .EQ. '') goDE(i__) = rNULL__
        if(ar__(600:606) .EQ. '') gdVrad(i__) = rNULL__
        if(ar__(608:614) .EQ. '') gdVell(i__) = rNULL__
        if(ar__(616:620) .EQ. '') gPA(i__) = rNULL__
        if(ar__(656:661) .EQ. '') r_mag(i__) = rNULL__
        if(ar__(663:668) .EQ. '') e_r_mag(i__) = rNULL__
        if(ar__(670:675) .EQ. '') rpmag(i__) = rNULL__
        if(ar__(677:682) .EQ. '') e_rpmag(i__) = rNULL__
        if(ar__(684:689) .EQ. '') rPmag_1(i__) = rNULL__
        if(ar__(691:696) .EQ. '') e_rPmag_1(i__) = rNULL__
        if(ar__(698:704) .EQ. '') rPrad(i__) = rNULL__
        if(ar__(716:721) .EQ. '') roRA(i__) = rNULL__
        if(ar__(723:728) .EQ. '') roDE(i__) = rNULL__
        if(ar__(730:736) .EQ. '') rdVrad(i__) = rNULL__
        if(ar__(738:744) .EQ. '') rdVell(i__) = rNULL__
        if(ar__(746:750) .EQ. '') rPA(i__) = rNULL__
        if(ar__(786:791) .EQ. '') i_mag(i__) = rNULL__
        if(ar__(793:798) .EQ. '') e_i_mag(i__) = rNULL__
        if(ar__(800:805) .EQ. '') ipmag(i__) = rNULL__
        if(ar__(807:812) .EQ. '') e_ipmag(i__) = rNULL__
        if(ar__(814:819) .EQ. '') iPmag_1(i__) = rNULL__
        if(ar__(821:826) .EQ. '') e_iPmag_1(i__) = rNULL__
        if(ar__(828:834) .EQ. '') iPrad(i__) = rNULL__
        if(ar__(846:851) .EQ. '') ioRA(i__) = rNULL__
        if(ar__(853:858) .EQ. '') ioDE(i__) = rNULL__
        if(ar__(860:866) .EQ. '') idVrad(i__) = rNULL__
        if(ar__(868:874) .EQ. '') idVell(i__) = rNULL__
        if(ar__(876:880) .EQ. '') iPA(i__) = rNULL__
        if(ar__(916:921) .EQ. '') z_mag(i__) = rNULL__
        if(ar__(923:928) .EQ. '') e_z_mag(i__) = rNULL__
        if(ar__(930:935) .EQ. '') zpmag(i__) = rNULL__
        if(ar__(937:942) .EQ. '') e_zpmag(i__) = rNULL__
        if(ar__(944:949) .EQ. '') zPmag_1(i__) = rNULL__
        if(ar__(951:956) .EQ. '') e_zPmag_1(i__) = rNULL__
        if(ar__(958:964) .EQ. '') zPrad(i__) = rNULL__
        if(ar__(976:981) .EQ. '') zoRA(i__) = rNULL__
        if(ar__(983:988) .EQ. '') zoDE(i__) = rNULL__
        if(ar__(990:996) .EQ. '') zdVrad(i__) = rNULL__
        if(ar__(998:1004) .EQ. '') zdVell(i__) = rNULL__
        if(ar__(1006:1010) .EQ. '') zPA(i__) = rNULL__
        if(ar__(1012:1018) .EQ. '') pmRA(i__) = rNULL__
        if(ar__(1020:1025) .EQ. '') e_pmRA(i__) = rNULL__
        if(ar__(1027:1033) .EQ. '') pmDE(i__) = rNULL__
        if(ar__(1035:1040) .EQ. '') e_pmDE(i__) = rNULL__
        if(ar__(1042:1048) .EQ. '') sigRA(i__) = rNULL__
        if(ar__(1050:1055) .EQ. '') sigDE(i__) = rNULL__
        if(ar__(1063:1066) .EQ. '') g_O(i__) = rNULL__
        if(ar__(1068:1071) .EQ. '') r_E(i__) = rNULL__
        if(ar__(1073:1076) .EQ. '') g_J(i__) = rNULL__
        if(ar__(1078:1081) .EQ. '') r_F(i__) = rNULL__
        if(ar__(1083:1086) .EQ. '') i_N(i__) = rNULL__
        if(ar__(1088:1097) .EQ. '') zph(i__) = rNULL__
        if(ar__(1099:1108) .EQ. '') e_zph(i__) = rNULL__
        if(ar__(1110:1115) .EQ. '') v_zph_(i__) = rNULL__
        if(ar__(1117:1123) .EQ. '') chi2(i__) = rNULL__
        if(ar__(1125:1132) .EQ. '') u_Mag_1(i__) = rNULL__
        if(ar__(1134:1141) .EQ. '') g_Mag_1(i__) = rNULL__
        if(ar__(1143:1150) .EQ. '') r_Mag_1(i__) = rNULL__
        if(ar__(1152:1159) .EQ. '') i_Mag_1(i__) = rNULL__
        if(ar__(1161:1168) .EQ. '') z_Mag_1(i__) = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg(i__),DEdeg(i__),mode(i__),q_mode(i__),class(i__),
     +  SDSS12(i__),m_SDSS12(i__),SDSS_ID(i__),objID(i__),Sp_ID(i__),
     +  SpObjID(i__),parentID(i__),flags(i__),Status(i__),
     +  e_RAdeg(i__),e_DEdeg(i__),ObsDate(i__),Q(i__),umag(i__),
     +  e_umag(i__),gmag(i__),e_gmag(i__),rmag(i__),e_rmag(i__),
     +  imag(i__),e_imag(i__),zmag(i__),e_zmag(i__),zsp(i__),
     +  e_zsp(i__),f_zsp(i__),Vdisp(i__),e_Vdisp(i__),spInst(i__),
     +  spType(i__),spCl(i__),subCl(i__),spS_N(i__),uFlags(i__),
     +  us(i__),uc(i__),uDate(i__),u_mag(i__),e_u_mag(i__),upmag(i__),
     +  e_upmag(i__),uPmag_1(i__),e_uPmag_1(i__),uPrad(i__),
     +  e_uPrad(i__),uoRA(i__),uoDE(i__),udVrad(i__),udVell(i__),
     +  uPA(i__),gFlags(i__),gs(i__),gc(i__),gDate(i__),g_mag(i__),
     +  e_g_mag(i__),gpmag(i__),e_gpmag(i__),gPmag_1(i__),
     +  e_gPmag_1(i__),gPrad(i__),e_gPrad(i__),goRA(i__),goDE(i__),
     +  gdVrad(i__),gdVell(i__),gPA(i__),rFlags(i__),rs(i__),rc(i__),
     +  rDate(i__),r_mag(i__),e_r_mag(i__),rpmag(i__),e_rpmag(i__),
     +  rPmag_1(i__),e_rPmag_1(i__),rPrad(i__),e_rPrad(i__),roRA(i__),
     +  roDE(i__),rdVrad(i__),rdVell(i__),rPA(i__),iFlags(i__),
     +  is(i__),ic(i__),iDate(i__),i_mag(i__),e_i_mag(i__),ipmag(i__),
     +  e_ipmag(i__),iPmag_1(i__),e_iPmag_1(i__),iPrad(i__),
     +  e_iPrad(i__),ioRA(i__),ioDE(i__),idVrad(i__),idVell(i__),
     +  iPA(i__),zFlags(i__),zs(i__),zc(i__),zDate(i__),z_mag(i__),
     +  e_z_mag(i__),zpmag(i__),e_zpmag(i__),zPmag_1(i__),
     +  e_zPmag_1(i__),zPrad(i__),e_zPrad(i__),zoRA(i__),zoDE(i__),
     +  zdVrad(i__),zdVell(i__),zPA(i__),pmRA(i__),e_pmRA(i__),
     +  pmDE(i__),e_pmDE(i__),sigRA(i__),sigDE(i__),M(i__),N(i__),
     +  g_O(i__),r_E(i__),g_J(i__),r_F(i__),i_N(i__),zph(i__),
     +  e_zph(i__),v_zph_(i__),chi2(i__),u_Mag_1(i__),g_Mag_1(i__),
     +  r_Mag_1(i__),i_Mag_1(i__),z_Mag_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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