FORTRAN Generation
(/./ftp/cats/II/246)

Conversion of standardized ReadMe file for file /./ftp/cats/II/246 into FORTRAN code for reading data files line by line.

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-Mar-19
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. II/246              2MASS All-Sky Catalog of Point Sources     (Cutri+ 2003)
*================================================================================
*The 2MASS All-Sky Catalog of Point Sources
*     Cutri R.M., Skrutskie M.F., Van Dyk S., Beichman C.A., Carpenter J.M.,
*     Chester T., Cambresy L., Evans T., Fowler J., Gizis J., Howard E.,
*     Huchra J., Jarrett T., Kopan E.L., Kirkpatrick J.D., Light R.M,
*     Marsh K.A., McCallon H., Schneider S., Stiening R., Sykes M.,
*     Weinberg M., Wheaton W.A., Wheelock S., Zacarias N.
*    <University of Massachusetts and Infrared Processing and Analysis Center
*     (IPAC/California Institute of Technology) (2003)>
*    =2003yCat.2246....0C
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'out.sam'	! 2MASS Point Source Catalogue, sample output
                                (on a total of 470,992,970 sources)

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

C  J2000 position composed of: RAdeg DEdeg
      real*8        RAdeg       ! (deg) (ra) Right ascension (J2000)
      real*8        DEdeg       ! (deg) (dec) Declination (J2000) (dec)
      real*4        errMaj      ! (arcsec) (err_maj) Semi-major axis of position 
*                                  error ellipse
      real*4        errMin      ! (arcsec) (err_min) Semi-minor axis of position 
*                                  error ellipse
      integer*4     errPA       ! (deg) [0,180] (err_ang) Position angle of error
*                                         ellipse major axis (E of N)
      character*17  v2MASS      ! (designation) Source designation (1)
*--------------------------------------------------------------------------------
      real*4        Jmag        ! (mag) ?(j_m) J selected default magnitude (2)
      real*4        Jcmsig      ! (mag) ?(j_cmsig) J default magnitude uncertainty (3)
      real*4        e_Jmag      ! (mag) ?(j_msigcom) J total magnitude uncertainty (4)
      real*8        Jsnr        ! ?(j_snr) J Signal-to-noise ratio
      real*4        Hmag        ! (mag) ?(h_m) H selected default magnitude (2)
      real*4        Hcmsig      ! (mag) ?(h_cmsig) H default magnitude uncertainty (3)
      real*4        e_Hmag      ! (mag) ?(h_msigcom) H total magnitude uncertainty (4)
      real*8        Hsnr        ! ?(h_snr) H Signal-to-noise ratio
      real*4        Kmag        ! (mag) ?(k_m) K selected default magnitude (2)
      real*4        Kcmsig      ! (mag) ?(k_cmsig) K default magnitude uncertainty (3)
      real*4        e_Kmag      ! (mag) ?(k_msigcom) K total magnitude uncertainty (4)
      real*8        Ksnr        ! ?(k_snr) K Signal-to-noise ratio
*--------------------------------------------------------------------------------
      character*3   Qflg        ! (ph_qual) JHK Photometric quality flag (5)
      character*3   Rflg        ! (rd_flg) Source of JHK default mag (6)
      character*3   Bflg        ! (bl_flg) JHK components fit to source (7)
      character*3   Cflg        ! (cc_flg) Artifact contamination, confusion (8)
      character*6   Ndet        ! [0-9] (ndet) Number of aperture measurements
*                                       (jjhhkk) (9)
*--------------------------------------------------------------------------------
      real*4        prox        ! (arcsec) Distance between source and nearest neighbour
      integer*4     pxPA        ! (deg) ? (pxpa) Position angle of vector from source
*                                   to nearest neighbour (E of N)
      integer*8     pxCntr      ! (pxcntr) Sequence number of nearest neighbour
      integer*4     Xflg        ! [0,2] (gal_contam) Extended source
*                                       contamination (10)
      integer*4     Aflg        ! [0,1] (mp_flg) Association with asteroid
*                                       or comet (11)
*--------------------------------------------------------------------------------
      integer*8     Cntr        ! (pts_key) Unique source identifier in catalogue
      character*1   Hemis       ! [ns] (hemis) Hemisphere of observation
      character*10  Date        ! (date) Observation date
      integer*4     Scan        ! (scan) Scan number (within date)
      real*8        GLON        ! (deg) (glon) Galactic longitude (12)
      real*8        GLAT        ! (deg) (glat) Galactic latitude (12)
      real*4        Xscan       ! (arcsec) (x_scan) Distance of source from focal plane
*                                         centerline
      real*8        JD          ! (d) (jdate) Julian date of source measurement (13)
*--------------------------------------------------------------------------------
      real*4        Jpsfchi     ! ?(j_psfchi) J band reduced chi2 value of fit
      real*4        Hpsfchi     ! ?(h_psfchi) H band reduced chi2 value of fit
      real*4        Kpsfchi     ! ?(k_psfchi) K band reduced chi2 value of fit
      real*4        Jstdap      ! (mag) ?(j_m_stdap) J standard aperture magnitude (18)
      real*4        e_Jstdap    ! (mag) ?(j_msig_stdap) error on Jstdap
      real*4        Hstdap      ! (mag) ?(h_m_stdap) H standard aperture magnitude (18)
      real*4        e_Hstdap    ! (mag) ?(h_msig_stdap) error on Hstdap
      real*4        Kstdap      ! (mag) ?(k_m_stdap) K standard aperture magnitude (18)
      real*4        e_Kstdap    ! (mag) ?(k_msig_stdap) error on Kstdap
*--------------------------------------------------------------------------------
      integer*4     edgeNS      ! (arcsec) (dist_edge_ns) Distance from the source to the
*                                  nearest North or South scan edge
      integer*4     edgeEW      ! (arcsec) (dist_edge_ew) Distance from the source to the
*                                  nearest East or West scan edge
      character*2   edge        ! [nsew] (dist_edge_flg) flag indicating to which
*                                  edges the edgeNS and edgeEW values refer
      integer*4     dup         ! (dup_src) Flag indicating duplicate source (14)
      integer*4     use         ! (use_src) Use source flag (15)
*--------------------------------------------------------------------------------
      character*1   opt         ! [0UT] (a) Associated optical source (16)
      real*4        Dopt        ! (arcsec) ?(dist_opt) Distance to associated optical
*                                   source
      integer*4     PAopt       ! (deg) [0,360]? (phi_opt) position angle from optical
*                                   source to the 2MASS source position
      real*4        Bmag        ! (mag) ?(b_m_opt) Blue magnitude of associated
*                                   optical source
      real*4        Rmag        ! (mag) ?(vr_m_opt) Visual or red mag of associated
*                                   optical source
      integer*4     Nopt        ! (nopt_mchs) Number of optical sources
*                                   within 5arcsec (17)
*--------------------------------------------------------------------------------
      integer*4     extKey      ! ?(ext_key) Record Identifier in XSC
      integer*4     scanKey     ! (scan_key) Record Identifier in the
*                                   Scan Information Table
      integer*4     coaddKey    ! (coadd_key) Record Identifier in the
*                                   Atlas Image Data Table
      integer*4     coadd       ! (coadd) Sequence number of the Atlas Image
*Note (1):  Sexagesimal, equatorial position-based source name in the form:
*           hhmmssss+ddmmsss[ABC...].
*    The full naming convention for 2MASS All-Sky Release PSC sources has
*    the form "2MASS Jhhmmssss+ddmmsss[ABC...]", where "2MASS" indicates
*    that the source is from the All-Sky PSC, "J" indicates the position is
*    J2000, and the optional trailing letters are used to distinguish
*    sources with otherwise duplicate names. The "2MASS J" prefix is not
*    listed explicitly in the designation column.
*Note (2): This is the selected "default" magnitude for each band, [JHK].
*    If the source is not detected in the band, this is the 95% confidence
*    upper limit derived from a 4" radius aperture measurement taken at the
*    position of the source on the Atlas Image. The origin of the default
*    magnitude is given by the first character of the Rflg value
*    (Rflg). This column is null if the source is nominally detected in
*    the band, but no useful brightness estimate could be made
*    (Rflg="9").
*Note (3): This is the corrected photometric uncertainty [JHK]cmsig for
*    the default magnitude. If Rflg="2", this is the measurement error
*    from the profile-fitting procedure, corrected to be consistent with
*    observed repeatability statistics. If Rflg="1" or "4", this is the
*    RMS of the brightness measured in aperture photometry on the
*    individual frames. If Rflg="3", the uncertainty is derived from the
*    residuals to the 1-d radial profile fit to the unsaturated wings of
*    the bright star.
*
*    If the value is >8.0, it is a flag value indicating that a meaningful
*    uncertainty could not be determined for the source. This column is
*    null if the default magnitude is a 95% confidence upper limit
*    (Rflg="0" or "6") or if the source is not measurable (Rflg="9").
*Note (4): Combined, or total photometric uncertainty [JHK]msigcom
*    for the default magnitude in that band. The combined uncertainty is
*    derived from the following relation:
*
*      e_[JHK]mag = sqrt([JHK]cmsig^2^ + [JHK]_zperr_^2^
*                 + fferr^2^ + [r1normrms^2^])
*
*    where
*
*    cmsig = Corrected band photometric uncertainty
*    zperr = Nightly photometric zero point uncertainty = 0.011 mag
*    fferr = Flat-fielding residual error = 0.005 mags
*    r1normrms = R1 normalization uncertainty = 0.012 mags
*          (applied only for sources with Rflg="1")
*
*    This column is null if the default magnitude is a 95% confidence upper
*    limit (i.e. the source is not detected, or inconsistently deblended in
*    the band).
*Note (5): Three character flag, one character per band [JHK],
*    that provides a summary of the net quality of the default photometry
*    in each band, as derived from the Read Flag (Rflg), measurement
*    uncertainties ([jhk]cmsig), scan signal-to-noise ratios ([jhk]snr),
*    frame-detection statistics (Ndet), and profile-fit reduced chi-squared
*    values ([jhk]psfchi). The value for Qflg is set for a band
*    according to the precedence of the table below. For example, a source
*    that is tested and meets the conditions for category "X" is not tested
*    for subsequent qualities.
*
*    X = There is a detection at this location, but no valid brightness
*        estimate can be extracted using any algorithm. Rflg="9" and
*        default magnitude is null.
*
*    U = Upper limit on magnitude. Source is not detected in this band
*        (Rflg="0"), or it is detected, but not resolved in a consistent
*        fashion with other bands (Rflg="6"). A value of Qflg="U"
*        does not necessarily mean that there is no flux detected in this
*        band at the location. Whether or not flux has been detected can
*        be determined from the value of Rflg. When Rflg="0", no flux
*        has been detected. When Rflg="6", flux has been detected at the
*        location where the images were not deblended consistently in all
*        three bands (JHKs).
*
*    F = This category includes Rflg="1" or Rflg="3" sources where a
*        reliable estimate of the photometric error, [jhk]cmsig, could
*        not be determined. The uncertainties reported for these sources
*        in [jhk]cmsig and e_[jhk]mag are flags and have numeric
*        values >8.0.
*
*    E = This category includes detections where the goodness-of-fit
*        quality of the profile-fit photometry was very poor (Rflg=2 and
*        [jhk]psfchi>10.0), or detections where psf fit photometry did
*        not converge and an aperture magnitude is reported (Rflg=4), or
*        detections where the number of frames was too small in relation
*        to the number of frames in which a detection was geometrically
*        possible (Rflg="1" or Rflg="2").
*
*    A = Detections in any brightness regime where valid measurements
*        were made (Rflg="1","2" or "3") with
*          [jhk]snr>10 AND [jhk]cmsig<0.10857.
*
*    B = Detections in any brightness regime where valid measurements
*        were made (Rflg="1","2" or "3") with
*          [jhk]snr>7 AND [jhk]cmsig<0.15510.
*
*    C = Detections in any brightness regime where valid measurements
*        were made (Rflg="1","2" or "3") with
*          [jhk]snr>5 AND [jhk]cmsig<0.21714.
*
*    D = Detections in any brightness regime where valid measurements
*        were made (Rflg="1","2" or "3") with
*          no [jhk]snr OR [jhk]cmsig requirement.
*Note (6): The read flag indicates the source of J,H,K "default" magnitudes
*    as a 3-digit integer, where the 1st digit corresponds to the J band,
*    the 2nd to the H band, and the 3rd to the Ks band. Rflg values of
*    "1", "2" or "3" generally indicate the best quality detections,
*    photometry and astrometry (although other quality flags must be
*    considered). Values of "0", "4", "6" and "9" in a band indicate
*    either non-detections, or generally poor quality photometry and
*    positions. The definitions of the Rflg values are:
*
*    0 = Source is not detected in this band. The default magnitude
*        is the 95% confidence upper limit derived from a 4" radius
*        aperture measurement taken at the position of the source on the
*        Atlas Image. The sky background is estimated in an annular region
*        with inner radius of 14" and outer radius of 20".
*
*    1 = The default magnitude is derived from aperture photometry
*        measurements on the 51 ms "Read_1" exposures. The aperture radius
*        is 4", with the sky background measured in an annulus with an
*        inner radius of 14" and an outer radius of 20". Used for sources
*        that saturate one or more of the 1.3s "Read_2" exposures, but are
*        not saturated on at least one of the 51 ms "Read_1" frames.
*
*    2 = The default magnitude is derived from a profile-fitting
*        measurement made on the 1.3 sec "Read_2" exposures. The
*        profile-fit magnitudes are normalized to curve-of-growth
*        corrected aperture magnitudes. This is the most common type in
*        the PSC, and is used for sources that have no saturated pixels in
*        any of the 1.3 sec exposures.
*
*    3 = The default magnitude is derived from a 1-d radial profile
*        fitting measurement made on the 51 ms "Read_1" exposures. Used
*        for very bright sources that saturate all of the 51 ms "Read 1"
*        exposures.
*
*    4 = The default magnitude is derived from curve-of-growth-corrected
*        4" radius aperture photometry measurements on the 1.3 s "Read_2"
*        exposures. This is used for sources that are not saturated in any
*        of the Read_2 frames, but where the profile-fitting measurements
*        fail to converge to a solution. These magnitudes are the same as
*        the standard aperture magnitudes (Jstdap, Hstdap, Kstdap), but
*        when they are the default magnitudes, it generally implies that
*        they are low quality measurements.
*
*    6 = The default magnitude is the 95% confidence upper limit derived
*        from a 4" radius aperture measurement taken at the position of the
*        source on the Atlas Image. The sky background is estimated in an
*        annular region with inner radius of 14" and outer radius of 20".
*        This is used for pairs of sources which are detected and resolved
*        in another band, but are detected and not resolved in this band.
*        This differs from a Rflg="0" because in this case there is a
*        detection of the source in this band, but it is not consistently
*        resolved across all bands.
*
*    9 = The default magnitude is the 95% confidence upper limit derived
*        from a 4" radius aperture measurement taken at the position of the
*        source on the Atlas Image. The sky background is estimated in an
*        annular region with inner radius of 14" and outer radius of 20".
*        This is used for sources that were nominally detected in this
*        band, but which could not have a useful brightness measurement
*        from either profile fitting or aperture photometry. This often
*        occurs in highly confused regions, or very near Tile edges where
*        a significant fraction of the measurement aperture of sky annulus
*        falls off the focal plane.
*Note (7): Blend flag. Three character flag, one character per band [JHK],
*    that indicates the number of components that were fit simultaneously
*    when estimating the brightness of a source:
*
*    0 = Source is not detected, or is inconsistently deblended in that
*        band.
*
*    1 = One component was fit to the source in R_2 profile-fitting
*        photometry (Rflg="2"), or default magnitudes are from aperture
*        photometry (Rflg="1" or "4") or saturated star 1-d radial
*        profile-fitting (Rflg="3").
*
*   >1 = More than one component was fit simultaneously during R2
*        profile-fit photometry, where the value of the field is the
*        number of components simultaneously fit. The maximum number of
*        components is 7 in any band for the PSC, so this Bflg is always
*        a three character flag. Multi-component fitting occurs only for
*        profile-fitting, and only when more than one detection is found
*        within ~5". Single detections that are not well-fit by a single
*        PSF are not split.
*Note (8): Contamination and confusion flag. Three character flag, one
*    character per band [JHKs], that indicates that the photometry and/or
*    position measurements of a source may be contaminated or biased due to
*    proximity to an image artifact or nearby source of equal or greater
*    brightness. The Cflg in each band is set in hierarchical order
*    according to the following table, in the event a source is affected by
*    more than one artifact or condition:
*
*    p = Persistence. Source may be contaminated by a latent image left
*        by a nearby bright star.
*
*    c = Photometric Confusion. Source photometry is biased by a nearby
*        star that has contaminated the background estimation. This is
*        very common in high source density regions.
*
*    d = Diffraction spike confusion. Source may be contaminated by a
*        diffraction spike from a nearby star.
*
*    s = Electronic stripe. Source measurement may be contaminated by a
*        stripe from a nearby bright star.
*
*    b = Bandmerge confusion. In the process of merging detections in
*        the different bands for this source, there was more than one
*        possible match between the different band components. This occurs
*        in regions of very high source density, or when multiple sources
*        were split in one band but not another.
*
*    0 = Source is unaffected by known artifacts, or is not detected in
*        the band.
*
*    Non-zero values the Cflg in any band is an indicator that the
*    measurements of that source may be contaminated.
*Note (9): ndet is a six-character flag, two characters per band [JJHHKsKs],
*    that indicates the number frames on which a source was detected, N,
*    and the number of frames on which the source could have been measured,
*    M. The first digit in the pair for each band, N, gives the number of
*    frames on which there were >3 sigma aperture photometry detections of
*    the source. The second digit for each band, M, gives the number of
*    frames on which aperture measurements were possible. Normally, M=6,
*    (occasionally M=7 because the scanning step size was slightly less
*    than 1/6 of the frame size). M can be <6 if frames are "lost" because:
*    a) there were masked pixels within the source aperture due to cosmic
*    ray detections, noisy pixels, meteor trails, etc, or b) there were
*    saturated pixels within the source aperture. Values of M<6 are not
*    uncommon, but do indicate an effective loss of coverage and
*    sensitivity for a source.
*
*    The values of N and M for a band always pertain to the aperture
*    photometry on the 51 ms "Read_1" exposures if Rflg="1", and to the
*    aperture photometry on the 1.3 s "Read_2" exposures if Rflg="2" or
*    "4". Sources that are saturated on all of the Read_1 frames
*    (Rflg="3") have N=0 because no aperture photometry was possible.
*
*    Sources with signal-to-noise ratios >8-9 should be detected on all
*    available frames. Values of N < M for such sources are an indication
*    of possible loss of measurement integrity. Values of N < M, or even
*    N=0, are normal for fainter sources because they are too faint on
*    individual frames to yield a >3 sigma detection.
*Note (10): Extended source "contamination" flag. A value of
*    Xflg="2" indicates that this point source falls within the elliptical
*    boundary of an XSC source defined by the semi-major axis and
*    ellipticity of the 20 mag.arcsec^-2^ Ks-band elliptical isophote
*    (r_k20fe)+10%, for XSC sources where r_k20fe is >10''. Sources so
*    indicated are often foreground stars superimposed on background
*    galaxies, or sometimes extractions of pieces of the galaxy or nebula.
*    The point source photometry for these sources is probably contaminated
*    by the surrounding structured extended emission. Point sources can
*    still be superimposed on extended sources and remain unflagged if the
*    XSC source shape is not well-described by an ellipse.
*
*    This flag also denotes (Xflg="1") PSC sources that are equivalent to
*    sources in the XSC, but only for XSC sources with r_k20fe is >10''.
*    Since most XSC sources have semi-major axes <10'', Xflg does not
*    identify all PSC sources with exact XSC counterparts. Use the extKey
*    to identify all PSC sources that were found to be resolved relative to
*    a single point-spread function.
*
*    0 = Source does not fall within the elliptical profile of an extended
*        source with semi-major axis >10'', or it is not identified
*        exactly with an XSC source with semi-major axis >10''. However,
*        the source may correspond exactly to a smaller XSC source.
*
*    1 = Source is resolved by 2MASS, and is equivalent to a source in the
*        XSC that has a semi-major axis >10'' in size. Users must refer to
*        the extKey to identify all PSC sources with XSC counterparts.
*
*    2 = Source falls within the elliptical boundary of an XSC source that
*        has a semi-major axis >10'' in size.
*Note (11): Minor Planet Flag. Indicates if this source is associated
*    with the predicted position of a known minor planet, comet, planet or
*    planetary satellite. This association does not guarantee that the PSC
*    source is a detection of the solar system object.
*
*    0 = Source is not associated with a known solar system object
*
*    1 = Source is associated with the predicted position of a known
*        solar system object. The name and orbital data for the associated
*        objects are given in the Known Asteroid Detection List, Known
*        Comet Detection List, and Planet and Planetary Satellite
*        Detection List. The associated PSC source is cross-referenced in
*        those Lists via the value of ptsKey.
*Note (12):  Galactic coordinate for 2MASS source derived by precessing
*    reconstructed ra and dec to B1950, and performing rotational
*    transformation into lII, bII coordinate system. This coordinate should
*    not be used as an astrometric reference because it has been rounded to
*    0.001 deg.
*Note (13): The Julian Date of the source measurement is accurate to
*    +/-30seconds. This value is extrapolated from the start time of the
*    Survey scan using the difference between the declinations of the
*    source and the first row in the Tile divided by the scanning rate of
*    the telescope (approximately 5sec). The scanning rate of the two 2MASS
*    telescopes was slightly different because of the need to optimize the
*    dithering of images on the arrays.
*Note (14): Used in conjunction with the use flag, this numerical flag
*    indicates whether the source falls in a Tile overlap region, and if
*    so, if it was detected multiple times.
*
*    0 = The source does not fall within a Tile overlap region
*        (use="1"), or it falls in an overlap region and there were no
*        sources detected within 2" of its position in the overlapping
*        Tile (use="0").
*
*    1 = The source falls within a Tile overlap region, and there is one
*        source detected within 2" of its position in the overlapping Tile.
*
*   >1 = The source falls within a Tile overlap region, and there are
*        multiple sources detected within 2" of its position in the
*        overlapping Tile, and/or within its own Tile. This implies
*        confusion in the multiple source resolution procedure.
*Note (15): Used in conjunction with the dup flag, this numerical flag
*    indicates if a source falls within a Tile overlap region, and whether
*    or not it satisfies the unbiased selection rules for multiple source
*    resolution.
*
*    1 = The source does not fall in a Tile overlap region
*        (dup="0"), or it falls in an overlap region, but lies farther
*        from its scan edge than any apparition of the source in another
*        Tile. A source must have use="1" to be considered part of the
*        sub-Catalog that satisfies the 2MASS Level 1 Science Requirements
*
*    0 = The source falls in a Tile overlap region, but does not have
*        a detection within 2" of its position in any overlapping Tiles.
*        PSC sources with use="0" will always have dup="0". Such
*        objects are usually faint, and thus toggling above and below the
*        detection limits, or may have moved between the scans of the
*        different Tiles.
*Note (16): The catalog ID and other association parameters are given for
*    the closest optical match found within 5 arcsec. The ID consists of a
*    single-letter abbreviation for the catalog (e.g., 'T' for Tycho 2, 'U'
*    for USNO-A2.0). '0' means no optical source was found.
*Note (17): The optical association information is unreliable for sources
*    with |dec|>86{deg}, because of an error in the 2MASS/USNO-A2.0 position
*    correlation procedure that caused associations to be missed in the
*    vicinity of the equatorial poles. If the source has |dec|>86{deg}, a
*    value of a="0" does not necessarily mean that there is not an optical
*    association within 5 arcsec of the 2MASS position.
*Note (18): the standard aperture magnitude is the curve-of-growth corrected
*    average brightness measured in a 4" radius aperture centered on the
*    source position on each of the available 1.3 s "Read_2" frames. The
*    column is empty if the source is not detected in the band (Rflg="0"),
*    or if it is saturated in all of the 1.3 s "Read 2" exposures for the band.

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

C  Loading file 'out.sam'	! 2MASS Point Source Catalogue, sample output
*                                (on a total of 470,992,970 sources)

C  Format for file interpretation

    1 format(
     +  F10.6,1X,F10.6,1X,F4.2,1X,F4.2,1X,I3,1X,A17,1X,F6.3,1X,F5.3,
     +  1X,F5.3,1X,F10.1,1X,F6.3,1X,F5.3,1X,F5.3,1X,F10.1,1X,F6.3,1X,
     +  F5.3,1X,F5.3,1X,F10.1,1X,A3,1X,A3,1X,A3,1X,A3,1X,A6,1X,F5.1,
     +  1X,I3,1X,I10,1X,I1,1X,I1,1X,I10,1X,A1,1X,A10,1X,I3,1X,F7.3,1X,
     +  F7.3,1X,F6.1,1X,F12.4,1X,F6.2,1X,F6.2,1X,F6.2,1X,F6.3,1X,F5.3,
     +  1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,I5,1X,I3,1X,A2,1X,I1,1X,I1,
     +  1X,A1,1X,F3.1,1X,I3,1X,F5.2,1X,F5.2,1X,I1,1X,I7,1X,I5,1X,I7,
     +  1X,I3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'out.sam')
      write(6,*) '....Loading file: out.sam'
      do i__=1,1000
        read(1,'(A382)')ar__
        read(ar__,1)
     +  RAdeg,DEdeg,errMaj,errMin,errPA,v2MASS,Jmag,Jcmsig,e_Jmag,
     +  Jsnr,Hmag,Hcmsig,e_Hmag,Hsnr,Kmag,Kcmsig,e_Kmag,Ksnr,Qflg,
     +  Rflg,Bflg,Cflg,Ndet,prox,pxPA,pxCntr,Xflg,Aflg,Cntr,Hemis,
     +  Date,Scan,GLON,GLAT,Xscan,JD,Jpsfchi,Hpsfchi,Kpsfchi,Jstdap,
     +  e_Jstdap,Hstdap,e_Hstdap,Kstdap,e_Kstdap,edgeNS,edgeEW,edge,
     +  dup,use,opt,Dopt,PAopt,Bmag,Rmag,Nopt,extKey,scanKey,coaddKey,
     +  coadd
        if(ar__(55:60) .EQ. '') Jmag = rNULL__
        if(ar__(62:66) .EQ. '') Jcmsig = rNULL__
        if(ar__(68:72) .EQ. '') e_Jmag = rNULL__
        if(ar__(74:83) .EQ. '') Jsnr = rNULL__
        if(ar__(85:90) .EQ. '') Hmag = rNULL__
        if(ar__(92:96) .EQ. '') Hcmsig = rNULL__
        if(ar__(98:102) .EQ. '') e_Hmag = rNULL__
        if(ar__(104:113) .EQ. '') Hsnr = rNULL__
        if(ar__(115:120) .EQ. '') Kmag = rNULL__
        if(ar__(122:126) .EQ. '') Kcmsig = rNULL__
        if(ar__(128:132) .EQ. '') e_Kmag = rNULL__
        if(ar__(134:143) .EQ. '') Ksnr = rNULL__
        if(ar__(174:176) .EQ. '') pxPA = iNULL__
        if(ar__(257:262) .EQ. '') Jpsfchi = rNULL__
        if(ar__(264:269) .EQ. '') Hpsfchi = rNULL__
        if(ar__(271:276) .EQ. '') Kpsfchi = rNULL__
        if(ar__(278:283) .EQ. '') Jstdap = rNULL__
        if(ar__(285:289) .EQ. '') e_Jstdap = rNULL__
        if(ar__(291:296) .EQ. '') Hstdap = rNULL__
        if(ar__(298:302) .EQ. '') e_Hstdap = rNULL__
        if(ar__(304:309) .EQ. '') Kstdap = rNULL__
        if(ar__(311:315) .EQ. '') e_Kstdap = rNULL__
        if(ar__(336:338) .EQ. '') Dopt = rNULL__
        if(ar__(340:342) .EQ. '') PAopt = iNULL__
        if(ar__(344:348) .EQ. '') Bmag = rNULL__
        if(ar__(350:354) .EQ. '') Rmag = rNULL__
        if(ar__(358:364) .EQ. '') extKey = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg,DEdeg,errMaj,errMin,errPA,v2MASS,Jmag,Jcmsig,e_Jmag,
     +  Jsnr,Hmag,Hcmsig,e_Hmag,Hsnr,Kmag,Kcmsig,e_Kmag,Ksnr,Qflg,
     +  Rflg,Bflg,Cflg,Ndet,prox,pxPA,pxCntr,Xflg,Aflg,Cntr,Hemis,
     +  Date,Scan,GLON,GLAT,Xscan,JD,Jpsfchi,Hpsfchi,Kpsfchi,Jstdap,
     +  e_Jstdap,Hstdap,e_Hstdap,Kstdap,e_Kstdap,edgeNS,edgeEW,edge,
     +  dup,use,opt,Dopt,PAopt,Bmag,Rmag,Nopt,extKey,scanKey,coaddKey,
     +  coadd
c    .......End.of.Just test output...........
      end do
      close(1)

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