FORTRAN Generation
(/./ftp/cats/III/246)

Conversion of standardized ReadMe file for file /./ftp/cats/III/246 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 2024-Apr-20
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/246        First Byurakan Survey Late Type Stars catalog (Abrahamyan, 2007)
*================================================================================
*First Byurakan Survey (FBS) Late Type Stars catalog.
*    Abrahamyan H.V.
*   <Byurakan Observatory, Armenia (2007)>
*   =2007yCat.3246....0A
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! First Byurakan Survey (FBS) Late Type Stars catalog

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

C  Position composed of: RAdeg DEdeg (Epoch=J2000)
      integer*4     Seq         ! [1/995] Sequential number
      character*9   FBS         ! FBS name (based on B1950 position)
      character*6   FBS_L       ! Number of the object in the original paper
      real*8        RAdeg       ! (deg) Right ascension (degrees), ICRS, Ep=J2000 (1)
      real*8        DEdeg       ! (deg) Declination (degrees), ICRS, Ep=J2000 (1)
      real*8        GLON        ! (deg) Galactic longitude
      real*8        GLAT        ! (deg) Galactic latitude
      character*6   SpCl        ! FBS low-dispersion spectral classification
      integer*4     r_SpCl      ! [1/3]? Spectral classification origin (2)
      character*5   LuCl        ! Luminosity class (dwarf or giant)
      real*4        pmRA        ! (mas/yr) ?=- Proper motion in RA(*cos(Dec))
      real*4        e_pmRA      ! (mas/yr) ?=- Mean error on pmRA
      real*8        pmDE        ! (mas/yr) ?=- Proper motion in Dec
      real*4        e_pmDE      ! (mas/yr) ?=- Mean error on pmDE
      real*4        B1mag       ! (mag) ?=- First blue magnitude (USNO-B1)
      real*4        R1mag       ! (mag) ?=- First red magnitude (USNO-B1)
      real*4        B2mag       ! (mag) ?=- Second blue magnitude (USNO-B1)
      real*4        R2mag       ! (mag) ?=- Second red magnitude (USNO-B1)
      real*4        Imag        ! (mag) ?=- Infrared (N) magnitude (USNO-B1)
      real*4        Bnom        ! (mag) ?=- NOMAD blue magnitude
      real*4        Vnom        ! (mag) ?=- NOMAD visual magnitude
      real*4        Rnom        ! (mag) ?=- NOMAD red magnitude
      real*4        Rgsc        ! (mag) ?=- GSC2.2 magnitude in F (red)
*                                        photographic band
      real*4        Bgsc        ! (mag) ?=- GSC2.2 magnitude in J (blue)
*                                        photographic band
      real*4        Jmag        ! (mag) ?=- 2MASS J magnitude
      real*4        e_Jmag      ! (mag) ?=- 2MASS J magnitude error
      real*4        Hmag        ! (mag) ?=- 2MASS H magnitude
      real*4        e_Hmag      ! (mag) ?=- 2MASS H magnitude error
      real*4        Kmag        ! (mag) ?=- 2MASS K magnitude
      real*4        e_Kmag      ! (mag) ?=- 2MASS K magnitude error
      real*4        m_12_       ! (mag) ?=- IRAS 12um magnitude according to
*                                        m[12]=3.63-2.5*log10(f12)
      real*4        m_25_       ! (mag) ?=- IRAS 25um magnitude according to
*                                        m[25]=2.07-2.5*log10(f25)
      real*4        m_60_       ! (mag) ?=- IRAS 60um magnitude according to
*                                        m[60]=0.19-2.5*log10(f60)
      real*4        m_100_      ! (mag) ?=- IRAS 100um magnitude according to
*                                        m[100]=-0.92-2.5*log10(f100)
      character*16  v2MASS      ! 2MASS source designation (Cat. II/246)
      character*12  USNO_B1     ! USNO-B1-identifier (Cat. I/284)
      character*12  NOMAD       ! NOMAD-identifier (Cat. I/297)
      character*13  GSC2_2      ! GSC2.2-identifier (Cat. I/271)
      integer*4     UCAC2       ! ?=- UCAC2-identifier (Cat. I/289)
      character*9   GCVS4_2     ! Variable star name in GCVS4.2 (Cat. II/250)
      character*14  NSVS        ! NSVS-identifier (Cat. J/AJ/128/2965)
      character*13  ASAS        ! ASAS-identifier (Cat. II/264)
      character*11  IRAS        ! IRAS source name (Cat. II/125 and II/156)
*Note (1): Coordinates are given according to UCAC2 (I/289). If the star
*          is not present in UCAC2 coordinates are from NOMAD (I/297).
*Note (2): Spectral classification origin as follows:
*      1 = spectral class and subclass both from original papers.
*      2 = spectral class from original papers, subclass was determined by
*          us from DFBS
*          (http://byurakan.phys.uniroma1.it/)
*      3 = spectral class and subclass both was determined by us from DFBS
*          (http://byurakan.phys.uniroma1.it/)

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

C  Declarations for 'ids1-5.dat'	! Cross-identifications of lists 1-5 by B. Skiff

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

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

      character*4   FBS_L_1     ! Name in the FBS Late-type stars
      integer*4     RAh         ! (h) ?Right Ascension J2000 (hours)
      integer*4     RAm         ! (min) ?Right Ascension J2000 (minutes)
      real*4        RAs         ! (s) ?Right Ascension J2000 (seconds)
      character*1   DE_         ! ?Declination J2000 (sign)
      integer*4     DEd         ! (deg) ?Declination J2000 (degrees)
      integer*4     DEm         ! (arcmin) ?Declination J2000 (minutes)
      real*4        DEs         ! (arcsec) ?Declination J2000 (seconds)
      character*1   rPos        ! [UMLbTG] Source of position (1)
      integer*4     UCAC2_1     ! ?Identification in UCAC2 catalog (I/289)
      character*9   GSC         ! Identification in GSC-ACT catalog (Cat. I/255)
      character*11  IRAS_1      ! Identification in IRAS (II/125, II/156)
      real*4        Vmag        ! (mag) ?Approximative V magnitude
      character*4   SpCl_1      ! Approximative spectral type
      character*53  Notes       ! Notes and Remarks from B. Skiff
*Note (1): the symbols are the following:
*      b = USNO-B1.0    (2003AJ....125..984M, Cat. I/284)
*      G = GSC-ACT      (1999yCat.1255.....G, Cat. I/255)
*      L = Lepine LSPM  (2005AJ....129.1483L, Cat. I/298)
*      M = 2MASS        (2006AJ....131.1163S, Cat. II/246)
*      T = Tycho-2      (2000A&A...357..367H, Cat. I/259)
*      U = UCAC2        (2004AJ....127.3043Z, Cat. I/289)

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

C  Loading file 'catalog.dat'	! First Byurakan Survey (FBS) Late Type Stars catalog

C  Format for file interpretation

    1 format(
     +  I3,5X,A9,7X,A6,1X,F11.7,1X,F11.7,1X,F7.3,1X,F7.3,1X,A6,1X,I1,
     +  1X,A5,4X,F6.1,1X,F4.1,1X,F7.1,1X,F4.1,4X,F5.2,1X,F5.2,1X,F5.2,
     +  1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,
     +  F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F6.3,1X,A16,1X,A12,1X,A12,1X,A13,1X,I8,1X,A9,1X,
     +  A14,1X,A13,1X,A11)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,995
        read(1,'(A360)')ar__
        read(ar__,1)
     +  Seq,FBS,FBS_L,RAdeg,DEdeg,GLON,GLAT,SpCl,r_SpCl,LuCl,pmRA,
     +  e_pmRA,pmDE,e_pmDE,B1mag,R1mag,B2mag,R2mag,Imag,Bnom,Vnom,
     +  Rnom,Rgsc,Bgsc,Jmag,e_Jmag,Hmag,e_Hmag,Kmag,e_Kmag,m_12_,
     +  m_25_,m_60_,m_100_,v2MASS,USNO_B1,NOMAD,GSC2_2,UCAC2,GCVS4_2,
     +  NSVS,ASAS,IRAS
        if(ar__(79:79) .EQ. '') r_SpCl = iNULL__
        if (idig(ar__(90:95)).EQ.0) pmRA =  rNULL__
        if (idig(ar__(97:100)).EQ.0) e_pmRA =  rNULL__
        if (idig(ar__(102:108)).EQ.0) pmDE =  rNULL__
        if (idig(ar__(110:113)).EQ.0) e_pmDE =  rNULL__
        if (idig(ar__(118:122)).EQ.0) B1mag =  rNULL__
        if (idig(ar__(124:128)).EQ.0) R1mag =  rNULL__
        if (idig(ar__(130:134)).EQ.0) B2mag =  rNULL__
        if (idig(ar__(136:140)).EQ.0) R2mag =  rNULL__
        if (idig(ar__(142:146)).EQ.0) Imag =  rNULL__
        if (idig(ar__(148:152)).EQ.0) Bnom =  rNULL__
        if (idig(ar__(154:158)).EQ.0) Vnom =  rNULL__
        if (idig(ar__(160:164)).EQ.0) Rnom =  rNULL__
        if (idig(ar__(166:170)).EQ.0) Rgsc =  rNULL__
        if (idig(ar__(172:176)).EQ.0) Bgsc =  rNULL__
        if (idig(ar__(178:183)).EQ.0) Jmag =  rNULL__
        if (idig(ar__(185:189)).EQ.0) e_Jmag =  rNULL__
        if (idig(ar__(191:196)).EQ.0) Hmag =  rNULL__
        if (idig(ar__(198:202)).EQ.0) e_Hmag =  rNULL__
        if (idig(ar__(204:209)).EQ.0) Kmag =  rNULL__
        if (idig(ar__(211:215)).EQ.0) e_Kmag =  rNULL__
        if (idig(ar__(217:222)).EQ.0) m_12_ =  rNULL__
        if (idig(ar__(224:229)).EQ.0) m_25_ =  rNULL__
        if (idig(ar__(231:236)).EQ.0) m_60_ =  rNULL__
        if (idig(ar__(238:243)).EQ.0) m_100_ =  rNULL__
        if (UCAC2 .EQ. 45) UCAC2 =  iNULL__
c    ..............Just test output...........
        write(6,1)
     +  Seq,FBS,FBS_L,RAdeg,DEdeg,GLON,GLAT,SpCl,r_SpCl,LuCl,pmRA,
     +  e_pmRA,pmDE,e_pmDE,B1mag,R1mag,B2mag,R2mag,Imag,Bnom,Vnom,
     +  Rnom,Rgsc,Bgsc,Jmag,e_Jmag,Hmag,e_Hmag,Kmag,e_Kmag,m_12_,
     +  m_25_,m_60_,m_100_,v2MASS,USNO_B1,NOMAD,GSC2_2,UCAC2,GCVS4_2,
     +  NSVS,ASAS,IRAS
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'ids1-5.dat'	! Cross-identifications of lists 1-5 by B. Skiff

C  Format for file interpretation

    2 format(
     +  6X,A4,3X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,A1,1X,I8,
     +  1X,A9,1X,A11,1X,F4.1,2X,A4,2X,A53)

C  Effective file loading

      open(unit=1,status='old',file=
     +'ids1-5.dat')
      write(6,*) '....Loading file: ids1-5.dat'
      do i__=1,118
        read(1,'(A135)')ar__1
        read(ar__1,2)
     +  FBS_L_1,RAh,RAm,RAs,DE_,DEd,DEm,DEs,rPos,UCAC2_1,GSC,IRAS_1,
     +  Vmag,SpCl_1,Notes
        if(ar__1(14:15) .EQ. '') RAh = iNULL__
        if(ar__1(17:18) .EQ. '') RAm = iNULL__
        if(ar__1(20:24) .EQ. '') RAs = rNULL__
        if(ar__1(27:28) .EQ. '') DEd = iNULL__
        if(ar__1(30:31) .EQ. '') DEm = iNULL__
        if(ar__1(33:36) .EQ. '') DEs = rNULL__
        if(ar__1(40:47) .EQ. '') UCAC2_1 = iNULL__
        if(ar__1(71:74) .EQ. '') Vmag = rNULL__
        RAdeg_1 = rNULL__
        DEdeg_1 = 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 .GT. -180) RAdeg_1=RAh*15.
        if(RAm .GT. -180) RAdeg_1=RAdeg_1+RAm/4.
        if(RAs .GT. -180) RAdeg_1=RAdeg_1+RAs/240.
        if(DEd .GE. 0) DEdeg_1=DEd
        if(DEm .GE. 0) DEdeg_1=DEdeg_1+DEm/60.
        if(DEs .GE. 0) DEdeg_1=DEdeg_1+DEs/3600.
        if(DE_.EQ.'-'.AND.DEdeg_1.GE.0) DEdeg_1=-DEdeg_1
c    ..............Just test output...........
        write(6,2)
     +  FBS_L_1,RAh,RAm,RAs,DE_,DEd,DEm,DEs,rPos,UCAC2_1,GSC,IRAS_1,
     +  Vmag,SpCl_1,Notes
        write(6,'(6H Pos: 2F8.4)') RAdeg_1,DEdeg_1
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