FORTRAN Generation
(/./ftp/cats/I/259)

Conversion of standardized ReadMe file for file /./ftp/cats/I/259 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-18
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. I/259           The Tycho-2 Catalogue              (Hog+ 2000)
*================================================================================
*The Tycho-2 Catalogue of the 2.5 Million Brightest Stars
*    Hog E., Fabricius C., Makarov V.V., Urban S., Corbin T.,
*    Wycoff G., Bastian U., Schwekendiek P., Wicenec A.
*   <Astron. Astrophys. 355, L27 (2000)>
*   =2000A&A...355L..27H
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'tyc2.dat'	! *The Tycho-2 main catalogue

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

C  Position composed of: RAdeg DEdeg
      integer*4     TYC1       (nr__) ! [1,9537]+= TYC1 from TYC or GSC (1)
      integer*4     TYC2       (nr__) ! [1,12121]  TYC2 from TYC or GSC (1)
      integer*4     TYC3       (nr__) ! [1,3]      TYC3 from TYC (1)
      character*1   pflag      (nr__) ! [ PX] mean position flag (2)
      real*8        RAmdeg     (nr__) ! (deg) []? Mean Right Asc, ICRS, epoch=J2000 (3)
      real*8        DEmdeg     (nr__) ! (deg) []? Mean Decl, ICRS, at epoch=J2000 (3)
      real*8        pmRA       (nr__) ! (mas/yr) ? Proper motion in RA*cos(dec) (12)
      real*8        pmDE       (nr__) ! (mas/yr) ? Proper motion in Dec (12)
      integer*4     e_RAmdeg   (nr__) ! (mas) [3,183]? s.e. RA*cos(dec),at mean epoch (5)
      integer*4     e_DEmdeg   (nr__) ! (mas) [1,184]? s.e. of Dec at mean epoch (5)
      real*4        e_pmRA     (nr__) ! (mas/yr) [0.2,11.5]? s.e. prop mot in RA*cos(dec)(5)
      real*4        e_pmDE     (nr__) ! (mas/yr) [0.2,10.3]? s.e. of proper motion in Dec(5)
      real*8        EpRAm      (nr__) ! (yr) [1915.95,1992.53]? mean epoch of RA (4)
      real*8        EpDEm      (nr__) ! (yr) [1911.94,1992.01]? mean epoch of Dec (4)
      integer*4     Num        (nr__) ! [2,36]? Number of positions used
      real*4        q_RAmdeg   (nr__) ! [0.0,9.9]? Goodness of fit for mean RA (6)
      real*4        q_DEmdeg   (nr__) ! [0.0,9.9]? Goodness of fit for mean Dec (6)
      real*4        q_pmRA     (nr__) ! [0.0,9.9]? Goodness of fit for pmRA (6)
      real*4        q_pmDE     (nr__) ! [0.0,9.9]? Goodness of fit for pmDE (6)
      real*4        BTmag      (nr__) ! (mag) [2.183,16.581]? Tycho-2 BT magnitude (7)
      real*4        e_BTmag    (nr__) ! (mag) [0.014,1.977]? s.e. of BT (7)
      real*4        VTmag      (nr__) ! (mag) [1.905,15.193]? Tycho-2 VT magnitude (7)
      real*4        e_VTmag    (nr__) ! (mag) [0.009,1.468]? s.e. of VT (7)
      integer*4     prox       (nr__) ! (0.1arcsec) [3,999] proximity indicator (8)
      character*1   TYC        (nr__) ! [T] Tycho-1 star (9)
      integer*4     HIP        (nr__) ! [1,120404]? Hipparcos number
      character*3   CCDM       (nr__) ! CCDM component identifier for HIP stars(10)
      real*8        RAdeg      (nr__) ! (deg) Observed Tycho-2 Right Ascension, ICRS
      real*8        DEdeg      (nr__) ! (deg) Observed Tycho-2 Declination, ICRS
      real*4        EpRA_1990  (nr__) ! (yr) [0.81,2.13]  epoch-1990 of RAdeg
      real*4        EpDE_1990  (nr__) ! (yr) [0.72,2.36]  epoch-1990 of DEdeg
      real*4        e_RAdeg    (nr__) ! (mas) s.e.RA*cos(dec), of observed Tycho-2 RA (5)
      real*4        e_DEdeg    (nr__) ! (mas) s.e. of observed Tycho-2 Dec (5)
      character*1   posflg     (nr__) ! [ DP] type of Tycho-2 solution (11)
      real*4        corr       (nr__) ! [-1,1] correlation (RAdeg,DEdeg)
*Note (1): The TYC identifier is constructed from the GSC region number
*    (TYC1), the running number within the region (TYC2) and a component
*    identifier (TYC3) which is normally 1. Some non-GSC running numbers
*    were constructed for the first Tycho Catalogue and for Tycho-2.
*    The recommended star designation contains a hyphen between the
*    TYC numbers, e.g. TYC 1-13-1.
*Note (2):
*    ' ' = normal mean position and proper motion.
*    'P' = the mean position, proper motion, etc., refer to the
*          photocentre of two Tycho-2 entries, where the BT magnitudes
*          were used in weighting the positions.
*    'X' = no mean position, no proper motion.
*Note (3):
*    The mean position is a weighted mean for the catalogues contributing
*    to the proper motion determination. This mean has then been brought to
*    epoch 2000.0 by the computed proper motion. See Note(2) above for
*    details. Tycho-2 is one of the several catalogues used to determine
*    the mean position and proper motion. The observed Tycho-2 position is
*    given in the fields RAdeg and DEdeg.
*Note (4):
*    The mean epochs are given in Julian years.
*Note (5):
*    The errors are based on error models.
*Note (6):
*    This goodness of fit is the ratio of the scatter-based and the
*    model-based error. It is only defined when Num > 2. Values
*    exceeding 9.9 are truncated to 9.9.
*Note (7):
*    Blank when no magnitude is available. Either BTmag or VTmag is
*    always given. Approximate Johnson photometry may be obtained as:
*    V   = VT -0.090*(BT-VT)
*    B-V = 0.850*(BT-VT)
*    Consult Sect 1.3 of Vol 1 of "The Hipparcos and Tycho Catalogues",
*    ESA SP-1200, 1997, for details.
*Note (8):
*    Distance in units of 100 mas to the nearest entry in the Tycho-2
*    main catalogue or supplement. The distance is computed for the
*    epoch 1991.25. A value of 999 (i.e. 99.9 arcsec) is given if the
*    distance exceeds 99.9 arcsec.
*Note (9):
*    ' ' = no Tycho-1 star was found within 0.8 arcsec (quality 1-8)
*          or 2.4 arcsec (quality 9).
*    'T' = this is a Tycho-1 star. The Tycho-1 identifier is given in the
*          beginning of the record. For Tycho-1 stars, resolved in
*          Tycho-2 as a close pair, both components are flagged as
*          a Tycho-1 star and the Tycho-1 TYC3 is assigned to the
*          brightest (VT) component.
*    The HIP-only stars given in Tycho-1 are not flagged as Tycho-1 stars.
*Note (10):
*    The CCDM component identifiers for double or multiple Hipparcos stars
*    contributing to this Tycho-2 entry. For photocentre solutions, all
*    components within 0.8 arcsec contribute. For double star solutions any
*    unresolved component within 0.8 arcsec contributes. For single star
*    solutions, the predicted signal from close stars were normally
*    subtracted in the analysis of the photon counts and such stars
*    therefore do not contribute to the solution. The components are given
*    in lexical order.
*Note (11):
*    ' ' = normal treatment, close stars were subtracted when possible.
*    'D' = double star treatment. Two stars were found. The companion is
*          normally included as a separate Tycho-2 entry, but may have
*          been rejected.
*    'P' = photocentre treatment, close stars were not subtracted. This
*          special treatment was applied to known or suspected doubles
*          which were not successfully (or reliably) resolved in the
*          Tycho-2 double star processing.
*Note (12): Some Hipparcos stars (having a positive number in the HIP column)
*     have no proper motions; these are virtually all in multiple systems.

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

C  Declarations for 'suppl_1.dat'	! The Tycho-2 supplement-1

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

C  Position composed of: RAdeg DEdeg (Epoch=J1991.25)
      integer*4     TYC1_1     (nr__1) ! [2,9529]+= TYC1 from TYC (1)
      integer*4     TYC2_1     (nr__1) ! [1,12112]  TYC2 from TYC (1)
      integer*4     TYC3_1     (nr__1) ! [1,4]      TYC3 from TYC (1)
      character*1   flag       (nr__1) ! [HT] data from Hipparcos or Tycho-1 (2)
      real*8        RAdeg_1    (nr__1) ! (deg) Right Asc, ICRS, at epoch=J1991.25
      real*8        DEdeg_1    (nr__1) ! (deg) Decl, ICRS, at epoch=J1991.25
      real*8        pmRA_1     (nr__1) ! (mas/yr) []? Proper motion in RA*cos(dec)
      real*8        pmDE_1     (nr__1) ! (mas/yr) []? Proper motion in Dec
      real*4        e_RAdeg_1  (nr__1) ! (mas) s.e. RA*cos(dec)
      real*4        e_DEdeg_1  (nr__1) ! (mas) s.e. of Dec
      real*4        e_pmRA_1   (nr__1) ! (mas/yr) []? s.e. prop mot in RA * cos(dec)
      real*4        e_pmDE_1   (nr__1) ! (mas/yr) []? s.e. of proper motion in Dec
      character*1   mflag      (nr__1) ! [ BVH] Note about Tycho magnitudes (3)
      real*4        BTmag_1    (nr__1) ! (mag) []? Tycho-1 BT magnitude (4)
      real*4        e_BTmag_1  (nr__1) ! (mag) []? s.e. of BT (4)
      real*4        VTmag_1    (nr__1) ! (mag) []?  Tycho-1 VT or Hp magnitude (4)
      real*4        e_VTmag_1  (nr__1) ! (mag) []? s.e. of VT (4)
      integer*4     prox_1     (nr__1) ! (0.1arcsec) [1,999] proximity indicator (5)
      character*1   TYC_1      (nr__1) ! [ T] Tycho-1 star
      integer*4     HIP_1      (nr__1) ! [1,120404]? Hipparcos number
      character*1   CCDM_1     (nr__1) ! CCDM component identifier for HIP stars
*Note (1): The TYC identifier is constructed from the GSC region number (TYC1),
*    the running number within the region (TYC2) and a component identifier
*    (TYC3) which is normally 1. The numbers are copied from Tycho-1.
*    (see the "Nomenclature Notes" section above)
*Note (2):
*    'H' = data are from Hipparcos and include proper motion.
*    'T' = data are from Tycho-1. No proper motion is given.
*Note (3):
*    ' ' = both BT and VT given.
*    'B' = only BT given.
*    'V' = only VT given.
*    'H' = Hp is given instead of VT. BT is blank.
*Note (4):
*    Blank when no magnitude is available.
*    For Hipparcos stars with no VT, Hp is given instead of VT, and BT is blank.
*Note (5):
*    Distance in units of 100 mas to nearest Tycho-2 main or supplement
*    entry. (Computed for the epoch 1991.25). A value of 999 (i.e. 99.9
*    arcsec) is given if the distance exceeds 99.9 arcsec.

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

C  Declarations for 'suppl_2.dat'	! The Tycho-2 supplement-2

      integer*4 nr__2
      parameter (nr__2=1146)	! Number of records
      character*122 ar__2  	! Full-size record

C  Position composed of: RAdeg DEdeg (Epoch=J1991.25)
      integer*4     TYC1_2     (nr__2) ! [2,9529]+= TYC1 from TYC (1)
      integer*4     TYC2_2     (nr__2) ! [1,12112]  TYC2 from TYC (1)
      integer*4     TYC3_2     (nr__2) ! [1,4]      TYC3 from TYC (1)
      character*1   flag_1     (nr__2) ! [HT] data from Hipparcos or Tycho-1 (2)
      real*8        RAdeg_2    (nr__2) ! (deg) Right Asc, ICRS, at epoch=J1991.25
      real*8        DEdeg_2    (nr__2) ! (deg) Decl, ICRS, at epoch=J1991.25
      real*8        pmRA_2     (nr__2) ! (mas/yr) []? Proper motion in RA*cos(dec)
      real*8        pmDE_2     (nr__2) ! (mas/yr) []? Proper motion in Dec
      real*4        e_RAdeg_2  (nr__2) ! (mas) s.e. RA*cos(dec)
      real*4        e_DEdeg_2  (nr__2) ! (mas) s.e. of Dec
      real*4        e_pmRA_2   (nr__2) ! (mas/yr) []? s.e. prop mot in RA * cos(dec)
      real*4        e_pmDE_2   (nr__2) ! (mas/yr) []? s.e. of proper motion in Dec
      character*1   mflag_1    (nr__2) ! [ BVH] Note about Tycho magnitudes (3)
      real*4        BTmag_2    (nr__2) ! (mag) []? Tycho-1 BT magnitude (4)
      real*4        e_BTmag_2  (nr__2) ! (mag) []? s.e. of BT (4)
      real*4        VTmag_2    (nr__2) ! (mag) []?  Tycho-1 VT or Hp magnitude (4)
      real*4        e_VTmag_2  (nr__2) ! (mag) []? s.e. of VT (4)
      integer*4     prox_2     (nr__2) ! (0.1arcsec) [1,999] proximity indicator (5)
      character*1   TYC_2      (nr__2) ! [ T] Tycho-1 star
      integer*4     HIP_2      (nr__2) ! [1,120404]? Hipparcos number
      character*1   CCDM_2     (nr__2) ! CCDM component identifier for HIP stars
*Note (1): The TYC identifier is constructed from the GSC region number (TYC1),
*    the running number within the region (TYC2) and a component identifier
*    (TYC3) which is normally 1. The numbers are copied from Tycho-1.
*    (see the "Nomenclature Notes" section above)
*Note (2):
*    'H' = data are from Hipparcos and include proper motion.
*    'T' = data are from Tycho-1. No proper motion is given.
*Note (3):
*    ' ' = both BT and VT given.
*    'B' = only BT given.
*    'V' = only VT given.
*    'H' = Hp is given instead of VT. BT is blank.
*Note (4):
*    Blank when no magnitude is available.
*    For Hipparcos stars with no VT, Hp is given instead of VT, and BT is blank.
*Note (5):
*    Distance in units of 100 mas to nearest Tycho-2 main or supplement
*    entry. (Computed for the epoch 1991.25). A value of 999 (i.e. 99.9
*    arcsec) is given if the distance exceeds 99.9 arcsec.

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

C  Declarations for 'index.dat'	! Index to Tycho-2 and supplement-1

      integer*4 nr__3
      parameter (nr__3=9538)	! Number of records
      character*42 ar__3  	! Full-size record

      integer*4     rec_t2     (nr__3) ! +  Tycho-2 rec. of 1st star in region (1)
      integer*4     rec_s1     (nr__3) ! += Suppl-1 rec. of 1st star in region (1)
      real*4        RAmin      (nr__3) ! (deg) [-0.01,] smallest RA in region (2)
      real*4        RAmax      (nr__3) ! (deg) [,360.00] largest RA in region (2)
      real*4        DEmin      (nr__3) ! (deg) smallest Dec in this region (2)
      real*4        DEmax      (nr__3) ! (deg) largest Dec in this region (2)
*Note (1): The catalogue is sorted according to the GSC region numbers.
*    The line i of the index file gives the record number in Tycho-2 of
*    the first star in GSC region i. Line i+1 gives the record number +1
*    of the last star in GSC region i. For Supplement-1, some regions are
*    empty and line i and line i+1 give the same record number.
*Note (2): a safe rounding was applied. Minimum values are always
*    rounded down and maximum values up.

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

C  Loading file 'tyc2.dat'	! *The Tycho-2 main catalogue

C  Format for file interpretation

    1 format(
     +  I4,1X,I5,1X,I1,1X,A1,1X,F12.8,1X,F12.8,1X,F7.1,1X,F7.1,1X,I3,
     +  1X,I3,1X,F4.1,1X,F4.1,1X,F7.2,1X,F7.2,1X,I2,1X,F3.1,1X,F3.1,
     +  1X,F3.1,1X,F3.1,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,I3,1X,A1,
     +  1X,I6,A3,1X,F12.8,1X,F12.8,1X,F4.2,1X,F4.2,1X,F5.1,1X,F5.1,1X,
     +  A1,1X,F4.1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tyc2.dat')
      write(6,*) '....Loading file: tyc2.dat'
      do i__=1,2539913
        read(1,'(A206)')ar__
        read(ar__,1)
     +  TYC1(i__),TYC2(i__),TYC3(i__),pflag(i__),RAmdeg(i__),
     +  DEmdeg(i__),pmRA(i__),pmDE(i__),e_RAmdeg(i__),e_DEmdeg(i__),
     +  e_pmRA(i__),e_pmDE(i__),EpRAm(i__),EpDEm(i__),Num(i__),
     +  q_RAmdeg(i__),q_DEmdeg(i__),q_pmRA(i__),q_pmDE(i__),
     +  BTmag(i__),e_BTmag(i__),VTmag(i__),e_VTmag(i__),prox(i__),
     +  TYC(i__),HIP(i__),CCDM(i__),RAdeg(i__),DEdeg(i__),
     +  EpRA_1990(i__),EpDE_1990(i__),e_RAdeg(i__),e_DEdeg(i__),
     +  posflg(i__),corr(i__)
        if(ar__(16:27) .EQ. '') RAmdeg(i__) = rNULL__
        if(ar__(29:40) .EQ. '') DEmdeg(i__) = rNULL__
        if(ar__(42:48) .EQ. '') pmRA(i__) = rNULL__
        if(ar__(50:56) .EQ. '') pmDE(i__) = rNULL__
        if(ar__(58:60) .EQ. '') e_RAmdeg(i__) = iNULL__
        if(ar__(62:64) .EQ. '') e_DEmdeg(i__) = iNULL__
        if(ar__(66:69) .EQ. '') e_pmRA(i__) = rNULL__
        if(ar__(71:74) .EQ. '') e_pmDE(i__) = rNULL__
        if(ar__(76:82) .EQ. '') EpRAm(i__) = rNULL__
        if(ar__(84:90) .EQ. '') EpDEm(i__) = rNULL__
        if(ar__(92:93) .EQ. '') Num(i__) = iNULL__
        if(ar__(95:97) .EQ. '') q_RAmdeg(i__) = rNULL__
        if(ar__(99:101) .EQ. '') q_DEmdeg(i__) = rNULL__
        if(ar__(103:105) .EQ. '') q_pmRA(i__) = rNULL__
        if(ar__(107:109) .EQ. '') q_pmDE(i__) = rNULL__
        if(ar__(111:116) .EQ. '') BTmag(i__) = rNULL__
        if(ar__(118:122) .EQ. '') e_BTmag(i__) = rNULL__
        if(ar__(124:129) .EQ. '') VTmag(i__) = rNULL__
        if(ar__(131:135) .EQ. '') e_VTmag(i__) = rNULL__
        if(ar__(143:148) .EQ. '') HIP(i__) = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  TYC1(i__),TYC2(i__),TYC3(i__),pflag(i__),RAmdeg(i__),
     +  DEmdeg(i__),pmRA(i__),pmDE(i__),e_RAmdeg(i__),e_DEmdeg(i__),
     +  e_pmRA(i__),e_pmDE(i__),EpRAm(i__),EpDEm(i__),Num(i__),
     +  q_RAmdeg(i__),q_DEmdeg(i__),q_pmRA(i__),q_pmDE(i__),
     +  BTmag(i__),e_BTmag(i__),VTmag(i__),e_VTmag(i__),prox(i__),
     +  TYC(i__),HIP(i__),CCDM(i__),RAdeg(i__),DEdeg(i__),
     +  EpRA_1990(i__),EpDE_1990(i__),e_RAdeg(i__),e_DEdeg(i__),
     +  posflg(i__),corr(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'suppl_1.dat'	! The Tycho-2 supplement-1

C  Format for file interpretation

    2 format(
     +  I4,1X,I5,1X,I1,1X,A1,1X,F12.8,1X,F12.8,1X,F7.1,1X,F7.1,1X,
     +  F5.1,1X,F5.1,1X,F5.1,1X,F5.1,1X,A1,1X,F6.3,1X,F5.3,1X,F6.3,1X,
     +  F5.3,1X,I3,1X,A1,1X,I6,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'suppl_1.dat')
      write(6,*) '....Loading file: suppl_1.dat'
      do i__=1,17588
        read(1,'(A122)')ar__1
        read(ar__1,2)
     +  TYC1_1(i__),TYC2_1(i__),TYC3_1(i__),flag(i__),RAdeg_1(i__),
     +  DEdeg_1(i__),pmRA_1(i__),pmDE_1(i__),e_RAdeg_1(i__),
     +  e_DEdeg_1(i__),e_pmRA_1(i__),e_pmDE_1(i__),mflag(i__),
     +  BTmag_1(i__),e_BTmag_1(i__),VTmag_1(i__),e_VTmag_1(i__),
     +  prox_1(i__),TYC_1(i__),HIP_1(i__),CCDM_1(i__)
        if(ar__1(42:48) .EQ. '') pmRA_1(i__) = rNULL__
        if(ar__1(50:56) .EQ. '') pmDE_1(i__) = rNULL__
        if(ar__1(70:74) .EQ. '') e_pmRA_1(i__) = rNULL__
        if(ar__1(76:80) .EQ. '') e_pmDE_1(i__) = rNULL__
        if(ar__1(84:89) .EQ. '') BTmag_1(i__) = rNULL__
        if(ar__1(91:95) .EQ. '') e_BTmag_1(i__) = rNULL__
        if(ar__1(97:102) .EQ. '') VTmag_1(i__) = rNULL__
        if(ar__1(104:108) .EQ. '') e_VTmag_1(i__) = rNULL__
        if(ar__1(116:121) .EQ. '') HIP_1(i__) = iNULL__
c    ..............Just test output...........
        write(6,2)
     +  TYC1_1(i__),TYC2_1(i__),TYC3_1(i__),flag(i__),RAdeg_1(i__),
     +  DEdeg_1(i__),pmRA_1(i__),pmDE_1(i__),e_RAdeg_1(i__),
     +  e_DEdeg_1(i__),e_pmRA_1(i__),e_pmDE_1(i__),mflag(i__),
     +  BTmag_1(i__),e_BTmag_1(i__),VTmag_1(i__),e_VTmag_1(i__),
     +  prox_1(i__),TYC_1(i__),HIP_1(i__),CCDM_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'suppl_2.dat'	! The Tycho-2 supplement-2

C  Format for file interpretation

    3 format(
     +  I4,1X,I5,1X,I1,1X,A1,1X,F12.8,1X,F12.8,1X,F7.1,1X,F7.1,1X,
     +  F5.1,1X,F5.1,1X,F5.1,1X,F5.1,1X,A1,1X,F6.3,1X,F5.3,1X,F6.3,1X,
     +  F5.3,1X,I3,1X,A1,1X,I6,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'suppl_2.dat')
      write(6,*) '....Loading file: suppl_2.dat'
      do i__=1,1146
        read(1,'(A122)')ar__2
        read(ar__2,3)
     +  TYC1_2(i__),TYC2_2(i__),TYC3_2(i__),flag_1(i__),RAdeg_2(i__),
     +  DEdeg_2(i__),pmRA_2(i__),pmDE_2(i__),e_RAdeg_2(i__),
     +  e_DEdeg_2(i__),e_pmRA_2(i__),e_pmDE_2(i__),mflag_1(i__),
     +  BTmag_2(i__),e_BTmag_2(i__),VTmag_2(i__),e_VTmag_2(i__),
     +  prox_2(i__),TYC_2(i__),HIP_2(i__),CCDM_2(i__)
        if(ar__2(42:48) .EQ. '') pmRA_2(i__) = rNULL__
        if(ar__2(50:56) .EQ. '') pmDE_2(i__) = rNULL__
        if(ar__2(70:74) .EQ. '') e_pmRA_2(i__) = rNULL__
        if(ar__2(76:80) .EQ. '') e_pmDE_2(i__) = rNULL__
        if(ar__2(84:89) .EQ. '') BTmag_2(i__) = rNULL__
        if(ar__2(91:95) .EQ. '') e_BTmag_2(i__) = rNULL__
        if(ar__2(97:102) .EQ. '') VTmag_2(i__) = rNULL__
        if(ar__2(104:108) .EQ. '') e_VTmag_2(i__) = rNULL__
        if(ar__2(116:121) .EQ. '') HIP_2(i__) = iNULL__
c    ..............Just test output...........
        write(6,3)
     +  TYC1_2(i__),TYC2_2(i__),TYC3_2(i__),flag_1(i__),RAdeg_2(i__),
     +  DEdeg_2(i__),pmRA_2(i__),pmDE_2(i__),e_RAdeg_2(i__),
     +  e_DEdeg_2(i__),e_pmRA_2(i__),e_pmDE_2(i__),mflag_1(i__),
     +  BTmag_2(i__),e_BTmag_2(i__),VTmag_2(i__),e_VTmag_2(i__),
     +  prox_2(i__),TYC_2(i__),HIP_2(i__),CCDM_2(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'index.dat'	! Index to Tycho-2 and supplement-1

C  Format for file interpretation

    4 format(I7,1X,I6,1X,F6.2,1X,F6.2,1X,F6.2,1X,F6.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'index.dat')
      write(6,*) '....Loading file: index.dat'
      do i__=1,9538
        read(1,'(A42)')ar__3
        read(ar__3,4)
     +  rec_t2(i__),rec_s1(i__),RAmin(i__),RAmax(i__),DEmin(i__),
     +  DEmax(i__)
c    ..............Just test output...........
        write(6,4)
     +  rec_t2(i__),rec_s1(i__),RAmin(i__),RAmax(i__),DEmin(i__),
     +  DEmax(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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