!=================================================================
!  一次元 CO2 大気放射対流平衡計算プログラム; 
!  DCL による描画(動画用)
!
!  1999/05/31  小高正嗣
!  1999/06/04  小高正嗣
!=================================================================

      subroutine dclfig2
     I   ( ZGRID , QVAL, 
     D     NZ    , NZB                     )

!-----------------------------------------------------------------      
      implicit real*8 ( a-h,o-z )
!-----------------------------------------------------------------      

      dimension
     \   QVAL(-2:NZB), ZGRID(-2:NZB)

      real*4
     \   QVAL_p(0:NZ) , ZGRID_p(0:NZ)     

      real*4
     \   ZMIN, ZMAX,
     \   QMAX, QMIN 

!-----------------------------------------------------------------      

      do iz = 0, NZ
         QVAL_p(iz) = real( QVAL(iz) )
         ZGRID_p(iz)= real( ZGRID(iz) )/ 1000.0
      end do

      ZMIN    = ZGRID_p(0)
      ZMAX    = ZGRID_p(NZ)

      QMIN    = QVAL_p(0)
      QMAX    = QVAL_p(0)

      do iz = 0, NZ
         QMAX    = MAX( QMAX, QVAL_p(iz) )
         QMIN    = MIN( QMIN, QVAL_p(iz) )
      end do
      
      CALL grfrm                                                        
      CALL grswnd( QMIN, QMAX, ZMIN, ZMAX )   
      CALL grsvpt( 0.2, 0.8, 0.2, 0.8)                     
      CALL grstrn( 1 )
      CALL grstrf
      call ussttl( 'value', '[]', '', 'Z[km]' )
      CALL usdaxs
      CALL uuslni( 2 )
      CALL uulin( NZ+1, QVAL_p, ZGRID_p )

c      CALL grcls                                                        

      return

      end

