FORTRAN Generation
(/./ftp/cats/J/A_A/507/833)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/507/833 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-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/A+A/507/833       Interstellar CaII lines for 290 stars    (Megier+, 2009)
*================================================================================
*The interstellar CaII distance scale.
*    Megier A., Strobel A., Galazutdinov G.A., Krelowski J.
*   <Astron. Astrophys., 507, 833-840 (2009)>
*   =2009A&A...507..833M
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Target stars

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

C  Position composed of: GLON GLAT
      character*10  Name        ! Star name
      real*8        GLON        ! (deg) Galactic longitude (from SIMBAD)
      real*8        GLAT        ! (deg) Galactic latitude  (from SIMBAD)
      real*4        plx         ! (mas) ?=- Trigonometric parallax (Hipparcos)
      real*4        e_plx       ! (mas) ?=- rms uncertainty on plx
      integer*4     EWK         ! (0.1pm) Equivalent width of the CaII K line
      real*4        e_EWK       ! (0.1pm) rms uncertainty on EWK
      integer*4     EWH         ! (0.1pm) Equivalent width of the CaII H line
      real*4        e_EWH       ! (0.1pm) rms uncertainty on EWK
      real*4        NCaII       ! (10+12cm-2) CaII column density
      real*4        e_NCaII     ! (10+12cm-2) rms uncertainty on NCaII
      character*8   Assos       ! Association membership
      character*8   r_Assos     ! Reference  for association membership (1)
      integer*4     DH          ! (pc) ?=- Association distance from
*                                       Humphreys (1978ApJS...38..309H)
      integer*4     DGS         ! (pc) ?=- Association distance from
*                                       Garmany & Stencel (1992A&AS...94..211G)
      integer*4     DZ          ! (pc) ?=- Association distance from de
*                                       Zeeuw et al. (1999, Cat. J/AJ/117/354)
      integer*4     DCaII       ! (pc) Distance estimated from formula (3)
      integer*4     e_DCaII     ! (pc) ? rms uncertainty pn DCaII
*Note (1): Reference for association membership as follows:
*      H = Humphreys (1978ApJS...38..309H)
*     GS = Garmany and Stencel 1992A&AS...94..211G1992)
*      Z = de Zeeuw et al. (1999, Cat. <J/AJ/117/354>)
*Note (3): The formula for estimating distance is:
*     DCaII=~77+{2.78+(2.60/[EWK/EWH - 0.932])}*EWH

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

C  Loading file 'table1.dat'	! Target stars

C  Format for file interpretation

    1 format(
     +  A10,1X,F8.4,1X,F8.4,1X,F5.2,1X,F4.2,1X,I4,1X,F5.2,I3,1X,F5.2,
     +  1X,F5.2,1X,F4.2,1X,A8,1X,A8,2X,I4,1X,I4,1X,I3,1X,I4,1X,I4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,290
        read(1,'(A113)')ar__
        read(ar__,1)
     +  Name,GLON,GLAT,plx,e_plx,EWK,e_EWK,EWH,e_EWH,NCaII,e_NCaII,
     +  Assos,r_Assos,DH,DGS,DZ,DCaII,e_DCaII
        if (idig(ar__(30:34)).EQ.0) plx =  rNULL__
        if (idig(ar__(36:39)).EQ.0) e_plx =  rNULL__
        if (DH .EQ. 45) DH =  iNULL__
        if (DGS .EQ. 45) DGS =  iNULL__
        if (DZ .EQ. 45) DZ =  iNULL__
        if(ar__(110:113) .EQ. '') e_DCaII = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  Name,GLON,GLAT,plx,e_plx,EWK,e_EWK,EWH,e_EWH,NCaII,e_NCaII,
     +  Assos,r_Assos,DH,DGS,DZ,DCaII,e_DCaII
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