FORTRAN Generation
(/./ftp/cats/J/MNRAS/389/585)

Conversion of standardized ReadMe file for file /./ftp/cats/J/MNRAS/389/585 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-19
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/MNRAS/389/585     Fundamental parameters of M dwarfs     (Casagrande+, 2008)
*================================================================================
*M dwarfs: effective temperatures, radii and metallicities.
*    Casagrande L., Flynn C., Bessell M.
*   <Mon. Not. R. Astron. Soc., 389, 585-607 (2008)>
*   =2008MNRAS.389..585C
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Observable and physical quantities for our
                              sample stars

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

      character*14  Name        ! Star name
      integer*4     Teff        ! (K) Effective temperature
      integer*4     e_Teff      ! (K) rms uncertainty on Teff
      real*4        theta       ! (mas) Angular diameter
      real*4        e_theta     ! (mas) rms uncertainty on theta
      real*4        mBol        ! (mag) Apparent bolometric magnitude (1)
      real*4        Vmag        ! (mag) Johnson V magnitude
      real*4        B_V         ! (mag) ?=- Johnson B-V colour index
      real*4        U_B         ! (mag) ?=- Johnson U-B colour index
      real*4        V_Rc        ! (mag) Johnson-Cousins V-Rc colour index
      real*4        V_Ic        ! (mag) Johnson-Cousins V-Ic colour index
      real*4        Jmag        ! (mag) 2MASS Johnson J magnitude
      real*4        Hmag        ! (mag) 2MASS Johnson H magnitude
      real*4        Ksmag       ! (mag) 2MASS Johnson Ks magnitude
      real*4        v_M_H_      ! ([-]) ?=- Metallicity (2)
*Note (1): Apparent bolometric magnitudes (mBol) are obtained according to
*     Section 6, where the absolute bolometric magnitude of the Sun
*     M_Bol,sun_=4.74.
*Note (2): For the stars with HIP number, the metallicities are from the
*     Bonfils et al. (2005A&A...442..635B) calibration, while the remainder
*     are obtained with the MOITE.

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

C  Loading file 'table1.dat'	! Observable and physical quantities for our
*                              sample stars

C  Format for file interpretation

    1 format(
     +  A14,1X,I4,1X,I3,1X,F5.3,1X,F5.3,1X,F6.3,1X,F6.3,1X,F5.3,1X,
     +  F5.3,1X,F5.3,1X,F5.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F5.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,343
        read(1,'(A100)')ar__
        read(ar__,1)
     +  Name,Teff,e_Teff,theta,e_theta,mBol,Vmag,B_V,U_B,V_Rc,V_Ic,
     +  Jmag,Hmag,Ksmag,v_M_H_
        if (idig(ar__(51:55)).EQ.0) B_V =  rNULL__
        if (idig(ar__(57:61)).EQ.0) U_B =  rNULL__
        if (idig(ar__(96:100)).EQ.0) v_M_H_ =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Name,Teff,e_Teff,theta,e_theta,mBol,Vmag,B_V,U_B,V_Rc,V_Ic,
     +  Jmag,Hmag,Ksmag,v_M_H_
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