Class lscond
In: lscond/lscond.F90

大規模凝結

Large scale condensation

Note that Japanese and English are described in parallel.

大規模凝結過程によって温度と比湿を調節します.

飽和比湿の計算にはデフォルトでは Tetens (1930) を用います (saturate_t1930 参照). また, Config.mk の CPPFLAGS に -DLIB_SATURATE_NHA1992 を指定すると Nakajima et al. (1992) を用います (saturate_tnha1992 参照).

Adjust temperature and specific humidity by a large scale condensation process.

By default, Tetens (1930) is used for calculation of saturation specific humidity (See "saturate_t1930"). If "-DLIB_SATURATE_NHA1992" is specified to "CPPFLAGS" in Config.mk, Nakajima et al. (1992) is used (See "saturate_nha1992").

Procedures List

LScaleCond :温度と比湿の調節
———— :————
LScaleCond :Adjust temperature and specific humidity

NAMELIST

NAMELIST#lscond_nml

Methods

Included Modules

gridset dc_types dc_message constants timeset gtool_historyauto namelist_util dc_iounit dc_string axesset

Public Instance methods

Subroutine :
xyz_Temp(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(inout)
: $ T $ . 温度. Temperature
xyz_QVap(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(inout)
: $ q $ . 比湿. Specific humidity
xy_Rain(0:imax-1, 1:jmax) :real(DP), intent(inout)
: 降水量. Precipitation
xyz_DTempDt(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(inout)
: 温度変化率. Temperature tendency
xyz_DQVapDt(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(inout)
: 比湿変化率. Specific humidity tendency
xyz_Press(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(in)
: $ p $ . 気圧 (整数レベル). Air pressure (full level)
xyr_Press(0:imax-1, 1:jmax, 0:kmax) :real(DP), intent(in)
: $ hat{p} $ . 気圧 (半整数レベル). Air pressure (half level)

大規模凝結スキームにより, 温度と比湿を調節します.

Adjust temperature and specific humidity by large scale condensation scheme.

[Source]

  subroutine LScaleCond( xyz_Temp, xyz_QVap, xy_Rain, xyz_DTempDt, xyz_DQVapDt, xyz_Press, xyr_Press )
    !
    ! 大規模凝結スキームにより, 温度と比湿を調節します. 
    !
    ! Adjust temperature and specific humidity by 
    ! large scale condensation scheme. 
    !

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

    ! 物理定数設定
    ! Physical constants settings
    !
    use constants, only: GasRUniv, Grav, CpDry, GasRWet, LatentHeat, EpsV
                              ! $ \epsilon_v $ . 
                              ! 水蒸気分子量比. 
                              ! Molecular weight of water vapor

    ! 時刻管理
    ! Time control
    !
    use timeset, only: DelTime, TimeN, TimesetClockStart, TimesetClockStop

    ! ヒストリデータ出力
    ! History data output
    !
    use gtool_historyauto, only: HistoryAutoPut

    ! 宣言文 ; Declaration statements
    !
    implicit none

    real(DP), intent(inout):: xyz_Temp (0:imax-1, 1:jmax, 1:kmax)
                              ! $ T $ .     温度. Temperature
    real(DP), intent(inout):: xyz_QVap (0:imax-1, 1:jmax, 1:kmax)
                              ! $ q $ .     比湿. Specific humidity
    real(DP), intent(inout):: xy_Rain (0:imax-1, 1:jmax)
                              ! 降水量. 
                              ! Precipitation
    real(DP), intent(inout):: xyz_DTempDt (0:imax-1, 1:jmax, 1:kmax)
                              ! 温度変化率. 
                              ! Temperature tendency
    real(DP), intent(inout):: xyz_DQVapDt (0:imax-1, 1:jmax, 1:kmax)
                              ! 比湿変化率. 
                              ! Specific humidity tendency
    real(DP), intent(in):: xyz_Press (0:imax-1, 1:jmax, 1:kmax)
                              ! $ p $ . 気圧 (整数レベル). 
                              ! Air pressure (full level)
    real(DP), intent(in):: xyr_Press (0:imax-1, 1:jmax, 0:kmax)
                              ! $ \hat{p} $ . 気圧 (半整数レベル). 
                              ! Air pressure (half level)

    ! 作業変数
    ! Work variables
    !
    real(DP):: xy_RainLsc (0:imax-1, 1:jmax)
                              ! 降水量. 
                              ! Precipitation
    real(DP):: xyz_DTempDtLsc (0:imax-1, 1:jmax, 1:kmax)
                              ! 温度変化率. 
                              ! Temperature tendency
    real(DP):: xyz_DQVapDtLsc (0:imax-1, 1:jmax, 1:kmax)
                              ! 比湿変化率. 
                              ! Specific humidity tendency

    real(DP):: xyz_QVapB (0:imax-1, 1:jmax, 1:kmax)
                              ! 調節前の比湿. 
                              ! Specific humidity before adjust. 
    real(DP):: xyz_TempB (0:imax-1, 1:jmax, 1:kmax)
                              ! 調節前の温度. 
                              ! Temperature before adjust. 
                              !
    real(DP):: QVapSat
                              ! 飽和比湿. 
                              ! Saturation specific humidity. 
    real(DP):: DQVapSatDTemp
                              ! $ \DD{q_{\rm{sat}}}{T} $
    real(DP):: DelQVap
                              ! 調節による比湿の変化量. 
                              ! Specific humidity variation by adjustment
    real(DP):: DelTemp
                              ! 調節による温度変化量. 
                              ! Temperature variation by adjustment


    integer:: i               ! 経度方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in longitude
    integer:: j               ! 緯度方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in latitude
    integer:: k               ! 鉛直方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in vertical direction
    integer:: itr             ! イテレーション方向に回る DO ループ用作業変数
                              ! Work variables for DO loop in iteration direction

    ! 飽和比湿計算のための文関数定義 (CalcQVapSatSF, CalcDQVapSatDTempSF)
    ! Declaration of statement function for 
    !   calculation of saturation specific humidity 
    !   ("CalcQVapSatSF", "CalcDQVapSatDTempSF")
    !
#ifdef LIB_SATURATE_NHA1992
#include "../saturate/saturate_nha1992_sf.f90"
    EpsVSF     = EpsV
    GasRUnivSF = GasRUniv
#elif LIB_SATURATE_T1930
#include "../saturate/saturate_t1930_sf.f90"
    EpsVSF    = EpsV
    LatHeatSF = LatentHeat
    GasRWetSF = GasRWet
#else
#include "../saturate/saturate_t1930_sf.f90"
    EpsVSF    = EpsV
    LatHeatSF = LatentHeat
    GasRWetSF = GasRWet
#endif

    ! 実行文 ; Executable statement
    !

    ! 計算時間計測開始
    ! Start measurement of computation time
    !
    call TimesetClockStart( module_name )

    ! 初期化
    ! Initialization
    !
    if ( .not. lscond_inited ) call LSCondInit

    ! 調節前 "QVap", "Temp" の保存
    ! Store "QVap", "Temp" before adjustment
    !
    xyz_QVapB  = xyz_QVap
    xyz_TempB  = xyz_Temp

    ! 調節
    ! Adjustment
    !
    do k = kmax, 1, -1
      do i = 0, imax-1
        do j = 1, jmax
          
          ! 飽和比湿計算
          ! Calculate saturation specific humidity 
          ! 
          ! CalcQVapSatSF は文関数. (実行文の直前で定義)
          ! "CalcQVapSatSF" is statement function and 
          !   is declared just before executable statement. 
          ! 
          QVapSat = CalcQVapSatSF( xyz_Temp(i,j,k), xyz_Press(i,j,k) )

          ! 飽和していたら, 温度と比湿の変化を計算
          ! Calculate tendency of temperature and humidity 
          ! if moist is saturation. 
          !
          if ( ( xyz_QVap(i,j,k) / QVapSat ) >= CrtlRH ) then
            
            do itr = 1, ItrtMax
              
              ! 飽和比湿計算
              ! Calculate saturation specific humidity
              ! 
              ! CalcQVapSatSF, CalcDQVapSatDTempSF は文関数. (実行文の直前で定義)
              ! "CalcQVapSatSF", "CalcDQVapSatDTempSF" is statement function and 
              !   is declared just before executable statement. 
              ! 
              QVapSat = CalcQVapSatSF( xyz_Temp(i,j,k), xyz_Press(i,j,k) )

              DQVapSatDTemp = CalcDQVapSatDTempSF( xyz_Temp(i,j,k), QVapSat )

              ! 温度と比湿の変化分をニュートン法で求める
              ! Calculate variation of temperature and specific humidity 
              ! with Newton method
              !
              DelTemp = LatentHeat / CpDry * ( xyz_QVap(i,j,k) - QVapSat ) / ( 1.0_DP + LatentHeat / CpDry * DQVapSatDTemp )
              DelQVap = DQVapSatDTemp * DelTemp 
              
              ! 温度と比湿の調節
              ! Adjust temperature and specific humidity
              !
              xyz_Temp(i,j,k) = xyz_Temp(i,j,k) + DelTemp
              xyz_QVap(i,j,k) = QVapSat + DelQVap
              
            end do
            
          end if
        end do
      end do
    end do
    
    ! 比湿変化率, 温度変化率, 降水量の算出
    ! Calculate specific humidity tendency, temperature tendency, 
    ! precipitation
    !
    xy_RainLsc     = 0.
    xyz_DTempDtLsc = 0.
    xyz_DQvapDtLsc = 0.

    xyz_DQVapDtLsc = xyz_DQVapDtLsc + ( xyz_QVap - xyz_QVapB ) / ( 2.0_DP * DelTime )

    xyz_DTempDtLsc = xyz_DTempDtLsc + ( xyz_Temp - xyz_TempB ) / ( 2.0_DP * DelTime )

    do k = kmax, 1, -1
      xy_RainLsc = xy_RainLsc + ( xyz_Temp(:,:,k) - xyz_TempB(:,:,k) ) * CpDry / ( 2.0_DP * DelTime ) * ( xyr_Press(:,:,k-1) - xyr_Press(:,:,k) ) / Grav
    end do
    
    xy_Rain     = xy_Rain     + xy_RainLsc
    xyz_DTempDt = xyz_DTempDt + xyz_DTempDtLsc
    xyz_DQVapDt = xyz_DQVapDt + xyz_DQVapDtLsc

    ! ヒストリデータ出力
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'RainLsc',    xy_RainLsc )
    call HistoryAutoPut( TimeN, 'DTempDtLsc', xyz_DTempDtLsc )
    call HistoryAutoPut( TimeN, 'DQVapDtLsc', xyz_DQVapDtLsc )


    ! 計算時間計測一時停止
    ! Pause measurement of computation time
    !
    call TimesetClockStop( module_name )

  end subroutine LScaleCond
lscond_inited
Variable :
lscond_inited = .false. :logical, save, public
: 初期設定フラグ. Initialization flag

Private Instance methods

CrtlRH
Variable :
CrtlRH :real(DP), save
: 臨界相対湿度. Critical relative humidity
Subroutine :

依存モジュールの初期化チェック

Check initialization of dependency modules

[Source]

  subroutine InitCheck
    !
    ! 依存モジュールの初期化チェック
    !
    ! Check initialization of dependency modules

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

    ! NAMELIST ファイル入力に関するユーティリティ
    ! Utilities for NAMELIST file input
    !
    use namelist_util, only: namelist_util_inited

    ! 格子点設定
    ! Grid points settings
    !
    use gridset, only: gridset_inited

    ! 物理定数設定
    ! Physical constants settings
    !
    use constants, only: constants_inited

    ! 座標データ設定
    ! Axes data settings
    !
    use axesset, only: axesset_inited

    ! 時刻管理
    ! Time control
    !
    use timeset, only: timeset_inited

    ! 実行文 ; Executable statement
    !

    if ( .not. namelist_util_inited ) call MessageNotify( 'E', module_name, '"namelist_util" module is not initialized.' )

    if ( .not. gridset_inited ) call MessageNotify( 'E', module_name, '"gridset" module is not initialized.' )

    if ( .not. constants_inited ) call MessageNotify( 'E', module_name, '"constants" module is not initialized.' )

    if ( .not. axesset_inited ) call MessageNotify( 'E', module_name, '"axesset" module is not initialized.' )

    if ( .not. timeset_inited ) call MessageNotify( 'E', module_name, '"timeset" module is not initialized.' )

  end subroutine InitCheck
ItrtMax
Variable :
ItrtMax :integer, save
: イテレーション回数. Number of iteration
Subroutine :

lscond モジュールの初期化を行います. NAMELIST#lscond_nml の読み込みはこの手続きで行われます.

"lscond" module is initialized. "NAMELIST#lscond_nml" is loaded in this procedure.

This procedure input/output NAMELIST#lscond_nml .

[Source]

  subroutine LSCondInit
    !
    ! lscond モジュールの初期化を行います. 
    ! NAMELIST#lscond_nml の読み込みはこの手続きで行われます. 
    !
    ! "lscond" module is initialized. 
    ! "NAMELIST#lscond_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

    ! ヒストリデータ出力
    ! History data output
    !
    use gtool_historyauto, only: HistoryAutoAddVariable

    ! 宣言文 ; Declaration statements
    !
    implicit none

    integer:: unit_nml        ! NAMELIST ファイルオープン用装置番号. 
                              ! Unit number for NAMELIST file open
    integer:: iostat_nml      ! NAMELIST 読み込み時の IOSTAT. 
                              ! IOSTAT of NAMELIST read

    ! NAMELIST 変数群
    ! NAMELIST group name
    !
    namelist /lscond_nml/ CrtlRH, ItrtMax
          !
          ! デフォルト値については初期化手続 "lscond#LSCondInit" 
          ! のソースコードを参照のこと. 
          !
          ! Refer to source codes in the initialization procedure
          ! "lscond#LSCondInit" for the default values. 
          !

    ! 実行文 ; Executable statement
    !

    if ( lscond_inited ) return
    call InitCheck

    ! デフォルト値の設定
    ! Default values settings
    !
    CrtlRH  = 1.0_DP
    ItrtMax = 3

    ! NAMELIST の読み込み
    ! NAMELIST is input
    !
    if ( trim(namelist_filename) /= '' ) then
      call FileOpen( unit_nml, namelist_filename, mode = 'r' ) ! (in)

      rewind( unit_nml )
      read( unit_nml, nml = lscond_nml, iostat = iostat_nml ) ! (out)
      close( unit_nml )

      call NmlutilMsg( iostat_nml, module_name ) ! (in)
      if ( iostat_nml == 0 ) write( STDOUT, nml = lscond_nml )
    end if

    ! ヒストリデータ出力のためのへの変数登録
    ! Register of variables for history data output
    !
    call HistoryAutoAddVariable( 'RainLsc', (/ 'lon ', 'lat ', 'time' /), 'precipitation by large scale condensation', 'W m-2' )
    call HistoryAutoAddVariable( 'DTempDtLsc', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'large-scale condensation heating', 'K s-1' )
    call HistoryAutoAddVariable( 'DQVapDtLsc', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'large-scale condensation moistening', 'kg kg-1 s-1' )

    ! 印字 ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, '  CrtlRH  = %f', d = (/ CrtlRH /) )
    call MessageNotify( 'M', module_name, '  ItrtMax = %d', i = (/ ItrtMax /) )
    call MessageNotify( 'M', module_name, '' )
    call MessageNotify( 'M', module_name, '  Scheme of saturation = %c', c1 = saturate_scheme )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )

    lscond_inited = .true.
  end subroutine LSCondInit
LatHeatNha92
Constant :
LatHeatNha92 = 43655_DP :real(DP), parameter
: $ l $ [J mol-1]. 水の凝結の潜熱. Latent heat of condensation of water vapor
P0Nha92
Constant :
P0Nha92 = 1.4e+11_DP :real(DP), parameter
: $ p_0^{*} $ [Pa]. 水蒸気飽和曲線の定数. constant for water vapor saturation curve
module_name
Constant :
module_name = ‘lscond :character(*), parameter
: モジュールの名称. Module name
saturate_scheme
Constant :
saturate_scheme = ifdef LIB_SATURATE_NHA1992 elif LIB_SATURATE_T1930 else endif :character(*), parameter
version
Constant :
version = ’$Name: dcpam5-20090319 $’ // ’$Id: lscond.F90,v 1.3 2009-03-15 11:34:57 morikawa Exp $’ :character(*), parameter
: モジュールのバージョン Module version

[Validate]