Class BasicSet
In: setup/basicset.f90

デフォルトの基本場を設定するための変数参照型モジュール ただし, hogeBasicZ となる配列は, 外部から値を入力することで 初期化を行う.

Methods

Included Modules

dc_message ChemData gridset

Public Instance methods

Subroutine :
xz_Press(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)
xz_Exner(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)
xz_Temp(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)
xz_PotTemp(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)
xz_Dens(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)
xz_VelSound(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)
xza_MixRt(DimXMin:DimXMax, DimZMin:DimZMax, SpcNum) :real(8), intent(in)
xz_EffMolWt(DimXMin:DimXMax, DimZMin:DimZMax) :real(8), intent(in)

基本場の値を外部から取得する.

[Source]

  subroutine BasicSetArray_Init( xz_Press, xz_Exner, xz_Temp, xz_PotTemp, xz_Dens, xz_VelSound, xza_MixRt, xz_EffMolWt )
    !
    !基本場の値を外部から取得する. 
    !
    
    !入力変数
    real(8), intent(in) :: xz_Press(DimXMin:DimXMax, DimZMin:DimZMax)
    real(8), intent(in) :: xz_Exner(DimXMin:DimXMax, DimZMin:DimZMax)
    real(8), intent(in) :: xz_Temp(DimXMin:DimXMax, DimZMin:DimZMax)
    real(8), intent(in) :: xz_PotTemp(DimXMin:DimXMax, DimZMin:DimZMax)
    real(8), intent(in) :: xz_Dens(DimXMin:DimXMax, DimZMin:DimZMax)
    real(8), intent(in) :: xz_VelSound(DimXMin:DimXMax, DimZMin:DimZMax)
    real(8), intent(in) :: xza_MixRt(DimXMin:DimXMax, DimZMin:DimZMax, SpcNum)
    real(8), intent(in) :: xz_EffMolWt(DimXMin:DimXMax, DimZMin:DimZMax)
   
    !---------------------------------------------------------------
    ! *BasicZ な配列の初期化
    !---------------------------------------------------------------
    !配列の割り当て
    allocate( xz_DensBasicZ(DimXMin:DimXMax, DimZMin:DimZMax), xz_PressBasicZ(DimXMin:DimXMax, DimZMin:DimZMax), xz_ExnerBasicZ(DimXMin:DimXMax, DimZMin:DimZMax), xz_TempBasicZ(DimXMin:DimXMax, DimZMin:DimZMax), xz_PotTempBasicZ(DimXMin:DimXMax, DimZMin:DimZMax), xz_VelSoundBasicZ(DimXMin:DimXMax, DimZMin:DimZMax), xza_MixRtBasicZ(DimXMin:DimXMax, DimZMin:DimZMax, SpcNum), xz_EffMolWtBasicZ(DimXMin:DimXMax, DimZMin:DimZMax)         )
    
    !値の入力
    xz_PressBasicZ    = xz_Press
    xz_ExnerBasicZ    = xz_Exner
    xz_TempBasicZ     = xz_Temp
    xz_PotTempBasicZ  = xz_PotTemp
    xz_DensBasicZ     = xz_Dens
    xz_VelSoundBasicZ = xz_VelSound
    xza_MixRtBasicZ   = xza_MixRt
    xz_EffMolWtBasicZ = xz_EffMolWt
    
  end subroutine BasicSetArray_Init
Subroutine :
cfgfile :character(*), intent(in)
: NAMELIST ファイル
   real(8)                   :: Tropopause      !対流圏圏界面高度
   real(8)                   :: CpDryMol        !乾燥成分の定圧比熱 [J/K mol]

基本場の情報を Namelist から取得して値を計算

This procedure input/output NAMELIST#basicset .

[Source]

  subroutine BasicSet_Init(cfgfile)
    !
    !基本場の情報を Namelist から取得して値を計算
    !

    !暗黙の型宣言禁止
    implicit none
    
    !変数定義
    character(*), intent(in) :: cfgfile         !NAMELIST ファイル
!    real(8)                   :: Tropopause      !対流圏圏界面高度
!    real(8)                   :: CpDryMol        !乾燥成分の定圧比熱 [J/K mol]
    integer                   :: SpcDryNum       !乾燥成分の化学種の数
    integer                   :: SpcWetNum       !湿潤成分の化学種の数
    character(20)             :: SpcDrySymbol(5)!乾燥成分の化学種名
!    character(15)             :: SpcWetSymbol(10)!湿潤成分の化学種名
    real(8)                   :: SpcDryMolFr(5) !乾燥成分の化学種の存在度
!    real(8)                   :: SpcWetMolFr(10) !湿潤成分の化学種の存在度
    integer, allocatable      :: SpcDryID(:)     !乾燥成分の化学種のID
!    real(8)                   :: Humidity        !相対湿度
!    character(20)             :: EnvType         !基本場の温度設定, 'Dry' or 'Moist'
    real(8), allocatable      :: PropertyDry(:)  !作業配列
    character(20), allocatable:: Symbol(:)       !作業配列
    integer                   :: s, n1, n2, n3   !作業変数

    !NAMELIST の定義
    NAMELIST /basicset/ Grav, TempSfc, PressSfc,   PressBasis, Tropopause, SpcDrySymbol, SpcDryMolFr, SpcWetSymbol, SpcWetMolFr, EnvType, Humidity, TempStrat, Dhight

    SpcDrySymbol = '' 
    SpcDryMolFr  = 0.0d0
    SpcWetSymbol = '' 
    SpcWetMolFr  = 0.0d0
    
    !ファイルオープン. 情報取得. 
    open (10, FILE=cfgfile)
    read(10, NML=basicset)
    close(10)

    !----------------------------------------------------------
    ! 乾燥成分の物性値の初期化
    !----------------------------------------------------------
    !乾燥成分の個数を数える
    SpcDryNum = count(SpcDrySymbol /= "")
    
    !化学種の ID を取得    
    allocate(SpcDryID(SpcDryNum))    
    do s = 1, SpcDryNum
      SpcDryID(s) = ChemData_OneSpcID( SpcDrySymbol(s) )
    end do

    !作業配列の準備
    allocate(PropertyDry(SpcDryNum))

    !分子量
    do s = 1, SpcDryNum
      PropertyDry(s) = ChemData_MolWt(SpcDryID(s))
    end do
    MolWtDry = dot_product(PropertyDry, SpcDryMolFr(1:SpcDryNum)) 
    
    !定圧比熱(モル当量)
    do s = 1, SpcDryNum    
      PropertyDry(s) = ChemData_CpPerMolRef(SpcDryID(s))
    end do
    CpDryMol = dot_product(PropertyDry, SpcDryMolFr(1:SpcDryNum)) 
    
    !定圧比熱
    CpDry    = CpDryMol / MolWtDry
    
    !気体定数
    GasRDry = GasRUniv / MolWtDry
    
    !定積比熱
    CvDry    = CpDry - GasRDry
    
    
    !----------------------------------------------------------
    ! 湿潤成分の ID を得る
    !----------------------------------------------------------
    !湿潤成分の個数を数える
    SpcWetNum = count(SpcWetSymbol /= "")
    if (SpcWetNum /= SpcNum) then 
      call MessageNotify( "E", "basicset: ", "SpcWetNum is not equal to SpcNum." )
    end if
    
    !配列の割り当て
    allocate(SpcWetID(SpcWetNum), Symbol(SpcWetNum), MolWtWet(SpcWetNum))

    !SpcWetSymbol の文字列から, -Rain, -Cloud を除いたものを Symbol として保管
    do s = 1, SpcWetNum
      n1 = index(SpcWetSymbol(s), '-Cloud' )
      n2 = index(SpcWetSymbol(s), '-Rain' )
      n3 = max(n1, n2)
      if (n3 == 0) then
        Symbol(s) = SpcWetSymbol(s)
      else
        Symbol(s) = SpcWetSymbol(s)(1:n3-1)
      end if
    end do
    
    !化学種の ID を取得
    do s =1, SpcWetNum
      SpcWetID(s) = ChemData_OneSpcID( Symbol(s) )
    end do
    
    !分子量を保管
    do s = 1, SpcWetNum
      MolWtWet(s) = ChemData_MolWt(SpcWetID(s))
    end do

    !----------------------------------------------------------
    ! 確認
    !----------------------------------------------------------
    call MessageNotify( "M", "basicset_init", "Grav = %f",     d=(/Grav/) )
    call MessageNotify( "M", "basicset_init", "TempSfc = %f",  d=(/TempSfc/) )
    call MessageNotify( "M", "basicset_init", "PressSfc = %f", d=(/PressSfc/) )
    call MessageNotify( "M", "basicset_init", "PressBasis = %f", d=(/PressBasis/))

    do s = 1, SpcDryNum
      call MessageNotify( "M", "basicset_init", "SpcDryID = %d",      i=(/SpcDryID(s)/))
      call MessageNotify( "M", "basicset_init", "SpcDrySymbol = %c", c1=trim(SpcDrySymbol(s)))
      call MessageNotify( "M", "basicset_init", "SpcDryMolFr = %f",   d=(/SpcDryMolFr(s)/))
    end do

    call MessageNotify( "M", "basicset_init", "CpDry = %f",    d=(/CpDry/) )
    call MessageNotify( "M", "basicset_init", "CpDryMol = %f", d=(/CpDryMol/) )
    call MessageNotify( "M", "basicset_init", "CvDry = %f",    d=(/CvDry/) )
    call MessageNotify( "M", "basicset_init", "GasRDry = %f",  d=(/GasRDry/) )
    call MessageNotify( "M", "basicset_init", "MolWtDry = %f", d=(/MolWtDry/) )

    do s = 1, SpcWetNum
      call MessageNotify( "M", "basicset_init", "SpcWetID = %d",     i=(/SpcWetID(s)/) )
      call MessageNotify( "M", "basicset_init", "SpcWetSymbol = %c", c1=trim(SpcWetSymbol(s)) )
      call MessageNotify( "M", "basicset_init", "SpcWetMolFr = %f",  d=(/SpcWetMolFr(s)/) )
      call MessageNotify( "M", "basicset_init", "MolWtWet = %f",     d=(/MolWtWet(s)/) )
    end do

    call MessageNotify( "M", "basicset_init", "Tropopause = %f ", d=(/Tropopause/) )
    call MessageNotify( "M", "basicset_init", "EnvType = %c", c1=trim(EnvType) )
    call MessageNotify( "M", "basicset_init", "Humidity = %f", d=(/Humidity/)  )

  end subroutine BasicSet_Init
CpDry
Variable :
CpDry :real(8)
: 乾燥成分の定圧比熱 [J/K kg]
CpDryMol
Variable :
CpDryMol :real(8)
: 乾燥成分の定圧比熱 [J/K kg]
CvDry
Variable :
CvDry :real(8)
: 乾燥成分の定積比熱 [J/K kg]
Dhight
Variable :
Dhight :real(8)
: 重み関数のパラメータ [m]
EnvType
Variable :
EnvType :character(20)
: 基本場の温度設定, ‘Dry’ or ‘Moist‘
GasRDry
Variable :
GasRDry :real(8)
: 乾燥成分の気体定数 [J/K kg]
Grav
Variable :
Grav :real(8)
: 重力 [m/s^2]
Humidity
Variable :
Humidity :real(8)
: 相対湿度
MolWtDry
Variable :
MolWtDry :real(8)
: 乾燥成分の分子量 [kg/mol]
MolWtWet
Variable :
MolWtWet(:) :real(8), allocatable
: 湿潤成分の分子量
PressBasis
Variable :
PressBasis :real(8)
: 温位の基準圧力 [Pa]
PressSfc
Variable :
PressSfc :real(8)
: 地表面圧力 [Pa]
SpcWetID
Variable :
SpcWetID(:) :integer, allocatable
: 湿潤成分の化学種のID
SpcWetMolFr
Variable :
SpcWetMolFr(10) :real(8)
: 湿潤成分の化学種の存在度
SpcWetSymbol
Variable :
SpcWetSymbol(10) :character(20)
: 湿潤成分の化学種名
TempSfc
Variable :
TempSfc :real(8)
: 地表面温度 [K]
TempStrat
Variable :
TempStrat :real(8)
: 成層圏の温度 [k]
Tropopause
Variable :
Tropopause :real(8)
: 対流圏圏界面高度
xz_DensBasicZ
Variable :
xz_DensBasicZ(:,:) :real(8), allocatable
: 密度
xz_EffMolWtBasicZ
Variable :
xz_EffMolWtBasicZ(:,:) :real(8), allocatable
: 分子量効果
xz_ExnerBasicZ
Variable :
xz_ExnerBasicZ(:,:) :real(8), allocatable
: 無次元圧力
xz_PotTempBasicZ
Variable :
xz_PotTempBasicZ(:,:) :real(8), allocatable
: 温位
xz_PressBasicZ
Variable :
xz_PressBasicZ(:,:) :real(8), allocatable
: 無次元圧力
xz_TempBasicZ
Variable :
xz_TempBasicZ(:,:) :real(8), allocatable
: 温度
xz_VelSoundBasicZ
Variable :
xz_VelSoundBasicZ(:,:) :real(8), allocatable
: 音速
xza_MixRtBasicZ
Variable :
xza_MixRtBasicZ(:,:,:) :real(8), allocatable
: 凝縮成分混合比

[Validate]