FORTRAN Generation

Conversion of standardized ReadMe file for file /./ftp/cats/I/340 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  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2018-Jan-19
*  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
*  Please report problems or questions to   

      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

Cat. I/340                  UCAC5 Catalogue                         (Zacharias+ 2017)
*UCAC5: New Proper Motions using Gaia DR1.
*    Zacharias N., Finch C., Frouard J.
*   <Astron. J., in prep. (2017)>
*   =2017yCat.1340....0Z

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      (nr__) ! (deg) UCAC right ascension (J2000) at epoch 
*                                     "EPucac" on Gaia reference frame (ira)
      real*8        DEdeg      (nr__) ! (deg) UCAC declination (J2000) at epoch 
*                                     "EPucac" on Gaia reference frame (idc)
      integer*8     SrcIDgaia  (nr__) ! Gaia source ID (srcid)
      real*8        RAgaia     (nr__) ! (deg) Gaia right ascension (ICRS) at epoch 2015.0 
*                                     (rag) (1)
      real*8        DEgaia     (nr__) ! (deg) Gaia declination (ICRS) at epoch 2015.0 
*                                     (dcg) (1)
      real*4        e_RAgaia   (nr__) ! (mas) rms uncertainty on RAgaia (erg) (1)
      real*4        e_DEgaia   (nr__) ! (mas) rms uncertainty on DEgaia (edg) (1)
      integer*4     Org        (nr__) ! [1/3] TGAS/NOMAD flag (flg) (2)
      integer*4     Nu         (nr__) ! Number of images used for mean position (nu)
      real*8        EPucac     (nr__) ! (yr) UCAC epoch (epu)
      real*8        pmRA       (nr__) ! (mas/yr) UCAC/Gaia proper motion in RA*cosDE (pmur)
      real*8        pmDE       (nr__) ! (mas/yr) UCAC/Gaia proper motion in DE (pmud)
      real*4        e_pmRA     (nr__) ! (mas/yr) rms uncertainty on pmRA (pmer)
      real*4        e_pmDE     (nr__) ! (mas/yr) rms uncertainty on pmDE (pmed)
      real*4        Gmag       (nr__) ! (mag) Gaia G magnitude (gmag)
      real*4        f_mag      (nr__) ! (mag) ? Means UCAC model magnitude (umag)
      real*4        Rmag       (nr__) ! (mag) ? Photographic R magnitude from NOMAD (rmag)
      real*4        Jmag       (nr__) ! (mag) ? 2MASS J magnitude (jmag)
      real*4        Hmag       (nr__) ! (mag) ? 2MASS H magnitude (hmag)
      real*4        Kmag       (nr__) ! (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  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

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