* Last processed by NICE on 12-Jun-2000 15:53:00
* Customized for :  IEEE, LINUX, UNIX, MOTIF, F77
      SUBROUTINE NIC_SHOW (LINE,ERROR)
C ----------------------------------------------------------------------
C 	Support routine for command
C	SHOW
C
C Arguments :
C	LINE	C*(*)	Command line			Input
C	ERROR	L	Logical error flag		Output
C
C ----------------------------------------------------------------------
      IMPLICIT NONE
*
      INCLUDE 'nic.inc'
      INCLUDE 'parameter.inc'
      INCLUDE 'par.inc'
      INCLUDE 'const.inc'
* Local
      CHARACTER*(*) LINE
      CHARACTER ARGUM1*7, TEXT*75
      LOGICAL ERROR
      INTEGER I, J, LENC, NUM, NC
*
      ARGUM1 = 'UNKNOWN'
      CALL SIC_CH(LINE,0,1,ARGUM1,NC,.FALSE.,ERROR)
      IF (ERROR) GOTO 999
      IF (ARGUM1.NE.'UNKNOWN') THEN      ! to do: GR\SHOW ...
         CALL GR_EXEC1 (LINE(5:LENC(LINE)))
         RETURN
      ENDIF
      IF (NRECORD.EQ.0) THEN
         CALL MESSAGE (2,1,'SHOW','No input file opened')
         RETURN
      ELSE
         WRITE (6,'('' Section Header ------------------------''/)')
         WRITE (6,'('' Scan_type           = '',i8)') SCAN_TYPE
         WRITE (6,'('' Scan_number         = '',i8)') SCAN_NUMBER
         WRITE (6,'('' Number_of_subscans  = '',i8)') NSUBSCAN
         WRITE (6,'('' Number_of_records   = '',i8)') NRECORD
         WRITE (6,'('' Date_of_observation = '',i8)')
     $   DATE_OF_OBSERVATION
*
         WRITE (6,'(/'' Section Antenna -----------------------''/)')
         WRITE (6,'('' Gain_Elevation      = '',4e12.4)')
     $   (GAIN_ELEV(I),I=1,4)
         WRITE (6,'(''                       '',4e12.4)')
     $   (GAIN_ELEV(I),I=5,8)
         WRITE (6,'('' Wobbler_throw       = '',F5.1)')
     $   WOBBLER_THROW
         WRITE (6,'('' Wobbler_period      = '',F5.1)')
     $   WOBBLER_PERIOD
*
         WRITE (6,'(/'' Section Bolometer ---------------------''/)')
         WRITE (6,'('' Reference_channel   = '',i8)')
     $   REFERENCE_RECEIVER
         WRITE (6,'('' Bolometer_gain      = '',i8)')
     $   NINT(REFERENCE_GAIN)
         WRITE (6,'('' Frequency           = '',i8)') NINT(FREQUENCY)
*
         TEXT = ' Channel_number      = '
         NUM = 0
         DO I=1,NCHAN
            J = I-NUM
            IF (J.LE.17) THEN
               WRITE (TEXT(21+J*3:23+J*3),'(i3)') RECEIVER_NUMBER(I)
            ELSE
               WRITE (6,'(a)') TEXT
               TEXT = '                       '
               WRITE (TEXT(21+1*3:23+1*3),'(i3)') RECEIVER_NUMBER(I)
               NUM = NUM+17
               J = 0
            ENDIF
         ENDDO
         IF (J.NE.0) WRITE (6,'(a)') TEXT
*
         TEXT = ' Channel_flag        = '
         NUM = 0
* read SIC variable RECEIVER_FLAG[]
         CALL R4TOR4(MEMORY(IP_FLAG),RECEIVER_FLAG(1),NCHAN)
         DO I=1,NCHAN
            J = I-NUM
            IF (J.LE.17) THEN
               WRITE (TEXT(21+J*3:23+J*3),'(l3)') RECEIVER_FLAG(I)
            ELSE
               WRITE (6,'(a)') TEXT
               TEXT = '                       '
               WRITE (TEXT(21+1*3:23+1*3),'(l3)') RECEIVER_FLAG(I)
               NUM = NUM+17
               J = 0
            ENDIF
         ENDDO
         IF (J.NE.0) WRITE (6,'(a)') TEXT
*
         CALL R4TOR4(MEMORY(IP_AZOFF),RECEIVER_AZ_OFFSET(1),NCHAN)
         TEXT = ' Channel_Az_Offset   = '
         NUM = 0
         DO I=1,NCHAN
            J = I-NUM
            IF (J.LE.8) THEN
               WRITE (TEXT(21+J*6:26+J*6),'(f6.1)')
     $         RECEIVER_AZ_OFFSET(I)
            ELSE
               WRITE (6,'(a)') TEXT
               TEXT = '                       '
               WRITE (TEXT(21+1*6:26+1*6),'(f6.1)')
     $         RECEIVER_AZ_OFFSET(I)
               NUM = NUM+8
               J = 0
            ENDIF
         ENDDO
         IF (J.NE.0) WRITE (6,'(a)') TEXT
*
         CALL R4TOR4(MEMORY(IP_ELOFF),RECEIVER_EL_OFFSET(1),
     $   NCHAN)
         TEXT = ' Channel_El_Offset   = '
         NUM = 0
         DO I=1,NCHAN
            J = I-NUM
            IF (J.LE.8) THEN
               WRITE (TEXT(21+J*6:26+J*6),'(f6.1)')
     $         RECEIVER_EL_OFFSET(I)
            ELSE
               WRITE (6,'(a)') TEXT
               TEXT = '                       '
               WRITE (TEXT(21+1*6:26+1*6),'(f6.1)')
     $         RECEIVER_EL_OFFSET(I)
               NUM = NUM+8
               J = 0
            ENDIF
         ENDDO
         IF (J.NE.0) WRITE (6,'(a)') TEXT
*
         WRITE (6,'(/'' Section Calibration -------------------''/)')
         WRITE (6,'('' Ambient_pressure    = '',f10.1)')
     $   AMBIENT_PRESSURE
         WRITE (6,'('' Ambient_temperature = '',f10.1)')
     $   AMBIENT_TEMPERATURE
         WRITE (6,'('' Refraction          = '',f10.1)') REFRACTION
         WRITE (6,'('' Humidity            = '',f10.1)') HUMIDITY
         WRITE (6,'('' Site_altitude       = '',f10.1)') SITE_ALTITUDE
         WRITE (6,'('' Water_vapour        = '',f10.1)') WATER_VAPOUR
*
         CALL R4TOR4(MEMORY(IP_GAIN),RECEIVER_GAIN(1),NCHAN)
         TEXT = ' Channel_Gain        = '
         NUM = 0
         DO I=1,NCHAN
            J = I-NUM
            IF (J.LE.8) THEN
               WRITE (TEXT(21+J*6:26+J*6),'(f6.2)') RECEIVER_GAIN(I)
            ELSE
               WRITE (6,'(a)') TEXT
               TEXT = '                       '
               WRITE (TEXT(21+1*6:26+1*6),'(f6.2)') RECEIVER_GAIN(I)
               NUM = NUM+8
               J = 0
            ENDIF
         ENDDO
         IF (J.NE.0) WRITE (6,'(a)') TEXT
*
         IF (NCALPOW.NE.0) THEN
            WRITE (6,'(/'' Section Total Power -------------------''/)')
            TEXT = ' Total_power_channel = '
            NUM = 0
            DO I=1,NCALPOW
               J = I-NUM
               IF (J.LE.17) THEN
                  WRITE (TEXT(21+J*3:23+J*3),'(i3)') CALPOW_NUMBER(I)
               ELSE
                  WRITE (6,'(a)') TEXT
                  TEXT = '                       '
                  WRITE (TEXT(21+1*3:23+1*3),'(i3)') CALPOW_NUMBER(I)
                  NUM = NUM+17
                  J = 0
               ENDIF
            ENDDO
            IF (J.NE.0) WRITE (6,'(a)') TEXT
*
            TEXT = ' Total_power_flag    = '
            NUM = 0
            DO I=1,NCALPOW
               J = I-NUM
               IF (J.LE.17) THEN
                  WRITE (TEXT(21+J*3:23+J*3),'(l3)') CALPOW_FLAG(I)
               ELSE
                  WRITE (6,'(a)') TEXT
                  TEXT = '                       '
                  WRITE (TEXT(21+1*3:23+1*3),'(l3)') CALPOW_FLAG(I)
                  NUM = NUM+17
                  J = 0
               ENDIF
            ENDDO
            IF (J.NE.0) WRITE (6,'(a)') TEXT
         ENDIF
      ENDIF
999   RETURN
      END
