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

Conversion of standardized ReadMe file for file /./ftp/cats/I/317 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/317               The PPMXL Catalog                   (Roeser+ 2010)
*================================================================================
*The PPMXL catalog of positions and proper motions on the ICRS. Combining
*USNO-B1.0 and the two Micron All Sky Survey (2MASS).
*     Roeeser S., Demleitner M., Schilbach E.
*    <Astron. J. 139, 2440 (2010)>
*    =2010AJ....139.2440R
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'sample.out'	! Example of formatted output

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

C  J2000.0 position composed of: RAdeg DEdeg (Epoch=2000.0)
      character*19  PPMXL       ! Identifier (5)
      real*8        RAdeg       ! (deg) Right Ascension J2000.0, epoch 2000.0
      real*8        DEdeg       ! (deg) Declination J2000.0, epoch 2000.0
      real*8        pmRA        ! (mas/yr) Proper Motion in RA*cos(DEdeg)
      real*8        pmDE        ! (mas/yr) Proper Motion in Dec
      real*8        epRA        ! (yr) Mean Epoch (RA)
      real*8        epDE        ! (yr) Mean Epoch (Dec)
      integer*4     e_RAdeg     ! (mas) Mean error in RA*cos(DEdeg) at mean epoch (6)
      integer*4     e_DEdeg     ! (mas) Mean error in Dec at mean epoch (6)
      real*4        e_pmRA      ! (mas/yr) Mean error in pmRA*cos(DEdeg)
      real*4        e_pmDE      ! (mas/yr) Mean error in pmDec
      real*4        Jmag        ! (mag) ? J magnitude from 2MASS (Cat. II/246)
      real*4        e_Jmag      ! (mag) ? J total magnitude uncertainty
      real*4        Hmag        ! (mag) ? H magnitude from 2MASS (Cat. II/246)
      real*4        e_Hmag      ! (mag) ? H total magnitude uncertainty
      real*4        Kmag        ! (mag) ? Ks magnitude from 2MASS (Cat. II/246)
      real*4        e_Kmag      ! (mag) ? Ks total magnitude uncertainty
      real*4        b1mag       ! (mag) ? B mag from USNO-B, first epoch (1)
      real*4        b2mag       ! (mag) ? B mag from USNO-B, second epoch (1)
      real*4        r1mag       ! (mag) ? R mag from USNO-B, first epoch (1)
      real*4        r2mag       ! (mag) ? R mag from USNO-B, second epoch (1)
      real*4        imag        ! (mag) ? I mag from USNO-B (1)
      character*5   Smags       ! [0-8-] Surveys used for USNO-B magnitudes (2)
      integer*4     No          ! ? Number of observations used (4)
      integer*4     fl          ! Flags (3)
*Note (1): Magnitudes from USNO-B (Cat. I/284) should be used with care,
*     photometric calibration may be severely off for some plates.
*
*     For objects from PPMX (Cat I/312, bit#1 set in "fl"), these
*     magnitudes have a special meaning:
*     ------------------------------------------------------------
*     Column  [PPMX]   Content
*     ------------------------------------------------------------
*     b1mag   [Cmag]   Catalogue magnitude from source
*     b2mag   [Bmag]   Johnson B magnitude
*     r1mag   [Rmag]   calculated Ru (UCAC) magnitude from source
*     r2mag    ---     (always empty)
*     imag    [Vmag]   Johnson V magnitude
*     ------------------------------------------------------------
*Note (2): Flags indicating the origin of the 5 USNO-B magnitudes,
*     (except when bit#1 set in "fl", see Note(1) above):
*     ---------------------------------------------------
*     #   Survey   Emuls  Wavelen.   Zones  Fld  Dates
*                           (nm)                  Obs.
*     ---------------------------------------------------
*     0 = POSS-I   103a-O  350-500 -30..+90 936 1949-1965
*     1 = POSS-I   103a-E  620-670 -30..+90 936 1949-1965
*     2 = POSS-II  IIIa-J  385-540 +00..+87 897 1985-2000
*     3 = POSS-II  IIIa-F  610-690 +00..+87 897 1985-1999
*     4 = SERC-J   IIIa-J  385-540 -90..-05 606 1978-1990
*     5 = ESO-R    IIIa-F  630-690 -90..-05 624 1974-1994
*     6 = AAO-R    IIIa-F  590-690 -90..-20 606 1985-1998
*     7 = POSS-II* IV-N    730-900 +05..+87 800 1981-2002
*     8 = SERC-I   IV-N    715-900 -90..+00 892 1978-2002
*     ---------------------------------------------------
*     (*) Here #7 includes the SERC-I plates in the zones
*         +05..+20 (numbered #9 in USNO-B1.0)
*     ---------------------------------------------------
*Note (3): The flag is a bitwise or number ({Sigma}2^i^)
*      which each bit number (i) has the meaning:
*      #0 (1) = if set, one of the coordinates had an excessively large
*               chi square.
*      #1 (2) = Row is from PPMX (Cat. I/312). These objects are mostly
*               Tycho stars that were masked out of USNO-B. When this
*               bit is set, the USNO magnitudes (b1mag through imag)
*               have special meanings, see Note (1) above.
*      #2 (4) = Row is from PPMX (Cat. I/312) and replaces a single row
*               from USNO-B. This is done when the astrometry from PPMX
*               was better (in terms of error estimates) than the astrometry
*               of the corresponding PPMXL object.
*      #3 (8) = Row replaces multiple USNO-B1.0 objects. When PPMX contains
*               an object that has more than one counterpart in PPMXL, all
*               such counterparts are discarded on the assumption that they
*               should have been matched in USNO-B1.0 or result from
*               erroneous matches. For these rows, bit#1 is always 1.
*Note (4): No may be blank (null) for stars coming from ARIHIP or
*     Tycho-2 via PPMX (i.e. bit#1 is set in "fl")
*Note (5): the identifier is a 64-bit integer representing the "pixel"
*      number of the USNO-B 1.0 object in Q3C (QuadTreeCube, Koposov and
*      Glushkova 2006IAUJD..13E..43K [ADASS 2005]).
*Note (6): the mean errors at epoch J2000 are the convolution of the mean
*     error at the mean epoch and the error due to the propagation of the
*     error on the proper motion, i.e.
*     {sigma}(J2000) = sqrt[{sigma}_0_^2^ + ((2000-t_0_)*{sigma}(pm))^2^]

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

C  Declarations for 'dat/*'	! *PPMXL catalog organized by declination zones of 15'

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

C  J2000.0 position composed of: RAdeg DEdeg (Epoch=2000.0)
      character*19  PPMXL_1     ! Identifier (5)
      real*8        RAdeg_1     ! (deg) Right Ascension J2000.0, epoch 2000.0
      real*8        DEdeg_1     ! (deg) Declination J2000.0, epoch 2000.0
      real*8        pmRA_1      ! (mas/yr) Proper Motion in RA*cos(DEdeg)
      real*8        pmDE_1      ! (mas/yr) Proper Motion in Dec
      real*8        epRA_1      ! (yr) Mean Epoch (RA)
      real*8        epDE_1      ! (yr) Mean Epoch (Dec)
      integer*4     e_RAdeg_1   ! (mas) Mean error in RA*cos(DEdeg) at mean epoch (6)
      integer*4     e_DEdeg_1   ! (mas) Mean error in Dec at mean epoch (6)
      real*4        e_pmRA_1    ! (mas/yr) Mean error in pmRA*cos(DEdeg)
      real*4        e_pmDE_1    ! (mas/yr) Mean error in pmDec
      real*4        Jmag_1      ! (mag) ? J magnitude from 2MASS (Cat. II/246)
      real*4        e_Jmag_1    ! (mag) ? J total magnitude uncertainty
      real*4        Hmag_1      ! (mag) ? H magnitude from 2MASS (Cat. II/246)
      real*4        e_Hmag_1    ! (mag) ? H total magnitude uncertainty
      real*4        Kmag_1      ! (mag) ? Ks magnitude from 2MASS (Cat. II/246)
      real*4        e_Kmag_1    ! (mag) ? Ks total magnitude uncertainty
      real*4        b1mag_1     ! (mag) ? B mag from USNO-B, first epoch (1)
      real*4        b2mag_1     ! (mag) ? B mag from USNO-B, second epoch (1)
      real*4        r1mag_1     ! (mag) ? R mag from USNO-B, first epoch (1)
      real*4        r2mag_1     ! (mag) ? R mag from USNO-B, second epoch (1)
      real*4        imag_1      ! (mag) ? I mag from USNO-B (1)
      character*5   Smags_1     ! [0-8-] Surveys used for USNO-B magnitudes (2)
      integer*4     No_1        ! ? Number of observations used (4)
      integer*4     fl_1        ! Flags (3)
*Note (1): Magnitudes from USNO-B (Cat. I/284) should be used with care,
*     photometric calibration may be severely off for some plates.
*
*     For objects from PPMX (Cat I/312, bit#1 set in "fl"), these
*     magnitudes have a special meaning:
*     ------------------------------------------------------------
*     Column  [PPMX]   Content
*     ------------------------------------------------------------
*     b1mag   [Cmag]   Catalogue magnitude from source
*     b2mag   [Bmag]   Johnson B magnitude
*     r1mag   [Rmag]   calculated Ru (UCAC) magnitude from source
*     r2mag    ---     (always empty)
*     imag    [Vmag]   Johnson V magnitude
*     ------------------------------------------------------------
*Note (2): Flags indicating the origin of the 5 USNO-B magnitudes,
*     (except when bit#1 set in "fl", see Note(1) above):
*     ---------------------------------------------------
*     #   Survey   Emuls  Wavelen.   Zones  Fld  Dates
*                           (nm)                  Obs.
*     ---------------------------------------------------
*     0 = POSS-I   103a-O  350-500 -30..+90 936 1949-1965
*     1 = POSS-I   103a-E  620-670 -30..+90 936 1949-1965
*     2 = POSS-II  IIIa-J  385-540 +00..+87 897 1985-2000
*     3 = POSS-II  IIIa-F  610-690 +00..+87 897 1985-1999
*     4 = SERC-J   IIIa-J  385-540 -90..-05 606 1978-1990
*     5 = ESO-R    IIIa-F  630-690 -90..-05 624 1974-1994
*     6 = AAO-R    IIIa-F  590-690 -90..-20 606 1985-1998
*     7 = POSS-II* IV-N    730-900 +05..+87 800 1981-2002
*     8 = SERC-I   IV-N    715-900 -90..+00 892 1978-2002
*     ---------------------------------------------------
*     (*) Here #7 includes the SERC-I plates in the zones
*         +05..+20 (numbered #9 in USNO-B1.0)
*     ---------------------------------------------------
*Note (3): The flag is a bitwise or number ({Sigma}2^i^)
*      which each bit number (i) has the meaning:
*      #0 (1) = if set, one of the coordinates had an excessively large
*               chi square.
*      #1 (2) = Row is from PPMX (Cat. I/312). These objects are mostly
*               Tycho stars that were masked out of USNO-B. When this
*               bit is set, the USNO magnitudes (b1mag through imag)
*               have special meanings, see Note (1) above.
*      #2 (4) = Row is from PPMX (Cat. I/312) and replaces a single row
*               from USNO-B. This is done when the astrometry from PPMX
*               was better (in terms of error estimates) than the astrometry
*               of the corresponding PPMXL object.
*      #3 (8) = Row replaces multiple USNO-B1.0 objects. When PPMX contains
*               an object that has more than one counterpart in PPMXL, all
*               such counterparts are discarded on the assumption that they
*               should have been matched in USNO-B1.0 or result from
*               erroneous matches. For these rows, bit#1 is always 1.
*Note (4): No may be blank (null) for stars coming from ARIHIP or
*     Tycho-2 via PPMX (i.e. bit#1 is set in "fl")
*Note (5): the identifier is a 64-bit integer representing the "pixel"
*      number of the USNO-B 1.0 object in Q3C (QuadTreeCube, Koposov and
*      Glushkova 2006IAUJD..13E..43K [ADASS 2005]).
*Note (6): the mean errors at epoch J2000 are the convolution of the mean
*     error at the mean epoch and the error due to the propagation of the
*     error on the proper motion, i.e.
*     {sigma}(J2000) = sqrt[{sigma}_0_^2^ + ((2000-t_0_)*{sigma}(pm))^2^]

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

C  Loading file 'sample.out'	! Example of formatted output

C  Format for file interpretation

    1 format(
     +  A19,1X,F10.6,F10.6,1X,F8.1,1X,F8.1,1X,F7.2,1X,F7.2,1X,I3,1X,
     +  I3,1X,F4.1,1X,F4.1,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,
     +  F5.3,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,A5,1X,I2,1X,I2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'sample.out')
      write(6,*) '....Loading file: sample.out'
      do i__=1,111
        read(1,'(A173)')ar__
        read(ar__,1)
     +  PPMXL,RAdeg,DEdeg,pmRA,pmDE,epRA,epDE,e_RAdeg,e_DEdeg,e_pmRA,
     +  e_pmDE,Jmag,e_Jmag,Hmag,e_Hmag,Kmag,e_Kmag,b1mag,b2mag,r1mag,
     +  r2mag,imag,Smags,No,fl
        if(ar__(94:99) .EQ. '') Jmag = rNULL__
        if(ar__(101:105) .EQ. '') e_Jmag = rNULL__
        if(ar__(107:112) .EQ. '') Hmag = rNULL__
        if(ar__(114:118) .EQ. '') e_Hmag = rNULL__
        if(ar__(120:125) .EQ. '') Kmag = rNULL__
        if(ar__(127:131) .EQ. '') e_Kmag = rNULL__
        if(ar__(133:137) .EQ. '') b1mag = rNULL__
        if(ar__(139:143) .EQ. '') b2mag = rNULL__
        if(ar__(145:149) .EQ. '') r1mag = rNULL__
        if(ar__(151:155) .EQ. '') r2mag = rNULL__
        if(ar__(157:161) .EQ. '') imag = rNULL__
        if(ar__(169:170) .EQ. '') No = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  PPMXL,RAdeg,DEdeg,pmRA,pmDE,epRA,epDE,e_RAdeg,e_DEdeg,e_pmRA,
     +  e_pmDE,Jmag,e_Jmag,Hmag,e_Hmag,Kmag,e_Kmag,b1mag,b2mag,r1mag,
     +  r2mag,imag,Smags,No,fl
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'dat/*'	! *PPMXL catalog organized by declination zones of 15'

C  Format for file interpretation

    2 format(
     +  A19,1X,F10.6,F10.6,1X,F8.1,1X,F8.1,1X,F7.2,1X,F7.2,1X,I3,1X,
     +  I3,1X,F4.1,1X,F4.1,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,
     +  F5.3,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,A5,1X,I2,1X,I2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'dat/*')
      write(6,*) '....Loading file: dat/*'
      do i__=1,720
        read(1,'(A173)')ar__1
        read(ar__1,2)
     +  PPMXL_1,RAdeg_1,DEdeg_1,pmRA_1,pmDE_1,epRA_1,epDE_1,e_RAdeg_1,
     +  e_DEdeg_1,e_pmRA_1,e_pmDE_1,Jmag_1,e_Jmag_1,Hmag_1,e_Hmag_1,
     +  Kmag_1,e_Kmag_1,b1mag_1,b2mag_1,r1mag_1,r2mag_1,imag_1,
     +  Smags_1,No_1,fl_1
        if(ar__1(94:99) .EQ. '') Jmag_1 = rNULL__
        if(ar__1(101:105) .EQ. '') e_Jmag_1 = rNULL__
        if(ar__1(107:112) .EQ. '') Hmag_1 = rNULL__
        if(ar__1(114:118) .EQ. '') e_Hmag_1 = rNULL__
        if(ar__1(120:125) .EQ. '') Kmag_1 = rNULL__
        if(ar__1(127:131) .EQ. '') e_Kmag_1 = rNULL__
        if(ar__1(133:137) .EQ. '') b1mag_1 = rNULL__
        if(ar__1(139:143) .EQ. '') b2mag_1 = rNULL__
        if(ar__1(145:149) .EQ. '') r1mag_1 = rNULL__
        if(ar__1(151:155) .EQ. '') r2mag_1 = rNULL__
        if(ar__1(157:161) .EQ. '') imag_1 = rNULL__
        if(ar__1(169:170) .EQ. '') No_1 = iNULL__
c    ..............Just test output...........
        write(6,2)
     +  PPMXL_1,RAdeg_1,DEdeg_1,pmRA_1,pmDE_1,epRA_1,epDE_1,e_RAdeg_1,
     +  e_DEdeg_1,e_pmRA_1,e_pmDE_1,Jmag_1,e_Jmag_1,Hmag_1,e_Hmag_1,
     +  Kmag_1,e_Kmag_1,b1mag_1,b2mag_1,r1mag_1,r2mag_1,imag_1,
     +  Smags_1,No_1,fl_1
c    .......End.of.Just test output...........
      end do
      close(1)

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