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

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJ/676/286 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 2026-Jun-08
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/286  Spectral templates for galaxies from 0.2 to 10um  (Assef+, 2008)
*================================================================================
*Low-resolution spectral templates for galaxies from 0.2 to 10 {mu}m.
*    Assef R.J., Kochanek C.S., Brodwin M., Brown M.J.I., Caldwell N.,
*    Cool R.J., Eisenhardt P., Eisenstein D., Gonzalez A.H., Jannuzi B.T.,
*    Jones C., McKenzie E., Murray S.S., Stern D.
*   <Astrophys. J., 676, 286-303 (2008)>
*   =2008ApJ...676..286A
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Three template model absolute magnitudes

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

      real*4        z          (nr__) ! Redshift
      integer*4     t          (nr__) ! [1/4] Template number: 1=E, 2=Sbc, 3=Im,
*                                4=E+A (post-starburst galaxy)
      real*8        BWMAG      (nr__) ! (mag) Absolute B_W_ band magnitude (2)
      real*8        BMAG       (nr__) ! (mag) Absolute B band magnitude (2)
      real*8        VMAG       (nr__) ! (mag) Absolute V band magnitude (2)
      real*8        RMAG       (nr__) ! (mag) Absolute R band magnitude (2)
      real*8        IMAG       (nr__) ! (mag) Absolute I band magnitude (2)
      real*8        uMAG       (nr__) ! (mag) Absolute SDSS u' band AB magnitude (2)
      real*8        gMAG       (nr__) ! (mag) Absolute SDSS g' band AB magnitude (2)
      real*8        rMAG_1     (nr__) ! (mag) Absolute SDSS r' band AB magnitude (2)
      real*8        iMAG_1     (nr__) ! (mag) Absolute SDSS i' band AB magnitude (2)
      real*8        zMAG       (nr__) ! (mag) Absolute SDSS z' band AB magnitude (2)
      real*8        JMAG       (nr__) ! (mag) Absolute 2MASS J band magnitude (2)
      real*8        HMAG       (nr__) ! (mag) Absolute 2MASS H band magnitude (2)
      real*8        KSMAG      (nr__) ! (mag) Absolute 2MASS K_S_ band magnitude (2)
      real*8        KMAG       (nr__) ! (mag) Absolute K band magnitude (2)
      real*8        v3_6MAG    (nr__) ! (mag) Absolute Spitzer/IRAC 3.6 micron band magnitude (2)
      real*8        v4_5MAG    (nr__) ! (mag) Absolute Spitzer/IRAC 4.5 micron band magnitude (2)
      real*8        v5_8MAG    (nr__) ! (mag) Absolute Spitzer/IRAC 5.8 micron band magnitude (2)
      real*8        v8_0MAG    (nr__) ! (mag) Absolute Spitzer/IRAC 8.0 micron band magnitude (2)
      real*4        DM         (nr__) ! (mag) ? Distance Modulus
*Note (2): The absolute magnitude we present here corresponds to the
*     canonical definition of the absolute magnitude (as in, for example,
*     eq. 26 of Hogg 1999, astro-ph/9905116) plus the K correction term.
*     This allows the calculation of photometric redshifts and K corrections
*     from the table. To determine photometric redshifts, colors should be
*     calculated and matched to the data by varying the a_k_ coefficients
*     (see Section 3.1) and the redshift. For a galaxy at redshift z with
*     template coefficients a_k_, the model magnitude in band b is given by
*     M_b(z)_=-2.5log[sum_k_(a_k_ 10^-0.4M_b,k_(z)^)]. Apparent magnitudes
*     can be determined by adding the distance modulus to the absolute ones.
*     To determine K corrections for a galaxy at redshift z, coefficients
*     a_k_ should also be determined to match the observed colors as above.
*     With the same coefficients, redshift z and redshift zero model
*     absolute magnitudes can be determined, and the difference between them
*     will correspond to the desired K correction.

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

C  Declarations for 'table2.dat'	! Four template model absolute magnitudes

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

      real*4        z_1        (nr__1) ! Redshift
      integer*4     t_1        (nr__1) ! [1/4] Template number: 1=E, 2=Sbc, 3=Im,
*                                4=E+A (post-starburst galaxy)
      real*8        BWMAG_1    (nr__1) ! (mag) Absolute B_W_ band magnitude (2)
      real*8        BMAG_1     (nr__1) ! (mag) Absolute B band magnitude (2)
      real*8        VMAG_1     (nr__1) ! (mag) Absolute V band magnitude (2)
      real*8        RMAG_2     (nr__1) ! (mag) Absolute R band magnitude (2)
      real*8        IMAG_2     (nr__1) ! (mag) Absolute I band magnitude (2)
      real*8        uMAG_1     (nr__1) ! (mag) Absolute SDSS u' band AB magnitude (2)
      real*8        gMAG_1     (nr__1) ! (mag) Absolute SDSS g' band AB magnitude (2)
      real*8        rMAG_3     (nr__1) ! (mag) Absolute SDSS r' band AB magnitude (2)
      real*8        iMAG_3     (nr__1) ! (mag) Absolute SDSS i' band AB magnitude (2)
      real*8        zMAG_1     (nr__1) ! (mag) Absolute SDSS z' band AB magnitude (2)
      real*8        JMAG_1     (nr__1) ! (mag) Absolute 2MASS J band magnitude (2)
      real*8        HMAG_1     (nr__1) ! (mag) Absolute 2MASS H band magnitude (2)
      real*8        KSMAG_1    (nr__1) ! (mag) Absolute 2MASS K_S_ band magnitude (2)
      real*8        KMAG_1     (nr__1) ! (mag) Absolute K band magnitude (2)
      real*8        v3_6MAG_1  (nr__1) ! (mag) Absolute Spitzer/IRAC 3.6 micron band magnitude (2)
      real*8        v4_5MAG_1  (nr__1) ! (mag) Absolute Spitzer/IRAC 4.5 micron band magnitude (2)
      real*8        v5_8MAG_1  (nr__1) ! (mag) Absolute Spitzer/IRAC 5.8 micron band magnitude (2)
      real*8        v8_0MAG_1  (nr__1) ! (mag) Absolute Spitzer/IRAC 8.0 micron band magnitude (2)
      real*4        DM_1       (nr__1) ! (mag) ? Distance Modulus
*Note (2): The absolute magnitude we present here corresponds to the
*     canonical definition of the absolute magnitude (as in, for example,
*     eq. 26 of Hogg 1999, astro-ph/9905116) plus the K correction term.
*     This allows the calculation of photometric redshifts and K corrections
*     from the table. To determine photometric redshifts, colors should be
*     calculated and matched to the data by varying the a_k_ coefficients
*     (see Section 3.1) and the redshift. For a galaxy at redshift z with
*     template coefficients a_k_, the model magnitude in band b is given by
*     M_b(z)_=-2.5log[sum_k_(a_k_ 10^-0.4M_b,k_(z)^)]. Apparent magnitudes
*     can be determined by adding the distance modulus to the absolute ones.
*     To determine K corrections for a galaxy at redshift z, coefficients
*     a_k_ should also be determined to match the observed colors as above.
*     With the same coefficients, redshift z and redshift zero model
*     absolute magnitudes can be determined, and the difference between them
*     will correspond to the desired K correction.

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

C  Declarations for 'table3.dat'	! Three component spectral templates

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

      real*8        lambda     (nr__2) ! (um) Wavelength
      real*4        E          (nr__2) ! (mW/m2/Hz) Best fit Elliptical template F_nu_   (1)
      real*4        Sbc        (nr__2) ! (mW/m2/Hz) Best fit Sbc Spiral Sbc template F_nu_ (1)
      real*4        Im         (nr__2) ! (mW/m2/Hz) Best fit Irregular Im template F_nu_ (1)
      real*4        E_A        (nr__2) ! (mW/m2/Hz) ? Best fit E+A template F_nu_ (table4 only )(1)
*Note (1): In units of erg/s/cm^2^/Hz (=mW/m^2^/Hz=10^23^Jy). Templates
*     are normalized to be at a distance of 10pc and to have an integrated
*     luminosity between the wavelength boundaries of 10^10^L_{sun}_.

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

C  Declarations for 'table4.dat'	! Four component spectral templates

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

      real*8        lambda_1   (nr__3) ! (um) Wavelength
      real*4        E_1        (nr__3) ! (mW/m2/Hz) Best fit Elliptical template F_nu_   (1)
      real*4        Sbc_1      (nr__3) ! (mW/m2/Hz) Best fit Sbc Spiral Sbc template F_nu_ (1)
      real*4        Im_1       (nr__3) ! (mW/m2/Hz) Best fit Irregular Im template F_nu_ (1)
      real*4        E_A_1      (nr__3) ! (mW/m2/Hz) ? Best fit E+A template F_nu_ (table4 only )(1)
*Note (1): In units of erg/s/cm^2^/Hz (=mW/m^2^/Hz=10^23^Jy). Templates
*     are normalized to be at a distance of 10pc and to have an integrated
*     luminosity between the wavelength boundaries of 10^10^L_{sun}_.

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

C  Loading file 'table1.dat'	! Three template model absolute magnitudes

C  Format for file interpretation

    1 format(
     +  F5.3,1X,I1,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,
     +  F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,
     +  1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F6.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,453
        read(1,'(A158)')ar__
        read(ar__,1)
     +  z(i__),t(i__),BWMAG(i__),BMAG(i__),VMAG(i__),RMAG(i__),
     +  IMAG(i__),uMAG(i__),gMAG(i__),rMAG_1(i__),iMAG_1(i__),
     +  zMAG(i__),JMAG(i__),HMAG(i__),KSMAG(i__),KMAG(i__),
     +  v3_6MAG(i__),v4_5MAG(i__),v5_8MAG(i__),v8_0MAG(i__),DM(i__)
        if(ar__(153:158) .EQ. '') DM(i__) = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  z(i__),t(i__),BWMAG(i__),BMAG(i__),VMAG(i__),RMAG(i__),
     +  IMAG(i__),uMAG(i__),gMAG(i__),rMAG_1(i__),iMAG_1(i__),
     +  zMAG(i__),JMAG(i__),HMAG(i__),KSMAG(i__),KMAG(i__),
     +  v3_6MAG(i__),v4_5MAG(i__),v5_8MAG(i__),v8_0MAG(i__),DM(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Four template model absolute magnitudes

C  Format for file interpretation

    2 format(
     +  F5.3,1X,I1,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,
     +  F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,
     +  1X,F7.3,1X,F7.3,1X,F7.3,1X,F7.3,1X,F6.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,604
        read(1,'(A158)')ar__1
        read(ar__1,2)
     +  z_1(i__),t_1(i__),BWMAG_1(i__),BMAG_1(i__),VMAG_1(i__),
     +  RMAG_2(i__),IMAG_2(i__),uMAG_1(i__),gMAG_1(i__),rMAG_3(i__),
     +  iMAG_3(i__),zMAG_1(i__),JMAG_1(i__),HMAG_1(i__),KSMAG_1(i__),
     +  KMAG_1(i__),v3_6MAG_1(i__),v4_5MAG_1(i__),v5_8MAG_1(i__),
     +  v8_0MAG_1(i__),DM_1(i__)
        if(ar__1(153:158) .EQ. '') DM_1(i__) = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  z_1(i__),t_1(i__),BWMAG_1(i__),BMAG_1(i__),VMAG_1(i__),
     +  RMAG_2(i__),IMAG_2(i__),uMAG_1(i__),gMAG_1(i__),rMAG_3(i__),
     +  iMAG_3(i__),zMAG_1(i__),JMAG_1(i__),HMAG_1(i__),KSMAG_1(i__),
     +  KMAG_1(i__),v3_6MAG_1(i__),v4_5MAG_1(i__),v5_8MAG_1(i__),
     +  v8_0MAG_1(i__),DM_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Three component spectral templates

C  Format for file interpretation

    3 format(F8.6,1X,E10.4,1X,E10.4,1X,E10.4,1X,E10.4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,160
        read(1,'(A52)')ar__2
        read(ar__2,3)lambda(i__),E(i__),Sbc(i__),Im(i__),E_A(i__)
        if(ar__2(43:52) .EQ. '') E_A(i__) = rNULL__
c    ..............Just test output...........
        write(6,3)lambda(i__),E(i__),Sbc(i__),Im(i__),E_A(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table4.dat'	! Four component spectral templates

C  Format for file interpretation

    4 format(F8.6,1X,E10.4,1X,E10.4,1X,E10.4,1X,E10.4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table4.dat')
      write(6,*) '....Loading file: table4.dat'
      do i__=1,160
        read(1,'(A52)')ar__3
        read(ar__3,4)
     +  lambda_1(i__),E_1(i__),Sbc_1(i__),Im_1(i__),E_A_1(i__)
        if(ar__3(43:52) .EQ. '') E_A_1(i__) = rNULL__
c    ..............Just test output...........
        write(6,4)
     +  lambda_1(i__),E_1(i__),Sbc_1(i__),Im_1(i__),E_A_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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