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 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 2026-Jun-08
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     ! Gaia DR3 source_id
      real*8        RAdeg       ! (deg) Rigth ascension (ICRS) at Ep=2016.0
      real*8        DEdeg       ! (deg) Declination (ICRS) at Ep=2016.0
      real*8        RV          ! (km/s) Radial velocity
      real*8        e_RV        ! (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   ! Gaia DR3 source_id
      real*8        RAdeg_1     ! (deg) Rigth ascension (ICRS) at Ep=2016.0
      real*8        DEdeg_1     ! (deg) Declination (ICRS) at Ep=2016.0
      real*8        RV_1        ! (km/s) Calibrated XP radial velocity
      real*4        e_RV_1      ! (km/s) ?=- Calibrated XP radial velocity error
      real*8        Offset      ! (km/s) ?=- Offset applied to the original radial
*                                     velocity measurement during calibration
      real*8        UnderFactor ! ?=- Underestimation factor applied to the
*                                     measured uncertainties
      real*4        NoiseFloor  ! (km/s) ?=- Noise floor applied to the measured
*                                     uncertainties
      real*4        CMDoutfrac  ! ?=- CMD outlier fraction of stars in
*                                    colour-mag-extinction(-log g) range that are
*                                    considered outliers
      real*4        BadMeas     ! Probability of a bad measurement based on
*                                     the Random Forest Classifier
      integer*4     warning     ! Warning flag to indicate potentially
*                                     problematic radial velocity measurements
      integer*4     Teff        ! (K) Effective temperature of the best fit model
*                                     for radial velocity
      real*8        logg        ! ([cm/s2]) Surface gravity of the best fit model for
*                                     radial velocity
      real*8        v_Fe_H_     ! ([-]) Metallicity of the best fit model for
*                                     radial velocity
      real*4        rchi2       ! Reduced chi squared of our best fit model
      real*8        Skew        ! 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,RAdeg,DEdeg,RV,e_RV
c    ..............Just test output...........
        write(6,1)GaiaDR3,RAdeg,DEdeg,RV,e_RV
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,RAdeg_1,DEdeg_1,RV_1,e_RV_1,Offset,UnderFactor,
     +  NoiseFloor,CMDoutfrac,BadMeas,warning,Teff,logg,v_Fe_H_,rchi2,
     +  Skew
        if (idig(ar__1(63:74)).EQ.0) e_RV_1 =  rNULL__
        if (idig(ar__1(76:84)).EQ.0) Offset =  rNULL__
        if (idig(ar__1(86:95)).EQ.0) UnderFactor =  rNULL__
        if (idig(ar__1(97:108)).EQ.0) NoiseFloor =  rNULL__
        if (idig(ar__1(110:121)).EQ.0) CMDoutfrac =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  GaiaDR3_1,RAdeg_1,DEdeg_1,RV_1,e_RV_1,Offset,UnderFactor,
     +  NoiseFloor,CMDoutfrac,BadMeas,warning,Teff,logg,v_Fe_H_,rchi2,
     +  Skew
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