FORTRAN Generation
(/./ftp/cats/J/AJ/149/5)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/149/5 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/149/5    Solar neighborhood. XXXV. Distances to M dwarfs   (Winters+, 2015)
*================================================================================
*The solar neighborhood.
*XXXV. Distances to 1404 M dwarf systems within 25 pc in the southern sky.
*    Winters J.G., Hambly N.C., Jao W.-C., Dieterich S.B., Lurie J.C.,
*    Henry T.J., Hosey A.D., Slatten K.J., Boyd M.R., Ianna P.A., Riedel A.R.,
*    Subasavage J.P., Finch C.T., Bartlett J.L.
*   <Astron. J., 149, 5 (2015)>
*   =2015AJ....149....5W
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Observed data for southern red dwarf systems

      integer*4 nr__
      parameter (nr__=1748)	! Number of records
      character*160 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)

      character*14  Name        ! Name of the M dwarf primary (G1)
      integer*4     Nc          ! Number of known components in the system
      integer*4     Np          ! ? Indicates how many of the components are
*                                    included in the photometry
      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)
      integer*4     DEs         ! (arcsec) Arcsecond of Declination (J2000)
      real*4        pm          ! (arcsec/yr) Total proper motion magnitude
      real*4        pmPA        ! (deg) Proper motion position angle
      integer*4     r_pm        ! Reference for pm (in refs.dat file) (1)
      real*8        plx         ! (mas) ? Weighted mean of published trigonometric
*                                    parallaxes (see Section 3.4)
      character*2   f_plx       ! Note on plx (2)
      real*4        e_plx       ! (mas) ? Error in plx
      integer*4     o_plx       ! ? Number of measurements for plx
      character*13  r_plx       ! Reference for plx (in ref.dat file)
      real*4        Bmag        ! (mag) ? SuperCOSMOS B_J_ plate magnitude (3)
      character*1   f_Bmag      ! [J] Magnitude blended due to a close companion
      real*4        Fmag        ! (mag) ? SuperCOSMOS R_59F_ plate magnitude (3)
      character*1   f_Fmag      ! [J] Magnitude blended due to a close companion
      real*4        Nmag        ! (mag) ? SuperCOSMOS I_IVN_ plate magnitude (3)
      character*1   f_Nmag      ! [J] Magnitude blended due to a close companion
      real*4        Vmag        ! (mag) ? The Johnson V band magnitude (4)
      character*1   f_Vmag      ! [J] Magnitude blended due to a close companion
      real*4        Rmag        ! (mag) ? The Kron-Cousins R band magnitude (4)
      character*1   f_Rmag      ! [J] Magnitude blended due to a close companion
      real*4        Imag        ! (mag) ? The Kron-Cousins I band magnitude (4)
      character*1   f_Imag      ! [J] Magnitude blended due to a close companion
      integer*4     o_Imag      ! ? Number of VRI nights from REsearch
*                                    Consortium On Nearby Stars (RECONS;
*                                    http://www.recons.org/)
      integer*4     r_Imag      ! ? Reference for RECONS VRI magnitudes
      character*1   New         ! [U] Indicates updated RECONS VRI values (5)
      real*4        Jmag        ! (mag) 2MASS J band magnitude
      character*2   f_Jmag      ! Blended or inaccurate Jmag (6)
      real*4        Hmag        ! (mag) 2MASS H band magnitude
      character*2   f_Hmag      ! Blended or inaccurate Hmag (6)
      real*4        Kmag        ! (mag) 2MASS Ks band magnitude
      character*2   f_Kmag      ! Blended or inaccurate Kmag (6)
*Note (1): All proper motions are from SuperCOSMOS, except where noted. Some of
*     the proper motion values from the SuperCOSMOS Sky Survey for SCR objects
*     presented here differ slightly from those in the original discovery papers.
*     For the new values, a more comprehensive method has been used that provides
*     multiple measurements of proper motion between various plate pairs, while
*     before only a single value was available that incorporated all plates into
*     the solution simultaneously. The proper motions provided here are those
*     that yield consistent values among multiple determinations and are
*     preferred.
*Note (2): Flag on parallax defined as follows:
* a = The weighted mean parallax includes the parallax of both the primary and
*     the secondary components;
* b = The HIP parallax is markedly different from that published in the Yale
*     Parallax Catalog (YPC; Also called The General Catalogue of Trigonometric
*     Stellar Parallaxes, Fourth Edition, van Altena 1995, cat. I/174) and has
*     an error of ~45mas.
*Note (3): The wavelength ranges for the B_J_, R_59F_, and I_IVN_ filters are
*     3950-5400{AA}, 5900-6900{AA}, and 7150-9000{AA}, respectively (Morgan,
*     1995ASPC...84..137M, p137). See Section 3.1 for more details about the
*     B_J_R_59F_I_IVN_ plate photometry. The plate R_59F_ magnitude is the
*     second, more recent R epoch measurement of the two available in the
*     SuperCOSMOS Sky Survey.
*Note (4): Primarily the V_J_, R_KC_, I_KC_ magnitudes measured by REsearch
*     Consortium On Nearby Stars (RECONS; http://www.recons.org/) group at Cerro
*     Tololo Inter-American Observatory (CTIO) and the number of observations,
*     or VRI from a trusted source. The central wavelengths for the V_J_(old),
*     V_J_(new), R_KC_, and I_KC_ filters are 5438, 5475, 6425, and 8075{AA},
*     respectively. See Jao et al., 2011AJ....141..117J, for a discussion of the
*     nearly identical V_J_(old) and V_J_(new) filters. See Section 3.2 for more
*     details about the V_J_R_KC_I_KC_ CCD photometry.
*Note (5):
* u = We have previously published photometry for this object, but have since
*     then acquired more data and updated the value.
*Note (6): Flag on 2MASS magnitude defined as follows:
* J = Indicates that light from a close companion has resulted in blended
*     photometry;
* c = 2MASS magnitude error greater than 0.05mag.

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

C  Declarations for 'table2.dat'	! Derived data for southern red dwarf systems

      integer*4 nr__1
      parameter (nr__1=1748)	! Number of records
      character*98 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)

      character*14  Name2       ! Name of the M dwarf primary (G1)
      integer*4     RAh_1       ! (h) Hour of Right Ascension (J2000)
      integer*4     RAm_1       ! (min) Minute of Right Ascension (J2000)
      real*4        RAs_1       ! (s) Second of Right Ascension (J2000)
      character*1   DE__1       ! Sign of the Declination (J2000)
      integer*4     DEd_1       ! (deg) Degree of Declination (J2000)
      integer*4     DEm_1       ! (arcmin) Arcminute of Declination (J2000)
      integer*4     DEs_1       ! (arcsec) Arcsecond of Declination (J2000)
      real*4        dplt        ! (pc) ? The plate derived distance (7)
      character*3   f_dplt      ! Distance closer or further than estimated (8)
      real*4        e_dplt      ! (pc) ? Total error in dplt
      integer*4     o_dplt      ! Number of relations used in dplt
      real*4        dccd        ! (pc) ? The CCD derived distance (9)
      character*3   f_dccd      ! Distance closer or further than estimated (8)
      real*4        e_dccd      ! (pc) ? Total error in dccd
      integer*4     o_dccd      ! ? Number of relations used in dccd
      real*4        dtrig       ! (pc) ? Distance from weighted mean of published
*                                   parallaxes (see Section 3.4 for details)
      character*1   f_dtrig     ! [a] Indicates the weighted mean distance
*                                   includes that of both the primary and the
*                                   secondary components
      real*4        e_dtrig     ! (pc) ? Weighted mean error in dtrig
      integer*4     o_dtrig     ! ? Number of parallaxes used in dtrig
      real*4        dbest       ! (pc) [2.7/214] Most reliable distance
      character*1   f_dbest     ! Distance closer or further than estimated (8)
      character*3   n_dbest     ! Most reliable distance type (ccd, plt, trg)
*Note (7): Calculated by combining SuperCOSMOS BRI photometry with 2MASS infrared
*     photometry via a suite of 15 color-M_K_ relations using BRIJHK, as
*     described in Hambly et al. (2004AJ....128..437H). See Secion 4.1 for
*     additional details.
*Note (8): The flags on distance are defined as follows:
* c = Confirmed or candidate subdwarf (distance typically closer than estimated);
* f = Distance based on blended photometry (distance typically further than
*     estimated).
*Note (9): Determined using a method similar to that used for the plate derived
*     distances and as described by Henry et al. (2004AJ....128..437H). The
*     difference is that we use more accurate CCD VRI magnitudes obtained at
*     Cerro Tololo Inter-American Observatory (CTIO) instead of plate magnitudes
*     from SuperCOSMOS to determine the suite of color-M_K_ relations.
*     See Secion 4.2 for more details.

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

C  Declarations for 'refs.dat'	! References

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

      integer*4     Ref         ! Reference identifier
      character*19  BibCode     ! Bibliographic code
      character*21  Aut         ! Author's name
      character*21  Cat         ! Catalog in VizieR database

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

C  Loading file 'table1.dat'	! Observed data for southern red dwarf systems

C  Format for file interpretation

    1 format(
     +  A14,1X,I1,1X,I1,1X,I2,1X,I2,1X,F4.1,1X,A1,I2,1X,I2,1X,I2,1X,
     +  F5.3,1X,F5.1,1X,I2,1X,F7.2,1X,A2,3X,F4.2,1X,I1,1X,A13,1X,F5.2,
     +  A1,1X,F5.2,A1,1X,F5.2,A1,1X,F5.2,A1,1X,F5.2,A1,1X,F5.2,A1,1X,
     +  I1,1X,I2,A1,1X,F5.2,A2,1X,F5.2,A2,1X,F5.2,A2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,1748
        read(1,'(A160)')ar__
        read(ar__,1)
     +  Name,Nc,Np,RAh,RAm,RAs,DE_,DEd,DEm,DEs,pm,pmPA,r_pm,plx,f_plx,
     +  e_plx,o_plx,r_plx,Bmag,f_Bmag,Fmag,f_Fmag,Nmag,f_Nmag,Vmag,
     +  f_Vmag,Rmag,f_Rmag,Imag,f_Imag,o_Imag,r_Imag,New,Jmag,f_Jmag,
     +  Hmag,f_Hmag,Kmag,f_Kmag
        if(ar__(18:18) .EQ. '') Np = iNULL__
        if(ar__(56:62) .EQ. '') plx = rNULL__
        if(ar__(69:72) .EQ. '') e_plx = rNULL__
        if(ar__(74:74) .EQ. '') o_plx = iNULL__
        if(ar__(90:94) .EQ. '') Bmag = rNULL__
        if(ar__(97:101) .EQ. '') Fmag = rNULL__
        if(ar__(104:108) .EQ. '') Nmag = rNULL__
        if(ar__(111:115) .EQ. '') Vmag = rNULL__
        if(ar__(118:122) .EQ. '') Rmag = rNULL__
        if(ar__(125:129) .EQ. '') Imag = rNULL__
        if(ar__(132:132) .EQ. '') o_Imag = iNULL__
        if(ar__(134:135) .EQ. '') r_Imag = iNULL__
        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)
     +  Name,Nc,Np,RAh,RAm,RAs,DE_,DEd,DEm,DEs,pm,pmPA,r_pm,plx,f_plx,
     +  e_plx,o_plx,r_plx,Bmag,f_Bmag,Fmag,f_Fmag,Nmag,f_Nmag,Vmag,
     +  f_Vmag,Rmag,f_Rmag,Imag,f_Imag,o_Imag,r_Imag,New,Jmag,f_Jmag,
     +  Hmag,f_Hmag,Kmag,f_Kmag
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Derived data for southern red dwarf systems

C  Format for file interpretation

    2 format(
     +  A14,1X,I2,1X,I2,1X,F4.1,1X,A1,I2,1X,I2,1X,I2,1X,F5.1,1X,A3,1X,
     +  F4.1,1X,I2,1X,F5.1,1X,A3,1X,F4.1,1X,I2,1X,F5.1,1X,A1,1X,F5.1,
     +  1X,I1,1X,F5.1,A1,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,1748
        read(1,'(A98)')ar__1
        read(ar__1,2)
     +  Name2,RAh_1,RAm_1,RAs_1,DE__1,DEd_1,DEm_1,DEs_1,dplt,f_dplt,
     +  e_dplt,o_dplt,dccd,f_dccd,e_dccd,o_dccd,dtrig,f_dtrig,e_dtrig,
     +  o_dtrig,dbest,f_dbest,n_dbest
        if(ar__1(37:41) .EQ. '') dplt = rNULL__
        if(ar__1(47:50) .EQ. '') e_dplt = rNULL__
        if(ar__1(55:59) .EQ. '') dccd = rNULL__
        if(ar__1(65:68) .EQ. '') e_dccd = rNULL__
        if(ar__1(70:71) .EQ. '') o_dccd = iNULL__
        if(ar__1(73:77) .EQ. '') dtrig = rNULL__
        if(ar__1(81:85) .EQ. '') e_dtrig = rNULL__
        if(ar__1(87:87) .EQ. '') o_dtrig = iNULL__
        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)
     +  Name2,RAh_1,RAm_1,RAs_1,DE__1,DEd_1,DEm_1,DEs_1,dplt,f_dplt,
     +  e_dplt,o_dplt,dccd,f_dccd,e_dccd,o_dccd,dtrig,f_dtrig,e_dtrig,
     +  o_dtrig,dbest,f_dbest,n_dbest
        write(6,'(6H Pos: 2F8.4)') RAdeg_1,DEdeg_1
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'refs.dat'	! References

C  Format for file interpretation

    3 format(I2,1X,A19,1X,A21,1X,A21)

C  Effective file loading

      open(unit=1,status='old',file=
     +'refs.dat')
      write(6,*) '....Loading file: refs.dat'
      do i__=1,74
        read(1,'(A66)')ar__2
        read(ar__2,3)Ref,BibCode,Aut,Cat
c    ..............Just test output...........
        write(6,3)Ref,BibCode,Aut,Cat
c    .......End.of.Just test output...........
      end do
      close(1)

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