FORTRAN Generation
(/./ftp/cats/II/336)

Conversion of standardized ReadMe file for file /./ftp/cats/II/336 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=============================================================================
C  F77-compliant program generated by readme2f_1.81 (2015-09-23), on 2018-Nov-18
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. II/336       AAVSO Photometric All Sky Survey (APASS) DR9       (Henden+, 2016)
*================================================================================
*APASS: The AAVSO Photometric All-Sky Survey - Data Release 9
*    Henden A.A., Templeton M., Terrell D., Smith T.C., Levine S., Welch D.
*   <American Association of Variable Star Observers (AAVSO) (2016)>
*   =2015AAS...22533616H 
*   =2016yCat.2336....0H
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'apass9.sam'	! The APASS catalog, sample output
                                 (on a total of 62 million sources)

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

C  J2000 position composed of: RAdeg DEdeg
      real*8        RAdeg      (nr__) ! (deg) Right ascension in decimal degrees (J2000)
      real*8        DEdeg      (nr__) ! (deg) Declination in decimal degrees (J2000)
      real*4        e_RAdeg    (nr__) ! (arcsec) [0/2.4] RA uncertainty
      real*4        e_DEdeg    (nr__) ! (arcsec) [0/2.4] DEC uncertainty
      integer*8     Field      (nr__) ! [20110001/9999988888] Field name
      integer*4     nobs       (nr__) ! [2/387] Number of observed nights
      integer*4     mobs       (nr__) ! [2/3476] Number of images for this field,
*                                   usually nobs*5
      real*4        B_V        (nr__) ! (mag) [-7.5/13]? B-V color index
      real*4        e_B_V      (nr__) ! (mag) [0/10.1]? B-V uncertainty
      real*4        Vmag       (nr__) ! (mag) [5.5/27.4]? Johnson V-band magnitude
      real*4        e_Vmag     (nr__) ! (mag) [0/7]? Vmag uncertainty
      integer*4     u_e_Vmag   (nr__) ! [0/1]? Uncertainty flag on e_Vmag (1)
      real*4        Bmag       (nr__) ! (mag) [5.4/27.3]? Johnson B-band magnitude
      real*4        e_Bmag     (nr__) ! (mag) [0/10]? Bmag uncertainty
      integer*4     u_e_Bmag   (nr__) ! [0/1]? Uncertainty flag on e_Bmag (1)
      real*4        g_mag      (nr__) ! (mag) [5.9/24.2]? g'-band AB magnitude, Sloan filter
      real*4        e_g_mag    (nr__) ! (mag) [0/9.7]? g'mag uncertainty
      integer*4     u_e_g_mag  (nr__) ! [0/1]? Uncertainty flag on e_g'mag (1)
      real*4        r_mag      (nr__) ! (mag) [5.1/23.9]? r'-band AB magnitude, Sloan filter
      real*4        e_r_mag    (nr__) ! (mag) [0/6.5]? r'mag uncertainty
      integer*4     u_e_r_mag  (nr__) ! [0/1]? Uncertainty flag on e_r'mag (1)
      real*4        i_mag      (nr__) ! (mag) [4.2/29.1]? i'-band AB magnitude, Sloan filter
      real*4        e_i_mag    (nr__) ! (mag) [0/9.6]? i'mag uncertainty
      integer*4     u_e_i_mag  (nr__) ! [0/1]? Uncertainty flag on e_i'mag (1)
*Note (1): Uncertainty flag as follows:
*  0 = Standard deviation of N observations
*  1 = Poissonian error (unique observation)

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

C  Loading file 'apass9.sam'	! The APASS catalog, sample output
*                                 (on a total of 62 million sources)

C  Format for file interpretation

    1 format(
     +  F10.6,1X,F10.6,1X,F5.3,1X,F5.3,1X,I10,1X,I3,1X,I4,1X,F6.3,1X,
     +  F6.3,1X,F6.3,1X,F6.3,1X,I1,1X,F6.3,1X,F6.3,1X,I1,1X,F6.3,1X,
     +  F6.3,1X,I1,1X,F6.3,1X,F6.3,1X,I1,1X,F6.3,1X,F6.3,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'apass9.sam')
      write(6,*) '....Loading file: apass9.sam'
      do i__=1,1000
        read(1,'(A147)')ar__
        read(ar__,1)
     +  RAdeg(i__),DEdeg(i__),e_RAdeg(i__),e_DEdeg(i__),Field(i__),
     +  nobs(i__),mobs(i__),B_V(i__),e_B_V(i__),Vmag(i__),e_Vmag(i__),
     +  u_e_Vmag(i__),Bmag(i__),e_Bmag(i__),u_e_Bmag(i__),g_mag(i__),
     +  e_g_mag(i__),u_e_g_mag(i__),r_mag(i__),e_r_mag(i__),
     +  u_e_r_mag(i__),i_mag(i__),e_i_mag(i__),u_e_i_mag(i__)
        if(ar__(55:60) .EQ. '') B_V(i__) = rNULL__
        if(ar__(62:67) .EQ. '') e_B_V(i__) = rNULL__
        if(ar__(69:74) .EQ. '') Vmag(i__) = rNULL__
        if(ar__(76:81) .EQ. '') e_Vmag(i__) = rNULL__
        if(ar__(83:83) .EQ. '') u_e_Vmag(i__) = iNULL__
        if(ar__(85:90) .EQ. '') Bmag(i__) = rNULL__
        if(ar__(92:97) .EQ. '') e_Bmag(i__) = rNULL__
        if(ar__(99:99) .EQ. '') u_e_Bmag(i__) = iNULL__
        if(ar__(101:106) .EQ. '') g_mag(i__) = rNULL__
        if(ar__(108:113) .EQ. '') e_g_mag(i__) = rNULL__
        if(ar__(115:115) .EQ. '') u_e_g_mag(i__) = iNULL__
        if(ar__(117:122) .EQ. '') r_mag(i__) = rNULL__
        if(ar__(124:129) .EQ. '') e_r_mag(i__) = rNULL__
        if(ar__(131:131) .EQ. '') u_e_r_mag(i__) = iNULL__
        if(ar__(133:138) .EQ. '') i_mag(i__) = rNULL__
        if(ar__(140:145) .EQ. '') e_i_mag(i__) = rNULL__
        if(ar__(147:147) .EQ. '') u_e_i_mag(i__) = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg(i__),DEdeg(i__),e_RAdeg(i__),e_DEdeg(i__),Field(i__),
     +  nobs(i__),mobs(i__),B_V(i__),e_B_V(i__),Vmag(i__),e_Vmag(i__),
     +  u_e_Vmag(i__),Bmag(i__),e_Bmag(i__),u_e_Bmag(i__),g_mag(i__),
     +  e_g_mag(i__),u_e_g_mag(i__),r_mag(i__),e_r_mag(i__),
     +  u_e_r_mag(i__),i_mag(i__),e_i_mag(i__),u_e_i_mag(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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