FORTRAN Generation
(/./ftp/cats/J/AJ/144/62)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/144/62 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-Apr-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. J/AJ/144/62  Tertiary companions to close spectroscopic binaries  (Allen+, 2012)
*================================================================================
*Low-mass tertiary companions to spectroscopic binaries.
*I. Common proper motion survey for wide companions using 2MASS.
*    Allen P.R., Burgasser A.J., Faherty J.K., Kirkpatrick J.D.
*   <Astron. J., 144, 62 (2012)>
*   =2012AJ....144...62A
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Spectroscopic binary target list

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

C  J2000 position composed of: RAh RAm RAs DE- DEd DEm DEs
      real*8        RAdeg       ! (deg) Right Ascension J2000
      real*8        DEdeg       ! (deg)     Declination J2000
C  ---------------------------------- ! (position vector(s) in degrees)

      integer*4     HIP         ! [171/117712] Hipparcos Number
      integer*4     RAh         ! (h) Hour of Right Ascension (J2000)
      integer*4     RAm         ! (min) Minute of Right Ascension (J2000)
      real*4        RAs         ! (s) Second of Right Ascension (J2000)
      character*1   DE_         ! Sign of the Declination (J2000)
      integer*4     DEd         ! (deg) Degree of Declination (J2000)
      integer*4     DEm         ! (arcmin) Arcminute of Declination (J2000)
      real*4        DEs         ! (arcsec) Arcsecond of Declination (J2000)
      real*4        plx         ! (mas) [33/380] Parallax (1)
      real*4        e_plx       ! (mas) [0.4/7.7] Uncertainty in plx
      real*8        pmRA        ! (mas/yr) [-717/1152] Proper motion along RA (1)
      real*4        e_pmRA      ! (mas/yr) [0.3/7] Uncertainty in pmRA
      real*8        pmDE        ! (mas/yr) [-1224/714] Proper motion along DE (1)
      real*4        e_pmDE      ! (mas/yr) [0.3/7] Uncertainty in pmDE
      real*8        Per         ! (d) [0.2/70127] Period of the spectroscopic
*                                     binary (2)
      real*4        Vmag        ! (mag) [-1.5/11.5] V band magnitude (2)
      character*8   SpT         ! MK spectral type (2)
      character*12  Date        ! ("D:M:Y") ? UT date of the observation
      character*4   Tel         ! Telescope used (CTIO=Cerro Tololo or
*                                   KPNO=Kitt Peak Obs.)
*Note (1): Derived from the Hipparcos database (Perryman et al. 1997, I/239).
*Note (2): From the Ninth Catalog of Spectroscopic Binaries
*          (Pourbaix et al. 2004, Cat. B/sb9).

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

C  Declarations for 'table2.dat'	! Candidate and known common proper motion (CPM)
                             companions

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

C  J2000 position composed of: RAh RAm RAs DE- DEd DEm DEs
      real*8        RAdeg_1     ! (deg) Right Ascension J2000
      real*8        DEdeg_1     ! (deg)     Declination J2000
C  ---------------------------------- ! (position vector(s) in degrees)

      integer*4     HIP_1       ! [13081/111802] Hipparcos number
      integer*4     RAh_1       ! (h) Tertiary hour of right ascension (J2000)
*                                    from 2MASS
      integer*4     RAm_1       ! (min) Tertiary minute of right ascension (J2000)
      real*4        RAs_1       ! (s) Tertiary second of right ascension (J2000)
      character*1   DE__1       ! Tertiary sign of declination (J2000)
*                                    from 2MASS
      integer*4     DEd_1       ! (deg) Tertiary degree of declination (J2000)
*                                    from 2MASS
      integer*4     DEm_1       ! (arcmin) Tertiary arcminute of declination (J2000)
      integer*4     DEs_1       ! (arcsec) Tertiary arcsecond of declination (J2000)
      real*4        pmRA_1      ! (mas/yr) [-566/444] Proper motion along RA (1)
      integer*4     e_pmRA_1    ! (mas/yr) [24/48] pmRA uncertainty (1)
      real*4        pmDE_1      ! (mas/yr) [-632/280] Proper motion along DEC (1)
      integer*4     e_pmDE_1    ! (mas/yr) [28/44] pmDE uncertainty (1)
      integer*4     Sep         ! (AU) [200/9640]? Separation
      real*4        JMag        ! (mag) [4/15]? Absolute J-magnitude (2)
      real*4        e_JMag      ! (mag) [0.01/0.2]? JMag uncertainty (2)
      real*4        J_Ks        ! (mag) [-0.008/1.8]? 2MASS PSC J-Ks color index
      real*4        e_J_Ks      ! (mag) [0.02/0.3]? J-Ks uncertainty
      real*4        J_H         ! (mag) [0.1/1.2]? 2MASS PSC J-H color index
      real*4        e_J_H       ! (mag) [0.02/0.3]? J-H uncertainty
      real*4        H_Ks        ! (mag) [-0.4/0.6]? 2MASS PSC K-Ks color index
      real*4        e_H_Ks      ! (mag) [0.02/0.3]? H-Ks uncertainty
      character*4   SpT_1       ! Tertiary MK spectral type (3)
      character*5   SpTI        ! Primary MK spectral type
      integer*4     Note        ! [1/5] Note (4)
      character*1   r_SpT       ! Reference for SpT (5)
      character*3   Status      ! Companion status (Yes/No)
*Note (1): Listed proper motion measurements are derived from the data presented
*          in this paper save for those objects with a "5" in the "Note" column.
*          Those values were taken from Hipparcos, as those objects were
*          saturated in our data.
*Note (2): Absolute J magnitudes derived from 2MASS photometry and Hipparcos
*          parallaxes.
*Note (3): Companion spectral types were based either on SpeX prism spectroscopy
*          obtained for this work (objects with "2" or "3" in the Note column) or
*          were already known in which case the spectral type listed is from the
*          paper referenced by the lettered superscripts in the r_Note column
*          (objects with "1" or "5" in the Note column).
*Note (4): Note as follows:
* 1 = Previously known companion, no additional follow-up data required.
* 2 = Previously known candidate companion, no Spectral Type, SpeX data acquired.
* 3 = No previous data, SpeX data acquired.
* 4 = Additional photometry acquired from Vizier database, not a companion.
* 5 = Previously known bright companion. Saturated in these data, found via
*     literature search using the SIMBAD database.
*Note (5): Reference for the companion spectral type as follows:
* e = Reid et al. (1995, Cat. III/198).
* f = Tokovinin et al. (2006, Cat. J/A+A/450/681).
* g = Makarov et al. (2008ApJ...687..566M).
* h = Joy & Sanford (1926ApJ....64..250J).
* i = Reid et al. (2003, Cat. J/AJ/126/3007).
* j = Close et al. (1990AJ....100.1968C).
* k = Wilson et al. (2001AJ....122.1989W).
* l = Gizis et al. (2001ApJ...551L.163G).
* m = Dommanget & Nys (2002, Cat. I/274).

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

C  Loading file 'table1.dat'	! Spectroscopic binary target list

C  Format for file interpretation

    1 format(
     +  I6,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,F6.2,1X,F4.2,
     +  1X,F7.2,1X,F4.2,1X,F8.2,1X,F4.2,1X,F9.3,1X,F5.2,1X,A8,1X,A12,
     +  1X,A4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,118
        read(1,'(A112)')ar__
        read(ar__,1)
     +  HIP,RAh,RAm,RAs,DE_,DEd,DEm,DEs,plx,e_plx,pmRA,e_pmRA,pmDE,
     +  e_pmDE,Per,Vmag,SpT,Date,Tel
        RAdeg = rNULL__
        DEdeg = rNULL__
c  Derive coordinates RAdeg and DEdeg from input data
c  (RAdeg and DEdeg are set to rNULL__ when unknown)
        if(RAh .GT. -180) RAdeg=RAh*15.
        if(RAm .GT. -180) RAdeg=RAdeg+RAm/4.
        if(RAs .GT. -180) RAdeg=RAdeg+RAs/240.
        if(DEd .GE. 0) DEdeg=DEd
        if(DEm .GE. 0) DEdeg=DEdeg+DEm/60.
        if(DEs .GE. 0) DEdeg=DEdeg+DEs/3600.
        if(DE_.EQ.'-'.AND.DEdeg.GE.0) DEdeg=-DEdeg
c    ..............Just test output...........
        write(6,1)
     +  HIP,RAh,RAm,RAs,DE_,DEd,DEm,DEs,plx,e_plx,pmRA,e_pmRA,pmDE,
     +  e_pmDE,Per,Vmag,SpT,Date,Tel
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Candidate and known common proper motion (CPM)
*                             companions

C  Format for file interpretation

    2 format(
     +  I6,1X,I2,1X,I2,1X,F4.1,1X,A1,I2,1X,I2,1X,I2,1X,F6.1,1X,I2,1X,
     +  F6.1,1X,I2,1X,I4,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F5.3,1X,
     +  F5.3,1X,F6.3,1X,F5.3,1X,A4,1X,A5,1X,I1,1X,A1,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,18
        read(1,'(A122)')ar__1
        read(ar__1,2)
     +  HIP_1,RAh_1,RAm_1,RAs_1,DE__1,DEd_1,DEm_1,DEs_1,pmRA_1,
     +  e_pmRA_1,pmDE_1,e_pmDE_1,Sep,JMag,e_JMag,J_Ks,e_J_Ks,J_H,
     +  e_J_H,H_Ks,e_H_Ks,SpT_1,SpTI,Note,r_SpT,Status
        if(ar__1(49:52) .EQ. '') Sep = iNULL__
        if(ar__1(54:59) .EQ. '') JMag = rNULL__
        if(ar__1(61:65) .EQ. '') e_JMag = rNULL__
        if(ar__1(67:72) .EQ. '') J_Ks = rNULL__
        if(ar__1(74:78) .EQ. '') e_J_Ks = rNULL__
        if(ar__1(80:84) .EQ. '') J_H = rNULL__
        if(ar__1(86:90) .EQ. '') e_J_H = rNULL__
        if(ar__1(92:97) .EQ. '') H_Ks = rNULL__
        if(ar__1(99:103) .EQ. '') e_H_Ks = rNULL__
        RAdeg_1 = rNULL__
        DEdeg_1 = rNULL__
c  Derive coordinates RAdeg_1 and DEdeg_1 from input data
c  (RAdeg_1 and DEdeg_1 are set to rNULL__ when unknown)
        if(RAh_1 .GT. -180) RAdeg_1=RAh_1*15.
        if(RAm_1 .GT. -180) RAdeg_1=RAdeg_1+RAm_1/4.
        if(RAs_1 .GT. -180) RAdeg_1=RAdeg_1+RAs_1/240.
        if(DEd_1 .GE. 0) DEdeg_1=DEd_1
        if(DEm_1 .GE. 0) DEdeg_1=DEdeg_1+DEm_1/60.
        if(DEs_1 .GE. 0) DEdeg_1=DEdeg_1+DEs_1/3600.
        if(DE__1.EQ.'-'.AND.DEdeg_1.GE.0) DEdeg_1=-DEdeg_1
c    ..............Just test output...........
        write(6,2)
     +  HIP_1,RAh_1,RAm_1,RAs_1,DE__1,DEd_1,DEm_1,DEs_1,pmRA_1,
     +  e_pmRA_1,pmDE_1,e_pmDE_1,Sep,JMag,e_JMag,J_Ks,e_J_Ks,J_H,
     +  e_J_H,H_Ks,e_H_Ks,SpT_1,SpTI,Note,r_SpT,Status
        write(6,'(6H Pos: 2F8.4)') RAdeg_1,DEdeg_1
c    .......End.of.Just test output...........
      end do
      close(1)

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