FORTRAN Generation
(/./ftp/cats/J/MNRAS/376/313)

Conversion of standardized ReadMe file for file /./ftp/cats/J/MNRAS/376/313 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/MNRAS/376/313     Carbon star in Magellanic Cloud     (Groenewegen+, 2007)
*================================================================================
*Luminosities and mass-loss rates of carbon stars in the Magellanic Clouds.
*    Groenewegen M.A.T., Wood P.R., Sloan G.C., Blommaert J.A.D.L.,
*    Cioni M.-R.L., Feast M.W., Hony S., Matsuura M., Menzies J.W.,
*    Olivier E.A., Vanhollebeke E., van Loon J.T., Whitelock P.A.,
*    Zijlstra A.A., Habing H.J., Lagadec E.
*   <Mon. Not. R. Astron. Soc., 376, 313-337 (2007)>
*   =2007MNRAS.376..313G
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! The carbon star sample: identifiers and
                              pulsation periods

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

      character*15  Name       (nr__) ! Identifier
      character*57  ONames     (nr__) ! ?=- Other name(s)
      character*1   n_Per1     (nr__) ! [*] Note on all periods (1)
      integer*4     Per1       (nr__) ! (d) ? First period
      integer*4     Per2       (nr__) ! (d) ? Second period
      integer*4     Per3       (nr__) ! (d) ? Third period
      character*2   r_Per1     (nr__) ! ? Reference for Per1 (2)
      character*2   r_Per2     (nr__) ! ? Reference for Per2 (2)
      character*2   r_Per3     (nr__) ! ? Reference for Per3 (2)
      real*4        Ampl       (nr__) ! (mag) ? Amplitude
      character*1   n_Ampl     (nr__) ! [KRI] Filter for the amplitude
*Note (1): Periods preceded by a * indicate stars considered to have
*          the most regular pulsation (see Figs 3-6)
*Note (2): References as follows:
*     pp = present paper
*      1 = Whitelock et al. (2003MNRAS.342...86W)
*      0 = Groenewegen (2004, cat. <J/A+A/425/595>)
*      0 = Nishida et al. (2000MNRAS.313..136N)
*      0 = Raimondo et al. (2005, Cat. <J/A+A/438/521>)
*      1 = Reid et al. (1988MNRAS.232...53R)
*      2 = Sloan et al. (2006ApJ...645.1118S)
*      3 = Wood (1998A&A...338..592W)
*      4 = Dodion (2003, MSc thesis, Univ. Leuven)
*      5 = Wood et al. (in preparation)

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

C  Declarations for 'table2.dat'	! The carbon star sample:
                              quasi-simultaneous near-IR photometry

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

      character*15  Name_1     (nr__1) ! Identifier
      real*4        Jmag       (nr__1) ! (mag) ?=- J magnitude
      real*4        e_Jmag     (nr__1) ! (mag) ?=- rms uncertainty on Jmag
      real*4        Hmag       (nr__1) ! (mag) ?=- H magnitude
      real*4        e_Hmag     (nr__1) ! (mag) ?=- rms uncertainty on Hmag
      real*4        Kmag       (nr__1) ! (mag) K magnitude
      real*4        e_Kmag     (nr__1) ! (mag) rms uncertainty on Kmag
      real*4        Lmag       (nr__1) ! (mag) L magnitude
      real*4        e_Lmag     (nr__1) ! (mag) rms uncertainty on Lmag

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

C  Loading file 'table1.dat'	! The carbon star sample: identifiers and
*                              pulsation periods

C  Format for file interpretation

    1 format(
     +  A15,1X,A57,A1,I3,1X,I3,1X,I3,1X,A2,A2,1X,A2,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,60
        read(1,'(A100)')ar__
        read(ar__,1)
     +  Name(i__),ONames(i__),n_Per1(i__),Per1(i__),Per2(i__),
     +  Per3(i__),r_Per1(i__),r_Per2(i__),r_Per3(i__),Ampl(i__),
     +  n_Ampl(i__)
        if(ar__(75:77) .EQ. '') Per1(i__) = iNULL__
        if(ar__(79:81) .EQ. '') Per2(i__) = iNULL__
        if(ar__(83:85) .EQ. '') Per3(i__) = iNULL__
        if(ar__(95:98) .EQ. '') Ampl(i__) = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Name(i__),ONames(i__),n_Per1(i__),Per1(i__),Per2(i__),
     +  Per3(i__),r_Per1(i__),r_Per2(i__),r_Per3(i__),Ampl(i__),
     +  n_Ampl(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! The carbon star sample:
*                              quasi-simultaneous near-IR photometry

C  Format for file interpretation

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

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,60
        read(1,'(A67)')ar__1
        read(ar__1,2)
     +  Name_1(i__),Jmag(i__),e_Jmag(i__),Hmag(i__),e_Hmag(i__),
     +  Kmag(i__),e_Kmag(i__),Lmag(i__),e_Lmag(i__)
        if (idig(ar__1(17:22)).EQ.0) Jmag(i__) =  rNULL__
        if (idig(ar__1(24:28)).EQ.0) e_Jmag(i__) =  rNULL__
        if (idig(ar__1(30:35)).EQ.0) Hmag(i__) =  rNULL__
        if (idig(ar__1(37:41)).EQ.0) e_Hmag(i__) =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Name_1(i__),Jmag(i__),e_Jmag(i__),Hmag(i__),e_Hmag(i__),
     +  Kmag(i__),e_Kmag(i__),Lmag(i__),e_Lmag(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