FORTRAN Generation
(/./ftp/cats/III/159A)

Conversion of standardized ReadMe file for file /./ftp/cats/III/159A 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-19
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. III/159A    Ca II H and K Measurements Made at MWO (Duncan+ 1991)
*================================================================================
*Ca II H and K Measurements Made at Mount Wilson Observatory, 1966-1983
*    Duncan D.K., Vaughan A.H., Wilson O.C., Preston G.W., Frazer J.,
*    Lanning H.H., Misch A., Mueller J., Soyumer D., Woodard L., Baliunas S.L.,
*    Noyes R.W., Hartmann L.W., Porter A., Zwaan K., Middelkoop F.,
*    Rutter R., Mihalas D.
*   <Astrophys. J. Suppl. Ser. 76, 383 (1991)>
*   =1991ApJS...76..383D
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'catalog.dat'	! Observational Data

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

C  J2000 position composed of: RAdeg DEdeg
      character*10  Star       (nr__) ! Star Name or Number (default = HD or DM)
      integer*4     Nobs       (nr__) ! Number of Observations of S
      real*4        Smin       (nr__) ! Minimum S value
      real*4        Smax       (nr__) ! Maximum S value
      real*4        Smean      (nr__) ! Mean S value (1)
      real*4        e_Smean    (nr__) ! Standard deviation on Smean
      real*4        sdS        (nr__) ! (%) Standard deviation as a percentage
      real*8        Wmin       (nr__) ! Minimum weight (2)
      real*8        Wmean      (nr__) ! Mean weight (2)
      character*10  Date1      (nr__) ! ("DD/MM/YYYY") First Date the star was observed
      character*10  Date2      (nr__) ! ("DD/MM/YYYY") Last Date the star was observed
      character*19  SName      (nr__) ! Name recognized by Simbad
      real*8        RAdeg      (nr__) ! (deg) ? Right Ascension (J2000)
      real*8        DEdeg      (nr__) ! (deg) ? Declination (J2000)
      character*1   rPos       (nr__) ! [AUM] Origin of position: A=ASCC-2.5 (I/280)
*                                          U=UCAC2 (I/289), M=2MASS (II/246)
      real*4        Bmag       (nr__) ! (mag) ? B mag in Johnson system (from ASCC-2.5)
      real*4        Vmag       (nr__) ! (mag) ? V mag in Johnson system (from ASCC-2.5)
      integer*4     ASCC       (nr__) ! ? [1,2603318] ASCC-2.5 number (Cat. I/280)
      integer*4     HIP        (nr__) ! ? Hipparcos number (Cat. I/239)
*Note (1): the activity index S is the ratio of photon counts in the H and K
*     lines relative to the continuum, see the "Description" section above.
*Note (2): the weight is zero for the HKP-1 measurements which have been
*    converted to the S scale of HKP-2.

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

C  Loading file 'catalog.dat'	! Observational Data

C  Format for file interpretation

    1 format(
     +  A10,1X,I4,1X,F6.4,1X,F6.4,1X,F6.4,1X,F6.4,1X,F6.2,1X,F8.1,1X,
     +  F8.1,1X,A10,1X,A10,2X,A19,1X,F8.4,1X,F8.4,1X,A1,1X,F6.3,1X,
     +  F6.3,1X,I7,1X,I6)

C  Effective file loading

      open(unit=1,status='old',file=
     +'catalog.dat')
      write(6,*) '....Loading file: catalog.dat'
      do i__=1,3111
        read(1,'(A160)')ar__
        read(ar__,1)
     +  Star(i__),Nobs(i__),Smin(i__),Smax(i__),Smean(i__),
     +  e_Smean(i__),sdS(i__),Wmin(i__),Wmean(i__),Date1(i__),
     +  Date2(i__),SName(i__),RAdeg(i__),DEdeg(i__),rPos(i__),
     +  Bmag(i__),Vmag(i__),ASCC(i__),HIP(i__)
        if(ar__(113:120) .EQ. '') RAdeg(i__) = rNULL__
        if(ar__(122:129) .EQ. '') DEdeg(i__) = rNULL__
        if(ar__(133:138) .EQ. '') Bmag(i__) = rNULL__
        if(ar__(140:145) .EQ. '') Vmag(i__) = rNULL__
        if(ar__(147:153) .EQ. '') ASCC(i__) = iNULL__
        if(ar__(155:160) .EQ. '') HIP(i__) = iNULL__
c    ..............Just test output...........
        write(6,1)
     +  Star(i__),Nobs(i__),Smin(i__),Smax(i__),Smean(i__),
     +  e_Smean(i__),sdS(i__),Wmin(i__),Wmean(i__),Date1(i__),
     +  Date2(i__),SName(i__),RAdeg(i__),DEdeg(i__),rPos(i__),
     +  Bmag(i__),Vmag(i__),ASCC(i__),HIP(i__)
c    .......End.of.Just test output...........
      end do
      close(1)

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