CDS.headStuff2 FORTRAN Generation
()

Conversion of standardized ReadMe file for catalog 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 2024-Apr-26
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. VII/119             Catalogue of Principal Galaxies (PGC)   (Paturel+ 1989)
*================================================================================
*Catalogue of Principal Galaxies (PGC)
*     Paturel G., Fouque P., Bottinelli L., Gouguenheim L.
*    <Astron. Astrophys. Suppl. Ser. 80, 299 (1989)>
*    =1989A&AS...80..299P
C=============================================================================

C  Internal variables

      integer*4 i__

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

C  Declarations for 'pgc.dat'	! The PGC catalogue

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

C  B2000 position composed of: RAh RAm RAs DE- DEd DEm DEs
      real*8        RAdeg       ! (deg) Right Ascension B2000
      real*8        DEdeg       ! (deg)     Declination B2000
C  ---------------------------------- ! (position vector(s) in degrees)

      integer*4     PGC         ! [1/73197]+= PGC Number (3)
      integer*4     RAh         ! (h) []? Right Ascension B2000 (hours) (1)
      integer*4     RAm         ! (min) []? Right Ascension B2000 (minutes) (1)
      real*4        RAs         ! (s) []? Right Ascension B2000 (seconds) (1)
      character*1   DE_         ! Declination B2000 (sign) (1)
      integer*4     DEd         ! (deg) []? Declination B2000 (degrees) (1)
      integer*4     DEm         ! (arcmin) []? Declination B2000 (minutes) (1)
      integer*4     DEs         ! (arcsec) []? Declination B2000 (seconds) (1)
      integer*4     RA1950h     ! (h) []? Right Ascension 1950 (hours) (1)
      integer*4     RA1950m     ! (min) []? Right Ascension 1950 (minutes) (1)
      real*4        RA1950s     ! (s) []? Right Ascension 1950 (seconds) (1)
      character*1   DE1950_     ! Declination 1950 (sign) (1)
      integer*4     DE1950d     ! (deg) []? Declination 1950 (degrees) (1)
      integer*4     DE1950m     ! (arcmin) []? Declination 1950 (minutes) (1)
      integer*4     DE1950s     ! (arcsec) []? Declination 1950 (seconds) (1)
      character*1   u_DEs       ! [*] An asterisk indicates coordinates
*                                      with standard deviations less than
*                                      10arcsec (1)
      character*4   MType       ! Morphological type class; see section 3.1 of
*                                      the publication for details (1)
      real*4        MajAxis     ! (arcmin) []? Major axis diameter at 25mag/arcsec2 (1)
      character*1   u_MajAxis   ! [:?*] Uncertainty (:?) or accuracy (*) flag
*                                       on MajAxis (1)
      real*4        MinAxis     ! (arcmin) []? Minor axis diameter at 25mag/arcsec2 (1)
      character*1   u_MinAxis   ! [:?*] Uncertainty (:?) or accuracy (*) flag
*                                        on MinAxis (1)
      real*4        Btot        ! (mag) []? Apparent total magnitude; see section 3.3
*                                     of the publication for details (1)
      character*1   u_Btot      ! [*] An asterisk indicates magnitudes with
*                                      accuracy less than 0.3mag (1)
      integer*4     HRV         ! (km/s) []? Heliocentric Radial Velocity (1)
      character*1   u_HRV       ! [*] An asterisk indicates velocities with
*                                     standard deviations less than 30km/s (1)
      integer*4     PA          ! (deg) [0/180[? Position Angle from North eastward
*                                     in 1950 frame (1)
      character*16  Name1       ! Name of galaxy in other sources (2)
      character*16  Name2       ! Name of galaxy in other sources (2)
      character*16  Name3       ! Name of galaxy in other sources (2)
      character*16  Name4       ! Name of galaxy in other sources (2)
      character*1   Cont        ! [+] if a continuation record exists (1)
*Note (1): field empty for continuation lines, i.e. preceding line has a
*    '+' in byte 142
*Note (2): acronyms and references for designations are given in Table 2
*    of the publication
*Note (3): the PGC number is repeated for continuation line, i.e. when
*    line has a '+' in byte 142

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

C  Loading file 'pgc.dat'	! The PGC catalogue

C  Format for file interpretation

    1 format(
     +  I5,1X,I2,I2,F4.1,A1,I2,I2,I2,1X,I2,I2,F4.1,A1,I2,I2,I2,A1,1X,
     +  A4,F6.1,A1,1X,F5.1,A1,2X,F4.1,A1,2X,I5,A1,1X,I3,1X,A16,A16,
     +  A16,A16,A1)

C  Effective file loading

      open(unit=1,status='old',file=
     +'pgc.dat')
      write(6,*) '....Loading file: pgc.dat'
      do i__=1,77141
        read(1,'(A142)')ar__
        read(ar__,1)
     +  PGC,RAh,RAm,RAs,DE_,DEd,DEm,DEs,RA1950h,RA1950m,RA1950s,
     +  DE1950_,DE1950d,DE1950m,DE1950s,u_DEs,MType,MajAxis,u_MajAxis,
     +  MinAxis,u_MinAxis,Btot,u_Btot,HRV,u_HRV,PA,Name1,Name2,Name3,
     +  Name4,Cont
        if(ar__(7:8) .EQ. '') RAh = iNULL__
        if(ar__(9:10) .EQ. '') RAm = iNULL__
        if(ar__(11:14) .EQ. '') RAs = rNULL__
        if(ar__(16:17) .EQ. '') DEd = iNULL__
        if(ar__(18:19) .EQ. '') DEm = iNULL__
        if(ar__(20:21) .EQ. '') DEs = iNULL__
        if(ar__(23:24) .EQ. '') RA1950h = iNULL__
        if(ar__(25:26) .EQ. '') RA1950m = iNULL__
        if(ar__(27:30) .EQ. '') RA1950s = rNULL__
        if(ar__(32:33) .EQ. '') DE1950d = iNULL__
        if(ar__(34:35) .EQ. '') DE1950m = iNULL__
        if(ar__(36:37) .EQ. '') DE1950s = iNULL__
        if(ar__(44:49) .EQ. '') MajAxis = rNULL__
        if(ar__(52:56) .EQ. '') MinAxis = rNULL__
        if(ar__(60:63) .EQ. '') Btot = rNULL__
        if(ar__(67:71) .EQ. '') HRV = iNULL__
        if(ar__(74:76) .EQ. '') PA = iNULL__
        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)
     +  PGC,RAh,RAm,RAs,DE_,DEd,DEm,DEs,RA1950h,RA1950m,RA1950s,
     +  DE1950_,DE1950d,DE1950m,DE1950s,u_DEs,MType,MajAxis,u_MajAxis,
     +  MinAxis,u_MinAxis,Btot,u_Btot,HRV,u_HRV,PA,Name1,Name2,Name3,
     +  Name4,Cont
        write(6,'(6H Pos: 2F8.4)') RAdeg,DEdeg
c    .......End.of.Just test output...........
      end do
      close(1)

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