FORTRAN Generation
(/./ftp/cats/J/A_A/608/A148)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/608/A148 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 2024-Apr-19
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/608/A148     Stellar populations towards Orion with Gaia DR1 (Zari+, 2017)
*================================================================================
*Mapping young stellar populations towards Orion with Gaia DR1.
*    Zari E., Brown A.G.A., de Bruijne J., Manara C.F., de Zeeuw P.T.
*    <Astron. Astrophys. 608, A148 (2017)>
*    =2017A&A...608A.148Z        (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'origaia.dat'	! Gaia DR1 sources in the Orion field

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

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      integer*8     Source      ! Source ID  (source_id)
      real*8        RAdeg       ! (deg) Gaia right ascension (ICRS) at epoch 2015.0 (ra)
      real*8        DEdeg       ! (deg) Gaia declination (ICRS) at epoch 2015.0 (dec)
      real*8        GLON        ! (deg) Gaia Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT        ! (deg) Gaia Galactic latitude at epoch 2015.0 (b)
      real*4        v_Gmag_     ! (mag) Gaia G-band mean magnitude (phot_g_mean_mag)
      real*4        v_FG_       ! (e-/s) Gaia 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*8        pmRA        ! (mas/yr) ?=- Gaia proper motion in right ascension
*                                 direction (pmra)
      real*8        pmDE        ! (mas/yr) ?=- Gaia proper motion in declination direction
*                                 (pmdec)
      real*4        Plx         ! (mas) ?=- Gaia Absolute barycentric stellar parallax
*                                 (parallax)
      real*4        e_pmRA      ! (mas/yr) ?=- Standard error of pmRA (pmra_error)
      real*4        e_pmDE      ! (mas/yr) ?=- Standard error of pmDE (pmdec_error)
      real*4        e_Plx       ! (mas) ?=- Standard error of Plx (parallax_error)

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

C  Declarations for 'x2mass.dat'	! Gaia DR1 sources cross-matched with the 2MASS
                                 catalogue, with separation < 1"

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

C  Position composed of: GLON GLAT (Epoch=2015.0)
      integer*8     Source_1    ! Gaia Source ID  (source_id)
      real*8        GLON_1      ! (deg) Gaia Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT_1      ! (deg) Gaia Galactic latitude at epoch 2015.0 (b)
      real*4        v_Gmag__1   ! (mag) Gaia G-band mean magnitude (phot_g_mean_mag)
      real*4        e__FG__1    ! (e-/s) Error on G-band mean flux
*                                 (phot_g_mean_flux_error)
      real*4        v_FG__1     ! (e-/s) Gaia G-band mean flux (phot_g_mean_flux)
      real*4        Jmag        ! (mag) 2MASS J magnitude (j_m)
      real*4        e_Jmag      ! (mag) ? Error on Jmag (j_msigcom)
      real*4        Hmag        ! (mag) ? 2MASS H magnitude (h_m)
      real*4        e_Hmag      ! (mag) ? Error on Hmag (h_msigcom)
      real*8        Ksmag       ! (mag) ? 2MASS Ks magnitude (ks_m)
      real*4        e_Ksmag     ! (mag) ? Error on Ksmag (ks_msigcom)
      character*3   Qual        ! 2MASS quality flags (ph_qual)

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

C  Declarations for 'oritgas.dat'	! TGAS sources in the Orion field

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

C  Position composed of: RAdeg DEdeg (Epoch=2015.0)
      integer*4     HIP         ! ?=- HIP number (hip)
      integer*8     Source_2    ! Gaia Source ID  (source_id)
      real*8        RAdeg_1     ! (deg) Gaia right ascension (ICRS) at epoch 2015.0 (ra)
      real*8        DEdeg_1     ! (deg) Gaia declination (ICRS) at epoch 2015.0 (dec)
      real*8        GLON_2      ! (deg) Gaia Galactic longitude at epoch 2015.0 (l)
      real*8        GLAT_2      ! (deg) Gaia Galactic latitude at epoch 2015.0 (b)
      real*4        v_Gmag__2   ! (mag) Gaia G-band mean magnitude (phot_g_mean_mag)
      real*4        v_FG__2     ! (e-/s) Gaia G-band mean flux (phot_g_mean_flux)
      real*4        e__FG__2    ! (e-/s) Error on G-band mean flux
*                                 (phot_g_mean_flux_error)
      real*8        pmRA_1      ! (mas/yr) Gaia proper motion in right ascension direction
*                                 (pmra)
      real*8        pmDE_1      ! (mas/yr) Gaia proper motion in declination direction
*                                 (pmdec)
      real*4        Plx_1       ! (mas) Gaia Absolute barycentric stellar parallax
*                                 (parallax)
      real*4        e_pmRA_1    ! (mas/yr) Standard error of pmRA (pmra_error)
      real*4        e_pmDE_1    ! (mas/yr) Standard error of pmDE (pmdec_error)
      real*4        e_Plx_1     ! (mas) Standard error of Plx (parallax_error)

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

C  Loading file 'origaia.dat'	! Gaia DR1 sources in the Orion field

C  Format for file interpretation

    1 format(
     +  I19,1X,F14.10,1X,F14.10,1X,F14.10,1X,F14.10,1X,F6.3,1X,E11.5,
     +  1X,E11.5,1X,F9.3,1X,F9.3,1X,F6.2,1X,F6.3,1X,F6.3,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'origaia.dat')
      write(6,*) '....Loading file: origaia.dat'
      do i__=1,9926756
        read(1,'(A156)')ar__
        read(ar__,1)
     +  Source,RAdeg,DEdeg,GLON,GLAT,v_Gmag_,v_FG_,e__FG_,pmRA,pmDE,
     +  Plx,e_pmRA,e_pmDE,e_Plx
        if (idig(ar__(112:120)).EQ.0) pmRA =  rNULL__
        if (idig(ar__(122:130)).EQ.0) pmDE =  rNULL__
        if (idig(ar__(132:137)).EQ.0) Plx =  rNULL__
        if (idig(ar__(139:144)).EQ.0) e_pmRA =  rNULL__
        if (idig(ar__(146:151)).EQ.0) e_pmDE =  rNULL__
        if (idig(ar__(153:156)).EQ.0) e_Plx =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Source,RAdeg,DEdeg,GLON,GLAT,v_Gmag_,v_FG_,e__FG_,pmRA,pmDE,
     +  Plx,e_pmRA,e_pmDE,e_Plx
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'x2mass.dat'	! Gaia DR1 sources cross-matched with the 2MASS
*                                 catalogue, with separation < 1"

C  Format for file interpretation

    2 format(
     +  I19,1X,F14.10,1X,F14.10,1X,F6.3,1X,E11.5,1X,E11.5,1X,F6.3,1X,
     +  F5.3,1X,F6.3,1X,F5.3,1X,F7.3,1X,F5.3,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'x2mass.dat')
      write(6,*) '....Loading file: x2mass.dat'
      do i__=1,5059068
        read(1,'(A124)')ar__1
        read(ar__1,2)
     +  Source_1,GLON_1,GLAT_1,v_Gmag__1,e__FG__1,v_FG__1,Jmag,e_Jmag,
     +  Hmag,e_Hmag,Ksmag,e_Ksmag,Qual
        if(ar__1(89:93) .EQ. '') e_Jmag = rNULL__
        if(ar__1(95:100) .EQ. '') Hmag = rNULL__
        if(ar__1(102:106) .EQ. '') e_Hmag = rNULL__
        if(ar__1(108:114) .EQ. '') Ksmag = rNULL__
        if(ar__1(116:120) .EQ. '') e_Ksmag = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Source_1,GLON_1,GLAT_1,v_Gmag__1,e__FG__1,v_FG__1,Jmag,e_Jmag,
     +  Hmag,e_Hmag,Ksmag,e_Ksmag,Qual
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'oritgas.dat'	! TGAS sources in the Orion field

C  Format for file interpretation

    3 format(
     +  I5,1X,I19,1X,F14.10,1X,F14.10,1X,F14.10,1X,F14.10,1X,F6.3,1X,
     +  E11.5,1X,E11.5,1X,F9.3,1X,F9.3,1X,F6.2,1X,F6.3,1X,F6.3,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'oritgas.dat')
      write(6,*) '....Loading file: oritgas.dat'
      do i__=1,34829
        read(1,'(A162)')ar__2
        read(ar__2,3)
     +  HIP,Source_2,RAdeg_1,DEdeg_1,GLON_2,GLAT_2,v_Gmag__2,v_FG__2,
     +  e__FG__2,pmRA_1,pmDE_1,Plx_1,e_pmRA_1,e_pmDE_1,e_Plx_1
        if (HIP .EQ. 45) HIP =  iNULL__
c    ..............Just test output...........
        write(6,3)
     +  HIP,Source_2,RAdeg_1,DEdeg_1,GLON_2,GLAT_2,v_Gmag__2,v_FG__2,
     +  e__FG__2,pmRA_1,pmDE_1,Plx_1,e_pmRA_1,e_pmDE_1,e_Plx_1
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