FORTRAN Generation
(/./ftp/cats/J/ApJ/676/944)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJ/676/944 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-Mar-29
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/ApJ/676/944 GALEX and CFHTLS candidate tidal disruption events (Gezari+, 2008)
*================================================================================
*UV/Optical detections of candidate tidal disruption events by GALEX and CFHTLS.
*    Gezari S., Basa S., Martin D.C., Bazin G., Forster K., Milliard B.,
*    Halpern J.P., Friedman P.G., Morrissey P., Neff S.G., Schiminovich D.,
*    Seibert M., Small T., Wyder T.K.
*   <Astrophys. J., 676, 944-969 (2008)>
*   =2008ApJ...676..944G
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'sources.dat'	! UV variable sources with optical matches in
                             XMM-LSS (D1, 23 sources, table 2),
                             COSMOS (D2, 23 sources, table 3),
                             GROTH (D3, 32 sources, table 4),
                             CFHTLS (D4, 9 sources, table 5),

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

C  J2000 position composed of: RAdeg DEdeg
      character*5   Name        ! Name (DN-NN)
      character*16  GALEX       ! GALEX name (JHHMMSS.s+DDMMSS)
      real*8        RAdeg       ! (deg) Right ascension in decimal degrees (J2000)
      real*8        DEdeg       ! (deg) Declination in decimal degrees (J2000)
      character*1   l_FUV03     ! Limit flag on FUV03
      real*4        FUV03       ! (mag) ?=- GALEX FUV (135-175nm) magnitude in 2003
      real*4        e_FUV03     ! (mag) ? rms uncertainty on FUV03
      character*1   l_FUV04     ! Limit flag on FUV04
      real*4        FUV04       ! (mag) GALEX FUV (135-175nm) magnitude in 2004
      real*4        e_FUV04     ! (mag) ? rms uncertainty on FUV04
      character*1   l_FUV05     ! Limit flag on FUV05
      real*4        FUV05       ! (mag) ?=- GALEX FUV (135-175nm) magnitude in 2005
      real*4        e_FUV05     ! (mag) ? rms uncertainty on FUV05
      character*1   l_FUV06     ! Limit flag on FUV06
      real*4        FUV06       ! (mag) GALEX FUV (135-175nm) magnitude in 2006
      real*4        e_FUV06     ! (mag) ? rms uncertainty on FUV06
      character*1   l_FUV07     ! Limit flag on FUV07
      real*4        FUV07       ! (mag) ?=- GALEX FUV (135-175nm) magnitude in 2007
      real*4        e_FUV07     ! (mag) ? rms uncertainty on FUV07
      real*4        sigma       ! Factor times {sigma}(m) that the source varies
      character*1   FT          ! [FT] Flare/Transient Type (G1)
      character*1   l_NUV03     ! Limit flag on NUV03
      real*4        NUV03       ! (mag) ?=- GALEX NUV (175-280nm) magnitude in 2003
      real*4        e_NUV03     ! (mag) ? rms uncertainty on NUV03
      character*1   l_NUV04     ! Limit flag on NUV04
      real*4        NUV04       ! (mag) GALEX NUV (175-280nm) magnitude in 2004
      real*4        e_NUV04     ! (mag) ? rms uncertainty on NUV04
      character*1   l_NUV05     ! Limit flag on NUV05
      real*4        NUV05       ! (mag) ?=- GALEX NUV (175-280nm) magnitude in 2005
      real*4        e_NUV05     ! (mag) ? rms uncertainty on NUV05
      character*1   l_NUV06     ! Limit flag on NUV06
      real*4        NUV06       ! (mag) GALEX NUV (175-280nm) magnitude in 2006
      real*4        e_NUV06     ! (mag) ? rms uncertainty on NUV06
      character*1   l_NUV07     ! Limit flag on NUV07
      real*4        NUV07       ! (mag) ?=- GALEX NUV (175-280nm) magnitude in 2007
      real*4        e_NUV07     ! (mag) ? rms uncertainty on NUV07

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

C  Declarations for 'matches.dat'	! Optical matches to UV variable sources in
                             XMM-LSS (D1, table 6), COSMOS (D2, table 7),
                             GROTH (D3, table 8) and CFHTLS (D4, table 9)

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

      character*5   Name_1      ! Name (DN-NN)
      character*16  GALEX_1     ! GALEX name (JHHMMSS.s+DDMMSS)
      real*4        umag        ! (mag) SDSS u magnitude
      real*4        e_umag      ! (mag) rms uncertainty on umag
      real*4        gmag        ! (mag) SDSS g magnitude
      real*4        e_gmag      ! (mag) rms uncertainty on gmag
      real*4        rmag        ! (mag) SDSS r magnitude
      real*4        e_rmag      ! (mag) rms uncertainty on rmag
      real*4        imag        ! (mag) SDSS i magnitude
      real*4        e_imag      ! (mag) rms uncertainty on imag
      real*4        zmag        ! (mag) SDSS z magnitude
      real*4        e_zmag      ! (mag) rms uncertainty on zmag
      real*4        r1_2        ! (arcsec) Half-light radius
      real*4        Sep         ! (arcsec) Separation UV/optical
      character*3   Flag        ! [oxsg ] Source pecularities (G2)
      character*4   Class       ! Classification (1)
      real*4        z           ! ? Redshift
*Note (1): Classification as follows:
*    QSO = optically unresolved sources (r_1/2_<0.6") with g-r<0.6 and
*          u-g<1 are classified as quasars
*   STAR = optically unresolved sources with u-g>1.75 or g-r<0.6 and
*          u-g>1 are classified as stars
*    GAL = optically resolved sources (r_1/2_>0.6") are classified as galaxies
*    AGN = optically resolved sources with a hard X-ray detection or an
*          active galaxy spectrum are classified as active galactic nuclei

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

C  Declarations for 'table10.dat'	! Tidal disruption flare candidates

      integer*4 nr__2
      parameter (nr__2=11)	! Number of records
      character*55 ar__2  	! Full-size record

      character*5   Name_2      ! Name (DN-NN)
      character*16  GALEX_2     ! GALEX name (JHHMMSS.s+DDMMSS)
      character*1   FT_1        ! [FT] Flare Type (G1)
      character*1   Flag_1      ! [o] Source pecularities (G2)
      character*4   Template    ! Galaxy template from photo-z fitting
*                                   routine (1)
      real*4        zph1        ! Photometric redshift range
      real*4        zph2        ! Photometric redshift range
      real*4        zsp         ! ? Spectroscopic redshift
      character*6   Type        ! Spectral type (2)
*Note (1): Emission-line galaxies (either star-forming or Seyfert galaxies)
*     are labeled as "em".
*Note (2): Classes are:
*    Early = spectra with no emission lines (early-type galaxies)
*      Sy2 = spectra with diagnostic narrow-line ratios of
*            ([OIII]{lambda}5007)/(H{beta})>3  (Seyfert 2 galaxies)
*      Sy1 = spectra that show broad H{beta} emission (Seyfert 1 galaxies)

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

C  Declarations for 'table11.dat'	! Log of optical spectroscopic observations

      integer*4 nr__3
      parameter (nr__3=8)	! Number of records
      character*80 ar__3  	! Full-size record

      character*5   Name_3      ! Name (DN-NN)
      character*16  GALEX_3     ! GALEX name (JHHMMSS.s+DDMMSS)
      character*10  Date        ! ("YYYY/MM/DD") UT date
      character*8   Tel         ! Telescope
      character*5   Inst        ! Instrument
      real*4        Slit        ! (arcsec) Slit
      real*4        Dlambda     ! (0.1nm) Interval wavelength
      integer*4     Texp        ! (s) Exposure time
      real*4        z_1         ! Spectroscopic redshift
      character*1   l__OIII_Hb_ ! Limit flag on [OIII/Hb]
      real*4        v_OIII_Hb_  ! ? [OIII]{lambda}5007)/(H{beta})
*                                           narrow-line ratio
      character*1   l_logL__OIII_ ! Limit flag on logL([OIII)]
      real*4        logL__OIII_ ! ([10-7W]) ? [OIII]{lambda}5007 luminosity

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

C  Loading file 'sources.dat'	! UV variable sources with optical matches in
*                             XMM-LSS (D1, 23 sources, table 2),
*                             COSMOS (D2, 23 sources, table 3),
*                             GROTH (D3, 32 sources, table 4),
*                             CFHTLS (D4, 9 sources, table 5),

C  Format for file interpretation

    1 format(
     +  A5,1X,A16,1X,F8.4,1X,F8.4,1X,A1,F5.2,1X,F4.2,1X,A1,F5.2,1X,
     +  F4.2,1X,A1,F5.2,1X,F4.2,1X,A1,F5.2,1X,F4.2,1X,A1,F5.2,1X,F4.2,
     +  1X,F4.1,1X,A1,1X,A1,F5.2,1X,F4.2,1X,A1,F5.2,1X,F4.2,1X,A1,
     +  F5.2,1X,F4.2,1X,A1,F5.2,1X,F4.2,1X,A1,F5.2,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'sources.dat')
      write(6,*) '....Loading file: sources.dat'
      do i__=1,87
        read(1,'(A167)')ar__
        read(ar__,1)
     +  Name,GALEX,RAdeg,DEdeg,l_FUV03,FUV03,e_FUV03,l_FUV04,FUV04,
     +  e_FUV04,l_FUV05,FUV05,e_FUV05,l_FUV06,FUV06,e_FUV06,l_FUV07,
     +  FUV07,e_FUV07,sigma,FT,l_NUV03,NUV03,e_NUV03,l_NUV04,NUV04,
     +  e_NUV04,l_NUV05,NUV05,e_NUV05,l_NUV06,NUV06,e_NUV06,l_NUV07,
     +  NUV07,e_NUV07
        if (idig(ar__(43:47)).EQ.0) FUV03 =  rNULL__
        if(ar__(49:52) .EQ. '') e_FUV03 = rNULL__
        if(ar__(61:64) .EQ. '') e_FUV04 = rNULL__
        if (idig(ar__(67:71)).EQ.0) FUV05 =  rNULL__
        if(ar__(73:76) .EQ. '') e_FUV05 = rNULL__
        if(ar__(85:88) .EQ. '') e_FUV06 = rNULL__
        if (idig(ar__(91:95)).EQ.0) FUV07 =  rNULL__
        if(ar__(97:100) .EQ. '') e_FUV07 = rNULL__
        if (idig(ar__(110:114)).EQ.0) NUV03 =  rNULL__
        if(ar__(116:119) .EQ. '') e_NUV03 = rNULL__
        if(ar__(128:131) .EQ. '') e_NUV04 = rNULL__
        if (idig(ar__(134:138)).EQ.0) NUV05 =  rNULL__
        if(ar__(140:143) .EQ. '') e_NUV05 = rNULL__
        if(ar__(152:155) .EQ. '') e_NUV06 = rNULL__
        if (idig(ar__(158:162)).EQ.0) NUV07 =  rNULL__
        if(ar__(164:167) .EQ. '') e_NUV07 = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Name,GALEX,RAdeg,DEdeg,l_FUV03,FUV03,e_FUV03,l_FUV04,FUV04,
     +  e_FUV04,l_FUV05,FUV05,e_FUV05,l_FUV06,FUV06,e_FUV06,l_FUV07,
     +  FUV07,e_FUV07,sigma,FT,l_NUV03,NUV03,e_NUV03,l_NUV04,NUV04,
     +  e_NUV04,l_NUV05,NUV05,e_NUV05,l_NUV06,NUV06,e_NUV06,l_NUV07,
     +  NUV07,e_NUV07
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'matches.dat'	! Optical matches to UV variable sources in
*                             XMM-LSS (D1, table 6), COSMOS (D2, table 7),
*                             GROTH (D3, table 8) and CFHTLS (D4, table 9)

C  Format for file interpretation

    2 format(
     +  A5,1X,A16,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,
     +  F6.3,1X,F5.3,1X,F6.3,1X,F5.3,1X,F5.3,1X,F3.1,1X,A3,1X,A4,1X,
     +  F5.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'matches.dat')
      write(6,*) '....Loading file: matches.dat'
      do i__=1,87
        read(1,'(A112)')ar__1
        read(ar__1,2)
     +  Name_1,GALEX_1,umag,e_umag,gmag,e_gmag,rmag,e_rmag,imag,
     +  e_imag,zmag,e_zmag,r1_2,Sep,Flag,Class,z
        if(ar__1(108:112) .EQ. '') z = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Name_1,GALEX_1,umag,e_umag,gmag,e_gmag,rmag,e_rmag,imag,
     +  e_imag,zmag,e_zmag,r1_2,Sep,Flag,Class,z
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table10.dat'	! Tidal disruption flare candidates

C  Format for file interpretation

    3 format(
     +  A5,1X,A16,1X,A1,1X,A1,1X,A4,1X,F4.2,1X,F4.2,1X,F6.4,1X,A6)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table10.dat')
      write(6,*) '....Loading file: table10.dat'
      do i__=1,11
        read(1,'(A55)')ar__2
        read(ar__2,3)
     +  Name_2,GALEX_2,FT_1,Flag_1,Template,zph1,zph2,zsp,Type
        if(ar__2(43:48) .EQ. '') zsp = rNULL__
c    ..............Just test output...........
        write(6,3)
     +  Name_2,GALEX_2,FT_1,Flag_1,Template,zph1,zph2,zsp,Type
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table11.dat'	! Log of optical spectroscopic observations

C  Format for file interpretation

    4 format(
     +  A5,1X,A16,1X,A10,1X,A8,1X,A5,1X,F3.1,1X,F4.1,1X,I4,1X,F6.4,1X,
     +  A1,F3.1,1X,A1,F4.1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table11.dat')
      write(6,*) '....Loading file: table11.dat'
      do i__=1,8
        read(1,'(A80)')ar__3
        read(ar__3,4)
     +  Name_3,GALEX_3,Date,Tel,Inst,Slit,Dlambda,Texp,z_1,
     +  l__OIII_Hb_,v_OIII_Hb_,l_logL__OIII_,logL__OIII_
        if(ar__3(72:74) .EQ. '') v_OIII_Hb_ = rNULL__
        if(ar__3(77:80) .EQ. '') logL__OIII_ = rNULL__
c    ..............Just test output...........
        write(6,4)
     +  Name_3,GALEX_3,Date,Tel,Inst,Slit,Dlambda,Texp,z_1,
     +  l__OIII_Hb_,v_OIII_Hb_,l_logL__OIII_,logL__OIII_
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