FORTRAN Generation
(/./ftp/cats/J/MNRAS/466/1290)

Conversion of standardized ReadMe file for file /./ftp/cats/J/MNRAS/466/1290 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 2026-Oct-09
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/466/1290    Metal-rich SX Phe stars in Kepler field       (Nemec+, 2017)
*================================================================================
*Metal-rich SX Phe stars in the Kepler field.
*    Nemec J.M., Balona L.A., Murphy S.J., Kinemuchi K., Jeon Y.-B.
*   <Mon. Not. R. Astron. Soc., 466, 1290-1329 (2017)>
*   =2017MNRAS.466.1290N    (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Summary of CFHT and APO spectra

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

      character*1   Note       (nr__) ! Note (1)
      character*12  Name       (nr__) ! KIC/HD name
      character*17  Sp         (nr__) ! Spectrum  number (CFHT or APO)
      character*10  Obs_date   (nr__) ! ("YYYY/MM/DD") UTC mid-exposure date (mid)
      character*8   Obs_time   (nr__) ! ("h:m:s") UTC mid-exposure time (mid)
      real*8        BJD        (nr__) ! (d) Mid-exposure barycentric Julian Day
      integer*4     ExpTime    (nr__) ! (s) Exposure time
      integer*4     S_N        (nr__) ! Signal-to-noise ratio
      real*4        AM         (nr__) ! Airmass at the mid-time of the observation
      real*8        BRV        (nr__) ! (km/s) Barycentric radial velocity (2)
      real*4        e_BRV      (nr__) ! (km/s) rms uncertainty on BRV
      character*1   l_vsini    (nr__) ! Limit flag on vsini
      real*4        vsini      (nr__) ! (km/s) ? Projected equatorial velocity (2)
      real*4        e_vsini    (nr__) ! (km/s) ? rms uncertainty on vsini
      character*4   Flag       (nr__) ! Note
*Note (1): Note as follows:
*    a = Kepler-field SX Phe stars
*    b = IAU radial velocity standard stars
*Note (2): For the SB2 system KIC 6780873, the RV and vsini entries are for the
*    primary component.

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

C  Declarations for 'table2.dat'	! Locations and kinematics for the 34 SX Phe
                                 candidates

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

C  Position composed of: GLON GLAT
      integer*4     KIC        (nr__1) ! KIC star number
      integer*4     CFHT       (nr__1) ! ?=- CFHT star number
      character*1   n_CFHT     (nr__1) ! Uncertainty flag on CFHT
      real*8        GLON       (nr__1) ! (deg) Galactic longitude
      real*8        GLAT       (nr__1) ! (deg) Galactic latitude
      real*4        E_B_V_KIC  (nr__1) ! (mag) ?=- KIC reddening
      real*4        E_B_V      (nr__1) ! (mag) New reddening
      integer*4     dKIC       (nr__1) ! (pc) ?=- KIC distance
      integer*4     d          (nr__1) ! (pc) New distance
      integer*4     zKIC       (nr__1) ! (pc) ?=- KIC height above the Galactic plane
      integer*4     z          (nr__1) ! (pc) New height above the Galactic plane
      real*4        v_RV_      (nr__1) ! (km/s) ? Mean radial velocity
      real*4        e__RV_     (nr__1) ! (km/s) ? rms uncertainty on <RV>
      integer*4     o__RV_     (nr__1) ! ? Number of measured spectra
      character*1   n__RV_     (nr__1) ! [*] * for binary systems,
*                                    systemic radial velocity in <RV>
      integer*4     Uvel       (nr__1) ! (km/s) ? Space motion, U, relative to the LSR
      integer*4     Vvel       (nr__1) ! (km/s) ? Space motion, V, relative to the LSR
      integer*4     Wvel       (nr__1) ! (km/s) ? Space motion, W, relative to the LSR
      integer*4     Tvel       (nr__1) ! (km/s) ? Total space motion, relative to the LSR

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

C  Declarations for 'table3.dat'	! Spectral types, luminosity classes, mean
                                 projected rotational velocities, and mean
                                 radial-tangential macroturbulent velocities

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

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

      integer*4     KIC_1      (nr__2) ! KIC star number
      integer*4     CFHT_1     (nr__2) ! ?=- CFHT star number
      character*1   n_CFHT_1   (nr__2) ! Uncertainty flag on CFHT
      integer*4     RAh        (nr__2) ! (h) Right ascension (J2000)
      integer*4     RAm        (nr__2) ! (min) Right ascension (J2000)
      real*4        RAs        (nr__2) ! (s) Right ascension (J2000)
      character*1   DE_        (nr__2) ! Declination sign (J2000)
      integer*4     DEd        (nr__2) ! (deg) Declination (J2000)
      integer*4     DEm        (nr__2) ! (arcmin) Declination (J2000)
      real*4        DEs        (nr__2) ! (arcsec) Declination (J2000)
      character*4   SpTypeK    (nr__2) ! Spectral type based on the K-line
      character*4   SpTypeH    (nr__2) ! Spectral type based on hydrogen lines
      character*4   SpTypeM    (nr__2) ! Spectral type based on metal lines
      character*7   Lum        (nr__2) ! Luminosity class
      character*1   l__vsini_FT(nr__2) ! Limit flag on <vsini>FT
      real*4        v_vsini_FT (nr__2) ! (km/s) Weighted average of the vsini values
*                                    given in Table 1
      real*4        e__vsini_FT(nr__2) ! (km/s) rms uncertainty on <vsini>FT
      integer*4     o__vsini_FT(nr__2) ! Number of spectra measured
      character*1   l__vsini_GOF(nr__2) ! Limit flag on <vsini>GOF
      integer*4     v_vsini_GOF(nr__2) ! (km/s) ? Mean vsini values derived using the
*                                    goodness-of-fit method
      integer*4     e__vsini_GOF(nr__2) ! (km/s) ? rms uncertainty on <vsini>GOF
      integer*4     v_zetaRT_  (nr__2) ! (km/s) ? Average radial-tangential macroturbulent
*                                    velocity, {zeta}_RT_. derived using the
*                                    goodness-of-fit method
      integer*4     e__zetaRT_ (nr__2) ! (km/s) ? rms uncertainty on <zetaRT>
      integer*4     o__zetaRT_ (nr__2) ! ? number of lines that were measured

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

C  Declarations for 'table4.dat'	! Atmospheric characteristics for 32 of the 34
                                 candidate SX Phe stars in the Kepler field

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

      integer*4     KIC_2      (nr__3) ! KIC star number
      integer*4     CFHT_2     (nr__3) ! ?=- CFHT star number
      character*1   n_CFHT_2   (nr__3) ! Uncertainty flag on CFHT
      real*4        loggKIC    (nr__3) ! ([cm/s2]) ? KIC surface gravity (SME estimate)
      real*4        loggH14    (nr__3) ! ([cm/s2]) H14 surface gravity (VWA/MOOG estimates
*                                     based on the EW/COG method) (1)
      real*4        logg       (nr__3) ! ([cm/s2]) This paper surface gravity
      real*4        e_logg     (nr__3) ! ([cm/s2]) ? rms uncertainty on logg
      character*1   n_logg     (nr__3) ! [)] Flag for assumed or uncertainty value
*                                     of logg
      integer*4     TeffKIC    (nr__3) ! (K) ?=- KIC Effective temperature (SME estimate)
      integer*4     TeffH14    (nr__3) ! (K) ?=- H14 Effective temperature (VWA/MOOG
*                                     estimates based on the EW/COG method) (1)
      integer*4     Teff       (nr__3) ! (K) This paper Effective temperature
      integer*4     e_Teff     (nr__3) ! (K) rms uncertainty on Teff
      real*4        xit        (nr__3) ! (km/s) This paper microturbulent velocity
      real*4        e_xit      (nr__3) ! (km/s) rms uncertainty on xit
      character*1   n_xit      (nr__3) ! [)] Flag for assumed or uncertainty value
*                                     of xit
      real*4        v_Fe_H_KIC (nr__3) ! ([-]) ?=- KIC metal abundance (SME estimate)
      real*4        v_Fe_H_H14 (nr__3) ! ([-]) ?=- H14 metal abundance (VWA/MOOG estimates
*                                     based on the EW/COG method) (1)
      real*4        v_Fe_H_    (nr__3) ! ([-]) This paper metal abundance
      real*4        e__Fe_H_   (nr__3) ! ([-]) ? rms uncertainty on [Fe/H]
      character*1   n__Fe_H_   (nr__3) ! [)] Uncertainty flag on [Fe/H]
*Note (1): H14: Huber et al., 2014, Cat. J/ApJS/211/2.

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

C  Declarations for 'table5.dat'	! Mean magnitudes and colours for the Kepler-field
                                 SX Phe candidates

      integer*4 nr__4
      parameter (nr__4=48)	! Number of records
      character*99 ar__4  	! Full-size record

      integer*4     KIC_3      (nr__4) ! KIC star number
      integer*4     CFHT_3     (nr__4) ! ?=- CFHT star number
      character*1   n_CFHT_3   (nr__4) ! Uncertainty flag on CFHT
      real*4        Kpmag      (nr__4) ! (mag) ?=- Kepler magnitude
      character*1   n_Vmag     (nr__4) ! [n] n if new observation (1)
      real*4        Vmag       (nr__4) ! (mag) ?=- E12 V magnitude (2)
      character*1   n_B_V      (nr__4) ! [n] n if new observation (1)
      real*4        B_V        (nr__4) ! (mag) ?=- E12 B-V colour index (2)
      character*1   n_U_B      (nr__4) ! [n] n if new observation (1)
      real*4        U_B        (nr__4) ! (mag) ?=- E12 U-B colour index (2)
      character*1   n__B_V_0K  (nr__4) ! [n] n if new observation (1)
      real*4        v_B_V_0K   (nr__4) ! (mag) ?=- KIC dereddened B-V colour index
      character*1   n__B_V_0n  (nr__4) ! [n] n if new observation (1)
      real*4        v_B_V_0n   (nr__4) ! (mag) ?=- New dereddened B-V colour index
      character*1   n__U_B_0K  (nr__4) ! [n] n if new observation (1)
      real*4        v_U_B_0K   (nr__4) ! (mag) ?=- KIC dereddened U-B colour index
      character*1   n__U_B_0n  (nr__4) ! [n] n if new observation (1)
      real*4        v_U_B_0n   (nr__4) ! (mag) ?=- New dereddened U-B colour index
      real*4        g_rKIC     (nr__4) ! (mag) ?=- KIC g-r colour index
      real*4        g_rKIS     (nr__4) ! (mag) ?=- Kepler-INT Survey g-r colour index
      real*4        r_i        (nr__4) ! (mag) ? KIC r-i colour index
      real*4        H_K        (nr__4) ! (mag) ? KIC H-K colour index
      real*4        J_K        (nr__4) ! (mag) ? KIC J-K colour index
*Note (1): values from new photometric observations.
*Note (2): E12: Everett et al. (2012PASP..124..316E).

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

C  Loading file 'table1.dat'	! Summary of CFHT and APO spectra

C  Format for file interpretation

    1 format(
     +  A1,1X,A12,1X,A17,1X,A10,2X,A8,1X,F12.4,1X,I4,1X,I3,1X,F4.2,1X,
     +  F7.2,1X,F5.2,A1,F6.2,1X,F5.2,A4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,208
        read(1,'(A111)')ar__
        read(ar__,1)
     +  Note(i__),Name(i__),Sp(i__),Obs_date(i__),Obs_time(i__),
     +  BJD(i__),ExpTime(i__),S_N(i__),AM(i__),BRV(i__),e_BRV(i__),
     +  l_vsini(i__),vsini(i__),e_vsini(i__),Flag(i__)
        if(ar__(96:101) .EQ. '') vsini(i__) = rNULL__
        if(ar__(103:107) .EQ. '') e_vsini(i__) = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Note(i__),Name(i__),Sp(i__),Obs_date(i__),Obs_time(i__),
     +  BJD(i__),ExpTime(i__),S_N(i__),AM(i__),BRV(i__),e_BRV(i__),
     +  l_vsini(i__),vsini(i__),e_vsini(i__),Flag(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Locations and kinematics for the 34 SX Phe
*                                 candidates

C  Format for file interpretation

    2 format(
     +  I8,1X,I2,A1,1X,F7.4,1X,F7.4,1X,F5.3,1X,F4.2,1X,I4,1X,I4,1X,I3,
     +  1X,I3,1X,F6.1,1X,F3.1,1X,I2,A1,1X,I5,1X,I4,1X,I5,1X,I4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,34
        read(1,'(A94)')ar__1
        read(ar__1,2)
     +  KIC(i__),CFHT(i__),n_CFHT(i__),GLON(i__),GLAT(i__),
     +  E_B_V_KIC(i__),E_B_V(i__),dKIC(i__),d(i__),zKIC(i__),z(i__),
     +  v_RV_(i__),e__RV_(i__),o__RV_(i__),n__RV_(i__),Uvel(i__),
     +  Vvel(i__),Wvel(i__),Tvel(i__)
        if (CFHT(i__) .EQ. 45) CFHT(i__) =  iNULL__
        if (idig(ar__1(30:34)).EQ.0) E_B_V_KIC(i__) =  rNULL__
        if (dKIC(i__) .EQ. 45) dKIC(i__) =  iNULL__
        if (zKIC(i__) .EQ. 45) zKIC(i__) =  iNULL__
        if(ar__1(59:64) .EQ. '') v_RV_(i__) = rNULL__
        if(ar__1(66:68) .EQ. '') e__RV_(i__) = rNULL__
        if(ar__1(70:71) .EQ. '') o__RV_(i__) = iNULL__
        if(ar__1(74:78) .EQ. '') Uvel(i__) = iNULL__
        if(ar__1(80:83) .EQ. '') Vvel(i__) = iNULL__
        if(ar__1(85:89) .EQ. '') Wvel(i__) = iNULL__
        if(ar__1(91:94) .EQ. '') Tvel(i__) = iNULL__
c    ..............Just test output...........
        write(6,2)
     +  KIC(i__),CFHT(i__),n_CFHT(i__),GLON(i__),GLAT(i__),
     +  E_B_V_KIC(i__),E_B_V(i__),dKIC(i__),d(i__),zKIC(i__),z(i__),
     +  v_RV_(i__),e__RV_(i__),o__RV_(i__),n__RV_(i__),Uvel(i__),
     +  Vvel(i__),Wvel(i__),Tvel(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Spectral types, luminosity classes, mean
*                                 projected rotational velocities, and mean
*                                 radial-tangential macroturbulent velocities

C  Format for file interpretation

    3 format(
     +  I8,1X,I2,A1,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F5.2,1X,A4,
     +  1X,A4,1X,A4,1X,A7,A1,F5.1,1X,F3.1,1X,I2,2X,A1,I2,1X,I1,1X,I2,
     +  1X,I1,2X,I2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,32
        read(1,'(A90)')ar__2
        read(ar__2,3)
     +  KIC_1(i__),CFHT_1(i__),n_CFHT_1(i__),RAh(i__),RAm(i__),
     +  RAs(i__),DE_(i__),DEd(i__),DEm(i__),DEs(i__),SpTypeK(i__),
     +  SpTypeH(i__),SpTypeM(i__),Lum(i__),l__vsini_FT(i__),
     +  v_vsini_FT(i__),e__vsini_FT(i__),o__vsini_FT(i__),
     +  l__vsini_GOF(i__),v_vsini_GOF(i__),e__vsini_GOF(i__),
     +  v_zetaRT_(i__),e__zetaRT_(i__),o__zetaRT_(i__)
        if (CFHT_1(i__) .EQ. 45) CFHT_1(i__) =  iNULL__
        if(ar__2(77:78) .EQ. '') v_vsini_GOF(i__) = iNULL__
        if(ar__2(80:80) .EQ. '') e__vsini_GOF(i__) = iNULL__
        if(ar__2(82:83) .EQ. '') v_zetaRT_(i__) = iNULL__
        if(ar__2(85:85) .EQ. '') e__zetaRT_(i__) = iNULL__
        if(ar__2(88:89) .EQ. '') o__zetaRT_(i__) = iNULL__
        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,3)
     +  KIC_1(i__),CFHT_1(i__),n_CFHT_1(i__),RAh(i__),RAm(i__),
     +  RAs(i__),DE_(i__),DEd(i__),DEm(i__),DEs(i__),SpTypeK(i__),
     +  SpTypeH(i__),SpTypeM(i__),Lum(i__),l__vsini_FT(i__),
     +  v_vsini_FT(i__),e__vsini_FT(i__),o__vsini_FT(i__),
     +  l__vsini_GOF(i__),v_vsini_GOF(i__),e__vsini_GOF(i__),
     +  v_zetaRT_(i__),e__zetaRT_(i__),o__zetaRT_(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 'table4.dat'	! Atmospheric characteristics for 32 of the 34
*                                 candidate SX Phe stars in the Kepler field

C  Format for file interpretation

    4 format(
     +  I8,1X,I2,A1,1X,F4.2,2X,F4.2,1X,F4.2,1X,F4.2,A1,1X,I4,2X,I4,1X,
     +  I4,1X,I3,1X,F4.1,1X,F3.1,A1,1X,F5.2,2X,F5.2,1X,F5.2,1X,F4.2,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table4.dat')
      write(6,*) '....Loading file: table4.dat'
      do i__=1,40
        read(1,'(A89)')ar__3
        read(ar__3,4)
     +  KIC_2(i__),CFHT_2(i__),n_CFHT_2(i__),loggKIC(i__),
     +  loggH14(i__),logg(i__),e_logg(i__),n_logg(i__),TeffKIC(i__),
     +  TeffH14(i__),Teff(i__),e_Teff(i__),xit(i__),e_xit(i__),
     +  n_xit(i__),v_Fe_H_KIC(i__),v_Fe_H_H14(i__),v_Fe_H_(i__),
     +  e__Fe_H_(i__),n__Fe_H_(i__)
        if (CFHT_2(i__) .EQ. 45) CFHT_2(i__) =  iNULL__
        if(ar__3(14:17) .EQ. '') loggKIC(i__) = rNULL__
        if(ar__3(30:33) .EQ. '') e_logg(i__) = rNULL__
        if (TeffKIC(i__) .EQ. 45) TeffKIC(i__) =  iNULL__
        if (TeffH14(i__) .EQ. 45) TeffH14(i__) =  iNULL__
        if (idig(ar__3(66:70)).EQ.0) v_Fe_H_KIC(i__) =  rNULL__
        if (idig(ar__3(73:77)).EQ.0) v_Fe_H_H14(i__) =  rNULL__
        if(ar__3(85:88) .EQ. '') e__Fe_H_(i__) = rNULL__
c    ..............Just test output...........
        write(6,4)
     +  KIC_2(i__),CFHT_2(i__),n_CFHT_2(i__),loggKIC(i__),
     +  loggH14(i__),logg(i__),e_logg(i__),n_logg(i__),TeffKIC(i__),
     +  TeffH14(i__),Teff(i__),e_Teff(i__),xit(i__),e_xit(i__),
     +  n_xit(i__),v_Fe_H_KIC(i__),v_Fe_H_H14(i__),v_Fe_H_(i__),
     +  e__Fe_H_(i__),n__Fe_H_(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table5.dat'	! Mean magnitudes and colours for the Kepler-field
*                                 SX Phe candidates

C  Format for file interpretation

    5 format(
     +  I8,1X,I2,A1,1X,F6.3,A1,F6.3,A1,F5.3,A1,F6.3,A1,F5.2,1X,A1,
     +  F4.2,A1,F5.2,1X,A1,F5.2,1X,F6.3,2X,F5.3,1X,F6.3,1X,F6.3,1X,
     +  F6.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table5.dat')
      write(6,*) '....Loading file: table5.dat'
      do i__=1,48
        read(1,'(A99)')ar__4
        read(ar__4,5)
     +  KIC_3(i__),CFHT_3(i__),n_CFHT_3(i__),Kpmag(i__),n_Vmag(i__),
     +  Vmag(i__),n_B_V(i__),B_V(i__),n_U_B(i__),U_B(i__),
     +  n__B_V_0K(i__),v_B_V_0K(i__),n__B_V_0n(i__),v_B_V_0n(i__),
     +  n__U_B_0K(i__),v_U_B_0K(i__),n__U_B_0n(i__),v_U_B_0n(i__),
     +  g_rKIC(i__),g_rKIS(i__),r_i(i__),H_K(i__),J_K(i__)
        if (CFHT_3(i__) .EQ. 45) CFHT_3(i__) =  iNULL__
        if (idig(ar__4(14:19)).EQ.0) Kpmag(i__) =  rNULL__
        if (idig(ar__4(21:26)).EQ.0) Vmag(i__) =  rNULL__
        if (idig(ar__4(28:32)).EQ.0) B_V(i__) =  rNULL__
        if (idig(ar__4(34:39)).EQ.0) U_B(i__) =  rNULL__
        if (idig(ar__4(41:45)).EQ.0) v_B_V_0K(i__) =  rNULL__
        if (idig(ar__4(48:51)).EQ.0) v_B_V_0n(i__) =  rNULL__
        if (idig(ar__4(53:57)).EQ.0) v_U_B_0K(i__) =  rNULL__
        if (idig(ar__4(60:64)).EQ.0) v_U_B_0n(i__) =  rNULL__
        if (idig(ar__4(66:71)).EQ.0) g_rKIC(i__) =  rNULL__
        if (idig(ar__4(74:78)).EQ.0) g_rKIS(i__) =  rNULL__
        if(ar__4(80:85) .EQ. '') r_i(i__) = rNULL__
        if(ar__4(87:92) .EQ. '') H_K(i__) = rNULL__
        if(ar__4(94:99) .EQ. '') J_K(i__) = rNULL__
c    ..............Just test output...........
        write(6,5)
     +  KIC_3(i__),CFHT_3(i__),n_CFHT_3(i__),Kpmag(i__),n_Vmag(i__),
     +  Vmag(i__),n_B_V(i__),B_V(i__),n_U_B(i__),U_B(i__),
     +  n__B_V_0K(i__),v_B_V_0K(i__),n__B_V_0n(i__),v_B_V_0n(i__),
     +  n__U_B_0K(i__),v_U_B_0K(i__),n__U_B_0n(i__),v_U_B_0n(i__),
     +  g_rKIC(i__),g_rKIS(i__),r_i(i__),H_K(i__),J_K(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