| Path: | main/dcpam_hs94.f90 |
| Last Update: | Tue Aug 12 18:50:30 +0900 2008 |
| Authors: | Yasuhiro MORIKAWA |
| Version: | $Id: dcpam_hs94.f90,v 1.3 2008-08-12 09:50:30 morikawa Exp $ |
| Tag Name: | $Name: dcpam5-20080812 $ |
| Copyright: | Copyright (C) GFD Dennou Club, 2008. All rights reserved. |
| License: | See COPYRIGHT |
| Main Program : |
Note that Japanese and English are described in parallel.
Held and Suarez (1994) ベンチマークテストを行ないます.
Held and Suarez (1994) benchmark test is performed.
program dcpam_hs94
!
! <b>Note that Japanese and English are described in parallel.</b>
!
! Held and Suarez (1994) ベンチマークテストを行ないます.
!
! Held and Suarez (1994) benchmark test is performed.
!
!== References
!
! * Held, I. M., Suarez, M. J., 1994:
! A proposal for the intercomparison of the dynamical cores of
! atmospheric general circuation models.
! <i>Bull. Am. Meteor. Soc.</i>, <b>75</b>, 1825--1830.
! モジュール引用 ; USE statements
!
! 力学過程 (スペクトル法, Arakawa and Suarez (1983))
! Dynamical process (Spectral method, Arakawa and Suarez (1983))
!
use dynamics_hspl_vas83, only: Dynamics
! Held and Suarez (1994) による強制と散逸
! Forcing and dissipation suggested by Held and Suarez (1994)
!
use held_suarez_1994, only: Hs94Forcing
! タイムフィルター (Asselin, 1972)
! Time filter (Asselin, 1972)
!
use timefilter_asselin1972, only: TimeFilter
! 時刻管理
! Time control
!
use timeset, only: TimesetProgress, Nstep ! ループ回数. Number of times of loops
! リスタートデータ入出力
! Restart data input/output
!
use restart_file_io, only: RestartFileOutPut
! ヒストリデータ出力
! History data output
!
use gt4_historyauto, only: HistoryAutoPut, HistoryAutoProgress
! 種別型パラメタ
! Kind type parameter
!
use dc_types, only: DP, STRING, TOKEN ! キーワード. Keywords.
! 宣言文 ; Declaration statements
!
implicit none
! 予報変数 (ステップ $ t-\Delta t $ , $ t $ , $ t+\Delta t $ )
! Prediction variables (Step $ t-\Delta t $ , $ t $ , $ t+\Delta t $ )
!
real(DP), allocatable:: xyz_UB (:,:,:)
! $ u (t-\Delta t) $ . 東西風速. Eastward wind
real(DP), allocatable:: xyz_VB (:,:,:)
! $ v (t-\Delta t) $ . 南北風速. Northward wind
real(DP), allocatable:: xyz_TempB (:,:,:)
! $ T (t-\Delta t) $ . 温度. Temperature
real(DP), allocatable:: xyz_QVapB (:,:,:)
! $ q (t-\Delta t) $ . 比湿. Specific humidity
real(DP), allocatable:: xy_PsB (:,:)
! $ p_s (t-\Delta t) $ . 地表面気圧. Surface pressure
real(DP), allocatable:: xyz_UN (:,:,:)
! $ u (t) $ . 東西風速. Eastward wind
real(DP), allocatable:: xyz_VN (:,:,:)
! $ v (t) $ . 南北風速. Northward wind
real(DP), allocatable:: xyz_TempN (:,:,:)
! $ T (t) $ . 温度. Temperature
real(DP), allocatable:: xyz_QVapN (:,:,:)
! $ q (t) $ . 比湿. Specific humidity
real(DP), allocatable:: xy_PsN (:,:)
! $ p_s (t) $ . 地表面気圧. Surface pressure
real(DP), allocatable:: xyz_UA (:,:,:)
! $ u (t+\Delta t) $ . 東西風速. Eastward wind
real(DP), allocatable:: xyz_VA (:,:,:)
! $ v (t+\Delta t) $ . 南北風速. Northward wind
real(DP), allocatable:: xyz_TempA (:,:,:)
! $ T (t+\Delta t) $ . 温度. Temperature
real(DP), allocatable:: xyz_QVapA (:,:,:)
! $ q (t+\Delta t) $ . 比湿. Specific humidity
real(DP), allocatable:: xy_PsA (:,:)
! $ p_s (t+\Delta t) $ . 地表面気圧. Surface pressure
! 診断変数
! Diagnostic variables
!
real(DP), allocatable:: xyz_DUDt (:,:,:)
! $ \DP{u}{t} $ . 東西風速変化.
! Eastward wind tendency
real(DP), allocatable:: xyz_DVDt (:,:,:)
! $ \DP{v}{t} $ . 南北風速変化.
! Northward wind tendency
real(DP), allocatable:: xyz_DTempDt (:,:,:)
! $ \DP{T}{t} $ . 温度変化.
! Temperature tendency
real(DP), allocatable:: xyz_DQVapDt (:,:,:)
! $ \DP{q}{t} $ . 比湿変化.
! Temperature tendency
! 作業変数
! Work variables
!
integer:: i ! 時間方向に回る DO ループ用作業変数.
! Work variables for DO loop in time
logical:: firstloop = .true.
! 初回のループであることを示すフラグ.
! Flag implying first loop
! 実行文 ; Executable statement
!
! 主プログラムの初期化 (内部サブルーチン)
! Initialization for the main program (Internal subroutine)
!
call MainInit
! 時間積分
! Time integration
!
do i = 1, Nstep
! Held and Suarez (1994) による強制と散逸
! Forcing and dissipation suggested by Held and Suarez (1994)
!
call Hs94Forcing( xyz_UB, xyz_VB, xyz_TempB, xy_PsB, xyz_DUDt, xyz_DVDt, xyz_DTempDt ) ! (out)
xyz_DQVapDt = 0.0_DP
! 力学過程
! Dynamical core
!
call Dynamics( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN, xyz_DUDt, xyz_DVDt, xyz_DTempDt, xyz_DQVapDt, xyz_UA, xyz_VA, xyz_TempA, xyz_QVapA, xy_PsA ) ! (out)
! 時間フィルター
! Time filter
!
call TimeFilter( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN, xyz_UA, xyz_VA, xyz_TempA, xyz_QVapA, xy_PsA ) ! (in)
! ヒストリデータ出力
! History data output
!
if ( .not. firstloop ) then
call HistoryAutoPut( 'U', xyz_UN )
call HistoryAutoPut( 'V', xyz_VN )
call HistoryAutoPut( 'Temp', xyz_TempN )
call HistoryAutoPut( 'QVap', xyz_QVapN )
call HistoryAutoPut( 'Ps', xy_PsN )
end if
! 予報変数の時刻付け替え
! Exchange time of prediction variables
!
xyz_UB = xyz_UN
xyz_UN = xyz_UA
xyz_UA = 0.0_DP
xyz_VB = xyz_VN
xyz_VN = xyz_VA
xyz_VA = 0.0_DP
xyz_TempB = xyz_TempN
xyz_TempN = xyz_TempA
xyz_TempA = 0.0_DP
xyz_QVapB = xyz_QVapN
xyz_QVapN = xyz_QVapA
xyz_QVapA = 0.0_DP
xy_PsB = xy_PsN
xy_PsN = xy_PsA
xy_PsA = 0.0_DP
! 時刻の進行
! Progress time
!
call TimesetProgress
call HistoryAutoProgress
! リスタートデータ出力
! Restart data output
!
if ( .not. firstloop ) then
call RestartFileOutput( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN ) ! (in)
end if
firstloop = .false.
end do
! 主プログラムの終了処理 (内部サブルーチン)
! Termination for the main program (Internal subroutine)
!
call MainTerminate
contains
subroutine MainInit
!
! 主プログラムの初期化手続き.
!
! Initialization procedure for the main program.
!
! コマンドライン引数処理
! Command line option parser
!
use option_parser, only: OptParseInit
! NAMELIST ファイル入力に関するユーティリティ
! Utilities for NAMELIST file input
!
use namelist_util, only: NmlutilInit
! 時刻管理
! Time control
!
use timeset, only: TimesetInit
! 出力ファイルの基本情報管理
! Management basic information for output files
!
use fileset, only: FilesetInit
! 格子点設定
! Grid points settings
!
use gridset, only: GridsetInit, imax, jmax, kmax ! 鉛直層数.
! Number of vertical level
! 物理定数設定
! Physical constants settings
!
use constants, only: ConstantsInit
! 座標データ設定
! Axes data settings
!
use axesset, only: AxessetInit
! リスタートデータ入出力
! Restart data input/output
!
use restart_file_io, only: RestartFileOpen, RestartFileGet
! ヒストリデータ出力
! History data output
!
use history_file_io, only: HistoryFileOpen
use gt4_historyauto, only: HistoryAutoAddVariable, HistoryAutoPut
! 文字列操作
! Character handling
!
use dc_string, only: StoA
! 実行文 ; Executable statement
!
! コマンドライン引数処理
! Command line option parser
!
call OptParseInit
! NAMELIST ファイル名入力
! Input NAMELIST file name
!
call NmlutilInit
! 時刻管理
! Time control
!
call TimesetInit
! 出力ファイルの基本情報管理
! Management basic information for output files
!
call FilesetInit
! 格子点設定
! Grid points settings
!
call GridsetInit
! 物理定数設定
! Physical constants settings
!
call ConstantsInit
! 座標データ設定
! Axes data settings
!
call AxessetInit
! 予報変数の割付
! Allocation of prediction variables
!
allocate( xyz_UB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_VB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_TempB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_QVapB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xy_PsB (0:imax-1, 1:jmax) )
allocate( xyz_UN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_VN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_TempN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_QVapN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xy_PsN (0:imax-1, 1:jmax) )
allocate( xyz_UA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_VA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_TempA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_QVapA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xy_PsA (0:imax-1, 1:jmax) )
! リスタートデータ入力
! Restart data input
!
call RestartFileGet( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN ) ! (out)
! リスタートデータ出力
! Restart data output
!
call RestartFileOpen
! リスタートファイルへ初期値データ出力
! Output initial data to a restart file
!
call RestartFileOutput( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN ) ! (in)
! ヒストリデータファイルの初期化
! Initialization of history data files
!
call HistoryFileOpen
! ヒストリデータ出力のためのへの変数登録
! Register of variables for history data output
!
call HistoryAutoAddVariable( 'U' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'eastward wind', 'm s-1' )
call HistoryAutoAddVariable( 'V' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'northwardward wind', 'm s-1' )
call HistoryAutoAddVariable( 'Temp' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'temperature', 'K' )
call HistoryAutoAddVariable( 'QVap' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'specific humidity', 'kg kg-1' )
call HistoryAutoAddVariable( 'Ps' , (/ 'lon ', 'lat ', 'time' /), 'surface pressure', 'Pa' )
! ヒストリデータ出力 (スタート時刻)
! History data output (Start time)
!
call HistoryAutoPut( 'U', xyz_UN )
call HistoryAutoPut( 'V', xyz_VN )
call HistoryAutoPut( 'Temp', xyz_TempN )
call HistoryAutoPut( 'QVap', xyz_QVapN )
call HistoryAutoPut( 'Ps', xy_PsN )
! 診断変数の割付
! Allocation of diagnostic variables
!
allocate( xyz_DUDt (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_DVDt (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_DTempDt (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_DQVapDt (0:imax-1, 1:jmax, 1:kmax) )
end subroutine MainInit
subroutine MainTerminate
!
! 主プログラムの終了処理手続き.
!
! Termination procedure for the main program.
!
! 時刻管理
! Time control
!
use timeset, only: TimesetClose
! リスタートデータ入出力
! Restart data input/output
!
use restart_file_io, only: RestartFileClose
! ヒストリデータ出力
! History data output
!
use history_file_io, only: HistoryFileClose
! 実行文 ; Executable statement
!
! リスタートデータファイルクローズ
! Close restart data input
!
call RestartFileClose
! ヒストリデータファイルクローズ
! Close history data input
!
call HistoryFileClose
! 時刻管理終了処理
! Termination of time control
!
call TimesetClose
end subroutine MainTerminate
end program dcpam_hs94
| Subroutine : |
主プログラムの初期化手続き.
Initialization procedure for the main program.
subroutine MainInit
!
! 主プログラムの初期化手続き.
!
! Initialization procedure for the main program.
!
! コマンドライン引数処理
! Command line option parser
!
use option_parser, only: OptParseInit
! NAMELIST ファイル入力に関するユーティリティ
! Utilities for NAMELIST file input
!
use namelist_util, only: NmlutilInit
! 時刻管理
! Time control
!
use timeset, only: TimesetInit
! 出力ファイルの基本情報管理
! Management basic information for output files
!
use fileset, only: FilesetInit
! 格子点設定
! Grid points settings
!
use gridset, only: GridsetInit, imax, jmax, kmax ! 鉛直層数.
! Number of vertical level
! 物理定数設定
! Physical constants settings
!
use constants, only: ConstantsInit
! 座標データ設定
! Axes data settings
!
use axesset, only: AxessetInit
! リスタートデータ入出力
! Restart data input/output
!
use restart_file_io, only: RestartFileOpen, RestartFileGet
! ヒストリデータ出力
! History data output
!
use history_file_io, only: HistoryFileOpen
use gt4_historyauto, only: HistoryAutoAddVariable, HistoryAutoPut
! 文字列操作
! Character handling
!
use dc_string, only: StoA
! 実行文 ; Executable statement
!
! コマンドライン引数処理
! Command line option parser
!
call OptParseInit
! NAMELIST ファイル名入力
! Input NAMELIST file name
!
call NmlutilInit
! 時刻管理
! Time control
!
call TimesetInit
! 出力ファイルの基本情報管理
! Management basic information for output files
!
call FilesetInit
! 格子点設定
! Grid points settings
!
call GridsetInit
! 物理定数設定
! Physical constants settings
!
call ConstantsInit
! 座標データ設定
! Axes data settings
!
call AxessetInit
! 予報変数の割付
! Allocation of prediction variables
!
allocate( xyz_UB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_VB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_TempB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_QVapB (0:imax-1, 1:jmax, 1:kmax) )
allocate( xy_PsB (0:imax-1, 1:jmax) )
allocate( xyz_UN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_VN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_TempN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_QVapN (0:imax-1, 1:jmax, 1:kmax) )
allocate( xy_PsN (0:imax-1, 1:jmax) )
allocate( xyz_UA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_VA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_TempA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_QVapA (0:imax-1, 1:jmax, 1:kmax) )
allocate( xy_PsA (0:imax-1, 1:jmax) )
! リスタートデータ入力
! Restart data input
!
call RestartFileGet( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN ) ! (out)
! リスタートデータ出力
! Restart data output
!
call RestartFileOpen
! リスタートファイルへ初期値データ出力
! Output initial data to a restart file
!
call RestartFileOutput( xyz_UB, xyz_VB, xyz_TempB, xyz_QVapB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyz_QVapN, xy_PsN ) ! (in)
! ヒストリデータファイルの初期化
! Initialization of history data files
!
call HistoryFileOpen
! ヒストリデータ出力のためのへの変数登録
! Register of variables for history data output
!
call HistoryAutoAddVariable( 'U' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'eastward wind', 'm s-1' )
call HistoryAutoAddVariable( 'V' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'northwardward wind', 'm s-1' )
call HistoryAutoAddVariable( 'Temp' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'temperature', 'K' )
call HistoryAutoAddVariable( 'QVap' , (/ 'lon ', 'lat ', 'sig ', 'time' /), 'specific humidity', 'kg kg-1' )
call HistoryAutoAddVariable( 'Ps' , (/ 'lon ', 'lat ', 'time' /), 'surface pressure', 'Pa' )
! ヒストリデータ出力 (スタート時刻)
! History data output (Start time)
!
call HistoryAutoPut( 'U', xyz_UN )
call HistoryAutoPut( 'V', xyz_VN )
call HistoryAutoPut( 'Temp', xyz_TempN )
call HistoryAutoPut( 'QVap', xyz_QVapN )
call HistoryAutoPut( 'Ps', xy_PsN )
! 診断変数の割付
! Allocation of diagnostic variables
!
allocate( xyz_DUDt (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_DVDt (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_DTempDt (0:imax-1, 1:jmax, 1:kmax) )
allocate( xyz_DQVapDt (0:imax-1, 1:jmax, 1:kmax) )
end subroutine MainInit
| Subroutine : |
主プログラムの終了処理手続き.
Termination procedure for the main program.
subroutine MainTerminate
!
! 主プログラムの終了処理手続き.
!
! Termination procedure for the main program.
!
! 時刻管理
! Time control
!
use timeset, only: TimesetClose
! リスタートデータ入出力
! Restart data input/output
!
use restart_file_io, only: RestartFileClose
! ヒストリデータ出力
! History data output
!
use history_file_io, only: HistoryFileClose
! 実行文 ; Executable statement
!
! リスタートデータファイルクローズ
! Close restart data input
!
call RestartFileClose
! ヒストリデータファイルクローズ
! Close history data input
!
call HistoryFileClose
! 時刻管理終了処理
! Termination of time control
!
call TimesetClose
end subroutine MainTerminate