FORTRAN Generation
(/./ftp/cats/J/AJ/141/21)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/141/21 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-Mar-29
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/141/21        CCD distance estimates of SCR targets        (Winters+, 2011)
*================================================================================
*The solar neighborhood.
*XXIII. CCD photometric distance estimates of SCR targets.
*77 M dwarf systems within 25 pc.
*    Winters J.G., Henry T.J., Jao W.-C., Subasavage J.P., Finch C.T.,
*    Hambly N.C.
*   <Astron. J., 141, 21 (2011)>
*   =2011AJ....141...21W
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table2.dat'	! BRI photometric results for new SCR discoveries

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

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

      character*9   SCR        (nr__) ! SCR designation, HHMM+DDMM (G1)
      character*2   m_SCR      (nr__) ! Multiplicity index on SCR (G1)
      integer*4     RAh        (nr__) ! (h) Right ascension (J2000, Ep=J2000) (G1)
      integer*4     RAm        (nr__) ! (min) Right ascension (J2000, Ep=J2000) (G1)
      real*4        RAs        (nr__) ! (s) Right ascension (J2000, Ep=J2000) (G1)
      character*1   DE_        (nr__) ! Declination sign (J2000, Ep=J2000) (G1)
      integer*4     DEd        (nr__) ! (deg) Declination (J2000, Ep=J2000) (G1)
      integer*4     DEm        (nr__) ! (arcmin) Declination (J2000, Ep=J2000) (G1)
      real*4        DEs        (nr__) ! (arcsec) Declination (J2000, Ep=J2000) (G1)
      real*4        Bmag       (nr__) ! (mag) ?=- SuperCOSMOS B_J_ magnitude
      character*1   n_Bmag     (nr__) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Rmag       (nr__) ! (mag) SuperCOSMOS R_59F_ plate magnitude
      character*1   n_Rmag     (nr__) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Imag       (nr__) ! (mag) SuperCOSMOS I_IVN_ plate magnitude
      character*1   n_Imag     (nr__) ! [J] Joint photometry (when m_SCR contains AB)

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

C  Declarations for 'table3.dat'	! Photometric results for SCR sample ({mu}>=0.18"/yr)

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

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

      character*9   SCR_1      (nr__1) ! SCR designation, HHMM+DDMM (G1)
      character*2   m_SCR_1    (nr__1) ! Multiplicity index on SCR (G1)
      integer*4     RAh_1      (nr__1) ! (h) Right ascension (J2000.0, Ep=J2000) (G1)
      integer*4     RAm_1      (nr__1) ! (min) Right ascension (J2000.0, Ep=J2000) (G1)
      real*4        RAs_1      (nr__1) ! (s) Right ascension (J2000.0, Ep=J2000) (G1)
      character*1   DE__1      (nr__1) ! Declination sign (J2000.0, Ep=J2000) (G1)
      integer*4     DEd_1      (nr__1) ! (deg) Declination (J2000.0, Ep=J2000) (G1)
      integer*4     DEm_1      (nr__1) ! (arcmin) Declination (J2000.0, Ep=J2000) (G1)
      real*4        DEs_1      (nr__1) ! (arcsec) Declination (J2000.0, Ep=J2000) (G1)
      real*4        pm         (nr__1) ! (arcsec/yr) Proper motion as measured by SuperCOSMOS
      real*4        pmPA       (nr__1) ! (deg) Position angle as measured by SuperCOSMOS
      real*4        Vmag       (nr__1) ! (mag) ?=- Johnson V magnitude
      character*1   n_Vmag     (nr__1) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Rmag_1     (nr__1) ! (mag) Kron-Cousins R magnitude
      character*1   n_Rmag_1   (nr__1) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Imag_1     (nr__1) ! (mag) Kron-Cousins I magnitude
      character*1   n_Imag_1   (nr__1) ! [J] Joint photometry (when m_SCR contains AB)
      integer*4     Nn         (nr__1) ! Number of nights each system was observed
      real*4        Jmag       (nr__1) ! (mag) 2MASS J magnitude
      character*1   n_Jmag     (nr__1) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Hmag       (nr__1) ! (mag) 2MASS H magnitude
      character*1   n_Hmag     (nr__1) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Ksmag      (nr__1) ! (mag) 2MASS Ks magnitude
      character*1   n_Ksmag    (nr__1) ! [J] Joint photometry (when m_SCR contains AB)
      real*4        Dplt       (nr__1) ! (pc) Distance estimate from plate
      real*4        e_Dplt     (nr__1) ! (pc) rms uncertainty on Dplt
      integer*4     N1         (nr__1) ! Number of color-absolute magnitude relations
*                                   utilized for Dplt
      real*4        Dccd       (nr__1) ! (pc) Distance estimate from CCD
      real*4        e_Dccd     (nr__1) ! (pc) rms uncertainty on Dccd
      integer*4     N2         (nr__1) ! Number of color-absolute magnitude relations
*                                   utilized for Dccd
      real*4        Vtan       (nr__1) ! (km/s) Tangential velocity, based on the CCD distance
*                                   estimates and the SuperCOSMOS proper motions
      character*5   SpType     (nr__1) ! MK spectral type
      character*5   Ref        (nr__1) ! References (2)
      character*3   Notes      (nr__1) ! Notes, in notes.dat file
*Note (2): References as follows:
*   1 = Hambly et al., 2004AJ....128..437H
*   2 = Henry et al., 2004AJ....128.2460H
*   3 = Subasavage et al., 2005AJ....129..413S
*   4 = Subasavage et al., 2005AJ....130.1658S
*   5 = Finch et al., 2007AJ....133.2898F
*   6 = this paper

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

C  Declarations for 'notes.dat'	! Individual notes

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

      character*1   Note       (nr__2) ! Note code
      character*72  Text       (nr__2) ! Text of the note

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

C  Loading file 'table2.dat'	! BRI photometric results for new SCR discoveries

C  Format for file interpretation

    1 format(
     +  3X,A9,A2,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,F5.2,
     +  A1,1X,F5.2,A1,1X,F5.2,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,29
        read(1,'(A59)')ar__
        read(ar__,1)
     +  SCR(i__),m_SCR(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),
     +  DEd(i__),DEm(i__),DEs(i__),Bmag(i__),n_Bmag(i__),Rmag(i__),
     +  n_Rmag(i__),Imag(i__),n_Imag(i__)
        if (idig(ar__(40:44)).EQ.0) Bmag(i__) =  rNULL__
        RAdeg(i__) = rNULL__
        DEdeg(i__) = rNULL__
c  Derive coordinates RAdeg and DEdeg from input data
c  (RAdeg and DEdeg are set to rNULL__ when unknown)
        if(RAh(i__) .GT. -180) RAdeg(i__)=RAh(i__)*15.
        if(RAm(i__) .GT. -180) RAdeg(i__)=RAdeg(i__)+RAm(i__)/4.
        if(RAs(i__) .GT. -180) RAdeg(i__)=RAdeg(i__)+RAs(i__)/240.
        if(DEd(i__) .GE. 0) DEdeg(i__)=DEd(i__)
        if(DEm(i__) .GE. 0) DEdeg(i__)=DEdeg(i__)+DEm(i__)/60.
        if(DEs(i__) .GE. 0) DEdeg(i__)=DEdeg(i__)+DEs(i__)/3600.
        if(DE_(i__).EQ.'-'.AND.DEdeg(i__).GE.0) DEdeg(i__)=-DEdeg(i__)
c    ..............Just test output...........
        write(6,1)
     +  SCR(i__),m_SCR(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),
     +  DEd(i__),DEm(i__),DEs(i__),Bmag(i__),n_Bmag(i__),Rmag(i__),
     +  n_Rmag(i__),Imag(i__),n_Imag(i__)
        write(6,'(6H Pos: 2F8.4)') RAdeg(i__),DEdeg(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Photometric results for SCR sample ({mu}>=0.18"/yr)

C  Format for file interpretation

    2 format(
     +  3X,A9,A2,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,F5.3,
     +  1X,F5.1,1X,F5.2,A1,F5.2,A1,F5.2,A1,I1,1X,F5.2,A1,F5.2,A1,F5.2,
     +  A1,F4.1,1X,F4.1,1X,I2,1X,F4.1,1X,F3.1,1X,I2,1X,F4.1,1X,A5,1X,
     +  A5,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,104
        read(1,'(A134)')ar__1
        read(ar__1,2)
     +  SCR_1(i__),m_SCR_1(i__),RAh_1(i__),RAm_1(i__),RAs_1(i__),
     +  DE__1(i__),DEd_1(i__),DEm_1(i__),DEs_1(i__),pm(i__),pmPA(i__),
     +  Vmag(i__),n_Vmag(i__),Rmag_1(i__),n_Rmag_1(i__),Imag_1(i__),
     +  n_Imag_1(i__),Nn(i__),Jmag(i__),n_Jmag(i__),Hmag(i__),
     +  n_Hmag(i__),Ksmag(i__),n_Ksmag(i__),Dplt(i__),e_Dplt(i__),
     +  N1(i__),Dccd(i__),e_Dccd(i__),N2(i__),Vtan(i__),SpType(i__),
     +  Ref(i__),Notes(i__)
        if (idig(ar__1(52:56)).EQ.0) Vmag(i__) =  rNULL__
        RAdeg_1(i__) = rNULL__
        DEdeg_1(i__) = 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(i__) .GT. -180) RAdeg_1(i__)=RAh_1(i__)*15.
        if(RAm_1(i__) .GT. -180) RAdeg_1(i__)=RAdeg_1(i__)+RAm_1(i__)/4.
        if(RAs_1(i__) .GT. -180) RAdeg_1(i__)=RAdeg_1(i__)+RAs_1(i__)/240.
        if(DEd_1(i__) .GE. 0) DEdeg_1(i__)=DEd_1(i__)
        if(DEm_1(i__) .GE. 0) DEdeg_1(i__)=DEdeg_1(i__)+DEm_1(i__)/60.
        if(DEs_1(i__) .GE. 0) DEdeg_1(i__)=DEdeg_1(i__)+DEs_1(i__)/3600.
        if(DE__1(i__).EQ.'-'.AND.DEdeg_1(i__).GE.0) DEdeg_1(i__)=-DEdeg_1(i__)
c    ..............Just test output...........
        write(6,2)
     +  SCR_1(i__),m_SCR_1(i__),RAh_1(i__),RAm_1(i__),RAs_1(i__),
     +  DE__1(i__),DEd_1(i__),DEm_1(i__),DEs_1(i__),pm(i__),pmPA(i__),
     +  Vmag(i__),n_Vmag(i__),Rmag_1(i__),n_Rmag_1(i__),Imag_1(i__),
     +  n_Imag_1(i__),Nn(i__),Jmag(i__),n_Jmag(i__),Hmag(i__),
     +  n_Hmag(i__),Ksmag(i__),n_Ksmag(i__),Dplt(i__),e_Dplt(i__),
     +  N1(i__),Dccd(i__),e_Dccd(i__),N2(i__),Vtan(i__),SpType(i__),
     +  Ref(i__),Notes(i__)
        write(6,'(6H Pos: 2F8.4)') RAdeg_1(i__),DEdeg_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'notes.dat'	! Individual notes

C  Format for file interpretation

    3 format(A1,1X,A72)

C  Effective file loading

      open(unit=1,status='old',file=
     +'notes.dat')
      write(6,*) '....Loading file: notes.dat'
      do i__=1,31
        read(1,'(A74)')ar__2
        read(ar__2,3)Note(i__),Text(i__)
c    ..............Just test output...........
        write(6,3)Note(i__),Text(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C Locate position of first digit in string; or return 0
      integer function idig(c)
      character*(*) c
      character*1 c1
      integer lc,i
      lc=len(c)
      idig=0
      do i=1,lc
         if(c(i:i).ne.' ') go to 1
      end do
    1 if(i.gt.lc) return
      c1=c(i:i)
      if(c1.eq.'.'.or.c1.eq.'-'.or.c1.eq.'+') i=i+1
      if(i.gt.lc) return
      c1=c(i:i)
      if(c1.ge.'0'.and.c1.le.'9') idig=i
      return
      end