FORTRAN Generation
(/./ftp/cats/J/MNRAS/362/1167)

Conversion of standardized ReadMe file for file /./ftp/cats/J/MNRAS/362/1167 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 2016-Dec-08
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/362/1167   Radial velocities of 14 southern Cepheids  (Petterson+, 2005)
*================================================================================
*A spectroscopic study of bright southern Cepheids -
*a high-resolution view of Cepheid atmospheres.
*    Petterson O.K.L., Cottrell P.L., Albrow M.D., Fokin A.
*   <Mon. Not. R. Astron. Soc., 362, 1167-1182 (2005)>
*   =2005MNRAS.362.1167P
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Cepheid periods

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

      character*8   Name        ! Cepheid name
      real*8        Epoch       ! (JD) Epoch
      real*8        Per         ! (d) Period
      character*45  r_Per       ! Source for period

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

C  Declarations for 'tablea.dat'	! Velocities

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

      character*8   Name_1      ! Cepheid name
      real*8        JD          ! (d) Julian date
      real*4        Phase       ! [0/1] Phase
      real*4        RV          ! (km/s) ?=- Radial velocity
      real*4        MVel        ! (km/s) Metallic velocity
      real*4        HaVel       ! (km/s) ?=- H{alpha} velocity
      real*4        CaIIVel     ! (km/s) ?=- Ca II velocity
      real*4        CaIVel      ! (km/s) Ca I velocity
      real*4        BaIIVel     ! (km/s) Ba II velocity
      real*4        FeIVel      ! (km/s) Fe I velocity
      real*4        FeIIVel     ! (km/s) ?=- Fe II velocity
      real*4        SiIVel      ! (km/s) Si I velocity
      real*4        SiIIVel     ! (km/s) Si II velocity

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

C  Loading file 'table1.dat'	! Cepheid periods

C  Format for file interpretation

    1 format(A8,3X,F11.3,2X,F9.6,3X,A45)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,14
        read(1,'(A81)')ar__
        read(ar__,1)Name,Epoch,Per,r_Per
c    ..............Just test output...........
        write(6,1)Name,Epoch,Per,r_Per
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'tablea.dat'	! Velocities

C  Format for file interpretation

    2 format(
     +  A8,1X,F12.4,1X,F6.4,1X,F6.2,1X,F6.2,1X,F6.2,1X,F6.2,1X,F6.2,
     +  1X,F6.2,1X,F6.2,1X,F6.2,1X,F6.2,1X,F6.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tablea.dat')
      write(6,*) '....Loading file: tablea.dat'
      do i__=1,418
        read(1,'(A98)')ar__1
        read(ar__1,2)
     +  Name_1,JD,Phase,RV,MVel,HaVel,CaIIVel,CaIVel,BaIIVel,FeIVel,
     +  FeIIVel,SiIVel,SiIIVel
        if (idig(ar__1(30:35)).EQ.0) RV =  rNULL__
        if (idig(ar__1(44:49)).EQ.0) HaVel =  rNULL__
        if (idig(ar__1(51:56)).EQ.0) CaIIVel =  rNULL__
        if (idig(ar__1(79:84)).EQ.0) FeIIVel =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Name_1,JD,Phase,RV,MVel,HaVel,CaIIVel,CaIVel,BaIIVel,FeIVel,
     +  FeIIVel,SiIVel,SiIIVel
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