C*********************************************************************
C
C     PROGRAM TQDVLOP
C
C     水平平均温度・混合比鉛直分布作成プログラム(時間発展)
C
C     1998/09/22  小高正嗣
C     1998/10/02  小高正嗣
C     1999/01/17  小高正嗣
C
C*********************************************************************
      subroutine tqdvlop_z(ibegin,iend,inter)

C---------------------------------------------------------------------  
      IMPLICIT REAL*8 ( A-H, O-Z )                                      
C---------------------------------------------------------------------  
#include "grid_size_M.f"
      parameter ( nzprof = nz )                              
      parameter ( nzp = nz+1, ntp = 120 )
C---------------------------------------------------------------------  
C                                                                       
      CHARACTER*10 NMZPRF( NZPROF )                                     
      character*5  nmrun
      character*4  from
      character*1  chara
      character*1  pz
      character*2  end
      real*4 tend

      real*4  dtpad0,dqvad0
      real*4  zgrid(nzp)
      real*4  tptend(nzp),tpmean(nzp),dtpadv(nzp),
     &        dtpdif(nzp),dtpdnl(nzp),
     &        dtpdi0(nzp),dtprad(nzp),tperror(nzp)
      real*8  qvtend(nzp),qvmean(nzp),dqvadv(nzp),
     &        dqvdif(nzp),dqvdnl(nzp),
     &        dqvdi0(nzp),dqvnfl(nzp),qverror(nzp)
      real*4  qvmean_4(nzp)

      integer fnum
      integer ibegin,iend,inter
      real*4 para1
C
C=====================================================================  
      xvpt = 0.05
      yvpt = 0.4

c      open (11,file='exparam.1')
c      read (11,*) irun
c      read (11,*) time0, nloop1, nloop2, dtime, ntmoni, ntkubu
c      close(11)

c      write(6,*) 'data number = ', nloop1
c      write(0,*) 'ibegin(1-', nloop1, 
c     &           ') iend(1-', nloop1,  
c     &           ') inter(1-', nloop1, ')'
c      read (5,*) ibegin, iend, inter

c      call sgpwsn
c      read(*,*) iws

c      call gropn(iws)
c      call sglset( 'LCORNER', .FALSE. )
c      call sldiv( 'Y', 2, 1 )

c      call grfrm
c      call grswnd( 225., 270., 0., 10. )
c      call grswnd( 230., 276., 0., 10. )
c      call grsvpt( 0.2, 0.8, 0.2, 0.8 )
c      call grstrn(1)
c      call grstrf
c      call ussttl ( 'THETA', '[K]', '', 'Z[km]' )
c      call usdaxs

      para1 = 0.95

      do i = ibegin, iend+1, inter

         fnum = 49 + i
         open(fnum)

         read(fnum,'(a2,a15,g15.7,a6,g15.7,a4,9a15)') 
     &        chara, nmrun, t_begin, from, t_end,
     &        pz, (nmzprf(j),j=40,48)

         do iz = 1, nzp
            read(fnum,'(10g15.7)') zgrid(iz), 
     &           tptend(iz),
     &           tpmean(iz),
     &           dtpadv(iz),
     &           dtpdif(iz),
     &           dtpdnl(iz),
     &           dtpad0,
     &           dtpdi0(iz),
     &           dtprad(iz),
     &           tperror(iz)
         end do

         close(fnum)

         tend = t_end / 3600.
         tend = tend - 48 + 6
         write(end,500) INT(tend)
 500     format(I2)

         do iz = 1, nzp
            zgrid(iz) = zgrid(iz) / 1000.
         end do

         call grfig
         call grswnd( 225., 270., 0., 10. )
         call grsvpt ( xvpt, xvpt+0.2, 0.15, 0.35 )
c         call grsvpt ( xvpt, xvpt+0.2, 0.45, 0.65 )
         call grstrn(1)
         call grstrf


c         call sglset( 'LCHAR', .TRUE. )
c         call sgsplc( end ) 
c         call sglset ( 'LROT', .TRUE. )
c         call sgiset ( 'IROT', 90 )
c         call sgrset ( 'FFCT', para1 )

         call uulin(nzp, tpmean, zgrid)
         call sglset( 'LCHAR', .FALSE. )
         call sglset ( 'LROT', .FALSE. )
c         para1 = para1 - 0.08

            xvpt = xvpt + 0.23

      end do
*
*      
      end



