FORTRAN Generation
(/./ftp/cats/J/A_A/477/717)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/477/717 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 2024-Apr-16
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/477/717    Spectroscopy of Type Ia supernovae          (Bronder+, 2008)
*================================================================================
*SNLS spectroscopy: testing for evolution in type Ia supernovae.
*    Bronder T.J., Hook I.M., Astier P., Balam D., Balland C., Basa S.,
*    Carlberg R.G., Conley A., Fouchez D., Guy J., Howell D.A., Neill J.D.,
*    Pain R., Perrett K., Pritchet C.J., Regnault N., Sullivan M., Baumont S.,
*    Fabbro S., Filliol M., Perlmutter S., Ripoche P.
*   <Astron. Astrophys., 477, 717-734 (2008)>
*   =2008A&A...477..717B
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table6.dat'	! Observed properties and instrument settings for
                              SNLS SNe candidates observed from November 2004
                              to May 2006

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

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

      character*6   SNLS       (nr__) ! SN name
      integer*4     RAh        (nr__) ! (h) Right ascension (J2000)
      integer*4     RAm        (nr__) ! (min) Right ascension (J2000)
      real*4        RAs        (nr__) ! (s) Right ascension (J2000)
      character*1   DE_        (nr__) ! Declination sign (J2000)
      integer*4     DEd        (nr__) ! (deg) Declination (J2000)
      integer*4     DEm        (nr__) ! (arcmin) Declination (J2000)
      real*4        DEs        (nr__) ! (arcsec) Declination (J2000)
      character*10  ObsDate    (nr__) ! ("YYYY-MM-DD") Observation date
      integer*4     ExpTime    (nr__) ! (s) Exposure time
      character*3   Mode       (nr__) ! Observing mode (1)
      integer*4     lambdac    (nr__) ! (nm) ? Central wavelength
      real*4        Seeing     (nr__) ! (arcsec) Seeing
      real*4        i_mag      (nr__) ! (mag) i' magnitude (2)
      character*1   l_Inc      (nr__) ! Limit flag on Inc
      integer*4     Inc        (nr__) ! (%) Percentage increase (2) (3)
      character*1   EW         (nr__) ! [*] For SN having equivalent width data
*                                         in tablea1
*Note (1): Observing mode as follows:
*      C = classical
*    N+S = nod-and-shuffle
*Note (2): Estimated from the light-curves and correspond to the date of
*     spectroscopy.
*Note (3): Percentage increase relative to the host galaxy (interpolated to
*     the date of spectroscopy)

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

C  Declarations for 'table7.dat'	! SNLS identifications and derived properties for SNe
                              candidates observed from Nov. 2004 to May 2006

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

      character*6   SNLS_1     (nr__1) ! SN name
      real*4        z          (nr__1) ! ?=- Redshift (1)
      real*4        e_z        (nr__1) ! ?=- rms uncertainty on z
      integer*4     CI         (nr__1) ! Confidence index
      character*6   SNType     (nr__1) ! Final object identification
      character*6   Temp       (nr__1) ! Template name of best low-z spectral fit
      integer*4     TempDay    (nr__1) ! (d) ? Days past maximum of best low-z spectral fit
      character*32  r_z        (nr__1) ! Host features used to estimate z
*Note (1): Redshifts identified with host galaxy features are accurate to
*     ~+/-0.001. Redshifts identified with template matches are accurate to
*     ~+/-0.01.

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

C  Declarations for 'tablea1.dat'	! *Equivalent width and ejection velocity results
                              for the published high redshift SNe Ia observed
                              by the SNLS at the Gemini telescopes

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

      character*6   SNLS_2     (nr__2) ! SN name
      real*4        Day        (nr__2) ! Rest-frame day, relative to B'max
      real*4        e_Day      (nr__2) ! rms uncertainty on Day
      real*4        EW_CaII    (nr__2) ! (0.1nm) ?=- CaII equivalent width (1)
      real*4        e_EW_CaII  (nr__2) ! (0.1nm) ?=- rms uncertainty in EW(CaII) (2)
      real*4        EW_SiII    (nr__2) ! (0.1nm) ?=- SiII equivalent width (1)
      real*4        e_EW_SiII  (nr__2) ! (0.1nm) ?=- rms uncertainty in EW(SiII) (2)
      real*4        EW_MgII    (nr__2) ! (0.1nm) ?=- MgII equivalent width (1)
      real*4        e_EW_MgII  (nr__2) ! (0.1nm) ?=- rms uncertainty in EW(MgII) (2)
      real*4        Vej        (nr__2) ! (10+4km/s) ?=- Ejection velocity (1)
      real*4        e_Vej      (nr__2) ! (10+4km/s) ?=- rms uncertainty on Vej
*Note (1): The blank spaces (---) indicate where a measurement had to be
*     removed due to inadequate wavelength coverage.
*Note (2): The uncertainties in the EW results include measurement errors,
*     errors from any possible variance in the pseudo-continuum, and the
*     uncertainty from the host galaxy contamination correction.

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

C  Loading file 'table6.dat'	! Observed properties and instrument settings for
*                              SNLS SNe candidates observed from November 2004
*                              to May 2006

C  Format for file interpretation

    1 format(
     +  A6,1X,I2,1X,I2,1X,F6.3,1X,A1,I2,1X,I2,1X,F5.2,1X,A10,1X,I4,1X,
     +  A3,1X,I3,1X,F4.2,1X,F5.2,1X,A1,I5,1X,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table6.dat')
      write(6,*) '....Loading file: table6.dat'
      do i__=1,61
        read(1,'(A76)')ar__
        read(ar__,1)
     +  SNLS(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),DEd(i__),
     +  DEm(i__),DEs(i__),ObsDate(i__),ExpTime(i__),Mode(i__),
     +  lambdac(i__),Seeing(i__),i_mag(i__),l_Inc(i__),Inc(i__),
     +  EW(i__)
        if(ar__(54:56) .EQ. '') lambdac(i__) = iNULL__
        RAdeg(i__) = rNULL__
        DEdeg(i__) = rNULL__
c  Derive coordinates RAdeg and DEdeg from input data
c  (RAdeg and DEdeg are set to rNULL__ when unknown)
        if(RAh(i__) .GT. -180) RAdeg(i__)=RAh(i__)*15.
        if(RAm(i__) .GT. -180) RAdeg(i__)=RAdeg(i__)+RAm(i__)/4.
        if(RAs(i__) .GT. -180) RAdeg(i__)=RAdeg(i__)+RAs(i__)/240.
        if(DEd(i__) .GE. 0) DEdeg(i__)=DEd(i__)
        if(DEm(i__) .GE. 0) DEdeg(i__)=DEdeg(i__)+DEm(i__)/60.
        if(DEs(i__) .GE. 0) DEdeg(i__)=DEdeg(i__)+DEs(i__)/3600.
        if(DE_(i__).EQ.'-'.AND.DEdeg(i__).GE.0) DEdeg(i__)=-DEdeg(i__)
c    ..............Just test output...........
        write(6,1)
     +  SNLS(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),DEd(i__),
     +  DEm(i__),DEs(i__),ObsDate(i__),ExpTime(i__),Mode(i__),
     +  lambdac(i__),Seeing(i__),i_mag(i__),l_Inc(i__),Inc(i__),
     +  EW(i__)
        write(6,'(6H Pos: 2F8.4)') RAdeg(i__),DEdeg(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table7.dat'	! SNLS identifications and derived properties for SNe
*                              candidates observed from Nov. 2004 to May 2006

C  Format for file interpretation

    2 format(A6,1X,F5.3,1X,F5.3,1X,I1,1X,A6,1X,A6,1X,I3,1X,A32)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table7.dat')
      write(6,*) '....Loading file: table7.dat'
      do i__=1,59
        read(1,'(A71)')ar__1
        read(ar__1,2)
     +  SNLS_1(i__),z(i__),e_z(i__),CI(i__),SNType(i__),Temp(i__),
     +  TempDay(i__),r_z(i__)
        if (idig(ar__1(8:12)).EQ.0) z(i__) =  rNULL__
        if (idig(ar__1(14:18)).EQ.0) e_z(i__) =  rNULL__
        if(ar__1(36:38) .EQ. '') TempDay(i__) = iNULL__
c    ..............Just test output...........
        write(6,2)
     +  SNLS_1(i__),z(i__),e_z(i__),CI(i__),SNType(i__),Temp(i__),
     +  TempDay(i__),r_z(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'tablea1.dat'	! *Equivalent width and ejection velocity results
*                              for the published high redshift SNe Ia observed
*                              by the SNLS at the Gemini telescopes

C  Format for file interpretation

    3 format(
     +  A6,1X,F5.2,1X,F4.2,2X,F5.1,1X,F4.1,3X,F4.1,1X,F4.1,2X,F5.1,1X,
     +  F4.1,2X,F5.2,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'tablea1.dat')
      write(6,*) '....Loading file: tablea1.dat'
      do i__=1,55
        read(1,'(A65)')ar__2
        read(ar__2,3)
     +  SNLS_2(i__),Day(i__),e_Day(i__),EW_CaII(i__),e_EW_CaII(i__),
     +  EW_SiII(i__),e_EW_SiII(i__),EW_MgII(i__),e_EW_MgII(i__),
     +  Vej(i__),e_Vej(i__)
        if (idig(ar__2(20:24)).EQ.0) EW_CaII(i__) =  rNULL__
        if (idig(ar__2(26:29)).EQ.0) e_EW_CaII(i__) =  rNULL__
        if (idig(ar__2(33:36)).EQ.0) EW_SiII(i__) =  rNULL__
        if (idig(ar__2(38:41)).EQ.0) e_EW_SiII(i__) =  rNULL__
        if (idig(ar__2(44:48)).EQ.0) EW_MgII(i__) =  rNULL__
        if (idig(ar__2(50:53)).EQ.0) e_EW_MgII(i__) =  rNULL__
        if (idig(ar__2(56:60)).EQ.0) Vej(i__) =  rNULL__
        if (idig(ar__2(62:65)).EQ.0) e_Vej(i__) =  rNULL__
c    ..............Just test output...........
        write(6,3)
     +  SNLS_2(i__),Day(i__),e_Day(i__),EW_CaII(i__),e_EW_CaII(i__),
     +  EW_SiII(i__),e_EW_SiII(i__),EW_MgII(i__),e_EW_MgII(i__),
     +  Vej(i__),e_Vej(i__)
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