!c Description: 
!c   初期値読み込み (netCDF ファイル)
!c
!c Current Code Owner: 
!c   sugiyama@gfd-dennou.org
!c
!c Copyright (C) SUGIYAMA Ko-ichiro, 2004, All rights reserved

module distrbset
  implicit none
  save
  real(8), allocatable   :: fs_VelXDistrb(:,:)
  real(8), allocatable   :: sf_VelZDistrb(:,:)
  real(8), allocatable   :: ss_ExnerDistrb(:,:)
  real(8), allocatable   :: ss_ThetaDistrb(:,:)

contains
  subroutine distrbset_init
    use gridset
    use fileset, only: cfgfile, distrbfile
    use gt4_history
    
    character(20)  :: name            !変数名
    
    !--- 配列の割り当て
    allocate(  &
         & fs_VelXDistrb(DimXMin:DimXMax, DimZMin:DimZMax), &
         & sf_VelZDistrb(DimXMin:DimXMax, DimZMin:DimZMax), &
         & ss_ExnerDistrb(DimXMin:DimXMax, DimZMin:DimZMax), &
         & ss_ThetaDistrb(DimXMin:DimXMax, DimZMin:DimZMax) )

    !--- 変数の取り出し
    name = "VelXDistrb"
    call HistoryGet( distrbfile, name, fs_VelXDistrb )

    name = "VelZDistrb"
    call HistoryGet( distrbfile, name, sf_VelZDistrb )

    name = "ExnerDistrb"
    call HistoryGet( distrbfile, name, ss_ExnerDistrb )

    name = "ThetaDistrb"
    call HistoryGet( distrbfile, name, ss_ThetaDistrb )

  end subroutine distrbset_init
  
end module distrbset

