FORTRAN Generation
(/./ftp/cats/J/A_A/543/A160)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/543/A160 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-18
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/543/A160      Normalized spectra of 82 Kepler red giants (Thygesen+, 2012)
*================================================================================
*Atmospheric parameters of 82 red giants in the Kepler field.
*    Thygesen A.O., Frandsen, S., Bruntt H., Kallinger T., Andersen M.F.,
*    Elsworth Y.E., Hekker S., Karoff C., Stello D., Brogaard K., Burke C.,
*    Caldwell D.A., Christiansen J.L.
*   <Astron. Astrophys. 543, A160 (2012)>
*   =2012A&A...543A.160T
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'stars.dat'	! List of studied giants

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

C  J2000 position composed of: RAh RAm RAs DE- DEd DEm DEs
      real*8        RAdeg      (nr__) ! (deg) Right Ascension J2000
      real*8        DEdeg      (nr__) ! (deg)     Declination J2000
C  ---------------------------------- ! (position vector(s) in degrees)

      character*12  Name       (nr__) ! Star name
      integer*4     RAh        (nr__) ! (h) Right ascension (J2000)
      integer*4     RAm        (nr__) ! (min) Right ascension (J2000)
      real*4        RAs        (nr__) ! (s) Right ascension (J2000)
      character*1   DE_        (nr__) ! Declination sign (J2000)
      integer*4     DEd        (nr__) ! (deg) Declination (J2000)
      integer*4     DEm        (nr__) ! (arcmin) Declination (J2000)
      real*4        DEs        (nr__) ! (arcsec) Declination (J2000)
      character*13  FileName   (nr__) ! Name of the spectrum file in subdirectory sp

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

C  Declarations for 'sp/*'	! Individual spectra

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

      real*8        lambda     (nr__1) ! (0.1nm) [3999/8850] Wavelength vector
      real*8        nFlux      (nr__1) ! Normalized flux

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

C  Declarations for 'tablea1.dat'	! Fundamental atmospheric parameters for all red
                             giants in our sample

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

      integer*4     KIC        (nr__2) ! KIC (Cat. V/133) identification
      integer*4     Teff1      (nr__2) ! (K) Effective temperature with VWA (+/-80K) (1)
      real*4        logg1      (nr__2) ! ([cm/s2]) Surface gravity with VWA (+/-0.2dex) (1)
      real*4        xi1        (nr__2) ! (km/s) Microturbulent velocity with VWA (+/-0.15km/s) (1)
      real*4        v_Fe_H_1   (nr__2) ! ([Sun]) Metallicity from FeI and FeII (+/-0.15dex) (1)
      integer*4     Teff2      (nr__2) ! (K) ?=- Effective temperature with Kepler 
*                                  asteroseismic analysis (+/-100K)
      real*4        logg2      (nr__2) ! ([cm/s2]) ?=- Surface gravity with Kepler
*                                  asteroseismic analysis (+/-0.1dex)
      integer*4     Teff3      (nr__2) ! (K) ?=- Effective temperature with KIC (V/133)
      real*4        logg3      (nr__2) ! ([cm/s2]) ?=- Surface gravity with KIC (V/133)
      real*4        v_Fe_H_3   (nr__2) ! ([Sun]) ?=- Metallicity with KIC (V/133)
      integer*4     Teff       (nr__2) ! (K) ?=- VWA + Kepler effective temperature (2)
      real*4        v_Fe_H_    (nr__2) ! ([Sun]) ?=- VWA + Kepler metallicity, FeII is used
*                                  as the measure of [Fe/H] (2)
      real*4        xi         (nr__2) ! (km/s) ?=- VWA + Kepler microturbulent velocity {xi} (2)
      real*4        vsini      (nr__2) ! (km/s) Projected rotational velocity (+/-1.0km/s)
      real*4        vmacro     (nr__2) ! (km/s) Macroturbulent velocity (+/-1.0km/s)
      real*4        RV         (nr__2) ! (km/s) Radial velocity (+/-0.15km/s)
      character*3   Type       (nr__2) ! Giant type: RGB = red giant branch, 
*                              RC = red clump, SC = secondary clump
*Note (1): VWA software poackage (see Bruntt et al. 2004A&A...425..683B,
*     2008A&A...478..487B, 2010A&A...519A..51B), from spectroscopy.
*Note (2): values are determined with VWA by fixing the gravity from the
*     asteroseismic Kepler value.

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

C  Declarations for 'tablea2.dat'	! Elemental abundances for all targets where an
                             asteroseismic logg could be determined

      integer*4 nr__3
      parameter (nr__3=82)	! Number of records
      character*109 ar__3  	! Full-size record

      integer*4     KIC_1      (nr__3) ! KIC (Cat. V/133) identification
      character*1   R          (nr__3) ! [*] (KIC 9574235): abundances based on
*                                       the spectroscopic (VWA) logg
      real*4        v_C_H_     (nr__3) ! ([Sun]) ?=- [C/H] abundance (+/-0.5dex)
      real*4        v_O_H_     (nr__3) ! ([Sun]) ?=- [O/H] abundance (+/-0.5dex)
      real*4        v_Si_H_    (nr__3) ! ([Sun]) ?=- [Si/H] abundance (+/-0.2dex)
      real*4        v_Ca_H_    (nr__3) ! ([Sun]) ?=- [Ca/H] abundance (+/-0.2dex)
      real*4        v_Sc_H_    (nr__3) ! ([Sun]) ?=- [Sc/H] abundance (+/-0.2dex)
      real*4        v_TiI_H_   (nr__3) ! ([Sun]) ?=- [TiI/H] abundance (+/-0.2dex)
      real*4        v_TiII_H_  (nr__3) ! ([Sun]) ?=- [TiII/H] abundance (+/-0.2dex)
      real*4        v_V_H_     (nr__3) ! ([Sun]) ?=- [V/H] abundance (+/-0.2dex)
      real*4        v_CrI_H_   (nr__3) ! ([Sun]) ?=- [CrI/H] abundance (+/-0.2dex)
      real*4        v_CrII_H_  (nr__3) ! ([Sun]) ?=- [CrII/H] abundance (+/-0.2dex)
      real*4        v_Mn_H_    (nr__3) ! ([Sun]) ?=- [Mn/H] abundance (+/-0.2dex)
      real*4        v_FeI_H_   (nr__3) ! ([Sun]) ?=- [FeI/H] abundance (+/-0.15dex)
      real*4        v_FeII_H_  (nr__3) ! ([Sun]) ?=- [FeII/H] abundance (+/-0.15dex)
      real*4        v_Co_H_    (nr__3) ! ([Sun]) ?=- [Co/H] abundance (+/-0.2dex)
      real*4        v_Ni_H_    (nr__3) ! ([Sun]) ?=- [Ni/H] abundance (+/-0.2dex)
      real*4        v_Y_H_     (nr__3) ! ([Sun]) ?=- [Y/H] abundance (+/-0.2dex)

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

C  Loading file 'stars.dat'	! List of studied giants

C  Format for file interpretation

    1 format(A12,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F5.2,1X,A13)

C  Effective file loading

      open(unit=1,status='old',file=
     +'stars.dat')
      write(6,*) '....Loading file: stars.dat'
      do i__=1,92
        read(1,'(A51)')ar__
        read(ar__,1)
     +  Name(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),DEd(i__),
     +  DEm(i__),DEs(i__),FileName(i__)
        RAdeg(i__) = rNULL__
        DEdeg(i__) = rNULL__
c  Derive coordinates RAdeg and DEdeg from input data
c  (RAdeg and DEdeg are set to rNULL__ when unknown)
        if(RAh(i__) .GT. -180) RAdeg(i__)=RAh(i__)*15.
        if(RAm(i__) .GT. -180) RAdeg(i__)=RAdeg(i__)+RAm(i__)/4.
        if(RAs(i__) .GT. -180) RAdeg(i__)=RAdeg(i__)+RAs(i__)/240.
        if(DEd(i__) .GE. 0) DEdeg(i__)=DEd(i__)
        if(DEm(i__) .GE. 0) DEdeg(i__)=DEdeg(i__)+DEm(i__)/60.
        if(DEs(i__) .GE. 0) DEdeg(i__)=DEdeg(i__)+DEs(i__)/3600.
        if(DE_(i__).EQ.'-'.AND.DEdeg(i__).GE.0) DEdeg(i__)=-DEdeg(i__)
c    ..............Just test output...........
        write(6,1)
     +  Name(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),DEd(i__),
     +  DEm(i__),DEs(i__),FileName(i__)
        write(6,'(6H Pos: 2F8.4)') RAdeg(i__),DEdeg(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'sp/*'	! Individual spectra

C  Format for file interpretation

    2 format(1X,F10.5,2X,F10.8)

C  Effective file loading

      open(unit=1,status='old',file=
     +'sp/*')
      write(6,*) '....Loading file: sp/*'
      do i__=1,92
        read(1,'(A23)')ar__1
        read(ar__1,2)lambda(i__),nFlux(i__)
c    ..............Just test output...........
        write(6,2)lambda(i__),nFlux(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'tablea1.dat'	! Fundamental atmospheric parameters for all red
*                             giants in our sample

C  Format for file interpretation

    3 format(
     +  4X,I8,1X,I4,1X,F4.2,1X,F4.2,1X,F5.2,1X,I4,1X,F4.2,1X,I4,1X,
     +  F4.2,1X,F5.2,1X,I4,1X,F5.2,1X,F4.2,1X,F3.1,1X,F3.1,1X,F6.1,1X,
     +  A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tablea1.dat')
      write(6,*) '....Loading file: tablea1.dat'
      do i__=1,82
        read(1,'(A94)')ar__2
        read(ar__2,3)
     +  KIC(i__),Teff1(i__),logg1(i__),xi1(i__),v_Fe_H_1(i__),
     +  Teff2(i__),logg2(i__),Teff3(i__),logg3(i__),v_Fe_H_3(i__),
     +  Teff(i__),v_Fe_H_(i__),xi(i__),vsini(i__),vmacro(i__),RV(i__),
     +  Type(i__)
        if (Teff2(i__) .EQ. 45) Teff2(i__) =  iNULL__
        if (idig(ar__2(40:43)).EQ.0) logg2(i__) =  rNULL__
        if (Teff3(i__) .EQ. 45) Teff3(i__) =  iNULL__
        if (idig(ar__2(50:53)).EQ.0) logg3(i__) =  rNULL__
        if (idig(ar__2(55:59)).EQ.0) v_Fe_H_3(i__) =  rNULL__
        if (Teff(i__) .EQ. 45) Teff(i__) =  iNULL__
        if (idig(ar__2(66:70)).EQ.0) v_Fe_H_(i__) =  rNULL__
        if (idig(ar__2(72:75)).EQ.0) xi(i__) =  rNULL__
c    ..............Just test output...........
        write(6,3)
     +  KIC(i__),Teff1(i__),logg1(i__),xi1(i__),v_Fe_H_1(i__),
     +  Teff2(i__),logg2(i__),Teff3(i__),logg3(i__),v_Fe_H_3(i__),
     +  Teff(i__),v_Fe_H_(i__),xi(i__),vsini(i__),vmacro(i__),RV(i__),
     +  Type(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'tablea2.dat'	! Elemental abundances for all targets where an
*                             asteroseismic logg could be determined

C  Format for file interpretation

    4 format(
     +  4X,I8,A1,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,
     +  F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,
     +  1X,F5.2,1X,F5.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tablea2.dat')
      write(6,*) '....Loading file: tablea2.dat'
      do i__=1,82
        read(1,'(A109)')ar__3
        read(ar__3,4)
     +  KIC_1(i__),R(i__),v_C_H_(i__),v_O_H_(i__),v_Si_H_(i__),
     +  v_Ca_H_(i__),v_Sc_H_(i__),v_TiI_H_(i__),v_TiII_H_(i__),
     +  v_V_H_(i__),v_CrI_H_(i__),v_CrII_H_(i__),v_Mn_H_(i__),
     +  v_FeI_H_(i__),v_FeII_H_(i__),v_Co_H_(i__),v_Ni_H_(i__),
     +  v_Y_H_(i__)
        if (idig(ar__3(15:19)).EQ.0) v_C_H_(i__) =  rNULL__
        if (idig(ar__3(21:25)).EQ.0) v_O_H_(i__) =  rNULL__
        if (idig(ar__3(27:31)).EQ.0) v_Si_H_(i__) =  rNULL__
        if (idig(ar__3(33:37)).EQ.0) v_Ca_H_(i__) =  rNULL__
        if (idig(ar__3(39:43)).EQ.0) v_Sc_H_(i__) =  rNULL__
        if (idig(ar__3(45:49)).EQ.0) v_TiI_H_(i__) =  rNULL__
        if (idig(ar__3(51:55)).EQ.0) v_TiII_H_(i__) =  rNULL__
        if (idig(ar__3(57:61)).EQ.0) v_V_H_(i__) =  rNULL__
        if (idig(ar__3(63:67)).EQ.0) v_CrI_H_(i__) =  rNULL__
        if (idig(ar__3(69:73)).EQ.0) v_CrII_H_(i__) =  rNULL__
        if (idig(ar__3(75:79)).EQ.0) v_Mn_H_(i__) =  rNULL__
        if (idig(ar__3(81:85)).EQ.0) v_FeI_H_(i__) =  rNULL__
        if (idig(ar__3(87:91)).EQ.0) v_FeII_H_(i__) =  rNULL__
        if (idig(ar__3(93:97)).EQ.0) v_Co_H_(i__) =  rNULL__
        if (idig(ar__3(99:103)).EQ.0) v_Ni_H_(i__) =  rNULL__
        if (idig(ar__3(105:109)).EQ.0) v_Y_H_(i__) =  rNULL__
c    ..............Just test output...........
        write(6,4)
     +  KIC_1(i__),R(i__),v_C_H_(i__),v_O_H_(i__),v_Si_H_(i__),
     +  v_Ca_H_(i__),v_Sc_H_(i__),v_TiI_H_(i__),v_TiII_H_(i__),
     +  v_V_H_(i__),v_CrI_H_(i__),v_CrII_H_(i__),v_Mn_H_(i__),
     +  v_FeI_H_(i__),v_FeII_H_(i__),v_Co_H_(i__),v_Ni_H_(i__),
     +  v_Y_H_(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