| Class | dynamics_hspl_vas83 |
| In: |
dynamics/dynamics_hspl_vas83.F90
|
Note that Japanese and English are described in parallel.
力学過程を演算するモジュールです. 水平離散化にスペクトル法 (Bourke, 1988) を, 鉛直離散化には Arakawa and Suarez (1983) を用いています.
時間積分法にはリープフロッグスキームを用いています. デフォルトでは, $ Delta t $ を大きくとるために, 重力波項に セミインプリシット法を適用しています. NAMELIST#dynamics_hspl_vas83_nml の TimeIntegScheme を変更することで, 重力波項をエクスプリシット法によって解くことも可能です.
This is a dynamical core module. Spectral method (Bourke, 1988) (for horizontal) and Arakawa and Suarez (1983) method (for vertical) are used.
Leap-frog scheme is used as time integration. By default, semi-implicit scheme is applied to gravitational terms for extension of $ Delta t $ . Explicit scheme can be applied to gravitational terms by changing "TimeIntegScheme" in "NAMELIST#dynamics_hspl_vas83_nml".
| Dynamics : | 力学計算 |
| DynamicsFinalize : | 終了処理 (モジュール内部の変数の割り付け解除) |
| ———— : | ———— |
| Dynamics : | Calculate dynamics |
| DynamicsFinalize : | Termination (deallocate variables in this module) |
NAMELIST#dynamics_hspl_vas83_nml
| Subroutine : | |||
| xyz_UB(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_VB(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_TempB(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyzf_QMixB(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| xy_PsB(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
| xyz_UN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_VN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_TempN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyzf_QMixN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| xy_PsN(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
| xyz_DUDtPhy(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_DVDtPhy(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_DTempDtPhy(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyzf_DQMixDtPhy(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| xy_SurfHeight(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
| xyz_UA(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyz_VA(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyz_TempA(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyzf_QMixA(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(out)
| ||
| xy_PsA(0:imax-1, 1:jmax) : | real(DP), intent(out)
|
力学過程の演算を行い, 与えられた $ t-\Delta t $ および $ t $ の 東西風速 (xyz_UB, xyz_UN), 南北風速 (xyz_VB, xyz_VN), 温度 (xyz_TempB, xyz_TempN), 質量混合比 (xyzf_QMixB, xyzf_QMixN), 地表面気圧 (xyz_PsB, xyz_PsN), および地表面高度 (xy_SurfHeight) から, $ t+Delta t $ の 東西風速 (xyz_UA), 南北風速 (xyz_VA), 温度 (xyz_TempA), 質量混合比 (xyzf_QMixA), 地表面気圧 (xyz_PsA) を返します.
別の物理プロセスによる渦度, 発散, 温度, 比湿の変化を, 力学過程の変化に足して次のステップを計算する場合には, それらの変化を xyz_DUDtPhy, xyz_DVDtPhy, xyz_DTempDtPhy, xyzf_DQMixDtPhy に与えてください.
時間積分法にはリープフロッグスキームを用いています. デフォルトでは, $ Delta t $ を大きくとるために, 重力波項に セミインプリシット法を適用しています. NAMELIST#dynamics_hspl_vas83_nml の TimeIntegScheme を変更することで, 重力波項をエクスプリシット法によって解くことも可能です.
Calculate dynamical processes. Eastward wind (xyz_UB, xyz_UN), northward wind (xyz_VB, xyz_VN), temperature (xyz_TempB, xyz_TempN), mass mixing ratio (xyzf_QMixB, xyzf_QMixN), surface pressure (xyz_PsB, xyz_PsN) at $ t-\Delta t $ and $ t $, and surface height (xy_SurfHeight) are input, and eastward wind (xyz_UA), northward wind (xyz_VA), temperature (xyz_TempA), mass mixing ratio (xyzf_QMixA), surface pressure (xyz_PsA) are returned.
In order to add tendencies of vorticity, divergence, temperature and specific humidity by another physical process to tendencies of this dynamical process and to calculate the values at next time step, give these tendencies to "xyz_DUDtPhy", "xyz_DVDtPhy", "xyz_DTempDtPhy", "xyzf_DQMixDtPhy"
Leap-frog scheme is used as time integration. By default, semi-implicit scheme is applied to gravitational terms for extension of $ Delta t $ . Explicit scheme can be applied to gravitational terms by changing "TimeIntegScheme" in "NAMELIST#dynamics_hspl_vas83_nml".
subroutine Dynamics( xyz_UB, xyz_VB, xyz_TempB, xyzf_QMixB, xy_PsB, xyz_UN, xyz_VN, xyz_TempN, xyzf_QMixN, xy_PsN, xyz_DUDtPhy, xyz_DVDtPhy, xyz_DTempDtPhy, xyzf_DQMixDtPhy, xy_SurfHeight, xyz_UA, xyz_VA, xyz_TempA, xyzf_QMixA, xy_PsA )
!
! 力学過程の演算を行い, 与えられた $ t-\Delta t $ および $ t $ の
! 東西風速 (xyz_UB, xyz_UN), 南北風速 (xyz_VB, xyz_VN),
! 温度 (xyz_TempB, xyz_TempN), 質量混合比 (xyzf_QMixB, xyzf_QMixN),
! 地表面気圧 (xyz_PsB, xyz_PsN), および地表面高度 (xy_SurfHeight) から,
! $ t+\Delta t $ の
! 東西風速 (xyz_UA), 南北風速 (xyz_VA), 温度 (xyz_TempA),
! 質量混合比 (xyzf_QMixA), 地表面気圧 (xyz_PsA) を返します.
!
! 別の物理プロセスによる渦度, 発散, 温度, 比湿の変化を,
! 力学過程の変化に足して次のステップを計算する場合には,
! それらの変化を xyz_DUDtPhy, xyz_DVDtPhy, xyz_DTempDtPhy, xyzf_DQMixDtPhy
! に与えてください.
!
! 時間積分法にはリープフロッグスキームを用いています.
! デフォルトでは, $ \Delta t $ を大きくとるために, 重力波項に
! セミインプリシット法を適用しています.
! NAMELIST#dynamics_hspl_vas83_nml の TimeIntegScheme を変更することで,
! 重力波項をエクスプリシット法によって解くことも可能です.
!
! Calculate dynamical processes.
! Eastward wind (xyz_UB, xyz_UN),
! northward wind (xyz_VB, xyz_VN),
! temperature (xyz_TempB, xyz_TempN),
! mass mixing ratio (xyzf_QMixB, xyzf_QMixN),
! surface pressure (xyz_PsB, xyz_PsN) at $ t-\Delta t $ and $ t $,
! and surface height (xy_SurfHeight) are input,
! and
! eastward wind (xyz_UA), northward wind (xyz_VA),
! temperature (xyz_TempA),
! mass mixing ratio (xyzf_QMixA), surface pressure (xyz_PsA)
! are returned.
!
! In order to add tendencies of vorticity, divergence,
! temperature and specific humidity by another physical process to
! tendencies of this dynamical process
! and to calculate the values at next time step,
! give these tendencies to
! "xyz_DUDtPhy", "xyz_DVDtPhy", "xyz_DTempDtPhy", "xyzf_DQMixDtPhy"
!
! Leap-frog scheme is used as time integration.
! By default, semi-implicit scheme is applied to gravitational terms
! for extension of $ \Delta t $ .
! Explicit scheme can be applied to gravitational terms by changing
! "TimeIntegScheme" in "NAMELIST#dynamics_hspl_vas83_nml".
!
! モジュール引用 ; USE statements
!
use constants, only: RPlanet, CpDry, Grav
! $ g $ [m s-2].
! 重力加速度.
! Gravitational acceleration
! 格子点設定
! Grid points settings
!
use gridset, only: imax, jmax, kmax ! 鉛直層数.
! Number of vertical level
! 時刻管理
! Time control
!
use timeset, only: DelTime, TimeN, TimesetClockStart, TimesetClockStop
#ifdef LIB_MPI
! MPI 版 SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library MPI version, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_mpi_module, only: wa_Lapla_wa, w_Lapla_w, wa_LaplaInv_wa, wa_DivLambda_xya => wa_DivLambda_xva, wa_DivMu_xya => wa_DivMu_xva, xy_GradLambda_w => xv_GradLambda_w, xya_GradLambda_wa => xva_GradLambda_wa, xy_GradMu_w => xv_GradMu_w, xya_GradMu_wa => xva_GradMu_wa, w_xy => w_xv, xy_w => xv_w, wa_xya => wa_xva, xya_wa => xva_wa
#else
! SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_module, only: wa_Lapla_wa, w_Lapla_w, wa_LaplaInv_wa, wa_DivLambda_xya, wa_DivMu_xya, xy_GradLambda_w, xya_GradLambda_wa, xy_GradMu_w, xya_GradMu_wa, w_xy, xy_w, wa_xya, xya_wa
#endif
! ヒストリデータ出力
! History data output
!
use gtool_historyauto, only: HistoryAutoPut
! 文字列操作
! Character handling
!
use dc_string, only: LChar
! 種別型パラメタ
! Kind type parameter
!
use dc_types, only: DP ! 倍精度実数型. Double precision.
! 宣言文 ; Declaration statements
!
implicit none
real(DP), intent(in):: xyz_UB (0:imax-1, 1:jmax, 1:kmax)
! $ u (t-\Delta t) $ . 東西風速. Eastward wind
real(DP), intent(in):: xyz_VB (0:imax-1, 1:jmax, 1:kmax)
! $ v (t-\Delta t) $ . 南北風速. Northward wind
real(DP), intent(in):: xyz_TempB (0:imax-1, 1:jmax, 1:kmax)
! $ T (t-\Delta t) $ . 温度. Temperature
real(DP), intent(in):: xyzf_QMixB(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ q (t-\Delta t) $ . 比湿. Specific humidity
real(DP), intent(in):: xy_PsB (0:imax-1, 1:jmax)
! $ p_s (t-\Delta t) $ . 地表面気圧. Surface pressure
real(DP), intent(in):: xyz_UN (0:imax-1, 1:jmax, 1:kmax)
! $ u (t) $ . 東西風速. Eastward wind
real(DP), intent(in):: xyz_VN (0:imax-1, 1:jmax, 1:kmax)
! $ v (t) $ . 南北風速. Northward wind
real(DP), intent(in):: xyz_TempN (0:imax-1, 1:jmax, 1:kmax)
! $ T (t) $ . 温度. Temperature
real(DP), intent(in):: xyzf_QMixN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ q (t) $ . 比湿. Specific humidity
real(DP), intent(in):: xy_PsN (0:imax-1, 1:jmax)
! $ p_s (t) $ . 地表面気圧. Surface pressure
real(DP), intent(in):: xyz_DUDtPhy (0:imax-1, 1:jmax, 1:kmax)
! $ \left(\DP{u}{t}\right)^{phy} $ .
! 外力項 (物理過程) による東西風速変化.
! Eastward wind tendency by external force terms (physical processes)
real(DP), intent(in):: xyz_DVDtPhy (0:imax-1, 1:jmax, 1:kmax)
! $ \left(\DP{v}{t}\right)^{phy} $ .
! 外力項 (物理過程) による南北風速変化.
! Northward wind tendency by external force terms (physical processes)
real(DP), intent(in):: xyz_DTempDtPhy (0:imax-1, 1:jmax, 1:kmax)
! $ \left(\DP{T}{t}\right)^{phy} $ .
! 外力項 (物理過程) による温度変化.
! Temperature tendency by external force terms (physical processes)
real(DP), intent(in):: xyzf_DQMixDtPhy(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ \left(\DP{q}{t}\right)^{phy} $ .
! 外力項 (物理過程) による比湿変化.
! Temperature tendency by external force terms (physical processes)
real(DP), intent(in):: xy_SurfHeight (0:imax-1, 1:jmax)
! $ z_s $ . 地表面高度.
! Surface height.
real(DP), intent(out):: xyz_UA (0:imax-1, 1:jmax, 1:kmax)
! $ u (t+\Delta t) $ . 東西風速. Eastward wind
real(DP), intent(out):: xyz_VA (0:imax-1, 1:jmax, 1:kmax)
! $ v (t+\Delta t) $ . 南北風速. Northward wind
real(DP), intent(out):: xyz_TempA (0:imax-1, 1:jmax, 1:kmax)
! $ T (t+\Delta t) $ . 温度. Temperature
real(DP), intent(out):: xyzf_QMixA(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ q (t+\Delta t) $ . 比湿. Specific humidity
real(DP), intent(out):: xy_PsA (0:imax-1, 1:jmax)
! $ p_s (t+\Delta t) $ . 地表面気圧. Surface pressure
! 作業変数
! Work variables
!
real(DP):: xyz_UCosLatN (0:imax-1, 1:jmax, 1:kmax)
! $ U (t) = u (t) \times \cos \varphi $ .
real(DP):: xyz_VCosLatN (0:imax-1, 1:jmax, 1:kmax)
! $ V (t) = v (t) \times \cos \varphi $ .
real(DP):: xyz_VorN (0:imax-1, 1:jmax, 1:kmax)
! $ \zeta (t) $ . 渦度. Vorticity
real(DP):: xyz_DivN (0:imax-1, 1:jmax, 1:kmax)
! $ D (t) $ . 発散. Divergence
real(DP):: xy_PiN (0:imax-1, 1:jmax)
! $ \pi = \ln p_s $
real(DP):: wz_DivN ((nmax+1)**2, 1:kmax)
! $ D (t) $ . 発散 (スペクトル).
! Divergence (spectral)
real(DP):: wz_TempN ((nmax+1)**2, 1:kmax)
! $ T (t) $ . 温度 (スペクトル).
! Temperature (spectral)
real(DP):: w_PiN ((nmax+1)**2)
! $ \pi $ スペクトル
real(DP):: xy_GradLambdaPiN (0:imax-1, 1:jmax)
! $ \DP{\pi}{\lambda} $
real(DP):: xy_GradMuPiN (0:imax-1, 1:jmax)
! $ (1-\mu^2) \DP{\pi}{\mu} $
real(DP):: xyz_UAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ U_A (t) $ . 東西運動量移流項.
! Eastward advection of momentum
real(DP):: xyz_VAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ V_A (t) $ . 南北運動量移流項.
! Northward advection of momentum
real(DP):: xyz_TempNonLinearN (0:imax-1, 1:jmax, 1:kmax)
! $ H (t) $ . 温度時間変化項.
! Temperature tendency
real(DP):: xyzf_QMixNonLinearN (0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ R (t) $ . 比湿時間変化項.
! Specific humidity tendency
real(DP):: xyz_KinEngyN (0:imax-1, 1:jmax, 1:kmax)
! $ KE (t) $ . 運動エネルギー項.
! Kinetic energy
real(DP):: xyz_TempUAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ UT' (t) $ . 温度東西移流項.
! Eastward advection of temperature
real(DP):: xyz_TempVAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ VT' (t) $ . 温度南北移流項.
! Northward advection of temperature
real(DP):: xyr_SigDotN (0:imax-1, 1:jmax, 0:kmax)
! $ \dot{\sigma} $ .
! 鉛直流. Vertical flow
real(DP):: xy_DPiDtNG (0:imax-1, 1:jmax)
! $ Z $ . 地表面気圧時間変化非重力波項.
! Non-gravity wave component of surface pressure tendency
real(DP):: xyzf_QMixUAdvN (0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ Uq (t) $ . 比湿東西移流項.
! Eastward advection of specific humidity
real(DP):: xyzf_QMixVAdvN (0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ Vq (t) $ . 比湿南北移流項.
! Northward advection of specific humidity
real(DP):: wz_DVorDtNG ((nmax+1)**2, 1:kmax)
! $ \left( \DD{\zeta}{t} (t) \right)^{NG}$ . 渦度変化の非重力波成分 (スペクトル).
! Non-gravity wave component of vorticity tendency (spectral)
real(DP):: wz_DDivDtNG ((nmax+1)**2, 1:kmax)
! $ \left( \DD{D}{t} (t) \right)^{NG}$ . 発散変化の非重力波成分 (スペクトル).
! Non-gravity wave component of divergence tendency (spectral)
real(DP):: wz_DTempDtNG ((nmax+1)**2, 1:kmax)
! $ \left( \DD{T}{t} (t) \right)^{NG}$ . 温度変化の非重力波成分 (スペクトル).
! Non-gravity wave component of temperature tendency (spectral)
real(DP):: wzf_DQMixDtN((nmax+1)**2, 1:kmax, 1:ncmax)
! $ \DD{q}{t} (t) $ . 比湿変化 (スペクトル).
! Specific humidity tendency (spectral)
real(DP):: w_DPiDtNG((nmax+1)**2)
! $ \left( \DD{p_s}{t} (t) \right)^{NG}$ . 地表面気圧変化費重力波項 (スペクトル).
! Non-gravity wave component of surface pressure tendency (spectral)
real(DP):: xyz_UCosLatB (0:imax-1, 1:jmax, 1:kmax)
! $ U (t-\Delta t) = u (t-\Delta t) \times \cos \varphi $ .
real(DP):: xyz_VCosLatB (0:imax-1, 1:jmax, 1:kmax)
! $ V (t-\Delta t) = v (t-\Delta t) \times \cos \varphi $ .
real(DP):: wz_VorB ((nmax+1)**2, 1:kmax)
! $ \zeta (t-\Delta t) $ . 渦度 (スペクトル).
! Vorticity (spectral)
real(DP):: wz_DivB ((nmax+1)**2, 1:kmax)
! $ D (t-\Delta t) $ . 発散 (スペクトル).
! Divergence (spectral)
real(DP):: wz_TempB ((nmax+1)**2, 1:kmax)
! $ T (t-\Delta t) $ . 温度 (スペクトル).
! Temperature (spectral)
real(DP):: w_PiB ((nmax+1)**2)
! $ \pi = \ln p_s (t-\Delta t) $ . 地表面気圧 (スペクトル).
! Surface pressure (spectral)
real(DP):: wzf_QMixB((nmax+1)**2, 1:kmax, 1:ncmax)
! $ q (t-\Delta t) $ . 比湿 (スペクトル).
! Specific humidity (spectral)
real(DP):: xyz_DUDtPhyCosLat (0:imax-1, 1:jmax, 1:kmax)
! $ \left(\DP{u}{t}\right)^{phy} \times \cos \varphi $ .
real(DP):: xyz_DVDtPhyCosLat (0:imax-1, 1:jmax, 1:kmax)
! $ \left(\DP{v}{t}\right)^{phy} \times \cos \varphi $ .
real(DP):: wz_VorA ((nmax+1)**2, 1:kmax)
! $ \zeta (t+\Delta t) $ . 渦度 (スペクトル).
! Vorticity (spectral)
real(DP):: wz_DivA ((nmax+1)**2, 1:kmax)
! $ D (t+\Delta t) $ . 発散 (スペクトル).
! Divergence (spectral)
real(DP):: wz_TempA ((nmax+1)**2, 1:kmax)
! $ T (t+\Delta t) $ . 温度 (スペクトル).
! Temperature (spectral)
real(DP):: w_PiA ((nmax+1)**2)
! $ \pi = \ln p_s (t+\Delta t) $ . 地表面気圧 (スペクトル).
! Surface pressure (spectral)
real(DP):: wzf_QMixA((nmax+1)**2, 1:kmax, 1:ncmax)
! $ q (t+\Delta t) $ . 比湿 (スペクトル).
! Specific humidity (spectral)
real(DP):: wz_Psi ((nmax+1)**2, 1:kmax)
! $ \psi $ . 流線関数. Streamline function
real(DP):: wz_Chi ((nmax+1)**2, 1:kmax)
! $ \chi $ . ポテンシャル. Potential
real(DP):: xyz_UCosLatA (0:imax-1, 1:jmax, 1:kmax)
! $ U (t+\Delta t) = u (t+\Delta t) \times \cos \varphi $ .
real(DP):: xyz_VCosLatA (0:imax-1, 1:jmax, 1:kmax)
! $ V (t+\Delta t) = v (t+\Delta t) \times \cos \varphi $ .
real(DP):: wz_VorDiffA ((nmax+1)**2, 1:kmax)
! $ \mathscr{D}(\zeta) $ .
! 運動量水平拡散による渦度変化 (スペクトル).
! Vorticity tendency by
! horizontal momentum diffusion (spectral)
real(DP):: wz_DivDiffA ((nmax+1)**2, 1:kmax)
! $ \mathscr{D}(D) $ .
! 運動量水平拡散による発散変化 (スペクトル).
! Divergence tendency by
! horizontal momentum diffusion (spectral)
real(DP):: wz_PsiDiff ((nmax+1)**2, 1:kmax)
! 運動量水平拡散による流線関数 $ \psi $ 変化
! Streamline function tendency by
! horizontal momentum diffusion
real(DP):: wz_ChiDiff ((nmax+1)**2, 1:kmax)
! 運動量水平拡散によるポテンシャル $ \chi $ 変化
! Potential tendency by
! horizontal momentum diffusion
real(DP):: xyz_UDiff (0:imax-1, 1:jmax, 1:kmax)
! 運動量水平拡散による東西風変化.
! Eastward wind tendency by
! horizontal momentum diffusion
real(DP):: xyz_VDiff (0:imax-1, 1:jmax, 1:kmax)
! 運動量水平拡散による南北風変化.
! Northward wind tendency by
! horizontal momentum diffusion
! 地表面高度関連
! Surface height etc.
!
real(DP):: w_SurfGeoPot ((nmax+1)**2)
! $ \Phi_s $ . 地表ジオポテンシャル.
! Surface geo-potential
integer:: k ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
integer:: n ! 組成方向に回る DO ループ用作業変数
! Work variables for DO loop in dimension of constituents
! 実行文 ; Executable statement
!
! 計算時間計測開始
! Start measurement of computation time
!
call TimesetClockStart( module_name )
! 初期化
! Initialization
!
if ( .not. dynamics_hspl_vas83_inited ) call DynamicsInit
! TimeIntegration で使用する係数の設定
! Configure coefficients for "TimeIntegration"
!
call SemiImplMatrix
! 地表面気圧の空間変化項の計算
! Calculate spatial surface pressure tendency
!
xy_PiN = log( xy_PsN )
w_PiN = w_xy( xy_PiN )
xy_GradLambdaPiN = xy_GradLambda_w( w_PiN ) / RPlanet
xy_GradMuPiN = xy_GradMu_w ( w_PiN ) / RPlanet
! 風速から渦度発散の計算
! Calculate vorticity and divergence from wind velocity
!
do k = 1, kmax
xyz_UCosLatN(:,:,k) = xyz_UN(:,:,k) * xy_CosLat
xyz_VCosLatN(:,:,k) = xyz_VN(:,:,k) * xy_CosLat
end do
xyz_VorN = xya_wa( wa_DivLambda_xya( xyz_VCosLatN ) - wa_DivMu_xya ( xyz_UCosLatN ) ) / RPlanet
wz_DivN = ( wa_DivLambda_xya( xyz_UCosLatN ) + wa_DivMu_xya ( xyz_VCosLatN ) ) / RPlanet
xyz_DivN = xya_wa( wz_DivN )
select case ( IDTimeIntegScheme )
case ( IDTimeIntegSchemeExplicit )
wz_TempN = wa_xya( xyz_TempN )
end select
! 格子点上での非線形力学項の計算
! Calculate non-linear dynamical terms on grid points
!
call NonLinearOnGrid( xyz_UN, xyz_VN, xyz_VorN, xyz_DivN, xyz_TempN, xyzf_QMixN, xy_GradLambdaPiN, xy_GradMuPiN, xyz_UAdvN, xyz_VAdvN, xyz_TempNonLinearN, xyzf_QMixNonLinearN, xyz_KinEngyN, xyz_TempUAdvN, xyz_TempVAdvN, xyr_SigDotN, xy_DPiDtNG, xyzf_QMixUAdvN, xyzf_QMixVAdvN )
! スペクトル時間変化項の計算
! Calculate spectral tendency terms
!
! 渦度の時間変化 (スペクトル) の計算
! Calculate vorticity tendency (spectral)
!
wz_DVorDtNG = ( wa_DivLambda_xya( xyz_VAdvN ) - wa_DivMu_xya ( xyz_UAdvN ) ) / RPlanet
! 発散の時間変化 (スペクトル) の計算
! Calculate divergence tendency (spectral)
!
wz_DDivDtNG = ( wa_DivLambda_xya( xyz_UAdvN ) + wa_DivMu_xya ( xyz_VAdvN ) ) / RPlanet - wa_Lapla_wa( wa_xya(xyz_KinEngyN) ) / RPlanet**2
! 温度の時間変化の非重力波成分 (スペクトル) の計算
! Calculate non-gravity wave component of temperature tendency (spectral)
!
wz_DTempDtNG = - ( wa_DivLambda_xya( xyz_TempUAdvN ) + wa_DivMu_xya ( xyz_TempVAdvN ) ) / RPlanet + wa_xya( xyz_TempNonLinearN )
! 地表面気圧の時間変化の非重力波項 (スペクトル) の計算
! Calculate non-gravity wave component of surface pressure tendency (spectral)
!
w_DPiDtNG = w_xy( xy_DPiDtNG )
! 比湿の時間変化 (スペクトル) の計算
! Calculate specific humidity tendency (spectral)
!
do n = 1, ncmax
wzf_DQMixDtN(:,:,n) = - ( wa_DivLambda_xya( xyzf_QMixUAdvN(:,:,:,n) ) + wa_DivMu_xya ( xyzf_QMixVAdvN(:,:,:,n) ) ) / RPlanet + wa_xya( xyzf_QMixNonLinearN(:,:,:,n) )
end do
! 地表ジオポテンシャルの計算
! Calculate surface geo-potential
!
w_SurfGeoPot = w_xy( Grav * xy_SurfHeight )
! 格子点値をスペクトル値へ ( $ t-\Delta t$ )
! Exchange grid values to spectral values ( $ t-\Delta t$ )
!
do k = 1, kmax
xyz_UCosLatB(:,:,k) = xyz_UB(:,:,k) * xy_CosLat
xyz_VCosLatB(:,:,k) = xyz_VB(:,:,k) * xy_CosLat
end do
wz_VorB = ( wa_DivLambda_xya( xyz_VCosLatB ) - wa_DivMu_xya ( xyz_UCosLatB ) ) / RPlanet
wz_DivB = ( wa_DivLambda_xya( xyz_UCosLatB ) + wa_DivMu_xya ( xyz_VCosLatB ) ) / RPlanet
wz_TempB = wa_xya( xyz_TempB )
do n = 1, ncmax
wzf_QMixB(:,:,n) = wa_xya( xyzf_QMixB(:,:,:,n) )
end do
w_PiB = w_xy( log( xy_PsB ) )
! 物理過程による時間変化格子データをスペクトルデータへ変換し,
! 非線形力学項のスペクトル時間変化に加算.
! Convert tendency data on grid by physical processes into spectral data,
! and Add them to spectral tencencies of nonlinear terms.
!
do k = 1, kmax
xyz_DUDtPhyCosLat(:,:,k) = xyz_DUDtPhy(:,:,k) * xy_CosLat
xyz_DVDtPhyCosLat(:,:,k) = xyz_DVDtPhy(:,:,k) * xy_CosLat
end do
wz_DVorDtNG = wz_DVorDtNG + ( wa_DivLambda_xya( xyz_DVDtPhyCosLat ) - wa_DivMu_xya ( xyz_DUDtPhyCosLat ) ) / RPlanet
wz_DDivDtNG = wz_DDivDtNG + ( wa_DivLambda_xya( xyz_DUDtPhyCosLat ) + wa_DivMu_xya ( xyz_DVDtPhyCosLat ) ) / RPlanet
wz_DTempDtNG = wz_DTempDtNG + wa_xya( xyz_DTempDtPhy )
do n = 1, ncmax
wzf_DQMixDtN(:,:,n) = wzf_DQMixDtN(:,:,n) + wa_xya( xyzf_DQMixDtPhy(:,:,:,n) )
end do
! 時間積分
! Time integration
!
call TimeIntegration( w_SurfGeoPot, wz_DVorDtNG, wz_DDivDtNG, wz_DTempDtNG, wzf_DQMixDtN, w_DPiDtNG, wz_DivN, wz_TempN, w_PiN, wz_VorB, wz_DivB, wz_TempB, wzf_QMixB, w_PiB, wz_VorA, wz_DivA, wz_TempA, wzf_QMixA, w_PiA )
! スペクトル値を格子点値へ ( $ t+\Delta t$ )
! Exchange spectral values to grid values ( $ t+\Delta t$ )
!
wz_Psi = wa_LaplaInv_wa( wz_VorA ) * RPlanet**2
wz_Chi = wa_LaplaInv_wa( wz_DivA ) * RPlanet**2
xyz_UCosLatA = ( xya_GradLambda_wa( wz_Chi ) - xya_GradMu_wa ( wz_Psi ) ) / RPlanet
xyz_VCosLatA = ( xya_GradLambda_wa( wz_Psi ) + xya_GradMu_wa ( wz_Chi ) ) / RPlanet
do k = 1, kmax
xyz_UA(:,:,k) = xyz_UCosLatA(:,:,k) / xy_CosLat
xyz_VA(:,:,k) = xyz_VCosLatA(:,:,k) / xy_CosLat
end do
xyz_TempA = xya_wa( wz_TempA )
do n = 1, ncmax
xyzf_QMixA(:,:,:,n) = xya_wa( wzf_QMixA(:,:,n) )
end do
xy_PsA = exp( xy_w( w_PiA ) )
! 水平拡散とスポンジ層による散逸の補正
! Correction for dissipation of kinetic enery by horizontal diffusion and sponge
! layer
!
! 水平拡散とスポンジ層による渦度発散の時間変化
! Vorticity and divergence tendency by horizontal diffusion and damping in a sponge
! layer
!
wz_VorDiffA = wz_VorA * wz_DisCoefM
wz_DivDiffA = wz_DivA * wz_DisCoefM
! 水平拡散とスポンジ層による散逸の摩擦熱補正
! Correction for internal energy by horizontal diffusion and damping in a sponge
! layer
!
wz_PsiDiff = wa_LaplaInv_wa( wz_VorDiffA ) * RPlanet**2
wz_ChiDiff = wa_LaplaInv_wa( wz_DivDiffA ) * RPlanet**2
xyz_UDiff = ( xya_GradLambda_wa( wz_ChiDiff ) - xya_GradMu_wa ( wz_PsiDiff ) ) / RPlanet
xyz_VDiff = ( xya_GradLambda_wa( wz_PsiDiff ) + xya_GradMu_wa ( wz_ChiDiff ) ) / RPlanet
do k = 1, kmax
xyz_TempA(:,:,k) = xyz_TempA(:,:,k) - ( xyz_UA(:,:,k) * xyz_UDiff(:,:,k) + xyz_VA(:,:,k) * xyz_VDiff(:,:,k) ) / xy_CosLat / CpDry * 2. * DelTime
end do
! ヒストリデータ出力
! History data output
!
call DiagOutput( xyz_UN, xyz_VN, xyz_TempN, xyzf_QMixN, xy_PsN, xyr_SigDotN, xy_DPiDtNG ) ! (in)
! 計算時間計測一時停止
! Pause measurement of computation time
!
call TimesetClockStop( module_name )
end subroutine Dynamics
| Subroutine : |
モジュール内部の変数の割り付け解除を行います.
Deallocate variables in this module.
subroutine DynamicsFinalize
!
! モジュール内部の変数の割り付け解除を行います.
!
! Deallocate variables in this module.
!
! 宣言文 ; Declaration statements
!
implicit none
! 実行文 ; Executable statement
!
if ( .not. dynamics_hspl_vas83_inited ) return
! デフォルト値へ戻す
! Return to default values
!
DelTimeSave = - 1.
! 割り付け解除
! Deallocation
!
if ( allocated( xy_SinLat ) ) deallocate( xy_SinLat )
if ( allocated( xy_CosLat ) ) deallocate( xy_CosLat )
if ( allocated( xy_Cori ) ) deallocate( xy_Cori )
if ( allocated( z_HydroAlpha ) ) deallocate( z_HydroAlpha )
if ( allocated( z_HydroBeta ) ) deallocate( z_HydroBeta )
if ( allocated( z_TInpCoefA ) ) deallocate( z_TInpCoefA )
if ( allocated( z_TInpCoefB ) ) deallocate( z_TInpCoefB )
if ( allocated( z_TInpCoefK ) ) deallocate( z_TInpCoefK )
if ( allocated( z_RefTemp ) ) deallocate( z_RefTemp )
if ( allocated( r_RefTemp ) ) deallocate( r_RefTemp )
if ( allocated( wz_LaplaEigVal ) ) deallocate( wz_LaplaEigVal )
if ( allocated( wz_DisCoefM ) ) deallocate( wz_DisCoefM )
if ( allocated( wz_DisCoefH ) ) deallocate( wz_DisCoefH )
if ( allocated( wz_DisCoefQ ) ) deallocate( wz_DisCoefQ )
if ( allocated( z_siMtxC ) ) deallocate( z_siMtxC )
if ( allocated( z_siMtxG ) ) deallocate( z_siMtxG )
if ( allocated( zz_siMtxH ) ) deallocate( zz_siMtxH )
if ( allocated( zz_siMtxDiH ) ) deallocate( zz_siMtxDiH )
if ( allocated( wzz_siMtxWDiH ) ) deallocate( wzz_siMtxWDiH )
if ( allocated( zz_siMtxGCt ) ) deallocate( zz_siMtxGCt )
if ( allocated( zz_siMtxW ) ) deallocate( zz_siMtxW )
if ( allocated( zz_siMtxQ ) ) deallocate( zz_siMtxQ )
if ( allocated( zz_siMtxS ) ) deallocate( zz_siMtxS )
if ( allocated( zz_siMtxR ) ) deallocate( zz_siMtxR )
!!$ if ( allocated(nmo ) ) deallocate( nmo )
!!$ if ( allocated(wzz_siMtxM ) ) deallocate( wzz_siMtxM )
!!$ if ( allocated(z_siMtxPivWork) ) deallocate( z_siMtxPivWork )
if ( allocated(wzz_siMtxLU ) ) deallocate( wzz_siMtxLU )
if ( allocated(wz_siMtxPiv ) ) deallocate( wz_siMtxPiv )
dynamics_hspl_vas83_inited = .false.
end subroutine DynamicsFinalize
| Variable : | |||
| dynamics_hspl_vas83_inited = .false. : | logical, save, public
|
| Variable : | |||
| DelTimeSave : | real(DP), save
|
| Subroutine : | |||
| xyz_U(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_V(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_Temp(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyzf_QMix(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| xy_Ps(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
| xyr_SigDot(0:imax-1, 1:jmax, 0:kmax) : | real(DP), intent(in)
| ||
| xy_DPiDt(0:imax-1, 1:jmax) : | real(DP), intent(in)
|
診断量の出力を行います.
Diagnostic variables are output.
subroutine DiagOutput( xyz_U, xyz_V, xyz_Temp, xyzf_QMix, xy_Ps, xyr_SigDot, xy_DPiDt )
!
! 診断量の出力を行います.
!
! Diagnostic variables are output.
!
! モジュール引用 ; USE statements
!
! 物理定数設定
! Physical constants settings
!
use constants, only: RPlanet, Grav, CpDry, LatentHeat
! $ L $ [J kg-1] .
! 凝結の潜熱.
! Latent heat of condensation
! 時刻管理
! Time control
!
use timeset, only: TimeN ! ステップ $ t $ の時刻. Time of step $ t $.
#ifdef LIB_MPI
! MPI 版 SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library MPI version, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_mpi_module, only: wa_DivLambda_xya => wa_DivLambda_xva, wa_DivMu_xya => wa_DivMu_xva, xya_wa => xva_wa
#else
! SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_module, only: wa_DivLambda_xya, wa_DivMu_xya, xya_wa
#endif
! ヒストリデータ出力
! History data output
!
use gtool_historyauto, only: HistoryAutoPut
! 宣言文 ; Declaration statements
!
implicit none
real(DP), intent(in):: xyz_U (0:imax-1, 1:jmax, 1:kmax)
! $ u $ . 東西風速. Eastward wind
real(DP), intent(in):: xyz_V (0:imax-1, 1:jmax, 1:kmax)
! $ v $ . 南北風速. Northward wind
real(DP), intent(in):: xyz_Temp (0:imax-1, 1:jmax, 1:kmax)
! $ T $ . 温度. Temperature
real(DP), intent(in):: xyzf_QMix(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ q $ . 比湿. Specific humidity
real(DP), intent(in):: xy_Ps (0:imax-1, 1:jmax)
! $ p_s $ . 地表面気圧. Surface pressure
real(DP), intent(in):: xyr_SigDot (0:imax-1, 1:jmax, 0:kmax)
! $ \dot{\sigma} $ .
! 鉛直流. Vertical flow
real(DP), intent(in):: xy_DPiDt (0:imax-1, 1:jmax)
! $ Z $ . 地表面気圧時間変化項.
! Surface pressure tendency
! 作業変数
! Work variables
!
real(DP):: xyz_UCosLat (0:imax-1, 1:jmax, 1:kmax)
! $ U = u \times \cos \varphi $ .
real(DP):: xyz_VCosLat (0:imax-1, 1:jmax, 1:kmax)
! $ V = v \times \cos \varphi $ .
real(DP):: xyz_Vor (0:imax-1, 1:jmax, 1:kmax)
! $ \zeta $ . 渦度. Vorticity
real(DP):: xyz_Div (0:imax-1, 1:jmax, 1:kmax)
! $ D $ . 発散. Divergence
real(DP):: xy_Mass (0:imax-1, 1:jmax)
! 質量.
! Mass
real(DP):: xyz_KinEngy (0:imax-1, 1:jmax, 1:kmax)
! $ KE $ . 運動エネルギー.
! Kinetic energy
real(DP):: xyz_IntEngy (0:imax-1, 1:jmax, 1:kmax)
! $ IE $ . 内部エネルギー.
! Internal energy
real(DP):: xyz_PotEngy (0:imax-1, 1:jmax, 1:kmax)
! $ PE $ . ポテンシャルエネルギー.
! Potential energy
real(DP):: xyz_LatEngy (0:imax-1, 1:jmax, 1:kmax)
! $ LE $ . 潜熱エネルギー.
! Latent heat energy
real(DP):: xyz_TotEngy (0:imax-1, 1:jmax, 1:kmax)
! $ TE $ . 全エネルギー.
! Total energy
real(DP):: xyz_Enstro (0:imax-1, 1:jmax, 1:kmax)
! エンストロフィー.
! Enstrophy
integer:: k ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
! 実行文 ; Executable statement
!
! 鉛直流と地表面気圧時間変化項の出力
! Output vertical flow and surface pressure tendency
!
call HistoryAutoPut( TimeN, 'SigDot', xyr_SigDot )
call HistoryAutoPut( TimeN, 'DPiDt', xy_DPiDt )
! 風速から渦度発散の計算
! Calculate vorticity and divergence from wind velocity
!
do k = 1, kmax
xyz_UCosLat(:,:,k) = xyz_U(:,:,k) * xy_CosLat
xyz_VCosLat(:,:,k) = xyz_V(:,:,k) * xy_CosLat
end do
xyz_Vor = xya_wa( wa_DivLambda_xya( xyz_VCosLat ) - wa_DivMu_xya( xyz_UCosLat ) ) / RPlanet
xyz_Div = xya_wa( wa_DivLambda_xya( xyz_UCosLat ) + wa_DivMu_xya( xyz_VCosLat ) ) / RPlanet
call HistoryAutoPut( TimeN, 'Vor', xyz_Vor )
call HistoryAutoPut( TimeN, 'Div', xyz_Div )
! 質量の計算
! Calculate mass
!
xy_Mass = xy_Ps / Grav
! エネルギー, エンストロフィーの計算
! Calculate energy and enstrophy
!
call HydroGrid( xyz_Temp, xyz_PotEngy ) ! (out)
do k = 1, kmax
xyz_KinEngy(:,:,k) = ( xyz_U(:,:,k) ** 2 + xyz_V(:,:,k) ** 2 ) / 2. * xy_Mass
xyz_IntEngy(:,:,k) = CpDry * xyz_Temp(:,:,k) * xy_Mass
xyz_PotEngy(:,:,k) = xyz_PotEngy(:,:,k) * xy_Mass
xyz_LatEngy(:,:,k) = LatentHeat * xyzf_QMix(:,:,k,IndexH2OVap) * xy_Mass
end do
xyz_TotEngy = xyz_KinEngy + xyz_IntEngy + xyz_PotEngy + xyz_LatEngy
do k = 1, kmax
xyz_Enstro(:,:,k) = xyz_Vor(:,:,k) ** 2 * xy_Mass
end do
call HistoryAutoPut( TimeN, 'Mass', xy_Mass )
call HistoryAutoPut( TimeN, 'KinEngy', xyz_KinEngy )
call HistoryAutoPut( TimeN, 'IntEngy', xyz_IntEngy )
call HistoryAutoPut( TimeN, 'PotEngy', xyz_PotEngy )
call HistoryAutoPut( TimeN, 'LatEngy', xyz_LatEngy )
call HistoryAutoPut( TimeN, 'TotEngy', xyz_TotEngy )
call HistoryAutoPut( TimeN, 'Enstro', xyz_Enstro )
end subroutine DiagOutput
| Subroutine : |
計算に必要なパラメタの設定や NAMELIST#dynamics_hspl_vas83_nml の読み込みを行います.
Configure parameters for calculation, and load "NAMELIST#dynamics_hspl_vas83_nml"
This procedure input/output NAMELIST#dynamics_hspl_vas83_nml .
subroutine DynamicsInit
!
! 計算に必要なパラメタの設定や NAMELIST#dynamics_hspl_vas83_nml
! の読み込みを行います.
!
! Configure parameters for calculation,
! and load "NAMELIST#dynamics_hspl_vas83_nml"
!
! モジュール引用 ; USE statements
!
! 物理定数設定
! Physical constants settings
!
use constants, only: RPlanet, Omega, GasRDry, CpDry
! $ C_p $ [J kg-1 K-1].
! 乾燥大気の定圧比熱.
! Specific heat of air at constant pressure
! 座標データ設定
! Axes data settings
!
use axesset, only: z_Sigma, r_Sigma, z_DelSigma ! $ \Delta \sigma $ (整数).
! $ \Delta \sigma $ (Full)
#ifdef LIB_MPI
! MPI 版 SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library MPI version, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_mpi_module, only: xy_Lat => xv_Lat, w_xy => w_xv
#else
! SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_module, only: xy_Lat, w_xy
#endif
use w_module, only: rn
! NAMELIST ファイル入力に関するユーティリティ
! Utilities for NAMELIST file input
!
use namelist_util, only: namelist_filename, NmlutilMsg
! ヒストリデータ出力
! History data output
!
use gtool_historyauto, only: HistoryAutoAddVariable
! gtool4 データ入力
! Gtool4 data input
!
use gtool_history, only: HistoryGet
! ファイル入出力補助
! File I/O support
!
use dc_iounit, only: FileOpen
! 種別型パラメタ
! Kind type parameter
!
use dc_types, only: STDOUT, STRING ! 文字列. Strings.
! 日付および時刻の取り扱い
! Date and time handler
!
use dc_date_types, only: DC_DIFFTIME
! 日時の差を表現するデータ型.
! Data type for difference about date and time
use dc_date, only: DCDiffTimeCreate, EvalSec
! メッセージ出力
! Message output
!
use dc_message, only: MessageNotify
! 組み込み関数 PRESENT の拡張版関数
! Extended functions of intrinsic function "PRESENT"
!
use dc_present, only: present_and_not_empty
! 文字列操作
! Character handling
!
use dc_string, only: LChar
! SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_module, only: nm_l
! 宣言文 ; Declaration statements
!
implicit none
! 基準温度の設定のための作業変数
! Work variable for reference temperature
!
character(TOKEN) :: TimeIntegScheme
! 時間積分法.
! 以下の方法を選択可能.
!
! Time integration scheme.
! Available schemes are as follows.
!
! * "Semi-implicit"
! * "Explicit"
real(DP):: RefTemp
! $ \overline{T} $ . 基準温度.
! Reference temperature
! 水平拡散, スポンジ層のための作業変数
! Work variable for horizontal diffusion and sponge layer
!
real(DP) :: wz_HDifCoefM ((nmax+1)**2, 1:kmax)
! $ {\cal D}_M = -K_{HD} [(-1)^{N_D/2}\nabla^{N_D}- (2/a^2)^{N_D/2}] $ .
! 運動量水平拡散係数.
! Coefficient of horizontal momentum diffusion
real(DP) :: wz_HDifCoefH ((nmax+1)**2, 1:kmax)
! $ {\cal D}_H = -(-1)^{N_D/2}K_{HD}\nabla^{N_D} $ .
! 熱, 水水平拡散係数.
! Coefficient of horizontal thermal and water diffusion
real(DP) :: wz_SpongeLayerCoefM((nmax+1)**2, 1:kmax)
! スポンジ層における運動量の減衰係数
! Damping coefficient for momentum in a sponge layer
real(DP) :: wz_SpongeLayerCoefH((nmax+1)**2, 1:kmax)
! スポンジ層における熱の減衰係数
! Damping coefficient for temperature zonal perturbation
! in a sponge layer
integer:: HDOrder ! 超粘性の次数. Order of hyper-viscosity
real(DP):: VisCoef ! 超粘性係数. Hyper-viscosity coefficient
real(DP):: HDEFoldTimeValue ! 最大波数に対する e-folding time.
! 負の値を与えると, 水平拡散係数をゼロにします.
!
! E-folding time for maximum wavenumber.
! If negative value is given,
! coefficients of horizontal diffusion become zero.
character(TOKEN):: HDEFoldTimeUnit
! 最大波数に対する e-folding time の単位.
! Unit of e-folding time for maximum wavenumber
real(DP):: HDEFoldTime ! 最大波数に対する e-folding time [単位: 秒].
! E-folding time for maximum wavenumber [Unit: sec]
type(DC_DIFFTIME):: dcdiff_hdefold
logical :: FlagSpongeLayer
logical :: FlagSpongeLayerforZonalMean
logical :: FlagSpongeLayerforHeat
real(DP) :: SLEFoldTimeValue
! スポンジ層の最上層における減衰時定数
! Damping time constant at the top model layer
! in a sponge layer
character(TOKEN) :: SLEFoldTimeUnit
! SLEFoldTimeValue の単位
! Unit of SLEFoldTimeValue
real(DP) :: SLEFoldTime
! スポンジ層の最上層における減衰時定数 (秒)
! Damping time constant at the top model layer
! in a sponge layer (sec)
integer :: SLOrder
! スポンジ層の減衰係数の sigma 依存性のオーダ
! Sigma dependence of damping coefficient
! in a sponge layer
integer :: SLNumLayer
! スポンジ層が適応されるモデル上端からの層の数
! Number of layers which the sponge layer is applied.
integer :: a_DegOrd(2)
type(DC_DIFFTIME):: dcdiff_slefold
! NonLinearOnGrid 等で使用する係数の設定のための作業変数
! Work variable for coefficients for "NonLinearOnGrid", etc.
!
real(DP):: Kappa ! $ \kappa = R/C_p $ .
! 気体定数の定圧比熱に対する比.
! Ratio of gas constant to specific heat
integer:: k ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
integer:: l ! 波数方向に回る DO ループ用作業変数
! Work variables for DO loop in wavenumber
integer:: unit_nml ! NAMELIST ファイルオープン用装置番号.
! Unit number for NAMELIST file open
integer:: iostat_nml ! NAMELIST 読み込み時の IOSTAT.
! IOSTAT of NAMELIST read
! NAMELIST 変数群
! NAMELIST group name
!
namelist /dynamics_hspl_vas83_nml/ TimeIntegScheme, HDOrder, HDEFoldTimeValue, HDEFoldTimeUnit, FlagSpongeLayer, FlagSpongeLayerforZonalMean, FlagSpongeLayerforHeat, SLEFoldTimeValue, SLEFoldTimeUnit, SLOrder, SLNumLayer, RefTemp
!
! デフォルト値については初期化手続 "dynamics_hspl_vas83#DynamicsInit"
! のソースコードを参照のこと.
!
! Refer to source codes in the initialization procedure
! "dynamics_hspl_vas83#DynamicsInit" for the default values.
!
! 実行文 ; Executable statement
!
if ( dynamics_hspl_vas83_inited ) return
call InitCheck
! デフォルト値の設定
! Default values settings
!
TimeIntegScheme = 'Semi-implicit'
HDOrder = 8
HDEFoldTimeValue = 8640.
HDEFoldTimeUnit = 'sec'
FlagSpongeLayer = .false.
FlagSpongeLayerforZonalMean = .false.
FlagSpongeLayerforHeat = .false.
SLEFoldTimeValue = 86400.0d0
SLEFoldTimeUnit = 'sec'
SLOrder = 1
SLNumLayer = kmax
RefTemp = 300.
! NAMELIST の読み込み
! NAMELIST is input
!
if ( trim(namelist_filename) /= '' ) then
call FileOpen( unit_nml, namelist_filename, mode = 'r' ) ! (in)
rewind( unit_nml )
read( unit_nml, nml = dynamics_hspl_vas83_nml, iostat = iostat_nml ) ! (out)
close( unit_nml )
call NmlutilMsg( iostat_nml, module_name ) ! (in)
if ( iostat_nml == 0 ) write( STDOUT, nml = dynamics_hspl_vas83_nml )
end if
! 時間積分法のチェック
! Check time integration scheme
!
select case ( LChar( trim( TimeIntegScheme ) ) )
case ('semi-implicit')
IDTimeIntegScheme = IDTimeIntegSchemeSemiImplicit
case ('explicit')
IDTimeIntegScheme = IDTimeIntegSchemeExplicit
case default
call MessageNotify( 'E', module_name, '"TimeIntegScheme" must be "Semi-Implicit" or "Explicit".' )
end select
! SemiImplMatrix サブルーチン用に $ \Delta t $ の保存値に初期値を設定.
! Configure initial value to saved value of $ \Delta t $ for a subroutine "SemiImplMatrix"
!
DelTimeSave = - 1.
! NonLinearOnGrid 等で使用する係数の設定
! Configure coefficients for "NonLinearOnGrid", etc.
!
! $ \sin \varphi $ と $ \cos \varphi $ の計算
! Calculate $ \sin \varphi $ and $ \cos \varphi $
!
allocate( xy_SinLat (0:imax-1, 1:jmax) )
allocate( xy_CosLat (0:imax-1, 1:jmax) )
xy_SinLat = sin( xy_Lat )
xy_CosLat = cos( xy_Lat )
! コリオリパラメータの計算
! Calculate Coriolis parameter
!
allocate( xy_Cori (0:imax-1, 1:jmax) )
xy_Cori = 2. * Omega * xy_SinLat
! 静水圧の式の係数 $ \alpha $ , $ \beta $ の計算
! Calculate coefficients $ \alpha $ and $ \beta $ in hydrostatic equation.
!
allocate( z_HydroAlpha (1:kmax) )
allocate( z_HydroBeta (1:kmax) )
Kappa = GasRDry / CpDry
do k = 1, kmax
z_HydroAlpha(k) = ( r_Sigma(k-1) / z_Sigma(k) ) ** Kappa - 1.
z_HydroBeta(k) = 1. - ( r_Sigma(k) / z_Sigma(k) ) ** Kappa
enddo
! 温度鉛直補間の係数 $ \kappa $, $ a $ , $ b $ の計算
! Calculate coefficients $ \kappa $, $ a $ , $ b $
! for interpolation of temperature
!
allocate( z_TInpCoefA (1:kmax) )
allocate( z_TInpCoefB (1:kmax) )
allocate( z_TInpCoefK (1:kmax) )
do k = 1, kmax
z_TInpCoefK(k) = ( r_Sigma(k-1) * z_HydroAlpha(k) + r_Sigma(k ) * z_HydroBeta (k) ) / z_DelSigma(k)
enddo
z_TInpCoefA = 0.
do k = 2, kmax
z_TInpCoefA(k) = z_HydroAlpha(k) * ( 1. - (z_Sigma(k) / z_Sigma(k-1)) ** Kappa ) ** ( -1 )
end do
z_TInpCoefB = 0.
do k = 1, kmax - 1
z_TInpCoefB(k) = z_HydroBeta(k) * ( (z_Sigma(k) / z_Sigma(k+1) ) ** Kappa - 1. ) ** ( -1 )
end do
! 基準温度 (半整数レベル) の計算
! Calculate reference temperature on half levels
!
allocate( z_RefTemp (1:kmax) )
allocate( r_RefTemp (0:kmax) )
z_RefTemp = RefTemp
r_RefTemp(0) = 0.
r_RefTemp(kmax) = 0.
do k = 1, kmax - 1
r_RefTemp(k) = z_TInpCoefA(k+1) * z_RefTemp(k+1) + z_TInpCoefB( k ) * z_RefTemp( k )
enddo
! ルジャンドル陪関数の固有値の設定
! Set eigen value of Associated Legendre Function
!
allocate( wz_LaplaEigVal((nmax+1)**2, 1:kmax) )
do k = 1, kmax
wz_LaplaEigVal(:,k) = rn(:,1) / RPlanet**2
enddo
! 水平拡散係数の設定
! Configure coefficient of horizontal diffusion
!
! 粘性係数の計算 (最大波数の e-folding time が HDEFoldTime となるように)
! Calculate viscosity coefficient
!
call DCDiffTimeCreate( dcdiff_hdefold, HDEFoldTimeValue, HDEFoldTimeUnit ) ! (in)
HDEFoldTime = EvalSec( dcdiff_hdefold )
if ( HDEFoldTimeValue > 0. ) then
VisCoef = ( (nmax*(nmax+1)) / RPlanet**2 )**(-HDOrder / 2) / HDEFoldTime
else
VisCoef = 0.
end if
wz_HDifCoefH = - VisCoef * ( ( - wz_LaplaEigVal )**( HDOrder / 2 ) )
wz_HDifCoefM = wz_HDifCoefH - VisCoef * ( - ( 2. / RPlanet**2 )**( HDOrder / 2 ) )
! スポンジ層の減衰係数の設定
! Set damping coefficient in a sponge layer
!
if ( SLEFoldTimeValue <= 0.0d0 ) then
call MessageNotify( 'E', module_name, 'SLEFoldTimeValue must be greater than zero, SLEFoldTimeValue=<%f>.', d = (/ SLEFoldTimeValue /) )
end if
if ( ( SLNumLayer <= 0.0d0 ) .or. ( SLNumLayer > kmax ) ) then
call MessageNotify( 'E', module_name, 'SLNumLayer must be greater than zero and less than/equal to kmax, SLNumLayer=<%d>.', i = (/ SLNumLayer /) )
end if
! スポンジ層の減衰係数の計算
! Calculate damping coefficient for momentum in a sponge layer
!
call DCDiffTimeCreate( dcdiff_slefold, SLEFoldTimeValue, SLEFoldTimeUnit ) ! (in)
SLEFoldTime = EvalSec( dcdiff_slefold )
if ( FlagSpongeLayer ) then
! Sponge layer is not applied for model layers, k = 1, kmax-SLNumLayers.
!
do k = 1, kmax-SLNumLayer
wz_SpongeLayerCoefM(:,k) = 0.0d0
end do
do k = kmax-SLNumLayer+1, kmax
wz_SpongeLayerCoefM(:,k) = 1.0d0 / ( SLEFoldTime * ( z_Sigma(k) / z_Sigma(kmax) )**SLOrder )
end do
if ( .not. FlagSpongeLayerforZonalMean ) then
! Sponge layer is not applied for zonal mean component.
! i.e., sponge layer is applied for zonal wave component only.
!
do k = kmax-SLNumLayer+1, kmax
do l = 1, (nmax+1)**2
a_DegOrd = nm_l( l )
if ( a_DegOrd(2) == 0 ) then
wz_SpongeLayerCoefM(l,k) = 0.0d0
end if
end do
end do
end if
if ( FlagSpongeLayerforHeat ) then
wz_SpongeLayerCoefH = wz_SpongeLayerCoefM
! Sponge layer is not applied for zonal mean component.
! i.e., sponge layer is applied for zonal wave component only.
!
do k = kmax-SLNumLayer+1, kmax
do l = 1, (nmax+1)**2
a_DegOrd = nm_l( l )
if ( a_DegOrd(2) == 0 ) then
wz_SpongeLayerCoefH(l,k) = 0.0d0
end if
end do
end do
else
wz_SpongeLayerCoefH = 0.0d0
end if
else
! Sponge layer is not applied.
!
wz_SpongeLayerCoefM = 0.0d0
wz_SpongeLayerCoefH = 0.0d0
end if
! 運動量の水平拡散係数とスポンジ層減衰係数の和
! Damping coefficients by horizonatl diffusion and a sponge layer
!
allocate( wz_DisCoefM((nmax+1)**2, 1:kmax) )
allocate( wz_DisCoefH((nmax+1)**2, 1:kmax) )
allocate( wz_DisCoefQ((nmax+1)**2, 1:kmax) )
wz_DisCoefM = wz_HDifCoefM - wz_SpongeLayerCoefM
wz_DisCoefH = wz_HDifCoefH - wz_SpongeLayerCoefH
wz_DisCoefQ = wz_HDifCoefH
! ヒストリデータ出力のためのへの変数登録
! Register of variables for history data output
!
call HistoryAutoAddVariable( 'SigDot', (/ 'lon ', 'lat ', 'sigm', 'time' /), 'sigma-vertical velocity', '1 s-1' )
call HistoryAutoAddVariable( 'DPiDt', (/ 'lon ', 'lat ', 'time' /), 'Pi (log Ps) tendency)', 'Pa s-1' )
call HistoryAutoAddVariable( 'Vor', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'vorticity', 's-1' )
call HistoryAutoAddVariable( 'Div', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'divergence', 's-1' )
call HistoryAutoAddVariable( 'Mass', (/ 'lon ', 'lat ', 'time' /), 'mass', 'kg' )
call HistoryAutoAddVariable( 'KinEngy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'kinetic energy', 'J' )
call HistoryAutoAddVariable( 'IntEngy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'internal energy', 'J' )
call HistoryAutoAddVariable( 'PotEngy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'potential energy', 'J' )
call HistoryAutoAddVariable( 'LatEngy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'latent energy', 'J' )
call HistoryAutoAddVariable( 'TotEngy', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'total energy', 'J' )
call HistoryAutoAddVariable( 'Enstro', (/ 'lon ', 'lat ', 'sig ', 'time' /), 'enstrophy', 'kg' )
! 印字 ; Print
!
call MessageNotify( 'M', module_name, '----- Initialization Messages -----' )
call MessageNotify( 'M', module_name, ' TimeIntegScheme = %c', c1 = trim( TimeIntegScheme ) )
call MessageNotify( 'M', module_name, ' HDEFoldTime = %f [%c]', d = (/ HDEFoldTimeValue /), c1 = trim(HDEFoldTimeUnit) )
call MessageNotify( 'M', module_name, ' HDOrder = %d', i = (/ HDOrder /) )
call MessageNotify( 'M', module_name, ' VisCoef = %f', d = (/ VisCoef /) )
call MessageNotify( 'M', module_name, ' FlagSpongeLayer = %b', l = (/ FlagSpongeLayer /) )
call MessageNotify( 'M', module_name, ' FlagSpongeLayerforZonalMean = %b', l = (/ FlagSpongeLayerforZonalMean /) )
call MessageNotify( 'M', module_name, ' FlagSpongeLayerforHeat = %b', l = (/ FlagSpongeLayerforHeat /) )
call MessageNotify( 'M', module_name, ' SLEFoldTime = %f [%c]', d = (/ SLEFoldTimeValue /), c1 = trim(SLEFoldTimeUnit) )
call MessageNotify( 'M', module_name, ' SLOrder = %d', i = (/ SLOrder /) )
call MessageNotify( 'M', module_name, ' SLNumLayer = %d', i = (/ SLNumLayer /) )
call MessageNotify( 'M', module_name, ' RefTemp = %f', d = (/ RefTemp /) )
call MessageNotify( 'M', module_name, '-- version = %c', c1 = trim(version) )
dynamics_hspl_vas83_inited = .true.
end subroutine DynamicsInit
| Subroutine : | |||
| xyz_Temp(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_Phi(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
|
格子点データである温度 $ T $ から, 静水圧の式を用いて 格子点データのジオポテンシャル高度 $ Phi $ を求めます.
subroutine HydroGrid( xyz_Temp, xyz_Phi )
!
! 格子点データである温度 $ T $ から, 静水圧の式を用いて
! 格子点データのジオポテンシャル高度 $ \Phi $ を求めます.
!
! モジュール引用 ; USE statements
!
use constants, only: CpDry
! $ C_p $ [J kg-1 K-1].
! 乾燥大気の定圧比熱.
! Specific heat of air at constant pressure
! 宣言文 ; Declaration statements
!
implicit none
real(DP), intent(in):: xyz_Temp (0:imax-1, 1:jmax, 1:kmax)
! $ T $ . 温度. Temperature
real(DP), intent(out):: xyz_Phi (0:imax-1, 1:jmax, 1:kmax)
! $ \Phi $ . ジオポテンシャル高度.
! Getpotential height
! 作業変数
! Work variables
!
integer:: k ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
! 実行文 ; Executable statement
!
xyz_Phi(:,:,1) = CpDry * z_HydroAlpha(1) * xyz_Temp(:,:,1)
do k = 2, kmax
xyz_Phi(:,:,k) = xyz_Phi(:,:,k-1) + CpDry * z_HydroAlpha(k) * xyz_Temp(:,:,k) + CpDry * z_HydroBeta(k-1) * xyz_Temp(:,:,k-1)
enddo
end subroutine HydroGrid
| Variable : | |||
| IDTimeIntegScheme : | integer , save
|
| Subroutine : |
依存モジュールの初期化チェック
Check initialization of dependency modules
subroutine InitCheck
!
! 依存モジュールの初期化チェック
!
! Check initialization of dependency modules
! モジュール引用 ; USE statements
!
! NAMELIST ファイル入力に関するユーティリティ
! Utilities for NAMELIST file input
!
use namelist_util, only: namelist_util_inited
! 格子点設定
! Grid points settings
!
use gridset, only: gridset_inited
! 物理定数設定
! Physical constants settings
!
use constants, only: constants_inited
! 座標データ設定
! Axes data settings
!
use axesset, only: axesset_inited
! 時刻管理
! Time control
!
use timeset, only: timeset_inited
! メッセージ出力
! Message output
!
use dc_message, only: MessageNotify
! 実行文 ; Executable statement
!
if ( .not. namelist_util_inited ) call MessageNotify( 'E', module_name, '"namelist_util" module is not initialized.' )
if ( .not. gridset_inited ) call MessageNotify( 'E', module_name, '"gridset" module is not initialized.' )
if ( .not. constants_inited ) call MessageNotify( 'E', module_name, '"constants" module is not initialized.' )
if ( .not. axesset_inited ) call MessageNotify( 'E', module_name, '"axesset" module is not initialized.' )
if ( .not. timeset_inited ) call MessageNotify( 'E', module_name, '"timeset" module is not initialized.' )
end subroutine InitCheck
| Subroutine : | |||
| xyz_UN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_VN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_VorN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_DivN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyz_TempN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(in)
| ||
| xyzf_QMixN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| xy_GradLambdaPiN(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
| xy_GradMuPiN(0:imax-1, 1:jmax) : | real(DP), intent(in)
| ||
| xyz_UAdvN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyz_VAdvN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyz_TempNonLinearN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyzf_QMixNonLinearN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(out)
| ||
| xyz_KinEngyN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyz_TempUAdvN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyz_TempVAdvN(0:imax-1, 1:jmax, 1:kmax) : | real(DP), intent(out)
| ||
| xyr_SigDotN(0:imax-1, 1:jmax, 0:kmax) : | real(DP), intent(out)
| ||
| xy_DPiDtNG(0:imax-1, 1:jmax) : | real(DP), intent(out)
| ||
| xyzf_QMixUAdvN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(out)
| ||
| xyzf_QMixVAdvN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax) : | real(DP), intent(out)
|
非線形項 (非重力波項) を格子点上で計算します.
Non-linear terms (non gravitational terms) are calculated on grid points
subroutine NonLinearOnGrid( xyz_UN, xyz_VN, xyz_VorN, xyz_DivN, xyz_TempN, xyzf_QMixN, xy_GradLambdaPiN, xy_GradMuPiN, xyz_UAdvN, xyz_VAdvN, xyz_TempNonLinearN, xyzf_QMixNonLinearN, xyz_KinEngyN, xyz_TempUAdvN, xyz_TempVAdvN, xyr_SigDotN, xy_DPiDtNG, xyzf_QMixUAdvN, xyzf_QMixVAdvN )
!
! 非線形項 (非重力波項) を格子点上で計算します.
!
! Non-linear terms (non gravitational terms) are calculated on
! grid points
!
! モジュール引用 ; USE statements
!
! 座標データ設定
! Axes data settings
!
use axesset, only: r_Sigma, z_DelSigma ! $ \Delta \sigma $ (整数).
! $ \Delta \sigma $ (Full)
! 物理定数設定
! Physical constants settings
!
use constants, only: CpDry, EpsV
! $ \epsilon_v $ .
! 水蒸気分子量比.
! Molecular weight of water vapor
! 文字列操作
! Character handling
!
use dc_string, only: LChar
implicit none
real(DP), intent(in):: xyz_UN (0:imax-1, 1:jmax, 1:kmax)
! $ u (t) $ . 東西風速. Eastward wind
real(DP), intent(in):: xyz_VN (0:imax-1, 1:jmax, 1:kmax)
! $ v (t) $ . 南北風速. Northward wind
real(DP), intent(in):: xyz_VorN (0:imax-1, 1:jmax, 1:kmax)
! $ \zeta (t) $ . 渦度. Vorticity
real(DP), intent(in):: xyz_DivN (0:imax-1, 1:jmax, 1:kmax)
! $ D (t) $ . 発散. Divergence
real(DP), intent(in):: xyz_TempN (0:imax-1, 1:jmax, 1:kmax)
! $ T (t) $ . 温度. Temperature
real(DP), intent(in):: xyzf_QMixN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ q (t) $ . 比湿. Specific humidity
real(DP), intent(in):: xy_GradLambdaPiN (0:imax-1, 1:jmax)
! $ \DP{\pi}{\lambda} $
real(DP), intent(in):: xy_GradMuPiN (0:imax-1, 1:jmax)
! $ (1-\mu^2) \DP{\pi}{\mu} $
real(DP), intent(out):: xyz_UAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ U_A (t) $ . 東西運動量移流項.
! Eastward advection of momentum
real(DP), intent(out):: xyz_VAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ V_A (t) $ . 南北運動量移流項.
! Northward advection of momentum
real(DP), intent(out):: xyz_TempNonLinearN (0:imax-1, 1:jmax, 1:kmax)
! $ \hat{H} (t) $ . 温度時間変化項.
! Temperature tendency
real(DP), intent(out):: xyzf_QMixNonLinearN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ R (t) $ . 比湿時間変化項.
! Specific humidity tendency
real(DP), intent(out):: xyz_KinEngyN (0:imax-1, 1:jmax, 1:kmax)
! $ KE (t) $ . 運動エネルギー項.
! Kinetic energy
real(DP), intent(out):: xyz_TempUAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ UT' (t) $ . 温度東西移流項.
! Eastward advection of temperature
real(DP), intent(out):: xyz_TempVAdvN (0:imax-1, 1:jmax, 1:kmax)
! $ VT' (t) $ . 温度南北移流項.
! Northward advection of temperature
real(DP), intent(out):: xyr_SigDotN (0:imax-1, 1:jmax, 0:kmax)
! $ \dot{\sigma} (t) $ .
! 鉛直流. Vertical flow
real(DP), intent(out):: xy_DPiDtNG (0:imax-1, 1:jmax)
! $ Z (t) $ . 地表面気圧時間変化非重力波項.
! Non-gravity wave component of surface pressure tendency
real(DP), intent(out):: xyzf_QMixUAdvN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ Uq (t) $ . 比湿東西移流項.
! Eastward advection of specific humidity
real(DP), intent(out):: xyzf_QMixVAdvN(0:imax-1, 1:jmax, 1:kmax, 1:ncmax)
! $ Vq (t) $ . 比湿南北移流項.
! Northward advection of specific humidity
!-----------------------------------
! 作業変数
! Work variables
real(DP):: xyz_UCosLatN (0:imax-1, 1:jmax, 1:kmax)
! $ U (t) = u (t) \times \cos \varphi $ .
real(DP):: xyz_VCosLatN (0:imax-1, 1:jmax, 1:kmax)
! $ V (t) = v (t) \times \cos \varphi $ .
real(DP):: xyz_PiAdv (0:imax-1, 1:jmax, 1:kmax)
! $ \Dvect{v} \cdot \nabla \pi $ .
! $ \pi $ の移流. Advection of $ \pi $
real(DP):: xyz_PiAdvSum (0:imax-1, 1:jmax, 1:kmax)
! $ \sum_k^K(\Dvect{v}\cdot\nabla\pi)\Delta\sigma $ .
! $ \pi $ 移流の積分値. Integral downward of advection of $ \pi $
real(DP):: xyz_DivSum (0:imax-1, 1:jmax, 1:kmax)
! $ \sum_k^K D\Delta\sigma $ .
! 発散の積分値. Integral downward of divergence
real(DP):: xyr_SigDotNonG (0:imax-1, 1:jmax, 0:kmax)
! $ \dot{\sigma} $ .
! 鉛直流 (非重力波). Vertical flow (non gravitational)
real(DP):: xyz_TempEdd (0:imax-1, 1:jmax, 1:kmax)
! $ T' = T - \bar{T} $ .
! 温度の擾乱 (整数レベル). Temperature eddy (full level)
real(DP):: xyr_TempEdd (0:imax-1, 1:jmax, 0:kmax)
! $ \hat{T}' $ .
! 温度の擾乱 (半整数レベル). Temperature eddy (half level)
real(DP):: xyz_VirTemp (0:imax-1, 1:jmax, 1:kmax)
! $ T_v $ .
! 仮温度. Virtual temperature
real(DP):: xyz_VirTempEdd (0:imax-1, 1:jmax, 1:kmax)
! $ {T_v}' = T_v - \bar{T} $ .
! 仮温度の擾乱. Virtual temperature eddy
integer:: k ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
integer:: n ! 組成方向に回る DO ループ用作業変数
! Work variables for DO loop in dimension of constituents
! 実行文 ; Executable statement
!
! u -> U (= u cos \varphi), v -> V (= v cos \varphi)
!
do k = 1, kmax
xyz_UCosLatN(:,:,k) = xyz_UN(:,:,k) * xy_CosLat
xyz_VCosLatN(:,:,k) = xyz_VN(:,:,k) * xy_CosLat
end do
! $ \pi $ の移流, $ \pi $ 移流と発散の大気上端から下向きの積分
! Calculate advection of $ \pi $, integral advection of $ \pi $ and divergence
! from the top of the model downward
!
do k = 1, kmax
xyz_PiAdv(:,:,k) = ( xyz_UCosLatN(:,:,k) * xy_GradLambdaPiN + xyz_VCosLatN(:,:,k) * xy_GradMuPiN ) / ( 1. - xy_SinLat**2 )
enddo
xyz_PiAdvSum(:,:,kmax) = xyz_PiAdv(:,:,kmax) * z_DelSigma(kmax)
do k = kmax-1, 1, -1
xyz_PiAdvSum(:,:,k) = xyz_PiAdvSum(:,:,k+1) + xyz_PiAdv(:,:,k) * z_DelSigma(k)
enddo
xyz_DivSum(:,:,kmax) = xyz_DivN(:,:,kmax) * z_DelSigma(kmax)
do k = kmax-1, 1, -1
xyz_DivSum(:,:,k) = xyz_DivSum(:,:,k+1) + xyz_DivN(:,:,k) * z_DelSigma(k)
enddo
! 地表面気圧時間変化の非重力波項 $ Z $ の計算
! Calculate non-gravity wave component of surface pressure tendency $ Z $
!
xy_DPiDtNG = - xyz_PiAdvSum(:,:,1)
! $ \dot{\sigma} $ の計算
! Calculate $ \dot{\sigma} $
!
do k = 1, kmax-1
xyr_SigDotN(:,:,k) = r_Sigma(k) * ( xyz_PiAdvSum(:,:,1) + xyz_DivSum(:,:,1) ) - ( xyz_PiAdvSum(:,:,k+1) + xyz_DivSum(:,:,k+1) )
xyr_SigDotNonG(:,:,k) = r_Sigma(k) * xyz_PiAdvSum(:,:,1) - xyz_PiAdvSum(:,:,k+1)
enddo
! $ \dot{\sigma} $ の上下境界値
! $ \dot{\sigma} $ on upper and lower boundary
!
xyr_SigDotN(:,:,0) = 0.
xyr_SigDotN(:,:,kmax) = 0.
xyr_SigDotNonG(:,:,0) = 0.
xyr_SigDotNonG(:,:,kmax) = 0.
! 温度の擾乱 (整数レベル), 仮温度, 仮温度の擾乱の計算
! Calculate temperature eddy (full level), virtual temperature,
! virtual temperature eddy
!
do k = 1, kmax
xyz_VirTemp(:,:,k) = xyz_TempN(:,:,k) * ( 1. + ((( 1. / EpsV ) - 1. ) * xyzf_QMixN(:,:,k,IndexH2OVap)) )
xyz_TempEdd(:,:,k) = xyz_TempN(:,:,k) - z_RefTemp(k)
xyz_VirTempEdd(:,:,k) = xyz_VirTemp(:,:,k) - z_RefTemp(k)
enddo
! 温度の擾乱 (半整数レベル) の計算
! Calculate temperature eddy (half level)
!
xyr_TempEdd(:,:,0) = 0.
xyr_TempEdd(:,:,kmax) = 0.
do k = 1, kmax-1
xyr_TempEdd(:,:,k) = z_TInpCoefA(k+1) * xyz_TempN(:,:,k+1) + z_TInpCoefB( k ) * xyz_TempN(:,:, k ) - r_RefTemp(k)
enddo
! 東西運動量移流項の計算
! Calculate advection of eastward momentum
!
xyz_UAdvN(:,:,1) = ( xyz_VorN(:,:,1) + xy_Cori ) * xyz_VCosLatN(:,:,1) - 1. / ( 2. * z_DelSigma(1) ) * xyr_SigDotN(:,:,1) * ( xyz_UCosLatN(:,:,1) - xyz_UCosLatN(:,:,2) ) - CpDry * z_TInpCoefK(1) * xyz_VirTempEdd(:,:,1) * xy_GradLambdaPiN
do k = 2, kmax-1
xyz_UAdvN(:,:,k) = ( xyz_VorN(:,:,k) + xy_Cori ) * xyz_VCosLatN(:,:,k) - 1. / ( 2. * z_DelSigma(k) ) * ( xyr_SigDotN(:,:,k-1) * ( xyz_UCosLatN(:,:,k-1) - xyz_UCosLatN(:,:,k) ) + xyr_SigDotN(:,:,k) * ( xyz_UCosLatN(:,:,k) - xyz_UCosLatN(:,:,k+1) ) ) - CpDry * z_TInpCoefK(k) * xyz_VirTempEdd(:,:,k) * xy_GradLambdaPiN
end do
xyz_UAdvN(:,:,kmax) = ( xyz_VorN(:,:,kmax) + xy_Cori ) * xyz_VCosLatN(:,:,kmax) - 1. / ( 2. * z_DelSigma(kmax) ) * xyr_SigDotN(:,:,kmax-1) * ( xyz_UCosLatN(:,:,kmax-1) - xyz_UCosLatN(:,:,kmax) ) - CpDry * z_TInpCoefK(kmax) * xyz_VirTempEdd(:,:,kmax) * xy_GradLambdaPiN
! 南北運動量移流項の計算
! Calculate advection of northward momentum
!
xyz_VAdvN(:,:,1) = - ( xyz_VorN(:,:,1) + xy_Cori ) * xyz_UCosLatN(:,:,1) - 1. / ( 2. * z_DelSigma(1) ) * xyr_SigDotN(:,:,1) * ( xyz_VCosLatN(:,:,1) - xyz_VCosLatN(:,:,2) ) - CpDry * z_TInpCoefK(1) * xyz_VirTempEdd(:,:,1) * xy_GradMuPiN
do k = 2, kmax-1
xyz_VAdvN(:,:,k) = - ( xyz_VorN(:,:,k) + xy_Cori ) * xyz_UCosLatN(:,:,k) - 1. / ( 2. * z_DelSigma(k) ) * ( xyr_SigDotN(:,:,k-1) * ( xyz_VCosLatN(:,:,k-1) - xyz_VCosLatN(:,:,k) ) + xyr_SigDotN(:,:,k) * ( xyz_VCosLatN(:,:,k) - xyz_VCosLatN(:,:,k+1) ) ) - CpDry * z_TInpCoefK(k) * xyz_VirTempEdd(:,:,k) * xy_GradMuPiN
end do
xyz_VAdvN(:,:,kmax) = - ( xyz_VorN(:,:,kmax) + xy_Cori ) * xyz_UCosLatN(:,:,kmax) - 1. / ( 2. * z_DelSigma(kmax) ) * xyr_SigDotN(:,:,kmax-1) * ( xyz_VCosLatN(:,:,kmax-1) - xyz_VCosLatN(:,:,kmax) ) - CpDry * z_TInpCoefK(kmax) * xyz_VirTempEdd(:,:,kmax) * xy_GradMuPiN
! 運動エネルギー項 (仮温度補正含む) の計算
! Calculate kinematic energy term
! (including virtual temperature correction)
!
call HydroGrid( xyz_VirTemp - xyz_TempN, xyz_KinEngyN ) ! (out)
do k = 1, kmax
xyz_KinEngyN(:,:,k) = xyz_KinEngyN(:,:,k) + ( xyz_UCosLatN(:,:,k)**2 + xyz_VCosLatN(:,:,k)**2 ) / ( 2. * ( 1. - xy_SinLat**2 ) )
end do
! 温度東西移流項, 温度南北移流項の計算
! Calculate eastward and northward advection of temperature
!
do k = 1, kmax
xyz_TempUAdvN(:,:,k) = xyz_UCosLatN(:,:,k) * xyz_TempEdd(:,:,k)
xyz_TempVAdvN(:,:,k) = xyz_VCosLatN(:,:,k) * xyz_TempEdd(:,:,k)
end do
! 温度の時間変化項 $ \hat{H} $ の計算
! Calculate temperature tendency term $ \hat{H} $
!
do k = 1, kmax-1
xyz_TempNonLinearN(:,:,k) = xyz_TempEdd(:,:,k) * xyz_DivN(:,:,k) - 1. / z_DelSigma(k) * ( xyr_SigDotN(:,:,k-1) * ( xyr_TempEdd(:,:,k-1) - xyz_TempEdd(:,:,k) ) + xyr_SigDotN(:,:,k) * ( xyz_TempEdd(:,:,k) - xyr_TempEdd(:,:,k) ) ) - 1. / z_DelSigma(k) * ( xyr_SigDotNonG(:,:,k-1) * ( r_RefTemp(k-1) - z_RefTemp(k) ) + xyr_SigDotNonG(:,:,k) * ( z_RefTemp(k) - r_RefTemp(k) ) ) + z_TInpCoefK(k) * xyz_VirTemp(:,:,k) * xyz_PiAdv(:,:,k) - z_HydroAlpha(k) / z_DelSigma(k) * ( xyz_VirTemp(:,:,k) * xyz_PiAdvSum(:,:,k) + xyz_VirTempEdd(:,:,k) * xyz_DivSum(:,:,k) ) - z_HydroBeta(k) / z_DelSigma(k) * ( xyz_VirTemp(:,:,k) * xyz_PiAdvSum(:,:,k+1) + xyz_VirTempEdd(:,:,k) * xyz_DivSum(:,:,k+1) )
enddo
xyz_TempNonLinearN(:,:,kmax) = xyz_TempEdd(:,:,kmax) * xyz_DivN(:,:,kmax) - 1. / z_DelSigma(kmax) * ( xyr_SigDotN(:,:,kmax-1) * ( xyr_TempEdd(:,:,kmax-1) - xyz_TempEdd(:,:,kmax) ) + xyr_SigDotN(:,:,kmax) * ( xyz_TempEdd(:,:,kmax) - xyr_TempEdd(:,:,kmax) ) ) - 1. / z_DelSigma(kmax) * ( xyr_SigDotNonG(:,:,kmax-1) * ( r_RefTemp(kmax-1) - z_RefTemp(kmax) ) + xyr_SigDotNonG(:,:,kmax) * ( z_RefTemp(kmax) - r_RefTemp(kmax) ) ) + z_TInpCoefK(kmax) * xyz_VirTemp(:,:,kmax) * xyz_PiAdv(:,:,kmax) - z_HydroAlpha(kmax) / z_DelSigma(kmax) * ( xyz_VirTemp(:,:,kmax) * xyz_PiAdvSum(:,:,kmax) + xyz_VirTempEdd(:,:,kmax) * xyz_DivSum(:,:,kmax) )
! 比湿東西移流項, 比湿南北移流項の計算
! Calculate eastward and northward advection of specific humidity
!
do n = 1, ncmax
do k = 1, kmax
xyzf_QMixUAdvN(:,:,k,n) = xyz_UCosLatN(:,:,k) * xyzf_QMixN(:,:,k,n)
xyzf_QMixVAdvN(:,:,k,n) = xyz_VCosLatN(:,:,k) * xyzf_QMixN(:,:,k,n)
end do
end do
! 比湿時間変化項 $ R $ の計算
! Calculate specific humidity tendency $ R $
!
do n = 1, ncmax
xyzf_QMixNonLinearN(:,:,1,n) = xyzf_QMixN(:,:,1,n) * xyz_DivN(:,:,1) - 1. / ( 2. * z_DelSigma(1) ) * xyr_SigDotN(:,:,1) * ( xyzf_QMixN(:,:,1,n) - xyzf_QMixN(:,:,2,n) )
do k = 2, kmax - 1
xyzf_QMixNonLinearN(:,:,k,n) = xyzf_QMixN(:,:,k,n) * xyz_DivN(:,:,k) - 1. / ( 2. * z_DelSigma(k) ) * ( xyr_SigDotN(:,:,k-1) * ( xyzf_QMixN(:,:,k-1,n) - xyzf_QMixN(:,:,k ,n) ) + xyr_SigDotN(:,:,k) * ( xyzf_QMixN(:,:,k ,n) - xyzf_QMixN(:,:,k+1,n) ) )
end do
xyzf_QMixNonLinearN(:,:,kmax,n) = xyzf_QMixN(:,:,kmax,n) * xyz_DivN(:,:,kmax) - 1. / ( 2. * z_DelSigma(kmax) ) * xyr_SigDotN(:,:,kmax-1) * ( xyzf_QMixN(:,:,kmax-1,n) - xyzf_QMixN(:,:,kmax,n) )
end do
end subroutine NonLinearOnGrid
| Subroutine : |
TimeIntegration で使用する係数の設定を行います. 初回および $ Delta t $ が変更された場合以外は, 前回に設定した値をそのまま用います.
Configure coefficients for "TimeIntegration". Setting values that are set last time are used, except when first time and Δt are changed.
subroutine SemiImplMatrix
!
! TimeIntegration で使用する係数の設定を行います.
! 初回および $ \Delta t $ が変更された場合以外は,
! 前回に設定した値をそのまま用います.
!
! Configure coefficients for "TimeIntegration".
! Setting values that are set last time are used,
! except when first time and Δt are changed.
!
! モジュール引用 ; USE statements
!
! 物理定数設定
! Physical constants settings
!
use constants, only: RPlanet, CpDry
! $ C_p $ [J kg-1 K-1].
! 乾燥大気の定圧比熱.
! Specific heat of air at constant pressure
! 座標データ設定
! Axes data settings
!
use axesset, only: r_Sigma, z_DelSigma ! $ \Delta \sigma $ (整数).
! $ \Delta \sigma $ (Full)
! 時刻管理
! Time control
!
use timeset, only: DelTime ! $ \Delta t $ [s]
! SPMODEL ライブラリ, 球面上の問題を球面調和函数変換により解く(多層対応)
! SPMODEL library, problems on sphere are solved with spherical harmonics (multi layer is supported)
!
use wa_module, only: l_nm
! LU 分解法により連立 1 次方程式を解くための関数 (spml 同梱モジュール)
! Functions to solve linear simultaneous equation by LU decomposition
! (a module included in spml)
!
use lumatrix, only: LUDecomp
! メッセージ出力
! Message output
!
use dc_message, only: MessageNotify
! デバッグ用ユーティリティ
! Utilities for debug
!
use dc_trace, only: DbgMessage, BeginSub, EndSub, Debug
! 宣言文 ; Declaration statements
!
implicit none
! TimeIntegration 等で使用する係数の設定のための作業変数
! Work variable for coefficients for "TimeIntegration", etc.
!
integer:: k, l, kk ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
integer:: n
! 実行文 ; Executable statement
!
! $ \Delta t $ [s] のチェック・保存
! Check and save $ \Delta t $ [s]
!
if ( DelTimeSave == DelTime ) return
DelTimeSave = DelTime
call DbgMessage( '%c: %c: (DelTime=%f [sec]) coefficients for "TimeIntegration" is generated. ', c1 = module_name, c2 = 'SemiImplMatrix', d = (/ DelTime /) )
! TimeIntegration で使用する係数の設定
! Configure coefficients for "TimeIntegration"
!
if ( .not. allocated( z_siMtxC ) ) allocate( z_siMtxC (1:kmax) )
if ( .not. allocated( z_siMtxG ) ) allocate( z_siMtxG (1:kmax) )
if ( .not. allocated( zz_siMtxH ) ) allocate( zz_siMtxH (1:kmax, 1:kmax) )
if ( .not. allocated( wz_siMtxDi ) ) allocate( wz_siMtxDi ((nmax+1)**2,1:kmax) )
if ( .not. allocated( zz_siMtxDiH ) ) allocate( zz_siMtxDiH (1:kmax, 1:kmax) )
if ( .not. allocated( wzz_siMtxWDiH ) ) allocate( wzz_siMtxWDiH((nmax+1)**2,1:kmax, 1:kmax) )
if ( .not. allocated( zz_siMtxGCt ) ) allocate( zz_siMtxGCt (1:kmax, 1:kmax) )
if ( .not. allocated( zz_siMtxW ) ) allocate( zz_siMtxW (1:kmax, 1:kmax) )
if ( .not. allocated( zz_siMtxQ ) ) allocate( zz_siMtxQ (1:kmax, 1:kmax) )
if ( .not. allocated( zz_siMtxS ) ) allocate( zz_siMtxS (1:kmax, 1:kmax) )
if ( .not. allocated( zz_siMtxR ) ) allocate( zz_siMtxR (1:kmax, 1:kmax) )
z_siMtxC = z_DelSigma
z_siMtxG = CpDry * z_TInpCoefK * z_RefTemp
do k = 1, kmax
do l = 1, kmax
zz_siMtxGCt(k,l) = z_siMtxG(k) * z_siMtxC(l)
end do
end do
zz_siMtxW = 0.
do k = 1, kmax
do l = 1, k
zz_siMtxW(k,l) = CpDry * z_HydroAlpha(l)
enddo
do l = 1, k-1
zz_siMtxW(k,l) = zz_siMtxW(k,l) + CpDry * z_HydroBeta(l)
enddo
enddo
zz_siMtxS = 0.
do k = 1, kmax
do l = 1, kmax
zz_siMtxS(k,l) = r_Sigma(k-1) * z_DelSigma(l)
enddo
do l = k, kmax
zz_siMtxS(k,l) = zz_siMtxS(k,l) - z_DelSigma(l)
enddo
enddo
zz_siMtxQ = 0.
do k = 1, kmax
zz_siMtxQ(k,k) = ( r_RefTemp(k-1) - z_RefTemp(k) ) / z_DelSigma(k)
enddo
do k = 1, kmax-1
zz_siMtxQ(k,k+1) = ( z_RefTemp(k) - r_RefTemp(k) ) / z_DelSigma(k)
enddo
zz_siMtxR = 0.
do k = 1, kmax
do l = k, kmax
zz_siMtxR(k,l) = - z_HydroAlpha(k) / z_DelSigma(k) * z_DelSigma(l) * z_RefTemp(k)
enddo
do l = k + 1, kmax
zz_siMtxR(k,l) = zz_siMtxR(k,l) - z_HydroBeta(k) / z_DelSigma(k) * z_DelSigma(l) * z_RefTemp(k)
enddo
enddo
zz_siMtxH = matmul(zz_siMtxQ, zz_siMtxS) - zz_siMtxR
! Check of coefficients for horizontal diffusion and sponge layer
! A threshold value used below is arbitrary.
!
do n = 1, (nmax+1)**2
do k = 1, kmax
if ( abs( 1.0d0 - 2.0d0 * DelTime * wz_DisCoefM(n,k) ) < 1.0d-10 ) then
call MessageNotify( 'E', module_name, 'Dissipation coefficient for momentum is inappropriate.' )
end if
if ( abs( 1.0d0 - 2.0d0 * DelTime * wz_DisCoefH(n,k) ) < 1.0d-10 ) then
call MessageNotify( 'E', module_name, 'Dissipation coefficient for heat is inappropriate.' )
end if
if ( abs( 1.0d0 - 2.0d0 * DelTime * wz_DisCoefQ(n,k) ) < 1.0d-10 ) then
call MessageNotify( 'E', module_name, 'Dissipation coefficient for composition is inappropriate.' )
end if
end do
end do
wz_siMtxDi = 1.0d0 / ( 1.0d0 - 2.0d0 * DelTime * wz_DisCoefH )
do n = 1, (nmax+1)**2
! NOTE: wz_siMtiDi is a diagonal matrix.
!
do k = 1, kmax
do kk = 1, kmax
zz_siMtxDiH(k,kk) = wz_siMtxDi(n,k) * zz_siMtxH(k,kk)
end do
end do
zz_siMtxDiH = matmul( zz_siMtxW, zz_siMtxDiH )
do k = 1, kmax
do kk = 1, kmax
wzz_siMtxWDiH(n,k,kk) = zz_siMtxDiH(k,kk)
end do
end do
end do
if ( .not. allocated(wzz_siMtxLU) ) allocate( wzz_siMtxLU((nmax+1)**2, 1:kmax, 1:kmax) )
if ( .not. allocated(wz_siMtxPiv) ) allocate( wz_siMtxPiv((nmax+1)**2, 1:kmax) )
! 行列 $ \underline{M} $ の計算
! Calculate matrix $ \underline{M} $
!
do k = 1, kmax
do kk = 1, kmax
wzz_siMtxLU ( :,k,kk ) = - DelTime**2 * wz_LaplaEigVal(:,1) * ( wzz_siMtxWDiH(:,k,kk) + zz_siMtxGCt(k,kk) )
if ( k == kk ) then
wzz_siMtxLU ( :,k,kk ) = wzz_siMtxLU ( :,k,kk ) + ( 1. - 2. * DelTime * wz_DisCoefM (:,k) )
endif
end do
end do
! LU 行列計算
! LU matrix calculation
!
call LUDecomp( wzz_siMtxLU, wz_siMtxPiv ) ! (out)
end subroutine SemiImplMatrix
| Subroutine : | |||
| w_SurfGeoPot((nmax+1)**2) : | real(DP), intent(in)
| ||
| wz_DVorDtNG((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wz_DDivDtNG((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wz_DTempDtNG((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wzf_DQMixDtN((nmax+1)**2, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| w_DPiDtNG((nmax+1)**2) : | real(DP), intent(in)
| ||
| wz_DivN((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wz_TempN((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| w_PiN((nmax+1)**2) : | real(DP), intent(in)
| ||
| wz_VorB((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wz_DivB((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wz_TempB((nmax+1)**2, 1:kmax) : | real(DP), intent(in)
| ||
| wzf_QMixB((nmax+1)**2, 1:kmax, 1:ncmax) : | real(DP), intent(in)
| ||
| w_PiB((nmax+1)**2) : | real(DP), intent(in)
| ||
| wz_VorA((nmax+1)**2, 1:kmax) : | real(DP), intent(out)
| ||
| wz_DivA((nmax+1)**2, 1:kmax) : | real(DP), intent(out)
| ||
| wz_TempA((nmax+1)**2, 1:kmax) : | real(DP), intent(out)
| ||
| wzf_QMixA((nmax+1)**2, 1:kmax, 1:ncmax) : | real(DP), intent(out)
| ||
| w_PiA((nmax+1)**2) : | real(DP), intent(out)
|
時間積分を行い, 時刻 $ t $ の物理量の時間変化と $ t-\Delta t$ の物理量から 時刻 $ t+Delta t $ の物理量を計算します.
時間積分法にはリープフロッグスキームを用いています. ただし拡散項には前方差分を用いています. デフォルトでは, $ Delta t $ を大きくとるために, 重力波項に セミインプリシット法を適用しています. NAMELIST#dynamics_hspl_vas83_nml の TimeIntegScheme を変更することで, 重力波項をエクスプリシット法によって解くことも可能です.
With time integration, calculate physical values at $ t+Delta t $ from tendency at $ t $ and physical values at $ t-\Delta t $ .
Leap-frog scheme is used as time integration scheme. And forward difference is used to diffusion terms. By default, semi-implicit scheme is applied to gravitational terms for extension of $ Delta t $ . Explicit scheme can be applied to gravitational terms by changing "TimeIntegScheme" in "NAMELIST#dynamics_hspl_vas83_nml".
subroutine TimeIntegration( w_SurfGeoPot, wz_DVorDtNG, wz_DDivDtNG, wz_DTempDtNG, wzf_DQMixDtN, w_DPiDtNG, wz_DivN, wz_TempN, w_PiN, wz_VorB, wz_DivB, wz_TempB, wzf_QMixB, w_PiB, wz_VorA, wz_DivA, wz_TempA, wzf_QMixA, w_PiA )
!
! 時間積分を行い,
! 時刻 $ t $ の物理量の時間変化と $ t-\Delta t$ の物理量から
! 時刻 $ t+\Delta t $ の物理量を計算します.
!
! 時間積分法にはリープフロッグスキームを用いています.
! ただし拡散項には前方差分を用いています.
! デフォルトでは, $ \Delta t $ を大きくとるために, 重力波項に
! セミインプリシット法を適用しています.
! NAMELIST#dynamics_hspl_vas83_nml の TimeIntegScheme を変更することで,
! 重力波項をエクスプリシット法によって解くことも可能です.
!
! With time integration, calculate physical values at $ t+\Delta t $
! from tendency at $ t $ and physical values at $ t-\Delta t $ .
!
! Leap-frog scheme is used as time integration scheme.
! And forward difference is used to diffusion terms.
! By default, semi-implicit scheme is applied to gravitational terms
! for extension of $ \Delta t $ .
! Explicit scheme can be applied to gravitational terms by changing
! "TimeIntegScheme" in "NAMELIST#dynamics_hspl_vas83_nml".
!
! モジュール引用 ; USE statements
!
! 物理定数設定
! Physical constants settings
!
use constants, only: RPlanet, CpDry
! $ C_p $ [J kg-1 K-1].
! 乾燥大気の定圧比熱.
! Specific heat of air at constant pressure
! 時刻管理
! Time control
!
use timeset, only: DelTime ! $ \Delta t $ [s]
! 座標データ設定
! Axes data settings
!
use axesset, only: z_DelSigma ! $ \Delta \sigma $ (整数).
! $ \Delta \sigma $ (Full)
! LU 分解法により連立 1 次方程式を解くための関数 (spml 同梱モジュール)
! Functions to solve linear simultaneous equation by LU decomposition
! (a module included in spml)
!
use lumatrix, only: LUSolve
! 文字列操作
! Character handling
!
use dc_string, only: LChar
implicit none
real(DP), intent(in):: w_SurfGeoPot ((nmax+1)**2)
! $ \Phi_s $ . 地表ジオポテンシャル.
! Surface geo-potential
real(DP), intent(in):: wz_DVorDtNG ((nmax+1)**2, 1:kmax)
! $ \left( \DD{\zeta}{t} (t) \right)^{NG}$ . 渦度変化の非重力波成分 (スペクトル).
! Non-gravity wave component of vorticity tendency (spectral)
real(DP), intent(in):: wz_DDivDtNG ((nmax+1)**2, 1:kmax)
! $ \DD{D}{t} (t) $ . 発散変化 (スペクトル).
! Divergence tendency (spectral)
real(DP), intent(in):: wz_DTempDtNG((nmax+1)**2, 1:kmax)
! $ \left( \DD{T}{t} (t) \right)^{NG}$ . 温度変化の非重力波成分 (スペクトル).
! Temperature tendency (spectral)
real(DP), intent(in):: wzf_DQMixDtN((nmax+1)**2, 1:kmax, 1:ncmax)
! $ \DD{q}{t} (t) $ . 比湿変化 (スペクトル).
! Specific humidity tendency (spectral)
real(DP), intent(in):: w_DPiDtNG((nmax+1)**2)
! $ \left( \DD{p_s}{t} (t) \right) $ . 地表面気圧変化の非重力波項 (スペクトル).
! Non-gravity wave component of surface pressure tendency (spectral)
real(DP), intent(in):: wz_DivN ((nmax+1)**2, 1:kmax)
! $ D (t) $ . 発散 (スペクトル).
! Divergence (spectral)
real(DP), intent(in):: wz_TempN ((nmax+1)**2, 1:kmax)
! $ T (t) $ . 温度 (スペクトル).
! Temperature (spectral)
real(DP), intent(in):: w_PiN ((nmax+1)**2)
! $ \pi = \ln p_s (t) $ . 地表面気圧 (スペクトル).
real(DP), intent(in):: wz_VorB ((nmax+1)**2, 1:kmax)
! $ \zeta (t-\Delta t) $ . 渦度 (スペクトル).
! Vorticity (spectral)
real(DP), intent(in):: wz_DivB ((nmax+1)**2, 1:kmax)
! $ D (t-\Delta t) $ . 発散 (スペクトル).
! Divergence (spectral)
real(DP), intent(in):: wz_TempB ((nmax+1)**2, 1:kmax)
! $ T (t-\Delta t) $ . 温度 (スペクトル).
! Temperature (spectral)
real(DP), intent(in):: w_PiB ((nmax+1)**2)
! $ \pi = \ln p_s (t-\Delta t) $ . 地表面気圧 (スペクトル).
! Surface pressure (spectral)
real(DP), intent(in):: wzf_QMixB((nmax+1)**2, 1:kmax, 1:ncmax)
! $ q (t-\Delta t) $ . 比湿 (スペクトル).
! Specific humidity (spectral)
real(DP), intent(out):: wz_VorA ((nmax+1)**2, 1:kmax)
! $ \zeta (t+\Delta t) $ . 渦度 (スペクトル).
! Vorticity (spectral)
real(DP), intent(out):: wz_DivA ((nmax+1)**2, 1:kmax)
! $ D (t+\Delta t) $ . 発散 (スペクトル).
! Divergence (spectral)
real(DP), intent(out):: wz_TempA ((nmax+1)**2, 1:kmax)
! $ T (t+\Delta t) $ . 温度 (スペクトル).
! Temperature (spectral)
real(DP), intent(out):: w_PiA ((nmax+1)**2)
! $ \pi = \ln p_s (t+\Delta t) $ . 地表面気圧 (スペクトル).
! Surface pressure (spectral)
real(DP), intent(out):: wzf_QMixA((nmax+1)**2, 1:kmax, 1:ncmax)
! $ q (t+\Delta t) $ . 比湿 (スペクトル).
! Specific humidity (spectral)
! 作業変数
! Work variables
!
real(DP):: wz_HDiv ((nmax+1)**2, 1:kmax)
real(DP):: w_CtDiv ((nmax+1)**2)
real(DP):: wz_WT ((nmax+1)**2, 1:kmax)
real(DP):: wz_siTemp ((nmax+1)**2, 1:kmax)
! 温度 (セミインプリシット法のための作業変数).
! Temperature (work variable for semi-implicit scheme)
real(DP):: w_siPi ((nmax+1)**2)
! $ \pi $ (セミインプリシット法のための作業変数).
! $ \pi $ (work variable for semi-implicit scheme)
real(DP):: wz_siPhi ((nmax+1)**2, 1:kmax)
! $ \Phi = \underline{W} ( 1 - 2 \Delta t \underline{D_H} ) \overline{ \Dvect{T} }^{t}$ .
! (セミインプリシット法のための作業変数).
! (Work variable for semi-implicit scheme)
real(DP):: wz_siVectF ((nmax+1)**2, 1:kmax)
! $ \Dvect{f} $ .
! 発散項に関するセミインプリシット方程式の右辺.
! Right-hand side of a semi-implicit equation of a divergence term.
real(DP):: wz_siDivAvrTime ((nmax+1)**2, 1:kmax)
! $ \overline{\Dvect{D}}^{t} $ .
! 時間平均の $ \Dvect{D} $ (セミインプリシット法のための作業変数).
! Time average $ \Dvect{D} $ (a work variable for semi-implicit scheme)
integer:: k, kk ! 鉛直方向に回る DO ループ用作業変数
! Work variables for DO loop in vertical direction
integer:: n ! 組成方向に回る DO ループ用作業変数
! Work variables for DO loop in dimension of constituents
! 実行文 ; Executable statement
!
! 時間積分. 拡散は前方差分
! Time integration. Forward difference is applied to diffusion
!
! 渦度 ; Vorticity
!
wz_VorA = ( 1. / ( 1. - 2. * DelTime * wz_DisCoefM ) ) * ( wz_VorB + 2. * DelTime * wz_DVorDtNG )
! 発散 ; Divergence
!
select case ( IDTimeIntegScheme )
case ( IDTimeIntegSchemeSemiImplicit )
! セミインプリシット法で用いる行列の計算に使われる項の計算
! Calculate terms used in making a matrix for semi-implicit method
!
wz_siTemp = ( 1. - DelTime * wz_DisCoefH ) * wz_TempB + DelTime * wz_DTempDtNG
! NOTE:
! The matrix wz_siMtxDi = ( 1 - 2 \Delta t D_H ) is diagonal matrix.
!
wz_siPhi (:,1) = CpDry * z_HydroAlpha(1) * wz_siMtxDi(:,1) * wz_siTemp(:,1)
do k = 2, kmax
wz_siPhi (:,k) = wz_siPhi(:,k-1) + CpDry * z_HydroAlpha(k ) * wz_siMtxDi(:,k ) * wz_siTemp(:,k ) + CpDry * z_HydroBeta (k-1) * wz_siMtxDi(:,k-1) * wz_siTemp(:,k-1)
end do
w_siPi = w_PiB + DelTime * w_DPiDtNG
! 発散方程式の右辺の計算
! Calculate right side of divergence equation
!
do k = 1, kmax
wz_siVectF(:,k) = ( 1. - DelTime * wz_DisCoefM (:,k) ) * wz_DivB(:,k) + DelTime * wz_DDivDtNG(:,k) - DelTime * wz_LaplaEigVal(:,1) * ( w_SurfGeoPot + wz_siPhi(:,k) + z_siMtxG(k) * w_siPi )
end do
! 時間平均の $ \Dvect{D} $ を LU 行列で解く
! Solve time average $ \Dvect{D} $ with LU matrix
!
wz_siDivAvrTime = LUSolve( wzz_siMtxLU, wz_siMtxPiv, wz_siVectF )
wz_DivA = 2. * wz_siDivAvrTime - wz_DivB
case ( IDTimeIntegSchemeExplicit )
wz_WT = 0.0d0
do k = 1, kmax
do kk = 1, kmax
wz_WT(:,k) = wz_WT(:,k) + zz_siMtxW(k,kk) * wz_TempN(:,kk)
end do
end do
do k = 1, kmax
wz_DivA(:,k) = ( 1. / ( 1. - 2. * DelTime * wz_DisCoefM(:,k) ) ) * ( wz_DivB(:,k) + 2. * DelTime * ( wz_DDivDtNG(:,k) - wz_LaplaEigVal(:,1) * ( w_SurfGeoPot + wz_WT(:,k) + z_siMtxG(k) * w_PiN ) ) )
end do
end select
! 温度 ; Temperature
!
select case ( IDTimeIntegScheme )
case ( IDTimeIntegSchemeSemiImplicit )
wz_HDiv = 0.
do k = 1, kmax
do kk = 1, kmax
wz_HDiv(:,k) = wz_HDiv(:,k) + zz_siMtxH(k,kk) * wz_siDivAvrTime(:,kk)
end do
end do
case ( IDTimeIntegSchemeExplicit )
wz_HDiv = 0.
do k = 1, kmax
do kk = 1, kmax
wz_HDiv(:,k) = wz_HDiv(:,k) + zz_siMtxH(k,kk) * wz_DivN(:,kk)
end do
end do
end select
wz_TempA = ( 1. / ( 1. - 2. * DelTime * wz_DisCoefH ) ) * ( wz_TempB + 2. * DelTime * ( wz_DTempDtNG - wz_HDiv ) )
! 地表面気圧 ; Surface pressure
!
select case ( IDTimeIntegScheme )
case ( IDTimeIntegSchemeSemiImplicit )
w_CtDiv = 0.0d0
do k = 1, kmax
w_CtDiv = w_CtDiv + z_siMtxC(k) * wz_siDivAvrTime(:,k)
end do
case ( IDTimeIntegSchemeExplicit )
w_CtDiv = 0.0d0
do k = 1, kmax
w_CtDiv = w_CtDiv + z_siMtxC(k) * wz_DivN(:,k)
end do
end select
w_PiA = w_PiB + 2. * DelTime * ( w_DPiDtNG - w_CtDiv )
! 比湿 ; Specific humidity
!
do n = 1, ncmax
wzf_QMixA(:,:,n) = ( 1. / ( 1. - 2. * DelTime * wz_DisCoefQ ) ) * ( wzf_QMixB(:,:,n) + 2. * DelTime * wzf_DQMixDtN(:,:,n) )
end do
end subroutine TimeIntegration
| Constant : | |||
| module_name = ‘dynamics_hspl_vas83‘ : | character(*), parameter
|
| Variable : | |||
| r_RefTemp(:) : | real(DP), allocatable
|
| Constant : | |||
| version = ’$Name: dcpam5-20100224 $’ // ’$Id: dynamics_hspl_vas83.F90,v 1.45 2009-10-25 03:16:04 morikawa Exp $’ : | character(*), parameter
|
| Variable : | |||
| wz_DisCoefH(:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| wz_DisCoefM(:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| wz_DisCoefQ(:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| wz_LaplaEigVal(:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| wz_siMtxDi(:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| wz_siMtxPiv(:,:) : | integer , save, allocatable
|
| Variable : | |||
| wzz_siMtxLU(:,:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| xy_Cori(:,:) : | real(DP), allocatable
|
| Variable : | |||
| z_HydroAlpha(:) : | real(DP), allocatable
|
| Variable : | |||
| z_HydroBeta(:) : | real(DP), allocatable
|
| Variable : | |||
| z_RefTemp(:) : | real(DP), allocatable
|
| Variable : | |||
| z_TInpCoefA(:) : | real(DP), allocatable
|
| Variable : | |||
| z_TInpCoefB(:) : | real(DP), allocatable
|
| Variable : | |||
| z_TInpCoefK(:) : | real(DP), allocatable
|
| Variable : | |||
| zz_siMtxGCt(:,:) : | real(DP), save, allocatable
|
| Variable : | |||||||||
| zz_siMtxR(:,:) : | real(DP), save, allocatable
|
| Variable : | |||
| zz_siMtxW(:,:) : | real(DP), save, allocatable
|