FORTRAN Generation
(/./ftp/cats/J/AJ/136/2070)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/136/2070 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-16
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/136/2070   SEGUE stellar parameter pipeline. III.   (Allende Prieto+, 2008)
*================================================================================
*The SEGUE stellar parameter pipeline.
*III. Comparison with high-resolution spectroscopy of SDSS/SEGUE field stars.
*    Allende Prieto C., Sivarani T., Beers T.C., Lee Y.S., Koesterke L.,
*    Shetrone M., Sneden C., Lambert D.L., Wilhelm R., Rockosi C.M., Lai D.K.,
*    Yanny B., Ivans I.I., Johnson J.A., Aoki W., Bailer-Jones C.A.L.,
*    Fiorentin P.R.
*   <Astron. J., 136, 2070-2082 (2008)>
*   =2008AJ....136.2070A
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table3.dat'	! Comparison of SSPP velocities and atmospheric
                            parameters (HET [Hobby-Eberly Telescope] sample)

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

      character*19  SDSS        ! SDSS designation (JHHMMSS.ss+DDMMSS.s)
      integer*4     MJD         ! MJD part of spectrum designation
      integer*4     Plate       ! Plate number of spectrum designation
      integer*4     Fib         ! Fiber number of spectrum designation
      real*8        RV          ! (km/s) SSPP radial velocity
      integer*4     Teff        ! (K) ?=- SSPP effective temperature
      integer*4     e_Teff      ! (K) ?=- 1-{sigma} error on Teff
      real*4        logg        ! ([cm/s2]) ?=- SSPP surface gravity
      real*4        e_logg      ! ([cm/s2]) ?=- rms uncertainty on logg
      real*4        v_Fe_H_     ! ([Sun]) ?=- SSPP metallicity
      real*4        e__Fe_H_    ! ([Sun]) ?=- rms uncertainty on [Fe/H]
      character*1   S           ! [HKES] OTHERS sample code (1)
      real*8        RV2         ! (km/s) OTHERS radial velocity
      integer*4     Teff2       ! (K) OTHERS effective temperature
      integer*4     e_Teff2     ! (K) 1-{sigma} error on Teff2
      real*4        logg2       ! ([cm/s2]) OTHERS surface gravity
      real*4        e_logg2     ! ([cm/s2]) rms uncertainty on logg2
      real*4        v_Fe_H_2    ! ([Sun]) OTHERS metallicity
      real*4        e__Fe_H_2   ! ([Sun]) rms uncertainty on [Fe/H]2
*Note (1): "SSPP" stands for "SEGUE Stellar Parameter Pipeline".
*  The sample codes are:
*  H = HET (Hobby-Eberly Telescope)
*  K = Keck-HIRES
*  S = Subaru
*  E = Keck-ESI

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

C  Declarations for 'table4.dat'	! Comparison of SSPP velocities and atmospheric
                            parameters (Keck-HIRES, Subaru and Keck-ESI samples)

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

      character*19  SDSS_1      ! SDSS designation (JHHMMSS.ss+DDMMSS.s)
      integer*4     MJD_1       ! MJD part of spectrum designation
      integer*4     Plate_1     ! Plate number of spectrum designation
      integer*4     Fib_1       ! Fiber number of spectrum designation
      real*8        RV_1        ! (km/s) SSPP radial velocity
      integer*4     Teff_1      ! (K) ?=- SSPP effective temperature
      integer*4     e_Teff_1    ! (K) ?=- 1-{sigma} error on Teff
      real*4        logg_1      ! ([cm/s2]) ?=- SSPP surface gravity
      real*4        e_logg_1    ! ([cm/s2]) ?=- rms uncertainty on logg
      real*4        v_Fe_H__1   ! ([Sun]) ?=- SSPP metallicity
      real*4        e__Fe_H__1  ! ([Sun]) ?=- rms uncertainty on [Fe/H]
      character*1   S_1         ! [HKES] OTHERS sample code (1)
      real*8        RV2_1       ! (km/s) OTHERS radial velocity
      integer*4     Teff2_1     ! (K) OTHERS effective temperature
      integer*4     e_Teff2_1   ! (K) 1-{sigma} error on Teff2
      real*4        logg2_1     ! ([cm/s2]) OTHERS surface gravity
      real*4        e_logg2_1   ! ([cm/s2]) rms uncertainty on logg2
      real*4        v_Fe_H_2_1  ! ([Sun]) OTHERS metallicity
      real*4        e__Fe_H_2_1 ! ([Sun]) rms uncertainty on [Fe/H]2
*Note (1): "SSPP" stands for "SEGUE Stellar Parameter Pipeline".
*  The sample codes are:
*  H = HET (Hobby-Eberly Telescope)
*  K = Keck-HIRES
*  S = Subaru
*  E = Keck-ESI

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

C  Loading file 'table3.dat'	! Comparison of SSPP velocities and atmospheric
*                            parameters (HET [Hobby-Eberly Telescope] sample)

C  Format for file interpretation

    1 format(
     +  5X,A19,1X,I5,1X,I4,1X,I3,1X,F7.2,1X,I4,1X,I3,1X,F4.2,1X,F4.2,
     +  1X,F5.2,1X,F4.2,1X,A1,1X,F7.2,1X,I4,1X,I3,1X,F4.2,1X,F4.2,1X,
     +  F5.2,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,81
        read(1,'(A117)')ar__
        read(ar__,1)
     +  SDSS,MJD,Plate,Fib,RV,Teff,e_Teff,logg,e_logg,v_Fe_H_,
     +  e__Fe_H_,S,RV2,Teff2,e_Teff2,logg2,e_logg2,v_Fe_H_2,e__Fe_H_2
        if (Teff .EQ. 45) Teff =  iNULL__
        if (e_Teff .EQ. 45) e_Teff =  iNULL__
        if (idig(ar__(58:61)).EQ.0) logg =  rNULL__
        if (idig(ar__(63:66)).EQ.0) e_logg =  rNULL__
        if (idig(ar__(68:72)).EQ.0) v_Fe_H_ =  rNULL__
        if (idig(ar__(74:77)).EQ.0) e__Fe_H_ =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  SDSS,MJD,Plate,Fib,RV,Teff,e_Teff,logg,e_logg,v_Fe_H_,
     +  e__Fe_H_,S,RV2,Teff2,e_Teff2,logg2,e_logg2,v_Fe_H_2,e__Fe_H_2
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table4.dat'	! Comparison of SSPP velocities and atmospheric
*                            parameters (Keck-HIRES, Subaru and Keck-ESI samples)

C  Format for file interpretation

    2 format(
     +  5X,A19,1X,I5,1X,I4,1X,I3,1X,F7.2,1X,I4,1X,I3,1X,F4.2,1X,F4.2,
     +  1X,F5.2,1X,F4.2,1X,A1,1X,F7.2,1X,I4,1X,I3,1X,F4.2,1X,F4.2,1X,
     +  F5.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,45
        read(1,'(A117)')ar__1
        read(ar__1,2)
     +  SDSS_1,MJD_1,Plate_1,Fib_1,RV_1,Teff_1,e_Teff_1,logg_1,
     +  e_logg_1,v_Fe_H__1,e__Fe_H__1,S_1,RV2_1,Teff2_1,e_Teff2_1,
     +  logg2_1,e_logg2_1,v_Fe_H_2_1,e__Fe_H_2_1
        if (Teff_1 .EQ. 45) Teff_1 =  iNULL__
        if (e_Teff_1 .EQ. 45) e_Teff_1 =  iNULL__
        if (idig(ar__1(58:61)).EQ.0) logg_1 =  rNULL__
        if (idig(ar__1(63:66)).EQ.0) e_logg_1 =  rNULL__
        if (idig(ar__1(68:72)).EQ.0) v_Fe_H__1 =  rNULL__
        if (idig(ar__1(74:77)).EQ.0) e__Fe_H__1 =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  SDSS_1,MJD_1,Plate_1,Fib_1,RV_1,Teff_1,e_Teff_1,logg_1,
     +  e_logg_1,v_Fe_H__1,e__Fe_H__1,S_1,RV2_1,Teff2_1,e_Teff2_1,
     +  logg2_1,e_logg2_1,v_Fe_H_2_1,e__Fe_H_2_1
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