Class BasicSet_3d
In: setup/basicset_3d.f90

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

Methods

Included Modules

dc_types dc_iounit dc_message ChemData gridset_3d

Public Instance methods

Subroutine :
xyz_Press(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)
xyz_Exner(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)
xyz_Temp(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)
xyz_PotTemp(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)
xyz_Dens(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)
xyz_VelSound(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)
xyza_MixRt(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax,SpcNum) :real(DP), intent(in)
xyz_EffMolWt(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) :real(DP), intent(in)

[Source]

  subroutine BasicSetArray_Init( xyz_Press, xyz_Exner, xyz_Temp, xyz_PotTemp, xyz_Dens, xyz_VelSound, xyza_MixRt, xyz_EffMolWt )

    !
    !基本場の値を外部から取得する. 
    !
    
    !入力変数
    real(DP), intent(in) :: xyz_Press (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in) :: xyz_Exner (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in) :: xyz_Temp (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in) :: xyz_PotTemp (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in) :: xyz_Dens (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in) :: xyz_VelSound (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
    real(DP), intent(in) :: xyza_MixRt (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax,SpcNum)
    real(DP), intent(in) :: xyz_EffMolWt(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax)
   
    !---------------------------------------------------------------
    ! *BasicZ な配列の初期化
    !---------------------------------------------------------------
    !配列の割り当て
    allocate( xyz_DensBasicZ    (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax), xyz_PressBasicZ   (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax), xyz_ExnerBasicZ   (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax), xyz_TempBasicZ    (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax), xyz_PotTempBasicZ (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax), xyz_VelSoundBasicZ(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax), xyza_MixRtBasicZ  (DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax,SpcNum), xyz_EffMolWtBasicZ(DimXMin:DimXMax,DimYMin:DimYMax,DimZMin:DimZMax) )
    
    !値の入力
    xyz_PressBasicZ    = xyz_Press
    xyz_ExnerBasicZ    = xyz_Exner
    xyz_TempBasicZ     = xyz_Temp
    xyz_PotTempBasicZ  = xyz_PotTemp
    xyz_DensBasicZ     = xyz_Dens
    xyz_VelSoundBasicZ = xyz_VelSound
    xyza_MixRtBasicZ   = xyza_MixRt
    xyz_EffMolWtBasicZ = xyz_EffMolWt

  end subroutine BasicSetArray_Init
Subroutine :
cfgfile :character(*), intent(in)
: NAMELIST ファイル
   real(DP)                 :: Tropopause      !対流圏圏界面高度
   real(DP)                 :: 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(DP)                 :: Tropopause      !対流圏圏界面高度
!    real(DP)                 :: CpDryMol        !乾燥成分の定圧比熱 [J/K mol]
    integer                  :: SpcDryNum       !乾燥成分の化学種の数
    integer                  :: SpcWetNum       !湿潤成分の化学種の数
    character(20)            :: SpcDrySymbol(5)!乾燥成分の化学種名
!    character(15)            :: SpcWetSymbol(10)!湿潤成分の化学種名
    real(DP)                 :: SpcDryMolFr(5) !乾燥成分の化学種の存在度
!    real(DP)                 :: SpcWetMolFr(10) !湿潤成分の化学種の存在度
    integer, allocatable     :: SpcDryID(:)     !乾燥成分の化学種のID
!    real(DP)                 :: Humidity        !相対湿度
!    character(20)            :: EnvType         !基本場の温度設定, 'Dry' or 'Moist'
    real(DP), allocatable    :: PropertyDry(:)  !作業配列
    character(20), allocatable:: Symbol(:)       !作業配列
    integer                  :: s, n1, n2, n3   !作業変数
    integer                  :: unit            !装置番号

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

    SpcDrySymbol = '' 
    SpcDryMolFr  = 0.0d0
    SpcWetSymbol = '' 
    SpcWetMolFr  = 0.0d0
    
    !ファイルオープン. 情報取得. 
    call FileOpen(unit, file=cfgfile, mode='r')
    read(unit, NML=basicset)
    close(unit)

    !----------------------------------------------------------
    ! 乾燥成分の物性値の初期化
    !----------------------------------------------------------
    !乾燥成分の個数を数える
    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." )
!      write(*,*) "SpcWetNum /= SpcNum"
!      stop
    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(DP)
: 乾燥成分の定圧比熱 [J/K kg]
CpDryMol
Variable :
CpDryMol :real(DP)
: 乾燥成分の定圧比熱 [J/K kg]
CvDry
Variable :
CvDry :real(DP)
: 乾燥成分の定積比熱 [J/K kg]
Dhight
Variable :
Dhight :real(DP)
: 重み関数のパラメータ [m]
EnvType
Variable :
EnvType :character(20)
: 基本場の温度設定, ‘Dry’ or ‘Moist‘
GasRDry
Variable :
GasRDry :real(DP)
: 乾燥成分の気体定数 [J/K kg]
Grav
Variable :
Grav :real(DP)
: 重力 [m/s^2]
Humidity
Variable :
Humidity :real(DP)
: 相対湿度
MolWtDry
Variable :
MolWtDry :real(DP)
: 乾燥成分の分子量 [kg/mol]
MolWtWet
Variable :
MolWtWet(:) :real(DP), allocatable
: 湿潤成分の分子量
PressBasis
Variable :
PressBasis :real(DP)
: 温位の基準圧力 [Pa]
PressSfc
Variable :
PressSfc :real(DP)
: 地表面圧力 [Pa]
SpcWetID
Variable :
SpcWetID(:) :integer, allocatable
: 湿潤成分の化学種のID
SpcWetMolFr
Variable :
SpcWetMolFr(10) :real(DP)
: 湿潤成分の化学種の存在度
SpcWetSymbol
Variable :
SpcWetSymbol(10) :character(20)
: 湿潤成分の化学種名
TempSfc
Variable :
TempSfc :real(DP)
: 地表面温度 [K]
TempStrat
Variable :
TempStrat :real(DP)
: 成層圏の温度 [k]
Tropopause
Variable :
Tropopause :real(DP)
: 対流圏圏界面高度
xyz_DensBasicZ
Variable :
xyz_DensBasicZ(:,:,:) :real(DP), allocatable
: 密度
xyz_EffMolWtBasicZ
Variable :
xyz_EffMolWtBasicZ(:,:,:) :real(DP), allocatable
: 分子量効果
xyz_ExnerBasicZ
Variable :
xyz_ExnerBasicZ(:,:,:) :real(DP), allocatable
: 無次元圧力
xyz_PotTempBasicZ
Variable :
xyz_PotTempBasicZ(:,:,:) :real(DP), allocatable
: 温位
xyz_PressBasicZ
Variable :
xyz_PressBasicZ(:,:,:) :real(DP), allocatable
: 無次元圧力
xyz_TempBasicZ
Variable :
xyz_TempBasicZ(:,:,:) :real(DP), allocatable
: 温度
xyz_VelSoundBasicZ
Variable :
xyz_VelSoundBasicZ(:,:,:) :real(DP), allocatable
: 音速
xyza_MixRtBasicZ
Variable :
xyza_MixRtBasicZ(:,:,:,:) :real(DP), allocatable
: 凝縮成分混合比