!= 荳矩Κ蠅�阜繝輔Λ繝�け繧ｹ
!
!= Lower boundary flux
!
! Authors::   Yoshiyuki O. Takahashi
! Version::   $Id: lb_flux_simple.f90,v 1.2 2014/05/07 09:39:22 murashin Exp $
! Tag Name::  $Name:  $
! Copyright:: Copyright (C) GFD Dennou Club, 2008-2009. All rights reserved.
! License::   See COPYRIGHT[link:../../../COPYRIGHT]
!

module lb_flux_simple
  !
  != 荳矩Κ蠅�阜繝輔Λ繝�け繧ｹ
  !
  != Lower boundary flux
  !
  ! <b>Note that Japanese and English are described in parallel.</b>
  !
  !
  !
  !
  !
  !== References
  !
!!$  ! Louis, J-F., M. Tiedtke, and J-F. Geleyn,
!!$  ! A short history of the PBL parameterization at ECMWF,
!!$  ! Workshop on Planetary Boundary Layer Parameterization, 59-80, ECMWF, Reading, U.K.,
!!$  ! 1982.
  !
  !== Procedures List
  !
!!$  ! SurfaceFlux       :: 蝨ｰ陦ｨ髱｢繝輔Λ繝�け繧ｹ縺ｮ險育ｮ�
!!$  ! SurfaceFluxOutput :: 蝨ｰ陦ｨ髱｢繝輔Λ繝�け繧ｹ縺ｮ蜃ｺ蜉�
!!$  ! ------------      :: ------------
!!$  ! SurfaceFlux       :: Calculate surface fluxes
!!$  ! SurfaceFluxOutput :: Output surface fluxes
  !
  !== NAMELIST
  !
  ! NAMELIST#lb_flux_simple_nml
  !

  ! 繝｢繧ｸ繝･繝ｼ繝ｫ蠑慕畑 ; USE statements
  !

  ! 譬ｼ蟄千せ險ｭ螳�
  ! 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

  ! 邨��縺ｫ髢｢繧上ｋ驟榊�縺ｮ險ｭ螳�
  ! Settings of array for atmospheric composition
  !
  use composition, only: ncmax, IndexH2OVap

  ! 遞ｮ蛻･蝙九ヱ繝ｩ繝｡繧ｿ
  ! Kind type parameter
  !
  use dc_types, only: DP, &      ! 蛟咲ｲｾ蠎ｦ螳滓焚蝙�. Double precision.
    &                 STRING, &  ! 譁�ｭ怜�.       Strings.
    &                 TOKEN      ! 繧ｭ繝ｼ繝ｯ繝ｼ繝�.   Keywords.

  ! 繝｡繝�そ繝ｼ繧ｸ蜃ｺ蜉�
  ! Message output
  !
  use dc_message, only: MessageNotify

  ! 螳｣險譁� ; Declaration statements
  !
  implicit none
  private

  ! 蜈ｬ髢区焔邯壹″
  ! Public procedure
  !
  public :: LBFluxSimple
  public :: LBFluxSimpleInit
!!$  public :: SurfaceFluxOutput

  ! 蜈ｬ髢句､画焚
  ! Public variables
  !

  ! 髱槫�髢句､画焚
  ! Private variables
  !
  logical, save :: lb_flux_simple_inited = .false.
                              ! 蛻晄悄險ｭ螳壹ヵ繝ｩ繧ｰ.
                              ! Initialization flag

  integer, save      :: IDLBMomFluxMode
  integer, parameter :: IDLBMomFluxModeNoFlux       = 10
  integer, parameter :: IDLBMomFluxModeFixTimeConst = 11
  integer, save      :: IDLBHeatFluxMode
  integer, parameter :: IDLBHeatFluxModeFixFlux     = 20
  integer, parameter :: IDLBHeatFluxModeFixTemp     = 21
  integer, save      :: IDLBH2OVapFluxMode
  integer, parameter :: IDLBH2OVapFluxModeFixFlux   = 30
  integer, parameter :: IDLBH2OVapFluxModeFixMixRt  = 31

  real(DP), save:: FricTimeConstAtLB
                            ! 荳矩Κ蠅�阜鞫ｩ謫ｦ縺ｮ菫よ焚 (s).
                            ! Time constant of surface friction (s).
  real(DP), save:: FricLowestLatAtLB
                            ! 荳矩Κ蠅�阜鞫ｩ謫ｦ縺悟ロ縺乗怙菴守ｷｯ蠎ｦ (degree).
                            ! Lowest latitude where the friction is applied (degree)
  real(DP), save:: HeatFluxAtLB
                            ! 荳矩Κ蠅�阜縺ｧ縺ｮ辭ｱ繝輔Λ繝�け繧ｹ (W m-2).
                            ! Heat flux at the lower boundary (W m-2).
  real(DP), save:: TempAtLB
  real(DP), save:: H2OVapFluxAtLB
                            ! 荳矩Κ蠅�阜縺ｧ縺ｮ H2O 闥ｸ豌苓ｳｪ驥上ヵ繝ｩ繝�け繧ｹ (W m-2).
                            ! 螳滄圀縺ｫ縺ｯ繧ｼ繝ｭ縺ｫ蝗ｺ螳壹☆繧九◆繧√↓菴ｿ縺�ｨ句ｺｦ縺ｫ縺励°菴ｿ縺医↑縺�□繧阪≧.
                            ! H2O vapor flux at the lower boundary (kg m-2 s-1).
  real(DP), save:: QH2OVapAtLB
  real(DP), save:: DiffCoefHeatMass

  character(*), parameter:: module_name = 'lb_flux_simple'
                              ! 繝｢繧ｸ繝･繝ｼ繝ｫ縺ｮ蜷咲ｧｰ.
                              ! Module name
  character(*), parameter:: version = &
    & '$Name:  $' // &
    & '$Id: lb_flux_simple.f90,v 1.2 2014/05/07 09:39:22 murashin Exp $'
                              ! 繝｢繧ｸ繝･繝ｼ繝ｫ縺ｮ繝舌�繧ｸ繝ｧ繝ｳ
                              ! Module version

contains

  !--------------------------------------------------------------------------------------

  subroutine LBFluxSimple( &
    & xyz_U, xyz_V, xyz_Temp, xyr_VirTemp, xyzf_QMix,             & ! (in)
    & xyr_Press, xy_SurfHeight, xyz_Height, xyz_Exner, xyr_Exner, & ! (in)
    & xyr_MomFluxX, xyr_MomFluxY, xyr_HeatFlux, xyrf_QMixFlux,    & ! (out)
    & xy_SurfVelTransCoef, xy_SurfTempTransCoef,                  & ! (out)
    & xy_SurfQVapTransCoef                                        & ! (out)
    & )
    !
    ! 貂ｩ蠎ｦ, 豈疲ｹｿ, 豌怜悸縺九ｉ, 謾ｾ蟆�ヵ繝ｩ繝�け繧ｹ繧定ｨ育ｮ励＠縺ｾ縺�.
    !
    ! Calculate radiation flux from temperature, specific humidity, and
    ! air pressure.
    !

    ! 繝｢繧ｸ繝･繝ｼ繝ｫ蠑慕畑 ; USE statements
    !

    ! 迚ｩ逅��謨ｰ蟄ｦ螳壽焚險ｭ螳�
    ! Physical and mathematical constants settings
    !
    use constants0, only: &
      & PI
                              ! $ \pi $ .
                              ! 蜀�捉邇�.  Circular constant

    ! 迚ｩ逅�ｮ壽焚險ｭ螳�
    ! Physical constants settings
    !
    use constants, only: &
      & Grav, &               ! $ g $ [m s-2].
                              ! 驥榊鴨蜉�騾溷ｺｦ.
                              ! Gravitational acceleration
      & GasRDry, &
                              ! $ R $ [J kg-1 K-1].
                              ! 荵ｾ辯･螟ｧ豌励�豌嶺ｽ灘ｮ壽焚.
                              ! Gas constant of air
      & CpDry
                              ! $ C_p $ [J kg-1 K-1].
                              ! 荵ｾ辯･螟ｧ豌励�螳壼悸豈皮�.
                              ! Specific heat of air at constant pressure

    ! 鬟ｽ蜥梧ｯ疲ｹｿ縺ｮ邂怜�
    ! Evaluate saturation specific humidity
    !
    use saturate, only: xy_CalcQVapSat

    ! 蠎ｧ讓吶ョ繝ｼ繧ｿ險ｭ螳�
    ! Axes data settings
    !
    use axesset, only: &
      & y_Lat                 ! $ \varphi $ [rad.] . 邱ｯ蠎ｦ. Latitude

    ! 譎ょ綾邂｡逅�
    ! Time control
    !
    use timeset, only: &
      & TimeN, &              ! 繧ｹ繝�ャ繝� $ t $ 縺ｮ譎ょ綾. Time of step $ t $.
      & TimesetClockStart, TimesetClockStop

    ! 繝�ヰ繝�げ逕ｨ繝ｦ繝ｼ繝�ぅ繝ｪ繝�ぅ
    ! Utilities for debug
    !
    use dc_trace, only: DbgMessage, BeginSub, EndSub

    ! 螳｣險譁� ; Declaration statements
    !

    real(DP), intent(in):: xyz_U (0:imax-1, 1:jmax, 1:kmax)
                              ! $ u $ . 譚ｱ隘ｿ鬚ｨ騾�. Eastward wind
    real(DP), intent(in):: xyz_V (0:imax-1, 1:jmax, 1:kmax)
                              ! $ v $ . 蜊怜圏鬚ｨ騾�. Northward wind

    real(DP), intent(in):: xyz_Temp (0:imax-1, 1:jmax, 1:kmax)
                              ! $ T $ . 貂ｩ蠎ｦ (謨ｴ謨ｰ繝ｬ繝吶Ν).
                              ! Temperature (full level)
    real(DP), intent(in):: xyr_VirTemp (0:imax-1, 1:jmax, 0:kmax)
                              ! $ T_v $ . 莉ｮ貂ｩ蠎ｦ (蜊頑紛謨ｰ繝ｬ繝吶Ν).
                              ! Virtual temperature (half level)
    real(DP), intent(in):: xyzf_QMix(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
                              ! $ q $ .     豈疲ｹｿ. Specific humidity
    real(DP), intent(in):: xyr_Press (0:imax-1, 1:jmax, 0:kmax)
                              ! $ p_s $ . 蝨ｰ陦ｨ髱｢豌怜悸 (蜊頑紛謨ｰ繝ｬ繝吶Ν).
                              ! Surface pressure (half level)
    real(DP), intent(in):: xy_SurfHeight(0:imax-1,1:jmax)
                              ! $ z_s $ . 蝨ｰ陦ｨ髱｢鬮伜ｺｦ.
                              ! Surface height.
    real(DP), intent(in):: xyz_Height (0:imax-1, 1:jmax, 1:kmax)
                              ! 鬮伜ｺｦ (謨ｴ謨ｰ繝ｬ繝吶Ν).
                              ! Height (full level)
    real(DP), intent(in):: xyz_Exner (0:imax-1, 1:jmax, 1:kmax)
                              ! Exner 髢｢謨ｰ (謨ｴ謨ｰ繝ｬ繝吶Ν).
                              ! Exner function (full level)
    real(DP), intent(in):: xyr_Exner (0:imax-1, 1:jmax, 0:kmax)
                              ! Exner 髢｢謨ｰ (蜊頑紛謨ｰ繝ｬ繝吶Ν).
                              ! Exner function (half level)
    real(DP), intent(out):: xyr_MomFluxX (0:imax-1, 1:jmax, 0:0)
                              ! 譚ｱ隘ｿ譁ｹ蜷鷹°蜍暮㍼繝輔Λ繝�け繧ｹ.
                              ! Eastward momentum flux
    real(DP), intent(out):: xyr_MomFluxY (0:imax-1, 1:jmax, 0:0)
                              ! 蜊怜圏譁ｹ蜷鷹°蜍暮㍼繝輔Λ繝�け繧ｹ.
                              ! Northward momentum flux
    real(DP), intent(out):: xyr_HeatFlux (0:imax-1, 1:jmax, 0:0)
                              ! 辭ｱ繝輔Λ繝�け繧ｹ.
                              ! Heat flux
    real(DP), intent(out):: xyrf_QMixFlux(0:imax-1, 1:jmax, 0:0, 1:ncmax)
                              ! 豈疲ｹｿ繝輔Λ繝�け繧ｹ.
                              ! Specific humidity flux
    real(DP), intent(out):: xy_SurfVelTransCoef (0:imax-1, 1:jmax)
                              ! 霈ｸ騾∽ｿよ焚�夐°蜍暮㍼.
                              ! Diffusion coefficient: velocity
    real(DP), intent(out):: xy_SurfTempTransCoef (0:imax-1, 1:jmax)
                              ! 霈ｸ騾∽ｿよ焚�壽ｸｩ蠎ｦ.
                              ! Transfer coefficient: temperature
    real(DP), intent(out):: xy_SurfQVapTransCoef (0:imax-1, 1:jmax)
                              ! 霈ｸ騾∽ｿよ焚�壽ｰｴ闥ｸ豌�
                              ! Transfer coefficient: water vapor

    ! 菴懈･ｭ螟画焚
    ! Work variables
    !
    real(DP) :: xy_TempAtLB   (0:imax-1, 1:jmax)
    real(DP) :: xy_QH2OVapAtLB(0:imax-1, 1:jmax)

    integer:: j
    integer:: n               ! 邨��譁ｹ蜷代↓蝗槭ｋ DO 繝ｫ繝ｼ繝礼畑菴懈･ｭ螟画焚
                              ! Work variables for DO loop in dimension of constituents

    ! 螳溯｡梧枚 ; Executable statement
    !

    ! 蛻晄悄蛹也｢ｺ隱�
    ! Initialization check
    !
    if ( .not. lb_flux_simple_inited ) then
      call MessageNotify( 'E', module_name, 'This module has not been initialized.' )
    end if

    ! 險育ｮ玲凾髢楢ｨ域ｸｬ髢句ｧ�
    ! Start measurement of computation time
    !
    call TimesetClockStart( module_name )

    ! 霈ｸ騾∽ｿよ焚縺ｮ險育ｮ�
    ! Calculate transfer coefficient
    !
    select case ( IDLBMomFluxMode )
    case ( IDLBMomFluxModeNoFlux )
      xy_SurfVelTransCoef = 0.0_DP
    case ( IDLBMomFluxModeFixTimeConst )
      if ( FricTimeConstAtLB <= 0.0_DP ) then
        call MessageNotify( 'E', module_name, 'FricTimeConstAtLB must be greater than or equal to zero.' )
      end if
      do j = 1, jmax
        if ( abs( y_Lat(j) ) >= FricLowestLatAtLB * PI / 180.0_DP ) then
          xy_SurfVelTransCoef(:,j) =                           &
            & - ( xyr_Press(:,j,1) - xyr_Press(:,j,0) ) / Grav &
            &   / FricTimeConstAtLB
        else
          xy_SurfVelTransCoef(:,j) = 0.0_DP
        end if
      end do
    end select

    select case ( IDLBHeatFluxMode )
    case ( IDLBHeatFluxModeFixFlux )
      xy_SurfTempTransCoef = HeatFluxAtLB
    case ( IDLBHeatFluxModeFixTemp )
      xy_SurfTempTransCoef =                                    &
        &   xyr_Press(:,:,0) / ( GasRDry * xyr_VirTemp(:,:,0) ) &
        & * DiffCoefHeatMass                                    &
        & / ( xyz_Height(:,:,1) - xy_SurfHeight )
    end select

    select case( IDLBH2OVapFluxMode )
    case ( IDLBH2OVapFluxModeFixFlux )
      xy_SurfQVapTransCoef = H2OVapFluxAtLB
    case ( IDLBH2OVapFluxModeFixMixRt )
      xy_SurfQVapTransCoef =                                    &
        &   xyr_Press(:,:,0) / ( GasRDry * xyr_VirTemp(:,:,0) ) &
        & * DiffCoefHeatMass                                    &
        & / ( xyz_Height(:,:,1) - xy_SurfHeight )
    end select

    ! 荳矩Κ蠅�阜繝輔Λ繝�け繧ｹ縺ｮ險育ｮ�
    ! Calculate fluxes at lower boundary
    !
    !   Momentum
    !
    xyr_MomFluxX(:,:,0) = - xy_SurfVelTransCoef * xyz_U(:,:,1)
    xyr_MomFluxY(:,:,0) = - xy_SurfVelTransCoef * xyz_V(:,:,1)

    !   Heat
    !
    select case ( IDLBHeatFluxMode )
    case ( IDLBHeatFluxModeFixFlux )
      xyr_HeatFlux = HeatFluxAtLB
    case ( IDLBHeatFluxModeFixTemp )
      xy_TempAtLB = TempAtLB
      xyr_HeatFlux(:,:,0) = - CpDry * xyr_Exner(:,:,0) * xy_SurfTempTransCoef &
        &                       * (   xyz_Temp(:,:,1) / xyz_Exner(:,:,1)      &
        &                           - xy_TempAtLB     / xyr_Exner(:,:,0) )
    end select

    !   Mass
    !
    select case( IDLBH2OVapFluxMode )
    case ( IDLBH2OVapFluxModeFixFlux )
      xyrf_QMixFlux(:,:,0,IndexH2OVap) = H2OVapFluxAtLB
    case ( IDLBH2OVapFluxModeFixMixRt )
      xy_QH2OVapAtLB = QH2OVapAtLB
      xyrf_QMixFlux(:,:,0,IndexH2OVap) =                      &
        & - xy_SurfQVapTransCoef                              &
        & * ( xyzf_QMix(:,:,1,IndexH2OVap) - xy_QH2OVapAtLB )
    end select
    !
    xyrf_QMixFlux(:,:,0,1:IndexH2OVap-1)     = 0.0_DP
    xyrf_QMixFlux(:,:,0,IndexH2OVap+1:ncmax) = 0.0_DP

    ! Surface flux of constituents except for water vapor is zero.
!!$    write( 6, * ) "MEMO: Surface flux of constituents except for water vapor is zero. (YOT, 2013/05/15)"

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !

    ! 險育ｮ玲凾髢楢ｨ域ｸｬ荳譎ょ●豁｢
    ! Pause measurement of computation time
    !
    call TimesetClockStop( module_name )

  end subroutine LBFluxSimple

  !--------------------------------------------------------------------------------------

  subroutine SurfaceFluxOutput(                                &
    & xyr_MomFluxX, xyr_MomFluxY, xyr_HeatFlux, xyrf_QMixFlux, & ! (in)
    & xy_SurfH2OVapFluxA, xy_SurfLatentHeatFluxA,              & ! (in)
    & xyz_DUDt, xyz_DVDt, xyz_DTempDt, xyzf_DQMixDt,           & ! (in)
    & xy_SurfTemp, xy_DSurfTempDt,                             & ! (in)
    & xyr_Press, xyz_Exner, xyr_Exner, xy_SurfHumidCoef,       & ! (in)
    & xy_SurfVelTransCoef, xy_SurfTempTransCoef,               & ! (in)
    & xy_SurfQVapTransCoef                                     & ! (in)
    & )
    !
    ! 繝輔Λ繝�け繧ｹ (xyr_MomFluxX, xyr_MomFluxY, xyr_HeatFlux, xyrf_QMixFlux).
    ! 縺ｫ縺､縺�※, 縺昴�莉悶�蠑墓焚繧堤畑縺�※陬懈ｭ｣縺�, 蜃ｺ蜉帙ｒ陦後≧.
    !
    ! Fluxes (xyr_MomFluxX, xyr_MomFluxY, xyr_HeatFlux, xyrf_QMixFlux) are
    ! corrected by using other arguments, and the corrected values are output.
    !

    ! 繝｢繧ｸ繝･繝ｼ繝ｫ蠑慕畑 ; USE statements
    !

    ! 迚ｩ逅�ｮ壽焚險ｭ螳�
    ! Physical constant settings
    !
    use constants, only: &
      & GasRDry, &
                              ! $ R $ [J kg-1 K-1].
                              ! 荵ｾ辯･螟ｧ豌励�豌嶺ｽ灘ｮ壽焚.
                              ! Gas constant of air
      & CpDry, &
                              ! $ C_p $ [J kg-1 K-1].
                              ! 荵ｾ辯･螟ｧ豌励�螳壼悸豈皮�.
                              ! Specific heat of air at constant pressure
      & LatentHeat
                              ! $ L $ [J kg-1] .
                              ! 蜃晉ｵ舌�貎懃�.
                              ! Latent heat of condensation

    ! 鬟ｽ蜥梧ｯ疲ｹｿ縺ｮ邂怜�
    ! Evaluation of saturation specific humidity
    !
    use saturate, only: xy_CalcQVapSat, xy_CalcDQVapSatDTemp

    ! 譎ょ綾邂｡逅�
    ! Time control
    !
    use timeset, only: &
      & DelTime, &            ! $ \Delta t $ [s]
      & TimeN, &              ! 繧ｹ繝�ャ繝� $ t $ 縺ｮ譎ょ綾. Time of step $ t $.
      & TimesetClockStart, TimesetClockStop

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !
    use gtool_historyauto, only: HistoryAutoPut

    ! 螳｣險譁� ; Declaration statements
    !

    real(DP), intent(in):: xyr_MomFluxX (0:imax-1, 1:jmax, 0:kmax)
                              ! 譚ｱ隘ｿ譁ｹ蜷鷹°蜍暮㍼繝輔Λ繝�け繧ｹ.
                              ! Eastward momentum flux
    real(DP), intent(in):: xyr_MomFluxY (0:imax-1, 1:jmax, 0:kmax)
                              ! 蜊怜圏譁ｹ蜷鷹°蜍暮㍼繝輔Λ繝�け繧ｹ.
                              ! Northward momentum flux
    real(DP), intent(in):: xyr_HeatFlux (0:imax-1, 1:jmax, 0:kmax)
                              ! 辭ｱ繝輔Λ繝�け繧ｹ.
                              ! Heat flux
    real(DP), intent(in):: xyrf_QMixFlux(0:imax-1, 1:jmax, 0:kmax, 1:ncmax)
                              ! 豈疲ｹｿ繝輔Λ繝�け繧ｹ.
                              ! Specific humidity flux
    real(DP), intent(in):: xy_SurfH2OVapFluxA    (0:imax-1, 1:jmax)
                              ! 諠第弌陦ｨ髱｢豌ｴ闥ｸ豌励ヵ繝ｩ繝�け繧ｹ.
                              ! Water vapor flux at the surface
    real(DP), intent(in):: xy_SurfLatentHeatFluxA(0:imax-1, 1:jmax)
                              ! 諠第弌陦ｨ髱｢貎懃�繝輔Λ繝�け繧ｹ.
                              ! Latent heat flux at the surface
    real(DP), intent(in):: xyz_DUDt (0:imax-1, 1:jmax, 1:kmax)
                              ! $ \DP{u}{t} $ . 譚ｱ隘ｿ鬚ｨ騾滓凾髢灘､牙喧邇�.
                              ! Eastward wind tendency
    real(DP), intent(in):: xyz_DVDt (0:imax-1, 1:jmax, 1:kmax)
                              ! $ \DP{v}{t} $ . 蜊怜圏鬚ｨ騾滓凾髢灘､牙喧邇�.
                              ! Northward wind tendency
    real(DP), intent(in):: xyz_DTempDt (0:imax-1, 1:jmax, 1:kmax)
                              ! $ \DP{T}{t} $ . 貂ｩ蠎ｦ譎る俣螟牙喧邇�.
                              ! Temperature tendency
    real(DP), intent(in):: xyzf_DQMixDt(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
                              ! $ \DP{q}{t} $ . 豈疲ｹｿ譎る俣螟牙喧邇�.
                              ! Specific humidity tendency
    real(DP), intent(in):: xy_SurfTemp (0:imax-1, 1:jmax)
                              ! 蝨ｰ陦ｨ髱｢貂ｩ蠎ｦ.
                              ! Surface temperature
    real(DP), intent(in):: xy_DSurfTempDt (0:imax-1, 1:jmax)
                              ! 蝨ｰ陦ｨ髱｢貂ｩ蠎ｦ譎る俣螟牙喧邇�.
                              ! Surface temperature tendency
    real(DP), intent(in):: xyr_Press (0:imax-1, 1:jmax, 0:kmax)
                              ! $ \hat{p} $ . 豌怜悸 (蜊頑紛謨ｰ繝ｬ繝吶Ν).
                              ! Air pressure (half level)
    real(DP), intent(in):: xyz_Exner (0:imax-1, 1:jmax, 1:kmax)
                              ! Exner 髢｢謨ｰ (謨ｴ謨ｰ繝ｬ繝吶Ν).
                              ! Exner function (full level)
    real(DP), intent(in):: xyr_Exner (0:imax-1, 1:jmax, 0:kmax)
                              ! Exner 髢｢謨ｰ (蜊頑紛謨ｰ繝ｬ繝吶Ν).
                              ! Exner function (half level)
    real(DP), intent(in):: xy_SurfHumidCoef (0:imax-1, 1:jmax)
                              ! 蝨ｰ陦ｨ貉ｿ貎､蠎ｦ.
                              ! Surface humidity coefficient
    real(DP), intent(in):: xy_SurfVelTransCoef (0:imax-1, 1:jmax)
                              ! 霈ｸ騾∽ｿよ焚�夐°蜍暮㍼.
                              ! Diffusion coefficient: velocity
    real(DP), intent(in):: xy_SurfTempTransCoef (0:imax-1, 1:jmax)
                              ! 霈ｸ騾∽ｿよ焚�壽ｸｩ蠎ｦ.
                              ! Transfer coefficient: temperature
    real(DP), intent(in):: xy_SurfQVapTransCoef (0:imax-1, 1:jmax)
                              ! 霈ｸ騾∽ｿよ焚�壽ｰｴ闥ｸ豌�
                              ! Transfer coefficient: water vapor

    ! 蜃ｺ蜉帙�縺溘ａ縺ｮ菴懈･ｭ螟画焚
    ! Work variables for output
    !
    real(DP):: xyr_MomFluxXCor (0:imax-1, 1:jmax, 0:kmax)
                              ! 譚ｱ隘ｿ譁ｹ蜷鷹°蜍暮㍼繝輔Λ繝�け繧ｹ.
                              ! Eastward momentum flux
    real(DP):: xyr_MomFluxYCor (0:imax-1, 1:jmax, 0:kmax)
                              ! 蜊怜圏譁ｹ蜷鷹°蜍暮㍼繝輔Λ繝�け繧ｹ.
                              ! Northward momentum flux
    real(DP):: xyr_HeatFluxCor (0:imax-1, 1:jmax, 0:kmax)
                              ! 辭ｱ繝輔Λ繝�け繧ｹ.
                              ! Heat flux
    real(DP):: xyrf_QMixFluxCor(0:imax-1, 1:jmax, 0:kmax, 1:ncmax)
                              ! 豈疲ｹｿ繝輔Λ繝�け繧ｹ.
                              ! Specific humidity flux
    real(DP):: xyr_LatentHeatFluxCor(0:imax-1, 1:jmax, 0:kmax)
                              ! 陦ｨ髱｢貎懃�繝輔Λ繝�け繧ｹ.
                              ! Latent heat flux
    real(DP):: xy_SurfQVapSat (0:imax-1, 1:jmax)
                              ! 蝨ｰ陦ｨ鬟ｽ蜥梧ｯ疲ｹｿ.
                              ! Saturated specific humidity on surface
    real(DP):: xy_SurfDQVapSatDTemp (0:imax-1, 1:jmax)
                              ! 蝨ｰ陦ｨ鬟ｽ蜥梧ｯ疲ｹｿ螟牙喧.
                              ! Saturated specific humidity tendency on surface

    ! 菴懈･ｭ螟画焚
    ! Work variables
    !
    integer:: i               ! 邨悟ｺｦ譁ｹ蜷代↓蝗槭ｋ DO 繝ｫ繝ｼ繝礼畑菴懈･ｭ螟画焚
                              ! Work variables for DO loop in longitude
    integer:: j               ! 邱ｯ蠎ｦ譁ｹ蜷代↓蝗槭ｋ DO 繝ｫ繝ｼ繝礼畑菴懈･ｭ螟画焚
                              ! Work variables for DO loop in latitude
    integer:: n               ! 邨��譁ｹ蜷代↓蝗槭ｋ DO 繝ｫ繝ｼ繝礼畑菴懈･ｭ螟画焚
                              ! Work variables for DO loop in dimension of constituents

    ! 螳溯｡梧枚 ; Executable statement
    !

    ! 蛻晄悄蛹也｢ｺ隱�
    ! Initialization check
    !
    if ( .not. lb_flux_simple_inited ) then
      call MessageNotify( 'E', module_name, 'This module has not been initialized.' )
    end if

    ! 險育ｮ玲凾髢楢ｨ域ｸｬ髢句ｧ�
    ! Start measurement of computation time
    !
    call TimesetClockStart( module_name )

    ! 鬟ｽ蜥梧ｯ疲ｹｿ縺ｮ險育ｮ�
    ! Calculate saturated specific humidity
    !
    xy_SurfQVapSat       = &
      & xy_CalcQVapSat      ( xy_SurfTemp, xyr_Press(:,:,0) )
    xy_SurfDQVapSatDTemp = &
      & xy_CalcDQVapSatDTemp( xy_SurfTemp, xy_SurfQVapSat   )

    ! Output of fluxes at t
    !

    ! 鬚ｨ騾�, 貂ｩ蠎ｦ, 豈疲ｹｿ繝輔Λ繝�け繧ｹ陬懈ｭ｣
    ! Correct fluxes of wind, temperature, specific humidity
    !
    do j = 1, jmax
      do i = 0, imax-1
        xyr_MomFluxXCor( i,j,0 ) = xyr_MomFluxX( i,j,0 ) &
          & - xy_SurfVelTransCoef( i,j ) * xyz_DUDt( i,j,1 ) * DelTime

        xyr_MomFluxYCor( i,j,0 ) = xyr_MomFluxY( i,j,0 ) &
          & - xy_SurfVelTransCoef( i,j ) * xyz_DVDt( i,j,1 ) * DelTime

        xyr_HeatFluxCor( i,j,0 ) = xyr_HeatFlux( i,j,0 )               &
          & - CpDry * xyr_Exner( i,j,0 ) * xy_SurfTempTransCoef( i,j ) &
          &     * ( xyz_DTempDt( i,j,1 ) / xyz_Exner( i,j,1 )          &
          &       - xy_DSurfTempDt( i,j ) / xyr_Exner( i,j,0 ) )       &
          &   * DelTime
      end do
    end do
    n = IndexH2OVap
    do j = 1, jmax
      do i = 0, imax-1
        xyrf_QMixFluxCor( i,j,0,n ) = xyrf_QMixFlux( i,j,0,n )                    &
          & - xy_SurfHumidCoef( i,j ) * xy_SurfQVapTransCoef( i,j )               &
          &   * ( xyzf_DQMixDt( i,j,1,n )                                         &
          &     - xy_SurfDQVapSatDTemp( i,j ) * xy_DSurfTempDt( i,j ) ) * DelTime
      end do
    end do
    do n = 1, IndexH2OVap-1
      xyrf_QMixFluxCor(:,:,0,n) = xyrf_QMixFlux(:,:,0,n)
    end do
    do n = IndexH2OVap+1, ncmax
      xyrf_QMixFluxCor(:,:,0,n) = xyrf_QMixFlux(:,:,0,n)
    end do
    n = IndexH2OVap
    do j = 1, jmax
      do i = 0, imax-1
        xyr_LatentHeatFluxCor( i,j,0 ) = LatentHeat * xyrf_QMixFluxCor( i,j,0,n )
      end do
    end do

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'TauX'          , xyr_MomFluxXCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'TauY'          , xyr_MomFluxYCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'Sens'          , xyr_HeatFluxCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'SurfH2OVapFlux', xyrf_QMixFluxCor(:,:,0,IndexH2OVap) )
    call HistoryAutoPut( TimeN, 'Evap'          , xyr_LatentHeatFluxCor(:,:,0) )

    ! Output of fluxes at t - \Delta t
    !

    ! 鬚ｨ騾�, 貂ｩ蠎ｦ, 豈疲ｹｿ繝輔Λ繝�け繧ｹ陬懈ｭ｣
    ! Correct fluxes of wind, temperature, specific humidity
    !
    do j = 1, jmax
      do i = 0, imax-1
        xyr_MomFluxXCor( i,j,0 ) = xyr_MomFluxX( i,j,0 )
        xyr_MomFluxYCor( i,j,0 ) = xyr_MomFluxY( i,j,0 )
        xyr_HeatFluxCor( i,j,0 ) = xyr_HeatFlux( i,j,0 )
      end do
    end do
    n = IndexH2OVap
    do j = 1, jmax
      do i = 0, imax-1
        xyrf_QMixFluxCor( i,j,0,n ) = xyrf_QMixFlux( i,j,0,n )
      end do
    end do
    do n = 1, IndexH2OVap-1
      xyrf_QMixFluxCor(:,:,0,n) = xyrf_QMixFlux(:,:,0,n)
    end do
    do n = IndexH2OVap+1, ncmax
      xyrf_QMixFluxCor(:,:,0,n) = xyrf_QMixFlux(:,:,0,n)
    end do
    n = IndexH2OVap
    do j = 1, jmax
      do i = 0, imax-1
        xyr_LatentHeatFluxCor( i,j,0 ) = LatentHeat * xyrf_QMixFluxCor( i,j,0,n )
      end do
    end do

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'TauXB'          , xyr_MomFluxXCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'TauYB'          , xyr_MomFluxYCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'SensB'          , xyr_HeatFluxCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'SurfH2OVapFluxB', xyrf_QMixFluxCor(:,:,0,IndexH2OVap) )
    call HistoryAutoPut( TimeN, 'EvapB'          , xyr_LatentHeatFluxCor(:,:,0) )

    ! Output of fluxes at t + \Delta t
    !

    ! 鬚ｨ騾�, 貂ｩ蠎ｦ, 豈疲ｹｿ繝輔Λ繝�け繧ｹ陬懈ｭ｣
    ! Correct fluxes of wind, temperature, specific humidity
    !
    do j = 1, jmax
      do i = 0, imax-1
        xyr_MomFluxXCor( i,j,0 ) = xyr_MomFluxX( i,j,0 ) &
          & - xy_SurfVelTransCoef( i,j ) * xyz_DUDt( i,j,1 ) * 2.0_DP * DelTime

        xyr_MomFluxYCor( i,j,0 ) = xyr_MomFluxY( i,j,0 ) &
          & - xy_SurfVelTransCoef( i,j ) * xyz_DVDt( i,j,1 ) * 2.0_DP * DelTime

        xyr_HeatFluxCor( i,j,0 ) = xyr_HeatFlux( i,j,0 )               &
          & - CpDry * xyr_Exner( i,j,0 ) * xy_SurfTempTransCoef( i,j ) &
          &     * ( xyz_DTempDt( i,j,1 ) / xyz_Exner( i,j,1 )          &
          &       - xy_DSurfTempDt( i,j ) / xyr_Exner( i,j,0 ) )       &
          &   * 2.0_DP * DelTime
      end do
    end do
    n = IndexH2OVap
    do j = 1, jmax
      do i = 0, imax-1
        xyrf_QMixFluxCor( i,j,0,n ) = xyrf_QMixFlux( i,j,0,n )                    &
          & - xy_SurfHumidCoef( i,j ) * xy_SurfQVapTransCoef( i,j )               &
          &   * ( xyzf_DQMixDt( i,j,1,n )                                         &
          &     - xy_SurfDQVapSatDTemp( i,j ) * xy_DSurfTempDt( i,j ) ) * 2.0_DP * DelTime
      end do
    end do
    do n = 1, IndexH2OVap-1
      xyrf_QMixFluxCor(:,:,0,n) = xyrf_QMixFlux(:,:,0,n)
    end do
    do n = IndexH2OVap+1, ncmax
      xyrf_QMixFluxCor(:,:,0,n) = xyrf_QMixFlux(:,:,0,n)
    end do
    n = IndexH2OVap
    do j = 1, jmax
      do i = 0, imax-1
        xyr_LatentHeatFluxCor( i,j,0 ) = LatentHeat * xyrf_QMixFluxCor( i,j,0,n )
      end do
    end do

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'TauXA'          , xyr_MomFluxXCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'TauYA'          , xyr_MomFluxYCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'SensA'          , xyr_HeatFluxCor (:,:,0) )
    call HistoryAutoPut( TimeN, 'SurfH2OVapFluxA', xyrf_QMixFluxCor(:,:,0,IndexH2OVap) )
    call HistoryAutoPut( TimeN, 'EvapA'          , xyr_LatentHeatFluxCor(:,:,0) )

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'SurfH2OVapFluxU', xy_SurfH2OVapFluxA     )
    call HistoryAutoPut( TimeN, 'EvapU'          , xy_SurfLatentHeatFluxA )

    ! 險育ｮ玲凾髢楢ｨ域ｸｬ荳譎ょ●豁｢
    ! Pause measurement of computation time
    !
    call TimesetClockStop( module_name )

  end subroutine SurfaceFluxOutput

  !--------------------------------------------------------------------------------------

  subroutine LBFluxSimpleInit
    !
    ! surface_flux_bulk 繝｢繧ｸ繝･繝ｼ繝ｫ縺ｮ蛻晄悄蛹悶ｒ陦後＞縺ｾ縺�.
    ! NAMELIST#surface_flux_bulk_nml 縺ｮ隱ｭ縺ｿ霎ｼ縺ｿ縺ｯ縺薙�謇狗ｶ壹″縺ｧ陦後ｏ繧後∪縺�.
    !
    ! "surface_flux_bulk" module is initialized.
    ! "NAMELIST#surface_flux_bulk_nml" is loaded in this procedure.
    !

    ! 繝｢繧ｸ繝･繝ｼ繝ｫ蠑慕畑 ; USE statements
    !

    ! NAMELIST 繝輔ぃ繧､繝ｫ蜈･蜉帙↓髢｢縺吶ｋ繝ｦ繝ｼ繝�ぅ繝ｪ繝�ぅ
    ! Utilities for NAMELIST file input
    !
    use namelist_util, only: namelist_filename, NmlutilMsg, NmlutilAryValid

    ! 繝輔ぃ繧､繝ｫ蜈･蜃ｺ蜉幄｣懷勧
    ! File I/O support
    !
    use dc_iounit, only: FileOpen

    ! 遞ｮ蛻･蝙九ヱ繝ｩ繝｡繧ｿ
    ! Kind type parameter
    !
    use dc_types, only: STDOUT ! 讓呎ｺ門�蜉帙�陬�ｽｮ逡ｪ蜿ｷ. Unit number of standard output

    ! 譁�ｭ怜�謫堺ｽ�
    ! Character handling
    !
    use dc_string, only: StoA

    ! 譌･莉倥♀繧医�譎ょ綾縺ｮ蜿悶ｊ謇ｱ縺�
    ! Date and time handler
    !
    use dc_calendar, only: DCCalConvertByUnit

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉�
    ! History data output
    !
    use gtool_historyauto, only: HistoryAutoAddVariable

    ! 迚ｩ逅�ｮ壽焚險ｭ螳�
    ! Physical constant settings
    !
    use constants, only: &
      & GasRDry, &
                              ! $ R $ [J kg-1 K-1].
                              ! 荵ｾ辯･螟ｧ豌励�豌嶺ｽ灘ｮ壽焚.
                              ! Gas constant of air
      & CpDry
                              ! $ C_p $ [J kg-1 K-1].
                              ! 荵ｾ辯･螟ｧ豌励�螳壼悸豈皮�.
                              ! Specific heat of air at constant pressure

    ! 螳｣險譁� ; Declaration statements
    !
    real(DP)         :: FricTimeConstAtLBValue
    character(TOKEN) :: FricTimeConstAtLBUnit

    character(STRING) :: LBMomFluxMode
    character(STRING) :: LBHeatFluxMode
    character(STRING) :: LBH2OVapFluxMode

    integer:: unit_nml        ! NAMELIST 繝輔ぃ繧､繝ｫ繧ｪ繝ｼ繝励Φ逕ｨ陬�ｽｮ逡ｪ蜿ｷ.
                              ! Unit number for NAMELIST file open
    integer:: iostat_nml      ! NAMELIST 隱ｭ縺ｿ霎ｼ縺ｿ譎ゅ� IOSTAT.
                              ! IOSTAT of NAMELIST read

    ! NAMELIST 螟画焚鄒､
    ! NAMELIST group name
    !
    namelist /lb_flux_simple_nml/                        &
      & LBMomFluxMode,                                   &
      & FricTimeConstAtLBValue, FricTimeConstAtLBUnit,   &
      & FricLowestLatAtLB,                               &
      & LBHeatFluxMode,                                  &
      & HeatFluxAtLB, TempAtLB,                          &
      & LBH2OVapFluxMode,                                &
      & H2OVapFluxAtLB, QH2OVapAtLB, DiffCoefHeatMass
          !
          ! 繝�ヵ繧ｩ繝ｫ繝亥､縺ｫ縺､縺�※縺ｯ蛻晄悄蛹匁焔邯� "lb_flux_simple#LBFluxSimpleInit"
          ! 縺ｮ繧ｽ繝ｼ繧ｹ繧ｳ繝ｼ繝峨ｒ蜿ら�縺ｮ縺薙→.
          !
          ! Refer to source codes in the initialization procedure
          ! "lb_flux_simple#LBFluxSimpleInit" for the default values.
          !

    ! 螳溯｡梧枚 ; Executable statement
    !

    if ( lb_flux_simple_inited ) return

    ! 繝�ヵ繧ｩ繝ｫ繝亥､縺ｮ險ｭ螳�
    ! Default values settings
    !
    LBMomFluxMode            = 'FixTimeConst'
    FricTimeConstAtLBValue   = 20.0_DP   ! Schneider and Liou (2009)
    FricTimeConstAtLBUnit    = 'day'
    FricLowestLatAtLB        = 16.3_DP   ! Schneider and Liou (2009)

    LBHeatFluxMode           = 'FixFlux'
    HeatFluxAtLB             =  5.7_DP   ! Schneider and Liou (2009)
    TempAtLB                 =  160.0_DP * ( 30.0_DP / 0.6_DP )**( GasRDry / CpDry )
                                 ! Sugiyama et al. (2009), Nagare Multimedia
                                 ! Potential Temperature of 160 K with
                                 ! reference pressure of 0.6 bars

    LBH2OVapFluxMode         = 'FixFlux'
    H2OVapFluxAtLB           =  0.0_DP
    QH2OVapAtLB              =  7.816e-4_DP
                                 ! Sugiyama et al. (2009), Nagare Multimedia
    DiffCoefHeatMass         = 800.0_DP
                                 ! Sugiyama et al. (2009), Nagare Multimedia

    ! NAMELIST 縺ｮ隱ｭ縺ｿ霎ｼ縺ｿ
    ! NAMELIST is input
    !
    if ( trim(namelist_filename) /= '' ) then
      call FileOpen( unit_nml, &          ! (out)
        & namelist_filename, mode = 'r' ) ! (in)

      rewind( unit_nml )
      read( unit_nml, &                ! (in)
        & nml = lb_flux_simple_nml, &  ! (out)
        & iostat = iostat_nml )        ! (out)
      close( unit_nml )

      call NmlutilMsg( iostat_nml, module_name ) ! (in)
    end if

    FricTimeConstAtLB = &
      & DCCalConvertByUnit( FricTimeConstAtLBValue, FricTimeConstAtLBUnit, 'sec' ) ! (in)

    ! Identification of calculation method for momentum flux
    !
    call MessageNotify( 'M', module_name, &
      & 'LBMomFluxMode=<%c>.', c1 = trim(LBMomFluxMode) )
    select case ( LBMomFluxMode )
    case ( 'NoFlux' )
      IDLBMomFluxMode = IDLBMomFluxModeNoFlux
    case ( 'FixTimeConst' )
      IDLBMomFluxMode = IDLBMomFluxModeFixTimeConst
    case default
      call MessageNotify( 'E', module_name, &
        & 'LBMomFluxMode=<%c> is not supported.', c1 = trim(LBMomFluxMode) )
    end select

    ! Identification of calculation method for heat flux
    !
    call MessageNotify( 'M', module_name, &
      & 'LBHeatFluxMode=<%c>.', c1 = trim(LBHeatFluxMode) )
    select case ( LBHeatFluxMode )
    case ( 'FixFlux' )
      IDLBHeatFluxMode = IDLBHeatFluxModeFixFlux
    case ( 'FixTemp' )
      IDLBHeatFluxMode = IDLBHeatFluxModeFixFlux
    case default
      call MessageNotify( 'E', module_name, &
        & 'LBHeatFluxMode=<%c> is not supported.', c1 = trim(LBHeatFluxMode) )
    end select

    ! Identification of calculation method for H2O vapor flux
    !
    call MessageNotify( 'M', module_name, &
      & 'LBH2OVapFluxMode=<%c>.', c1 = trim(LBH2OVapFluxMode) )
    select case ( LBH2OVapFluxMode )
    case ( 'FixFlux' )
      IDLBH2OVapFluxMode = IDLBH2OVapFluxModeFixFlux
    case ( 'FixMixRt' )
      IDLBH2OVapFluxMode = IDLBH2OVapFluxModeFixMixRt
    case default
      call MessageNotify( 'E', module_name, &
        & 'LBH2OVapFluxMode=<%c> is not supported.', c1 = trim(LBH2OVapFluxMode) )
    end select

    ! 繝偵せ繝医Μ繝��繧ｿ蜃ｺ蜉帙�縺溘ａ縺ｮ縺ｸ縺ｮ螟画焚逋ｻ骭ｲ
    ! Register of variables for history data output
    !
    call HistoryAutoAddVariable( 'TauX', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface stress(x)  ', 'N m-2' )
    call HistoryAutoAddVariable( 'TauY', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface stress(y)  ', 'N m-2' )
    call HistoryAutoAddVariable( 'Sens', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'sensible heat flux', 'W m-2' )
    call HistoryAutoAddVariable( 'SurfH2OVapFlux', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface H2O vapor flux  ', 'kg m-2 s-1' )
    call HistoryAutoAddVariable( 'Evap', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'latent heat flux  ', 'W m-2' )

    call HistoryAutoAddVariable( 'TauXB', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface stress(x)  ', 'N m-2' )
    call HistoryAutoAddVariable( 'TauYB', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface stress(y)  ', 'N m-2' )
    call HistoryAutoAddVariable( 'SensB', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'sensible heat flux', 'W m-2' )
    call HistoryAutoAddVariable( 'SurfH2OVapFluxB', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface H2O vapor flux  ', 'kg m-2 s-1' )
    call HistoryAutoAddVariable( 'EvapB', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'latent heat flux  ', 'W m-2' )

    call HistoryAutoAddVariable( 'TauXA', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface stress(x)  ', 'N m-2' )
    call HistoryAutoAddVariable( 'TauYA', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface stress(y)  ', 'N m-2' )
    call HistoryAutoAddVariable( 'SensA', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'sensible heat flux', 'W m-2' )
    call HistoryAutoAddVariable( 'SurfH2OVapFluxA', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface H2O vapor flux  ', 'kg m-2 s-1' )
    call HistoryAutoAddVariable( 'EvapA', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'latent heat flux  ', 'W m-2' )

    call HistoryAutoAddVariable( 'SurfH2OVapFluxU', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'surface H2O vapor flux  ', 'kg m-2 s-1' )
    call HistoryAutoAddVariable( 'EvapU', &
      & (/ 'lon ', 'lat ', 'time' /), &
      & 'latent heat flux  ', 'W m-2' )

    ! 蜊ｰ蟄� ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, 'LBMomFluxMode            = %c', c1 = trim( LBMomFluxMode ) )
    call MessageNotify( 'M', module_name, 'FricTimeConstAtLB        = %f', d = (/ FricTimeConstAtLB /) )
    call MessageNotify( 'M', module_name, 'FricLowestLatAtLB        = %f', d = (/ FricLowestLatAtLB /) )
    call MessageNotify( 'M', module_name, 'LBHeatFluxMode           = %c', c1 = trim( LBHeatFluxMode ) )
    call MessageNotify( 'M', module_name, 'HeatFluxAtLB             = %f', d = (/ HeatFluxAtLB /) )
    call MessageNotify( 'M', module_name, 'TempAtLB                 = %f', d = (/ TempAtLB /) )
    call MessageNotify( 'M', module_name, 'LBH2OVapFluxMode         = %c', c1 = trim( LBH2OVapFluxMode ) )
    call MessageNotify( 'M', module_name, 'H2OVapFluxAtLB           = %f', d = (/ H2OVapFluxAtLB /) )
    call MessageNotify( 'M', module_name, 'QH2OVapAtLB              = %f', d = (/ QH2OVapAtLB /) )
    call MessageNotify( 'M', module_name, 'DiffCoefHeatMass         = %f', d = (/ DiffCoefHeatMass /) )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )

    lb_flux_simple_inited = .true.

  end subroutine LBFluxSimpleInit

  !--------------------------------------------------------------------------------------

end module lb_flux_simple