FORTRAN Generation
(/./ftp/cats/J/other/RAA/17.62)

Conversion of standardized ReadMe file for file /./ftp/cats/J/other/RAA/17.62 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-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/other/RAA/17.62     Candidate members of 4 stellar streams         (Li+, 2017)
*================================================================================
*Candidate members of the Pal 5, GD-1, Cetus Polar and Orphan tidal stellar halo
*streams from SDSS DR9, LAMOST DR3 and APOGEE catalogs.
*    Li G.-W., Yanny B., Zhang H.-T., Bai Z.-R., Wu Y., Dong Y.-Q., Lei Y.-J.,
*    Yuan H.-L., Hou Y.-H., Wang Y.-F., Zhang Y.
*   <Res. Astron. Astrophys., 17, 62 (2017)>
*   =2017RAA....17...62L    (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Candidates in LAMOST

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

C  J2000 position composed of: RAdeg DEdeg
      character*6   Stream     (nr__) ! Stream designation
      integer*4     ObsID      (nr__) ! LAMOST ObsID (1)
      character*2   Subclass   (nr__) ! Spectral type
      real*8        RAdeg      (nr__) ! (deg) Right ascension (J2000)
      real*8        DEdeg      (nr__) ! (deg) Declination (J2000)
      real*8        HRV        (nr__) ! (km/s) Heliocentric radial velocity
      real*8        Teff       (nr__) ! (K) Effective temperature
      real*4        v_Fe_H_    (nr__) ! ([-]) Metallicity
      real*4        logg       (nr__) ! ([cm/s2]) Surface gravity
      real*4        e_HRV      (nr__) ! (km/s) rms uncertainty on HRV
      real*4        e_Teff     (nr__) ! (K) rms uncertainty on Teff
      real*4        e__Fe_H_   (nr__) ! ([-]) rms uncertainty on [Fe/H]
      real*4        e_logg     (nr__) ! ([cm/s2]) rms uncertainty on logg
      integer*4     Level      (nr__) ! [1/3] Confidence level:
*                                     1 represents highest confidence
*Note (1):  the same object in different observation has different obsid which
*  is unique for all LAMOST spectra.

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

C  Declarations for 'table2.dat'	! Candidates in SDSS

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

C  J2000 position composed of: RAdeg DEdeg
      character*6   Stream_1   (nr__1) ! Stream designation
      integer*4     Plate      (nr__1) ! SDSS plate number
      integer*4     MJD        (nr__1) ! (d) SDSS MJD number
      integer*4     Fiber      (nr__1) ! SDSS Fiber number
      character*3   Subclass_1 (nr__1) ! Spectral type
      real*8        RAdeg_1    (nr__1) ! (deg) Right ascension (J2000)
      real*8        DEdeg_1    (nr__1) ! (deg) Declination (J2000)
      real*8        HRV_1      (nr__1) ! (km/s) Heliocentric radial velocity
      real*8        Teff_1     (nr__1) ! (K) Effective temperature
      real*4        v_Fe_H__1  (nr__1) ! ([-]) Metallicity
      real*4        v_Fe_H_wbg (nr__1) ! ([-]) ?=- WBG Metallicity (1)
      real*4        logg_1     (nr__1) ! ([cm/s2]) Surface gravity
      real*4        e_HRV_1    (nr__1) ! (km/s) rms uncertainty on HRV
      real*4        e_Teff_1   (nr__1) ! (K) rms uncertainty on Teff
      real*4        e__Fe_H__1 (nr__1) ! ([-]) rms uncertainty on [Fe/H]
      real*4        e__Fe_H_wbg(nr__1) ! ([-]) ?=- rms uncertainty on [Fe/H]wbg
      real*4        e_logg_1   (nr__1) ! ([cm/s2]) rms uncertainty on logg
      integer*4     Level_1    (nr__1) ! [1/3] Confidence level:
*                                      1 represents highest confidence
*Note (1): Newberg et al. (2009ApJ...700L..61N) found the quoted FEHWBG
*   (Wilhelm et al., 1999, Cat. J/AJ/117/2308) (WBG) parameter is a better
*   measure of metallicity than FEHADOP for blue horizontal branch (BHB) stars,
*   so we use WBG metallicity for stars with (g-r)_0_<=0.2 and
*   FEHADOP (adopted) metallicity for stars with (g-r)_0_>=0.2.

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

C  Declarations for 'table3.dat'	! Candidates in APOGEE

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

C  J2000 position composed of: RAdeg DEdeg
      character*5   Stream_2   (nr__2) ! Stream designation
      character*18  v2MASS     (nr__2) ! 2MASS name (2MHHMMSSss+DDMMSSs)
      real*8        RAdeg_2    (nr__2) ! (deg) Right ascension (J2000)
      real*8        DEdeg_2    (nr__2) ! (deg) Declination (J2000)
      real*4        HRV_2      (nr__2) ! (km/s) Heliocentric radial velocity
      real*8        Teff_2     (nr__2) ! (K) ? Effective temperature
      real*4        v_Fe_H__2  (nr__2) ! ([-]) ? Metallicity
      real*4        logg_2     (nr__2) ! ([cm/s2]) ? Surface gravity
      real*4        e_HRV_2    (nr__2) ! (km/s) rms uncertainty on HRV
      real*4        e_Teff_2   (nr__2) ! (K) ? rms uncertainty on Teff
      real*4        e__Fe_H__2 (nr__2) ! ([-]) ? rms uncertainty on [Fe/H]
      real*4        e_logg_2   (nr__2) ! ([cm/s2]) ? rms uncertainty on logg
      integer*4     Level_2    (nr__2) ! [1] Confidence level:
*                                       1 represents highest confidence

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

C  Loading file 'table1.dat'	! Candidates in LAMOST

C  Format for file interpretation

    1 format(
     +  A6,1X,I9,1X,A2,1X,F12.8,1X,F11.8,1X,F7.2,1X,F7.2,1X,F5.2,1X,
     +  F4.2,1X,F5.2,1X,F6.2,1X,F4.2,1X,F4.2,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,48
        read(1,'(A96)')ar__
        read(ar__,1)
     +  Stream(i__),ObsID(i__),Subclass(i__),RAdeg(i__),DEdeg(i__),
     +  HRV(i__),Teff(i__),v_Fe_H_(i__),logg(i__),e_HRV(i__),
     +  e_Teff(i__),e__Fe_H_(i__),e_logg(i__),Level(i__)
c    ..............Just test output...........
        write(6,1)
     +  Stream(i__),ObsID(i__),Subclass(i__),RAdeg(i__),DEdeg(i__),
     +  HRV(i__),Teff(i__),v_Fe_H_(i__),logg(i__),e_HRV(i__),
     +  e_Teff(i__),e__Fe_H_(i__),e_logg(i__),Level(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Candidates in SDSS

C  Format for file interpretation

    2 format(
     +  A6,1X,I4,1X,I5,1X,I3,1X,A3,1X,F10.6,1X,F10.6,1X,F7.2,1X,F7.2,
     +  1X,F5.2,1X,F5.2,1X,F4.2,1X,F5.2,1X,F6.2,1X,F4.2,1X,F4.2,1X,
     +  F4.2,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,187
        read(1,'(A110)')ar__1
        read(ar__1,2)
     +  Stream_1(i__),Plate(i__),MJD(i__),Fiber(i__),Subclass_1(i__),
     +  RAdeg_1(i__),DEdeg_1(i__),HRV_1(i__),Teff_1(i__),
     +  v_Fe_H__1(i__),v_Fe_H_wbg(i__),logg_1(i__),e_HRV_1(i__),
     +  e_Teff_1(i__),e__Fe_H__1(i__),e__Fe_H_wbg(i__),e_logg_1(i__),
     +  Level_1(i__)
        if (idig(ar__1(71:75)).EQ.0) v_Fe_H_wbg(i__) =  rNULL__
        if (idig(ar__1(100:103)).EQ.0) e__Fe_H_wbg(i__) =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Stream_1(i__),Plate(i__),MJD(i__),Fiber(i__),Subclass_1(i__),
     +  RAdeg_1(i__),DEdeg_1(i__),HRV_1(i__),Teff_1(i__),
     +  v_Fe_H__1(i__),v_Fe_H_wbg(i__),logg_1(i__),e_HRV_1(i__),
     +  e_Teff_1(i__),e__Fe_H__1(i__),e__Fe_H_wbg(i__),e_logg_1(i__),
     +  Level_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Candidates in APOGEE

C  Format for file interpretation

    3 format(
     +  A5,1X,A18,1X,F10.6,1X,F9.6,1X,F6.2,1X,F7.2,1X,F5.2,1X,F4.2,1X,
     +  F4.2,1X,F5.2,1X,F4.2,1X,F4.2,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,7
        read(1,'(A94)')ar__2
        read(ar__2,3)
     +  Stream_2(i__),v2MASS(i__),RAdeg_2(i__),DEdeg_2(i__),
     +  HRV_2(i__),Teff_2(i__),v_Fe_H__2(i__),logg_2(i__),
     +  e_HRV_2(i__),e_Teff_2(i__),e__Fe_H__2(i__),e_logg_2(i__),
     +  Level_2(i__)
        if(ar__2(54:60) .EQ. '') Teff_2(i__) = rNULL__
        if(ar__2(62:66) .EQ. '') v_Fe_H__2(i__) = rNULL__
        if(ar__2(68:71) .EQ. '') logg_2(i__) = rNULL__
        if(ar__2(78:82) .EQ. '') e_Teff_2(i__) = rNULL__
        if(ar__2(84:87) .EQ. '') e__Fe_H__2(i__) = rNULL__
        if(ar__2(89:92) .EQ. '') e_logg_2(i__) = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  Stream_2(i__),v2MASS(i__),RAdeg_2(i__),DEdeg_2(i__),
     +  HRV_2(i__),Teff_2(i__),v_Fe_H__2(i__),logg_2(i__),
     +  e_HRV_2(i__),e_Teff_2(i__),e__Fe_H__2(i__),e_logg_2(i__),
     +  Level_2(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