FORTRAN Generation
(/./ftp/cats/J/ApJS/168/277)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJS/168/277 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-28
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/ApJS/168/277     HK-Survey field horizontal-branch candidates   (Beers+, 2007)
*================================================================================
*A catalog of candidate field horizontal-branch and A-type stars.
*III. A 2MASS-cleaned version.
*    Beers T.C., Almeida T., Rossi S., Wilhelm R., Marsteller B.
*   <Astrophys. J. Suppl. Ser., 168, 277-288 (2007)>
*   =2007ApJS..168..277B
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table3.dat'	! Catalog of HK-Survey field horizontal-branch
                                 candidates

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

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

      character*12  BPS        (nr__) ! Star name (BPS BS FFFFF-NNNN
*                                     or BPS CS FFFFF-NNNN in Simbad)
      character*1   n_BPS      (nr__) ! [*] Indicates data added by the CDS team (1)
      integer*4     BC         (nr__) ! ? Brightness classification (2)
      integer*4     RAh        (nr__) ! (h) Hour of Right Ascension (J2000)
      integer*4     RAm        (nr__) ! (min) Minute of Right Ascension (J2000)
      real*4        RAs        (nr__) ! (s) Second of Right Ascension (J2000)
      character*1   DE_        (nr__) ! Sign of the Declination (J2000)
      integer*4     DEd        (nr__) ! (deg) Degree of Declination (J2000)
      integer*4     DEm        (nr__) ! (arcmin) Arcminute of Declination (J2000)
      integer*4     DEs        (nr__) ! (arcsec) Arcsecond of Declination (J2000)
      real*4        GLON       (nr__) ! (deg) Galactic longitude
      real*4        GLAT       (nr__) ! (deg) Galactic latitude
      real*4        Vmag       (nr__) ! (mag) ? Measured V band magnitude
      real*4        B_V        (nr__) ! (mag) ? Measured (B-V) color index
      real*4        E_B_V      (nr__) ! (mag) ? Adopted reddening estimate
      real*4        Jmag       (nr__) ! (mag) ? 2MASS J band magnitude
      real*4        J_H        (nr__) ! (mag) ? 2MASS (J-H) color index
      real*4        V0mag      (nr__) ! (mag) ? Extinction-corrected V band magnitude
      real*4        V0mag2     (nr__) ! (mag) ? Predicted 2MASS extinction-corrected
*                                      V band magnitude
      real*4        v_B_V_0    (nr__) ! (mag) ? Reddening-corrected (B-V) color index
      real*4        v_B_V_02   (nr__) ! (mag) ? Predicted 2MASS reddening-corrected
*                                      (B-V) color index
      character*2   q_Class    (nr__) ! BHB probability classification (3)
      character*5   Class      (nr__) ! Wilhelm et al. (1999, Cat. J/AJ/117/2329)
*                                     classification (4)
*Note (1): BPS CS 30339-015 is not part of the original table, but was added
*     by the CDS team so that tables 3 and 4 have the same number of
*     entries. Data were taken both from 2MASS and from Simbad.
*Note (2): From visual inspection of the HK survey plates (1=brightest)
*Note (3): The BHB (Blue Horizontal Branch) likelihood is assigned in the
*          following manner:
*     H = (high) star has either a measured or estimated (B-V)0 color in the
*         range -0.2<=(B-V)0<=+0.2;
*     M = (medium) star has either a measured or estimated (B-V)0 color in the
*          range -0.3<=(B-V)0<-0.2 or +0.2<(B-V)0<=+0.4;
*     L = (low) star has either a measured or estimated (B-V)0 color in the 
*         range lying outside of -0.3<=(B-V)0<=+0.4.
*     Stars where there remained some difficulty in either assigning a
*     confident 2MASS match, or where the 2MASS flags indicated possible
*     problems with the photometry, are indicated by the ":" attached to the
*     probability classification. Stars for which no suitable match in 2MASS
*     could be found are assigned an "X" for their probability
*     classifications.
*Note (4): Classification, defined as follows:
*    FHB = the star has a derived temperature and gravity consistent with a
*          horizontal-branch identification;
*  FHB/A = it was not possible, based on the data in hand, to differentiate
*          between a horizontal-branch and a high-gravity A-type star
*          identification;
*    A-V = the star is a likely high-gravity object (note that this includes
*          some stars with temperatures cooler than would usually be considered
*          for assignment of a type A designation);
*     Am = the star is a likely metallic-line A-type star. The interested reader
*          should consult Wilhelm et al. (1999, Cat. J/AJ/117/2308) for a more
*          detailed discussion of these classes.

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

C  Declarations for 'table4.dat'	! 2MASS identifications of HK-Survey field horizontal-
                             branch candidates and multiple identifications

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

C  J2000 position composed of: RA2h RA2m RA2s DE2- DE2d DE2m DE2s
      real*8        RAdeg_1    (nr__1) ! (deg) Right Ascension J2000
      real*8        DEdeg_1    (nr__1) ! (deg)     Declination J2000
C  ---------------------------------- ! (position vector(s) in degrees)

      character*12  BPS_1      (nr__1) ! Star name
      character*16  v2MASS     (nr__1) ! The 2MASS Identification (HHMMSSss+DDMMSSs,
*                                  2MASS JHHMMSSss+DDMMSSs in Simbad)
      integer*4     RA2h       (nr__1) ! (h) ? Hour of Right Ascension (J2000)
      integer*4     RA2m       (nr__1) ! (min) ? Minute of Right Ascension (J2000)
      real*4        RA2s       (nr__1) ! (s) ? Second of Right Ascension (J2000)
      character*1   DE2_       (nr__1) ! Sign of the Declination (J2000)
      integer*4     DE2d       (nr__1) ! (deg) ? Degree of Declination (J2000)
      integer*4     DE2m       (nr__1) ! (arcmin) ? Arcminute of Declination (J2000)
      real*4        DE2s       (nr__1) ! (arcsec) ? Arcsecond of Declination (J2000)
      character*38  MID        (nr__1) ! Multiple HK-survey Identification(s) (1)
*Note (1): Note that some of these multiply-identified stars are not present
*     in the FHB/A candidate catalog, since they were not classified as such
*     in the HK survey.

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

C  Loading file 'table3.dat'	! Catalog of HK-Survey field horizontal-branch
*                                 candidates

C  Format for file interpretation

    1 format(
     +  A12,A1,I1,1X,I2,1X,I2,1X,F4.1,1X,A1,I2,1X,I2,1X,I2,1X,F5.1,1X,
     +  F5.1,1X,F5.2,1X,F5.2,1X,F5.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F6.3,1X,A2,1X,A5)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,12057
        read(1,'(A116)')ar__
        read(ar__,1)
     +  BPS(i__),n_BPS(i__),BC(i__),RAh(i__),RAm(i__),RAs(i__),
     +  DE_(i__),DEd(i__),DEm(i__),DEs(i__),GLON(i__),GLAT(i__),
     +  Vmag(i__),B_V(i__),E_B_V(i__),Jmag(i__),J_H(i__),V0mag(i__),
     +  V0mag2(i__),v_B_V_0(i__),v_B_V_02(i__),q_Class(i__),Class(i__)
        if(ar__(14:14) .EQ. '') BC(i__) = iNULL__
        if(ar__(49:53) .EQ. '') Vmag(i__) = rNULL__
        if(ar__(55:59) .EQ. '') B_V(i__) = rNULL__
        if(ar__(61:65) .EQ. '') E_B_V(i__) = rNULL__
        if(ar__(67:72) .EQ. '') Jmag(i__) = rNULL__
        if(ar__(74:79) .EQ. '') J_H(i__) = rNULL__
        if(ar__(81:86) .EQ. '') V0mag(i__) = rNULL__
        if(ar__(88:93) .EQ. '') V0mag2(i__) = rNULL__
        if(ar__(95:100) .EQ. '') v_B_V_0(i__) = rNULL__
        if(ar__(102:107) .EQ. '') v_B_V_02(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)
     +  BPS(i__),n_BPS(i__),BC(i__),RAh(i__),RAm(i__),RAs(i__),
     +  DE_(i__),DEd(i__),DEm(i__),DEs(i__),GLON(i__),GLAT(i__),
     +  Vmag(i__),B_V(i__),E_B_V(i__),Jmag(i__),J_H(i__),V0mag(i__),
     +  V0mag2(i__),v_B_V_0(i__),v_B_V_02(i__),q_Class(i__),Class(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 'table4.dat'	! 2MASS identifications of HK-Survey field horizontal-
*                             branch candidates and multiple identifications

C  Format for file interpretation

    2 format(
     +  A12,1X,A16,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,A38)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table4.dat')
      write(6,*) '....Loading file: table4.dat'
      do i__=1,12057
        read(1,'(A92)')ar__1
        read(ar__1,2)
     +  BPS_1(i__),v2MASS(i__),RA2h(i__),RA2m(i__),RA2s(i__),
     +  DE2_(i__),DE2d(i__),DE2m(i__),DE2s(i__),MID(i__)
        if(ar__1(31:32) .EQ. '') RA2h(i__) = iNULL__
        if(ar__1(34:35) .EQ. '') RA2m(i__) = iNULL__
        if(ar__1(37:41) .EQ. '') RA2s(i__) = rNULL__
        if(ar__1(44:45) .EQ. '') DE2d(i__) = iNULL__
        if(ar__1(47:48) .EQ. '') DE2m(i__) = iNULL__
        if(ar__1(50:53) .EQ. '') DE2s(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(RA2h(i__) .GT. -180) RAdeg_1(i__)=RA2h(i__)*15.
        if(RA2m(i__) .GT. -180) RAdeg_1(i__)=RAdeg_1(i__)+RA2m(i__)/4.
        if(RA2s(i__) .GT. -180) RAdeg_1(i__)=RAdeg_1(i__)+RA2s(i__)/240.
        if(DE2d(i__) .GE. 0) DEdeg_1(i__)=DE2d(i__)
        if(DE2m(i__) .GE. 0) DEdeg_1(i__)=DEdeg_1(i__)+DE2m(i__)/60.
        if(DE2s(i__) .GE. 0) DEdeg_1(i__)=DEdeg_1(i__)+DE2s(i__)/3600.
        if(DE2_(i__).EQ.'-'.AND.DEdeg_1(i__).GE.0) DEdeg_1(i__)=-DEdeg_1(i__)
c    ..............Just test output...........
        write(6,2)
     +  BPS_1(i__),v2MASS(i__),RA2h(i__),RA2m(i__),RA2s(i__),
     +  DE2_(i__),DE2d(i__),DE2m(i__),DE2s(i__),MID(i__)
        write(6,'(6H Pos: 2F8.4)') RAdeg_1(i__),DEdeg_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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