FORTRAN Generation
(/./ftp/cats/J/AJ/134/2353)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/134/2353 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-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/AJ/134/2353       Observations of contact binaries     (Rucinski+, 2007)
*================================================================================
*Contact binaries with additional components.
*III. A search using adaptive optics.
*    Rucinski S.M., Pribulla T., Van Kerkwijk M.H.
*   <Astron. J., 134, 2353-2365 (2007)>
*   =2007AJ....134.2353R
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Journal of the AO observations during the three
                             observing runs of January 10, 1998, July 23,
                             1998 and October 17-18, 2005

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

      integer*4     Num         ! Frame number
      character*9   Name        ! Object name
      real*8        Date        ! (d) Heliocentric Julian Date
      character*2   Filt        ! Filter used

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

C  Declarations for 'table2.dat'	! Overview of observed systems and detections of
                             visual companions

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

      character*9   Name_1      ! Star name
      character*1   Run1        ! [CDN-] Run 1 (1998/01/10) detection code (1)
      character*1   Run2        ! [CDN-] Run 2 (1998/07/23) detection code (1)
      character*1   Run3        ! [CDN-] Run 3 (2005/10/17-18) detection code (1)
*Note (1): Detection code is:
*      - = not observed in that run
*      N = no detection
*      D = detection at a separation of <5"
*      C = a very close pair, with possible detection through
*          a deformation of the diffraction pattern

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

C  Declarations for 'table5.dat'	! Companions of contact binaries detected or
                             confirmed during this program

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

      character*1   Flag        ! [NC] N for New, C for Confirmed Detections
      character*9   Name_2      ! Star name
      real*8        HJD         ! (d) Date the observation
      real*4        Phase       ! Orbital phase of the binary
      real*4        dVphi       ! ? Correction of binary brightness
      real*4        plx         ! (mas) Hipparcos parallax used to estimate absolute
*                                     magnitudes
      real*4        rho         ! (arcsec) ? Separation
      real*4        e_rho       ! (arcsec) ? rms uncertainty on rho
      real*4        theta       ! (deg) ? Position angle
      real*4        e_theta     ! (deg) ? rms uncertainty on theta
      real*4        dKmag       ! ? Magnitude difference in K band
      real*4        e_dKmag     ! ? rms uncertainty on DKmag
      real*4        dHmag       ! ? Magnitude difference in H band
      real*4        e_dHmag     ! ? rms uncertainty on DHmag
      real*4        KMAG        ! (mag) ? Absolute K magnitude
      real*4        HMAG        ! (mag) ? Absolute H magnitude
      character*6   SpT         ! MK spectral type

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

C  Declarations for 'table6.dat'	! Properties of contact binaries with newly
                             detected companions

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

      character*9   Name_3      ! Star name
      real*4        Vmax        ! (mag) Maximum V magnitude
      real*4        dVmag       ! (mag) Difference in V band
      real*4        plx_1       ! (mas) Parallax
      real*4        e_plx       ! (mas) ?=- rms uncertainty on plx
      real*4        pm          ! (mas/yr) Total proper motion
      character*6   SpT_1       ! MK spectral type
      real*4        v_B_V_0     ! (mag) Deredenned B-V colour index
      real*4        VMAGc       ! (mag) Calculated absolute V magnitude
      real*4        VMAG        ! (mag) Spectroscopic absolute V magnitude
      real*4        HMAG_1      ! (mag) Spectroscopic absolute H magnitude
      real*4        KMAG_1      ! (mag) Spectroscopic absolute K magnitude
      real*4        HMAGc       ! (mag) Corrected absolute H magnitude
      real*4        KMAGc       ! (mag) Corrected absolute K magnitude
      real*4        M12         ! (solMass) ?=- Mass of the binary system
      character*6   SpTc        ! Comp. MK spectral type
      character*1   l_M3        ! Limit flag on M3
      real*4        M3          ! (solMass) estimated mass of the third companion
      real*4        M3u         ! (solMass) ? Upper value of M3 when interval
      real*4        a           ! (AU) ? Semi-major axis
      real*8        Pvis        ! (yr) ?=- Visual period

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

C  Loading file 'table1.dat'	! Journal of the AO observations during the three
*                             observing runs of January 10, 1998, July 23,
*                             1998 and October 17-18, 2005

C  Format for file interpretation

    1 format(I6,1X,A9,1X,F12.4,1X,A2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,642
        read(1,'(A32)')ar__
        read(ar__,1)Num,Name,Date,Filt
c    ..............Just test output...........
        write(6,1)Num,Name,Date,Filt
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Overview of observed systems and detections of
*                             visual companions

C  Format for file interpretation

    2 format(A9,1X,A1,A1,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,80
        read(1,'(A13)')ar__1
        read(ar__1,2)Name_1,Run1,Run2,Run3
c    ..............Just test output...........
        write(6,2)Name_1,Run1,Run2,Run3
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table5.dat'	! Companions of contact binaries detected or
*                             confirmed during this program

C  Format for file interpretation

    3 format(
     +  A1,1X,A9,1X,F12.4,1X,F5.3,1X,F4.2,1X,F5.1,1X,F5.3,1X,F4.3,1X,
     +  F6.2,1X,F5.2,1X,F6.3,1X,F5.3,1X,F5.3,1X,F5.3,1X,F4.2,1X,F4.2,
     +  1X,A6)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table5.dat')
      write(6,*) '....Loading file: table5.dat'
      do i__=1,40
        read(1,'(A107)')ar__2
        read(ar__2,3)
     +  Flag,Name_2,HJD,Phase,dVphi,plx,rho,e_rho,theta,e_theta,dKmag,
     +  e_dKmag,dHmag,e_dHmag,KMAG,HMAG,SpT
        if(ar__2(32:35) .EQ. '') dVphi = rNULL__
        if(ar__2(43:47) .EQ. '') rho = rNULL__
        if(ar__2(49:52) .EQ. '') e_rho = rNULL__
        if(ar__2(54:59) .EQ. '') theta = rNULL__
        if(ar__2(61:65) .EQ. '') e_theta = rNULL__
        if(ar__2(67:72) .EQ. '') dKmag = rNULL__
        if(ar__2(74:78) .EQ. '') e_dKmag = rNULL__
        if(ar__2(80:84) .EQ. '') dHmag = rNULL__
        if(ar__2(86:90) .EQ. '') e_dHmag = rNULL__
        if(ar__2(92:95) .EQ. '') KMAG = rNULL__
        if(ar__2(97:100) .EQ. '') HMAG = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  Flag,Name_2,HJD,Phase,dVphi,plx,rho,e_rho,theta,e_theta,dKmag,
     +  e_dKmag,dHmag,e_dHmag,KMAG,HMAG,SpT
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table6.dat'	! Properties of contact binaries with newly
*                             detected companions

C  Format for file interpretation

    4 format(
     +  A9,1X,F5.2,1X,F4.2,1X,F5.2,1X,F4.2,1X,F5.1,1X,A6,1X,F4.2,1X,
     +  F4.2,1X,F4.2,1X,F4.2,1X,F4.2,1X,F4.2,1X,F4.2,1X,F5.3,1X,A6,1X,
     +  A1,F4.2,1X,F3.1,1X,F5.1,1X,F7.1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table6.dat')
      write(6,*) '....Loading file: table6.dat'
      do i__=1,16
        read(1,'(A116)')ar__3
        read(ar__3,4)
     +  Name_3,Vmax,dVmag,plx_1,e_plx,pm,SpT_1,v_B_V_0,VMAGc,VMAG,
     +  HMAG_1,KMAG_1,HMAGc,KMAGc,M12,SpTc,l_M3,M3,M3u,a,Pvis
        if (idig(ar__3(28:31)).EQ.0) e_plx =  rNULL__
        if (idig(ar__3(81:85)).EQ.0) M12 =  rNULL__
        if(ar__3(100:102) .EQ. '') M3u = rNULL__
        if(ar__3(104:108) .EQ. '') a = rNULL__
        if (idig(ar__3(110:116)).EQ.0) Pvis =  rNULL__
c    ..............Just test output...........
        write(6,4)
     +  Name_3,Vmax,dVmag,plx_1,e_plx,pm,SpT_1,v_B_V_0,VMAGc,VMAG,
     +  HMAG_1,KMAG_1,HMAGc,KMAGc,M12,SpTc,l_M3,M3,M3u,a,Pvis
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