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

Conversion of standardized ReadMe file for file /./ftp/cats/I/337 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 2018-May-20
C=============================================================================
*  This code was generated from the ReadMe file documenting a catalogue
*  according to the "Standard for Documentation of Astronomical Catalogues"
*  currently in use by the Astronomical Data Centers (CDS, ADC, A&A)
*  (see full documentation at URL http://vizier.u-strasbg.fr/doc/catstd.htx)
*  Please report problems or questions to   
C=============================================================================

      implicit none
*  Unspecified or NULL values, generally corresponding to blank columns,
*  are assigned one of the following special values:
*     rNULL__    for unknown or NULL floating-point values
*     iNULL__    for unknown or NULL   integer      values
      real*4     rNULL__
      integer*4  iNULL__
      parameter  (rNULL__=--2147483648.)  	! NULL real number
      parameter  (iNULL__=(-2147483647-1))	! NULL int  number
      integer    idig			! testing NULL number

C=============================================================================
Cat. 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      (nr__) ! (deg) Right ascension (ICRS) at epoch 2015.0 (ra)
      real*8        DEdeg      (nr__) ! (deg) Declination (ICRS) at epoch 2015.0 (dec)
      integer*8     SolID      (nr__) ! Solution ID (solution_id) (G1)
      integer*8     Source     (nr__) ! Source ID (source_id) (G2)
      integer*8     RandomI    (nr__) ! Random index used to select subsets
*                                     (random_index) (G3)
      real*4        Epoch      (nr__) ! (yr) [2015.0] Reference epoch in Julian years
*                                     (ref_epoch) (G4)
      real*4        e_RAdeg    (nr__) ! (mas) Standard error of right ascension
*                                     (ra_error)
      real*4        e_DEdeg    (nr__) ! (mas) Standard error of declination (dec_error)
      real*4        Plx        (nr__) ! (mas) ? Absolute barycentric stellar parallax of
*                                    the source at the reference epoch Epoch
*                                     (parallax)
      real*4        e_Plx      (nr__) ! (mas) ? Standard error of parallax
*                                     (parallax_error)
      real*8        pmRA       (nr__) ! (mas/yr) ? Proper motion in right ascension direction
*                                     (pmRA) (G5)
      real*4        e_pmRA     (nr__) ! (mas/yr) ? Standard error of proper motion in right
*                                     ascension direction (pmra_error)
      real*8        pmDE       (nr__) ! (mas/yr) ? Proper motion in declination direction
*                                     (pmdec) (G6)
      real*4        e_pmDE     (nr__) ! (mas/yr) ? Standard error of proper motion in
*                                     declination direction (pmdec_error)
      real*4        RADEcor    (nr__) ! Correlation between right ascension and
*                                     declination (ra_dec_corr)
      real*4        RAPlxcor   (nr__) ! ? Correlation between right ascension and
*                                     parallax (ra_parallax_corr)
      real*4        RApmRAcor  (nr__) ! ? Correlation between right ascension and
*                                     proper motion in right ascension
*                                     (ra_pmra_corr)
      real*4        RApmDEcor  (nr__) ! ? Correlation between right ascension and
*                                     proper motion in declination
*                                     (ra_pmdec_corr)
      real*4        DEPlxcor   (nr__) ! ? Correlation between declination and
*                                     parallax (dec_parallax_corr)
      real*4        DEpmRAcor  (nr__) ! ? Correlation between declination and
*                                     proper motion in right ascension
*                                     (dec_pmra_corr)
      real*4        DEpmDEcor  (nr__) ! ? Correlation between declination and
*                                     proper motion in declination
*                                     (dec_pmdec_corr)
      real*4        PlxpmRAcor (nr__) ! ? Correlation between parallax and proper
*                                     motion in right ascension
*                                     (parallax_pmra_corr)
      real*4        PlxpmDEcor (nr__) ! ? Correlation between parallax and proper
*                                     motion in declination
*                                     (parallax_pmdec_corr)
      real*4        pmRApmDEcor(nr__) ! ? Correlation between proper motion in
*                                     right ascension and proper motion in
*                                     declination (pmra_pmdec_corr)
      integer*4     NAL        (nr__) ! Total number of observations AL
*                                     (astrometric_n_obs_al) (G7)
      integer*4     NAC        (nr__) ! Total number of observations AC
*                                     (astrometric_n_obs_ac) (G8)
      integer*4     NgAL       (nr__) ! Number of good observations AL
*                                     (astrometric_n_good_obs_al) (G9)
      integer*4     NgAC       (nr__) ! Number of good observations AC
*                                     (astrometric_n_good_obs_ac) (G9)
      integer*4     NbAL       (nr__) ! Number of bad observations AL
*                                     (astrometric_n_bad_obs_al) (G10)
      integer*4     NbAC       (nr__) ! Number of bad observations AC
*                                     (astrometric_n_bad_obs_ac) (G10)
      real*8        DQ         (nr__) ! ?=- Hipparcos/Gaia data discrepancy
*                                     (Hipparcos subset of TGAS only)
*                                     (astrometric_delta_q) (G11)
      real*4        epsi       (nr__) ! (mas) Excess noise of the source
*                                     (astrometric_excess_noise) (G12)
      real*4        sepsi      (nr__) ! [] Significance of excess noise
*                                     (astrometric_excess_noise_sig) (G13)
      integer*4     APF        (nr__) ! [0/1] Primary or secondary
*                                     (astrometric_primary_flag) (G14)
      real*4        ARF        (nr__) ! Relegation factor
*                                     (astrometric_relegation_factor)
      real*8        WAL        (nr__) ! (mas-2) Mean astrometric weight of the source in
*                                     the AL direction (astrometric_weight_al)
      real*4        WAC        (nr__) ! (mas-2) ? Mean astrometric weight of the source in
*                                     the AC direction (astrometric_weight_ac)
      integer*4     Apr        (nr__) ! [0/6] Type of prior used in in the
*                                     astrometric solution
*                                     (astrometric_priors_used) (G15)
      integer*4     MatchObs   (nr__) ! Amount of observations matched to this
*                                     source (matched_observations) (G16)
      integer*4     Dup        (nr__) ! [0/1] Source with duplicate sources
*                                     (duplicated_source) (G17)
      real*4        sK1        (nr__) ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k1) (G18)
      real*4        sK2        (nr__) ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k2) (G18)
      real*4        sK3        (nr__) ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k3) (G18)
      real*4        sK4        (nr__) ! [0/1] Degree of concentration of scan
*                                     directions across the source
*                                     (scan_direction_strength_k4) (G18)
      real*8        mK1        (nr__) ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k1) (G19)
      real*8        mK2        (nr__) ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k2) (G19)
      real*8        mK3        (nr__) ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k3) (G19)
      real*8        mK4        (nr__) ! (deg) Mean position angle of scan directions
*                                     across the source
*                                     (scan_direction_mean_k4) (G19)
      integer*4     o__Gmag_   (nr__) ! Number of observations contributing to G
*                                     photometry (phot_g_n_obs)
      real*4        v_FG_      (nr__) ! (e-/s) G-band mean flux (phot_g_mean_flux)
      real*4        e__FG_     (nr__) ! (e-/s) Error on G-band mean flux
*                                     (phot_g_mean_flux_error)
      real*4        v_Gmag_    (nr__) ! (mag) G-band mean magnitude
*                                     (phot_g_mean_mag) (G20)
      character*13  Var        (nr__) ! Photometric variability flag
*                                     (phot_variable_flag) (G21)
      real*8        GLON       (nr__) ! (deg) Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT       (nr__) ! (deg) Galactic latitude at epoch 2015.0 (b)
      real*8        ELON       (nr__) ! (deg) Ecliptic longitude at epoch 2015.0 (ecl_lon)
      real*8        ELAT       (nr__) ! (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        (nr__1) ! ?=- Hipparcos identifier (hip)
      character*12  TYC2       (nr__1) ! Tycho 2 identifier (tycho2_id)
      integer*8     SolID_1    (nr__1) ! Solution ID (solution_id) (G1)
      integer*8     Source_1   (nr__1) ! Source ID (source_id) (G2)
      integer*4     RandomI_1  (nr__1) ! Random index used to select subsets
*                                      (random_index) (G3)
      real*4        Epoch_1    (nr__1) ! (yr) [2015.0] Reference epoch in Julian years
*                                      (ref_epoch) (G4)
      real*8        RAdeg_1    (nr__1) ! (deg) Right ascension (ICRS) at epoch 2015.0 (ra)
      real*4        e_RAdeg_1  (nr__1) ! (mas) Standard error of right ascension
*                                      (ra_error)
      real*8        DEdeg_1    (nr__1) ! (deg) Declination (ICRS) at epoch 2015.0 (dec)
      real*4        e_DEdeg_1  (nr__1) ! (mas) Standard error of declination (dec_error)
      real*4        Plx_1      (nr__1) ! (mas) Absolute barycentric stellar parallax of
*                                      the source at the reference epoch Epoch
*                                      (parallax)
      real*4        e_Plx_1    (nr__1) ! (mas) Standard error of parallax (parallax_error)
      real*8        pmRA_1     (nr__1) ! (mas/yr) Proper motion in right ascension direction
*                                       (pmRA) (G5)
      real*4        e_pmRA_1   (nr__1) ! (mas/yr) Standard error of proper motion in right
*                                       ascension direction (pmra_error)
      real*8        pmDE_1     (nr__1) ! (mas/yr) Proper motion in declination direction
*                                      (pmdec) (G6)
      real*4        e_pmDE_1   (nr__1) ! (mas/yr) Standard error of proper motion in
*                                      declination direction (pmdec_error)
      real*4        RADEcor_1  (nr__1) ! Correlation between right ascension and
*                                      declination (ra_dec_corr)
      real*4        RAPlxcor_1 (nr__1) ! Correlation between right ascension and
*                                      parallax (ra_parallax_corr)
      real*4        RApmRAcor_1(nr__1) ! Correlation between right ascension and
*                                      proper motion in right ascension
*                                      (ra_pmra_corr)
      real*4        RApmDEcor_1(nr__1) ! Correlation between right ascension and
*                                      proper motion in declination
*                                      (ra_pmdec_corr)
      real*4        DEPlxcor_1 (nr__1) ! Correlation between declination and
*                                      parallax (dec_parallax_corr)
      real*4        DEpmRAcor_1(nr__1) ! Correlation between declination and
*                                      proper motion in right ascension
*                                      (dec_pmra_corr)
      real*4        DEpmDEcor_1(nr__1) ! Correlation between declination and
*                                      proper motion in declination
*                                      (dec_pmdec_corr)
      real*4        PlxpmRAcor_1(nr__1) ! Correlation between parallax and proper
*                                      motion in right ascension
*                                      (parallax_pmra_corr)
      real*4        PlxpmDEcor_1(nr__1) ! Correlation between parallax and proper
*                                      motion in declination
*                                      (parallax_pmdec_corr)
      real*4        pmRApmDEcor_1(nr__1) ! Correlation between proper motion in
*                                      right ascension and proper motion in
*                                      declination (pmra_pmdec_corr)
      integer*4     NAL_1      (nr__1) ! Total number of observations AL
*                                      (astrometric_n_obs_al) (G7)
      integer*4     NAC_1      (nr__1) ! Total number of observations AC
*                                      (astrometric_n_obs_ac) (G8)
      integer*4     NgAL_1     (nr__1) ! Number of good observations AL
*                                      (astrometric_n_good_obs_al) (G9)
      integer*4     NgAC_1     (nr__1) ! Number of good observations AC
*                                      (astrometric_n_good_obs_ac) (G9)
      integer*4     NbAL_1     (nr__1) ! Number of bad observations AL
*                                      (astrometric_n_bad_obs_al) (G10)
      integer*4     NbAC_1     (nr__1) ! Number of bad observations AC
*                                      (astrometric_n_bad_obs_ac) (G10)
      real*8        DQ_1       (nr__1) ! ?=- Hipparcos/Gaia data discrepancy
*                                      (Hipparcos subset of TGAS only)
*                                      (astrometric_delta_q) (G11)
      real*4        epsi_1     (nr__1) ! (mas) Excess noise of the source
*                                      (astrometric_excess_noise) (G12)
      real*4        sepsi_1    (nr__1) ! Significance of excess noise
*                                      (astrometric_excess_noise_sig) (G13)
      integer*4     APF_1      (nr__1) ! [1] Primary or secondary
*                                      (astrometric_primary_flag) (G14)
      real*4        ARF_1      (nr__1) ! Relegation factor
*                                      (astrometric_relegation_factor)
      real*8        WAL_1      (nr__1) ! (mas-2) Mean astrometric weight of the source in
*                                      the AL direction (astrometric_weight_al)
      real*4        WAC_1      (nr__1) ! (mas-2) ? Mean astrometric weight of the source in
*                                      the AC direction (astrometric_weight_ac)
      integer*4     Apr_1      (nr__1) ! [3/5] Type of prior used in in the
*                                      astrometric solution
*                                      (astrometric_priors_used) (G15)
      integer*4     MatchObs_1 (nr__1) ! Amount of observations matched to this
*                                      source (matched_observations) (G16)
      integer*4     Dup_1      (nr__1) ! [0/1] Source with duplicate sources
*                                      (duplicated_source) (G17)
      real*4        sK1_1      (nr__1) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k1) (G18)
      real*4        sK2_1      (nr__1) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k2) (G18)
      real*4        sK3_1      (nr__1) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k3) (G18)
      real*4        sK4_1      (nr__1) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k4) (G18)
      real*8        mK1_1      (nr__1) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k1) (G19)
      real*8        mK2_1      (nr__1) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k2) (G19)
      real*8        mK3_1      (nr__1) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k3) (G19)
      real*8        mK4_1      (nr__1) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k4) (G19)
      integer*4     o__Gmag__1 (nr__1) ! Number of observations contributing to G
*                                      photometry (phot_g_n_obs)
      real*8        v_FG__1    (nr__1) ! (e-/s) G-band mean flux (phot_g_mean_flux)
      real*8        e__FG__1   (nr__1) ! (e-/s) Error on G-band mean flux
*                                      (phot_g_mean_flux_error)
      real*4        v_Gmag__1  (nr__1) ! (mag) G-band mean magnitude
*                                      (phot_g_mean_mag) (G20)
      character*13  Var_1      (nr__1) ! Photometric variability flag
*                                      (phot_variable_flag) (G21)
      real*8        GLON_1     (nr__1) ! (deg) Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT_1     (nr__1) ! (deg) Galactic latitude at epoch 2015.0 (b)
      real*8        ELON_1     (nr__1) ! (deg) Ecliptic longitude at epoch 2015.0
*                                      (ecl_lon)
      real*8        ELAT_1     (nr__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      (nr__2) ! ?=- Hipparcos identifier (hip)
      character*12  TYC2_1     (nr__2) ! Tycho 2 identifier (tycho2_id)
      integer*8     SolID_2    (nr__2) ! Solution ID (solution_id) (G1)
      integer*8     Source_2   (nr__2) ! Source ID (source_id) (G2)
      integer*4     RandomI_2  (nr__2) ! Random index used to select subsets
*                                      (random_index) (G3)
      real*4        Epoch_2    (nr__2) ! (yr) [2015.0] Reference epoch in Julian years
*                                      (ref_epoch) (G4)
      real*8        RAdeg_2    (nr__2) ! (deg) Right ascension (ICRS) at epoch 2015.0 (ra)
      real*4        e_RAdeg_2  (nr__2) ! (mas) Standard error of right ascension
*                                      (ra_error)
      real*8        DEdeg_2    (nr__2) ! (deg) Declination (ICRS) at epoch 2015.0 (dec)
      real*4        e_DEdeg_2  (nr__2) ! (mas) Standard error of declination (dec_error)
      real*4        Plx_2      (nr__2) ! (mas) Absolute barycentric stellar parallax of
*                                      the source at the reference epoch Epoch
*                                      (parallax)
      real*4        e_Plx_2    (nr__2) ! (mas) Standard error of parallax (parallax_error)
      real*8        pmRA_2     (nr__2) ! (mas/yr) Proper motion in right ascension direction
*                                       (pmRA) (G5)
      real*4        e_pmRA_2   (nr__2) ! (mas/yr) Standard error of proper motion in right
*                                       ascension direction (pmra_error)
      real*8        pmDE_2     (nr__2) ! (mas/yr) Proper motion in declination direction
*                                      (pmdec) (G6)
      real*4        e_pmDE_2   (nr__2) ! (mas/yr) Standard error of proper motion in
*                                      declination direction (pmdec_error)
      real*4        RADEcor_2  (nr__2) ! Correlation between right ascension and
*                                      declination (ra_dec_corr)
      real*4        RAPlxcor_2 (nr__2) ! Correlation between right ascension and
*                                      parallax (ra_parallax_corr)
      real*4        RApmRAcor_2(nr__2) ! Correlation between right ascension and
*                                      proper motion in right ascension
*                                      (ra_pmra_corr)
      real*4        RApmDEcor_2(nr__2) ! Correlation between right ascension and
*                                      proper motion in declination
*                                      (ra_pmdec_corr)
      real*4        DEPlxcor_2 (nr__2) ! Correlation between declination and
*                                      parallax (dec_parallax_corr)
      real*4        DEpmRAcor_2(nr__2) ! Correlation between declination and
*                                      proper motion in right ascension
*                                      (dec_pmra_corr)
      real*4        DEpmDEcor_2(nr__2) ! Correlation between declination and
*                                      proper motion in declination
*                                      (dec_pmdec_corr)
      real*4        PlxpmRAcor_2(nr__2) ! Correlation between parallax and proper
*                                      motion in right ascension
*                                      (parallax_pmra_corr)
      real*4        PlxpmDEcor_2(nr__2) ! Correlation between parallax and proper
*                                      motion in declination
*                                      (parallax_pmdec_corr)
      real*4        pmRApmDEcor_2(nr__2) ! Correlation between proper motion in
*                                      right ascension and proper motion in
*                                      declination (pmra_pmdec_corr)
      integer*4     NAL_2      (nr__2) ! Total number of observations AL
*                                      (astrometric_n_obs_al) (G7)
      integer*4     NAC_2      (nr__2) ! Total number of observations AC
*                                      (astrometric_n_obs_ac) (G8)
      integer*4     NgAL_2     (nr__2) ! Number of good observations AL
*                                      (astrometric_n_good_obs_al) (G9)
      integer*4     NgAC_2     (nr__2) ! Number of good observations AC
*                                      (astrometric_n_good_obs_ac) (G9)
      integer*4     NbAL_2     (nr__2) ! Number of bad observations AL
*                                      (astrometric_n_bad_obs_al) (G10)
      integer*4     NbAC_2     (nr__2) ! Number of bad observations AC
*                                      (astrometric_n_bad_obs_ac) (G10)
      real*8        DQ_2       (nr__2) ! ?=- Hipparcos/Gaia data discrepancy
*                                      (Hipparcos subset of TGAS only)
*                                      (astrometric_delta_q) (G11)
      real*4        epsi_2     (nr__2) ! (mas) Excess noise of the source
*                                      (astrometric_excess_noise) (G12)
      real*4        sepsi_2    (nr__2) ! Significance of excess noise
*                                      (astrometric_excess_noise_sig) (G13)
      integer*4     APF_2      (nr__2) ! [1] Primary or secondary
*                                      (astrometric_primary_flag) (G14)
      real*4        ARF_2      (nr__2) ! Relegation factor
*                                      (astrometric_relegation_factor)
      real*8        WAL_2      (nr__2) ! (mas-2) Mean astrometric weight of the source in
*                                      the AL direction (astrometric_weight_al)
      real*4        WAC_2      (nr__2) ! (mas-2) ? Mean astrometric weight of the source in
*                                      the AC direction (astrometric_weight_ac)
      integer*4     Apr_2      (nr__2) ! [3/5] Type of prior used in in the
*                                      astrometric solution
*                                      (astrometric_priors_used) (G15)
      integer*4     MatchObs_2 (nr__2) ! Amount of observations matched to this
*                                      source (matched_observations) (G16)
      integer*4     Dup_2      (nr__2) ! [0/1] Source with duplicate sources
*                                      (duplicated_source) (G17)
      real*4        sK1_2      (nr__2) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k1) (G18)
      real*4        sK2_2      (nr__2) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k2) (G18)
      real*4        sK3_2      (nr__2) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k3) (G18)
      real*4        sK4_2      (nr__2) ! [0/1] Degree of concentration of scan
*                                      directions across the source
*                                      (scan_direction_strength_k4) (G18)
      real*8        mK1_2      (nr__2) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k1) (G19)
      real*8        mK2_2      (nr__2) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k2) (G19)
      real*8        mK3_2      (nr__2) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k3) (G19)
      real*8        mK4_2      (nr__2) ! (deg) Mean position angle of scan directions
*                                      across the source
*                                      (scan_direction_mean_k4) (G19)
      integer*4     o__Gmag__2 (nr__2) ! Number of observations contributing to G
*                                      photometry (phot_g_n_obs)
      real*8        v_FG__2    (nr__2) ! (e-/s) G-band mean flux (phot_g_mean_flux)
      real*8        e__FG__2   (nr__2) ! (e-/s) Error on G-band mean flux
*                                      (phot_g_mean_flux_error)
      real*4        v_Gmag__2  (nr__2) ! (mag) G-band mean magnitude
*                                      (phot_g_mean_mag) (G20)
      character*13  Var_2      (nr__2) ! Photometric variability flag
*                                      (phot_variable_flag) (G21)
      real*8        GLON_2     (nr__2) ! (deg) Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT_2     (nr__2) ! (deg) Galactic latitude at epoch 2015.0 (b)
      real*8        ELON_2     (nr__2) ! (deg) Ecliptic longitude at epoch 2015.0
*                                      (ecl_lon)
      real*8        ELAT_2     (nr__2) ! (deg) Ecliptic latitude at epoch 2015.0 (ecl_lat)
      character*12  TYC        (nr__2) ! TYC2 or TYC1 designation
      real*4        BTmag      (nr__2) ! (mag) ? Tycho-2 or HIP BT magnitude
      real*4        e_BTmag    (nr__2) ! (mag) ? rms uncertainty on BTmag
      real*4        VTmag      (nr__2) ! (mag) ? Tycho-2 or HIP VT magnitude
      real*4        e_VTmag    (nr__2) ! (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    (nr__3) ! Solution ID (solution_id) (G1)
      integer*8     Source_3   (nr__3) ! Source ID (source_id) (G2)
      real*4        F1         (nr__3) ! (d-1) Fundamental frequency 1
*                                   (phot_variable_fundam_freq1) (1)
      character*5   Class      (nr__3) ! 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      (nr__4) ! Best type classification
*                                  (type_best_classification) (1)
      character*6   TBest2     (nr__4) ! Best subclassification estimate
*                                  (type2_best_sub_classification) (2)
      character*14  Mbest      (nr__4) ! Best mode classification estimate
*                                  (mode_best_classification) (3)
      character*18  SolID_4    (nr__4) ! Solution ID (solution_id) (G1)
      character*19  Source_4   (nr__4) ! Source ID (source_id) (G2)
      real*8        P1         (nr__4) ! (d) Period (p1) (G22)
      real*8        e_P1       (nr__4) ! (d) rms uncertainty on P1 (e_p1) (G23)
      real*8        EpG        (nr__4) ! (d) Epoch of the maximum of the light curve in
*                                  the G band (epoch_g) (G24)
      real*8        e_EpG      (nr__4) ! (d) Uncertainty on the epoch parameter EpG
*                                  (epoch_g_error) (G25)
      real*8        v_Gmag__3  (nr__4) ! (mag) Intensity-averaged magnitude in the G band
*                                  (int_average_g) (G26)
      real*4        e__Gmag_   (nr__4) ! (mag) Uncertainty on <Gmag> (int_average_g_error)
*                                  (G27)
      real*4        AmpG       (nr__4) ! (mag) Peak-to-peak amplitude of the G band light
*                                  curve (peak_to_peak_g) (G28)
      real*4        e_AmpG     (nr__4) ! (mag) Uncertainty on AmpG (peak_to_peak_g_error)
*                                  (G29)
      integer*4     NHP1       (nr__4) ! Number of harmonics used to model P1 of the
*                                  light curve (num_harmonics_for_p1_) (G30)
      real*4        R21G       (nr__4) ! ?=- Fourier decomposition parameter R21=A2/A1
*                                  (for G band) (r21_g) (G31)
      real*4        e_R21G     (nr__4) ! ?=- Uncertainty on R21G (r21_g_error) (G32)
      real*4        phi21G     (nr__4) ! ?=- Fourier decomposition parameter
*                                  phi21=phi2-2*phi1 (for G band)  (G33)
      real*4        e_phi21G   (nr__4) ! ?=- Uncertainty on phi21G (phi21_g_error)
      real*8        RAdeg_3    (nr__4) ! (deg) Right ascension (ICRS) at epoch 2015.0
      real*8        DEdeg_3    (nr__4) ! (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    (nr__5) ! Best RR Lyrae classification estimate
*                                  (best_classification) (1)
      integer*8     SolID_5    (nr__5) ! Solution ID (solution_id) (G1)
      integer*8     Source_5   (nr__5) ! Source ID (source_id) (G2)
      real*8        P1_1       (nr__5) ! (d) Period (p1) (G22)
      real*8        e_P1_1     (nr__5) ! (d) rms uncertainty on P1 (e_p1) (G23)
      real*8        EpG_1      (nr__5) ! (d) Epoch of the maximum of the light curve in
*                                  the G band (epoch_g) (G24)
      real*8        e_EpG_1    (nr__5) ! (d) Uncertainty on the epoch parameter EpG
*                                  (epoch_g_error) (G25)
      real*4        v_Gmag__4  (nr__5) ! (mag) Intensity-averaged magnitude in the G band
*                                  (int_average_g) (G26)
      real*4        e__Gmag__1 (nr__5) ! (mag) Uncertainty on <Gmag> (int_average_g_error)
*                                  (G27)
      real*4        AmpG_1     (nr__5) ! (mag) Peak-to-peak amplitude of the G band light
*                                  curve (peak_to_peak_g) (G28)
      real*4        e_AmpG_1   (nr__5) ! (mag) Uncertainty on AmpG (peak_to_peak_g_error)
*                                  (G29)
      integer*4     NHP1_1     (nr__5) ! [1/8] Number of harmonics used to model P1 of
*                                  the light curve (num_harmonics_for_p1_) (G30)
      real*8        R21G_1     (nr__5) ! ?=- Fourier decomposition parameter R21=A2/A1
*                                  (for G band) (r21_g) (G31)
      real*8        e_R21G_1   (nr__5) ! ?=- Uncertainty on R21G (r21_g_error) (G32)
      real*8        phi21G_1   (nr__5) ! ?=- Fourier decomposition parameter
*                                  phi21=phi2-2*phi1 (for G band)  (G33)
      real*8        e_phi21G_1 (nr__5) ! ?=- Uncertainty on phi21G (phi21_g_error)
      real*8        RAdeg_4    (nr__5) ! (deg) Right ascension (ICRS) at epoch 2015.0
      real*8        DEdeg_4    (nr__5) ! (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    (nr__6) ! Solution ID (solution_id) (G1)
      integer*8     Source_6   (nr__6) ! Source ID (source_id) (G2)
      integer*4     Nobs       (nr__6) ! Number of processed G-band observations for
*                                   variability analyses
*                                   (num_observations_processed) (1)
      real*8        ObsTime    (nr__6) ! (d) Mean observation time (with respect to T0) of
*                                   G-band time series (mean_obs_time) (2)
      real*4        b_Gmag     (nr__6) ! (mag) Minimum magnitude of the G-band time series
*                                   (minimum)
      real*4        B_Gmag_1   (nr__6) ! (mag) Maximum magnitude of the G-band time series
*                                   (maximum)
      real*4        v_Gmag__5  (nr__6) ! (mag) Mean magnitude of the G-band time series
*                                   (mean)
      real*4        GmagMed    (nr__6) ! (mag) Median magnitude of the G-band time series
*                                   (median)
      real*4        Range      (nr__6) ! (mag) Difference between the highest and lowest
*                                   magnitude of the G-band time series (range)
      real*4        stddev     (nr__6) ! (mag) Square root of the unweighted variance of the
*                                   G-band time series values (std_dev)
      real*4        Ske        (nr__6) ! Standardized unweighted skewness of the G-band
*                                   time series values (skewness)
      real*4        Kur        (nr__6) ! Standardized unweighted kurtosis of the G-band
*                                   time series values (kurtosis)
      real*4        Dur        (nr__6) ! (d) Time duration of the G-band time series
*                                   (time_duration)
      real*4        MAD        (nr__6) ! (mag) Median Absolute Deviation of the G-band time
*                                   series values
*                                   (median_absolute_deviation)
      real*4        Abbe       (nr__6) ! Abbe value of the G-band time series
*                                   values (3)
      real*4        IQR        (nr__6) ! (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    (nr__7) ! Solution ID (solution_id) (G1)
      integer*8     Source_7   (nr__7) ! Source ID (source_id) (G2)
      real*8        ObsTime_1  (nr__7) ! (d) Barycentric light-travel time corrected
*                                   timestamp for each FOV observation
*                                   (observation_time) (1)
      real*8        FG         (nr__7) ! (e-/s) G-band flux for each FOV observation (g_flux)
      real*8        e_FG       (nr__7) ! (e-/s) Estimated G-band flux uncertainty for each
*                                   FOV observation (g_flux_error)
      real*4        Gmag       (nr__7) ! (mag) G-band magnitude for each FOV observation
*                                   (g_magnitude) (2)
      integer*4     Rej        (nr__7) ! [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    (nr__8) ! Solution ID (solution_id) (G1)
      integer*8     Source_8   (nr__8) ! Source ID (source_id) (G2) (1)
      real*4        Epoch_3    (nr__8) ! (yr) [2015.0] Reference epoch in Julian years
*                                   (ref_epoch) (G4)
      real*8        RAdeg_5    (nr__8) ! (deg) Right ascension (ICRS) at epoch 2015.0
*                                   (ra) (1)
      real*4        e_RAdeg_3  (nr__8) ! (mas) Standard error of right ascension
*                                   (ra_error)
      real*8        DEdeg_5    (nr__8) ! (deg) Declination (ICRS) at epoch 2015.0 (dec) (2)
      real*4        e_DEdeg_3  (nr__8) ! (mas) Standard error of declination (dec_error)
      real*4        RADEcor_3  (nr__8) ! Correlation between right ascension and
*                                   declination (ra_dec_corr)
      real*4        v_Gmag__6  (nr__8) ! (mag) ? G-band mean magnitude
*                                   (phot_g_mean_mag) (G20) (3)
      integer*4     Apr_3      (nr__8) ! [3/6] Type of prior used in in the astrometric
*                                   solution (astrometric_priors_used) (G15)
      character*16  ICRF2      (nr__8) ! ICRF2 designation of the source matched to
*                                   this Gaia source (HHMMSS.s+DDMMSS)
*                                   (icrf2_match)
      integer*4     Frot       (nr__8) ! [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(i__),DEdeg(i__),SolID(i__),Source(i__),RandomI(i__),
     +  Epoch(i__),e_RAdeg(i__),e_DEdeg(i__),Plx(i__),e_Plx(i__),
     +  pmRA(i__),e_pmRA(i__),pmDE(i__),e_pmDE(i__),RADEcor(i__),
     +  RAPlxcor(i__),RApmRAcor(i__),RApmDEcor(i__),DEPlxcor(i__),
     +  DEpmRAcor(i__),DEpmDEcor(i__),PlxpmRAcor(i__),PlxpmDEcor(i__),
     +  pmRApmDEcor(i__),NAL(i__),NAC(i__),NgAL(i__),NgAC(i__),
     +  NbAL(i__),NbAC(i__),DQ(i__),epsi(i__),sepsi(i__),APF(i__),
     +  ARF(i__),WAL(i__),WAC(i__),Apr(i__),MatchObs(i__),Dup(i__),
     +  sK1(i__),sK2(i__),sK3(i__),sK4(i__),mK1(i__),mK2(i__),
     +  mK3(i__),mK4(i__),o__Gmag_(i__),v_FG_(i__),e__FG_(i__),
     +  v_Gmag_(i__),Var(i__),GLON(i__),GLAT(i__),ELON(i__),ELAT(i__)
        if(ar__(103:108) .EQ. '') Plx(i__) = rNULL__
        if(ar__(110:113) .EQ. '') e_Plx(i__) = rNULL__
        if(ar__(115:123) .EQ. '') pmRA(i__) = rNULL__
        if(ar__(125:130) .EQ. '') e_pmRA(i__) = rNULL__
        if(ar__(132:140) .EQ. '') pmDE(i__) = rNULL__
        if(ar__(142:147) .EQ. '') e_pmDE(i__) = rNULL__
        if(ar__(156:161) .EQ. '') RAPlxcor(i__) = rNULL__
        if(ar__(163:168) .EQ. '') RApmRAcor(i__) = rNULL__
        if(ar__(170:175) .EQ. '') RApmDEcor(i__) = rNULL__
        if(ar__(177:182) .EQ. '') DEPlxcor(i__) = rNULL__
        if(ar__(184:189) .EQ. '') DEpmRAcor(i__) = rNULL__
        if(ar__(191:196) .EQ. '') DEpmDEcor(i__) = rNULL__
        if(ar__(198:203) .EQ. '') PlxpmRAcor(i__) = rNULL__
        if(ar__(205:210) .EQ. '') PlxpmDEcor(i__) = rNULL__
        if(ar__(212:217) .EQ. '') pmRApmDEcor(i__) = rNULL__
        if (idig(ar__(248:255)).EQ.0) DQ(i__) =  rNULL__
        if(ar__(291:299) .EQ. '') WAC(i__) = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg(i__),DEdeg(i__),SolID(i__),Source(i__),RandomI(i__),
     +  Epoch(i__),e_RAdeg(i__),e_DEdeg(i__),Plx(i__),e_Plx(i__),
     +  pmRA(i__),e_pmRA(i__),pmDE(i__),e_pmDE(i__),RADEcor(i__),
     +  RAPlxcor(i__),RApmRAcor(i__),RApmDEcor(i__),DEPlxcor(i__),
     +  DEpmRAcor(i__),DEpmDEcor(i__),PlxpmRAcor(i__),PlxpmDEcor(i__),
     +  pmRApmDEcor(i__),NAL(i__),NAC(i__),NgAL(i__),NgAC(i__),
     +  NbAL(i__),NbAC(i__),DQ(i__),epsi(i__),sepsi(i__),APF(i__),
     +  ARF(i__),WAL(i__),WAC(i__),Apr(i__),MatchObs(i__),Dup(i__),
     +  sK1(i__),sK2(i__),sK3(i__),sK4(i__),mK1(i__),mK2(i__),
     +  mK3(i__),mK4(i__),o__Gmag_(i__),v_FG_(i__),e__FG_(i__),
     +  v_Gmag_(i__),Var(i__),GLON(i__),GLAT(i__),ELON(i__),ELAT(i__)
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(i__),TYC2(i__),SolID_1(i__),Source_1(i__),RandomI_1(i__),
     +  Epoch_1(i__),RAdeg_1(i__),e_RAdeg_1(i__),DEdeg_1(i__),
     +  e_DEdeg_1(i__),Plx_1(i__),e_Plx_1(i__),pmRA_1(i__),
     +  e_pmRA_1(i__),pmDE_1(i__),e_pmDE_1(i__),RADEcor_1(i__),
     +  RAPlxcor_1(i__),RApmRAcor_1(i__),RApmDEcor_1(i__),
     +  DEPlxcor_1(i__),DEpmRAcor_1(i__),DEpmDEcor_1(i__),
     +  PlxpmRAcor_1(i__),PlxpmDEcor_1(i__),pmRApmDEcor_1(i__),
     +  NAL_1(i__),NAC_1(i__),NgAL_1(i__),NgAC_1(i__),NbAL_1(i__),
     +  NbAC_1(i__),DQ_1(i__),epsi_1(i__),sepsi_1(i__),APF_1(i__),
     +  ARF_1(i__),WAL_1(i__),WAC_1(i__),Apr_1(i__),MatchObs_1(i__),
     +  Dup_1(i__),sK1_1(i__),sK2_1(i__),sK3_1(i__),sK4_1(i__),
     +  mK1_1(i__),mK2_1(i__),mK3_1(i__),mK4_1(i__),o__Gmag__1(i__),
     +  v_FG__1(i__),e__FG__1(i__),v_Gmag__1(i__),Var_1(i__),
     +  GLON_1(i__),GLAT_1(i__),ELON_1(i__),ELAT_1(i__)
        if (HIP(i__) .EQ. 45) HIP(i__) =  iNULL__
        if (idig(ar__1(263:270)).EQ.0) DQ_1(i__) =  rNULL__
        if(ar__1(305:312) .EQ. '') WAC_1(i__) = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  HIP(i__),TYC2(i__),SolID_1(i__),Source_1(i__),RandomI_1(i__),
     +  Epoch_1(i__),RAdeg_1(i__),e_RAdeg_1(i__),DEdeg_1(i__),
     +  e_DEdeg_1(i__),Plx_1(i__),e_Plx_1(i__),pmRA_1(i__),
     +  e_pmRA_1(i__),pmDE_1(i__),e_pmDE_1(i__),RADEcor_1(i__),
     +  RAPlxcor_1(i__),RApmRAcor_1(i__),RApmDEcor_1(i__),
     +  DEPlxcor_1(i__),DEpmRAcor_1(i__),DEpmDEcor_1(i__),
     +  PlxpmRAcor_1(i__),PlxpmDEcor_1(i__),pmRApmDEcor_1(i__),
     +  NAL_1(i__),NAC_1(i__),NgAL_1(i__),NgAC_1(i__),NbAL_1(i__),
     +  NbAC_1(i__),DQ_1(i__),epsi_1(i__),sepsi_1(i__),APF_1(i__),
     +  ARF_1(i__),WAL_1(i__),WAC_1(i__),Apr_1(i__),MatchObs_1(i__),
     +  Dup_1(i__),sK1_1(i__),sK2_1(i__),sK3_1(i__),sK4_1(i__),
     +  mK1_1(i__),mK2_1(i__),mK3_1(i__),mK4_1(i__),o__Gmag__1(i__),
     +  v_FG__1(i__),e__FG__1(i__),v_Gmag__1(i__),Var_1(i__),
     +  GLON_1(i__),GLAT_1(i__),ELON_1(i__),ELAT_1(i__)
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(i__),TYC2_1(i__),SolID_2(i__),Source_2(i__),
     +  RandomI_2(i__),Epoch_2(i__),RAdeg_2(i__),e_RAdeg_2(i__),
     +  DEdeg_2(i__),e_DEdeg_2(i__),Plx_2(i__),e_Plx_2(i__),
     +  pmRA_2(i__),e_pmRA_2(i__),pmDE_2(i__),e_pmDE_2(i__),
     +  RADEcor_2(i__),RAPlxcor_2(i__),RApmRAcor_2(i__),
     +  RApmDEcor_2(i__),DEPlxcor_2(i__),DEpmRAcor_2(i__),
     +  DEpmDEcor_2(i__),PlxpmRAcor_2(i__),PlxpmDEcor_2(i__),
     +  pmRApmDEcor_2(i__),NAL_2(i__),NAC_2(i__),NgAL_2(i__),
     +  NgAC_2(i__),NbAL_2(i__),NbAC_2(i__),DQ_2(i__),epsi_2(i__),
     +  sepsi_2(i__),APF_2(i__),ARF_2(i__),WAL_2(i__),WAC_2(i__),
     +  Apr_2(i__),MatchObs_2(i__),Dup_2(i__),sK1_2(i__),sK2_2(i__),
     +  sK3_2(i__),sK4_2(i__),mK1_2(i__),mK2_2(i__),mK3_2(i__),
     +  mK4_2(i__),o__Gmag__2(i__),v_FG__2(i__),e__FG__2(i__),
     +  v_Gmag__2(i__),Var_2(i__),GLON_2(i__),GLAT_2(i__),ELON_2(i__),
     +  ELAT_2(i__),TYC(i__),BTmag(i__),e_BTmag(i__),VTmag(i__),
     +  e_VTmag(i__)
        if (HIP_1(i__) .EQ. 45) HIP_1(i__) =  iNULL__
        if (idig(ar__2(263:270)).EQ.0) DQ_2(i__) =  rNULL__
        if(ar__2(305:312) .EQ. '') WAC_2(i__) = rNULL__
        if(ar__2(528:533) .EQ. '') BTmag(i__) = rNULL__
        if(ar__2(535:539) .EQ. '') e_BTmag(i__) = rNULL__
        if(ar__2(541:546) .EQ. '') VTmag(i__) = rNULL__
        if(ar__2(548:552) .EQ. '') e_VTmag(i__) = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  HIP_1(i__),TYC2_1(i__),SolID_2(i__),Source_2(i__),
     +  RandomI_2(i__),Epoch_2(i__),RAdeg_2(i__),e_RAdeg_2(i__),
     +  DEdeg_2(i__),e_DEdeg_2(i__),Plx_2(i__),e_Plx_2(i__),
     +  pmRA_2(i__),e_pmRA_2(i__),pmDE_2(i__),e_pmDE_2(i__),
     +  RADEcor_2(i__),RAPlxcor_2(i__),RApmRAcor_2(i__),
     +  RApmDEcor_2(i__),DEPlxcor_2(i__),DEpmRAcor_2(i__),
     +  DEpmDEcor_2(i__),PlxpmRAcor_2(i__),PlxpmDEcor_2(i__),
     +  pmRApmDEcor_2(i__),NAL_2(i__),NAC_2(i__),NgAL_2(i__),
     +  NgAC_2(i__),NbAL_2(i__),NbAC_2(i__),DQ_2(i__),epsi_2(i__),
     +  sepsi_2(i__),APF_2(i__),ARF_2(i__),WAL_2(i__),WAC_2(i__),
     +  Apr_2(i__),MatchObs_2(i__),Dup_2(i__),sK1_2(i__),sK2_2(i__),
     +  sK3_2(i__),sK4_2(i__),mK1_2(i__),mK2_2(i__),mK3_2(i__),
     +  mK4_2(i__),o__Gmag__2(i__),v_FG__2(i__),e__FG__2(i__),
     +  v_Gmag__2(i__),Var_2(i__),GLON_2(i__),GLAT_2(i__),ELON_2(i__),
     +  ELAT_2(i__),TYC(i__),BTmag(i__),e_BTmag(i__),VTmag(i__),
     +  e_VTmag(i__)
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(i__),Source_3(i__),F1(i__),Class(i__)
c    ..............Just test output...........
        write(6,4)SolID_3(i__),Source_3(i__),F1(i__),Class(i__)
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(i__),TBest2(i__),Mbest(i__),SolID_4(i__),Source_4(i__),
     +  P1(i__),e_P1(i__),EpG(i__),e_EpG(i__),v_Gmag__3(i__),
     +  e__Gmag_(i__),AmpG(i__),e_AmpG(i__),NHP1(i__),R21G(i__),
     +  e_R21G(i__),phi21G(i__),e_phi21G(i__),RAdeg_3(i__),
     +  DEdeg_3(i__)
        if (idig(ar__4(148:152)).EQ.0) R21G(i__) =  rNULL__
        if (idig(ar__4(154:158)).EQ.0) e_R21G(i__) =  rNULL__
        if (idig(ar__4(160:164)).EQ.0) phi21G(i__) =  rNULL__
        if (idig(ar__4(166:170)).EQ.0) e_phi21G(i__) =  rNULL__
c    ..............Just test output...........
        write(6,5)
     +  TBest(i__),TBest2(i__),Mbest(i__),SolID_4(i__),Source_4(i__),
     +  P1(i__),e_P1(i__),EpG(i__),e_EpG(i__),v_Gmag__3(i__),
     +  e__Gmag_(i__),AmpG(i__),e_AmpG(i__),NHP1(i__),R21G(i__),
     +  e_R21G(i__),phi21G(i__),e_phi21G(i__),RAdeg_3(i__),
     +  DEdeg_3(i__)
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(i__),SolID_5(i__),Source_5(i__),P1_1(i__),e_P1_1(i__),
     +  EpG_1(i__),e_EpG_1(i__),v_Gmag__4(i__),e__Gmag__1(i__),
     +  AmpG_1(i__),e_AmpG_1(i__),NHP1_1(i__),R21G_1(i__),
     +  e_R21G_1(i__),phi21G_1(i__),e_phi21G_1(i__),RAdeg_4(i__),
     +  DEdeg_4(i__)
        if (idig(ar__5(119:126)).EQ.0) R21G_1(i__) =  rNULL__
        if (idig(ar__5(128:135)).EQ.0) e_R21G_1(i__) =  rNULL__
        if (idig(ar__5(137:144)).EQ.0) phi21G_1(i__) =  rNULL__
        if (idig(ar__5(146:153)).EQ.0) e_phi21G_1(i__) =  rNULL__
c    ..............Just test output...........
        write(6,6)
     +  TBest_1(i__),SolID_5(i__),Source_5(i__),P1_1(i__),e_P1_1(i__),
     +  EpG_1(i__),e_EpG_1(i__),v_Gmag__4(i__),e__Gmag__1(i__),
     +  AmpG_1(i__),e_AmpG_1(i__),NHP1_1(i__),R21G_1(i__),
     +  e_R21G_1(i__),phi21G_1(i__),e_phi21G_1(i__),RAdeg_4(i__),
     +  DEdeg_4(i__)
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(i__),Source_6(i__),Nobs(i__),ObsTime(i__),b_Gmag(i__),
     +  B_Gmag_1(i__),v_Gmag__5(i__),GmagMed(i__),Range(i__),
     +  stddev(i__),Ske(i__),Kur(i__),Dur(i__),MAD(i__),Abbe(i__),
     +  IQR(i__)
c    ..............Just test output...........
        write(6,7)
     +  SolID_6(i__),Source_6(i__),Nobs(i__),ObsTime(i__),b_Gmag(i__),
     +  B_Gmag_1(i__),v_Gmag__5(i__),GmagMed(i__),Range(i__),
     +  stddev(i__),Ske(i__),Kur(i__),Dur(i__),MAD(i__),Abbe(i__),
     +  IQR(i__)
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(i__),Source_7(i__),ObsTime_1(i__),FG(i__),e_FG(i__),
     +  Gmag(i__),Rej(i__)
c    ..............Just test output...........
        write(6,8)
     +  SolID_7(i__),Source_7(i__),ObsTime_1(i__),FG(i__),e_FG(i__),
     +  Gmag(i__),Rej(i__)
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(i__),Source_8(i__),Epoch_3(i__),RAdeg_5(i__),
     +  e_RAdeg_3(i__),DEdeg_5(i__),e_DEdeg_3(i__),RADEcor_3(i__),
     +  v_Gmag__6(i__),Apr_3(i__),ICRF2(i__),Frot(i__)
        if(ar__8(99:104) .EQ. '') v_Gmag__6(i__) = rNULL__
c    ..............Just test output...........
        write(6,9)
     +  SolID_8(i__),Source_8(i__),Epoch_3(i__),RAdeg_5(i__),
     +  e_RAdeg_3(i__),DEdeg_5(i__),e_DEdeg_3(i__),RADEcor_3(i__),
     +  v_Gmag__6(i__),Apr_3(i__),ICRF2(i__),Frot(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