Class co2_phase_change
In: saturate/co2_phase_change.f90

CO2 相変化

Phase change of CO2

Note that Japanese and English are described in parallel.

Procedures List

!$ ! DryConvAdjust :乾燥対流調節
!$ ! ———— :————
!$ ! DryConvAdjust :Dry convective adjustment

NAMELIST

NAMELIST#dry_conv_adjust_nml

Methods

Included Modules

gridset dc_types namelist_util dc_message timeset gtool_historyauto constants dc_iounit dc_string

Public Instance methods

Subroutine :
xyr_Press(0:imax-1, 1:jmax, 0:kmax) :real(DP), intent(in )
: $ hat{p} $ . 気圧 (半整数レベル). Air pressure (half level)
xyz_Press(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(in )
: $ p $ . 気圧 (整数レベル). Air pressure (full level)
xy_Ps(0:imax-1, 1:jmax) :real(DP), intent(inout)
: $ T $ . 温度. Temperature
xyz_Temp(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(inout)
: $ T $ . 温度. Temperature
xy_SurfMajCompIce(0:imax-1, 1:jmax) :real(DP), intent(inout)
: Surface major component ice amount

CO2 相変化

CO2 phase change

[Source]

  subroutine CO2PhaseChangeInAtm( xyr_Press, xyz_Press, xy_Ps, xyz_Temp, xy_SurfMajCompIce )
    !
    ! CO2 相変化
    !
    ! CO2 phase change
    !

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

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

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

    ! 物理定数設定
    ! Physical constants settings
    !
    use constants, only: Grav, CpDry
                              ! $ C_p $ [J kg-1 K-1].
                              ! 乾燥大気の定圧比熱.
                              ! Specific heat of air at constant pressure


    ! 宣言文 ; Declaration statements
    !
    implicit none

    real(DP), intent(in   ):: xyr_Press (0:imax-1, 1:jmax, 0:kmax)
                              ! $ \hat{p} $ . 気圧 (半整数レベル). 
                              ! Air pressure (half level)
    real(DP), intent(in   ):: xyz_Press (0:imax-1, 1:jmax, 1:kmax)
                              ! $ p $ . 気圧 (整数レベル). 
                              ! Air pressure (full level)
    real(DP), intent(inout):: xy_Ps            (0:imax-1, 1:jmax)
                              ! $ T $ .     温度. Temperature
    real(DP), intent(inout):: xyz_Temp         (0:imax-1, 1:jmax, 1:kmax)
                              ! $ T $ .     温度. Temperature
    real(DP), intent(inout):: xy_SurfMajCompIce(0:imax-1, 1:jmax)
                              !
                              ! Surface major component ice amount

    ! 作業変数
    ! Work variables
    !
    real(DP):: xyz_TempB           (0:imax-1, 1:jmax, 1:kmax)
                              ! 調節前の温度. 
                              ! Temperature before adjustment
    real(DP):: xyz_DTempDt         (0:imax-1, 1:jmax, 1:kmax)
                              ! 温度変化率. 
                              ! Temperature tendency
    real(DP):: xy_DSurfMajCompIceDt(0:imax-1, 1:jmax)
                              ! 
                              ! Surface major component ice tendency

    real(DP):: xyz_TempCond   (0:imax-1, 1:jmax, 1:kmax)

    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

    logical :: FlagCheckPs


    ! 実行文 ; Executable statement
    !

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

    ! 初期化
    ! Initialization
    !
    if ( .not. co2_phase_change_inited ) call CO2PhaseChangeInit

    if ( .not. FlagUse ) return


    FlagCheckPs = .false.
    do j = 1, jmax
      do i = 0, imax-1
        if ( xyr_Press(i,j,0) > 1.0d4 ) then
          FlagCheckPs = .true.
        end if
      end do
    end do
    if ( FlagCheckPs ) then
      call MessageNotify( 'W', module_name, 'Surface pressure is greater than 10000 Pa.' )
    end if


    ! 調節前 "Temp" の保存
    ! Store "Temp" before adjustment
    !
    xyz_TempB    = xyz_Temp


    call CO2Saturate3D( xyz_Press, xyz_TempCond )

    do k = 1, kmax
      do j = 1, jmax
        do i = 0, imax-1
          if ( xyz_Temp(i,j,k) < xyz_TempCond(i,j,k) ) then
            xyz_Temp(i,j,k) = xyz_TempCond(i,j,k)
          end if
        end do
      end do
    end do

    ! 温度変化率
    ! Calculate temperature tendency
    !
    xyz_DTempDt = ( xyz_Temp - xyz_TempB ) / ( 2.0_DP * DelTime )


    !
    ! Surface major component ice adjustment
    !
    xy_DSurfMajCompIceDt = 0.0_DP
    do k = kmax, 1, -1
      xy_DSurfMajCompIceDt = xy_DSurfMajCompIceDt + CpDry * xyz_DTempDt(:,:,k) * ( xyr_Press(:,:,k-1) - xyr_Press(:,:,k) ) / Grav / LatentHeatCO2Subl
    end do
    xy_SurfMajCompIce = xy_SurfMajCompIce + xy_DSurfMajCompIceDt * ( 2.0_DP * DelTime )


    !
    ! Surface pressure adjustment
    !
    xy_Ps = xy_Ps - xy_DSurfMajCompIceDt * Grav * ( 2.0_DP * DelTime )


    ! ヒストリデータ出力
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'DTempDtCO2PhaseChange', xyz_DTempDt )


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

  end subroutine CO2PhaseChangeInAtm
Subroutine :
xy_Press(0:imax-1, 1:jmax) :real(DP), intent(in )
: $ p $ . 気圧 (整数レベル). Air pressure (full level)
xy_TempCond(0:imax-1, 1:jmax) :real(DP), intent(out)
: Condensation temperature

CO2 相変化

CO2 phase change

[Source]

  subroutine CO2Saturate2D( xy_Press, xy_TempCond )
    !
    ! CO2 相変化
    !
    ! CO2 phase change
    !

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


    ! 宣言文 ; Declaration statements
    !
    implicit none

    real(DP), intent(in ):: xy_Press   (0:imax-1, 1:jmax)
                              ! $ p $ . 気圧 (整数レベル). 
                              ! Air pressure (full level)
    real(DP), intent(out):: xy_TempCond(0:imax-1, 1:jmax)
                              !
                              ! Condensation temperature

    ! 作業変数
    ! Work variables
    !

    ! 実行文 ; Executable statement
    !


    ! 初期化
    ! Initialization
    !
    if ( .not. co2_phase_change_inited ) call CO2PhaseChangeInit


    xy_TempCond = 149.2_DP + 6.48_DP * log( 0.135_DP * xy_Press * 1.0d-2 )


  end subroutine CO2Saturate2D
Subroutine :
xyz_Press(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(in )
: $ p $ . 気圧 (整数レベル). Air pressure (full level)
xyz_TempCond(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(out)
: Condensation temperature

CO2 相変化

CO2 phase change

[Source]

  subroutine CO2Saturate3D( xyz_Press, xyz_TempCond )
    !
    ! CO2 相変化
    !
    ! CO2 phase change
    !

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


    ! 宣言文 ; Declaration statements
    !
    implicit none

    real(DP), intent(in ):: xyz_Press   (0:imax-1, 1:jmax, 1:kmax)
                              ! $ p $ . 気圧 (整数レベル). 
                              ! Air pressure (full level)
    real(DP), intent(out):: xyz_TempCond(0:imax-1, 1:jmax, 1:kmax)
                              !
                              ! Condensation temperature

    ! 作業変数
    ! Work variables
    !

    ! 実行文 ; Executable statement
    !


    ! 初期化
    ! Initialization
    !
    if ( .not. co2_phase_change_inited ) call CO2PhaseChangeInit


    xyz_TempCond = 149.2_DP + 6.48_DP * log( 0.135_DP * xyz_Press * 1.0d-2 )


  end subroutine CO2Saturate3D
LatentHeatCO2Subl
Constant :
LatentHeatCO2Subl = 5.9d5 :real(DP), parameter
: Latent heat of CO2 (J kg^{-1}) This value is obtained from Pollack et al. [1981] and Forget et al. [1998].
co2_phase_change_inited
Variable :
co2_phase_change_inited = .false. :logical, save, public
: 初期設定フラグ. Initialization flag

Private Instance methods

Subroutine :

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

"co2_phase_change" module is initialized. "NAMELIST#co2_phase_change_nml" is loaded in this procedure.

This procedure input/output NAMELIST#co2_phase_change_nml .

[Source]

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

          ! デフォルト値については初期化手続 "co2_phase_change#CO2PhaseChangeInit" 
          ! のソースコードを参照のこと. 
          !
          ! Refer to source codes in the initialization procedure
          ! "co2_phase_change#CO2PhaseChangeInit" for the default values. 
          !

    ! 実行文 ; Executable statement
    !

    if ( co2_phase_change_inited ) return

    ! デフォルト値の設定
    ! Default values settings
    !
    FlagUse = .false.

    ! 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 = co2_phase_change_nml, iostat = iostat_nml )         ! (out)
      close( unit_nml )

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


    ! ヒストリデータ出力のためのへの変数登録
    ! Register of variables for history data output
    !
    call HistoryAutoAddVariable( 'DSurfTempDtCO2PhaseChange', (/ 'lon ', 'lat ', 'time' /), 'heating by CO2 phase change', 'K s-1' )
    call HistoryAutoAddVariable( 'DTempDtCO2PhaseChange', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'heating by CO2 phase change', 'K s-1' )

    ! 印字 ; Print
    !
    call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
    call MessageNotify( 'M', module_name, '  FlagUse              = %b', l = (/ FlagUse /) )
    call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )

    co2_phase_change_inited = .true.

  end subroutine CO2PhaseChangeInit
Subroutine :
xyr_Press(0:imax-1, 1:jmax, 0:kmax) :real(DP), intent(in )
: $ hat{p} $ . 気圧 (半整数レベル). Air pressure (half level)
xyz_Press(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(in )
: $ p $ . 気圧 (整数レベル). Air pressure (full level)
xy_SurfTemp(0:imax-1, 1:jmax) :real(DP), intent(inout)
: $ T_s $ . 惑星表面温度. Surface temperature
xyz_Temp(0:imax-1, 1:jmax, 1:kmax) :real(DP), intent(inout)
: $ T $ . 温度. Temperature

CO2 相変化

CO2 phase change

[Source]

  subroutine CO2PhaseChangeLimitTemp( xyr_Press, xyz_Press, xy_SurfTemp, xyz_Temp )
    !
    ! CO2 相変化
    !
    ! CO2 phase change
    !

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

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

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


    ! 宣言文 ; Declaration statements
    !
    implicit none

    real(DP), intent(in   ):: xyr_Press (0:imax-1, 1:jmax, 0:kmax)
                              ! $ \hat{p} $ . 気圧 (半整数レベル). 
                              ! Air pressure (half level)
    real(DP), intent(in   ):: xyz_Press (0:imax-1, 1:jmax, 1:kmax)
                              ! $ p $ . 気圧 (整数レベル). 
                              ! Air pressure (full level)
    real(DP), intent(inout):: xy_SurfTemp(0:imax-1, 1:jmax)
                              ! $ T_s $ .   惑星表面温度. Surface temperature
    real(DP), intent(inout):: xyz_Temp   (0:imax-1, 1:jmax, 1:kmax)
                              ! $ T $ .     温度. Temperature

    ! 作業変数
    ! Work variables
    !
    real(DP):: xy_SurfTempB  (0:imax-1, 1:jmax)
                              ! 調節前の惑星表面温度. 
                              ! Surface temperature before adjustment
    real(DP):: xyz_TempB     (0:imax-1, 1:jmax, 1:kmax)
                              ! 調節前の温度. 
                              ! Temperature before adjustment
    real(DP):: xy_DSurfTempDt(0:imax-1, 1:jmax)
                              ! 惑星表面温度変化率. 
                              ! Surface temperature tendency
    real(DP):: xyz_DTempDt   (0:imax-1, 1:jmax, 1:kmax)
                              ! 温度変化率. 
                              ! Temperature tendency

    real(DP):: xy_SurfTempCond(0:imax-1, 1:jmax)
    real(DP):: xyz_TempCond   (0:imax-1, 1:jmax, 1:kmax)

    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

    logical :: FlagCheckPs


    ! 実行文 ; Executable statement
    !

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

    ! 初期化
    ! Initialization
    !
    if ( .not. co2_phase_change_inited ) call CO2PhaseChangeInit

    if ( .not. FlagUse ) return


    FlagCheckPs = .false.
    do j = 1, jmax
      do i = 0, imax-1
        if ( xyr_Press(i,j,0) > 1.0d4 ) then
          FlagCheckPs = .true.
        end if
      end do
    end do
    if ( FlagCheckPs ) then
      call MessageNotify( 'W', module_name, 'Surface pressure is greater than 10000 Pa.' )
    end if


    ! 調節前 "Temp" の保存
    ! Store "Temp" before adjustment
    !
    xy_SurfTempB = xy_SurfTemp
    xyz_TempB    = xyz_Temp


    do j = 1, jmax
      do i = 0, imax-1
        xy_SurfTempCond(i,j) = 149.2d0 + 6.48d0 * log( 0.135d0 * xyr_Press(i,j,0) * 1.0d-2 )
      end do
    end do
    do k = 1, kmax
      do j = 1, jmax
        do i = 0, imax-1
          xyz_TempCond(i,j,k) = 149.2d0 + 6.48d0 * log( 0.135d0 * xyz_Press(i,j,k) * 1.0d-2 )
        end do
      end do
    end do

    do j = 1, jmax
      do i = 0, imax-1
        if ( xy_SurfTemp(i,j) < xy_SurfTempCond(i,j) ) then
          xy_SurfTemp(i,j) = xy_SurfTempCond(i,j)
        end if
      end do
    end do
    do k = 1, kmax
      do j = 1, jmax
        do i = 0, imax-1
          if ( xyz_Temp(i,j,k) < xyz_TempCond(i,j,k) ) then
            xyz_Temp(i,j,k) = xyz_TempCond(i,j,k)
          end if
        end do
      end do
    end do


    ! 温度変化率
    ! Calculate temperature tendency
    !
    xy_DSurfTempDt = ( xy_SurfTemp - xy_SurfTempB ) / ( 2.0_DP * DelTime )
    xyz_DTempDt    = ( xyz_Temp    - xyz_TempB    ) / ( 2.0_DP * DelTime )


    ! ヒストリデータ出力
    ! History data output
    !
    call HistoryAutoPut( TimeN, 'DSurfTempDtCO2PhaseChange', xy_DSurfTempDt )
    call HistoryAutoPut( TimeN, 'DTempDtCO2PhaseChange'    , xyz_DTempDt    )


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

  end subroutine CO2PhaseChangeLimitTemp
FlagUse
Variable :
FlagUse :logical, save
: 使用フラグ flag for use of this scheme
module_name
Constant :
module_name = ‘co2_phase_change :character(*), parameter
: モジュールの名称. Module name
version
Constant :
version = ’$Name: dcpam5-20120226 $’ // ’$Id: co2_phase_change.f90,v 1.2 2011-12-29 08:27:46 yot Exp $’ :character(*), parameter
: モジュールのバージョン Module version