FORTRAN Generation
(/./ftp/cats/I/337)

Conversion of standardized ReadMe file for file /./ftp/cats/I/337 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 2018-Feb-22
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. I/337               Gaia DR1                          (Gaia Collaboration, 2016)
*================================================================================
*Gaia DR1 data.
*   Gaia collaboration
*   <Astron. Astrophys., 595, A1-A7, A133 (2016)>
*   =2016A&A...595A...1G
*   =2016yCat.1337....0G
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'gaia.sam'	! Sample of GaiaSource data

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

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      real*8        RAdeg       ! (deg) Right ascension (ICRS) at epoch 2015.0 (ra)
      real*8        DEdeg       ! (deg) Declination (ICRS) at epoch 2015.0 (dec)
      integer*8     SolID       ! Solution ID (solution_id) (G1)
      integer*8     Source      ! Source ID (source_id) (G2)
      integer*8     RandomI     ! Random index used to select subsets
*                                     (random_index) (G3)
      real*4        Epoch       ! (yr) [2015.0] Reference epoch in Julian years
*                                     (ref_epoch) (G4)
      real*4        e_RAdeg     ! (mas) Standard error of right ascension
*                                     (ra_error)
      real*4        e_DEdeg     ! (mas) Standard error of declination (dec_error)
      real*4        Plx         ! (mas) ? Absolute barycentric stellar parallax of
*                                    the source at the reference epoch Epoch
*                                     (parallax)
      real*4        e_Plx       ! (mas) ? Standard error of parallax
*                                     (parallax_error)
      real*8        pmRA        ! (mas/yr) ? Proper motion in right ascension direction
*                                     (pmRA) (G5)
      real*4        e_pmRA      ! (mas/yr) ? Standard error of proper motion in right
*                                     ascension direction (pmra_error)
      real*8        pmDE        ! (mas/yr) ? Proper motion in declination direction
*                                     (pmdec) (G6)
      real*4        e_pmDE      ! (mas/yr) ? Standard error of proper motion in
*                                     declination direction (pmdec_error)
      real*4        RADEcor     ! Correlation between right ascension and
*                                     declination (ra_dec_corr)
      real*4        RAPlxcor    ! ? Correlation between right ascension and
*                                     parallax (ra_parallax_corr)
      real*4        RApmRAcor   ! ? Correlation between right ascension and
*                                     proper motion in right ascension
*                                     (ra_pmra_corr)
      real*4        RApmDEcor   ! ? Correlation between right ascension and
*                                     proper motion in declination
*                                     (ra_pmdec_corr)
      real*4        DEPlxcor    ! ? Correlation between declination and
*                                     parallax (dec_parallax_corr)
      real*4        DEpmRAcor   ! ? Correlation between declination and
*                                     proper motion in right ascension
*                                     (dec_pmra_corr)
      real*4        DEpmDEcor   ! ? Correlation between declination and
*                                     proper motion in declination
*                                     (dec_pmdec_corr)
      real*4        PlxpmRAcor  ! ? Correlation between parallax and proper
*                                     motion in right ascension
*                                     (parallax_pmra_corr)
      real*4        PlxpmDEcor  ! ? Correlation between parallax and proper
*                                     motion in declination
*                                     (parallax_pmdec_corr)
      real*4        pmRApmDEcor ! ? Correlation between proper motion in
*                                     right ascension and proper motion in
*                                     declination (pmra_pmdec_corr)
      integer*4     NAL         ! Total number of observations AL
*                                     (astrometric_n_obs_al) (G7)
      integer*4     NAC         ! Total number of observations AC
*                                     (astrometric_n_obs_ac) (G8)
      integer*4     NgAL        ! Number of good observations AL
*                                     (astrometric_n_good_obs_al) (G9)
      integer*4     NgAC        ! Number of good observations AC
*                                     (astrometric_n_good_obs_ac) (G9)
      integer*4     NbAL        ! Number of bad observations AL
*                                     (astrometric_n_bad_obs_al) (G10)
      integer*4     NbAC        ! Number of bad observations AC
*                                     (astrometric_n_bad_obs_ac) (G10)
      real*8        DQ          ! ?=- Hipparcos/Gaia data discrepancy
*                                     (Hipparcos subset of TGAS only)
*                                     (astrometric_delta_q) (G11)
      real*4        epsi        ! (mas) Excess noise of the source
*                                     (astrometric_excess_noise) (G12)
      real*4        sepsi       ! [] Significance of excess noise
*                                     (astrometric_excess_noise_sig) (G13)
      integer*4     APF         ! [0/1] Primary or secondary
*                                     (astrometric_primary_flag) (G14)
      real*4        ARF         ! Relegation factor
*                                     (astrometric_relegation_factor)
      real*8        WAL         ! (mas-2) Mean astrometric weight of the source in
*                                     the AL direction (astrometric_weight_al)
      real*4        WAC         ! (mas-2) ? Mean astrometric weight of the source in
*                                     the AC direction (astrometric_weight_ac)
      integer*4     Apr         ! [0/6] Type of prior used in in the
*                                     astrometric solution
*                                     (astrometric_priors_used) (G15)
      integer*4     MatchObs    ! Amount of observations matched to this
*                                     source (matched_observations) (G16)
      integer*4     Dup         ! [0/1] Source with duplicate sources
*                                     (duplicated_source) (G17)
      real*4        sK1         ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k1) (G18)
      real*4        sK2         ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k2) (G18)
      real*4        sK3         ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k3) (G18)
      real*4        sK4         ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k4) (G18)
      real*8        mK1         ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k1) (G19)
      real*8        mK2         ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k2) (G19)
      real*8        mK3         ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k3) (G19)
      real*8        mK4         ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k4) (G19)
      integer*4     o__Gmag_    ! Number of observations contributing to G
*                                     photometry (phot_g_n_obs)
      real*4        v_FG_       ! (e-/s) G-band mean flux (phot_g_mean_flux)
      real*4        e__FG_      ! (e-/s) Error on G-band mean flux
*                                     (phot_g_mean_flux_error)
      real*4        v_Gmag_     ! (mag) G-band mean magnitude
*                                     (phot_g_mean_mag) (G20)
      character*13  Var         ! Photometric variability flag
*                                     (phot_variable_flag) (G21)
      real*8        GLON        ! (deg) Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT        ! (deg) Galactic latitude at epoch 2015.0 (b)
      real*8        ELON        ! (deg) Ecliptic longitude at epoch 2015.0 (ecl_lon)
      real*8        ELAT        ! (deg) Ecliptic latitude at epoch 2015.0 (ecl_lat)

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

C  Declarations for 'tgas.dat'	! TGAS: Subset of GaiaSource comprising those
                               stars in the Hipparcos and Tycho-2 Catalogues
                               for which a full 5-parameter astrometric
                               solution has been possible in Gaia Data
                               Release (TgasSource)

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

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      integer*4     HIP         ! ?=- Hipparcos identifier (hip)
      character*12  TYC2        ! Tycho 2 identifier (tycho2_id)
      integer*8     SolID_1     ! Solution ID (solution_id) (G1)
      integer*8     Source_1    ! Source ID (source_id) (G2)
      integer*4     RandomI_1   ! Random index used to select subsets
*                                      (random_index) (G3)
      real*4        Epoch_1     ! (yr) [2015.0] Reference epoch in Julian years
*                                      (ref_epoch) (G4)
      real*8        RAdeg_1     ! (deg) Right ascension (ICRS) at epoch 2015.0 (ra)
      real*4        e_RAdeg_1   ! (mas) Standard error of right ascension
*                                      (ra_error)
      real*8        DEdeg_1     ! (deg) Declination (ICRS) at epoch 2015.0 (dec)
      real*4        e_DEdeg_1   ! (mas) Standard error of declination (dec_error)
      real*4        Plx_1       ! (mas) Absolute barycentric stellar parallax of
*                                      the source at the reference epoch Epoch
*                                      (parallax)
      real*4        e_Plx_1     ! (mas) Standard error of parallax (parallax_error)
      real*8        pmRA_1      ! (mas/yr) Proper motion in right ascension direction
*                                       (pmRA) (G5)
      real*4        e_pmRA_1    ! (mas/yr) Standard error of proper motion in right
*                                       ascension direction (pmra_error)
      real*8        pmDE_1      ! (mas/yr) Proper motion in declination direction
*                                      (pmdec) (G6)
      real*4        e_pmDE_1    ! (mas/yr) Standard error of proper motion in
*                                      declination direction (pmdec_error)
      real*4        RADEcor_1   ! Correlation between right ascension and
*                                      declination (ra_dec_corr)
      real*4        RAPlxcor_1  ! Correlation between right ascension and
*                                      parallax (ra_parallax_corr)
      real*4        RApmRAcor_1 ! Correlation between right ascension and
*                                      proper motion in right ascension
*                                      (ra_pmra_corr)
      real*4        RApmDEcor_1 ! Correlation between right ascension and
*                                      proper motion in declination
*                                      (ra_pmdec_corr)
      real*4        DEPlxcor_1  ! Correlation between declination and
*                                      parallax (dec_parallax_corr)
      real*4        DEpmRAcor_1 ! Correlation between declination and
*                                      proper motion in right ascension
*                                      (dec_pmra_corr)
      real*4        DEpmDEcor_1 ! Correlation between declination and
*                                      proper motion in declination
*                                      (dec_pmdec_corr)
      real*4        PlxpmRAcor_1 ! Correlation between parallax and proper
*                                      motion in right ascension
*                                      (parallax_pmra_corr)
      real*4        PlxpmDEcor_1 ! Correlation between parallax and proper
*                                      motion in declination
*                                      (parallax_pmdec_corr)
      real*4        pmRApmDEcor_1 ! Correlation between proper motion in
*                                      right ascension and proper motion in
*                                      declination (pmra_pmdec_corr)
      integer*4     NAL_1       ! Total number of observations AL
*                                      (astrometric_n_obs_al) (G7)
      integer*4     NAC_1       ! Total number of observations AC
*                                      (astrometric_n_obs_ac) (G8)
      integer*4     NgAL_1      ! Number of good observations AL
*                                      (astrometric_n_good_obs_al) (G9)
      integer*4     NgAC_1      ! Number of good observations AC
*                                      (astrometric_n_good_obs_ac) (G9)
      integer*4     NbAL_1      ! Number of bad observations AL
*                                      (astrometric_n_bad_obs_al) (G10)
      integer*4     NbAC_1      ! Number of bad observations AC
*                                      (astrometric_n_bad_obs_ac) (G10)
      real*8        DQ_1        ! ?=- Hipparcos/Gaia data discrepancy
*                                      (Hipparcos subset of TGAS only)
*                                      (astrometric_delta_q) (G11)
      real*4        epsi_1      ! (mas) Excess noise of the source
*                                      (astrometric_excess_noise) (G12)
      real*4        sepsi_1     ! Significance of excess noise
*                                      (astrometric_excess_noise_sig) (G13)
      integer*4     APF_1       ! [1] Primary or secondary
*                                      (astrometric_primary_flag) (G14)
      real*4        ARF_1       ! Relegation factor
*                                      (astrometric_relegation_factor)
      real*8        WAL_1       ! (mas-2) Mean astrometric weight of the source in
*                                      the AL direction (astrometric_weight_al)
      real*4        WAC_1       ! (mas-2) ? Mean astrometric weight of the source in
*                                      the AC direction (astrometric_weight_ac)
      integer*4     Apr_1       ! [3/5] Type of prior used in in the
*                                      astrometric solution
*                                      (astrometric_priors_used) (G15)
      integer*4     MatchObs_1  ! Amount of observations matched to this
*                                      source (matched_observations) (G16)
      integer*4     Dup_1       ! [0/1] Source with duplicate sources
*                                      (duplicated_source) (G17)
      real*4        sK1_1       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k1) (G18)
      real*4        sK2_1       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k2) (G18)
      real*4        sK3_1       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k3) (G18)
      real*4        sK4_1       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k4) (G18)
      real*8        mK1_1       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k1) (G19)
      real*8        mK2_1       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k2) (G19)
      real*8        mK3_1       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k3) (G19)
      real*8        mK4_1       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k4) (G19)
      integer*4     o__Gmag__1  ! Number of observations contributing to G
*                                      photometry (phot_g_n_obs)
      real*8        v_FG__1     ! (e-/s) G-band mean flux (phot_g_mean_flux)
      real*8        e__FG__1    ! (e-/s) Error on G-band mean flux
*                                      (phot_g_mean_flux_error)
      real*4        v_Gmag__1   ! (mag) G-band mean magnitude
*                                      (phot_g_mean_mag) (G20)
      character*13  Var_1       ! Photometric variability flag
*                                      (phot_variable_flag) (G21)
      real*8        GLON_1      ! (deg) Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT_1      ! (deg) Galactic latitude at epoch 2015.0 (b)
      real*8        ELON_1      ! (deg) Ecliptic longitude at epoch 2015.0
*                                      (ecl_lon)
      real*8        ELAT_1      ! (deg) Ecliptic latitude at epoch 2015.0 (ecl_lat)

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

C  Declarations for 'tgasptyc.dat'	! TGAS supplement with BT and VT magnitudes

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

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      integer*4     HIP_1       ! ?=- Hipparcos identifier (hip)
      character*12  TYC2_1      ! Tycho 2 identifier (tycho2_id)
      integer*8     SolID_2     ! Solution ID (solution_id) (G1)
      integer*8     Source_2    ! Source ID (source_id) (G2)
      integer*4     RandomI_2   ! Random index used to select subsets
*                                      (random_index) (G3)
      real*4        Epoch_2     ! (yr) [2015.0] Reference epoch in Julian years
*                                      (ref_epoch) (G4)
      real*8        RAdeg_2     ! (deg) Right ascension (ICRS) at epoch 2015.0 (ra)
      real*4        e_RAdeg_2   ! (mas) Standard error of right ascension
*                                      (ra_error)
      real*8        DEdeg_2     ! (deg) Declination (ICRS) at epoch 2015.0 (dec)
      real*4        e_DEdeg_2   ! (mas) Standard error of declination (dec_error)
      real*4        Plx_2       ! (mas) Absolute barycentric stellar parallax of
*                                      the source at the reference epoch Epoch
*                                      (parallax)
      real*4        e_Plx_2     ! (mas) Standard error of parallax (parallax_error)
      real*8        pmRA_2      ! (mas/yr) Proper motion in right ascension direction
*                                       (pmRA) (G5)
      real*4        e_pmRA_2    ! (mas/yr) Standard error of proper motion in right
*                                       ascension direction (pmra_error)
      real*8        pmDE_2      ! (mas/yr) Proper motion in declination direction
*                                      (pmdec) (G6)
      real*4        e_pmDE_2    ! (mas/yr) Standard error of proper motion in
*                                      declination direction (pmdec_error)
      real*4        RADEcor_2   ! Correlation between right ascension and
*                                      declination (ra_dec_corr)
      real*4        RAPlxcor_2  ! Correlation between right ascension and
*                                      parallax (ra_parallax_corr)
      real*4        RApmRAcor_2 ! Correlation between right ascension and
*                                      proper motion in right ascension
*                                      (ra_pmra_corr)
      real*4        RApmDEcor_2 ! Correlation between right ascension and
*                                      proper motion in declination
*                                      (ra_pmdec_corr)
      real*4        DEPlxcor_2  ! Correlation between declination and
*                                      parallax (dec_parallax_corr)
      real*4        DEpmRAcor_2 ! Correlation between declination and
*                                      proper motion in right ascension
*                                      (dec_pmra_corr)
      real*4        DEpmDEcor_2 ! Correlation between declination and
*                                      proper motion in declination
*                                      (dec_pmdec_corr)
      real*4        PlxpmRAcor_2 ! Correlation between parallax and proper
*                                      motion in right ascension
*                                      (parallax_pmra_corr)
      real*4        PlxpmDEcor_2 ! Correlation between parallax and proper
*                                      motion in declination
*                                      (parallax_pmdec_corr)
      real*4        pmRApmDEcor_2 ! Correlation between proper motion in
*                                      right ascension and proper motion in
*                                      declination (pmra_pmdec_corr)
      integer*4     NAL_2       ! Total number of observations AL
*                                      (astrometric_n_obs_al) (G7)
      integer*4     NAC_2       ! Total number of observations AC
*                                      (astrometric_n_obs_ac) (G8)
      integer*4     NgAL_2      ! Number of good observations AL
*                                      (astrometric_n_good_obs_al) (G9)
      integer*4     NgAC_2      ! Number of good observations AC
*                                      (astrometric_n_good_obs_ac) (G9)
      integer*4     NbAL_2      ! Number of bad observations AL
*                                      (astrometric_n_bad_obs_al) (G10)
      integer*4     NbAC_2      ! Number of bad observations AC
*                                      (astrometric_n_bad_obs_ac) (G10)
      real*8        DQ_2        ! ?=- Hipparcos/Gaia data discrepancy
*                                      (Hipparcos subset of TGAS only)
*                                      (astrometric_delta_q) (G11)
      real*4        epsi_2      ! (mas) Excess noise of the source
*                                      (astrometric_excess_noise) (G12)
      real*4        sepsi_2     ! Significance of excess noise
*                                      (astrometric_excess_noise_sig) (G13)
      integer*4     APF_2       ! [1] Primary or secondary
*                                      (astrometric_primary_flag) (G14)
      real*4        ARF_2       ! Relegation factor
*                                      (astrometric_relegation_factor)
      real*8        WAL_2       ! (mas-2) Mean astrometric weight of the source in
*                                      the AL direction (astrometric_weight_al)
      real*4        WAC_2       ! (mas-2) ? Mean astrometric weight of the source in
*                                      the AC direction (astrometric_weight_ac)
      integer*4     Apr_2       ! [3/5] Type of prior used in in the
*                                      astrometric solution
*                                      (astrometric_priors_used) (G15)
      integer*4     MatchObs_2  ! Amount of observations matched to this
*                                      source (matched_observations) (G16)
      integer*4     Dup_2       ! [0/1] Source with duplicate sources
*                                      (duplicated_source) (G17)
      real*4        sK1_2       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k1) (G18)
      real*4        sK2_2       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k2) (G18)
      real*4        sK3_2       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k3) (G18)
      real*4        sK4_2       ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k4) (G18)
      real*8        mK1_2       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k1) (G19)
      real*8        mK2_2       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k2) (G19)
      real*8        mK3_2       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k3) (G19)
      real*8        mK4_2       ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k4) (G19)
      integer*4     o__Gmag__2  ! Number of observations contributing to G
*                                      photometry (phot_g_n_obs)
      real*8        v_FG__2     ! (e-/s) G-band mean flux (phot_g_mean_flux)
      real*8        e__FG__2    ! (e-/s) Error on G-band mean flux
*                                      (phot_g_mean_flux_error)
      real*4        v_Gmag__2   ! (mag) G-band mean magnitude
*                                      (phot_g_mean_mag) (G20)
      character*13  Var_2       ! Photometric variability flag
*                                      (phot_variable_flag) (G21)
      real*8        GLON_2      ! (deg) Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT_2      ! (deg) Galactic latitude at epoch 2015.0 (b)
      real*8        ELON_2      ! (deg) Ecliptic longitude at epoch 2015.0
*                                      (ecl_lon)
      real*8        ELAT_2      ! (deg) Ecliptic latitude at epoch 2015.0 (ecl_lat)
      character*12  TYC         ! TYC2 or TYC1 designation
      real*4        BTmag       ! (mag) ? Tycho-2 or HIP BT magnitude
      real*4        e_BTmag     ! (mag) ? rms uncertainty on BTmag
      real*4        VTmag       ! (mag) ? Tycho-2 or HIP VT magnitude
      real*4        e_VTmag     ! (mag) ? rms uncertainty on VTmag

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

C  Declarations for 'varsum.dat'	! Variability summary of sources with
                               phot_variable_flag = "VARIABLE" in the
                               GaiaSource table (VariableSummary)

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

      integer*8     SolID_3     ! Solution ID (solution_id) (G1)
      integer*8     Source_3    ! Source ID (source_id) (G2)
      real*4        F1          ! (d-1) Fundamental frequency 1
*                                   (phot_variable_fundam_freq1) (1)
      character*5   Class       ! Photometric variability classification
*                                   (classification) (2)
*Note (1): Identified 1st fundamental frequencies in the photometric G band,
*  copied from either the cepheid,dat or rrlyrae.dat table depending on the
*  value of classification.
*Note (2): Photometric variability classification for the types included in this
*  data release: "RRLYR" (RR Lyrae) or "CEP" (Cepheid). The tables cepheid.dat
*  and rrlyrae.dat contain detailed results for each type.

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

C  Declarations for 'cepheid.dat'	! Cepheid stars identified in table
                               VariableSummary as classification="CEP"

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

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      character*5   TBest       ! Best type classification
*                                  (type_best_classification) (1)
      character*6   TBest2      ! Best subclassification estimate
*                                  (type2_best_sub_classification) (2)
      character*14  Mbest       ! Best mode classification estimate
*                                  (mode_best_classification) (3)
      character*18  SolID_4     ! Solution ID (solution_id) (G1)
      character*19  Source_4    ! Source ID (source_id) (G2)
      real*8        P1          ! (d) Period (p1) (G22)
      real*8        e_P1        ! (d) rms uncertainty on P1 (e_p1) (G23)
      real*8        EpG         ! (d) Epoch of the maximum of the light curve in
*                                  the G band (epoch_g) (G24)
      real*8        e_EpG       ! (d) Uncertainty on the epoch parameter EpG
*                                  (epoch_g_error) (G25)
      real*8        v_Gmag__3   ! (mag) Intensity-averaged magnitude in the G band
*                                  (int_average_g) (G26)
      real*4        e__Gmag_    ! (mag) Uncertainty on <Gmag> (int_average_g_error)
*                                  (G27)
      real*4        AmpG        ! (mag) Peak-to-peak amplitude of the G band light
*                                  curve (peak_to_peak_g) (G28)
      real*4        e_AmpG      ! (mag) Uncertainty on AmpG (peak_to_peak_g_error)
*                                  (G29)
      integer*4     NHP1        ! Number of harmonics used to model P1 of the
*                                  light curve (num_harmonics_for_p1_) (G30)
      real*4        R21G        ! ?=- Fourier decomposition parameter R21=A2/A1
*                                  (for G band) (r21_g) (G31)
      real*4        e_R21G      ! ?=- Uncertainty on R21G (r21_g_error) (G32)
      real*4        phi21G      ! ?=- Fourier decomposition parameter
*                                  phi21=phi2-2*phi1 (for G band)  (G33)
      real*4        e_phi21G    ! ?=- Uncertainty on phi21G (phi21_g_error)
      real*8        RAdeg_3     ! (deg) Right ascension (ICRS) at epoch 2015.0
      real*8        DEdeg_3     ! (deg) Declination (ICRS) at epoch 2015.0
*Note (1): Best type classification estimate out of: "DCEP", "T2CEP", "ACEP"
*  (type best classification): Classification of a Cepheid into DCEP, T2CEP or
*  ACEP using the period-luminosity relations, which are different for the three
*  different types of Cepheids.
*Note (2): Best subclassification estimate for type best classification="T2CEP"
*  out of: "BL HER", "W VIR","RV TAU" (type2 best sub classification):
*    Sub-classification of a T2CEP Cepheids into BL Herculis, W Virginis or
*      RV Tauris sub-types depending on the source periodicity.
*Note (3): Best mode classification estimate as follows:
* FUNDAMENTAL = fundamental mode for type best classification="DCEP" or "ACEP"
* FIRST OVERTONE = first overtone for type best classification="DCEP" or "ACEP"
* SECOND OVERTONE = second overtone for type best classification="DCEP" or "ACEP"
* UNDEFINED = if mode could not be clearly determined for type best
*   classification="DCEP" or "ACEP"
* NOT APPLICABLE = when type best classification="T2CEP" Cepheid pulsation mode
*  is assigned using the period-luminosity relations, which are different for the
*  various pulsation modes, and the plot of the Fourier parameter R21 vs P1.

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

C  Declarations for 'rrlyrae.dat'	! RRLyrae stars identified in table
                               VariableSummary as
                               classification="RRLYR" (Rrlyrae)

      integer*4 nr__5
      parameter (nr__5=2595)	! Number of records
      character*183 ar__5  	! Full-size record

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      character*4   TBest_1     ! Best RR Lyrae classification estimate
*                                  (best_classification) (1)
      integer*8     SolID_5     ! Solution ID (solution_id) (G1)
      integer*8     Source_5    ! Source ID (source_id) (G2)
      real*8        P1_1        ! (d) Period (p1) (G22)
      real*8        e_P1_1      ! (d) rms uncertainty on P1 (e_p1) (G23)
      real*8        EpG_1       ! (d) Epoch of the maximum of the light curve in
*                                  the G band (epoch_g) (G24)
      real*8        e_EpG_1     ! (d) Uncertainty on the epoch parameter EpG
*                                  (epoch_g_error) (G25)
      real*4        v_Gmag__4   ! (mag) Intensity-averaged magnitude in the G band
*                                  (int_average_g) (G26)
      real*4        e__Gmag__1  ! (mag) Uncertainty on <Gmag> (int_average_g_error)
*                                  (G27)
      real*4        AmpG_1      ! (mag) Peak-to-peak amplitude of the G band light
*                                  curve (peak_to_peak_g) (G28)
      real*4        e_AmpG_1    ! (mag) Uncertainty on AmpG (peak_to_peak_g_error)
*                                  (G29)
      integer*4     NHP1_1      ! [1/8] Number of harmonics used to model P1 of
*                                  the light curve (num_harmonics_for_p1_) (G30)
      real*8        R21G_1      ! ?=- Fourier decomposition parameter R21=A2/A1
*                                  (for G band) (r21_g) (G31)
      real*8        e_R21G_1    ! ?=- Uncertainty on R21G (r21_g_error) (G32)
      real*8        phi21G_1    ! ?=- Fourier decomposition parameter
*                                  phi21=phi2-2*phi1 (for G band)  (G33)
      real*8        e_phi21G_1  ! ?=- Uncertainty on phi21G (phi21_g_error)
      real*8        RAdeg_4     ! (deg) Right ascension (ICRS) at epoch 2015.0
      real*8        DEdeg_4     ! (deg) Declination (ICRS) at epoch 2015.0
*Note (1): Classification of an RR Lyrae star according to the pulsation mode:
*  RRc for first overtone and RRab for fundamental mode, obtained using the
*  period-amplitude diagram in the G-band and the plots of the Fourier
*  parameters R21 and Phi2 vs period.

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

C  Declarations for 'fovparam.dat'	! *Statistical parameters of field-of-view time
                               series
                               (PhotVariableTimeSeriesGfovStatisticalParameters)

      integer*4 nr__6
      parameter (nr__6=3194)	! Number of records
      character*131 ar__6  	! Full-size record

      integer*8     SolID_6     ! Solution ID (solution_id) (G1)
      integer*8     Source_6    ! Source ID (source_id) (G2)
      integer*4     Nobs        ! Number of processed G-band observations for
*                                   variability analyses
*                                   (num_observations_processed) (1)
      real*8        ObsTime     ! (d) Mean observation time (with respect to T0) of
*                                   G-band time series (mean_obs_time) (2)
      real*4        b_Gmag      ! (mag) Minimum magnitude of the G-band time series
*                                   (minimum)
      real*4        B_Gmag_1    ! (mag) Maximum magnitude of the G-band time series
*                                   (maximum)
      real*4        v_Gmag__5   ! (mag) Mean magnitude of the G-band time series
*                                   (mean)
      real*4        GmagMed     ! (mag) Median magnitude of the G-band time series
*                                   (median)
      real*4        Range       ! (mag) Difference between the highest and lowest
*                                   magnitude of the G-band time series (range)
      real*4        stddev      ! (mag) Square root of the unweighted variance of the
*                                   G-band time series values (std_dev)
      real*4        Ske         ! Standardized unweighted skewness of the G-band
*                                   time series values (skewness)
      real*4        Kur         ! Standardized unweighted kurtosis of the G-band
*                                   time series values (kurtosis)
      real*4        Dur         ! (d) Time duration of the G-band time series
*                                   (time_duration)
      real*4        MAD         ! (mag) Median Absolute Deviation of the G-band time
*                                   series values
*                                   (median_absolute_deviation)
      real*4        Abbe        ! Abbe value of the G-band time series
*                                   values (3)
      real*4        IQR         ! (mag) Interquartile range of the time series
*                                   values (4)
*Note (1): The number of processed observations for variability analyses of this
*  source.
*Note (2): Gaia barycentric light-travel time corrected FOV observation times
* with respect to reference time T0=2455197.5days (=J2010.0=2010-01-01T00:00:00).
*Note (3): Let {t_i_, y_i_} be a time-sorted time series of size N, such that
* t_i_<t_i+1_ for all i<N. The Abbe value A is defined as
* A=[N/2(N-1)]/[{Sigma}{i=1,N-1}((y_i+1_-y_i_)^2^/[{Sigma}{i=1,N-}{y_i_-<y>)]
* where <y> is the unweighted mean.
*Note (4): The difference between the (unweighted) 75th and 25th percentile
* values: IQR=P_75_-P_25_.

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

C  Declarations for 'fov.dat'	! Photometric variable time series G
                               field-of-view (PhotVariableTimeSeriesGfov)

      integer*4 nr__7
      parameter (nr__7=233181)	! Number of records
      character*87 ar__7  	! Full-size record

      integer*8     SolID_7     ! Solution ID (solution_id) (G1)
      integer*8     Source_7    ! Source ID (source_id) (G2)
      real*8        ObsTime_1   ! (d) Barycentric light-travel time corrected
*                                   timestamp for each FOV observation
*                                   (observation_time) (1)
      real*8        FG          ! (e-/s) G-band flux for each FOV observation (g_flux)
      real*8        e_FG        ! (e-/s) Estimated G-band flux uncertainty for each
*                                   FOV observation (g_flux_error)
      real*4        Gmag        ! (mag) G-band magnitude for each FOV observation
*                                   (g_magnitude) (2)
      integer*4     Rej         ! [0/1] 1 (true) when this FOV observation was
*                                   excluded from variability analyses
*                                   (rejected_by_variability_processing) (3)
*Note (1): Field-of-view transit averaged observation time in units of
*  Barycentric JD (in TCB) in days -2455197.5, computed as follows. First the
*  observation time is converted from On-board Mission Time (OBMT) into
*  Julian date in TCB (Temps Coordonnee Barycentrique). Next a correction
*  is applied for the light-travel time to the Solar system barycentre,
*  resulting in Barycentric Julian Date (BJD). Finally, an offset of
*  2455197.5 days is applied (corresponding to a reference time T_0 at
*  2010-01-01T00:00:00) to have a conveniently small numerical value.
*  Although the centroiding time accuracy of the individual CCD
*  observations is (much) below 1 ms, this per-FoV observation time is
*  averaged over typically 9 CCD observations taken in a time range of
*  about 44 sec.
*Note (2): G-band magnitude for the field-of-view transit observation, computed
*  from the FG field using magnitude zero-point defined in ExtPhotZeroPoint.
*Note (3): Observations with this flag true (1) have been excluded from the
*  variability result in tables varsum.dat, cepheid.dat, rrlyrae.dat, and
*  fovparam.dat.

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

C  Declarations for 'qso.dat'	! *Auxilliary Quasar Solution for the QSOs that
                               were matched to ICRF2 sources (qso_icrf2)

      integer*4 nr__8
      parameter (nr__8=2191)	! Number of records
      character*125 ar__8  	! Full-size record

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      integer*8     SolID_8     ! Solution ID (solution_id) (G1)
      integer*8     Source_8    ! Source ID (source_id) (G2) (1)
      real*4        Epoch_3     ! (yr) [2015.0] Reference epoch in Julian years
*                                   (ref_epoch) (G4)
      real*8        RAdeg_5     ! (deg) Right ascension (ICRS) at epoch 2015.0
*                                   (ra) (1)
      real*4        e_RAdeg_3   ! (mas) Standard error of right ascension
*                                   (ra_error)
      real*8        DEdeg_5     ! (deg) Declination (ICRS) at epoch 2015.0 (dec) (2)
      real*4        e_DEdeg_3   ! (mas) Standard error of declination (dec_error)
      real*4        RADEcor_3   ! Correlation between right ascension and
*                                   declination (ra_dec_corr)
      real*4        v_Gmag__6   ! (mag) ? G-band mean magnitude
*                                   (phot_g_mean_mag) (G20) (3)
      integer*4     Apr_3       ! [3/6] Type of prior used in in the astrometric
*                                   solution (astrometric_priors_used) (G15)
      character*16  ICRF2       ! ICRF2 designation of the source matched to
*                                   this Gaia source (HHMMSS.s+DDMMSS)
*                                   (icrf2_match)
      integer*4     Frot        ! [0/3] Rotation flag (rot_flag) (4)
*Note (1): 111 sources in this table are not present in the gaia_source
*  table in the Gaia Data Release 1.
*Note (2): RA and DE does not match exactly for the same source between this
*  dataset and the gaia source table in the Gaia Data Release 1. Although both
*  datasets are based on the same original data, they have been generated from
*  two separate astrometric solutions.
*Note (3): null values for 39 sources for which CU5 photometry is not available.
*Note (4): Flag indicating how this source was used to fix the orientation of the
*           reference frame of the Gaia DR1 solution as follows:
*            0 = Not used
*            1 = Only right ascention is used
*            2 = Only declination is used
*            3 = Both right ascention and declination are used

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

C  Loading file 'gaia.sam'	! Sample of GaiaSource data

C  Format for file interpretation

    1 format(
     +  F14.10,1X,F14.10,1X,I19,1X,I19,1X,I10,1X,F6.1,1X,F6.3,1X,F6.3,
     +  1X,F6.2,1X,F4.2,1X,F9.3,1X,F6.3,1X,F9.3,1X,F6.3,1X,F6.3,1X,
     +  F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,I4,1X,I4,1X,I4,1X,I4,1X,I4,1X,I3,1X,F8.2,1X,F5.2,
     +  1X,E10.3,1X,I1,1X,F6.2,1X,F7.3,1X,E9.3,1X,I1,1X,I3,1X,I1,1X,
     +  F5.3,1X,F5.3,1X,F5.3,1X,F5.3,1X,F13.8,1X,F12.8,1X,F12.8,1X,
     +  F12.8,1X,I4,1X,E11.5,1X,E11.5,1X,F6.3,1X,A13,1X,F14.10,1X,
     +  F14.10,1X,F14.10,1X,F14.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'gaia.sam')
      write(6,*) '....Loading file: gaia.sam'
      do i__=1,1000
        read(1,'(A494)')ar__
        read(ar__,1)
     +  RAdeg,DEdeg,SolID,Source,RandomI,Epoch,e_RAdeg,e_DEdeg,Plx,
     +  e_Plx,pmRA,e_pmRA,pmDE,e_pmDE,RADEcor,RAPlxcor,RApmRAcor,
     +  RApmDEcor,DEPlxcor,DEpmRAcor,DEpmDEcor,PlxpmRAcor,PlxpmDEcor,
     +  pmRApmDEcor,NAL,NAC,NgAL,NgAC,NbAL,NbAC,DQ,epsi,sepsi,APF,ARF,
     +  WAL,WAC,Apr,MatchObs,Dup,sK1,sK2,sK3,sK4,mK1,mK2,mK3,mK4,
     +  o__Gmag_,v_FG_,e__FG_,v_Gmag_,Var,GLON,GLAT,ELON,ELAT
        if(ar__(103:108) .EQ. '') Plx = rNULL__
        if(ar__(110:113) .EQ. '') e_Plx = rNULL__
        if(ar__(115:123) .EQ. '') pmRA = rNULL__
        if(ar__(125:130) .EQ. '') e_pmRA = rNULL__
        if(ar__(132:140) .EQ. '') pmDE = rNULL__
        if(ar__(142:147) .EQ. '') e_pmDE = rNULL__
        if(ar__(156:161) .EQ. '') RAPlxcor = rNULL__
        if(ar__(163:168) .EQ. '') RApmRAcor = rNULL__
        if(ar__(170:175) .EQ. '') RApmDEcor = rNULL__
        if(ar__(177:182) .EQ. '') DEPlxcor = rNULL__
        if(ar__(184:189) .EQ. '') DEpmRAcor = rNULL__
        if(ar__(191:196) .EQ. '') DEpmDEcor = rNULL__
        if(ar__(198:203) .EQ. '') PlxpmRAcor = rNULL__
        if(ar__(205:210) .EQ. '') PlxpmDEcor = rNULL__
        if(ar__(212:217) .EQ. '') pmRApmDEcor = rNULL__
        if (idig(ar__(248:255)).EQ.0) DQ =  rNULL__
        if(ar__(291:299) .EQ. '') WAC = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg,DEdeg,SolID,Source,RandomI,Epoch,e_RAdeg,e_DEdeg,Plx,
     +  e_Plx,pmRA,e_pmRA,pmDE,e_pmDE,RADEcor,RAPlxcor,RApmRAcor,
     +  RApmDEcor,DEPlxcor,DEpmRAcor,DEpmDEcor,PlxpmRAcor,PlxpmDEcor,
     +  pmRApmDEcor,NAL,NAC,NgAL,NgAC,NbAL,NbAC,DQ,epsi,sepsi,APF,ARF,
     +  WAL,WAC,Apr,MatchObs,Dup,sK1,sK2,sK3,sK4,mK1,mK2,mK3,mK4,
     +  o__Gmag_,v_FG_,e__FG_,v_Gmag_,Var,GLON,GLAT,ELON,ELAT
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'tgas.dat'	! TGAS: Subset of GaiaSource comprising those
*                               stars in the Hipparcos and Tycho-2 Catalogues
*                               for which a full 5-parameter astrometric
*                               solution has been possible in Gaia Data
*                               Release (TgasSource)

C  Format for file interpretation

    2 format(
     +  I6,1X,A12,1X,I19,1X,I19,1X,I7,1X,F6.1,1X,F14.10,1X,F6.3,1X,
     +  F14.10,1X,F6.3,1X,F6.2,1X,F4.2,1X,F9.3,1X,F6.3,1X,F9.3,1X,
     +  F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F6.3,1X,F6.3,1X,I4,1X,I4,1X,I4,1X,I4,1X,I2,1X,I3,
     +  1X,F8.2,1X,F5.2,1X,E9.2,1X,I1,1X,F6.2,1X,F7.3,1X,E8.3,1X,I1,
     +  1X,I3,1X,I1,1X,F5.3,1X,F5.3,1X,F5.3,1X,F5.3,1X,F13.8,1X,F12.8,
     +  1X,F12.8,1X,F12.8,1X,I4,1X,F15.5,1X,F13.5,1X,F6.3,1X,A13,1X,
     +  F14.10,1X,F14.10,1X,F14.10,1X,F14.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tgas.dat')
      write(6,*) '....Loading file: tgas.dat'
      do i__=1,2057050
        read(1,'(A513)')ar__1
        read(ar__1,2)
     +  HIP,TYC2,SolID_1,Source_1,RandomI_1,Epoch_1,RAdeg_1,e_RAdeg_1,
     +  DEdeg_1,e_DEdeg_1,Plx_1,e_Plx_1,pmRA_1,e_pmRA_1,pmDE_1,
     +  e_pmDE_1,RADEcor_1,RAPlxcor_1,RApmRAcor_1,RApmDEcor_1,
     +  DEPlxcor_1,DEpmRAcor_1,DEpmDEcor_1,PlxpmRAcor_1,PlxpmDEcor_1,
     +  pmRApmDEcor_1,NAL_1,NAC_1,NgAL_1,NgAC_1,NbAL_1,NbAC_1,DQ_1,
     +  epsi_1,sepsi_1,APF_1,ARF_1,WAL_1,WAC_1,Apr_1,MatchObs_1,Dup_1,
     +  sK1_1,sK2_1,sK3_1,sK4_1,mK1_1,mK2_1,mK3_1,mK4_1,o__Gmag__1,
     +  v_FG__1,e__FG__1,v_Gmag__1,Var_1,GLON_1,GLAT_1,ELON_1,ELAT_1
        if (HIP .EQ. 45) HIP =  iNULL__
        if (idig(ar__1(263:270)).EQ.0) DQ_1 =  rNULL__
        if(ar__1(305:312) .EQ. '') WAC_1 = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  HIP,TYC2,SolID_1,Source_1,RandomI_1,Epoch_1,RAdeg_1,e_RAdeg_1,
     +  DEdeg_1,e_DEdeg_1,Plx_1,e_Plx_1,pmRA_1,e_pmRA_1,pmDE_1,
     +  e_pmDE_1,RADEcor_1,RAPlxcor_1,RApmRAcor_1,RApmDEcor_1,
     +  DEPlxcor_1,DEpmRAcor_1,DEpmDEcor_1,PlxpmRAcor_1,PlxpmDEcor_1,
     +  pmRApmDEcor_1,NAL_1,NAC_1,NgAL_1,NgAC_1,NbAL_1,NbAC_1,DQ_1,
     +  epsi_1,sepsi_1,APF_1,ARF_1,WAL_1,WAC_1,Apr_1,MatchObs_1,Dup_1,
     +  sK1_1,sK2_1,sK3_1,sK4_1,mK1_1,mK2_1,mK3_1,mK4_1,o__Gmag__1,
     +  v_FG__1,e__FG__1,v_Gmag__1,Var_1,GLON_1,GLAT_1,ELON_1,ELAT_1
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'tgasptyc.dat'	! TGAS supplement with BT and VT magnitudes

C  Format for file interpretation

    3 format(
     +  I6,1X,A12,1X,I19,1X,I19,1X,I7,1X,F6.1,1X,F14.10,1X,F6.3,1X,
     +  F14.10,1X,F6.3,1X,F6.2,1X,F4.2,1X,F9.3,1X,F6.3,1X,F9.3,1X,
     +  F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F6.3,1X,F6.3,1X,I4,1X,I4,1X,I4,1X,I4,1X,I2,1X,I3,
     +  1X,F8.2,1X,F5.2,1X,E9.2,1X,I1,1X,F6.2,1X,F7.3,1X,E8.3,1X,I1,
     +  1X,I3,1X,I1,1X,F5.3,1X,F5.3,1X,F5.3,1X,F5.3,1X,F13.8,1X,F12.8,
     +  1X,F12.8,1X,F12.8,1X,I4,1X,F15.5,1X,F13.5,1X,F6.3,1X,A13,1X,
     +  F14.10,1X,F14.10,1X,F14.10,1X,F14.10,1X,A12,1X,F6.3,1X,F5.3,
     +  1X,F6.3,1X,F5.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tgasptyc.dat')
      write(6,*) '....Loading file: tgasptyc.dat'
      do i__=1,2057050
        read(1,'(A552)')ar__2
        read(ar__2,3)
     +  HIP_1,TYC2_1,SolID_2,Source_2,RandomI_2,Epoch_2,RAdeg_2,
     +  e_RAdeg_2,DEdeg_2,e_DEdeg_2,Plx_2,e_Plx_2,pmRA_2,e_pmRA_2,
     +  pmDE_2,e_pmDE_2,RADEcor_2,RAPlxcor_2,RApmRAcor_2,RApmDEcor_2,
     +  DEPlxcor_2,DEpmRAcor_2,DEpmDEcor_2,PlxpmRAcor_2,PlxpmDEcor_2,
     +  pmRApmDEcor_2,NAL_2,NAC_2,NgAL_2,NgAC_2,NbAL_2,NbAC_2,DQ_2,
     +  epsi_2,sepsi_2,APF_2,ARF_2,WAL_2,WAC_2,Apr_2,MatchObs_2,Dup_2,
     +  sK1_2,sK2_2,sK3_2,sK4_2,mK1_2,mK2_2,mK3_2,mK4_2,o__Gmag__2,
     +  v_FG__2,e__FG__2,v_Gmag__2,Var_2,GLON_2,GLAT_2,ELON_2,ELAT_2,
     +  TYC,BTmag,e_BTmag,VTmag,e_VTmag
        if (HIP_1 .EQ. 45) HIP_1 =  iNULL__
        if (idig(ar__2(263:270)).EQ.0) DQ_2 =  rNULL__
        if(ar__2(305:312) .EQ. '') WAC_2 = rNULL__
        if(ar__2(528:533) .EQ. '') BTmag = rNULL__
        if(ar__2(535:539) .EQ. '') e_BTmag = rNULL__
        if(ar__2(541:546) .EQ. '') VTmag = rNULL__
        if(ar__2(548:552) .EQ. '') e_VTmag = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  HIP_1,TYC2_1,SolID_2,Source_2,RandomI_2,Epoch_2,RAdeg_2,
     +  e_RAdeg_2,DEdeg_2,e_DEdeg_2,Plx_2,e_Plx_2,pmRA_2,e_pmRA_2,
     +  pmDE_2,e_pmDE_2,RADEcor_2,RAPlxcor_2,RApmRAcor_2,RApmDEcor_2,
     +  DEPlxcor_2,DEpmRAcor_2,DEpmDEcor_2,PlxpmRAcor_2,PlxpmDEcor_2,
     +  pmRApmDEcor_2,NAL_2,NAC_2,NgAL_2,NgAC_2,NbAL_2,NbAC_2,DQ_2,
     +  epsi_2,sepsi_2,APF_2,ARF_2,WAL_2,WAC_2,Apr_2,MatchObs_2,Dup_2,
     +  sK1_2,sK2_2,sK3_2,sK4_2,mK1_2,mK2_2,mK3_2,mK4_2,o__Gmag__2,
     +  v_FG__2,e__FG__2,v_Gmag__2,Var_2,GLON_2,GLAT_2,ELON_2,ELAT_2,
     +  TYC,BTmag,e_BTmag,VTmag,e_VTmag
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'varsum.dat'	! Variability summary of sources with
*                               phot_variable_flag = "VARIABLE" in the
*                               GaiaSource table (VariableSummary)

C  Format for file interpretation

    4 format(I18,1X,I19,1X,F5.3,1X,A5)

C  Effective file loading

      open(unit=1,status='old',file=
     +'varsum.dat')
      write(6,*) '....Loading file: varsum.dat'
      do i__=1,3194
        read(1,'(A50)')ar__3
        read(ar__3,4)SolID_3,Source_3,F1,Class
c    ..............Just test output...........
        write(6,4)SolID_3,Source_3,F1,Class
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'cepheid.dat'	! Cepheid stars identified in table
*                               VariableSummary as classification="CEP"

C  Format for file interpretation

    5 format(
     +  A5,1X,A6,1X,A14,1X,A18,1X,A19,1X,F11.8,1X,F11.8,1X,F13.8,1X,
     +  F13.8,1X,F7.4,1X,F5.3,1X,F5.3,1X,F5.3,1X,I1,1X,F5.3,1X,F5.3,
     +  1X,F5.3,1X,F5.3,1X,F14.10,1X,F14.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'cepheid.dat')
      write(6,*) '....Loading file: cepheid.dat'
      do i__=1,599
        read(1,'(A200)')ar__4
        read(ar__4,5)
     +  TBest,TBest2,Mbest,SolID_4,Source_4,P1,e_P1,EpG,e_EpG,
     +  v_Gmag__3,e__Gmag_,AmpG,e_AmpG,NHP1,R21G,e_R21G,phi21G,
     +  e_phi21G,RAdeg_3,DEdeg_3
        if (idig(ar__4(148:152)).EQ.0) R21G =  rNULL__
        if (idig(ar__4(154:158)).EQ.0) e_R21G =  rNULL__
        if (idig(ar__4(160:164)).EQ.0) phi21G =  rNULL__
        if (idig(ar__4(166:170)).EQ.0) e_phi21G =  rNULL__
c    ..............Just test output...........
        write(6,5)
     +  TBest,TBest2,Mbest,SolID_4,Source_4,P1,e_P1,EpG,e_EpG,
     +  v_Gmag__3,e__Gmag_,AmpG,e_AmpG,NHP1,R21G,e_R21G,phi21G,
     +  e_phi21G,RAdeg_3,DEdeg_3
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'rrlyrae.dat'	! RRLyrae stars identified in table
*                               VariableSummary as
*                               classification="RRLYR" (Rrlyrae)

C  Format for file interpretation

    6 format(
     +  A4,1X,I18,1X,I19,1X,F10.8,1X,F10.8,1X,F13.8,1X,F10.8,1X,F6.3,
     +  1X,F5.3,1X,F5.3,1X,F5.3,1X,I1,1X,F8.6,1X,F8.6,1X,F8.6,1X,F8.6,
     +  1X,F14.10,1X,F14.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'rrlyrae.dat')
      write(6,*) '....Loading file: rrlyrae.dat'
      do i__=1,2595
        read(1,'(A183)')ar__5
        read(ar__5,6)
     +  TBest_1,SolID_5,Source_5,P1_1,e_P1_1,EpG_1,e_EpG_1,v_Gmag__4,
     +  e__Gmag__1,AmpG_1,e_AmpG_1,NHP1_1,R21G_1,e_R21G_1,phi21G_1,
     +  e_phi21G_1,RAdeg_4,DEdeg_4
        if (idig(ar__5(119:126)).EQ.0) R21G_1 =  rNULL__
        if (idig(ar__5(128:135)).EQ.0) e_R21G_1 =  rNULL__
        if (idig(ar__5(137:144)).EQ.0) phi21G_1 =  rNULL__
        if (idig(ar__5(146:153)).EQ.0) e_phi21G_1 =  rNULL__
c    ..............Just test output...........
        write(6,6)
     +  TBest_1,SolID_5,Source_5,P1_1,e_P1_1,EpG_1,e_EpG_1,v_Gmag__4,
     +  e__Gmag__1,AmpG_1,e_AmpG_1,NHP1_1,R21G_1,e_R21G_1,phi21G_1,
     +  e_phi21G_1,RAdeg_4,DEdeg_4
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'fovparam.dat'	! *Statistical parameters of field-of-view time
*                               series
*                               (PhotVariableTimeSeriesGfovStatisticalParameters)

C  Format for file interpretation

    7 format(
     +  I18,1X,I19,1X,I3,1X,F7.2,1X,F6.3,1X,F6.3,3X,F6.3,1X,F6.3,1X,
     +  F5.3,1X,F5.3,1X,F6.3,1X,F6.3,1X,F6.2,1X,F5.3,1X,F5.3,1X,F5.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'fovparam.dat')
      write(6,*) '....Loading file: fovparam.dat'
      do i__=1,3194
        read(1,'(A131)')ar__6
        read(ar__6,7)
     +  SolID_6,Source_6,Nobs,ObsTime,b_Gmag,B_Gmag_1,v_Gmag__5,
     +  GmagMed,Range,stddev,Ske,Kur,Dur,MAD,Abbe,IQR
c    ..............Just test output...........
        write(6,7)
     +  SolID_6,Source_6,Nobs,ObsTime,b_Gmag,B_Gmag_1,v_Gmag__5,
     +  GmagMed,Range,stddev,Ske,Kur,Dur,MAD,Abbe,IQR
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'fov.dat'	! Photometric variable time series G
*                               field-of-view (PhotVariableTimeSeriesGfov)

C  Format for file interpretation

    8 format(I18,1X,I19,1X,F7.2,1X,F15.5,3X,F13.5,1X,F6.3,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'fov.dat')
      write(6,*) '....Loading file: fov.dat'
      do i__=1,233181
        read(1,'(A87)')ar__7
        read(ar__7,8)SolID_7,Source_7,ObsTime_1,FG,e_FG,Gmag,Rej
c    ..............Just test output...........
        write(6,8)SolID_7,Source_7,ObsTime_1,FG,e_FG,Gmag,Rej
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'qso.dat'	! *Auxilliary Quasar Solution for the QSOs that
*                               were matched to ICRF2 sources (qso_icrf2)

C  Format for file interpretation

    9 format(
     +  I19,1X,I19,1X,F6.1,1X,F14.10,1X,F6.3,1X,F14.10,1X,F6.3,1X,
     +  F6.3,1X,F6.3,1X,I1,1X,A16,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'qso.dat')
      write(6,*) '....Loading file: qso.dat'
      do i__=1,2191
        read(1,'(A125)')ar__8
        read(ar__8,9)
     +  SolID_8,Source_8,Epoch_3,RAdeg_5,e_RAdeg_3,DEdeg_5,e_DEdeg_3,
     +  RADEcor_3,v_Gmag__6,Apr_3,ICRF2,Frot
        if(ar__8(99:104) .EQ. '') v_Gmag__6 = rNULL__
c    ..............Just test output...........
        write(6,9)
     +  SolID_8,Source_8,Epoch_3,RAdeg_5,e_RAdeg_3,DEdeg_5,e_DEdeg_3,
     +  RADEcor_3,v_Gmag__6,Apr_3,ICRF2,Frot
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