FORTRAN Generation
(/./ftp/cats/J/ApJ/670/346)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJ/670/346 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/ApJ/670/346   M giant stars in the Sagittarius dwarf galaxy. V.  (Chou+, 2007)
*================================================================================
*A 2MASS all-sky view of the Sagittarius dwarf galaxy.
*V. Variation of the metallicity distribution function along the Sagittarius
*stream.
*    Chou M.-Y., Majewski S.R., Cunha K., Smith V.V., Patterson R.J.,
*    Martinez-Delgado D., Law D.R., Crane J.D., Munoz R.R., Garcia Lopez R.,
*    Geisler D., Skrutskie M.F.
*   <Astrophys. J., 670, 346-362 (2007)>
*   =2007ApJ...670..346C
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! The program stars

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

C  J2000 position composed of: RAdeg DEdeg
      integer*4     Sam         ! [1/5] Sample (G1)
      character*15  Star        ! Star ID (HHMMSSs+DDMMSS)
      real*8        RAdeg       ! (deg) Right ascension in decimal degrees (J2000)
      real*8        DEdeg       ! (deg) Declination in decimal degrees (J2000)
      real*8        GLon        ! (deg) Galactic longitude
      real*8        GLat        ! (deg) Galactic latitude
      real*4        Ksmag0      ! (mag) Deredenned Ks magnitude
      real*4        v_J_Ks_0    ! (mag) Deredenned J-Ks colour index
      real*8        SgrLon      ! (deg) Sgr orbital plane longitude
      real*4        VGSRo       ! (km/s) Old Galactic standard of rest velocity
      real*4        VGSR        ! (km/s) ? New Galactic standard of rest velocity
      character*5   Spect       ! Spectrograph name
      character*10  Date        ! ("YYYY/MM/DD") Observation UT date
      integer*4     S_N         ! Signal-to-noise ratio

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

C  Declarations for 'table3.dat'	! FeI equivalent-width measurements

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

      integer*4     Sam_1       ! [1/6] Sample (G1)
      character*15  Star_1      ! Star ID or reference star name
      real*4        EW1         ! (0.1nm) ?=- FeI 7443.018{AA} equivalent width
      real*4        EW2         ! (0.1nm) ?=- FeI 7447.384{AA} equivalent width
      real*4        EW3         ! (0.1nm) ?=- FeI 7461.521{AA} equivalent width
      real*4        EW4         ! (0.1nm) ?=- FeI 7498.530{AA} equivalent width
      real*4        EW5         ! (0.1nm) ?=- FeI 7507.261{AA} equivalent width
      real*4        EW6         ! (0.1nm) ?=- FeI 7511.015{AA} equivalent width
      real*4        EW7         ! (0.1nm) ?=- FeI 7531.141{AA} equivalent width
      real*4        EW8         ! (0.1nm) ?=- FeI 7540.430{AA} equivalent width
      real*4        EW9         ! (0.1nm) ?=- FeI 7547.910{AA} equivalent width
      real*4        EW10        ! (0.1nm) ?=- FeI 7568.894{AA} equivalent width
      real*4        EW11        ! (0.1nm) ?=- FeI 7583.787{AA} equivalent width

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

C  Declarations for 'table7.dat'	! Derived stellar parameters for the program stars

      integer*4 nr__2
      parameter (nr__2=59)	! Number of records
      character*46 ar__2  	! Full-size record

      integer*4     Sam_2       ! [1/6] Sample (G1)
      character*15  Star_2      ! Star ID
      integer*4     Teff        ! (K) Effective temperature
      real*4        logg        ! ([cm/s2]) Surface gravity
      character*3   n_logg      ! Note on logg (1)
      real*4        ksi         ! (km/s) Microturbulent velocity
      real*4        v_Fe_H_     ! ([Sun]) Metallicity
      real*4        Std         ! Standard deviation in the line abundance
*                                     determination
*Note (1): "0.0(-)" means that our iterative procedure was converging on a
*     model atmosphere with logg<0, whereas the Kurucz (1994, CD-ROM 19)
*     model atmosphere grids do not go below logg=0. In these cases, we have
*     adopted the logg=0 atmosphere.

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

C  Loading file 'table1.dat'	! The program stars

C  Format for file interpretation

    1 format(
     +  I1,1X,A15,F9.5,1X,F9.5,1X,F9.5,1X,F9.5,1X,F6.3,1X,F4.2,1X,
     +  F9.5,1X,F6.1,1X,F6.1,1X,A5,1X,A10,1X,I3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,59
        read(1,'(A113)')ar__
        read(ar__,1)
     +  Sam,Star,RAdeg,DEdeg,GLon,GLat,Ksmag0,v_J_Ks_0,SgrLon,VGSRo,
     +  VGSR,Spect,Date,S_N
        if(ar__(87:92) .EQ. '') VGSR = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Sam,Star,RAdeg,DEdeg,GLon,GLat,Ksmag0,v_J_Ks_0,SgrLon,VGSRo,
     +  VGSR,Spect,Date,S_N
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! FeI equivalent-width measurements

C  Format for file interpretation

    2 format(
     +  I1,1X,A15,1X,F5.1,1X,F4.1,1X,F5.1,1X,F4.1,1X,F5.1,1X,F5.1,1X,
     +  F5.1,1X,F5.1,1X,F4.1,1X,F5.1,1X,F5.1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,66
        read(1,'(A80)')ar__1
        read(ar__1,2)
     +  Sam_1,Star_1,EW1,EW2,EW3,EW4,EW5,EW6,EW7,EW8,EW9,EW10,EW11
        if (idig(ar__1(19:23)).EQ.0) EW1 =  rNULL__
        if (idig(ar__1(25:28)).EQ.0) EW2 =  rNULL__
        if (idig(ar__1(30:34)).EQ.0) EW3 =  rNULL__
        if (idig(ar__1(36:39)).EQ.0) EW4 =  rNULL__
        if (idig(ar__1(41:45)).EQ.0) EW5 =  rNULL__
        if (idig(ar__1(47:51)).EQ.0) EW6 =  rNULL__
        if (idig(ar__1(53:57)).EQ.0) EW7 =  rNULL__
        if (idig(ar__1(59:63)).EQ.0) EW8 =  rNULL__
        if (idig(ar__1(65:68)).EQ.0) EW9 =  rNULL__
        if (idig(ar__1(70:74)).EQ.0) EW10 =  rNULL__
        if (idig(ar__1(76:80)).EQ.0) EW11 =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Sam_1,Star_1,EW1,EW2,EW3,EW4,EW5,EW6,EW7,EW8,EW9,EW10,EW11
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table7.dat'	! Derived stellar parameters for the program stars

C  Format for file interpretation

    3 format(I1,1X,A15,1X,I4,1X,F4.2,A3,1X,F4.2,1X,F5.2,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table7.dat')
      write(6,*) '....Loading file: table7.dat'
      do i__=1,59
        read(1,'(A46)')ar__2
        read(ar__2,3)Sam_2,Star_2,Teff,logg,n_logg,ksi,v_Fe_H_,Std
c    ..............Just test output...........
        write(6,3)Sam_2,Star_2,Teff,logg,n_logg,ksi,v_Fe_H_,Std
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