FORTRAN Generation
(/./ftp/cats/J/A_A/240/262)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/240/262 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-20
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/A+A/240/262     UBVR photometry of the open cluster King 2    (Aparicio+ 1990)
*================================================================================
*CCD UBVR photometry of the old rich open cluster King 2:
*comparison with theoretical models.
*      Aparicio A., Bertelli G., Chiosi C., Garcia-Pelayo J.M.
*     <Astron. Astrophys. 240, 262 (1990)>
*     =1990A&A...240..262A
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table3.dat'	! Photometric data of King 2

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

      integer*4     ABC         ! Sequential number, Cl* King 2 ABC NNN in Simbad
      real*4        Xpos        ! (pix) X position (1)
      real*8        Ypos        ! (pix) Y position (1)
      real*4        Vmag        ! (mag) Johnson V magnitude
      real*4        e_Vmag      ! (mag) rms uncertainty on Vmag
      real*4        U_B         ! (mag) ?=- Johnson U-B colour index
      real*4        e_U_B       ! (mag) ?=- rms uncertainty on U-B
      real*4        B_V         ! (mag) ?=- Johnson B-V colour index
      real*4        e_B_V       ! (mag) ?=- rms uncertainty on B-V
      real*4        V_Rc        ! (mag) ?=- Johnson-Cousins V-R colour index
      real*4        e_V_Rc      ! (mag) ?=- rms uncertainty on V-Rc
*Note (1): North at the left and east at the bottom. 1pix=15{mu}m=0.254".

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

C  Loading file 'table3.dat'	! Photometric data of King 2

C  Format for file interpretation

    1 format(
     +  I3,1X,F6.2,1X,F7.2,1X,F5.2,1X,F4.2,1X,F5.2,1X,F4.2,1X,F4.2,1X,
     +  F4.2,1X,F5.2,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,748
        read(1,'(A61)')ar__
        read(ar__,1)
     +  ABC,Xpos,Ypos,Vmag,e_Vmag,U_B,e_U_B,B_V,e_B_V,V_Rc,e_V_Rc
        if (idig(ar__(31:35)).EQ.0) U_B =  rNULL__
        if (idig(ar__(37:40)).EQ.0) e_U_B =  rNULL__
        if (idig(ar__(42:45)).EQ.0) B_V =  rNULL__
        if (idig(ar__(47:50)).EQ.0) e_B_V =  rNULL__
        if (idig(ar__(52:56)).EQ.0) V_Rc =  rNULL__
        if (idig(ar__(58:61)).EQ.0) e_V_Rc =  rNULL__
c    ..............Just test output...........
        write(6,1)
     +  ABC,Xpos,Ypos,Vmag,e_Vmag,U_B,e_U_B,B_V,e_B_V,V_Rc,e_V_Rc
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