FORTRAN Generation
(/./ftp/cats/IV/27A)

Conversion of standardized ReadMe file for file /./ftp/cats/IV/27A 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-16
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. IV/27A            HD-DM-GC-HR-HIP-Bayer-Flamsteed Cross Index    (Kostjuk, 2002)
*================================================================================
*HD-DM-GC-HR-HIP-Bayer-Flamsteed Cross Index
*     Kostjuk N.D.
*    <Institute of Astronomy of Russian Academy of Sciences (2002)>
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! HD-DM-GC-HR-HIP-Bayer-Flamsteed Cross Index

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

      integer*4     HD         (nr__) ! [1/257937] Henry Draper Catalog Number <III/135>
      character*12  DM         (nr__) ! Durchmusterung Identification from HD Catalog
*                                  <III/135> (1)
      integer*4     GC         (nr__) ! [1/33342]? Boss General Catalog (GC, <I/113>)
*                                   number if one exists, otherwise blank
      integer*4     HR         (nr__) ! [1/9110]? Harvard Revised Number=Bright Star
*                                   Number <V/50> if one exists, otherwise blank
      integer*4     HIP        (nr__) ! [1/120416]? Hipparcos Catalog <I/196> number
*                                   if one exists, otherwise blank
      integer*4     RAh        (nr__) ! (h) Right Ascension J2000 (hours) (2)
      integer*4     RAm        (nr__) ! (min) Right Ascension J2000 (minutes) (2)
      real*4        RAs        (nr__) ! (s) Right Ascension J2000 (seconds) (2)
      character*1   DE_        (nr__) ! Declination J2000 (sign)
      integer*4     DEd        (nr__) ! (deg) Declination J2000 (degrees) (2)
      integer*4     DEm        (nr__) ! (arcmin) Declination J2000 (minutes) (2)
      real*4        DEs        (nr__) ! (arcsec) Declination J2000 (seconds) (2)
      real*4        Vmag       (nr__) ! (mag) [-1.44/13.4]? Visual magnitude (2)
      integer*4     Fl         (nr__) ! ? Flamsteed number (G1)
      character*5   Bayer      (nr__) ! Bayer designation (G1)
      character*3   Cst        (nr__) ! Constellation abbreviation (G1)
*Note (1): Durchmusterung Identification from HD Catalog <III/135>
*    consists of DM Catalog designation:
*      BD north of -23 degrees,
*      CD from -23 to -52 degrees,
*      CP south of -52 degrees
*    Sign of DM zone, DM zone, DM number and component identification if
*    there are two or more HD stars with the same DM number (for multiple
*    systems included in the Washington Catalog of Visual Double Stars the
*    same designation are given).
*Note (2): Right ascensions, declinations and visual magnitudes for all
*    stars were taken from the Hipparcos catalog and from the CSI for the
*    stars that has no number in catalog Hipparcos.

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

C  Declarations for 'table1.dat'	! *List of alternative names for 454 stars
                             from the file catalog.dat

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

      integer*4     HD_1       (nr__1) ! [1/257937] Henry Draper Catalog number
      character*13  BFD        (nr__1) ! Bayer-Flamsteed designation of star
      character*1   n_BFD      (nr__1) ! [+ ] +: Bayer-Flamsteed designation accepted
*                                     in 'catalog.dat', otherwise - in the
*                                     catalogues of 'refs.dat'
      character*41  r_BFD      (nr__1) ! References detailed in 'refs.dat', where this
*                                 BFD-designation of star is taken

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

C  Declarations for 'table2.dat'	! List of alternative HD number or DM number
                              for 48 stars from the file catalog.dat

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

      character*13  BFD1       (nr__2) ! Bayer-Flamsteed designation of star accepted in
*                                 the catalog (1)
      character*13  BFD2       (nr__2) ! Bayer-Flamsteed designation of star in other
*                                 catalogs  (1)
      character*11  ID1        (nr__2) ! HD or DM number in the catalog for the star BFD1
      character*29  r_BFD1     (nr__2) ! References detailed in 'refs.dat' for BFD1
      character*11  ID2        (nr__2) ! Another HD or DM number for the BFD2
      character*14  r_BFD2     (nr__2) ! References detailed in 'refs.dat' for BFD2
*Note (1): In some cases (such as 55 Cas,52 Per) the star has various
*    HD numbers but it is not pointed that this star is double.

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

C  Declarations for 'table3.dat'	! List of proper names for 345 stars from the
                              file catalog.dat

      integer*4 nr__3
      parameter (nr__3=807)	! Number of records
      character*100 ar__3  	! Full-size record

      integer*4     HD_2       (nr__3) ! [1/257937] Henry Draper Catalog number
      character*13  BFD_1      (nr__3) ! Bayer-Flamsteed designation of star in catalog
      character*55  Name       (nr__3) ! Proper name for the star
      character*23  r_Name     (nr__3) ! References detailed in 'refs.dat'

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

C  Declarations for 'refs.dat'	! List of source catalogs and atlases

      integer*4 nr__4
      parameter (nr__4=26)	! Number of records
      character*143 ar__4  	! Full-size record

      integer*4     Ref        (nr__4) ! [1/26] Reference number
      character*7   Cat        (nr__4) ! Number of the catalogue in the CDS
      character*132 Text       (nr__4) ! Authors, name and complete reference

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

C  Declarations for 'addendum.dat'	! Addendum (see the "History" section below)

      integer*4 nr__5
      parameter (nr__5=277)	! Number of records
      character*77 ar__5  	! Full-size record

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

      integer*4     HD_3       (nr__5) ! ? Henry Draper Catalog Number <III/135>
      character*1   n_HD       (nr__5) ! [x*N] Duplicate, constellation, or Nova (1)
      integer*4     HR_1       (nr__5) ! [1/9110]?  Harvard Revised Number=Bright Star
*                                   Number <V/50> if one exists, otherwise blank
      integer*4     HIP_1      (nr__5) ! [1/120416]? Hipparcos Catalog <I/196> number
*                                   if one exists, otherwise blank
      integer*4     RAh_1      (nr__5) ! (h) Right Ascension J2000 (hours)
      integer*4     RAm_1      (nr__5) ! (min) Right Ascension J2000 (minutes)
      real*4        RAs_1      (nr__5) ! (s) Right Ascension J2000 (seconds)
      character*1   DE__1      (nr__5) ! Declination J2000 (sign)
      integer*4     DEd_1      (nr__5) ! (deg) Declination J2000 (degrees)
      integer*4     DEm_1      (nr__5) ! (arcmin) Declination J2000 (minutes)
      real*4        DEs_1      (nr__5) ! (arcsec) Declination J2000 (seconds)
      real*4        Vmag_1     (nr__5) ! (mag) ? Visual magnitude
      integer*4     Fl_1       (nr__5) ! ? Flamsteed number (G1)
      character*5   Bayer_1    (nr__5) ! Bayer designation (G1)
      character*3   Cst_1      (nr__5) ! Constellation abbreviation (G1)
*Note (1): flag as follows:
*    x = duplicated entry (2 different names for this star)
*    * = name refers to a constellation outside the official one
*    N = nova (concerns 11 Vul = CK Vul = Nova Vul 1670, not in HD)

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

C  Loading file 'catalog.dat'	! HD-DM-GC-HR-HIP-Bayer-Flamsteed Cross Index

C  Format for file interpretation

    1 format(
     +  I6,1X,A12,1X,I5,1X,I4,1X,I6,1X,I2,I2,F5.2,1X,A1,I2,I2,F4.1,1X,
     +  F5.2,1X,I3,1X,A5,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,3690
        read(1,'(A77)')ar__
        read(ar__,1)
     +  HD(i__),DM(i__),GC(i__),HR(i__),HIP(i__),RAh(i__),RAm(i__),
     +  RAs(i__),DE_(i__),DEd(i__),DEm(i__),DEs(i__),Vmag(i__),
     +  Fl(i__),Bayer(i__),Cst(i__)
        if(ar__(21:25) .EQ. '') GC(i__) = iNULL__
        if(ar__(27:30) .EQ. '') HR(i__) = iNULL__
        if(ar__(32:37) .EQ. '') HIP(i__) = iNULL__
        if(ar__(59:63) .EQ. '') Vmag(i__) = rNULL__
        if(ar__(65:67) .EQ. '') Fl(i__) = iNULL__
        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)
     +  HD(i__),DM(i__),GC(i__),HR(i__),HIP(i__),RAh(i__),RAm(i__),
     +  RAs(i__),DE_(i__),DEd(i__),DEm(i__),DEs(i__),Vmag(i__),
     +  Fl(i__),Bayer(i__),Cst(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 'table1.dat'	! *List of alternative names for 454 stars
*                             from the file catalog.dat

C  Format for file interpretation

    2 format(I6,1X,A13,1X,A1,1X,A41)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,1226
        read(1,'(A64)')ar__1
        read(ar__1,2)HD_1(i__),BFD(i__),n_BFD(i__),r_BFD(i__)
c    ..............Just test output...........
        write(6,2)HD_1(i__),BFD(i__),n_BFD(i__),r_BFD(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! List of alternative HD number or DM number
*                              for 48 stars from the file catalog.dat

C  Format for file interpretation

    3 format(A13,1X,A13,2X,A11,2X,A29,1X,A11,2X,A14)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,58
        read(1,'(A99)')ar__2
        read(ar__2,3)
     +  BFD1(i__),BFD2(i__),ID1(i__),r_BFD1(i__),ID2(i__),r_BFD2(i__)
c    ..............Just test output...........
        write(6,3)
     +  BFD1(i__),BFD2(i__),ID1(i__),r_BFD1(i__),ID2(i__),r_BFD2(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! List of proper names for 345 stars from the
*                              file catalog.dat

C  Format for file interpretation

    4 format(I6,1X,A13,1X,A55,1X,A23)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,807
        read(1,'(A100)')ar__3
        read(ar__3,4)HD_2(i__),BFD_1(i__),Name(i__),r_Name(i__)
c    ..............Just test output...........
        write(6,4)HD_2(i__),BFD_1(i__),Name(i__),r_Name(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'refs.dat'	! List of source catalogs and atlases

C  Format for file interpretation

    5 format(I2,1X,A7,1X,A132)

C  Effective file loading

      open(unit=1,status='old',file=
     +'refs.dat')
      write(6,*) '....Loading file: refs.dat'
      do i__=1,26
        read(1,'(A143)')ar__4
        read(ar__4,5)Ref(i__),Cat(i__),Text(i__)
c    ..............Just test output...........
        write(6,5)Ref(i__),Cat(i__),Text(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'addendum.dat'	! Addendum (see the "History" section below)

C  Format for file interpretation

    6 format(
     +  I6,A1,19X,I4,1X,I6,1X,I2,I2,F5.2,1X,A1,I2,I2,F4.1,1X,F5.2,1X,
     +  I3,1X,A5,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'addendum.dat')
      write(6,*) '....Loading file: addendum.dat'
      do i__=1,277
        read(1,'(A77)')ar__5
        read(ar__5,6)
     +  HD_3(i__),n_HD(i__),HR_1(i__),HIP_1(i__),RAh_1(i__),
     +  RAm_1(i__),RAs_1(i__),DE__1(i__),DEd_1(i__),DEm_1(i__),
     +  DEs_1(i__),Vmag_1(i__),Fl_1(i__),Bayer_1(i__),Cst_1(i__)
        if(ar__5(1:6) .EQ. '') HD_3(i__) = iNULL__
        if(ar__5(27:30) .EQ. '') HR_1(i__) = iNULL__
        if(ar__5(32:37) .EQ. '') HIP_1(i__) = iNULL__
        if(ar__5(59:63) .EQ. '') Vmag_1(i__) = rNULL__
        if(ar__5(65:67) .EQ. '') Fl_1(i__) = iNULL__
        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,6)
     +  HD_3(i__),n_HD(i__),HR_1(i__),HIP_1(i__),RAh_1(i__),
     +  RAm_1(i__),RAs_1(i__),DE__1(i__),DEd_1(i__),DEm_1(i__),
     +  DEs_1(i__),Vmag_1(i__),Fl_1(i__),Bayer_1(i__),Cst_1(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