!=================================================================
!  CO2 大気放射過程計算プログラム
!
!  1999/06/07  小高正嗣
!  1999/09/21  小高正嗣
!  1999/10/18  小高正嗣
!=================================================================

      subroutine CLRAD
     I   ( TPOT0 , EQWDTH, PSFC,
     O     DTPRAD, FXRADU, FXRADD, FXRADN, BBRAD,
     B     TEMP0 , PRES0 , DENS0, FDZ  ,
     C     TSFC  , CPDRY , RDRY , DX   , 
     C     SIGMA ,
     D     NX    , NXB   , NZ   , NZB     )

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

      dimension
     \   DTPRAD( -2:NZB )

      dimension
     \   EQWDTH( 0:NZ, 0:NZ )

      dimension
     \   TSFC  ( -2:NXB )

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

      dimension
     \   BBRAD ( -2:NZB ),
     \   FXRADU( -2:NZB ),
     \   FXRADD( -2:NZB ),
     \   FXRADN( -2:NZB )

!-----------------------------------------------------------------      
! 放射場の計算; 黒体放射

      call CLBBRAD 
     I   ( TEMP0,
     O     BBRAD, 
     D     NZ   , NZB  )

!-----------------------------------------------------------------      
! 放射場の計算; 上向き放射束密度

      call CLFXRDU
     I   ( BBRAD , EQWDTH, TEMP0,
     O     FXRADU,
     C     SIGMA , TSFC  ,
     D     NZ    , NZB   ,  NXB   )      

!-----------------------------------------------------------------      
! 放射場の計算; 下向き放射束密度

      call CLFXRDD
     I   ( BBRAD , EQWDTH, TEMP0,
     O     FXRADD,
     D     NZ    , NZB           )

!-----------------------------------------------------------------      
! 放射場の計算; 正味の放射束密度

      call CLFXRDN
     I   ( FXRADU, FXRADD,
     O     FXRADN,
     D     NZ    , NZB     )

!-----------------------------------------------------------------      
! 加熱率の計算

      call CLQRAD
     I   ( FXRADN, DENS0, TEMP0 , TPOT0,
     I     FDZ   , 
     O     DTPRAD,
     C     CPDRY , DX   ,
     D     NZ    , NZR                  )

      return
      end
