!=================================================================
!  CO2 大気放射過程計算プログラム; 加熱率の計算
! 
!  1999/05/31  小高正嗣
!  1999/06/07  小高正嗣
!=================================================================

      subroutine CLQRAD
     I   ( FXRADN, DENS0, TEMP0, TPOT0, PRES0, 
     I     FDZ   , 
     O     DTPRAD,
     C     CPDRY , DX   , GRAV ,
     D     NX    , NXB  , NZ   , NZB   )

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

      dimension
     \   DTPRAD( -2:NXB, -2:NZB )

      dimension
     \   FDZ  ( -2:NZB )

      dimension
     \   TPOT0( -2:NZB ), TEMP0( -2:NZB ), 
     \   DENS0( -2:NZB ), PRES0( -2:NZB )

      dimension
     \   FXRADN( -2:NXB, -2:NZB )

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

      do iz = 0, NZ-1
         do ix = -2, NXB
            DTPRAD( ix, iz ) = 
     \         - ( FXRADN( ix, iz + 1 ) - FXRADN ( ix, iz ) ) /
     \           ( CPDRY * DENS0( iz ) * FDZ( iz ) * DX ) * 
     \           ( TPOT0( iz ) / TEMP0( iz ) )
         end do
      end do

      do ix = -2, NXB
         DTPRAD( ix, NZ ) = 
     \         - ( FXRADN( ix, NZ + 1 ) - FXRADN ( ix, NZ ) ) /
     \           ( CPDRY * PRES0( NZ ) ) * GRAV *
     \           ( TPOT0( NZ ) / TEMP0( NZ ) )
      end do

      call BOUND ( DTPRAD, NX, NZ, NXB, NZB, 1, 1, 1, 1 )

      return
      end 



