FORTRAN Generation
(/./ftp/cats/J/ApJ/654/347)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJ/654/347 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-Oct-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/ApJ/654/347    Chandra X-ray observations in Eagle Nebula. I.  (Linsky+, 2007)
*================================================================================
*Chandra observations of the Eagle nebula.
*I. Embedded young stellar objects near the pillars of creation.
*    Linsky J.L., Gagne M., Mytyk A., Mccaughrean M., Andersen M.
*   <Astrophys. J., 654, 347-360 (2007)>
*   =2007ApJ...654..347L
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Chandra X-Ray Sources in M16: WFPC2 Field

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

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

      integer*4     v_LGM2007_ (nr__) ! Source number
      character*16  Name       (nr__) ! X-ray source name (JHHMMSS.s+DDMMSS)
      integer*4     RAh        (nr__) ! (h) Right ascension (J2000.0)
      integer*4     RAm        (nr__) ! (min) Right ascension (J2000.0)
      real*4        RAs        (nr__) ! (s) Right ascension (J2000.0)
      character*1   DE_        (nr__) ! Declination sign (J2000.0)
      integer*4     DEd        (nr__) ! (deg) Declination (J2000.0)
      integer*4     DEm        (nr__) ! (arcmin) Declination (J2000.0)
      real*4        DEs        (nr__) ! (arcsec) Declination (J2000.0)
      integer*4     Rct        (nr__) ! (ct) Raw counts
      real*4        Nct        (nr__) ! (ct) Net counts
      real*4        e_Nct      (nr__) ! (ct) rms uncertainty on Nct
      real*4        fX         (nr__) ! (10-19W/m2) 0.5-7.0keV X-ray flux in 10^-16^arg/cm^2^/s
*                                     (not corrected for absorption)
      real*4        K_S        (nr__) ! K-S time variability statistic
      real*4        Emed       (nr__) ! (keV) Mean photon energy
      character*1   T3         (nr__) ! [*] * indicates Sugitani matches

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

C  Declarations for 'table2.dat'	! *Optical and Near-Infrared Counterparts:
                              WFPC2 Field

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

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

      integer*4     v_LGM2007__1(nr__1) ! Source number
      character*16  Name_1     (nr__1) ! X-ray source name (JHHMMSS.s+DDMMSS)
      integer*4     RAh_1      (nr__1) ! (h) ? VLT Right ascension (J2000.0)
      integer*4     RAm_1      (nr__1) ! (min) ? VLT Right ascension (J2000.0)
      real*4        RAs_1      (nr__1) ! (s) ? VLT Right ascension (J2000.0)
      character*1   DE__1      (nr__1) ! ? VLT Declination sign (J2000.0)
      integer*4     DEd_1      (nr__1) ! (deg) ? VLT Declination (J2000.0)
      integer*4     DEm_1      (nr__1) ! (arcmin) ? VLT Declination (J2000.0)
      real*4        DEs_1      (nr__1) ! (arcsec) ? VLT Declination (J2000.0)
      real*4        OVLT       (nr__1) ! (arcsec) ? Offset with VLT source
      real*4        Jsmag      (nr__1) ! (mag) ? VLT Js magnitude
      real*4        Hmag       (nr__1) ! (mag) ? VLT H magnitude
      real*4        Ksmag      (nr__1) ! (mag) ? VLT Ks magnitude
      integer*4     RA2h       (nr__1) ! (h) ? 2MASS Right ascension (J2000.0)
      integer*4     RA2m       (nr__1) ! (min) ? 2MASS Right ascension (J2000.0)
      real*4        RA2s       (nr__1) ! (s) ? 2MASS Right ascension (J2000.0)
      character*1   DE2_       (nr__1) ! ? 2MASS Declination sign (J2000.0)
      integer*4     DE2d       (nr__1) ! (deg) ? 2MASS Declination (J2000.0)
      integer*4     DE2m       (nr__1) ! (arcmin) ? 2MASS Declination (J2000.0)
      real*4        DE2s       (nr__1) ! (arcsec) ? 2MASS Declination (J2000.0)
      real*4        O2M        (nr__1) ! (arcsec) ? Offset with 2MASS source
      real*4        J2mag      (nr__1) ! (mag) ? 2MASS J magnitude
      real*4        H2mag      (nr__1) ! (mag) ? 2MASS H magnitude
      real*4        Ks2mag     (nr__1) ! (mag) ? 2MASS Ks magnitude
      integer*4     Walk       (nr__1) ! ? Walker number, 1961ApJ...133..438W,
*                                     NGC 6611 NNN
      integer*4     BKP        (nr__1) ! ? Belikov number, 1999, Cat. <J/A+AS/134/525>,
*                                     Cl* NGC 6611 BKP NNNNN in Simbad
      real*4        Bmag       (nr__1) ! (mag) ? B magnitude
      real*4        Vmag       (nr__1) ! (mag) ? V magnitude
      character*4   SpT        (nr__1) ! MK spectral type
      real*4        AV         (nr__1) ! (mag) ? Absorption in V band

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

C  Declarations for 'table3.dat'	! Chandra Sources in M16:
                              Sugitani et al. (2002ApJ...565L..25S) Matches

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

      integer*4     v_LGM2007__2(nr__2) ! Source number
      character*16  Name_2     (nr__2) ! Source name (JHHMMSS.s+DDMMSS)
      character*15  Sug        (nr__2) ! Sugitani et al. (2002ApJ...565L..25S)
*                                   SN IRS designation (1)
      character*1   n_Sug      (nr__2) ! [c] Note on Sug (2)
      real*4        Offset     (nr__2) ! (arcsec) Offset between positions
      real*4        CR         (nr__2) ! (ct/s) Net counts rate
      real*4        K_S_1      (nr__2) ! K-S time variability statistic
      real*4        Emed_1     (nr__2) ! (keV) Mean photon energy
      real*4        fX_1       (nr__2) ! (10-19W/m2) Absorpbed 0.5-7.0keV X-ray flux
      real*4        Jmag       (nr__2) ! (mag) ?=- J magnitude
      real*4        Hmag_1     (nr__2) ! (mag) H magnitude
      real*4        Ksmag_1    (nr__2) ! (mag) Ks magnitude
      real*4        AV_1       (nr__2) ! (mag) ?=- Absorption in V band
      real*4        logLX      (nr__2) ! (10-7W) Unabsorbed 0.5-7keV luminosity assuming d=2kpc
      character*1   T1         (nr__2) ! [*] * indicates objects in WFPC2 field
*Note (1): For all sources but 3, the name is HHMMSS.s+DDMMSS.
*        * M16 ES-2 (T1) = [TSH2002] M16 ES-2 = [STN2002] T1 in Simbad
*        * M16 ES-1 (P1) = [TSH2002] M16 ES-1 = [STN2002] P1 in Simbad
*Note (2): c = For the bright star BD-13 4930 photometry is from 2MASS, and
*     astrometry is from Hipparcos

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

C  Loading file 'table1.dat'	! Chandra X-Ray Sources in M16: WFPC2 Field

C  Format for file interpretation

    1 format(
     +  I3,1X,A16,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,I3,1X,
     +  F5.1,1X,F4.1,1X,F5.1,1X,F4.2,1X,F4.2,1X,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,40
        read(1,'(A77)')ar__
        read(ar__,1)
     +  v_LGM2007_(i__),Name(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),
     +  DEd(i__),DEm(i__),DEs(i__),Rct(i__),Nct(i__),e_Nct(i__),
     +  fX(i__),K_S(i__),Emed(i__),T3(i__)
        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)
     +  v_LGM2007_(i__),Name(i__),RAh(i__),RAm(i__),RAs(i__),DE_(i__),
     +  DEd(i__),DEm(i__),DEs(i__),Rct(i__),Nct(i__),e_Nct(i__),
     +  fX(i__),K_S(i__),Emed(i__),T3(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 'table2.dat'	! *Optical and Near-Infrared Counterparts:
*                              WFPC2 Field

C  Format for file interpretation

    2 format(
     +  I3,1X,A16,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,F4.2,
     +  1X,F5.2,1X,F5.2,3X,F5.2,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,
     +  F4.1,1X,F4.2,1X,F5.2,1X,F5.2,1X,F5.2,1X,I3,1X,I5,1X,F5.2,1X,
     +  F5.2,1X,A4,1X,F4.2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,41
        read(1,'(A148)')ar__1
        read(ar__1,2)
     +  v_LGM2007__1(i__),Name_1(i__),RAh_1(i__),RAm_1(i__),
     +  RAs_1(i__),DE__1(i__),DEd_1(i__),DEm_1(i__),DEs_1(i__),
     +  OVLT(i__),Jsmag(i__),Hmag(i__),Ksmag(i__),RA2h(i__),RA2m(i__),
     +  RA2s(i__),DE2_(i__),DE2d(i__),DE2m(i__),DE2s(i__),O2M(i__),
     +  J2mag(i__),H2mag(i__),Ks2mag(i__),Walk(i__),BKP(i__),
     +  Bmag(i__),Vmag(i__),SpT(i__),AV(i__)
        if(ar__1(22:23) .EQ. '') RAh_1(i__) = iNULL__
        if(ar__1(25:26) .EQ. '') RAm_1(i__) = iNULL__
        if(ar__1(28:32) .EQ. '') RAs_1(i__) = rNULL__
        if(ar__1(35:36) .EQ. '') DEd_1(i__) = iNULL__
        if(ar__1(38:39) .EQ. '') DEm_1(i__) = iNULL__
        if(ar__1(41:44) .EQ. '') DEs_1(i__) = rNULL__
        if(ar__1(46:49) .EQ. '') OVLT(i__) = rNULL__
        if(ar__1(51:55) .EQ. '') Jsmag(i__) = rNULL__
        if(ar__1(57:61) .EQ. '') Hmag(i__) = rNULL__
        if(ar__1(65:69) .EQ. '') Ksmag(i__) = rNULL__
        if(ar__1(71:72) .EQ. '') RA2h(i__) = iNULL__
        if(ar__1(74:75) .EQ. '') RA2m(i__) = iNULL__
        if(ar__1(77:81) .EQ. '') RA2s(i__) = rNULL__
        if(ar__1(84:85) .EQ. '') DE2d(i__) = iNULL__
        if(ar__1(87:88) .EQ. '') DE2m(i__) = iNULL__
        if(ar__1(90:93) .EQ. '') DE2s(i__) = rNULL__
        if(ar__1(95:98) .EQ. '') O2M(i__) = rNULL__
        if(ar__1(100:104) .EQ. '') J2mag(i__) = rNULL__
        if(ar__1(106:110) .EQ. '') H2mag(i__) = rNULL__
        if(ar__1(112:116) .EQ. '') Ks2mag(i__) = rNULL__
        if(ar__1(118:120) .EQ. '') Walk(i__) = iNULL__
        if(ar__1(122:126) .EQ. '') BKP(i__) = iNULL__
        if(ar__1(128:132) .EQ. '') Bmag(i__) = rNULL__
        if(ar__1(134:138) .EQ. '') Vmag(i__) = rNULL__
        if(ar__1(145:148) .EQ. '') AV(i__) = rNULL__
        RAdeg_1(i__) = rNULL__
        DEdeg_1(i__) = rNULL__
c  Derive coordinates RAdeg_1 and DEdeg_1 from input data
c  (RAdeg_1 and DEdeg_1 are set to rNULL__ when unknown)
        if(RAh_1(i__) .GT. -180) RAdeg_1(i__)=RAh_1(i__)*15.
        if(RAm_1(i__) .GT. -180) RAdeg_1(i__)=RAdeg_1(i__)+RAm_1(i__)/4.
        if(RAs_1(i__) .GT. -180) RAdeg_1(i__)=RAdeg_1(i__)+RAs_1(i__)/240.
        if(DEd_1(i__) .GE. 0) DEdeg_1(i__)=DEd_1(i__)
        if(DEm_1(i__) .GE. 0) DEdeg_1(i__)=DEdeg_1(i__)+DEm_1(i__)/60.
        if(DEs_1(i__) .GE. 0) DEdeg_1(i__)=DEdeg_1(i__)+DEs_1(i__)/3600.
        if(DE__1(i__).EQ.'-'.AND.DEdeg_1(i__).GE.0) DEdeg_1(i__)=-DEdeg_1(i__)
c    ..............Just test output...........
        write(6,2)
     +  v_LGM2007__1(i__),Name_1(i__),RAh_1(i__),RAm_1(i__),
     +  RAs_1(i__),DE__1(i__),DEd_1(i__),DEm_1(i__),DEs_1(i__),
     +  OVLT(i__),Jsmag(i__),Hmag(i__),Ksmag(i__),RA2h(i__),RA2m(i__),
     +  RA2s(i__),DE2_(i__),DE2d(i__),DE2m(i__),DE2s(i__),O2M(i__),
     +  J2mag(i__),H2mag(i__),Ks2mag(i__),Walk(i__),BKP(i__),
     +  Bmag(i__),Vmag(i__),SpT(i__),AV(i__)
        write(6,'(6H Pos: 2F8.4)') RAdeg_1(i__),DEdeg_1(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Chandra Sources in M16:
*                              Sugitani et al. (2002ApJ...565L..25S) Matches

C  Format for file interpretation

    3 format(
     +  I3,1X,A16,1X,A15,A1,1X,F4.2,1X,F5.1,1X,F4.2,1X,F4.2,1X,F5.1,
     +  1X,F5.2,1X,F5.2,1X,F5.2,1X,F4.1,1X,F4.1,1X,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,40
        read(1,'(A94)')ar__2
        read(ar__2,3)
     +  v_LGM2007__2(i__),Name_2(i__),Sug(i__),n_Sug(i__),Offset(i__),
     +  CR(i__),K_S_1(i__),Emed_1(i__),fX_1(i__),Jmag(i__),
     +  Hmag_1(i__),Ksmag_1(i__),AV_1(i__),logLX(i__),T1(i__)
        if (idig(ar__2(66:70)).EQ.0) Jmag(i__) =  rNULL__
        if (idig(ar__2(84:87)).EQ.0) AV_1(i__) =  rNULL__
c    ..............Just test output...........
        write(6,3)
     +  v_LGM2007__2(i__),Name_2(i__),Sug(i__),n_Sug(i__),Offset(i__),
     +  CR(i__),K_S_1(i__),Emed_1(i__),fX_1(i__),Jmag(i__),
     +  Hmag_1(i__),Ksmag_1(i__),AV_1(i__),logLX(i__),T1(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