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 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-20
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       (nr__) ! SDSS designation (JHHMMSS.ss+DDMMSS.s)
      integer*4     MJD        (nr__) ! MJD part of spectrum designation
      integer*4     Plate      (nr__) ! Plate number of spectrum designation
      integer*4     Fib        (nr__) ! Fiber number of spectrum designation
      real*8        RV         (nr__) ! (km/s) SSPP radial velocity
      integer*4     Teff       (nr__) ! (K) ?=- SSPP effective temperature
      integer*4     e_Teff     (nr__) ! (K) ?=- 1-{sigma} error on Teff
      real*4        logg       (nr__) ! ([cm/s2]) ?=- SSPP surface gravity
      real*4        e_logg     (nr__) ! ([cm/s2]) ?=- rms uncertainty on logg
      real*4        v_Fe_H_    (nr__) ! ([Sun]) ?=- SSPP metallicity
      real*4        e__Fe_H_   (nr__) ! ([Sun]) ?=- rms uncertainty on [Fe/H]
      character*1   S          (nr__) ! [HKES] OTHERS sample code (1)
      real*8        RV2        (nr__) ! (km/s) OTHERS radial velocity
      integer*4     Teff2      (nr__) ! (K) OTHERS effective temperature
      integer*4     e_Teff2    (nr__) ! (K) 1-{sigma} error on Teff2
      real*4        logg2      (nr__) ! ([cm/s2]) OTHERS surface gravity
      real*4        e_logg2    (nr__) ! ([cm/s2]) rms uncertainty on logg2
      real*4        v_Fe_H_2   (nr__) ! ([Sun]) OTHERS metallicity
      real*4        e__Fe_H_2  (nr__) ! ([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     (nr__1) ! SDSS designation (JHHMMSS.ss+DDMMSS.s)
      integer*4     MJD_1      (nr__1) ! MJD part of spectrum designation
      integer*4     Plate_1    (nr__1) ! Plate number of spectrum designation
      integer*4     Fib_1      (nr__1) ! Fiber number of spectrum designation
      real*8        RV_1       (nr__1) ! (km/s) SSPP radial velocity
      integer*4     Teff_1     (nr__1) ! (K) ?=- SSPP effective temperature
      integer*4     e_Teff_1   (nr__1) ! (K) ?=- 1-{sigma} error on Teff
      real*4        logg_1     (nr__1) ! ([cm/s2]) ?=- SSPP surface gravity
      real*4        e_logg_1   (nr__1) ! ([cm/s2]) ?=- rms uncertainty on logg
      real*4        v_Fe_H__1  (nr__1) ! ([Sun]) ?=- SSPP metallicity
      real*4        e__Fe_H__1 (nr__1) ! ([Sun]) ?=- rms uncertainty on [Fe/H]
      character*1   S_1        (nr__1) ! [HKES] OTHERS sample code (1)
      real*8        RV2_1      (nr__1) ! (km/s) OTHERS radial velocity
      integer*4     Teff2_1    (nr__1) ! (K) OTHERS effective temperature
      integer*4     e_Teff2_1  (nr__1) ! (K) 1-{sigma} error on Teff2
      real*4        logg2_1    (nr__1) ! ([cm/s2]) OTHERS surface gravity
      real*4        e_logg2_1  (nr__1) ! ([cm/s2]) rms uncertainty on logg2
      real*4        v_Fe_H_2_1 (nr__1) ! ([Sun]) OTHERS metallicity
      real*4        e__Fe_H_2_1(nr__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(i__),MJD(i__),Plate(i__),Fib(i__),RV(i__),Teff(i__),
     +  e_Teff(i__),logg(i__),e_logg(i__),v_Fe_H_(i__),e__Fe_H_(i__),
     +  S(i__),RV2(i__),Teff2(i__),e_Teff2(i__),logg2(i__),
     +  e_logg2(i__),v_Fe_H_2(i__),e__Fe_H_2(i__)
        if (Teff(i__) .EQ. 45) Teff(i__) =  iNULL__
        if (e_Teff(i__) .EQ. 45) e_Teff(i__) =  iNULL__
        if (idig(ar__(58:61)).EQ.0) logg(i__) =  rNULL__
        if (idig(ar__(63:66)).EQ.0) e_logg(i__) =  rNULL__
        if (idig(ar__(68:72)).EQ.0) v_Fe_H_(i__) =  rNULL__
        if (idig(ar__(74:77)).EQ.0) e__Fe_H_(i__) =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  SDSS(i__),MJD(i__),Plate(i__),Fib(i__),RV(i__),Teff(i__),
     +  e_Teff(i__),logg(i__),e_logg(i__),v_Fe_H_(i__),e__Fe_H_(i__),
     +  S(i__),RV2(i__),Teff2(i__),e_Teff2(i__),logg2(i__),
     +  e_logg2(i__),v_Fe_H_2(i__),e__Fe_H_2(i__)
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(i__),MJD_1(i__),Plate_1(i__),Fib_1(i__),RV_1(i__),
     +  Teff_1(i__),e_Teff_1(i__),logg_1(i__),e_logg_1(i__),
     +  v_Fe_H__1(i__),e__Fe_H__1(i__),S_1(i__),RV2_1(i__),
     +  Teff2_1(i__),e_Teff2_1(i__),logg2_1(i__),e_logg2_1(i__),
     +  v_Fe_H_2_1(i__),e__Fe_H_2_1(i__)
        if (Teff_1(i__) .EQ. 45) Teff_1(i__) =  iNULL__
        if (e_Teff_1(i__) .EQ. 45) e_Teff_1(i__) =  iNULL__
        if (idig(ar__1(58:61)).EQ.0) logg_1(i__) =  rNULL__
        if (idig(ar__1(63:66)).EQ.0) e_logg_1(i__) =  rNULL__
        if (idig(ar__1(68:72)).EQ.0) v_Fe_H__1(i__) =  rNULL__
        if (idig(ar__1(74:77)).EQ.0) e__Fe_H__1(i__) =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  SDSS_1(i__),MJD_1(i__),Plate_1(i__),Fib_1(i__),RV_1(i__),
     +  Teff_1(i__),e_Teff_1(i__),logg_1(i__),e_logg_1(i__),
     +  v_Fe_H__1(i__),e__Fe_H__1(i__),S_1(i__),RV2_1(i__),
     +  Teff2_1(i__),e_Teff2_1(i__),logg2_1(i__),e_logg2_1(i__),
     +  v_Fe_H_2_1(i__),e__Fe_H_2_1(i__)
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