FORTRAN Generation
(/./ftp/cats/J/A_A/684/A29)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/684/A29 into FORTRAN code for loading all data files into arrays.

Note that special values are assigned to unknown or unspecified numbers (also called NULL numbers); when necessary, the coordinate components making up the right ascension and declination are converted into floating-point numbers representing these angles in degrees.



      program load_ReadMe
C=============================================================================
C  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2026-Oct-09
C=============================================================================
*  This code was generated from the ReadMe file documenting a catalogue
*  according to the "Standard for Documentation of Astronomical Catalogues"
*  currently in use by the Astronomical Data Centers (CDS, ADC, A&A)
*  (see full documentation at URL http://vizier.u-strasbg.fr/doc/catstd.htx)
*  Please report problems or questions to   
C=============================================================================

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

C=============================================================================
Cat. J/A+A/684/A29       Radial velocities from Gaia BP/RP spectra  (Verberne+, 2024)
*================================================================================
*Radial velocities from Gaia BP/RP spectra.
*    Verberne S., Koposov S.E., Rossi E.M., Marchetti T., Kuijken K., Penoyre Z.
*    <Astron. Astrophys. 684, A29 (2024)>
*    =2024A&A...684A..29V        (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'main.dat'	! Main catalogue

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

C  Position composed of: RAdeg DEdeg (Epoch=2016.0)
      integer*8     GaiaDR3    (nr__) ! Gaia DR3 source_id
      real*8        RAdeg      (nr__) ! (deg) Rigth ascension (ICRS) at Ep=2016.0
      real*8        DEdeg      (nr__) ! (deg) Declination (ICRS) at Ep=2016.0
      real*8        RV         (nr__) ! (km/s) Radial velocity
      real*8        e_RV       (nr__) ! (km/s) Radial velocity error

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

C  Declarations for 'extend.dat'	! Extended Catalogue

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

C  Position composed of: RAdeg DEdeg (Epoch=2016.0)
      integer*8     GaiaDR3_1  (nr__1) ! Gaia DR3 source_id
      real*8        RAdeg_1    (nr__1) ! (deg) Rigth ascension (ICRS) at Ep=2016.0
      real*8        DEdeg_1    (nr__1) ! (deg) Declination (ICRS) at Ep=2016.0
      real*8        RV_1       (nr__1) ! (km/s) Calibrated XP radial velocity
      real*4        e_RV_1     (nr__1) ! (km/s) ?=- Calibrated XP radial velocity error
      real*8        Offset     (nr__1) ! (km/s) ?=- Offset applied to the original radial
*                                     velocity measurement during calibration
      real*8        UnderFactor(nr__1) ! ?=- Underestimation factor applied to the
*                                     measured uncertainties
      real*4        NoiseFloor (nr__1) ! (km/s) ?=- Noise floor applied to the measured
*                                     uncertainties
      real*4        CMDoutfrac (nr__1) ! ?=- CMD outlier fraction of stars in
*                                    colour-mag-extinction(-log g) range that are
*                                    considered outliers
      real*4        BadMeas    (nr__1) ! Probability of a bad measurement based on
*                                     the Random Forest Classifier
      integer*4     warning    (nr__1) ! Warning flag to indicate potentially
*                                     problematic radial velocity measurements
      integer*4     Teff       (nr__1) ! (K) Effective temperature of the best fit model
*                                     for radial velocity
      real*8        logg       (nr__1) ! ([cm/s2]) Surface gravity of the best fit model for
*                                     radial velocity
      real*8        v_Fe_H_    (nr__1) ! ([-]) Metallicity of the best fit model for
*                                     radial velocity
      real*4        rchi2      (nr__1) ! Reduced chi squared of our best fit model
      real*8        Skew       (nr__1) ! Skewness of the radial velocity posterior

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

C  Loading file 'main.dat'	! Main catalogue

C  Format for file interpretation

    1 format(I19,1X,F15.11,1X,F15.11,1X,F9.3,1X,F8.4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'main.dat')
      write(6,*) '....Loading file: main.dat'
      do i__=1,6367355
        read(1,'(A70)')ar__
        read(ar__,1)
     +  GaiaDR3(i__),RAdeg(i__),DEdeg(i__),RV(i__),e_RV(i__)
c    ..............Just test output...........
        write(6,1)
     +  GaiaDR3(i__),RAdeg(i__),DEdeg(i__),RV(i__),e_RV(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'extend.dat'	! Extended Catalogue

C  Format for file interpretation

    2 format(
     +  I19,1X,F15.11,1X,F15.11,1X,F9.3,1X,E12.6,1X,F9.3,1X,F10.3,1X,
     +  E12.6,1X,E12.6,1X,F5.3,1X,I2,1X,I5,1X,F9.6,1X,F9.6,1X,E12.6,
     +  1X,F8.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'extend.dat')
      write(6,*) '....Loading file: extend.dat'
      do i__=1,125145490
        read(1,'(A178)')ar__1
        read(ar__1,2)
     +  GaiaDR3_1(i__),RAdeg_1(i__),DEdeg_1(i__),RV_1(i__),
     +  e_RV_1(i__),Offset(i__),UnderFactor(i__),NoiseFloor(i__),
     +  CMDoutfrac(i__),BadMeas(i__),warning(i__),Teff(i__),logg(i__),
     +  v_Fe_H_(i__),rchi2(i__),Skew(i__)
        if (idig(ar__1(63:74)).EQ.0) e_RV_1(i__) =  rNULL__
        if (idig(ar__1(76:84)).EQ.0) Offset(i__) =  rNULL__
        if (idig(ar__1(86:95)).EQ.0) UnderFactor(i__) =  rNULL__
        if (idig(ar__1(97:108)).EQ.0) NoiseFloor(i__) =  rNULL__
        if (idig(ar__1(110:121)).EQ.0) CMDoutfrac(i__) =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  GaiaDR3_1(i__),RAdeg_1(i__),DEdeg_1(i__),RV_1(i__),
     +  e_RV_1(i__),Offset(i__),UnderFactor(i__),NoiseFloor(i__),
     +  CMDoutfrac(i__),BadMeas(i__),warning(i__),Teff(i__),logg(i__),
     +  v_Fe_H_(i__),rchi2(i__),Skew(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