FORTRAN Generation
(/./ftp/cats/J/AJ/153/84)

Conversion of standardized ReadMe file for file /./ftp/cats/J/AJ/153/84 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-28
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/AJ/153/84 Low-resolution near-infrared stellar spectra from CIBER (Kim+, 2017)
*================================================================================
*Low-resolution near-infrared stellar spectra observed by the Cosmic Infrared
*Background Experiment (CIBER).
*    Kim M.G., Lee H.M., Arai T., Bock J., Cooray A., Jeong W.-S., Kim S.J.,
*    Korngut P., Lanz A., Lee D.H., Lee M.G., Matsumoto T., Matsuura S.,
*    Nam U.W., Onishi Y., Shirahata M., Smidt J., Tsumura K., Yamamura I.,
*    Zemcov M.
*   <Astron. J., 153, 84-84 (2017)>
*   =2017AJ....153...84K    (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! *Rocket-commanded coordinates for the observed field

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

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

      character*8   Field       ! Field name
      integer*4     Flight      ! ? Flight number
      integer*4     RAh         ! (h) Hour of Right Ascension (J2000)
      integer*4     RAm         ! (min) Minute of Right Ascension (J2000)
      real*4        RAs         ! (s) [0/60] Second of Right Ascension (J2000)
      character*1   DE_         ! Sign of the Declination (J2000)
      integer*4     DEd         ! (deg) Degree of Declination (J2000)
      integer*4     DEm         ! (arcmin) Arcminute of Declination (J2000)
      real*4        DEs         ! (arcsec) Arcsecond of Declination (J2000)

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

C  Declarations for 'table2.dat'	! Number of stars rejected at each criterion

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

      character*3   Flight_1    ! Flight
      integer*4     Nc          ! Total number of candidates
      integer*4     i           ! Number of candidate stars rejected at
*                                   criterion (i) (1)
      integer*4     ii          ! Number of candidate stars rejected at
*                                   criterion (ii) (2)
      integer*4     iii         ! Number of candidate stars rejected at
*                                   criterion (iii) (3)
      integer*4     iv          ! Number of candidate stars rejected at
*                                   criterion (iv) (4)
      integer*4     Ns          ! Total number of stars in final catalog
*Note (1): Each candidate must have J<11.
*Note (2): The J-band magnitude difference between the Low-Resolution
*     Spectrometer (LRS) candidate and the matched 2MASS counterpart must be
*     <1.5.
*Note (3): The J-H color difference between the Low-Resolution Spectrometer (LRS)
*     candidate star and the matched 2MASS counterpart must be <0.3.
*Note (4): Among the candidate 2MASS counterparts within the 500'' (=6 pixel)
*     radius of a given Low-Resolution Spectrometer (LRS) star, the
*     second-brightest 2MASS star must be fainter than the brightest one by more
*     than 2mag at the J-band.

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

C  Declarations for 'table3.dat'	! Star catalog

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

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

      character*3   Flight_2    ! Flight (either 2nd, 3rd, or 4th)
      character*7   Field_1     ! Field name
      character*6   Star        ! Star identifier
      character*1   f_Star      ! [e] Flag 'e' for a star observed from two
*                                   independent flights
      character*14  Name        ! Star name
      integer*4     RAh_1       ! (h) Hour of Right Ascension (J2000) (1)
      integer*4     RAm_1       ! (min) Minute of Right Ascension (J2000) (1)
      real*4        RAs_1       ! (s) Second of Right Ascension (J2000) (1)
      character*1   DE__1       ! Sign of the Declination (J2000) (1)
      integer*4     DEd_1       ! (deg) Degree of Declination (J2000) (1)
      integer*4     DEm_1       ! (arcmin) Arcminute of Declination (J2000) (1)
      real*4        DEs_1       ! (arcsec) Arcsecond of Declination (J2000) (1)
      real*4        Jmag1       ! (mag) [6.5/11] Low-Resolution Spectrometer (LRS)
*                                   Vega J-band magnitude (2)
      real*4        Hmag1       ! (mag) [5.7/10.7] Low-Resolution Spectrometer (LRS)
*                                   Vega H-band magnitude (2)
      real*4        Jmag2       ! (mag) [5.7/10.6] 2MASS Vega J-band magnitude (3)
      real*4        Hmag2       ! (mag) [5/10.1] 2MASS Vega H-band magnitude (3)
      character*5   SpT1        ! SIMBAD spectral type
      character*17  SpT2        ! Best-fit Infrared Telescope Facility (IRTF)
*                                   spectral type (4)
      real*4        chi2        ! [0.03/4.6] {Chi}^2^
      character*20  Note        ! Note
*Note (1): The J2000.0 right ascension and declination of a star in a sexagesimal
*     from 2MASS data.
*Note (2): From the spectra, we can compute synthetic magnitudes in the J- and
*     H-bands, which facilitate comparison to Two-Micron All-Sky Survey (2MASS;
*     see Cutri et al. 2003, Cat. II/246) measurements. We first convert surface
*     brightness in nW/m^2^/sr to flux in nW/m^2^/Hz and then integrate the
*     monochromatic intensity over the 2MASS band, applying the filter
*     transmissivity of the J- and H-bands (Cohen et al. 2003AJ....126.1090C). To
*     determine the appropriate zero magnitude, we integrate the J- and H-band
*     intensity of Vega's spectrum (Bohlin & Gilliland 2004AJ....127.3508B) with
*     the same filter response. The J- and H-band magnitudes of each source are
*     then calculated.
*Note (3): Vega magnitude of the matched 2MASS point source catalog (Cutri et al.
*     2003, Cat. II/246).
*Note (4): The star spectral types are determined by fitting known spectral
*     templates to the measured LRS spectra. We use the Infrared Telescope
*     Facility (IRTF) and Pickles 1998 (Cat. J/PASP/110/863) templates for the
*     SED fitting. See Section 4.1 in the paper for further details.

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

C  Declarations for 'spectra/*'	! Low-Resolution Spectrometer (LRS) spectra

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

      real*8        lambda      ! (um) Wavelength {lambda}
      real*8        Flux        ! J-band-normalized observed Low-Resolution
*                              Spectrometer (LRS) flux (1)
      real*8        b_Flux      ! Lower value of the flux interval
      real*8        B_Flux_1    ! Upper value of the flux interval
*Note (1): {lambda}^f^_{lambda}_/{lambda}^f^_{lambda}_(J-band).

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

C  Declarations for 'hrspex/*'	! High-resolution SpeX spectra

      integer*4 nr__4
      parameter (nr__4=110)	! Number of records
      character*40 ar__4  	! Full-size record

      real*8        lambda_1    ! (um) Wavelength {lambda}
      real*8        Flux_1      ! Flux

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

C  Declarations for 'lrspex/*'	! Low-resolution SpeX spectra

      integer*4 nr__5
      parameter (nr__5=110)	! Number of records
      character*80 ar__5  	! Full-size record

      real*8        lambda_2    ! (um) Wavelength {lambda}
      real*8        Flux_2      ! J-band-normalized observed Low-Resolution
*                              Spectrometer (LRS) flux (1)
      real*8        b_Flux_2    ! Lower value of the flux interval
      real*8        B_Flux_3    ! Upper value of the flux interval
*Note (1): {lambda}^f^_{lambda}_/{lambda}^f^_{lambda}_(J-band).

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

C  Loading file 'table1.dat'	! *Rocket-commanded coordinates for the observed field

C  Format for file interpretation

    1 format(A8,I1,1X,I2,1X,I2,1X,F6.3,1X,A1,I2,1X,I2,1X,F6.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,11
        read(1,'(A36)')ar__
        read(ar__,1)Field,Flight,RAh,RAm,RAs,DE_,DEd,DEm,DEs
        if(ar__(9:9) .EQ. '') Flight = iNULL__
        RAdeg = rNULL__
        DEdeg = rNULL__
c  Derive coordinates RAdeg and DEdeg from input data
c  (RAdeg and DEdeg are set to rNULL__ when unknown)
        if(RAh .GT. -180) RAdeg=RAh*15.
        if(RAm .GT. -180) RAdeg=RAdeg+RAm/4.
        if(RAs .GT. -180) RAdeg=RAdeg+RAs/240.
        if(DEd .GE. 0) DEdeg=DEd
        if(DEm .GE. 0) DEdeg=DEdeg+DEm/60.
        if(DEs .GE. 0) DEdeg=DEdeg+DEs/3600.
        if(DE_.EQ.'-'.AND.DEdeg.GE.0) DEdeg=-DEdeg
c    ..............Just test output...........
        write(6,1)Field,Flight,RAh,RAm,RAs,DE_,DEd,DEm,DEs
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! Number of stars rejected at each criterion

C  Format for file interpretation

    2 format(A3,8X,I3,1X,I2,1X,I2,1X,I1,1X,I3,1X,I2)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,3
        read(1,'(A29)')ar__1
        read(ar__1,2)Flight_1,Nc,i,ii,iii,iv,Ns
c    ..............Just test output...........
        write(6,2)Flight_1,Nc,i,ii,iii,iv,Ns
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Star catalog

C  Format for file interpretation

    3 format(
     +  A3,1X,A7,1X,A6,1X,A1,1X,A14,1X,I2,1X,I2,1X,F6.3,1X,A1,I2,1X,
     +  I2,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,A5,1X,A17,1X,
     +  F5.3,1X,A20)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,110
        read(1,'(A141)')ar__2
        read(ar__2,3)
     +  Flight_2,Field_1,Star,f_Star,Name,RAh_1,RAm_1,RAs_1,DE__1,
     +  DEd_1,DEm_1,DEs_1,Jmag1,Hmag1,Jmag2,Hmag2,SpT1,SpT2,chi2,Note
        RAdeg_1 = rNULL__
        DEdeg_1 = 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 .GT. -180) RAdeg_1=RAh_1*15.
        if(RAm_1 .GT. -180) RAdeg_1=RAdeg_1+RAm_1/4.
        if(RAs_1 .GT. -180) RAdeg_1=RAdeg_1+RAs_1/240.
        if(DEd_1 .GE. 0) DEdeg_1=DEd_1
        if(DEm_1 .GE. 0) DEdeg_1=DEdeg_1+DEm_1/60.
        if(DEs_1 .GE. 0) DEdeg_1=DEdeg_1+DEs_1/3600.
        if(DE__1.EQ.'-'.AND.DEdeg_1.GE.0) DEdeg_1=-DEdeg_1
c    ..............Just test output...........
        write(6,3)
     +  Flight_2,Field_1,Star,f_Star,Name,RAh_1,RAm_1,RAs_1,DE__1,
     +  DEd_1,DEm_1,DEs_1,Jmag1,Hmag1,Jmag2,Hmag2,SpT1,SpT2,chi2,Note
        write(6,'(6H Pos: 2F8.4)') RAdeg_1,DEdeg_1
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'spectra/*'	! Low-Resolution Spectrometer (LRS) spectra

C  Format for file interpretation

    4 format(8X,F12.10,8X,F12.10,7X,F13.10,8X,F12.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'spectra/*')
      write(6,*) '....Loading file: spectra/*'
      do i__=1,110
        read(1,'(A80)')ar__3
        read(ar__3,4)lambda,Flux,b_Flux,B_Flux_1
c    ..............Just test output...........
        write(6,4)lambda,Flux,b_Flux,B_Flux_1
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'hrspex/*'	! High-resolution SpeX spectra

C  Format for file interpretation

    5 format(8X,F12.10,8X,F12.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'hrspex/*')
      write(6,*) '....Loading file: hrspex/*'
      do i__=1,110
        read(1,'(A40)')ar__4
        read(ar__4,5)lambda_1,Flux_1
c    ..............Just test output...........
        write(6,5)lambda_1,Flux_1
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'lrspex/*'	! Low-resolution SpeX spectra

C  Format for file interpretation

    6 format(8X,F12.10,8X,F12.10,7X,F13.10,8X,F12.10)

C  Effective file loading

      open(unit=1,status='old',file=
     +'lrspex/*')
      write(6,*) '....Loading file: lrspex/*'
      do i__=1,110
        read(1,'(A80)')ar__5
        read(ar__5,6)lambda_2,Flux_2,b_Flux_2,B_Flux_3
c    ..............Just test output...........
        write(6,6)lambda_2,Flux_2,b_Flux_2,B_Flux_3
c    .......End.of.Just test output...........
      end do
      close(1)

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