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

  implicit none

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

  real(8), intent(out) :: g_sqrt(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) :: g_sqrt_z(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)

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

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

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

  g_sqrt_z(i,k) = (g_sqrt(i,k+1) + g_sqrt(i,k))/2.0d0

  g13x(i,k) = (g13(i+1,k) + g13(i,k))/2.0d0

  g13z(i,k) = (g13(i,k+1) + g13(i,k))/2.0d0

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

end subroutine jacobian

