!=======================================
! 2D cumulus model - kaminari
!  - subroutine jacobian (2D)
! 
! Author    : TAKAHASHI Koko
! Date      : 2003/11/01
! 
!=======================================
subroutine jacobian(i,k,im,km,g12,g13,g12z,g13x,g13z,g13xz)
!(i,k,im,km,dx,zs,z,h,g12,g13)

  implicit none

  integer, intent(in) :: im
  integer, intent(in) :: km
  integer, intent(in) :: i, k

  real(8), intent(out) :: g12(0:im+1,0:km+1)    ! $B%d%3%S%"%s$N(B1/2$B>h(B
  real(8), intent(out) :: g13(0:im+1,0:km+1)    ! $B%d%3%S%"%s$N(B13$B@.J,(B
  real(8), intent(out) :: g12z(0:im+1,0:km+1)
  real(8), intent(out) :: g13x(0:im+1,0:km+1)
  real(8), intent(out) :: g13z(0:im+1,0:km+1)
  real(8), intent(out) :: g13xz(0:im+1,0:km+1)

!  real(8), intent(in) :: zs(0:im-1)
!  real(8), intent(in) :: dx
!  real(8), intent(in) :: h

!  real(8), intent(in) :: z(0:im+1,0:km+1)

  g12(i,k) = 1.0D0
  g13(i,k) = 0.0D0

!  g12(i,k) =  (h - zs(i))/h

!  g13(i,k) = (z(i,k) - h)/(h - zs(i))   &
!       &     *(zs(i) - zs(i-1))/dx

  g12z(i,k) = (g12(i,k+1) + g12(i,k))/2

  g13x(i,k) = (g13(i+1,k) + g13(i,k))/2

  g13z(i,k) = (g13(i,k+1) + g13(i,k))/2

  g13xz(i,k) = (                               &
       &        g13(i+1,k+1) + g13(i-1,k+1)    &
       &        + g13(i+1,k-1) + g13(i-1,k-1)  &
       &       )/4

end subroutine jacobian

