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

Conversion of standardized ReadMe file for file /./ftp/cats/I/340 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-Apr-26
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/340                  UCAC5 Catalogue                         (Zacharias+ 2017)
*================================================================================
*UCAC5: New Proper Motions using Gaia DR1.
*    Zacharias N., Finch C., Frouard J.
*   <Astron. J., 153, 166 (2017)>
*   =2017yCat.1340....0Z
*   =2017AJ....153..166Z
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'ucac5.sam'	! UCAC5 catalog (107,758,513 sources)

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

C  J2000 position composed of: RAdeg DEdeg
      real*8        RAdeg       ! (deg) UCAC right ascension (J2000) at epoch 
*                                     "EPucac" on Gaia reference frame (ira)
      real*8        DEdeg       ! (deg) UCAC declination (J2000) at epoch 
*                                     "EPucac" on Gaia reference frame (idc)
      integer*8     SrcIDgaia   ! Gaia source ID (srcid)
      real*8        RAgaia      ! (deg) Gaia right ascension (ICRS) at epoch 2015.0 
*                                     (rag) (1)
      real*8        DEgaia      ! (deg) Gaia declination (ICRS) at epoch 2015.0 
*                                     (dcg) (1)
      real*4        e_RAgaia    ! (mas) rms uncertainty on RAgaia (erg) (1)
      real*4        e_DEgaia    ! (mas) rms uncertainty on DEgaia (edg) (1)
      integer*4     Org         ! [1/3] TGAS/NOMAD flag (flg) (2)
      integer*4     Nu          ! Number of images used for mean position (nu)
      real*8        EPucac      ! (yr) UCAC epoch (epu)
      real*8        pmRA        ! (mas/yr) UCAC/Gaia proper motion in RA*cosDE (pmur)
      real*8        pmDE        ! (mas/yr) UCAC/Gaia proper motion in DE (pmud)
      real*4        e_pmRA      ! (mas/yr) rms uncertainty on pmRA (pmer)
      real*4        e_pmDE      ! (mas/yr) rms uncertainty on pmDE (pmed)
      real*4        Gmag        ! (mag) Gaia G magnitude (gmag)
      real*4        f_mag       ! (mag) ? Means UCAC model magnitude (umag)
      real*4        Rmag        ! (mag) ? Photographic R magnitude from NOMAD (rmag)
      real*4        Jmag        ! (mag) ? 2MASS J magnitude (jmag)
      real*4        Hmag        ! (mag) ? 2MASS H magnitude (hmag)
      real*4        Kmag        ! (mag) ? 2MASS K magnitude (kmag)
*Note (1): The precision of the Gaia position is mas, rounded to integer,
* while the precision of Gaia position errors is 0.1mas, also rounded to integer.
*  It means that at epoch 2015 the rounded error on Gaia positions is higher than
*  the statistical error.
*  The Gaia 2015 epoch positions and errors were added for convenience,
*  using Gaia data as reference stars at a different epoch than 2015.
*  Thus the position errors at those epochs would be dominated by the proper
*  motion errors.
*Note (2): Flag as follows:
*            1 = TGAS
*            2 = not TGAS, in NOMAD
*            3 = neither

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

C  Loading file 'ucac5.sam'	! UCAC5 catalog (107,758,513 sources)

C  Format for file interpretation

    1 format(
     +  F11.7,1X,F11.7,1X,I19,1X,F11.7,1X,F11.7,1X,F5.1,1X,F4.1,1X,I1,
     +  1X,I2,1X,F8.3,1X,F7.1,1X,F7.1,1X,F5.1,1X,F4.1,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'ucac5.sam')
      write(6,*) '....Loading file: ucac5.sam'
      do i__=1,1000
        read(1,'(A161)')ar__
        read(ar__,1)
     +  RAdeg,DEdeg,SrcIDgaia,RAgaia,DEgaia,e_RAgaia,e_DEgaia,Org,Nu,
     +  EPucac,pmRA,pmDE,e_pmRA,e_pmDE,Gmag,f_mag,Rmag,Jmag,Hmag,Kmag
        if(ar__(128:133) .EQ. '') f_mag = rNULL__
        if(ar__(135:140) .EQ. '') Rmag = rNULL__
        if(ar__(142:147) .EQ. '') Jmag = rNULL__
        if(ar__(149:154) .EQ. '') Hmag = rNULL__
        if(ar__(156:161) .EQ. '') Kmag = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg,DEdeg,SrcIDgaia,RAgaia,DEgaia,e_RAgaia,e_DEgaia,Org,Nu,
     +  EPucac,pmRA,pmDE,e_pmRA,e_pmDE,Gmag,f_mag,Rmag,Jmag,Hmag,Kmag
c    .......End.of.Just test output...........
      end do
      close(1)

C=============================================================================
      stop
      end