FORTRAN Generation
(/./ftp/cats/J/PASP/115/413)

Conversion of standardized ReadMe file for file /./ftp/cats/J/PASP/115/413 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/PASP/115/413    BVI photometry in the open cluster NGC 6791  (Stetson+, 2003)
*================================================================================
*Homogeneous photometry. III. A star catalog for the open cluster NGC 6791.
*    Stetson P.B., Bruntt H., Grundahl F.
*   <Publ. Astron. Soc. Pac., 115, 413-447 (2003)>
*   =2003PASP..115..413S
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! Main data table

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

C  J2000.0 position composed of: RAh RAm RAs DE- DEd DEm DEs
      real*8        RAdeg       ! (deg) Right Ascension J2000.0
      real*8        DEdeg       ! (deg)     Declination J2000.0
C  ---------------------------------- ! (position vector(s) in degrees)

      integer*4     SBG         ! Sequential identification number (1)
      real*4        Xpos        ! (pix) X in accompanying image (2)
      real*4        Ypos        ! (pix) Y in accompanying image (2)
      real*4        Bmag        ! (mag) ?=99.999 B-band magnitude
      real*4        e_Bmag      ! (mag) ?=9.9999 {sigma}(B), standard error of the mean
      integer*4     o_Bmag      ! Number of valid photometric measurements in B
      real*4        Vmag        ! (mag) ?=99.999 V-band magnitude
      real*4        e_Vmag      ! (mag) ?=9.9999 {sigma}(V), standard error of the mean
      integer*4     o_Vmag      ! Number of valid photometric measurements in V
      real*4        Imag        ! (mag) ?=99.999 I-band magnitude
      real*4        e_Imag      ! (mag) ?=9.9999 {sigma}(I), standard error of the mean
      integer*4     o_Imag      ! Number of valid photometric measurements in I
      real*4        chi         ! Mean value of the {chi} image-quality index (3)
      real*8        sharp       ! Mean value of the sharp image-quality index (4)
      real*4        sep         ! ?=99.99 Value of the sep image-isolation index (5)
      real*8        VI          ! Value of the variability index
      real*4        w_VI        ! Weight of the variability index
      integer*4     RAh         ! (h) Hour of Right Ascension (J2000.0)
      integer*4     RAm         ! (min) Minute of Right Ascension (J2000.0)
      real*4        RAs         ! (s) Second of Right Ascension (J2000.0)
      character*1   DE_         ! Sign of the Declination (J2000.0)
      integer*4     DEd         ! (deg) Degree of Declination (J2000.0)
      integer*4     DEm         ! (arcmin) Arcminute of Declination (J2000.0)
      real*4        DEs         ! (arcsec) Arcsecond of Declination (J2000.0)
      integer*4     Num         ! Number of images used for the astrometry
*Note (1): Cl* NGC 6791 SBG NNNNN in Simbad
*Note (2): Equinox J2000.0, {alpha}=19h20min53s, {delta}=+37{deg}46.5arcmin.
*          Xpos increases E at 0.5"/pixel and Ypos increases N at 0.5"/pixel
*Note (3): The average goodness-of-fit index {chi} is a dimensionless measure of
*          the agreement between the perceived brightness profile of any given
*          object and the model PSF for the frame in which it is measured; it is
*          essentially the square root of the standard {chi}^2^ goodness-of-fit
*          index, with the fitting residual in each pixel of the profile suitably
*          weighted by that pixel's expected standard error (derived from readout
*          and Poisson noise). The perceived range of {chi} values will tend to
*          taper inward toward unity at increasingly faint magnitudes.
*Note (4): The index sharp is based upon the pixel-by-pixel residuals from the
*          fitting of the model PSF to the data for any given star, except in
*          this case it is a measure of the degree to which the negative
*          brightness residuals are more or less centrally concentrated than the
*          positive residuals. In essence, it is a first-order estimate of the
*          intrinsic angular radius of a resolved source; assuming that the PSF
*          has a characteristic radius s_PSF_ and the measured image profile has
*          a characteristic radius s_obsi_, sharp^2^~|s_obs_^2^-s_PSF_^2^|.
*          If s_obs_>s_PSF_, then sharp is assigned a positive value and
*          if s_obs_<s_PSF_, then sharp is assigned a negative value.
*Note (5): The surface brightness produced by a star of specified apparent
*          magnitude and centroid position can be determined at any point within
*          the field. We can evaluate the local surface brightness at the
*          position of the centroid of that star. At the same time, we can
*          evaluate and sum up the surface brightnesses produced by all the other
*          stars in the field at the position of the centroid of the star in
*          question. The ratio of these two surface brightnesses - the central
*          surface brightness of the star in question as compared to the summed
*          surface brightnesses of all other stars in the list evaluated at the
*          same position - expressed as a magnitude, constitutes our "separation
*          index" sep. For instance, a computed value sep=5 implies that at its
*          centroid the star is about 100 times brighter than the summed profiles
*          of all other stars in the field, and we conclude that the star is
*          contaminated at a level of ~1%. Conversely, a value sep<0 implies that
*          the central surface brightness of the star in question is fainter than
*          the summed wings of all the other stars at that position, and the
*          detection is possibly spurious or, at best, a poor measurement of a
*          badly crowded object.

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

C  Declarations for 'crossid.dat'	! Transit table containing star cross-identifications

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

      integer*4     SBG_1       ! Source name
      character*6   K65         ! Object number in Kinman, T. D.,
*                                   1965ApJ...142..655K
      character*2   HC          ! Object number in Harris & Canterna
*                                   1981AJ.....86.1332H (1)
      integer*4     ATT         ! ? Object number in Anthony-Twarog & Twarog
*                                   1985ApJ...291..595A (2)
      integer*4     K90         ! ? Object number in Kaluzny, J.
*                                   1990MNRAS.243..492K
      integer*4     KU          ! ? Object number in Kaluzni & Udalski
*                                   1992AcA....42...29K (3)
      character*3   GVZH        ! Object number in Garnavich et al.
*                                   1994AJ....107.1097G (4)
      integer*4     MJP         ! ? Object number in Montgomery et al.
*                                   1994, Cat. <J/AJ/108/585> (5)
      character*3   KUB         ! Object number in Kaluzny & Rucinski
*                                   1995, Cat. <J/A+AS/114/1> (6)
      integer*4     KR1         ! ? Object number in Kaluzny & Rucinski
*                                   1995, Cat. <J/A+AS/114/1> (7)
      integer*4     KR2         ! ? Object number in Kaluzni & Rucinski
*                                   1995, Cat. <J/A+AS/114/1> (8)
      character*3   KR          ! Object number in Mochejska, B. J.
*                                   2002, Cat. <J/AJ/123/3460> (9)
*Note (1): Cl* NGC 6791 HC SN in Simbad
*Note (2): Cl* NGC 6791 ATT  NNN
*Note (3): Cl* NGC 6791 KU NNNN in Simbad
*Note (4): Cl* NGC 6791 GVZH RNN in Simbad
*Note (5): Cl* NGC 6791 MJP NNNN
*Note (6): Cl* NGC 6791 KU BNN in Simbad
*Note (7): Cl* NGC 6791 KR 1-NNNN in Simbad
*Note (8): Cl* NGC 6791 KR 2-NNNNN in Simbad
*Note (9): Cl* NGC 6791 KR VNN or Cl* NGC 6791 BU BNN in Simbad

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

C  Loading file 'catalog.dat'	! Main data table

C  Format for file interpretation

    1 format(
     +  I5,1X,F6.1,1X,F6.1,1X,F6.3,1X,F6.4,1X,I4,1X,F6.3,1X,F6.4,1X,
     +  I4,1X,F6.3,1X,F6.4,1X,I4,2X,F6.3,1X,F7.3,2X,F5.2,1X,F7.3,1X,
     +  F5.1,1X,I3,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,2X,I4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,16258
        read(1,'(A144)')ar__
        read(ar__,1)
     +  SBG,Xpos,Ypos,Bmag,e_Bmag,o_Bmag,Vmag,e_Vmag,o_Vmag,Imag,
     +  e_Imag,o_Imag,chi,sharp,sep,VI,w_VI,RAh,RAm,RAs,DE_,DEd,DEm,
     +  DEs,Num
        RAdeg = rNULL__
        DEdeg = rNULL__
c  Derive coordinates RAdeg and DEdeg from input data
c  (RAdeg and DEdeg are set to rNULL__ when unknown)
        if(RAh .GT. -180) RAdeg=RAh*15.
        if(RAm .GT. -180) RAdeg=RAdeg+RAm/4.
        if(RAs .GT. -180) RAdeg=RAdeg+RAs/240.
        if(DEd .GE. 0) DEdeg=DEd
        if(DEm .GE. 0) DEdeg=DEdeg+DEm/60.
        if(DEs .GE. 0) DEdeg=DEdeg+DEs/3600.
        if(DE_.EQ.'-'.AND.DEdeg.GE.0) DEdeg=-DEdeg
c    ..............Just test output...........
        write(6,1)
     +  SBG,Xpos,Ypos,Bmag,e_Bmag,o_Bmag,Vmag,e_Vmag,o_Vmag,Imag,
     +  e_Imag,o_Imag,chi,sharp,sep,VI,w_VI,RAh,RAm,RAs,DE_,DEd,DEm,
     +  DEs,Num
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'crossid.dat'	! Transit table containing star cross-identifications

C  Format for file interpretation

    2 format(
     +  I5,1X,A6,1X,A2,1X,I3,1X,I4,1X,I4,1X,A3,1X,I4,1X,A3,1X,I4,1X,
     +  I5,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'crossid.dat')
      write(6,*) '....Loading file: crossid.dat'
      do i__=1,10389
        read(1,'(A57)')ar__1
        read(ar__1,2)SBG_1,K65,HC,ATT,K90,KU,GVZH,MJP,KUB,KR1,KR2,KR
        if(ar__1(17:19) .EQ. '') ATT = iNULL__
        if(ar__1(21:24) .EQ. '') K90 = iNULL__
        if(ar__1(26:29) .EQ. '') KU = iNULL__
        if(ar__1(35:38) .EQ. '') MJP = iNULL__
        if(ar__1(44:47) .EQ. '') KR1 = iNULL__
        if(ar__1(49:53) .EQ. '') KR2 = iNULL__
c    ..............Just test output...........
        write(6,2)SBG_1,K65,HC,ATT,K90,KU,GVZH,MJP,KUB,KR1,KR2,KR
c    .......End.of.Just test output...........
      end do
      close(1)

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