FORTRAN Generation
(/./ftp/cats/J/A_A/621/A126)

Conversion of standardized ReadMe file for file /./ftp/cats/J/A_A/621/A126 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-Sep-17
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/621/A126   CARMENES input catalogue of M dwarfs. IV.   (Diez Alonso+ 2019)
*================================================================================
*CARMENES input catalogue of M dwarfs.
*IV. New rotation periods from photometric time series.
*    Diez Alonso E., Caballero J.A., Montes D., de Cos Juez F.J., Dreizler S.,
*    Dubois F., Jeffers S.V., Lalitha S., Naves R., Reiners A., Ribas I.,
*    Vanaverbeke S., Amado P.J., Bejar V.J.S., Cortes-Contreras M., Herrero E.,
*    Hidalgo D., Kuerster M., Logie L., Quirrenbach A., Rau S., Seifert W.,
*    Schoefer P., Tal-Or L.
*    <Astron. Astrophys. 621, A126 (2019)>
*    =2019A&A...621A.126D        (SIMBAD/NED BibCode)
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'photom.dat'	! M dwarfs searched for photometric periods
                                 for 337 stars

      integer*4 nr__
      parameter (nr__=625)	! Number of records
      character*128 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)

      character*11  Karmn      (nr__) ! CARMENES designation (JHHMM+DDdA)
      character*21  Name       (nr__) ! Other Name of the star
      character*12  OName      (nr__) ! Other Name of the star
      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)
      character*17  Survey     (nr__) ! Survey
      integer*4     Nobs       (nr__) ! ?=- Number of data points before cleaning
      integer*4     Nused      (nr__) ! ?=- Number of data points after cleaning
      real*4        Dt         (nr__) ! (yr) ?=- Time between first and last visit
      real*4        v_mag_     (nr__) ! (mag) ?=- Mean magnitude
      real*8        s_mag      (nr__) ! (mag) []?=- Standard deviation of the individual
*                                   magnitudes
      real*4        e__mag_    (nr__) ! (mag) ?=- Mean error of magnitude

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

C  Declarations for 'rotper.dat'	! Rotation periods obtained for stars in our
                                 sample

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

      character*11  Karmn_1    (nr__1) ! CARMENES designation (JHHMM+DDdA)
      character*1   n_Karmn    (nr__1) ! [bcde] Individual note (1)
      real*8        Prot       (nr__1) ! (d) Rotation period determined in this work
      real*8        e_Prot     (nr__1) ! (d) rms uncertainty on Prot
      real*4        Amp        (nr__1) ! (mag) Amplitude of Prot from this work
      character*1   l_FAP      (nr__1) ! Limit flag on FAP
      real*8        FAP        (nr__1) ! (%) False alarm probability (this work)
      character*14  Survey_1   (nr__1) ! Survey used to compute Prot in this work
      real*8        ProtLit    (nr__1) ! (d) ?=- Previous published rotation period
      real*4        e_ProtLit  (nr__1) ! (d) ? rms uncertainty on ProtLit
      real*4        AmpLit     (nr__1) ! (mag) ?=- Amplitude of previous published Prot
      character*1   l_FAPLit   (nr__1) ! Limit flag on FAPLit
      real*4        FAPLit     (nr__1) ! (%) ?=- False alarm probability of previous
*                                   published Prot
      character*5   r_ProtLit  (nr__1) ! References of previous published Prot (2)
*Note (1): Individual notes as follows:
*      b = J00051+457 = GJ 2: the periodogram of the ASAS light curve displays
*           several secondary peaks around 15.37d, including at 21.2d as found
*           by Suarez-mascareno et al., 2015MNRAS.452.2745S.
*      c = J04472+206 = RX J0447.2+2038: we also measured Prot=0.342+/-0.002d,
*           in the Montcabrer dataset
*      d = J06318+414 = LP 205-044: the periodogram of the SuperWASP light curve
*           displays a second peak at 0.482d of approximately the same power
*           as at 0.299d.
*      e = J10508+068 = EE Leo: we increased the frequency search to less than
*           half of the inverse of the time baseline of about 80d, so the
*           tabulated period is uncertain.
*Note (2): References as follows:
*      GR98  = Greimel & Robb , 1998IBVS.4652....1G
*      Fek00 = Fekel & Henry, 2000AJ....120.3265F
*      Tes04 = Testa et al., 2004ApJ...617..508T
*      Riv05 = Rivera et al., 2005ApJ...634..625R, Cat. J/ApJ/634/625
*      KS07  = Kiraga and Stepien, 2007AcA....57..149K
*      Nor07 = Norton et al., 2007A&A...467..785N, Cat. J/A+A/467/785
*      Hal08 = Hallinan et al., 2008ApJ...684..644H
*      Har11 = Hartman et al., 2011AJ....141..166H, Cat. J/AJ/141/166
*      Irw11 = Irwin et al., 2011ApJ...727...56I
*      Kir12 = Kiraga, 2012AcA....62...67K, Cat. J/AcA/62/67
*      KS13  = Kiraga & Stepien, 2013AcA....63...53K, Cat. J/AcA/63/53
*      SM15  = Suarez-mascareno et al., 2015MNRAS.452.2745S
*      Wes15 = West et al., 2015ApJ...812....3W, Cat. J/ApJ/812/3
*      Dav16 = David et al., 2016Natur.534..658D
*      New16 = Newton et al., 2016ApJ...821...93N, Cat. J/ApJ/821/93
*      SM16  = Suarez Mascareno et al., 2016A&A...595A..12S
*      SM17  = Mascareno et al., 2018A&A...612A..89M
*      Clo17 = Cloutier et al., 2017A&A...608A..35C, Cat. J/A+A/608/A35
*      Vid17 = Vida et al., 2017ApJ...841..124V
*      Lot18 = Lothringer et al., 2018AJ....155...66L

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

C  Loading file 'photom.dat'	! M dwarfs searched for photometric periods
*                                 for 337 stars

C  Format for file interpretation

    1 format(
     +  A11,1X,A21,1X,A12,1X,I2,1X,I2,1X,F5.2,1X,A1,I2,1X,I2,1X,F4.1,
     +  1X,A17,1X,I5,1X,I5,1X,F6.4,1X,F6.3,1X,F7.4,1X,F5.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'photom.dat')
      write(6,*) '....Loading file: photom.dat'
      do i__=1,625
        read(1,'(A128)')ar__
        read(ar__,1)
     +  Karmn(i__),Name(i__),OName(i__),RAh(i__),RAm(i__),RAs(i__),
     +  DE_(i__),DEd(i__),DEm(i__),DEs(i__),Survey(i__),Nobs(i__),
     +  Nused(i__),Dt(i__),v_mag_(i__),s_mag(i__),e__mag_(i__)
        if (Nobs(i__) .EQ. 45) Nobs(i__) =  iNULL__
        if (Nused(i__) .EQ. 45) Nused(i__) =  iNULL__
        if (idig(ar__(102:107)).EQ.0) Dt(i__) =  rNULL__
        if (idig(ar__(109:114)).EQ.0) v_mag_(i__) =  rNULL__
        if (idig(ar__(116:122)).EQ.0) s_mag(i__) =  rNULL__
        if (idig(ar__(124:128)).EQ.0) e__mag_(i__) =  rNULL__
        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)
     +  Karmn(i__),Name(i__),OName(i__),RAh(i__),RAm(i__),RAs(i__),
     +  DE_(i__),DEd(i__),DEm(i__),DEs(i__),Survey(i__),Nobs(i__),
     +  Nused(i__),Dt(i__),v_mag_(i__),s_mag(i__),e__mag_(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 'rotper.dat'	! Rotation periods obtained for stars in our
*                                 sample

C  Format for file interpretation

    2 format(
     +  A11,A1,1X,F9.5,1X,F8.5,2X,F5.3,1X,A1,F8.5,1X,A14,2X,F8.4,1X,
     +  F6.4,F6.4,1X,A1,F4.1,1X,A5)

C  Effective file loading

      open(unit=1,status='old',file=
     +'rotper.dat')
      write(6,*) '....Loading file: rotper.dat'
      do i__=1,142
        read(1,'(A98)')ar__1
        read(ar__1,2)
     +  Karmn_1(i__),n_Karmn(i__),Prot(i__),e_Prot(i__),Amp(i__),
     +  l_FAP(i__),FAP(i__),Survey_1(i__),ProtLit(i__),e_ProtLit(i__),
     +  AmpLit(i__),l_FAPLit(i__),FAPLit(i__),r_ProtLit(i__)
        if (idig(ar__1(66:73)).EQ.0) ProtLit(i__) =  rNULL__
        if(ar__1(75:80) .EQ. '') e_ProtLit(i__) = rNULL__
        if (idig(ar__1(81:86)).EQ.0) AmpLit(i__) =  rNULL__
        if (idig(ar__1(89:92)).EQ.0) FAPLit(i__) =  rNULL__
c    ..............Just test output...........
        write(6,2)
     +  Karmn_1(i__),n_Karmn(i__),Prot(i__),e_Prot(i__),Amp(i__),
     +  l_FAP(i__),FAP(i__),Survey_1(i__),ProtLit(i__),e_ProtLit(i__),
     +  AmpLit(i__),l_FAPLit(i__),FAPLit(i__),r_ProtLit(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