FORTRAN Generation
(/./home/cats/IX/46)

Conversion of standardized ReadMe file for file /./home/cats/IX/46 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-May-20
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. IX/46         XMM-Newton Serendipitous Source Catalogue 3XMM-DR5 (XMM-SSC, 2016)
*================================================================================
*The XMM-Newton serendipitous survey. 
*VII. The third XMM-Newton serendipitous source catalogue.
*   Rosen S.R., Webb N. A., Watson, M.G., Ballet J., Barret D., Braito V., 
*   Carrera F.J., Ceballos M.T., Coriat M., Della Ceca R., Denkinson G., 
*   Esquej P., Farrell S.A., Freyberg M., Grise F., Guillout P., Heil L., 
*   Law-Green D., Lamer G., Lin D., Martino R., Michel L., Motch C., 
*   Nebot Gomez-Moran A., Page C.G., Page K., Page M., Pakull M.W., Pye J., 
*   Read A., Rodriguez P., Sakano M., Saxton R., Schwope A., Scott A.E., 
*   Sturm R., Traulsen I., Yershov V., Zolotukhin I. 
*  <XMM-SSC, Leicester, UK; Astron. Astrophys. 590, A1 (2016)>
*  =2016yCat.9046....0R
*  =2016A&A...590A...1R
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'xmm3r5s.dat'	! The 3XMM-DR5 Catalog, "slim" version

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

C  Position composed of: RAdeg DEdeg
      integer*8     Source      ! [200001101010001/207019812010095] 
*                                  (SRCID) Unique source index
      character*16  v3XMM       ! (IAUNAME) Unique source name (JHHMMSS.s+DDMMSS)
      real*8        RAdeg       ! (deg) (SC_RA) Mean source right ascension (ICRS)
      real*8        DEdeg       ! (deg) (SC_DEC) Mean source declination (ICRS)
      real*4        ePos        ! (arcsec) [0.03/20] (SC_POSERR) Mean error on position
      real*4        srcML       ! (SC_DET_ML) Source detection likelihood (2)
      real*4        Flux1       ! (mW/m2) (SC_EP_1_FLUX) Mean flux in 0.2-0.5keV band
      real*4        e_Flux1     ! (mW/m2) (SC_EP_1_FLUX_ERR) Mean error on Flux1
      real*4        Flux2       ! (mW/m2) (SC_EP_2_FLUX) Mean flux in 0.5-1.0keV band
      real*4        e_Flux2     ! (mW/m2) (SC_EP_2_FLUX_ERR) Mean error on Flux2
      real*4        Flux3       ! (mW/m2) (SC_EP_3_FLUX) Mean flux in 1.0-2.0keV band
      real*4        e_Flux3     ! (mW/m2) (SC_EP_3_FLUX_ERR) Mean error on Flux3
      real*4        Flux4       ! (mW/m2) (SC_EP_4_FLUX) Mean flux in 2.0-4.5keV band
      real*4        e_Flux4     ! (mW/m2) (SC_EP_4_FLUX_ERR) Mean error on Flux4
      real*4        Flux5       ! (mW/m2) (SC_EP_5_FLUX) Mean flux in 4.5-12keV band
      real*4        e_Flux5     ! (mW/m2) (SC_EP_5_FLUX_ERR) Mean error on Flux5
      real*4        Flux8       ! (mW/m2) (SC_EP_8_FLUX) Mean flux in 0.2-12keV band
      real*4        e_Flux8     ! (mW/m2) (SC_EP_8_FLUX_ERR) Mean error on Flux8
      real*4        Flux9       ! (mW/m2) ? (SC_EP_9_FLUX) Mean flux in 0.5-4.5keV band
      real*4        e_Flux9     ! (mW/m2) ? (SC_EP_9_FLUX_ERR) Mean error on Flux9
      real*4        F8min       ! (mW/m2) (SC_EP_8_FMIN) Minimum flux in 0.5-4.5keV band
      real*4        e_F8min     ! (mW/m2) (SC_EP_8_FMIN_ERR) Mean error on F8min
      real*4        F8max       ! (mW/m2) (SC_EP_8_FMAX) Maximum flux in 0.5-4.5keV band
      real*4        e_F8max     ! (mW/m2) (SC_EP_8_FMAX_ERR) Mean error on F8max
      real*4        HR1         ! [-1/1]? (SC_HR1) Hardness ratio, bands 1,2 (1)
      real*4        e_HR1       ! ? (SC_HR1_ERR) Mean error on HR1
      real*4        HR2         ! [-1/1]? (SC_HR2) Hardness ratio, bands 2,3 (1)
      real*4        e_HR2       ! ? (SC_HR2_ERR) Mean error on HR2
      real*4        HR3         ! [-1/1]? (SC_HR3) Hardness ratio, bands 3,4 (1)
      real*4        e_HR3       ! ? (SC_HR3_ERR) Mean error on HR3
      real*4        HR4         ! [-1/1]? (SC_HR4) Hardness ratio, bands 4,5 (1)
      real*4        e_HR4       ! ? (SC_HR4_ERR) Mean error on HR4
      real*4        ext         ! (arcsec) (SC_EXTENT) Total band extent
      real*4        extML       ! (SC_EXT_ML) Detection likelihood of the
*                                             extended source (3)
      real*4        Cst         ! [0/1]? (SC_CHI2PROB) Constant probability (4)
      integer*4     V           ! [0/1] (SC_VAR_FLAG) Variability flag (V=1)
      integer*4     S           ! [0/4] (SC_SUM_FLAG) summary flag, 0=best (5)
      real*8        MJD0        ! (d) [51577/56332] (MJD_FIRST) Date of first
*                                               observation (MJD)
      real*8        MJD1        ! (d) [51577/56333] (MJD_LAST) Date of last
*                                               observation (MJD)
      real*8        Fvar        ! ? (SC_FVAR) fractional excess variance of
*                                             the unique source (6)
      real*8        e_Fvar      ! ? (SC_FVARERR) Mean error on Fvar
      integer*4     Nd          ! [1/48] (N_DETECTIONS) Number of detections
      integer*4     c           ! [0/1] (CONFUSED) Confusion flag (7)
      character*54  uIRAP       ! (WEBPAGE_URL) URL for details at IRAP
*Note (1): The hardness ratio is defined as   (F2-F1)/(F2+F1)
*     if F2 is the flux in the harder band (the hardness ratio is
*     therefore -1 for softest sources and +1 for hardest sources).
*     The energy bands are:
*   1 = 0.2 -  0.5 keV (narrow band)
*   2 = 0.5 -  1.0 keV (narrow band)
*   3 = 1.0 -  2.0 keV (narrow band)
*   4 = 2.0 -  4.5 keV (narrow band)
*   5 = 4.5 - 12.0 keV (narrow band)
*   6 = 0.2 -  2.0 keV = soft broad band, no images made
*   7 = 2.0 - 12.0 keV = hard broad band, no images made
*   8 = 0.2 - 12.0 keV = total band
*   9 = 0.5 -  4.5 keV = XID band
*Note (2): defined as the maximum of the likelihoods of all detections
*     of this source.
*Note (3): defined as the average of the extent likelihoods of all
*     detections of this source.
*Note (4): {chi}^2^ probability that the unique source as detected by
*     any of the observations is constant, that is, the minimum value
*     of the EPIC probabilities in each detection.
*Note (5): the summary flag of the source is derived from the EPIC flag,
*    and is assigned the following values:
*   0 = good: none of the EPIC flags was set.
*   1 = source parameters may be affected: at least one of the EPIC warning
*        flags was set, but no possible-spurious detection flag is set.
*   2 = possibly spurious source: at least one of the possible-spurious
*        detection flags was set but not the manual flag
*   3 = source located in a area where spurious detection may occur.
*   4 = source located in a area where spurious detection may occur and is
*        possibly spurious.
*Note (6): The fractional excess variance of the unique source. It is the
*    value corresponding to the exposure and instrument that shows the
*    lowest probability of being constant.
*Note (7): This flag (1=true, 0=false) signifies that the 3-{sigma} error
*     circle of a detection within this unique source overlaps the 3-{sigma}
*     error circle of a nearby unique source. As such, it is an indicator of
*     possible confusion (uncertainty) about the assignment of detections
*     between sources.

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

C  Declarations for 'summary.dat'	! List of observations

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

C  J2000 position composed of: RAdeg DEdeg
      integer*4     Rev         ! [28/2412] (REVOLUT) Satellite revolution number
      integer*8     ObsID       ! (OBS_ID) XMM Observation number (Cat. B/xmm)
      integer*4     iODF        ! [1/10] (ODF_VERS) Data File (ODF) number
      real*8        RAdeg_1     ! (deg) (RA) field Right Ascension (J2000)
      real*8        DEdeg_1     ! (deg) (DEC) field Declination (J2000)
      character*28  Target      ! (TARGET) name
      integer*4     Q           ! [0/5] (OBS_CLASS) Observations quality (1)
      integer*4     Nd_1        ! [2/731] (NDET) Number of detections in field
      integer*4     Ng          ! [0/391] (NDETGOOD) Number of good detections
*                                     in field
      integer*4     Np          ! [1/3]? (PN_NEXP) Number of PN exposures merged
      character*3   f_PN        ! (PN_FILT) Filter of the PN exposure(s) (2)
      character*5   m_PN        ! (PN_MODE) Mode of the PN exposure(s) (3)
      integer*4     t_PN        ! (s) ?=--- (PN_TEXP) Total PN exposure time
      integer*4     N1          ! [1/5]? (M1_NEXP) Number of M1 exposures merged
      character*3   f_M1        ! (M1_FILT) Filter of the M1 exposure(s) (2)
      character*5   m_M1        ! (M1_MODE) Mode of the M1 exposures (3)
      integer*4     t_M1        ! (s) ?=--- (M1_TEXP) Total M1 exposure time
      integer*4     N2          ! [1/5]? (M2_NEXP) Number of M2 exposures merged
      character*3   f_M2        ! (M2_FILT) Filter of the M2 exposure(s) (2)
      character*5   m_M2        ! (M2_MODE) Mode of the M2 exposures (3)
      integer*4     t_M2        ! (s) ?=--- (M2_TEXP) Total M2 exposure time
*Note (1): Quality classification of the whole observation based on the area
*     flagged as bad in the manual flagging process
*Note (2): EPIC camera filters of catalogue observations:
*  Med=MEDIUM, Tn1=THIN1, Tn2=THIN2, Tck=THICK, Opn=OPEN,
*Note (3): MOS modes:
*   PFW  = Prime Full Window
*   PPW2 = Prime Partial W2
*   PPW3 = Prime Partial W3
*   PPW4 = Prime Partial W4
*   PPW5 = Prime Partial W5
*     FU = Fast Uncompressed
*     FC = Fast Compressed
*  PPRFS = Prime Partial Refreshed Frame Store

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

C  Loading file 'xmm3r5s.dat'	! The 3XMM-DR5 Catalog, "slim" version

C  Format for file interpretation

    1 format(
     +  I15,6X,A16,1X,F9.5,1X,F9.5,1X,F5.2,1X,E9.3,1X,E11.5,1X,E9.3,
     +  1X,E11.5,1X,E9.3,1X,E11.5,1X,E9.3,1X,E11.5,1X,E9.3,1X,E11.5,
     +  1X,E9.3,1X,E11.5,1X,E9.3,1X,E11.5,1X,E9.3,1X,E11.5,1X,E9.3,1X,
     +  E11.5,1X,E9.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,
     +  1X,F6.3,1X,F6.3,1X,F5.1,1X,E9.3,1X,F6.3,1X,I1,1X,I1,1X,F10.4,
     +  1X,F10.4,1X,F10.6,1X,F11.6,1X,I2,1X,I1,1X,A54)

C  Effective file loading

      open(unit=1,status='old',file=
     +'xmm3r5s.dat')
      write(6,*) '....Loading file: xmm3r5s.dat'
      do i__=1,396910
        read(1,'(A459)')ar__
        read(ar__,1)
     +  Source,v3XMM,RAdeg,DEdeg,ePos,srcML,Flux1,e_Flux1,Flux2,
     +  e_Flux2,Flux3,e_Flux3,Flux4,e_Flux4,Flux5,e_Flux5,Flux8,
     +  e_Flux8,Flux9,e_Flux9,F8min,e_F8min,F8max,e_F8max,HR1,e_HR1,
     +  HR2,e_HR2,HR3,e_HR3,HR4,e_HR4,ext,extML,Cst,V,S,MJD0,MJD1,
     +  Fvar,e_Fvar,Nd,c,uIRAP
        if(ar__(207:217) .EQ. '') Flux9 = rNULL__
        if(ar__(219:227) .EQ. '') e_Flux9 = rNULL__
        if(ar__(273:278) .EQ. '') HR1 = rNULL__
        if(ar__(280:285) .EQ. '') e_HR1 = rNULL__
        if(ar__(287:292) .EQ. '') HR2 = rNULL__
        if(ar__(294:299) .EQ. '') e_HR2 = rNULL__
        if(ar__(301:306) .EQ. '') HR3 = rNULL__
        if(ar__(308:313) .EQ. '') e_HR3 = rNULL__
        if(ar__(315:320) .EQ. '') HR4 = rNULL__
        if(ar__(322:327) .EQ. '') e_HR4 = rNULL__
        if(ar__(345:350) .EQ. '') Cst = rNULL__
        if(ar__(378:387) .EQ. '') Fvar = rNULL__
        if(ar__(389:399) .EQ. '') e_Fvar = rNULL__
c    ..............Just test output...........
        write(6,1)
     +  Source,v3XMM,RAdeg,DEdeg,ePos,srcML,Flux1,e_Flux1,Flux2,
     +  e_Flux2,Flux3,e_Flux3,Flux4,e_Flux4,Flux5,e_Flux5,Flux8,
     +  e_Flux8,Flux9,e_Flux9,F8min,e_F8min,F8max,e_F8max,HR1,e_HR1,
     +  HR2,e_HR2,HR3,e_HR3,HR4,e_HR4,ext,extML,Cst,V,S,MJD0,MJD1,
     +  Fvar,e_Fvar,Nd,c,uIRAP
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'summary.dat'	! List of observations

C  Format for file interpretation

    2 format(
     +  I4,1X,I10,1X,I3,1X,F9.5,1X,F9.5,1X,A28,1X,I1,1X,I3,1X,I3,1X,
     +  I1,1X,A3,1X,A5,1X,I6,1X,I1,1X,A3,1X,A5,1X,I6,1X,I1,1X,A3,1X,
     +  A5,1X,I6)

C  Effective file loading

      open(unit=1,status='old',file=
     +'summary.dat')
      write(6,*) '....Loading file: summary.dat'
      do i__=1,7781
        read(1,'(A135)')ar__1
        read(ar__1,2)
     +  Rev,ObsID,iODF,RAdeg_1,DEdeg_1,Target,Q,Nd_1,Ng,Np,f_PN,m_PN,
     +  t_PN,N1,f_M1,m_M1,t_M1,N2,f_M2,m_M2,t_M2
        if(ar__1(80:80) .EQ. '') Np = iNULL__
        if (t_PN .EQ. 45) t_PN =  iNULL__
        if(ar__1(99:99) .EQ. '') N1 = iNULL__
        if (t_M1 .EQ. 45) t_M1 =  iNULL__
        if(ar__1(118:118) .EQ. '') N2 = iNULL__
        if (t_M2 .EQ. 45) t_M2 =  iNULL__
c    ..............Just test output...........
        write(6,2)
     +  Rev,ObsID,iODF,RAdeg_1,DEdeg_1,Target,Q,Nd_1,Ng,Np,f_PN,m_PN,
     +  t_PN,N1,f_M1,m_M1,t_M1,N2,f_M2,m_M2,t_M2
c    .......End.of.Just test output...........
      end do
      close(1)

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