FORTRAN Generation
(/./ftp/cats/J/MNRAS/425/2116)

Conversion of standardized ReadMe file for file /./ftp/cats/J/MNRAS/425/2116 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-Sep-10
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/425/2116    Arizona CDFS Environment Survey, ACES        (Cooper+, 2012)
*================================================================================
*The Arizona CDFS Environment Survey (ACES): A Magellan/IMACS spectroscopic
*survey of the Chandra Deep Field-South.
*    Cooper M.C., Yan R., Dickinson M., Juneau S., Lotz J.M., Newman J.A.,
*    Papovich C., Salim S., Walth G., Weiner B.J., Willmer C.N.A.
*   <Mon. Not. R. Astron. Soc., 425, 2116-2127 (2012)>
*   =2012MNRAS.425.2116C
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'table1.dat'	! Slitmask observation information

      integer*4 nr__
      parameter (nr__=40)	! Number of records
      character*61 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*7   Mask        ! Name of the IMACS slitmask
      character*10  Date        ! ("YYYY/MM/DD") Observation date (UT)
      integer*4     RAh         ! (h) Slitmask center right ascension (J2000)
      integer*4     RAm         ! (min) Slitmask center right ascension (J2000)
      real*4        RAs         ! (s) Slitmask center right ascension (J2000)
      character*1   DE_         ! Slitmask center Declination sign (J2000)
      integer*4     DEd         ! (deg) Slitmask center Declination (J2000)
      integer*4     DEm         ! (arcmin) Slitmask center Declination (J2000)
      real*4        DEs         ! (arcsec) Slitmask center Declination (J2000)
      integer*4     PA          ! (deg) Position angle of the slitmask (E of N)
      integer*4     N0          ! Number of targets on slitmask.
      integer*4     Nz          ! Number of secure (Q = -1, 3, 4) redshifts
*                                      measured on slitmask
      integer*4     ExpTime     ! (s) Total exposure time for slitmask

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

C  Declarations for 'table2.dat'	! ACES redshift catalogue

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

C  J2000 position composed of: RAdeg DEdeg
      integer*4     Seq         ! [121/63431] Object identification number in the
*                                 R-band catalogue of Wolf et al. (2004,
*                                 Cat. II/253)
      real*8        RAdeg_1     ! (deg) Right ascension (J2000) (1)
      real*8        DEdeg_1     ! (deg) Declination (J2000) (1)
      real*4        Rmag        ! (mag) R-band magnitude in the AB system (1)
      character*7   Mask_1      ! Name of the IMACS slitmask on which the object
*                                  was observed
      integer*4     Slit        ! Number of slit on the IMACS slitmask
*                                  corresponding to the object
      real*8        MJD         ! (d) Modified Julian date of observation
      integer*4     Flag        ! [0/1] Targeting flag:
*                                        0 = main R-band selected target;
*                                        1 = Spitzer/MIPS 70um target
      real*8        z           ! ?=- Redshift derived from the observed spectrum
      real*8        zhel        ! ?=- Heliocentric-frame redshift.
      integer*4     Q           ! [-2/4] Redshift quality code, 4=best (2)
      real*8        zalt        ! ?=- Alternate redshift from literature
      integer*4     r_zalt      ! ?=- Source of alternate redshift (G1)
*Note (1): from Wolf et al. (2004, Cat. II/253).
*Note (2): Redshift quality code as follows:
*   -2 = unknown
*   -1 = star (redshift close to zero)
*    1 = unknown
*    3 = ~90 per cent confidence
*    4 = ~95 per cent confidence

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

C  Declarations for 'table3.dat'	! ACES environment catalogue

      integer*4 nr__2
      parameter (nr__2=4131)	! Number of records
      character*62 ar__2  	! Full-size record

      integer*4     Seq_1       ! Object identification number (SEQ) in the
*                                R-band catalogue of Wolf et al. (2004, II/253)
      real*4        zhel_1      ! Redshift (in the heliocentric frame)
      integer*4     r_zhel      ! Source of redshift (G1)
      real*4        Dedge       ! (Mpc) Distance from the nearest survey edge
*                                (h-1 comoving Mpc)
      real*4        lg_1_d3     ! ([-]) Overdensity as given by the third-nearest-
*                                neighbour surface density, ACES only tracer
      real*4        lg_1_d4     ! ([-]) Overdensity as given by the fourth-nearest-
*                                neighbour surface density, ACES only tracer
      real*4        lg_1_d5     ! ([-]) Overdensity as given by the fifth-nearest-
*                                neighbour surface density, ACES only tracer
      real*4        lg_1_d3_2   ! ([-]) Overdensity as given by the third-nearest-
*                                neighbour surface density, ACES + zpublic tracer
      real*4        lg_1_d4_2   ! ([-]) Overdensity as given by the fourth-nearest-
*                                neighbour surface density, ACES + zpublic tracer
      real*4        lg_1_d5_2   ! ([-]) Overdensity as given by the fifth-nearest-
*                                neighbour surface density, ACES + zpublic tracer

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

C  Loading file 'table1.dat'	! Slitmask observation information

C  Format for file interpretation

    1 format(
     +  A7,1X,A10,1X,I2,1X,I2,1X,F6.3,1X,A1,I2,1X,I2,1X,F5.2,1X,I3,1X,
     +  I3,1X,I3,1X,I4)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table1.dat')
      write(6,*) '....Loading file: table1.dat'
      do i__=1,40
        read(1,'(A61)')ar__
        read(ar__,1)
     +  Mask,Date,RAh,RAm,RAs,DE_,DEd,DEm,DEs,PA,N0,Nz,ExpTime
        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)
     +  Mask,Date,RAh,RAm,RAs,DE_,DEd,DEm,DEs,PA,N0,Nz,ExpTime
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table2.dat'	! ACES redshift catalogue

C  Format for file interpretation

    2 format(
     +  I5,1X,F9.6,1X,F10.6,1X,F5.2,1X,A7,1X,I3,1X,F7.1,1X,I1,1X,F7.5,
     +  1X,F7.5,1X,I2,1X,F7.5,1X,I1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table2.dat')
      write(6,*) '....Loading file: table2.dat'
      do i__=1,12983
        read(1,'(A83)')ar__1
        read(ar__1,2)
     +  Seq,RAdeg_1,DEdeg_1,Rmag,Mask_1,Slit,MJD,Flag,z,zhel,Q,zalt,
     +  r_zalt
        if (idig(ar__1(56:62)).EQ.0) z =  rNULL__
        if (idig(ar__1(64:70)).EQ.0) zhel =  rNULL__
        if (idig(ar__1(75:81)).EQ.0) zalt =  rNULL__
        if (r_zalt .EQ. 45) r_zalt =  iNULL__
c    ..............Just test output...........
        write(6,2)
     +  Seq,RAdeg_1,DEdeg_1,Rmag,Mask_1,Slit,MJD,Flag,z,zhel,Q,zalt,
     +  r_zalt
c    .......End.of.Just test output...........
      end do
      close(1)

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

C  Loading file 'table3.dat'	! ACES environment catalogue

C  Format for file interpretation

    3 format(
     +  I5,1X,F6.4,1X,I1,1X,F5.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,F6.3,1X,
     +  F6.3,1X,F6.3)

C  Effective file loading

      open(unit=1,status='old',file=
     +'table3.dat')
      write(6,*) '....Loading file: table3.dat'
      do i__=1,4131
        read(1,'(A62)')ar__2
        read(ar__2,3)
     +  Seq_1,zhel_1,r_zhel,Dedge,lg_1_d3,lg_1_d4,lg_1_d5,lg_1_d3_2,
     +  lg_1_d4_2,lg_1_d5_2
c    ..............Just test output...........
        write(6,3)
     +  Seq_1,zhel_1,r_zhel,Dedge,lg_1_d3,lg_1_d4,lg_1_d5,lg_1_d3_2,
     +  lg_1_d4_2,lg_1_d5_2
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