CDS.headStuff2 FORTRAN Generation
()

Conversion of standardized ReadMe file for catalog 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-26
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/A+A/325/159       Companions to M dwarfs within 5pc (Leinert+ 1997)
*================================================================================
*A search for companions to nearby southern M dwarfs with near-infrared
*speckle interferometry
*       Leinert C., Henry T., Glindemann A., McCArthy D.W. Jr.
*      <Astron. Astrophys. 325, 159 (1997)>
*      =1997A&A...325..159L      (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1'	! Basic data for all M dwarfs within five parsecs

      integer*4 nr__
      parameter (nr__=40)	! Number of records
      character*72 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*1   Loc        (nr__) ! [SN] S: southern stars ({delta}<=-30deg)
*                                       N: northern stars ({delta}>-30deg)
      character*14  Name       (nr__) ! Object designation
      character*1   Note       (nr__) ! [abc] Note (1)
      integer*4     RAh        (nr__) ! (h) Right ascension (J2000)
      integer*4     RAm        (nr__) ! (min) Right ascension (J2000)
      real*4        RAs        (nr__) ! (s) Right ascension (J2000)
      character*1   DE_        (nr__) ! Declination sign
      integer*4     DEd        (nr__) ! (deg) Declination (J2000)
      integer*4     DEm        (nr__) ! (arcmin) Declination (J2000)
      integer*4     DEs        (nr__) ! (arcsec) Declination (J2000)
      real*4        Vmag       (nr__) ! (mag) V magnitude (apparent)
      real*4        Jmag       (nr__) ! (mag) J magnitude (apparent) (1.20{mu}m)
      real*4        Hmag       (nr__) ! (mag) H magnitude (apparent) (1.62{mu}m)
      real*4        Kmag       (nr__) ! (mag) K magnitude (apparent) (2.20{mu}m)
      real*4        plx        (nr__) ! (arcsec) trigonometric parallax
      real*4        KMag_1     (nr__) ! (mag) K magnitude (absolute)
*Note (1): a: V photometry from Jahreiss (1997, Catalogue of Nerby Stars, A&AS,
*              in press)
*             JHK from this paper all other photometry from
*             Leggett (1992ApJS...82..351L)
*             errors: <= 0.03 magnitudes in VJHK
*          b: not a primary
*          c: parallaxes are from the Third Catalogue of Nearby Stars,
*              Jahreiss (1997, A&AS, in press)

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

C  Declarations for 'table2'	! Companion magnitude limits for southern
                                  M dwarfs within five parsecs

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

      character*10  Name_1     (nr__1) ! Object designation
      character*6   Tech       (nr__1) ! Applied technique (1)
      character*8   Obsdate    (nr__1) ! ("DD/MM/YY") Date of observations
      character*9   Tel        (nr__1) ! Telscope used
      character*2   Band       (nr__1) ! Wavelength band
      real*4        Mag1AU     (nr__1) ! (mag) ? Magnitude limit for separation 1 AU (2)
      character*1   u_Mag1AU   (nr__1) ! Uncertainty flag on Mag1AU
      real*4        Mag2AU     (nr__1) ! (mag) Magnitude limit for separation 2 AU (2)
      character*1   u_Mag2AU   (nr__1) ! Uncertainty flag on Mag2AU
      real*4        Mag5AU     (nr__1) ! (mag) Magnitude limit for separation 5 AU (2)
      real*4        Mag10AU    (nr__1) ! (mag) Magnitude limit for separation 10 AU (2)
*Note (1): 1D NS : one-dimensional slit-scanning speckle observations in
*                   north-south direction
*          1D EW : same in east-west direction
*          2D SPK: speckle observations with a two-dimensional array detector
*Note (2): The companion brightness limits are given in absolute magnitudes.

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

C  Declarations for 'table3'	! *Updated summary of magnitude limits for
                                  northern M dwarfs within five parsecs

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

      character*14  Name_2     (nr__2) ! Object designation
      character*6   Tech_1     (nr__2) ! Applied technique
      character*1   Band_1     (nr__2) ! Wavelength band
      real*4        Mag1AU_1   (nr__2) ! (mag) ? Magnitude limit for separation 1 AU (1)
      real*4        Mag2AU_1   (nr__2) ! (mag) ? Magnitude limit for separation 2 AU (1)
      real*4        Mag5AU_1   (nr__2) ! (mag) ? Magnitude limit for separation 5 AU (1)
      real*4        Mag10AU_1  (nr__2) ! (mag) ? Magnitude limit for separation 10 AU (1)
      character*1   Note_1     (nr__2) ! [c] c: Companion detected (2)
*Note (1): Detection limits include data from Henry (1991, Ph.D. Thesis,
*           Arizona Univ., Tuscon)
*           and effects of new parallaxes. These limits supersede those given
*           in Henry & McCarthy (1990ApJ...350..334H).
*Note (2): See Henry & McCarthy (1990ApJ...350..334H) for details

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

C  Loading file 'table1'	! Basic data for all M dwarfs within five parsecs

C  Format for file interpretation

    1 format(
     +  A1,1X,A14,A1,1X,I2,1X,I2,1X,F4.1,1X,A1,I2,1X,I2,1X,I2,1X,F5.2,
     +  1X,F4.2,1X,F4.2,1X,F4.2,2X,F6.4,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1')
      write(6,*) '....Loading file: table1'
      do i__=1,40
        read(1,'(A72)')ar__
        read(ar__,1)
     +  Loc(i__),Name(i__),Note(i__),RAh(i__),RAm(i__),RAs(i__),
     +  DE_(i__),DEd(i__),DEm(i__),DEs(i__),Vmag(i__),Jmag(i__),
     +  Hmag(i__),Kmag(i__),plx(i__),KMag_1(i__)
        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)
     +  Loc(i__),Name(i__),Note(i__),RAh(i__),RAm(i__),RAs(i__),
     +  DE_(i__),DEd(i__),DEm(i__),DEs(i__),Vmag(i__),Jmag(i__),
     +  Hmag(i__),Kmag(i__),plx(i__),KMag_1(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'	! Companion magnitude limits for southern
*                                  M dwarfs within five parsecs

C  Format for file interpretation

    2 format(
     +  A10,1X,A6,1X,A8,1X,A9,1X,A2,1X,F4.1,A1,1X,F4.1,A1,1X,F4.1,1X,
     +  F4.1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2')
      write(6,*) '....Loading file: table2'
      do i__=1,39
        read(1,'(A61)')ar__1
        read(ar__1,2)
     +  Name_1(i__),Tech(i__),Obsdate(i__),Tel(i__),Band(i__),
     +  Mag1AU(i__),u_Mag1AU(i__),Mag2AU(i__),u_Mag2AU(i__),
     +  Mag5AU(i__),Mag10AU(i__)
        if(ar__1(41:44) .EQ. '') Mag1AU(i__) = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Name_1(i__),Tech(i__),Obsdate(i__),Tel(i__),Band(i__),
     +  Mag1AU(i__),u_Mag1AU(i__),Mag2AU(i__),u_Mag2AU(i__),
     +  Mag5AU(i__),Mag10AU(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3'	! *Updated summary of magnitude limits for
*                                  northern M dwarfs within five parsecs

C  Format for file interpretation

    3 format(A14,1X,A6,1X,A1,1X,F4.1,1X,F4.1,1X,F4.1,1X,F4.1,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3')
      write(6,*) '....Loading file: table3'
      do i__=1,30
        read(1,'(A44)')ar__2
        read(ar__2,3)
     +  Name_2(i__),Tech_1(i__),Band_1(i__),Mag1AU_1(i__),
     +  Mag2AU_1(i__),Mag5AU_1(i__),Mag10AU_1(i__),Note_1(i__)
        if(ar__2(25:28) .EQ. '') Mag1AU_1(i__) = rNULL__
        if(ar__2(30:33) .EQ. '') Mag2AU_1(i__) = rNULL__
        if(ar__2(35:38) .EQ. '') Mag5AU_1(i__) = rNULL__
        if(ar__2(40:43) .EQ. '') Mag10AU_1(i__) = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  Name_2(i__),Tech_1(i__),Band_1(i__),Mag1AU_1(i__),
     +  Mag2AU_1(i__),Mag5AU_1(i__),Mag10AU_1(i__),Note_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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