!= 粗度長の設定, 陸面と海洋の差のみ考慮
!
!= Set roughness length, only considering land-ocean contrast
!
! Authors::   Yoshiyuki O. Takahashi
! Version::   $Id: roughlen_landoceancontrast.f90,v 1.2 2010-02-24 08:07:54 yot Exp $
! Tag Name::  $Name: dcpam5-20100224 $
! Copyright:: Copyright (C) GFD Dennou Club, 2008-2009. All rights reserved.
! License::   See COPYRIGHT[link:../../../COPYRIGHT]
!

module roughlen_landoceancontrast

  ! 宣言文 ; Declaration statements
  !
  implicit none
  private

  ! 公開手続き
  ! Public procedure
  !
  public:: SetRoughLenLandOceanContrast

contains

  subroutine SetRoughLenLandOceanContrast( &
    & xy_SurfCond, &
    & xy_RoughLen  &
    )

    ! モジュール引用 ; USE statements
    !

    ! 種別型パラメタ
    ! Kind type parameter
    !
    use dc_types, only: DP, &      ! 倍精度実数型. Double precision.
      &                 STRING     ! 文字列.       Strings.

    ! 格子点設定
    ! Grid points settings
    !
    use gridset, only: imax, & ! 経度格子点数.
                               ! Number of grid points in longitude
      &                jmax, & ! 緯度格子点数.
                               ! Number of grid points in latitude
      &                kmax    ! 鉛直層数.
                               ! Number of vertical level


    integer , intent(in   ) :: xy_SurfCond( 0:imax-1, 1:jmax )
    real(DP), intent(inout) :: xy_RoughLen( 0:imax-1, 1:jmax )

    ! 作業変数
    ! Work variables
    !
    integer:: i               ! 経度方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in longitude
    integer:: j               ! 緯度方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in latitude

    do j = 1, jmax
      do i = 0, imax-1

        if( xy_SurfCond( i, j ) == 0 ) then
          xy_RoughLen( i, j ) = 1.0d-4
        else
          xy_RoughLen( i, j ) = 1.0d-1
        end if

      end do
    end do


  end subroutine SetRoughLenLandOceanContrast

  !**************************************************************************************

end module roughlen_landoceancontrast

