subroutine HistoryFile_Open( )
!
!ヒストリファイルの定義
!
!暗黙の型宣言禁止
implicit none
!変数定義
integer :: s ! ループ添字
!-----------------------------------------------------------
! ヒストリー作成
!-----------------------------------------------------------
call MessageNotify ( "M", "HistoryFile_Open", "HistoryCreate" )
do s = 1, FileNum
call HistoryCreate( file = HistoryFile(s), title = exptitle, source = expsrc, institution = expinst, dims=(/'x','y','z','t'/), dimsizes=(/FileNX, FileNY, FileNZ, 0/), longnames=(/'X-coordinate', 'Y-coordinate', 'Z-coordinate', 'Time '/), units=(/'m ','m ','m ','sec'/), origin=0.0, xtypes=(/'double', 'double', 'double', 'double'/), interval=0.0, history=gt_hist(s), quiet=.true. )
call HistoryPut('x', x_X( FileXMin: FileXMax ), gt_hist(s) )
call HistoryPut('y', y_Y( FileYMin: FileYMax ), gt_hist(s) )
call HistoryPut('z', z_Z( FileZMin: FileZMax ), gt_hist(s) )
end do
!-----------------------------------------------------------
! 予報変数の出力
!-----------------------------------------------------------
call MessageNotify ( "M", "HistoryFile_Open", "HistoryAddVariable" )
!無次元圧力の擾乱
call HistoryAddVariable( varname='Exner', dims=(/'x','y','z','t'/), longname='disturbunce of nondimensional pressure', units=' ', xtype='double', history=gt_hist(1) )
!温位の擾乱
call HistoryAddVariable( varname='PotTemp', dims=(/'x','y','z','t'/), longname='disturbunce of potential temperature', units='K', xtype='double', history=gt_hist(2) )
!水平速度
call HistoryAddVariable( varname='VelX', dims=(/'x','y','z','t'/), longname='zonal velocity', units='m.s-1', xtype='double', history=gt_hist(3) )
!水平速度
call HistoryAddVariable( varname='VelY', dims=(/'x','y','z','t'/), longname='meridional velocity', units='m.s-1', xtype='double', history=gt_hist(4) )
!鉛直速度
call HistoryAddVariable( varname='VelZ', dims=(/'x','y','z','t'/), longname='vertical velocity', units='m.s-1', xtype='double', history=gt_hist(5) )
!渦粘性係数(運動量)
call HistoryAddVariable( varname='Km', dims=(/'x','y','z','t'/), longname='turbulet diffusion coefficient', units='m2.s-1', xtype='double', history=gt_hist(6) )
!渦粘性係数(熱)
call HistoryAddVariable( varname='Kh', dims=(/'x','y','z','t'/), longname='turbulet diffusion coefficient for heat', units='m2.s-1', xtype='double', history=gt_hist(7) )
call HistoryAddVariable( varname='VorX', dims=(/'x','y','z','t'/), longname='vorticity', units='m.s-1', xtype='double', history=gt_hist(10) )
call HistoryAddVariable( varname='VorY', dims=(/'x','y','z','t'/), longname='vorticity', units='m.s-1', xtype='double', history=gt_hist(11) )
call HistoryAddVariable( varname='VorZ', dims=(/'x','y','z','t'/), longname='vorticity', units='m.s-1', xtype='double', history=gt_hist(12) )
!----------------------------------------------------------------
! Stored Mixing Ratio
!----------------------------------------------------------------
do s = 1, SpcNum
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Mean', dims=(/'z','t'/), longname='Horiizontal Mean of ' //trim(SpcWetSymbol(s))//' Mixing Ratio', units='kg.kg-1', xtype='double', history=gt_hist(12+s) )
end do
!----------------------------------------------------------------
! 静的安定度
!----------------------------------------------------------------
call HistoryAddVariable( varname='Stab', dims=(/'z','t'/), longname='Static Stability', units='s-2', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='StabTemp', dims=(/'z','t'/), longname='Static Stability contributed by temperature', units='s-2', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='StabMolWt', dims=(/'z','t'/), longname='Static Stability contributed by Molecular Weight', units='s-2', xtype='double', history=gt_hist(9) )
!----------------------------------------------------------------
! 温位の時間変化
!----------------------------------------------------------------
call HistoryAddVariable( varname='PotTempAdv', dims=(/'z','t'/), longname='Advection term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempTurb', dims=(/'z','t'/), longname='Turbulence term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempDisp', dims=(/'z','t'/), longname='Dissipation term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempRad', dims=(/'z','t'/), longname='Radiation term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempDiff', dims=(/'z','t'/), longname='Numerical diffusion term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempCond', dims=(/'z','t'/), longname='Latent heat term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempFlux', dims=(/'z','t'/), longname='Surface Flux term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname='PotTempDamp', dims=(/'z','t'/), longname='Newtonian Cooling term of potential temperature', units='K.s-1', xtype='double', history=gt_hist(9) )
!----------------------------------------------------------------
! Mixing Ratio time change
!----------------------------------------------------------------
do s = 1, SpcNum
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Adv', dims=(/'z','t'/), longname='Advection term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Turb', dims=(/'z','t'/), longname='Turbulence term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Diff', dims=(/'z','t'/), longname='Diffusion term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Flux', dims=(/'z','t'/), longname='Surface Flux term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Rain', dims=(/'z','t'/), longname='Fall Rain term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Fill1', dims=(/'z','t'/), longname='Filling Negative term 1 of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Fill2', dims=(/'z','t'/), longname='Filling Negative term 2 of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Cond', dims=(/'z','t'/), longname='Condensation term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
call HistoryAddVariable( varname=trim(SpcWetSymbol(s))//'_Asln', dims=(/'z','t'/), longname='Asselin time filter term of ' //trim(SpcWetSymbol(s))//' mixing ratio', units='kg.kg-1.s-1', xtype='double', history=gt_hist(9) )
end do
!-----------------------------------------------------------
! 基本場の出力
!-----------------------------------------------------------
!無次元圧力の基本場
call HistoryAddVariable( varname='ExnerBasicZ', dims=(/'x','y','z'/), longname='nondimensional pressure', units='1', xtype='double', history=gt_hist(8) )
!温位の基本場
call HistoryAddVariable( varname='PotTempBasicZ', dims=(/'x','y','z'/), longname='potential temperature', units='K', xtype='double', history=gt_hist(8) )
!仮温位の基本場
! call HistoryAddVariable( &
! & varname='VPotTempBasicZ',&
! & dims=(/'x','y','z'/), &
! & longname='vertial potential temperature', &
! & units='K', &
! & xtype='double', &
! & history=gt_hist(8) )
!密度の基本場
call HistoryAddVariable( varname='DensBasicZ', dims=(/'x','y','z'/), longname='density', units='Kg.m-3', xtype='double', history=gt_hist(8) )
!音波速度の基本場
call HistoryAddVariable( varname='VelSoundBasicZ', dims=(/'x','y','z'/), longname='sound velocity', units='m.s-2', xtype='double', history=gt_hist(8) )
!温度の基本場
call HistoryAddVariable( varname='TempBasicZ', dims=(/'x','y','z'/), longname='Temperature of basic state', units='K', xtype='double', history=gt_hist(8) )
!圧力の基本場
call HistoryAddVariable( varname='PressBasicZ', dims=(/'x','y','z'/), longname='Pressure of basic state', units='Pa', xtype='double', history=gt_hist(8) )
!混合比の基本場
! do s = 1, SpcNum
! call HistoryAddVariable( &
! & varname=trim(SpcWetSymbol(s))//'BasicZ',&
! & dims=(/'x','y','z'/), &
! & longname=trim(SpcWetSymbol(s))//' Mixing Ratio of basic state', &
! & units='kg.kg-1', &
! & xtype='double', &
! & history=gt_hist(8) )
! end do
!分子量効果
! call HistoryAddVariable( &
! & varname='EffMolWtBasicZ', &
! & dims=(/'x','y','z'/), &
! & longname='Effect of Mole Weight', &
! & units='1', &
! & xtype='double', &
! & history=gt_hist(8) )
!-------------------------------------------------------------
! 基本場のファイル出力
!-------------------------------------------------------------
call MessageNotify ( "M", "HistoryFile_Open", "HistoryPut (BasicZ)" )
call HistoryPut( 'DensBasicZ', xyz_DensBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), gt_hist(8) )
call HistoryPut( 'ExnerBasicZ', xyz_ExnerBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), gt_hist(8) )
call HistoryPut( 'PotTempBasicZ', xyz_PotTempBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), gt_hist(8) )
! call HistoryPut( &
! & 'VPotTempBasicZ',&
! & xyz_PotTempBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax) &
! & / xyz_EffMolWtBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax),&
! & gt_hist(8) )
call HistoryPut( 'VelSoundBasicZ', xyz_VelSoundBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), gt_hist(8) )
call HistoryPut( 'TempBasicZ', xyz_TempBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), gt_hist(8) )
call HistoryPut( 'PressBasicZ', xyz_PressBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), gt_hist(8) )
! do s = 1, SpcNum
! call HistoryPut( &
! & trim(SpcWetSymbol(s))//'BasicZ', &
! & xyza_MixRtBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax, s), &
! & gt_hist(8) )
! end do
! call HistoryPut( &
! & 'EffMolWtBasicZ', &
! & xyz_EffMolWtBasicZ(FileXMin:FileXMax,FileYMin:FileYMax,FileZMin:FileZMax), &
! & gt_hist(8) )
end subroutine HistoryFile_Open