FORTRAN Generation
(/./ftp/cats/J/A_A/614/A116)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/614/A116 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/614/A116      Masgomas-6 near-IR spectra          (Ramirez Alegria+, 2018)
*================================================================================
*Identifying two groups of massive stars aligned in the l~38{deg} Galactic
*direction.
*    Ramirez Alegria S., Herrero A., Rubke K., Marin-Franch A., Garcia M.,
*    Borissova J.
*    <Astron. Astrophys. 614, A116 (2018)>
*    =2018A&A...614A.116R        (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table3.dat'	! Spectroscopically observed stars

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

C  J2000 position composed of: RAdeg DEdeg
      character*2   Type       (nr__) ! Massive (MS) or Field (FS) stars
      integer*4     Seq        (nr__) ! Sequential number
      integer*8     UKIDSS     (nr__) ! Identification number from the
*                                   UKIDSS GPS catalogue
      real*8        RAdeg      (nr__) ! (deg) Right ascension (J2000)
      real*8        DEdeg      (nr__) ! (deg) Declination (J2000)
      real*4        Jmag       (nr__) ! (mag) J magnitude
      real*4        e_Jmag     (nr__) ! (mag) rms uncertainty on Jmag
      real*4        Hmag       (nr__) ! (mag) H magnitude
      real*4        e_Hmag     (nr__) ! (mag) rms uncertainty on Hmag
      real*4        Kmag       (nr__) ! (mag) Ks magnitude
      real*4        e_Kmag     (nr__) ! (mag) rms uncertainty on Ksmag
      character*10  SpType     (nr__) ! Spectral type
      real*4        AK         (nr__) ! (mag) ?=- Estimated extinction
      real*4        E_AK       (nr__) ! (mag) ? Error on AK (upper value)
      real*4        e_AK_1     (nr__) ! (mag) ? Error on AK (lower value)
      real*4        Dist       (nr__) ! (kpc) ? Distance
      real*4        E_Dist     (nr__) ! (kpc) ? Error on Dist (upper value)
      real*4        e_Dist_1   (nr__) ! (kpc) ? Error on Dist (lower value)
      character*1   n_Dist     (nr__) ! [a] Note on Dist (1)
      integer*4     RV         (nr__) ! (km/s) ? Radial velocity
      integer*4     e_RV       (nr__) ! (km/s) ? rms uncertainty on RV
      integer*4     SNRH       (nr__) ! Signal-to-noise ratio measured for the
*                                   H-band spectrum
      integer*4     SNRK       (nr__) ! ? Signal-to-noise ratio measured for the
*                                    K-band spectrum
*Note (1): a: Distance estimated by Ueta et al. (2001ApJ...548.1020U).

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

C  Declarations for 'list.dat'	! List of fits spectra

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

C  J2000 position composed of: RAdeg DEdeg
      real*8        RAdeg_1    (nr__1) ! (deg) Right Ascension of center (J2000)
      real*8        DEdeg_1    (nr__1) ! (deg) Declination of center (J2000)
      integer*4     Seq_1      (nr__1) ! Object identification used in article
      integer*4     Nx         (nr__1) ! Number of points
      real*8        blambda    (nr__1) ! (0.1nm) Lower value of wavelength interval
      real*8        Blambda_1  (nr__1) ! (0.1nm) Upper value of wavelength interval
      real*8        dlambda    (nr__1) ! (0.1nm) Spectral resolution
      integer*4     size       (nr__1) ! (Kibyte) Size of FITS file
      character*11  FileName   (nr__1) ! Name of FITS file, in subdirectory fits
      character*18  Title      (nr__1) ! Title of the FITS file

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

C  Loading file 'table3.dat'	! Spectroscopically observed stars

C  Format for file interpretation

    1 format(
     +  A2,1X,I2,1X,I12,1X,F8.4,1X,F9.5,1X,F6.3,1X,F5.3,1X,F6.3,1X,
     +  F5.3,1X,F6.3,1X,F5.3,1X,A10,1X,F4.2,1X,F4.2,1X,F4.2,1X,F5.2,
     +  1X,F4.2,1X,F4.2,A1,1X,I3,1X,I3,1X,I3,1X,I3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,30
        read(1,'(A135)')ar__
        read(ar__,1)
     +  Type(i__),Seq(i__),UKIDSS(i__),RAdeg(i__),DEdeg(i__),
     +  Jmag(i__),e_Jmag(i__),Hmag(i__),e_Hmag(i__),Kmag(i__),
     +  e_Kmag(i__),SpType(i__),AK(i__),E_AK(i__),e_AK_1(i__),
     +  Dist(i__),E_Dist(i__),e_Dist_1(i__),n_Dist(i__),RV(i__),
     +  e_RV(i__),SNRH(i__),SNRK(i__)
        if (idig(ar__(89:92)).EQ.0) AK(i__) =  rNULL__
        if(ar__(94:97) .EQ. '') E_AK(i__) = rNULL__
        if(ar__(99:102) .EQ. '') e_AK_1(i__) = rNULL__
        if(ar__(104:108) .EQ. '') Dist(i__) = rNULL__
        if(ar__(110:113) .EQ. '') E_Dist(i__) = rNULL__
        if(ar__(115:118) .EQ. '') e_Dist_1(i__) = rNULL__
        if(ar__(121:123) .EQ. '') RV(i__) = iNULL__
        if(ar__(125:127) .EQ. '') e_RV(i__) = iNULL__
        if(ar__(133:135) .EQ. '') SNRK(i__) = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  Type(i__),Seq(i__),UKIDSS(i__),RAdeg(i__),DEdeg(i__),
     +  Jmag(i__),e_Jmag(i__),Hmag(i__),e_Hmag(i__),Kmag(i__),
     +  e_Kmag(i__),SpType(i__),AK(i__),E_AK(i__),e_AK_1(i__),
     +  Dist(i__),E_Dist(i__),e_Dist_1(i__),n_Dist(i__),RV(i__),
     +  e_RV(i__),SNRH(i__),SNRK(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'list.dat'	! List of fits spectra

C  Format for file interpretation

    2 format(
     +  F9.5,F9.5,1X,I2,1X,I4,1X,F7.1,1X,F7.1,1X,F7.5,1X,I2,1X,A11,1X,
     +  A18)

C  Effective file loading

      open(unit=1,status='old',file=
     +'list.dat')
      write(6,*) '....Loading file: list.dat'
      do i__=1,30
        read(1,'(A84)')ar__1
        read(ar__1,2)
     +  RAdeg_1(i__),DEdeg_1(i__),Seq_1(i__),Nx(i__),blambda(i__),
     +  Blambda_1(i__),dlambda(i__),size(i__),FileName(i__),Title(i__)
c    ..............Just test output...........
        write(6,2)
     +  RAdeg_1(i__),DEdeg_1(i__),Seq_1(i__),Nx(i__),blambda(i__),
     +  Blambda_1(i__),dlambda(i__),size(i__),FileName(i__),Title(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