FORTRAN Generation
(/./ftp/cats/J/ApJ/785/159)

Conversion of standardized ReadMe file for file /./ftp/cats/J/ApJ/785/159 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-Oct-13
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/785/159    SONYC census of substellar objects in Lupus 3    (Muzic+, 2014)
*================================================================================
*Substellar objects in nearby young clusters (SONYC).
*VIII. Substellar population in Lupus 3.
*    Muzic K., Scholz A., Geers V.C., Jayawardhana R., Lopez Marti B.
*   <Astrophys. J., 785, 159 (2014)>
*   =2014ApJ...785..159M    (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table2.dat'	! Photometry and Spectral Types for the Objects
                                of Spectral Type M, or Slightly Earlier,
                                Identified Toward Lupus 3

      integer*4 nr__
      parameter (nr__=27)	! Number of records
      character*128 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*4   ID          ! SONYC candidate identifier (S-NN) (G1)
      integer*4     RAh         ! (h) Hour of Right Ascension (J2000)
      integer*4     RAm         ! (min) Minute of Right Ascension (J2000)
      real*4        RAs         ! (s) 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)
      real*4        imag        ! (mag) MOSAIC-II i-band magnitude
      real*4        Jmag        ! (mag) NEWFIRM J-band magnitude
      real*4        Ksmag       ! (mag) NEWFIRM K_S_-band magnitude
      real*4        Av          ! (mag) Absorption in V band from photometry
      character*1   l_SpType    ! [<] Limit flag on SpType
      character*6   SpType      ! Spectral type
      real*4        AvSp        ! (mag) ? Absorption in V band from spectral type
      real*4        pmRA        ! (mas/yr) ? Proper motion along RA (pmRA*cosDE)
      real*4        e_pmRA      ! (mas/yr) ? Error on pmRA
      real*4        pmDE        ! (mas/yr) ? Proper motion along DE
      real*4        e_pmDE      ! (mas/yr) ? Error on pmDE
      character*1   Cand        ! [yn-] Proper motion candidate (y=yes, n=no)
      real*4        EW          ! (0.1nm) ? Equivalent width of the H{alpha} line
      character*9   Memb        ! Cluster membership
      character*1   n_Memb      ! [2/3] Note on Memb (1)
      character*22  Com         ! Comment (2)
      character*3   r_Com       ! [abcd, ] Comment reference(s) (3)
*Note (1): Note as follows:
*  2 = Background giant;
*  3 = Field dwarf.
*Note (2): Comment as follows:
*  C09 = Candidate member in Comeron et al. (2009, J/A+A/500/1045), Table 9;
*  M08 = IRAC YSO candidate from Merin et al. (2008, J/ApJS/177/551);
*  G06 = X-ray source from Gondoin (2006, J/A+A/454/595).
*Note (3): Reference as follows:
*  a = Comeron et al. 2003A&A...406.1001C;
*  b = Mortier et al. 2011MNRAS.418.1194M;
*  c = Allen et al. 2007ApJ...655.1095A;
*  d = Comeron et al. 2013A&A...554A..86C.

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

C  Declarations for 'table3.dat'	! Effective Temperature and Extinction Derived
                                from Models, for the Objects of Spectral Type M
                                (or Slightly Earlier) Toward Lupus 3

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

      character*4   ID_1        ! SONYC candidate identifier (S-NN) (G1)
      character*1   l_TeffAD    ! [>] Limit flag on TeffAD
      integer*4     TeffAD      ! (K) ? Effective temperature derived using
*                                   AMES-Dusty models (Allard et al.
*                                   2001ApJ...556..357A)
      real*4        AvAD        ! (mag) ? Absorption in V band corresponding to TeffAD
      integer*4     TeffBTS     ! (K) Effective temperature derived using
*                                   BT-Settl models (Allard et al.
*                                   2011ASPC..448...91A)
      real*4        AvBTS       ! (mag) Absorption in V band corresponding to TeffBTS
      integer*4     Teff        ! (K) ? Effective temperature
      character*1   n_Teff      ! [ab] Note on Teff (1)
      real*4        Avmean      ! (mag) ? Absorption in V band
*Note (1): Note as follows:
*  a = Parameters derived by Comeron et al. (2009, J/A+A/500/1045);
*  b = Parameters derived by Comeron et al. (2013A&A...554A..86C).

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

C  Declarations for 'table4.dat'	! Spectroscopically Confirmed Very Low Mass
                                Members of Lupus 3

      integer*4 nr__2
      parameter (nr__2=82)	! Number of records
      character*122 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*17  ID_2        ! Member of Lupus 3 identifier (1)
      integer*4     RAh_1       ! (h) Hour of Right Ascension (J2000)
      integer*4     RAm_1       ! (min) Minute of Right Ascension (J2000)
      real*4        RAs_1       ! (s) Second of Right Ascension (J2000)
      character*1   DE__1       ! Sign of the Declination (J2000)
      integer*4     DEd_1       ! (deg) Degree of Declination (J2000)
      integer*4     DEm_1       ! (arcmin) Arcminute of Declination (J2000)
      real*4        DEs_1       ! (arcsec) Arcsecond of Declination (J2000)
      real*4        Jmag_1      ! (mag) ? J-band magnitude
      real*4        Ksmag_1     ! (mag) ? K_S_-band magnitude
      character*1   l_SpType1   ! [<] Limit flag on SpType1
      character*6   SpType1     ! Spectral type 1
      character*3   r_SpType1   ! [acdefgh, ] Spectral type 1 reference(s) (2)
      character*4   SpType2     ! Spectral type 2
      character*3   r_SpType2   ! [cdfgh, ] Spectral type 2 reference(s) (2)
      character*4   SpType3     ! Spectral type 3
      character*1   r_SpType3   ! [fgh] Spectral type 3 reference (2)
      character*4   SpType4     ! Spectral type 4
      character*1   r_SpType4   ! [h] Spectral type 4 reference (2)
      integer*4     Teff1       ! (K) ? Effective temperature 1
      character*3   r_Teff1     ! [acgh, ] Effective temperature 1 reference(s)
*                                  (2)
      integer*4     Teff2       ! (K) ? Effective temperature 2
      character*3   r_Teff2     ! [bh, ] Effective temperature 2 reference(s) (2)
      integer*4     Teff3       ! (K) ? Effective temperature 3
      character*1   r_Teff3     ! [c] Effective temperature 3 reference (2)
      character*17  Other       ! Other name
      character*1   r_Other     ! [c] Other name reference (2)
*Note (1): Identifiers are from:
*  Schwartz (1977ApJS...35..161S, Sz);
*  Comeron et al. (2003A&A...406.1001C, Par-Lup3);
*  Lopez Marti et al. (2005A&A...440..139L, Lup);
*  Mortier et al. (2011MNRAS.418.1194M, M);
*  2MASS (Cat. II/246, J16)
*  this paper (SONYC-Lup3).
*Note (2): Reference as follows:
*  a = This work;
*  b = Comeron et al. 2009, J/A+A/500/1045;
*  c = Comeron et al. 2013A&A...554A..86C;
*  d = Comeron et al. 2003A&A...406.1001C;
*  e = Allen et al. 2007ApJ...655.1095A;
*  f = Hughes et al. 1994AJ....108.1071H;
*  g = Mortier et al. 2011MNRAS.418.1194M;
*  h = Alcala et al. 2014, J/A+A/561/A2.

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

C  Loading file 'table2.dat'	! Photometry and Spectral Types for the Objects
*                                of Spectral Type M, or Slightly Earlier,
*                                Identified Toward Lupus 3

C  Format for file interpretation

    1 format(
     +  A4,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,F4.1,1X,F4.1,
     +  1X,F4.1,1X,F4.1,1X,A1,A6,1X,F3.1,1X,F5.1,1X,F3.1,1X,F5.1,1X,
     +  F3.1,1X,A1,1X,F6.1,1X,A9,1X,A1,1X,A22,1X,A3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,27
        read(1,'(A128)')ar__
        read(ar__,1)
     +  ID,RAh,RAm,RAs,DE_,DEd,DEm,DEs,imag,Jmag,Ksmag,Av,l_SpType,
     +  SpType,AvSp,pmRA,e_pmRA,pmDE,e_pmDE,Cand,EW,Memb,n_Memb,Com,
     +  r_Com
        if(ar__(58:60) .EQ. '') AvSp = rNULL__
        if(ar__(62:66) .EQ. '') pmRA = rNULL__
        if(ar__(68:70) .EQ. '') e_pmRA = rNULL__
        if(ar__(72:76) .EQ. '') pmDE = rNULL__
        if(ar__(78:80) .EQ. '') e_pmDE = rNULL__
        if(ar__(84:89) .EQ. '') EW = rNULL__
        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)
     +  ID,RAh,RAm,RAs,DE_,DEd,DEm,DEs,imag,Jmag,Ksmag,Av,l_SpType,
     +  SpType,AvSp,pmRA,e_pmRA,pmDE,e_pmDE,Cand,EW,Memb,n_Memb,Com,
     +  r_Com
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! Effective Temperature and Extinction Derived
*                                from Models, for the Objects of Spectral Type M
*                                (or Slightly Earlier) Toward Lupus 3

C  Format for file interpretation

    2 format(A4,1X,A1,I4,1X,F3.1,1X,I4,1X,F3.1,1X,I4,1X,A1,1X,F3.1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,27
        read(1,'(A34)')ar__1
        read(ar__1,2)
     +  ID_1,l_TeffAD,TeffAD,AvAD,TeffBTS,AvBTS,Teff,n_Teff,Avmean
        if(ar__1(7:10) .EQ. '') TeffAD = iNULL__
        if(ar__1(12:14) .EQ. '') AvAD = rNULL__
        if(ar__1(25:28) .EQ. '') Teff = iNULL__
        if(ar__1(32:34) .EQ. '') Avmean = rNULL__
c    ..............Just test output...........
        write(6,2)
     +  ID_1,l_TeffAD,TeffAD,AvAD,TeffBTS,AvBTS,Teff,n_Teff,Avmean
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table4.dat'	! Spectroscopically Confirmed Very Low Mass
*                                Members of Lupus 3

C  Format for file interpretation

    3 format(
     +  A17,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,1X,F4.1,1X,
     +  F4.1,1X,A1,A6,A3,1X,A4,A3,1X,A4,A1,1X,A4,A1,1X,I4,A3,1X,I4,A3,
     +  I4,A1,1X,A17,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table4.dat')
      write(6,*) '....Loading file: table4.dat'
      do i__=1,82
        read(1,'(A122)')ar__2
        read(ar__2,3)
     +  ID_2,RAh_1,RAm_1,RAs_1,DE__1,DEd_1,DEm_1,DEs_1,Jmag_1,Ksmag_1,
     +  l_SpType1,SpType1,r_SpType1,SpType2,r_SpType2,SpType3,
     +  r_SpType3,SpType4,r_SpType4,Teff1,r_Teff1,Teff2,r_Teff2,Teff3,
     +  r_Teff3,Other,r_Other
        if(ar__2(43:46) .EQ. '') Jmag_1 = rNULL__
        if(ar__2(48:51) .EQ. '') Ksmag_1 = rNULL__
        if(ar__2(84:87) .EQ. '') Teff1 = iNULL__
        if(ar__2(92:95) .EQ. '') Teff2 = iNULL__
        if(ar__2(99:102) .EQ. '') Teff3 = iNULL__
        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)
     +  ID_2,RAh_1,RAm_1,RAs_1,DE__1,DEd_1,DEm_1,DEs_1,Jmag_1,Ksmag_1,
     +  l_SpType1,SpType1,r_SpType1,SpType2,r_SpType2,SpType3,
     +  r_SpType3,SpType4,r_SpType4,Teff1,r_Teff1,Teff2,r_Teff2,Teff3,
     +  r_Teff3,Other,r_Other
        write(6,'(6H Pos: 2F8.4)') RAdeg_1,DEdeg_1
c    .......End.of.Just test output...........
      end do
      close(1)

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