FORTRAN Generation
(/./ftp/cats/III/135A)

Conversion of standardized ReadMe file for file /./ftp/cats/III/135A 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 2018-Jul-21
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. III/135A    Henry Draper Catalogue and Extension (Cannon+ 1918-1924; ADC 1989)
*================================================================================
*Henry Draper Catalogue and Extension 1 (HD,HDE)
*    Cannon A.J., Pickering E.C.
*   <Harv. Ann. 91-100 (1918-1924)>
*   =1993yCat.3135....0C
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! The catalogue

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

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

      integer*4     HD          ! [1/272150]+ Henry Draper Catalog (HD) number
      character*12  DM          ! Durchmusterung identification (1)
      integer*4     RAh         ! (h) Hours RA, equinox B1900, epoch 1900.0
      integer*4     RAdm        ! (0.1min) Deci-Minutes RA, equinox B1900, epoch 1900.0
      character*1   DE_         ! Sign Dec, equinox B1900, epoch 1900.0
      integer*4     DEd         ! (deg) Degrees Dec, equinox B1900, epoch 1900.0
      integer*4     DEm         ! (arcmin) Minutes Dec, equinox B1900, epoch 1900.0
      integer*4     q_Ptm       ! [0/1]? Code for Ptm: 0 = measured, 1 = value
*                                       inferred from Ptg and spectral type
      real*4        Ptm         ! (mag) ? Photovisual magnitude (2)
      character*1   n_Ptm       ! [C] 'C' if Ptm is combined value with Ptg
      integer*4     q_Ptg       ! [0/1]? Code for Ptg: 0 = measured, 1 = value
*                                       inferred from Ptm and spectral type
      real*4        Ptg         ! (mag) ? Photographic magnitude (2)
      character*1   n_Ptg       ! [C] 'C' if Ptg is combined value for this
*                                  entry and the following or preceding entry
      character*3   SpT         ! Spectral type
      character*2   Int         ! [ 0-9B] Photographic intensity of spectrum (3)
      character*1   Rem         ! [DEGMR*] Remarks, see note (4)
*Note (1): the DM number is composed of:
*     Bytes 7-8 = catalog ID, 'BD', 'CD', 'CP', or 'AG' for AGK1 stars
*                (zones +50 to +59) not in the BD
*     Bytes 9-16 = Durchmusterung catalog number, SZZNNNNN.
*                 For AG zones, the ZZ field contains the lowest
*                 declination zone in the appropriate catalog (50 or 55)
*     Byte 17 = BD supplement letter (catalogue <I/71> by Warren and Kress)
*     Byte 18 = DM component identification
*Note (2): codes used for the magnitudes:
*     20.0 =  nebula          (Neb  in published catalog)
*     30.0 =  variable        (var. in published catalog)
*     40.0 =  nova            (Nov. in published catalog)
*     50.0 =  cluster         (Cl.  in published catalog)
*     blank = no value in published catalog
*Note (3): this intensity is a number between 1 and 10,
*     but has the value 14 for HD 35041, and
*     value 'B' for HD 37788 and 41366
*Note (4): The codes are:
*     D = Entry deleted (see adc.doc)
*     E = Image at edge of plate
*     G = Position and BD number taken directly from AGK1 and precessed to 1900
*     M = Multiple images used (see adc.doc)
*     R = Remark in the published catalog
*     * = Spectral type refers a cluster, nebula or nebulous star. (see adc.doc)

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

C  Loading file 'catalog.dat'	! The catalogue

C  Format for file interpretation

    1 format(I6,A12,I2,I3,A1,I2,I2,I1,F5.2,A1,I1,F5.2,A1,A3,A2,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,272150
        read(1,'(A48)')ar__
        read(ar__,1)
     +  HD,DM,RAh,RAdm,DE_,DEd,DEm,q_Ptm,Ptm,n_Ptm,q_Ptg,Ptg,n_Ptg,
     +  SpT,Int,Rem
        if(ar__(29:29) .EQ. '') q_Ptm = iNULL__
        if(ar__(30:34) .EQ. '') Ptm = rNULL__
        if(ar__(36:36) .EQ. '') q_Ptg = iNULL__
        if(ar__(37:41) .EQ. '') Ptg = rNULL__
        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(DEd .GE. 0) DEdeg=DEd
        if(DEm .GE. 0) DEdeg=DEdeg+DEm/60.
        if(DE_.EQ.'-'.AND.DEdeg.GE.0) DEdeg=-DEdeg
c    ..............Just test output...........
        write(6,1)
     +  HD,DM,RAh,RAdm,DE_,DEd,DEm,q_Ptm,Ptm,n_Ptm,q_Ptg,Ptg,n_Ptg,
     +  SpT,Int,Rem
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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