FORTRAN Generation
(/./ftp/cats/J/ApJS/273/19)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJS/273/19 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 2026-Aug-11
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/ApJS/273/19     Elemental abundances from DESI EDR spectra     (Zhang+, 2024)
*================================================================================
*Determining stellar elemental abundances from DESI spectra with the data-driven
*Payne.
*    Zhang M., Xiang M., Ting Y.-S., Wang J., Li H., Zou Hu, Nie J., Mou L.,
*    Wu T., Wu Y., Liu J.
*   <Astrophys. J. Suppl. Ser., 273, 19 (2024)>
*   =2024ApJS..273...19Z
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! Catalog of atmospheric parameters and elemental
                               abundances for stars in the early data release
                               of the DESI spectroscopic survey
                               (from erratum published in 2024, ApJS, 274, 21)

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

C  J2000 position composed of: RAdeg DEdeg
      real*8        RAdeg       ! (deg) Target right ascension (J2000)
*                                          (TARGET_RA)
      real*8        DEdeg       ! (deg) [-31.6/85] Target declination (J2000)
*                                          (TARGET_DEC)
      integer*8     ID          ! DESI target identifier (TARGET_ID)
      character*7   Survey      ! Name of the DESI survey (SURVEY)
      character*6   Prog        ! Name of the program (PROGRAM)
      character*1   Prim        ! [FT] Primary, false or true (PRIMARY)
      integer*4     Hpix        ! [683/45007] Healpix ID (HEALPIX)
      real*8        snrB        ! [-6.3/473.2] Median spectral
*                                          signal-to-noise ratio in B-band (SNRB)
      real*8        snrG        ! [-0.3/608] Median spectral
*                                          signal-to-noise ratio in G-band (SNRG)
      real*8        snrR        ! [0.2/771] Median spectral
*                                          signal-to-noise ratio in R-band (SNRR)
      real*8        RV          ! (km/s) [-1500/1500] Radial velocity from DESI
*                                          EDR catalog (RV)
      real*8        e_RV        ! (km/s) [0.0001/2341] RV uncertainty (RV_ERR)
      real*8        Teff        ! (K) [2642/8863]? Effective temperature
*                                          (TEFF)
      real*8        e_Teff      ! (K) [2.7/1220]? Teff uncertainty (TEFF_ERR)
      real*8        logg        ! ([cm/s2]) [-1.5/7.2]? Log of surface gravity
*                                          (LOGG)
      real*4        e_logg      ! ([cm/s2]) [0.01/3.1]? logg uncertainty (LOGG_ERR)
      real*8        v_Fe_H_     ! ([-]) [-5.2/1.7]? Iron abundance (FEH)
      real*4        e__Fe_H_    ! ([-]) [0.007/1.4]? [Fe/H] Uncertainty
*                                          (FEH_ERR)
      real*8        v_C_Fe_     ! ([-]) [-1.4/2.1]? Log of C/Fe abundance
*                                          (C_FE)
      real*4        e__C_Fe_    ! ([-]) [0.004/1.8]? [C/Fe] Uncertainty
*                                          (C_FE_ERR)
      real*8        v_N_Fe_     ! ([-]) [-1.9/2.2]? Log of N/Fe abundance
*                                          (N_FE)
      real*4        e__N_Fe_    ! ([-]) [0.009/3]? [N/Fe] Uncertainty
*                                          (N_FE_ERR)
      real*8        v_Mg_Fe_    ! ([-]) [-0.8/1.4]? Log of Mg/Fe abundance
*                                          (MG_FE)
      real*4        e__Mg_Fe_   ! ([-]) [0.005/3]? [Mg/Fe] Uncertainty
*                                          (MG_FE_ERR)
      real*8        v_O_Fe_     ! ([-]) [-0.8/1.6]? Log of O/Fe abundance
*                                          (O_FE)
      real*4        e__O_Fe_    ! ([-]) [0.006/2]? [O/Fe] Uncertainty
*                                          (O_FE_ERR)
      real*8        v_Al_Fe_    ! ([-]) [-1.3/1.5]? Log of Al/Fe abundance
*                                          (AL_FE)
      real*4        e__Al_Fe_   ! ([-]) [0.01/2.5]? [Al/Fe] Uncertainty
*                                          (AL_FE_ERR)
      real*8        v_Si_Fe_    ! ([-]) [-0.9/1.4]? Log of Si/Fe abundance
*                                          (SI_FE)
      real*4        e__Si_Fe_   ! ([-]) [0.007/2.1]? [Si/Fe] Uncertainty
*                                          (SI_FE_ERR)
      real*8        v_Ca_Fe_    ! ([-]) [-0.9/1.4]? Log of Ca/Fe abundance
*                                          (CA_FE)
      real*4        e__Ca_Fe_   ! ([-]) [0.006/2]? [Ca/Fe] Uncertainty
*                                          (CA_FE_ERR)
      real*8        v_Ti_Fe_    ! ([-]) [-1.2/1.5]? Log of Ti/Fe abundance
*                                          (TI_FE)
      real*4        e__Ti_Fe_   ! ([-]) [0.006/1.5]? [Ti/Fe] Uncertainty
*                                          (TI_FE_ERR)
      real*8        v_Cr_Fe_    ! ([-]) [-1.9/1]? Log of Cr/Fe abundance
*                                          (CR_FE)
      real*4        e__Cr_Fe_   ! ([-]) [0.009/3.6]? [Cr/Fe] Uncertainty
*                                          (CR_FE_ERR)
      real*8        v_Mn_Fe_    ! ([-]) [-1.4/0.9]? Log of Mn/Fe abundance
*                                          (MN_FE)
      real*4        e__Mn_Fe_   ! ([-]) [0.008/3.2]? [Mn/Fe] Uncertainty
*                                          (MN_FE_ERR)
      real*8        v_Ni_Fe_    ! ([-]) [-0.9/1.1]? Log of Ni/Fe abundance
*                                          (NI_FE)
      real*4        e__Ni_Fe_   ! ([-]) [0.008/3.1]? [Ni/Fe] Uncertainty
*                                          (NI_FE_ERR)
      real*8        Vmic        ! (km/s) [-0.63/3.13]? Microturbulent velocity
*                                          (VMIC)
      real*4        e_Vmic      ! (km/s) [0.009/3.4]? Vmic uncertainty
*                                          (VMIC_ERR)
      real*8        CorTeff_logg ! [-1/0.87] The correlation coefficients
*                                          between Teff and logg (COR_TEFF_LOGG)
      real*8        CorTeff_feh ! [-1/0.81] The correlation coefficients
*                                          between Teff and [Fe/H] (COR_TEFF_FEH)
      real*8        Corlogg_feh ! [-1/0.72] The correlation coefficients
*                                          between logg and [Fe/H] (COR_LOGG_FEH)
      real*4        q_Chi2      ! [-3.2/3.9e+6]? A quality flag
*                                          describing the {chi}^2^ of the
*                                          spectral fit (CHISQ_FLAG)
      real*4        Chi2        ! [0.009/773000]? The {chi}^2^ of the
*                                          spectral fit (CHISQ)
      real*4        logDist     ! ([pc]) [-8.1/12.7]? Log of distance (LOGDIS)
      real*4        e_logDist   ! ([pc]) [0.0002/15]? logDist uncertainty
*                                          (LOGDIS_ERR)
      real*4        EBV         ! (mag) [-0.3/0.83]? Interstellar reddening
*                                          (EBV)
      real*4        e_EBV       ! (mag) [0/3]? EBV uncertainty (EBV_ERR)
      real*4        X           ! (kpc) 3D X position in the Galactic
*                                          Cartesian coordinates (X)
      real*4        Y           ! (kpc) 3D Y position in the Galactic
*                                          Cartesian coordinates (Y)
      real*4        Z           ! (kpc) 3D Z position in the Galactic
*                                          Cartesian coordinates (Z)
      real*4        R           ! (kpc) ?=-9999 Radial position in the Galactic
*                                          cylindrical coordinates (R)
      real*4        PHI         ! (kpc) [-3.04/3.1]? Azimuthal position in the
*                                          Galactic cylindrical coordinates (PHI)
      real*4        VX          ! (km/s) [-2.2e+6/1.5e+6]?=-9999 3D velocity, X
*                                          component, in the Galactic Cartesian
*                                          coordinates (VX)
      real*4        VY          ! (km/s) [-2.2e+6/1.3e+6]?=-9999 3D velocity, Y
*                                          component, in the Galactic Cartesian
*                                          coordinates (VY)
      real*4        VZ          ! (km/s) [-2.2e+06/2e+06]?=-9999 3D velocity, Z
*                                          component, in the Galactic Cartesian
*                                          coordinates (VZ)
      real*4        VR          ! (km/s) [-2.2e+06/2.1e+06]?=-9999 Radial
*                                          velocity in the Galactic cylindrical
*                                          coordinates (VR)
      real*4        VT          ! (km/s) [-2.2e+06/2.1e+06]?=-9999 Azimuthal
*                                          velocity in the Galactic cylindrical
*                                          coordinates (VT)
      real*4        JR          ! (kpc.km/s) [-2.2e+06/26489]?=-9999  Actions in R
*                                          direction (JR)
      real*4        JPHI        ! (kpc.km/s) ?=-9999 Actions in PHI direction (JPHI)
      real*4        JZ          ! (kpc.km/s) ?=-9999 Actions in Z direction (JZ)
      real*4        LX          ! (kpc.km/s) ?=-9999 Angular momentum in the X
*                                          direction (LX)
      real*4        LY          ! (kpc.km/s) ?=-9999 Angular momentum in the Y
*                                          direction (LY)
      real*4        LZ          ! (kpc.km/s) [-2.2e+06/2.2e+06]?=-9999 Angular
*                                          momentum in the Z direction (LZ)
      real*4        RadGuid     ! (kpc) [-2.2e+06/2.2e+06]?=-9999 Guiding
*                                          center radius (R_GUIDING)
      real*4        Rapo        ! (kpc) [-2.2e+06/2.2e+06]?=-9999 Apocenter
*                                          radius (R_APO)
      real*4        Rperi       ! (kpc) [-2.2e+06/2e+06]?=-9999 Pericenter
*                                          radius (R_PERI)
      real*4        Ecc         ! [0.001/1]? Eccentricity (ECC)
      real*4        Zmax        ! (kpc) [-2.2e+06/2.2e+06]?=-9999 Maximum height
*                                          of orbits (ZMAX)
      real*4        Energy      ! [-2.2e+07/2.1e+07]?=-9999 Total energy
*                                          (ENERGY)
      real*4        omegaPHI    ! [-2.1/9999.99]? Frequency in the PHI
*                                          direction (OMEGA_PHI)
      real*4        omegaR      ! [0.017/9999.99]? Frequency in the R
*                                          direction (OMEGA_R)
      real*4        omegaZ      ! [0.01/9999.99]? Frequency in the Z
*                                          direction (OMEGA_Z)
      real*4        ER          ! [-2.2e+6/2.2e+6]?=-9999 Radial energy
      real*4        EZ          ! [-2.2e+6/2.2e+6]?=-9999 Vertical energy

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

C  Loading file 'catalog.dat'	! Catalog of atmospheric parameters and elemental
*                               abundances for stars in the early data release
*                               of the DESI spectroscopic survey
*                               (from erratum published in 2024, ApJS, 274, 21)

C  Format for file interpretation

    1 format(
     +  F11.7,1X,F11.7,1X,I19,1X,A7,1X,A6,1X,A1,1X,I5,1X,F7.3,1X,F7.3,
     +  1X,F7.3,1X,F10.4,1X,F9.4,1X,F7.2,1X,F7.2,1X,F8.3,1X,F5.3,1X,
     +  F8.3,1X,F5.3,1X,F8.3,1X,F5.3,1X,F8.3,1X,F5.3,1X,F8.3,1X,F5.3,
     +  1X,F8.3,1X,F5.3,1X,F8.3,1X,F5.3,1X,F8.3,1X,F5.3,1X,F8.3,1X,
     +  F5.3,1X,F8.3,1X,F5.3,1X,F8.3,1X,F5.3,1X,F8.3,1X,F5.3,1X,F8.3,
     +  1X,F5.3,1X,F8.3,1X,F5.3,1X,F9.6,1X,F9.6,1X,F9.6,1X,E11.4,1X,
     +  E10.4,1X,E11.4,1X,E11.4,1X,E10.3,1X,E10.3,1X,E11.4,1X,E11.4,
     +  1X,E11.4,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,
     +  E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,
     +  1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E11.4,1X,E12.6,1X,
     +  E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6,1X,E12.6)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,520228
        read(1,'(A783)')ar__
        read(ar__,1)
     +  RAdeg,DEdeg,ID,Survey,Prog,Prim,Hpix,snrB,snrG,snrR,RV,e_RV,
     +  Teff,e_Teff,logg,e_logg,v_Fe_H_,e__Fe_H_,v_C_Fe_,e__C_Fe_,
     +  v_N_Fe_,e__N_Fe_,v_Mg_Fe_,e__Mg_Fe_,v_O_Fe_,e__O_Fe_,v_Al_Fe_,
     +  e__Al_Fe_,v_Si_Fe_,e__Si_Fe_,v_Ca_Fe_,e__Ca_Fe_,v_Ti_Fe_,
     +  e__Ti_Fe_,v_Cr_Fe_,e__Cr_Fe_,v_Mn_Fe_,e__Mn_Fe_,v_Ni_Fe_,
     +  e__Ni_Fe_,Vmic,e_Vmic,CorTeff_logg,CorTeff_feh,Corlogg_feh,
     +  q_Chi2,Chi2,logDist,e_logDist,EBV,e_EBV,X,Y,Z,R,PHI,VX,VY,VZ,
     +  VR,VT,JR,JPHI,JZ,LX,LY,LZ,RadGuid,Rapo,Rperi,Ecc,Zmax,Energy,
     +  omegaPHI,omegaR,omegaZ,ER,EZ
        if(ar__(113:119) .EQ. '') Teff = rNULL__
        if(ar__(121:127) .EQ. '') e_Teff = rNULL__
        if(ar__(129:136) .EQ. '') logg = rNULL__
        if(ar__(138:142) .EQ. '') e_logg = rNULL__
        if(ar__(144:151) .EQ. '') v_Fe_H_ = rNULL__
        if(ar__(153:157) .EQ. '') e__Fe_H_ = rNULL__
        if(ar__(159:166) .EQ. '') v_C_Fe_ = rNULL__
        if(ar__(168:172) .EQ. '') e__C_Fe_ = rNULL__
        if(ar__(174:181) .EQ. '') v_N_Fe_ = rNULL__
        if(ar__(183:187) .EQ. '') e__N_Fe_ = rNULL__
        if(ar__(189:196) .EQ. '') v_Mg_Fe_ = rNULL__
        if(ar__(198:202) .EQ. '') e__Mg_Fe_ = rNULL__
        if(ar__(204:211) .EQ. '') v_O_Fe_ = rNULL__
        if(ar__(213:217) .EQ. '') e__O_Fe_ = rNULL__
        if(ar__(219:226) .EQ. '') v_Al_Fe_ = rNULL__
        if(ar__(228:232) .EQ. '') e__Al_Fe_ = rNULL__
        if(ar__(234:241) .EQ. '') v_Si_Fe_ = rNULL__
        if(ar__(243:247) .EQ. '') e__Si_Fe_ = rNULL__
        if(ar__(249:256) .EQ. '') v_Ca_Fe_ = rNULL__
        if(ar__(258:262) .EQ. '') e__Ca_Fe_ = rNULL__
        if(ar__(264:271) .EQ. '') v_Ti_Fe_ = rNULL__
        if(ar__(273:277) .EQ. '') e__Ti_Fe_ = rNULL__
        if(ar__(279:286) .EQ. '') v_Cr_Fe_ = rNULL__
        if(ar__(288:292) .EQ. '') e__Cr_Fe_ = rNULL__
        if(ar__(294:301) .EQ. '') v_Mn_Fe_ = rNULL__
        if(ar__(303:307) .EQ. '') e__Mn_Fe_ = rNULL__
        if(ar__(309:316) .EQ. '') v_Ni_Fe_ = rNULL__
        if(ar__(318:322) .EQ. '') e__Ni_Fe_ = rNULL__
        if(ar__(324:331) .EQ. '') Vmic = rNULL__
        if(ar__(333:337) .EQ. '') e_Vmic = rNULL__
        if(ar__(369:379) .EQ. '') q_Chi2 = rNULL__
        if(ar__(381:390) .EQ. '') Chi2 = rNULL__
        if(ar__(392:402) .EQ. '') logDist = rNULL__
        if(ar__(404:414) .EQ. '') e_logDist = rNULL__
        if(ar__(416:425) .EQ. '') EBV = rNULL__
        if(ar__(427:436) .EQ. '') e_EBV = rNULL__
        if(ar__(487:498) .EQ. '') PHI = rNULL__
        if(ar__(682:692) .EQ. '') Ecc = rNULL__
        if(ar__(720:731) .EQ. '') omegaPHI = rNULL__
        if(ar__(733:744) .EQ. '') omegaR = rNULL__
        if(ar__(746:757) .EQ. '') omegaZ = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  RAdeg,DEdeg,ID,Survey,Prog,Prim,Hpix,snrB,snrG,snrR,RV,e_RV,
     +  Teff,e_Teff,logg,e_logg,v_Fe_H_,e__Fe_H_,v_C_Fe_,e__C_Fe_,
     +  v_N_Fe_,e__N_Fe_,v_Mg_Fe_,e__Mg_Fe_,v_O_Fe_,e__O_Fe_,v_Al_Fe_,
     +  e__Al_Fe_,v_Si_Fe_,e__Si_Fe_,v_Ca_Fe_,e__Ca_Fe_,v_Ti_Fe_,
     +  e__Ti_Fe_,v_Cr_Fe_,e__Cr_Fe_,v_Mn_Fe_,e__Mn_Fe_,v_Ni_Fe_,
     +  e__Ni_Fe_,Vmic,e_Vmic,CorTeff_logg,CorTeff_feh,Corlogg_feh,
     +  q_Chi2,Chi2,logDist,e_logDist,EBV,e_EBV,X,Y,Z,R,PHI,VX,VY,VZ,
     +  VR,VT,JR,JPHI,JZ,LX,LY,LZ,RadGuid,Rapo,Rperi,Ecc,Zmax,Energy,
     +  omegaPHI,omegaR,omegaZ,ER,EZ
c    .......End.of.Just test output...........
      end do
      close(1)

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