FORTRAN Generation
(/./ftp/cats/J/MNRAS/417/2230)

Conversion of standardized ReadMe file for file /./ftp/cats/J/MNRAS/417/2230 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/MNRAS/417/2230 BVRI+SDSS+2MASS and WISE photometry of 289 stars (Bilir+, 2011)
*================================================================================
*Transformations between the WISE, 2MASS, SDSS and BVRI photometric systems.
*I. Transformation equations for dwarfs.
*    Bilir S., Karaali S., Ak S., Dagtekin N.D., Onal O., Yaz E., Coskunoglu B.,
*    Cabrera-Lavers A.
*   <Mon. Not. R. Astron. Soc., 417, 2230-2238 (2011)>
*   =2011MNRAS.417.2230B
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Johnson-Cousins, SDSS, 2MASS and WISE magnitudes
                             and colours of the sample stars

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

C  Position composed of: GLON GLAT
      character*14  v_BAK2008_  ! Star name, from Bilir et al. 2008,
*                                   Cat. J/MNRAS/384/1178
      real*8        GLON        ! (deg) Galactic longitude
      real*8        GLAT        ! (deg) Galactic latitude
      real*4        Vmag        ! (mag) ?=- Johnson V apparent magnitude
      real*4        B_V         ! (mag) ?=- Johnson B-V colour index
      real*4        R_I         ! (mag) ?=- Cousins R-I colour index
      real*4        gmag        ! (mag) SDSS g apparent magnitude
      real*4        g_r         ! (mag) SDSS g-r colour index
      real*4        r_i_1       ! (mag) SDSS r-i colour index
      real*4        Jmag        ! (mag) 2MASS J apparent magnitude
      real*4        J_H         ! (mag) 2MASS J-H colour index
      real*4        H_Ks        ! (mag) 2MASS H-Ks colour index
      real*4        W1mag       ! (mag) Wise W1 apparent magnitude
      real*4        W1_W2       ! (mag) Wise W1-W2 colour index
      real*4        E_B_V       ! (mag) Reduced E(B-V) colour excess

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

C  Loading file 'table1.dat'	! Johnson-Cousins, SDSS, 2MASS and WISE magnitudes
*                             and colours of the sample stars

C  Format for file interpretation

    1 format(
     +  A14,1X,F9.5,1X,F8.5,1X,F6.3,1X,F5.3,1X,F5.3,1X,F6.3,1X,F5.3,
     +  1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F5.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,289
        read(1,'(A111)')ar__
        read(ar__,1)
     +  v_BAK2008_,GLON,GLAT,Vmag,B_V,R_I,gmag,g_r,r_i_1,Jmag,J_H,
     +  H_Ks,W1mag,W1_W2,E_B_V
        if (idig(ar__(35:40)).EQ.0) Vmag =  rNULL__
        if (idig(ar__(42:46)).EQ.0) B_V =  rNULL__
        if (idig(ar__(48:52)).EQ.0) R_I =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  v_BAK2008_,GLON,GLAT,Vmag,B_V,R_I,gmag,g_r,r_i_1,Jmag,J_H,
     +  H_Ks,W1mag,W1_W2,E_B_V
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