FORTRAN Generation
(/./ftp/cats/J/AJ/152/40)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/152/40 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 2026-Jun-10
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/152/40   Spectroscopy of 341 bright A- and B-type stars  (Gullikson+, 2016)
*================================================================================
*The close companion mass-ratio distribution of intermediate-mass stars.
*    Gullikson K., Kraus A., Dodson-Robinson S.
*   <Astron. J., 152, 40 (2016)>
*   =2016AJ....152...40G    (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Sample properties

      integer*4 nr__
      parameter (nr__=340)	! Number of records
      character*107 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*11  Name       (nr__) ! Star name
      character*6   SpT        (nr__) ! Spectral type (1)
      integer*4     RAh        (nr__) ! (h) Hour of Right Ascension (J2000) (1)
      integer*4     RAm        (nr__) ! (min) Minute of Right Ascension (J2000)
      real*8        RAs        (nr__) ! (s) Second of Right Ascension (J2000)
      character*1   DE_        (nr__) ! Sign of the Declination (J2000) (1)
      integer*4     DEd        (nr__) ! (deg) Degree of Declination (J2000)
      integer*4     DEm        (nr__) ! (arcmin) Arcminute of Declination (J2000)
      real*4        DEs        (nr__) ! (arcsec) Arcsecond of Declination (J2000)
      real*4        Vmag       (nr__) ! (mag) [2/6]? The V-band magnitude (1)
      real*4        plx        (nr__) ! (mas) [0.72/68.92]? Parallax (1)
      integer*4     Teff       (nr__) ! (K) [7594/26000]? Stellar effective temperature (2)
      integer*4     e_Teff     (nr__) ! (K) [258/2000]? Uncertainty in Teff
      real*4        logg       (nr__) ! ([cm/s2]) [2.7/4.5]? Log surface gravity (2)
      real*4        e_logg     (nr__) ! ([cm/s2]) [0.14/0.25]? Uncertainty in logg
      real*4        Mass       (nr__) ! (Msun) [1.6/9.6]? Mass (2)
      real*4        E_Mass     (nr__) ! (Msun) [0.06/0.77]? Upper uncertainty in Mass
      real*4        e_Mass_1   (nr__) ! (Msun) [0.06/0.72]? Lower uncertainty in Mass
      integer*4     Age        (nr__) ! (Myr) [5/1064]? Age (2)
      integer*4     E_Age      (nr__) ! (Myr) [3/807]? Upper uncertainty in Age
      integer*4     e_Age_1    (nr__) ! (Myr) [1/412]? Low uncertainty in Age
      integer*4     r_Age      (nr__) ! [1/2]? Reference for Teff, logg, Mass, and
*                                 Age (1, or 2=this study) (3)
*Note (1): From the SIMBAD database. The spectral type given is that of the
*     brightest star if part of a known multiple system.
*Note (2): Discussed in Section 4.
*Note (3): The reference codes are:
*     1 = David & Hillenbrand 2015 (Cat. J/ApJ/804/146);
*     2 = This study.

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

C  Declarations for 'table2.dat'	! Spectroscopic observation log

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

      character*11  Name_1     (nr__1) ! Star name
      real*8        JD         (nr__1) ! (d) [6298.78/7288.82] Julian Date (JD-2450000)
      character*6   Inst       (nr__1) ! Spectroscopic instrument used (1)
      integer*4     Exp        (nr__1) ! (s) [22/7386] Exposure time
      integer*4     S_N        (nr__1) ! [20/2520] Spectroscopic signal to noise per
*                                   pixel (2)
*Note (1): The instruments used are:
*     CHIRON = CHIRON spectrograph on the 1.5m telescope at Cerro Tololo
*              Inter-American Observatory (CTIO);
*     HRS    = High Resolution Spectrograph on the Hobby Eberly Telescope (HET);
*     IGRINS = Immersion Grating Infrared Spectrograph (IGRINS) on the 2.7m
*              Harlan J. Smith Telescope;
*     TS23   = Tull coude spectrograph on the 2.7m Harlan J. Smith Telescope.
*Note (2): We calculate the S/N for the optical instruments (CHIRON, TS23, and
*     HRS) as the median of the extracted flux divided by its uncertainty for
*     each pixel from the echelle order nearest 675nm. For the IGRINS instrument,
*     we calculate the S/N from the order nearest 2200nm.

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

C  Declarations for 'table3.dat'	! *NIRI observation log

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

      character*10  Name_2     (nr__2) ! Star name
      real*4        Kmag       (nr__2) ! (mag) [4.4/6.5] The K band magnitude
      character*1   f_Kmag     (nr__2) ! Source of K magnitude (S=SIMBAD, or T=estimated
*                                  from the spectral type of the star and its
*                                  V-band magnitude)
      character*10  Date       (nr__2) ! ("Y:M:D") Gemini/NIRI observation date (1)
      character*6   Exp_1      (nr__2) ! Exposure sequence
      real*4        Sep        (nr__2) ! (arcsec) [0.16/3.68]? Separation {rho}
      real*4        e_Sep      (nr__2) ! (arcsec) [0.0007/0.003]? Uncertainty in Sep
      real*4        PA         (nr__2) ! (deg) [14.1/346.8]? Position angle {theta}
      real*4        e_PA       (nr__2) ! (deg) [0.02/0.92]? Uncertainty in PA
      real*4        dKcmag     (nr__2) ! (mag) [1.77/3.9]? The {Delta} K-continuum band
*                                  magnitude (2)
      real*4        e_dKcmag   (nr__2) ! (mag) [0.01/0.4]? Uncertainty in dKcmag
      real*4        Mass2      (nr__2) ! (Msun) [0.7/1.5]? Mass of secondary
      real*4        E_Mass2    (nr__2) ! (Msun) [0.14/0.39]? Upper uncertainty in Mass2
      real*4        e_Mass2_1  (nr__2) ! (Msun) [0.1/0.28]? Lower uncertainty in Mass2
      real*4        a          (nr__2) ! (AU) [25.1/467.7]? Separation, in astronomical units
      real*4        e_a        (nr__2) ! (AU) [0.16/0.81]? Uncertainty in a
*Note (1): We used the NIRI instrument behind the Altair adaptive optics system
*     on the Gemini North Telescope.
*Note (2): We used the K-continuum band centered on 2.2718{mu}m.

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

C  Declarations for 'table4.dat'	! Companion detections

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

      character*10  Name_3     (nr__3) ! Star Name
      character*5   Comp       (nr__3) ! Component (AB, AB?, AC, Aa,Ab, or Ba,Bb)
      character*1   f_Comp     (nr__3) ! [d] Newly discovered companion (d=true)
      integer*4     Nobs       (nr__3) ! [1/3] Number of observations (1, 2, or 3)
      character*3   Used       (nr__3) ! Used in analysis (yes or no)
      integer*4     Teff_1     (nr__3) ! (K) [3647/16000] Companion surface effective
*                                 temperature
      integer*4     e_Teff_1   (nr__3) ! (K) [85/1000] Uncertainty in Teff
      integer*4     vsini      (nr__3) ! (km/s) [1/120] Companion projected rotational velocity
      real*4        v_Fe_H_    (nr__3) ! ([-]) [-0.5/0.5] Companion metallicity
      real*4        MassI      (nr__3) ! (Msun) [0.5/4.3] Companion mass from isochrones
      real*4        E_MassI    (nr__3) ! (Msun) [0.02/0.47] Upper uncertainty in  MassI
      real*4        e_MassI_1  (nr__3) ! (Msun) [0.02/0.43] Lower uncertainty in  MassI
      real*4        MassS      (nr__3) ! (Msun) [0.5/4.7] Companion mass from Spectral type
      real*4        E_MassS    (nr__3) ! (Msun) [0.01/0.76] Upper uncertainty in MassS
      real*4        e_MassS_1  (nr__3) ! (Msun) [0.01/0.67] Lower uncertainty in MassS

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

C  Loading file 'table1.dat'	! Sample properties

C  Format for file interpretation

    1 format(
     +  A11,1X,A6,1X,I2,1X,I2,1X,F7.4,1X,A1,I2,1X,I2,1X,F6.3,1X,F5.3,
     +  1X,F5.2,1X,I5,1X,I4,1X,F3.1,1X,F4.2,1X,F3.1,1X,F4.2,1X,F4.2,
     +  1X,I4,1X,I3,1X,I3,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,340
        read(1,'(A107)')ar__
        read(ar__,1)
     +  Name(i__),SpT(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),
     +  DEd(i__),DEm(i__),DEs(i__),Vmag(i__),plx(i__),Teff(i__),
     +  e_Teff(i__),logg(i__),e_logg(i__),Mass(i__),E_Mass(i__),
     +  e_Mass_1(i__),Age(i__),E_Age(i__),e_Age_1(i__),r_Age(i__)
        if(ar__(48:52) .EQ. '') Vmag(i__) = rNULL__
        if(ar__(54:58) .EQ. '') plx(i__) = rNULL__
        if(ar__(60:64) .EQ. '') Teff(i__) = iNULL__
        if(ar__(66:69) .EQ. '') e_Teff(i__) = iNULL__
        if(ar__(71:73) .EQ. '') logg(i__) = rNULL__
        if(ar__(75:78) .EQ. '') e_logg(i__) = rNULL__
        if(ar__(80:82) .EQ. '') Mass(i__) = rNULL__
        if(ar__(84:87) .EQ. '') E_Mass(i__) = rNULL__
        if(ar__(89:92) .EQ. '') e_Mass_1(i__) = rNULL__
        if(ar__(94:97) .EQ. '') Age(i__) = iNULL__
        if(ar__(99:101) .EQ. '') E_Age(i__) = iNULL__
        if(ar__(103:105) .EQ. '') e_Age_1(i__) = iNULL__
        if(ar__(107:107) .EQ. '') r_Age(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)
     +  Name(i__),SpT(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),
     +  DEd(i__),DEm(i__),DEs(i__),Vmag(i__),plx(i__),Teff(i__),
     +  e_Teff(i__),logg(i__),e_logg(i__),Mass(i__),E_Mass(i__),
     +  e_Mass_1(i__),Age(i__),E_Age(i__),e_Age_1(i__),r_Age(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 'table2.dat'	! Spectroscopic observation log

C  Format for file interpretation

    2 format(A11,1X,F7.2,1X,A6,1X,I4,1X,I4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,499
        read(1,'(A36)')ar__1
        read(ar__1,2)Name_1(i__),JD(i__),Inst(i__),Exp(i__),S_N(i__)
c    ..............Just test output...........
        write(6,2)Name_1(i__),JD(i__),Inst(i__),Exp(i__),S_N(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! *NIRI observation log

C  Format for file interpretation

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

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,17
        read(1,'(A96)')ar__2
        read(ar__2,3)
     +  Name_2(i__),Kmag(i__),f_Kmag(i__),Date(i__),Exp_1(i__),
     +  Sep(i__),e_Sep(i__),PA(i__),e_PA(i__),dKcmag(i__),
     +  e_dKcmag(i__),Mass2(i__),E_Mass2(i__),e_Mass2_1(i__),a(i__),
     +  e_a(i__)
        if(ar__2(37:42) .EQ. '') Sep(i__) = rNULL__
        if(ar__2(44:49) .EQ. '') e_Sep(i__) = rNULL__
        if(ar__2(51:56) .EQ. '') PA(i__) = rNULL__
        if(ar__2(58:61) .EQ. '') e_PA(i__) = rNULL__
        if(ar__2(63:66) .EQ. '') dKcmag(i__) = rNULL__
        if(ar__2(68:71) .EQ. '') e_dKcmag(i__) = rNULL__
        if(ar__2(73:75) .EQ. '') Mass2(i__) = rNULL__
        if(ar__2(77:80) .EQ. '') E_Mass2(i__) = rNULL__
        if(ar__2(82:85) .EQ. '') e_Mass2_1(i__) = rNULL__
        if(ar__2(87:91) .EQ. '') a(i__) = rNULL__
        if(ar__2(93:96) .EQ. '') e_a(i__) = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  Name_2(i__),Kmag(i__),f_Kmag(i__),Date(i__),Exp_1(i__),
     +  Sep(i__),e_Sep(i__),PA(i__),e_PA(i__),dKcmag(i__),
     +  e_dKcmag(i__),Mass2(i__),E_Mass2(i__),e_Mass2_1(i__),a(i__),
     +  e_a(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table4.dat'	! Companion detections

C  Format for file interpretation

    4 format(
     +  A10,1X,A5,1X,A1,1X,I1,1X,A3,1X,I5,1X,I4,1X,I3,1X,F4.1,1X,F3.1,
     +  1X,F4.2,1X,F4.2,1X,F3.1,1X,F4.2,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table4.dat')
      write(6,*) '....Loading file: table4.dat'
      do i__=1,64
        read(1,'(A72)')ar__3
        read(ar__3,4)
     +  Name_3(i__),Comp(i__),f_Comp(i__),Nobs(i__),Used(i__),
     +  Teff_1(i__),e_Teff_1(i__),vsini(i__),v_Fe_H_(i__),MassI(i__),
     +  E_MassI(i__),e_MassI_1(i__),MassS(i__),E_MassS(i__),
     +  e_MassS_1(i__)
c    ..............Just test output...........
        write(6,4)
     +  Name_3(i__),Comp(i__),f_Comp(i__),Nobs(i__),Used(i__),
     +  Teff_1(i__),e_Teff_1(i__),vsini(i__),v_Fe_H_(i__),MassI(i__),
     +  E_MassI(i__),e_MassI_1(i__),MassS(i__),E_MassS(i__),
     +  e_MassS_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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