subroutine rs_read( &
&   HEAD,     &
&   IDATE,    &
&   KT,       &        
&   H, B, T)     ! $BM=JsJQ?t(B
  use prm,          only: IMAX, JMAX, KMAX, DX
  use com_var,      only: x, zk  ! $B:BI8>pJs(B
  use file_switch,  only: rsrd_UID

  implicit none
  
  character(LEN=100), INTENT(OUT):: HEAD
  integer ,INTENT(OUT):: IDATE                     ! $B@QJ,3+;O;~9o(B
  integer ,INTENT(OUT):: KT                        ! $BA0$N@QJ,4|4V(B
  real(8) ,INTENT(OUT):: H(1:IMAX, 1:JMAX)             ! $BI89b(B
  real(8) ,INTENT(OUT):: B(1:IMAX, 1:JMAX)             ! $B4pHW9bEY(B
  real(8) ,INTENT(OUT):: T(1:IMAX, 1:JMAX, 1:KMAX)     ! $B29EY(B
   
  integer :: rIMAX, rJMAX, rKMAX                       ! $B%U%!%$%kFb$N>pJs(B
  real(8) :: rDX                                       ! $B%U%!%$%kFb$N>pJs(B
!----------!
! $B%X%C%@!<(B !
!----------!
  write(6, *)'restart file read start'
  READ(rsrd_UID   )HEAD
  write(6, *)'HEADER: ', HEAD

!----------!
! $B2rA|EY(B   !
!----------!
  write(6, *)'IMAX, JMAX, KMAX, DX: ', IMAX, JMAX, KMAX, DX
  READ(rsrd_UID)   rIMAX, rJMAX, rKMAX, rDX
  
  if((rIMAX /= IMAX).or.(rJMAX /= JMAX).or.(rKMAX /= KMAX))then
     write(6, *)'restart file is error'
     write(6, *)'system parameter is IMAX, JMAX, KMAX, DX'
     write(6, *)'system parameter is', IMAX, JMAX, KMAX, DX
     write(6, *)'rs file          is',rIMAX, rJMAX, rKMAX, rDX
     stop
  elseif(rDX /= DX)then
     write(6, *)'warning. DX of rs file differ Dx of system '
  end if


  READ(rsrd_UID) x, zk
  write(6, *) x
  write(6, *)zk

!----------!
! $B;~4V>pJs(B !
!----------!
  READ(rsrd_UID)IDATE, KT
  write(6, *) IDATE, KT
!----------!
! $BM=JsJQ?t(B !
!----------!
  
  READ(rsrd_UID) H
  READ(rsrd_UID) B
  READ(rsrd_UID) T
  close(rsrd_UID)
  write(6, *) 'restart file is reloaded '
end subroutine rs_read





