Class phy_ape In: physics/phy_ape.f90

# Aqua Planet Experiment

Note that Japanese and English are described in parallel.

• 簡易多色放射
• 鉛直拡散 (Mellor and Yamada, 1974, レベル 2)
• 地表フラックス (バルク法)
• 湿潤対流調節 (Manabe et al., 1965)
• 乾燥対流調節,
• 診断型大規模凝結

Physical processes are calculated for calculation of atmosphere on a planet covered with water globally. Physical processes calculated in this module is as follows.

• Radiation process represented by band model
• Vertical diffusion
• Surface flux (bulk formulae)
• Moist convective adjustment
• Dry convective adjustment
• Large scale condensation

## Procedures List

 Create : PHYAPE 型変数の初期設定 PhysicsAPE : 物理過程 (放射, 鉛直拡散, 地表フラックス) の計算 PhysicsAdjust : 物理過程 (湿潤対流調節, 診断型大規模凝結, 乾燥対流調節) の計算 Close : PHYAPE 型変数の終了処理 PutLine : PHYAPE 型変数に格納されている情報の印字 initialized : PHYAPE 型変数が初期設定されているか否か ———— : ———— Create : Constructor of "PHYAPE" PhysicsAPE : Calculate some physical processes (radiation, vertical diffusion, surface flux) PhysicsAdjust : Calculate some physical processes (moist convective adjustment, large scale condensation, dry convective adjustment) Close : Deconstructor of "PHYAPE" PutLine : Print information of "PHYAPE" initialized : Check initialization of "PHYAPE"

## Usage

In the begging of program, initialize "PHYAPE" by "Create". "PhysicsAPE" receives zonal and meridional wind, and temperature, specific humidity, surface pressure, and returns tendency of zonal and meridional wind, and temperature, specific humidity with physical processes (radiation etc.) "PhysicsAdjust" receives temperature, specific humidity, surface pressure, and adjusts them with cumulus parameterization etc., and returns them. Physical processes are calculate about the values. Finally, terminate "PHYAPE" by "Close".

## References

• Manabe, S., Smagorinsky, J., Strickler, R.F., 1965: Simulated climatology of a general circulation model with a hydrologic cycle. Mon. Weather Rev., 93, 769--798.
• Mellor, G. L, Yamada, T., 1974: A hierarchy of turbulence closure models for planetary boundary layers. J. Atmos. Sci., 31, 1791--1806.

### Included Modules

dc_types dc_date_types phy_ground phy_interpolate phy_neg_moist phy_cumulus_adjust phy_lscond phy_implicit phy_radiation_flux phy_verdiff phy_surface_flux phy_dryconv_adjust gt4_history dc_trace dc_present dc_message dc_error dc_string dc_date dc_iounit

### Public Instance methods

Close( phy_ape, [err] )
Subroutine :
phy_ape :type(PHYAPE), intent(inout)
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

PHYAPE 型の変数の終了処理を行います. なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

Deconstructor of "PHYAPE". Note that if phy_ape is not initialized by "Create" yet, error is occurred.

Alias for PhysApeClose

Create( phy_ape, imax, jmax, kmax, x_Lon, y_Lat, z_Sigma, r_Sigma, PI, RAir, Grav, Cp, EL, RVap, EpsV, ES0, StB, FKarm, DelTime, [x_Lon_Weight], [y_Lat_Weight], [current_time_value], [current_time_unit], [history_varlist], [history_interval_value], [history_interval_unit], [history_precision], [history_fileprefix], [nmlfile], [err] )
Subroutine :
phy_ape :type(PHYAPE), intent(inout)
imax :integer, intent(in)
 : 経度格子点数. Number of grid points in longitude
jmax :integer, intent(in)
 : 緯度格子点数. Number of grid points in latitude
kmax :integer, intent(in)
 : 鉛直層数. Number of vertical level
x_Lon(0:imax-1) :real(DP), intent(in)
 : 経度. Longitude
y_Lat(0:jmax-1) :real(DP), intent(in)
 : 緯度. Latitude
z_Sigma(0:kmax-1) :real(DP), intent(in)
 : $sigma$ レベル (整数). Full $sigma$ level
r_Sigma(0:kmax) :real(DP), intent(in)
 : $sigma$ レベル (半整数). Half $sigma$ level
PI :real(DP), intent(in)
 : $pi$ . 円周率. Circular constant
RAir :real(DP), intent(in)
 : $R$ . 大気気体定数. Gas constant of air
Grav :real(DP), intent(in)
 : $g$ . 重力加速度. Gravitational acceleration
Cp :real(DP), intent(in)
 : $C_p$ . 大気定圧比熱. Specific heat of air at constant pressure
EL :real(DP), intent(in)
 : $L$ . 水の凝結の潜熱. Latent heat of condensation of water vapor
RVap :real(DP), intent(in)
 : $R_v$ . 水蒸気気体定数. Gas constant of water vapor
EpsV :real(DP), intent(in)
 : $epsilon_v$ . 水蒸気分子量比. Molecular weight ratio of water vapor
ES0 :real(DP), intent(in)
 : $e^{*}$ (273K) . 0 ℃での飽和蒸気圧. Saturated vapor pressure at 0 degrees C
StB :real(DP), intent(in)
 : $sigma_{SB}$ . ステファンボルツマン定数. Stefan-Boltzmann constant
FKarm :real(DP), intent(in)
 : $k$ . カルマン定数. Karman constant
DelTime :real(DP), intent(in)
 : $Delta t$ . タイムステップ. Time step
x_Lon_Weight(0:imax-1) :real(DP), intent(in), optional
 : 経度座標重み. Weight of longitude
y_Lat_Weight(0:jmax-1) :real(DP), intent(in), optional
 : 緯度座標重み. Weight of latitude
current_time_value :real(DP), intent(in), optional
 : 現在時刻の数値. Numerical value of current time
current_time_unit :character(*), intent(in), optional
 : 現在時刻の単位. Unit of current time
history_varlist :character(*), intent(in), optional
 : ヒストリデータの出力変数リスト. カンマで区切って並べる. (例: "Rain,RadLFlux,RadSFlux" ). List of variables output to history data. Delimiter is comma. (exp. "Rain,RadLFlux,RadSFlux" ).
history_interval_value :real(DP), intent(in), optional
 : ヒストリデータの出力間隔の数値. Numerical value for interval of history data output
history_interval_unit :character(*), intent(in), optional
 : ヒストリデータの出力間隔の単位. Unit for interval of history data output
history_precision :character(*), intent(in), optional
 : ヒストリデータの精度. Precision of history data
history_fileprefix :character(*), intent(in), optional
 : ヒストリデータのファイル名の接頭詞. Prefix of history data filenames
nmlfile :character(*), intent(in), optional
 : NAMELIST ファイルの名称. この引数に空文字以外を与えた場合, 指定されたファイルから NAMELIST 変数群を読み込みます. ファイルを読み込めない場合にはエラーを 生じます. NAMELIST 変数群の詳細に関しては NAMELIST#phy_ape_nml を参照してください. NAMELIST file name. If nonnull character is specified to this argument, NAMELIST group name is loaded from the file. If the file can not be read, an error occurs. See "NAMELIST#phy_ape_nml" for details about a NAMELIST group.
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

PHYAPE 型の変数の初期設定を行います. 他のサブルーチンを使用する前に必ずこのサブルーチンによって PHYAPE 型の変数を初期設定してください.

なお, 与えられた phy_ape が既に初期設定されている場合, プログラムはエラーを発生させます.

NAMELIST を利用する場合には引数 nmlfileNAMELIST ファイル名 を与えてください. NAMELIST 変数群の詳細に関しては NAMELIST#phy_ape_nml を参照してください.

Constructor of "PHYAPE". Initialize phy_ape by this subroutine, before other procedures are used,

Note that if phy_ape is already initialized by this procedure, error is occurred.

In order to use NAMELIST, specify a NAMELIST filename to argument nmlfile. See "NAMELIST#phy_ape_nml" for details about a NAMELIST group.

Alias for PhysApeCreate

PHYAPE
Derived Type :
initialized = .false. :logical
 : 初期設定フラグ. Initialization flag
imax :integer
 : 経度格子点数. Number of grid points in longitude
jmax :integer
 : 緯度格子点数. Number of grid points in latitude
kmax :integer
 : 鉛直層数. Number of vertical level
x_Lon(:) =>null() :real(DP), pointer
 : 経度. Longitude
x_Lon_Weight(:) =>null() :real(DP), pointer
 : 経度座標重み. Weight of longitude
y_Lat(:) =>null() :real(DP), pointer
 : 緯度. Latitude
y_Lat_Weight(:) =>null() :real(DP), pointer
 : 緯度座標重み. Weight of latitude
z_Sigma(:) =>null() :real(DP), pointer
 : $sigma$ レベル (整数). Full $sigma$ level
r_Sigma(:) =>null() :real(DP), pointer
 : $sigma$ レベル (半整数). Half $sigma$ level
PI :real(DP)
 : $pi$ . 円周率. Circular constant
DelTime :real(DP)
 : $Delta t$ . タイムステップ. Time step
current_time :type(DC_DIFFTIME)
 : 現在時刻. Current time.
delta_time :type(DC_DIFFTIME)
 : $Delta t$ . タイムステップ. Time step
phy_grd :type(PHYGRD)
phy_intpol :type(PHYINTPOL)
phy_neg_mst :type(PHYNEGMST)
phy_lsc :type(PHYLSC)
phy_impl :type(PHYIMPL)
phy_vdif :type(PHYVDIF)
phy_surfflx :type(PHYSURFFLX)
phy_dryconv :type(PHYDRYCONV)
history_varlist_array(:) =>null() :character(TOKEN), pointer
 : ヒストリデータの出力変数リスト. List of variables output to history data.
history_fileprefix :character(STRING)
 : ヒストリデータのファイル名の接頭詞. Prefix of history data filenames
hist_nml(:) =>null() :type(PHYAPE_HISTNML), pointer
 : NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. この配列の 1 番目にはデフォルトの設定が格納 され, 2 番目以降に個別の設定が格納される. Individual data output information from "NAMELIST#phy_ape_history_nml". Default settings are stored in the first element of this array, and individual settings are stored in the second or more.
gthist_surfstressx =>null() :type(GT_HISTORY), pointer
gthist_surfstressy =>null() :type(GT_HISTORY), pointer
gthist_sensheatflux =>null() :type(GT_HISTORY), pointer
gthist_latentheatflux =>null() :type(GT_HISTORY), pointer
gthist_rain =>null() :type(GT_HISTORY), pointer
gthist_cumrain =>null() :type(GT_HISTORY), pointer
gthist_lscrain =>null() :type(GT_HISTORY), pointer
gthist_radlflux =>null() :type(GT_HISTORY), pointer
gthist_radsflux =>null() :type(GT_HISTORY), pointer
gthist_dnegqvapdt =>null() :type(GT_HISTORY), pointer
gthist_dcumlsctempdt =>null() :type(GT_HISTORY), pointer
gthist_dcumlscqvapdt =>null() :type(GT_HISTORY), pointer
gthist_dlsctempdt =>null() :type(GT_HISTORY), pointer
gthist_dlscqvapdt =>null() :type(GT_HISTORY), pointer
gthist_dcumtempdt =>null() :type(GT_HISTORY), pointer
gthist_dcumqvapdt =>null() :type(GT_HISTORY), pointer
gthist_ddrytempdt =>null() :type(GT_HISTORY), pointer
gthist_dpsdt =>null() :type(GT_HISTORY), pointer
gthist_dradltempdt =>null() :type(GT_HISTORY), pointer
gthist_dradstempdt =>null() :type(GT_HISTORY), pointer
gthist_dverdiffudt =>null() :type(GT_HISTORY), pointer
gthist_dverdiffvdt =>null() :type(GT_HISTORY), pointer
gthist_dverdifftempdt =>null() :type(GT_HISTORY), pointer
gthist_dverdiffqvapdt =>null() :type(GT_HISTORY), pointer

まず, Create で "PHYAPE" 型の変数を初期設定して下さい. 初期設定された "PHYAPE" 型の変数を再度利用する際には, Close によって終了処理を行ってください.

Initialize "PHYAPE" variable by "Create" before usage. If you reuse "PHYAPE" variable again for another application, terminate by "Close".

PHYAPE_HISTNML
Derived Type :
name :character(TOKEN)
 : 変数名. Variable name
file :character(STRING)
 : ヒストリデータのファイル名. History data filenames
history_interval_time :type(DC_DIFFTIME)
 : ヒストリデータの出力間隔. Interval of history data output
history_interval_value :real(DP)
 : ヒストリデータの出力間隔の数値. Numerical value for interval of history data output
history_interval_unit :character(TOKEN)
 : ヒストリデータの出力間隔の単位. Unit for interval of history data output
history_precision :character(TOKEN)
 : ヒストリデータの精度. Precision of history data
history_average :logical
 : 出力データの平均化フラグ. Flag for average of output data.
dummy0 :logical
 : 8 ビット境界用のダミー変数. Dummy variable for 8 bit boundary

NAMELIST#phy_ape_history_nml からデータの出力情報 を個別に取得するための構造データ型です. 外部からの参照は 行わないでください.

This derived type is worked for input information about data output individually from "NAMELIST#phy_ape_history_nml" Do not refer this derived type externally.

PhysicsAPE( phy_ape, xyz_U, xyz_V, xyz_Temp, xy_Ps, xyz_QVap, xyz_DUDt, xyz_DVDt, xyz_DTempDt, xyz_DQVapDt, [historyput_flag], [err] )
Subroutine :
phy_ape :type(PHYAPE), intent(inout)
xyz_U(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)
 : $u$ . 東西風速. Zonal wind
xyz_V(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)
 : $v$ . 南北風速. Meridional wind
xyz_Temp(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)
 : $T$ . 温度. Temperature
xy_Ps(0:phy_ape%imax-1, 0:phy_ape%jmax-1) :real(DP), intent(in)
 : $p_s$ . 地表面気圧. Surface pressure
xyz_QVap(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)
 : $q$ . 比湿. Specific humidity
xyz_DUDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)
 : $DP{u}{t}$ . 東西風速変化. Zonal wind tendency
xyz_DVDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)
 : $DP{v}{t}$ . 南北風速変化. Meridional wind tendency
xyz_DTempDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)
 : $DP{T}{t}$ . 温度変化. Temperature tendency
xyz_DQVapDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)
 : $DP{q}{t}$ . 比湿変化. Temperature tendency
historyput_flag :logical, intent(in), optional
 : データ出力のフラグ. SetTime によって時刻を明示的に 指定した場合には, この引数に .true. または .false. を指定する ことでデータ出力のオンオフを 明示的に指定する必要があります. デフォルトは .false. です. Data output flag. When time is specified by "SetTime", explicit specification of data output on/off by specifying ".true." or ".false." to this argument. Default value is ".false.".
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

Some physical processes (radiation, vertical diffusion, etc) are calculated, and tendencies of velocity, temperature, surface pressure, specific humidity are returned. See "phy_ape" for detail.

If phy_ape is not initialized by "Create" yet, error is occurred.

Alias for PhysApePhysicsAPE

PhysicsAdjust( phy_ape, xyz_Temp, xy_Ps, xyz_QVap, [historyput_flag], [err] )
Subroutine :
phy_ape :type(PHYAPE), intent(inout)
xyz_Temp(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(inout)
 : $T$ . 温度. Temperature
xy_Ps(0:phy_ape%imax-1, 0:phy_ape%jmax-1) :real(DP), intent(inout)
 : $p_s$ . 地表面気圧. Surface pressure
xyz_QVap(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(inout)
 : $q$ . 比湿. Specific humidity
historyput_flag :logical, intent(in), optional
 : データ出力のフラグ. SetTime によって時刻を明示的に 指定した場合には, この引数に .true. または .false. を指定する ことでデータ出力のオンオフを 明示的に指定する必要があります. デフォルトは .false. です. Data output flag. When time is specified by "SetTime", explicit specification of data output on/off by specifying ".true." or ".false." to this argument. Default value is ".false.".
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

Some physical processes (cumulus parameterization, dry convective adjustment, etc) are calculated, and velocity, temperature, surface pressure, specific humidity are adjusted and returned. See "phy_ape" for detail.

If phy_ape is not initialized by "Create" yet, error is occurred.

PutLine( phy_ape, [unit], [indent], [err] )
Subroutine :
phy_ape :type(PHYAPE), intent(in)
unit :integer, intent(in), optional
 : 出力先の装置番号. デフォルトの出力先は標準出力. Unit number for output. Default value is standard output.
indent :character(*), intent(in), optional
 : 表示されるメッセージの字下げ. Indent of displayed messages.
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

Print information of phy_ape. By default messages are output to standard output. Unit number for output can be changed by unit argument.

Alias for PhysApePutLine

initialized( phy_ape ) result(result)
 Function : result : logical phy_ape : type(PHYAPE), intent(in)

phy_ape が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります.

If phy_ape is initialized, .true. is returned. If phy_ape is not initialized, .false. is returned.

Alias for PhysApeInitialized

### Private Instance methods

HstNmlAssoc( name, hist_nml, hptr, [err] )
Subroutine :
name :character(*), intent(in)
 : 変数名. Variable name
hist_nml(:) :type(PHYAPE_HISTNML), pointer
 : (in) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. この配列の 1 番目にはデフォルトの設定が格納 され, 2 番目以降に個別の設定が格納される. Individual data output information from "NAMELIST#phy_ape_history_nml". Default settings are stored in the first element of this array, and individual settings are stored in the second or more.
hptr :type(PHYAPE_HISTNML), pointer
 : (out) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. Individual data output information from "NAMELIST#phy_ape_history_nml"
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

データ出力情報が格納されたポインタ配列 hist_nml 内の name に該当するデータの情報へ hptr を結合して返します.

hist_nml が割り付けられていない場合, エラーを返します.

Associate hptr to information of data correspond to name stored in pointer array hist_nml, and return it.

If hist_nml is not allocated, error is occured.

Alias for PhysApeHstNmlAssoc

HstSetXYZR( phy_ape, file, hptr, history, xdim, ydim, zdim, rdim, timedim, [err] )
Subroutine :
phy_ape :type(PHYAPE), intent(inout)
file :character(*), intent(in)
 : ヒストリデータのファイル名. History data filenames
hptr :type(PHYAPE_HISTNML), pointer
 : (in) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. Individual data output information from "NAMELIST#phy_ape_history_nml"
history :type(GT_HISTORY), pointer
 : (out) gt4_history モジュール用構造体. Derived type for "gt4_history" module
xdim :character(*), intent(out)
 : 経度の名称. Name of longitude
ydim :character(*), intent(out)
 : 緯度の名称. Name of latitude
zdim :character(*), intent(out)
 : $sigma$ レベル (整数) の名称. Name of full $sigma$ level
rdim :character(*), intent(out)
 : $sigma$ レベル (半整数) の名称. Name of half $sigma$ level
timedim :character(*), intent(out)
 : 時刻の名称. Name of time
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

このサブルーチンはモジュール内からの出力データの初期設定を行います. 内部的に使用されることを想定しているため, モジュール外部からは 呼び出さないでください.

file に与えられた名前のファイルをオープンし, ファイル ID などが 格納された GT_HISTORY 変数 history を返します. history は空状態にして与えてください.

なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

This subroutine initializes settings of data output from this module. It is expected that this subroutine is used internally, so do not refer from the outside.

A file with name file is opened, and "GT_HISTORY" variable history that stores file ID etc. is returned. Give disassociated history.

If phy_ape is not initialized by "Create" yet, error is occurred.

Alias for PhysApeHstSetXYZR

NmlRead( nmlfile, history_varlist_, history_fileprefix_, hist_nml, [err] )
Subroutine :
nmlfile :character(*), intent(in)
 : NAMELIST ファイルの名称. NAMELIST file name
history_varlist_ :character(*), intent(inout)
history_fileprefix_ :character(*), intent(inout)
hist_nml(:) :type(PHYAPE_HISTNML), pointer
 : (inout) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. この配列の 1 番目にはデフォルトの設定が格納 され, 2 番目以降に個別の設定が格納される. Individual data output information from "NAMELIST#phy_ape_history_nml". Default settings are stored in the first element of this array, and individual settings are stored in the second or more.
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

NAMELIST ファイル nmlfile から値を入力するための 内部サブルーチンです. Create 内で呼び出されることを 想定しています.

なお, nmlfile に空文字が与えられた場合, または 与えられた nmlfile を読み込むことができない場合, プログラムはエラーを発生させます.

This is an internal subroutine to input values from NAMELIST file nmlfile. This subroutine is expected to be called by "Create".

A value not specified in NAMELIST file is returned without change.

If nmlfile is empty, or nmlfile can not be read, error is occurred.

This procedure input/output NAMELIST#phy_ape_varlist_nml, NAMELIST#phy_ape_history_nml .

Subroutine :
phy_ape :type(PHYAPE), intent(inout)
xyz_Temp(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(inout)
 : $T$ . 温度. Temperature
xy_Ps(0:phy_ape%imax-1, 0:phy_ape%jmax-1) :real(DP), intent(inout)
 : $p_s$ . 地表面気圧. Surface pressure
xyz_QVap(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(inout)
 : $q$ . 比湿. Specific humidity
historyput_flag :logical, intent(in), optional
 : データ出力のフラグ. SetTime によって時刻を明示的に 指定した場合には, この引数に .true. または .false. を指定する ことでデータ出力のオンオフを 明示的に指定する必要があります. デフォルトは .false. です. Data output flag. When time is specified by "SetTime", explicit specification of data output on/off by specifying ".true." or ".false." to this argument. Default value is ".false.".
err :logical, intent(out), optional
 : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort.

なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます.

Some physical processes (cumulus parameterization, dry convective adjustment, etc) are calculated, and velocity, temperature, surface pressure, specific humidity are adjusted and returned. See "phy_ape" for detail.

If phy_ape is not initialized by "Create" yet, error is occurred.

[Source]

subroutine PhysApeAdjust( phy_ape, xyz_Temp, xy_Ps, xyz_QVap, historyput_flag, err )
!
! 積雲パラメタリゼーションや乾燥対流調節など, いくつかの物理過程
! を計算し, 与えられた風速, 温度, 地表面気圧, 比湿を調節して
! 返します. 詳細は phy_ape を参照してください.
!
! なお, 与えられた *phy_ape* が Create によって初期設定
! されていない場合, プログラムはエラーを発生させます.
!
! Some physical processes (cumulus parameterization,
! dry convective adjustment, etc)
! are calculated, and velocity, temperature,
! surface pressure, specific humidity are adjusted and returned.
! See "phy_ape" for detail.
!
! If *phy_ape* is not initialized by "Create" yet,
! error is occurred.
!
use phy_interpolate, only: InterpolateTemp, InterpolateGeoPot
use phy_neg_moist, only: RemoveNegQVap
use phy_cumulus_adjust, only: Cumulus
use phy_lscond, only: LScaleCond
use phy_implicit, only: GetMatrices, Integrate
use dc_trace, only: BeginSub, EndSub
use dc_types, only: DP, STRING, TOKEN, STDOUT
use dc_present, only: present_and_true
use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT
use dc_string, only: PutLine, Split, StrInclude
use dc_date, only: EvalSec, EvalByUnit, mod, operator(*), operator(==), operator(<), operator(/), operator(+), operator(-)
use gt4_history, only: HistoryPut
implicit none
type(PHYAPE), intent(inout):: phy_ape
real(DP), intent(inout):: xyz_Temp (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1)
! $T$ .     温度. Temperature
real(DP), intent(inout):: xy_Ps (0:phy_ape%imax-1, 0:phy_ape%jmax-1)
! $p_s$ .   地表面気圧. Surface pressure
real(DP), intent(inout):: xyz_QVap (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1)
! $q$ .     比湿. Specific humidity
logical, intent(in), optional:: historyput_flag
! データ出力のフラグ.
! SetTime によって時刻を明示的に
! 指定した場合には, この引数に
! .true. または .false. を指定する
! ことでデータ出力のオンオフを
! 明示的に指定する必要があります.
! デフォルトは .false. です.
!
! Data output flag.
! When time is specified by "SetTime",
! explicit specification of data output
! on/off by specifying ".true." or ".false."
! to this argument.
! Default value is ".false.".
!
logical, intent(out), optional:: err
! 例外処理用フラグ.
! デフォルトでは, この手続き内でエラーが
! 生じた場合, プログラムは強制終了します.
! 引数 *err* が与えられる場合,
! プログラムは強制終了せず, 代わりに
! *err* に .true. が代入されます.
!
! Exception handling flag.
! By default, when error occur in
! this procedure, the program aborts.
! If this *err* argument is given,
! .true. is substituted to *err* and
! the program does not abort.

!-----------------------------------
!  *phy_ape* から取り出される設定値
!  Setting values fetched from *phy_ape*
integer:: kmax ! 鉛直層数.
! Number of vertical level
real(DP):: DelTime    ! $\Delta t$ . タイムステップ. Time step

!-----------------------------------
!  負の比湿除去による地表面気圧の変化
!  Surface pressure tendency for removal of negative moisture
real(DP):: xy_DPsDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1)
! $\DP{p_s}{t}$ .
! 負の比湿除去による地表面気圧の変化.
! Surface pressure tendency for removal of negative moisture

!!$!----------------------------------- !!$    !  入力値の保存用変数
!!$! Variables for saving input value !!$    real(DP):: xy_PsB (0:phy_ape%imax-1, 0:phy_ape%jmax-1)
!!$!$ p_s $. 地表面気圧. Surface pressure !----------------------------------- ! 温度 (整数レベル) と地表面気圧から内挿されるデータ ! Data interpolated from temperature (full level) and surface pressure real(DP):: xyr_Temp (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) !$ T $. 温度 (半整数レベル). ! Temperature (half level) real(DP):: xyz_Press (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ p $. 気圧 (整数レベル). ! Air pressure (full level) real(DP):: xyr_Press (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) !$ p $. 気圧 (半整数レベル). ! Air pressure (half level) real(DP):: xyz_GeoPot (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \phi $. ジオポテンシャル (整数レベル). ! Geo-potential (full level) real(DP):: xyr_GeoPot (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) !$ \phi $. ジオポテンシャル (半整数レベル). ! Geo-potential (half level) !----------------------------------- ! 負の水蒸気除去に使用される量 ! Values for removal of negative moisture real(DP):: xyz_DNegQVap1Dt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 比湿変化率 (1). ! Specific humidity tendency (1) real(DP):: xyz_DNegQVap2Dt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 比湿変化率 (2). ! Specific humidity tendency (2) !----------------------------------- ! 湿潤過程 (積雲) で計算される量 ! Values calculated by moist process (cumulus) real(DP):: xy_CumulusRain (0:phy_ape%imax-1, 0:phy_ape%jmax-1) ! 積雲スキームによる降水量. ! Precipitation by cumulus scheme real(DP):: xyz_DCumulusTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 積雲スキームによる温度変化率. ! Temperature tendency by cumulus scheme real(DP):: xyz_DCumulusQVapDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 積雲スキームによる比湿変化率. ! Specific humidity tendency by cumulus scheme !----------------------------------- ! 湿潤過程 (大規模凝結) で計算される量 ! Values calculated by moist process (large scale condensation) real(DP):: xyz_DLscTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 大規模凝結による温度変化率. ! Temperature tendency by large scale condensation real(DP):: xyz_DLscQVapDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 大規模凝結による比湿変化率. ! Specific humidity tendency by large scale condensation real(DP):: xy_LscRain (0:phy_ape%imax-1, 0:phy_ape%jmax-1) ! 大規模凝結による降水量. ! Precipitation by large scale condensation !----------------------------------- ! 乾燥対流調節で計算される量 ! Values calculated by dry convective adjustment real(DP):: xyz_DDryTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 乾燥対流調節による温度変化率. ! Temperature tendency by dry convective adjustment !----------------------------------- ! ヒストリファイルへのデータ出力設定 ! Configure the settings for history data output character(TOKEN):: name ! 変数名. Variable name type(PHYAPE_HISTNML), pointer:: hptr =>null() ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" !----------------------------------- ! 作業変数 ! Work variables integer:: k ! DO ループ用作業変数 ! Work variables for DO loop integer:: stat character(STRING):: cause_c character(*), parameter:: subname = 'PhysApeAdjust' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 初期設定のチェック ! Check initialization !----------------------------------------------------------------- if ( .not. phy_ape % initialized ) then stat = DC_ENOTINIT cause_c = 'PHYAPE' goto 999 end if !----------------------------------------------------------------- ! *phy_ape* に格納されている設定値の取り出し ! Fetch setting values stored in *phy_ape* !----------------------------------------------------------------- kmax = phy_ape % kmax DelTime = phy_ape % DelTime !!$    !-----------------------------------------------------------------
!!$! 入力値の保存 !!$    !  Save input value
!!$!----------------------------------------------------------------- !!$    xy_PsB = xy_Ps

!-----------------------------------------------------------------
!  温度の半整数 $\sigma$ レベルの補間, 気圧とジオポテンシャルの算出 (1)
!  Interpolate temperature on half $\sigma$ level, and
!  calculate pressure and geo-potential (1)
!-----------------------------------------------------------------

!-----------------------------------
!  温度の半整数 $\sigma$ レベルの補間
!  Interpolate temperature on half $\sigma$ level
call InterpolateTemp( phy_intpol = phy_ape % phy_intpol, xyz_Temp   = xyz_Temp, xyr_Temp   = xyr_Temp, err = err )                                             ! (out)

!-----------------------------------
!  気圧とジオポテンシャルの算出
!  Calculate pressure and geo-potential
call InterpolateGeoPot( phy_intpol = phy_ape % phy_intpol, xy_Ps      = xy_Ps, xyz_Temp   = xyz_Temp,   xyr_Temp   = xyr_Temp, xyz_Press  = xyz_Press,  xyr_Press  = xyr_Press, xyz_GeoPot = xyz_GeoPot, xyr_GeoPot = xyr_GeoPot, err = err )                                               ! (out)

!-----------------------------------------------------------------
!  負の水蒸気除去 (1)
!  Remove negative moisture (1)
!-----------------------------------------------------------------
xyz_DNegQVap1Dt = 0.0_DP
call RemoveNegQVap( phy_neg_mst = phy_ape % phy_neg_mst, xyr_Press = xyr_Press, xyz_QVap = xyz_QVap, xyz_DNegQVapDt = xyz_DNegQVap1Dt, err = err )                                              ! (out)

!-----------------------------------------------------------------
!  湿潤過程 (積雲)
!  Moist process (cumulus)
!-----------------------------------------------------------------
call Cumulus( phy_cumad = phy_ape % phy_cumad, xyz_Temp  = xyz_Temp,   xyz_QVap  = xyz_QVap, xyz_Press = xyz_Press,  xyr_Press = xyr_Press, xy_Rain = xy_CumulusRain, xyz_DTempDt = xyz_DCumulusTempDt, xyz_DQVapDt = xyz_DCumulusQVapDt, err = err )                                      ! (out)

!-----------------------------------------------------------------
!  湿潤過程 (大規模凝結)
!  Moist process (large scale condensation)
!-----------------------------------------------------------------
call LScaleCond( phy_lsc = phy_ape % phy_lsc, xyz_Temp  = xyz_Temp,   xyz_QVap  = xyz_QVap, xyz_Press = xyz_Press,  xyr_Press = xyr_Press, xy_Rain = xy_LscRain, xyz_DTempDt = xyz_DLscTempDt, xyz_DQVapDt = xyz_DLscQVapDt, err = err )                                       ! (out)

!-----------------------------------------------------------------
!  乾燥対流調節
!  Dry convective adjustment
!-----------------------------------------------------------------
call DryConvectAdjust( phy_dryconv = phy_ape % phy_dryconv, xyz_Press = xyz_Press, xyr_Press = xyr_Press, xyz_Temp = xyz_Temp, xyz_DTempDt = xyz_DDryTempDt, err = err )                                               ! (out)

!-----------------------------------------------------------------
!  負の水蒸気除去 (2)
!  Remove negative moisture (2)
!-----------------------------------------------------------------
xyz_DNegQVap2Dt = 0.0_DP
call RemoveNegQVap( phy_neg_mst = phy_ape % phy_neg_mst, xyr_Press = xyr_Press, xyz_QVap = xyz_QVap, xyz_DNegQVapDt = xyz_DNegQVap2Dt, err = err )                                              ! (out)

!!$! ※ AGCM5 にはなかった, 地表面気圧の再計算 !!$    !    (比湿が減った分だけ気圧を減らす??) をここにいったん退避する.
!!$! やまだ由さん作成の dcpam3 に導入された物理過程に入ってた. !!$
!!$!----------------------------------- ※ これにいたっては PhysicsAPE にないといけないが.... !!$    !  地表面気圧の再計算
!!$! Recalculate surface pressure !!$    do k = 0, kmax - 1
!!$xy_Ps = xy_Ps & !!$        &     + xyz_DQVapDt(:,:,k)  &
!!$& * ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) & !!$        &       * 2.0_DP * DelTime
!!$end do !!$
!!$!----------------------------------- !!$    !  地表面気圧の再計算
!!$! Recalculate surface pressure !!$    do k = 0, kmax - 1
!!$xy_Ps = xy_Ps & !!$        &     + (   xyz_DLscQVapDt(:,:,k) &
!!$& + xyz_DCumulusQVapDt(:,:,k) & !!$        &         + xyz_DNegQVap1Dt(:,:,k)     ) &
!!$& * ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) & !!$        &       * 2.0_DP * DelTime
!!$end do !!$
!!$!----------------------------------- !!$    !  地表面気圧の再計算
!!$! Recalculate surface pressure !!$    do k = 0, kmax - 1
!!$xy_Ps = xy_Ps & !!$         &     + xyz_DNegQVap2Dt(:,:,k) &
!!$& * ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) & !!$         &       * 2.0_DP * DelTime
!!$end do xy_DPsDt = 0.0_DP !----------------------------------- ! 地表面気圧の再計算 ! Recalculate surface pressure do k = 0, kmax - 1 xy_DPsDt = xy_DPsDt + ( xyz_DLscQVapDt(:,:,k) + xyz_DCumulusQVapDt(:,:,k) + xyz_DNegQVap1Dt(:,:,k) ) * ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) end do do k = 0, kmax - 1 xy_DPsDt = xy_DPsDt + xyz_DNegQVap2Dt(:,:,k) * ( xyr_Press(:,:,k) - xyr_Press(:,:,k+1) ) end do !---------------------------------------------------------------- ! ヒストリファイルへのデータ出力 ! History data output !---------------------------------------------------------------- !------------------------- ! xy_LscRain + xy_CumulusRain の出力 ! Output "xy_LscRain + xy_CumulusRain" name = 'Rain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_rain, varname = name, array = xy_LscRain + xy_CumulusRain, quiet = .false. ) ! (in) end if !------------------------- ! xy_CumulusRain の出力 ! Output "xy_CumulusRain" name = 'CumulusRain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_cumrain, varname = name, array = xy_CumulusRain, quiet = .false. ) ! (in) end if !------------------------- ! xy_LscRain の出力 ! Output "xy_LscRain" name = 'LscRain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_lscrain, varname = name, array = xy_LscRain, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DNegQVap1Dt, xyz_DNegQVap2Dt の出力 ! Output "xyz_DNegQVap1Dt", "xyz_DNegQVap2Dt" name = 'DNegQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dnegqvapdt, varname = name, array = xyz_DNegQvap1Dt + xyz_DNegQvap2Dt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DCumulusTempDt + xyz_DLscTempDt の出力 ! Output "xyz_DCumulusTempDt" + "xyz_DLscTempDt" name = 'DCumLscTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dcumlsctempdt, varname = name, array = xyz_DCumulusTempDt + xyz_DLscTempDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DCumulusQVapDt + xyz_DLscQVapDt の出力 ! Output "xyz_DCumulusQVapDt" + "xyz_DLscQVapDt" name = 'DCumLscQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dcumlscqvapdt, varname = name, array = xyz_DCumulusQVapDt + xyz_DLscQVapDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DLscTempDt の出力 ! Output "xyz_DLscTempDt" name = 'DLscTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dlsctempdt, varname = name, array = xyz_DLscTempDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DLscQVapDt の出力 ! Output "xyz_DLscQVapDt" name = 'DLscQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dlscqvapdt, varname = name, array = xyz_DLscQVapDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DCumulusTempDt の出力 ! Output "xyz_DCumulusTempDt" name = 'DCumulusTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dcumtempdt, varname = name, array = xyz_DCumulusTempDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DCumulusQVapDt の出力 ! Output "xyz_DCumulusQVapDt" name = 'DCumulusQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dcumqvapdt, varname = name, array = xyz_DCumulusQVapDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DDryTempDt の出力 ! Output "xyz_DDryTempDt" name = 'DDryTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_ddrytempdt, varname = name, array = xyz_DDryTempDt, quiet = .false. ) ! (in) end if !------------------------- ! xy_DPsDt の出力 ! Output "xy_DPsDt" name = 'DPsDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dpsdt, varname = name, array = xy_DPsDt, quiet = .false. ) ! (in) end if !----------------------------------------------------------------- ! 時刻の更新 ! Update time !----------------------------------------------------------------- phy_ape % current_time = phy_ape % current_time + phy_ape % delta_time !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeAdjust Subroutine : phy_ape :type(PHYAPE), intent(inout) err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. PHYAPE 型の変数の終了処理を行います. なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます. Deconstructor of "PHYAPE". Note that if phy_ape is not initialized by "Create" yet, error is occurred. [Source] subroutine PhysApeClose( phy_ape, err ) ! ! PHYAPE 型の変数の終了処理を行います. ! なお, 与えられた *phy_ape* が Create によって初期設定 ! されていない場合, プログラムはエラーを発生させます. ! ! Deconstructor of "PHYAPE". ! Note that if *phy_ape* is not initialized by "Create" yet, ! error is occurred. ! use phy_ground, only: Close use phy_interpolate, only: Close use phy_neg_moist, only: Close use phy_cumulus_adjust, only: Close use phy_lscond, only: Close use phy_implicit, only: Close use phy_radiation_flux, only: PhyRadFluxClose use phy_verdiff, only: Close use phy_surface_flux, only: Close use phy_dryconv_adjust, only: Close use dc_trace, only: BeginSub, EndSub use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT use dc_string, only: Split, StrInclude use gt4_history, only: HistoryClose implicit none type(PHYAPE), intent(inout):: phy_ape logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! ヒストリファイルへのデータ出力設定 ! Configure the settings for history data output character(TOKEN):: name ! 変数名. Variable name type(PHYAPE_HISTNML), pointer:: hptr =>null() ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c character(*), parameter:: subname = 'PhysApeClose' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 初期設定のチェック ! Check initialization !----------------------------------------------------------------- if ( .not. phy_ape % initialized ) then stat = DC_ENOTINIT cause_c = 'PHYAPE' goto 999 end if !----------------------------------------------------------------- ! 地表条件設定 ! Configure ground condition !----------------------------------------------------------------- call Close( phy_grd = phy_ape % phy_grd, err = err ) ! (out) !----------------------------------------------------------------- ! 温度の半整数$ \sigma $レベルの補間, 気圧とジオポテンシャルの算出 ! Interpolate temperature on half$ \sigma $level, and ! calculate pressure and geo-potential !----------------------------------------------------------------- call Close( phy_intpol = phy_ape % phy_intpol, err = err ) ! (out) !----------------------------------------------------------------- ! 負の水蒸気除去 ! Remove negative moisture !----------------------------------------------------------------- call Close( phy_neg_mst = phy_ape % phy_neg_mst, err = err ) ! (out) !----------------------------------------------------------------- ! 湿潤過程 (積雲) ! Moist process (cumulus) !----------------------------------------------------------------- call Close( phy_cumad = phy_ape % phy_cumad, err = err ) ! (out) !----------------------------------------------------------------- ! 湿潤過程 (大規模凝結) ! Moist process (large scale condensation) !----------------------------------------------------------------- call Close( phy_lsc = phy_ape % phy_lsc, err = err ) ! (out) !----------------------------------------------------------------- ! 陰解配列初期設定 ! Initialize implicit matrices !----------------------------------------------------------------- call Close( phy_impl = phy_ape % phy_impl, err = err ) ! (out) !----------------------------------------------------------------- ! 放射フラックス ! Radiation flux !----------------------------------------------------------------- call PhyRadFluxClose( phy_radflx = phy_ape % phy_radflx, err = err ) ! (out) !----------------------------------------------------------------- ! 鉛直拡散フラックス ! Vertical diffusion flux !----------------------------------------------------------------- call Close( phy_vdif = phy_ape % phy_vdif, err = err ) ! (out) !----------------------------------------------------------------- ! 地表面フラックス ! Surface flux !----------------------------------------------------------------- call Close( phy_surfflx = phy_ape % phy_surfflx, err = err ) ! (out) !----------------------------------------------------------------- ! 乾燥対流調節 ! Dry convective adjustment !----------------------------------------------------------------- call Close( phy_dryconv = phy_ape % phy_dryconv, err = err ) ! (out) !----------------------------------------------------------------- ! ヒストリファイルへのデータ出力の終了処理 ! Terminate the settings for history data output !----------------------------------------------------------------- !------------------------- ! xyr_UFlux の出力の終了処理 ! Terminate the settings for "xyr_UFlux" output name = 'SurfStressX' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_surfstressx ) ! (inout) end if !------------------------- ! xyr_VFlux の出力の終了処理 ! Terminate the settings for "xyr_VFlux" output name = 'SurfStressY' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_surfstressy ) ! (inout) end if !------------------------- ! xyr_TempFlux の出力の終了処理 ! Terminate the settings for "xyr_TempFlux" output name = 'SensHeatFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_sensheatflux ) ! (inout) end if !------------------------- ! xyr_QVapFlux の出力の終了処理 ! Terminate the settings for "xyr_QVapFlux" output name = 'LatentHeatFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_latentheatflux ) ! (inout) end if !------------------------- ! xy_LscRain + xy_CumulusRain の出力の終了処理 ! Terminate the settings for "xy_LscRain + xy_CumulusRain" output name = 'Rain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_rain ) ! (inout) end if !------------------------- ! xy_CumulusRain の出力の終了処理 ! Terminate the settings for "xy_CumulusRain" output name = 'CumulusRain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_cumrain ) ! (inout) end if !------------------------- ! xy_LscRain の出力の終了処理 ! Terminate the settings for "xy_LscRain" output name = 'LscRain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_lscrain ) ! (inout) end if !------------------------- ! xyr_RadLFlux の出力の終了処理 ! Terminate the settings for "xyr_RadLFlux" output name = 'RadLFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_radlflux ) ! (inout) end if !------------------------- ! xyr_RadSFlux の出力の終了処理 ! Terminate the settings for "xyr_RadSFlux" output name = 'RadSFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_radsflux ) ! (inout) end if !------------------------- ! xyz_DNegQVap1Dt, xyz_DNegQVap2Dt の出力の終了処理 ! Terminate the settings for "xyz_DNegQVap1Dt", "xyz_DNegQVap2Dt" output name = 'DNegQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dnegqvapdt ) ! (inout) end if !------------------------- ! xyz_DLscTempDt の出力の終了処理 ! Terminate the settings for "xyz_DLscTempDt" output name = 'DLscTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dlsctempdt ) ! (inout) end if !------------------------- ! xyz_DLscQVapDt の出力の終了処理 ! Terminate the settings for "xyz_DLscQVapDt" output name = 'DLscQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dlscqvapdt ) ! (inout) end if !------------------------- ! xyz_DCumulusTempDt の出力の終了処理 ! Terminate the settings for "xyz_DCumulusTempDt" output name = 'DCumulusTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dcumtempdt ) ! (inout) end if !------------------------- ! xyz_DCumulusQVapDt の出力の終了処理 ! Terminate the settings for "xyz_DCumulusQVapDt" output name = 'DCumulusQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dcumqvapdt ) ! (inout) end if !------------------------- ! xyz_DDryTempDt の出力の終了処理 ! Terminate the settings for "xyz_DDryTempDt" output name = 'DDryTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_ddrytempdt ) ! (inout) end if !------------------------- ! xy_DPsDt の出力の終了処理 ! Terminate the settings for "xy_DPsDt" output name = 'DPsDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dpsdt ) ! (inout) end if !------------------------- ! xyz_DRadLTempDt の出力の終了処理 ! Terminate the settings for "xyz_DRadLTempDt" output name = 'DRadLTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dradltempdt ) ! (inout) end if !------------------------- ! xyz_DRadSTempDt の出力の終了処理 ! Terminate the settings for "xyz_DRadSTempDt" output name = 'DRadSTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dradstempdt ) ! (inout) end if !------------------------- ! xyz_DVerdiffUDt の出力の終了処理 ! Terminate the settings for "xyz_DVerdiffUDt" output name = 'DVerdiffUDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dverdiffudt ) ! (inout) end if !------------------------- ! xyz_DVerdiffVDt の出力の終了処理 ! Terminate the settings for "xyz_DVerdiffVDt" output name = 'DVerdiffVDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dverdiffvdt ) ! (inout) end if !------------------------- ! xyz_DVerdiffTempDt の出力の終了処理 ! Terminate the settings for "xyz_DVerdiffTempDt" output name = 'DVerdiffTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dverdifftempdt ) ! (inout) end if !------------------------- ! xyz_DVerdiffQVapDt の出力の終了処理 ! Terminate the settings for "xyz_DVerdiffQVapDt" output name = 'DVerdiffQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then call HistoryClose( history = phy_ape % gthist_dverdiffqvapdt ) ! (inout) end if !----------------------------------------------------------------- ! 軸データの割付解除 ! Deallocate axes data !----------------------------------------------------------------- deallocate( phy_ape % x_Lon ) deallocate( phy_ape % x_Lon_Weight ) deallocate( phy_ape % y_Lat ) deallocate( phy_ape % y_Lat_Weight ) deallocate( phy_ape % z_Sigma ) deallocate( phy_ape % r_Sigma ) !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- phy_ape % initialized = .false. 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeClose Subroutine : phy_ape :type(PHYAPE), intent(inout) imax :integer, intent(in)  : 経度格子点数. Number of grid points in longitude jmax :integer, intent(in)  : 緯度格子点数. Number of grid points in latitude kmax :integer, intent(in)  : 鉛直層数. Number of vertical level x_Lon(0:imax-1) :real(DP), intent(in)  : 経度. Longitude y_Lat(0:jmax-1) :real(DP), intent(in)  : 緯度. Latitude z_Sigma(0:kmax-1) :real(DP), intent(in)  :$ sigma $レベル (整数). Full$ sigma $level r_Sigma(0:kmax) :real(DP), intent(in)  :$ sigma $レベル (半整数). Half$ sigma $level PI :real(DP), intent(in)  :$ pi $. 円周率. Circular constant RAir :real(DP), intent(in)  :$ R $. 大気気体定数. Gas constant of air Grav :real(DP), intent(in)  :$ g $. 重力加速度. Gravitational acceleration Cp :real(DP), intent(in)  :$ C_p $. 大気定圧比熱. Specific heat of air at constant pressure EL :real(DP), intent(in)  :$ L $. 水の凝結の潜熱. Latent heat of condensation of water vapor RVap :real(DP), intent(in)  :$ R_v $. 水蒸気気体定数. Gas constant of water vapor EpsV :real(DP), intent(in)  :$ epsilon_v $. 水蒸気分子量比. Molecular weight ratio of water vapor ES0 :real(DP), intent(in)  :$ e^{*} $(273K) . 0 ℃での飽和蒸気圧. Saturated vapor pressure at 0 degrees C StB :real(DP), intent(in)  :$ sigma_{SB} $. ステファンボルツマン定数. Stefan-Boltzmann constant FKarm :real(DP), intent(in)  :$ k $. カルマン定数. Karman constant DelTime :real(DP), intent(in)  :$ Delta t $. タイムステップ. Time step x_Lon_Weight(0:imax-1) :real(DP), intent(in), optional  : 経度座標重み. Weight of longitude y_Lat_Weight(0:jmax-1) :real(DP), intent(in), optional  : 緯度座標重み. Weight of latitude current_time_value :real(DP), intent(in), optional  : 現在時刻の数値. Numerical value of current time current_time_unit :character(*), intent(in), optional  : 現在時刻の単位. Unit of current time history_varlist :character(*), intent(in), optional  : ヒストリデータの出力変数リスト. カンマで区切って並べる. (例: "Rain,RadLFlux,RadSFlux" ). List of variables output to history data. Delimiter is comma. (exp. "Rain,RadLFlux,RadSFlux" ). history_interval_value :real(DP), intent(in), optional  : ヒストリデータの出力間隔の数値. Numerical value for interval of history data output history_interval_unit :character(*), intent(in), optional  : ヒストリデータの出力間隔の単位. Unit for interval of history data output history_precision :character(*), intent(in), optional  : ヒストリデータの精度. Precision of history data history_fileprefix :character(*), intent(in), optional  : ヒストリデータのファイル名の接頭詞. Prefix of history data filenames nmlfile :character(*), intent(in), optional  : NAMELIST ファイルの名称. この引数に空文字以外を与えた場合, 指定されたファイルから NAMELIST 変数群を読み込みます. ファイルを読み込めない場合にはエラーを 生じます. NAMELIST 変数群の詳細に関しては NAMELIST#phy_ape_nml を参照してください. NAMELIST file name. If nonnull character is specified to this argument, NAMELIST group name is loaded from the file. If the file can not be read, an error occurs. See "NAMELIST#phy_ape_nml" for details about a NAMELIST group. err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. PHYAPE 型の変数の初期設定を行います. 他のサブルーチンを使用する前に必ずこのサブルーチンによって PHYAPE 型の変数を初期設定してください. なお, 与えられた phy_ape が既に初期設定されている場合, プログラムはエラーを発生させます. NAMELIST を利用する場合には引数 nmlfileNAMELIST ファイル名 を与えてください. NAMELIST 変数群の詳細に関しては NAMELIST#phy_ape_nml を参照してください. Constructor of "PHYAPE". Initialize phy_ape by this subroutine, before other procedures are used, Note that if phy_ape is already initialized by this procedure, error is occurred. In order to use NAMELIST, specify a NAMELIST filename to argument nmlfile. See "NAMELIST#phy_ape_nml" for details about a NAMELIST group. [Source] subroutine PhysApeCreate( phy_ape, imax, jmax, kmax, x_Lon, y_Lat, z_Sigma, r_Sigma, PI, RAir, Grav, Cp, EL, RVap, EpsV, ES0, StB, FKarm, DelTime, x_Lon_Weight, y_Lat_Weight, current_time_value, current_time_unit, history_varlist, history_interval_value, history_interval_unit, history_precision, history_fileprefix, nmlfile, err ) ! ! PHYAPE 型の変数の初期設定を行います. ! 他のサブルーチンを使用する前に必ずこのサブルーチンによって ! PHYAPE 型の変数を初期設定してください. ! ! なお, 与えられた *phy_ape* が既に初期設定されている場合, ! プログラムはエラーを発生させます. ! ! NAMELIST を利用する場合には引数 *nmlfile* に NAMELIST ファイル名 ! を与えてください. NAMELIST 変数群の詳細に関しては ! NAMELIST#phy_ape_nml を参照してください. ! ! Constructor of "PHYAPE". ! Initialize *phy_ape* by this subroutine, ! before other procedures are used, ! ! Note that if *phy_ape* is already initialized ! by this procedure, error is occurred. ! ! In order to use NAMELIST, specify a NAMELIST filename to ! argument *nmlfile*. See "NAMELIST#phy_ape_nml" ! for details about a NAMELIST group. ! use phy_ground, only: Create, Get use phy_interpolate, only: Create use phy_neg_moist, only: Create use phy_cumulus_adjust, only: Create use phy_lscond, only: Create use phy_implicit, only: Create use phy_radiation_flux, only: PhyRadFluxCreate use phy_verdiff, only: Create use phy_surface_flux, only: Create use phy_dryconv_adjust, only: Create use dc_trace, only: BeginSub, EndSub use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_present, only: present_and_not_empty, present_and_true use dc_message, only: MessageNotify use dc_error, only: StoreError, DC_NOERR, DC_EALREADYINIT, DC_EARGLACK, DC_ENEGATIVE, DC_ENOFILEREAD use dc_string, only: Split, StrInclude, StoA use dc_date, only: Create use gt4_history, only: GT_HISTORY, HistoryAddVariable, HistoryAddAttr implicit none type(PHYAPE), intent(inout):: phy_ape integer, intent(in):: imax ! 経度格子点数. ! Number of grid points in longitude integer, intent(in):: jmax ! 緯度格子点数. ! Number of grid points in latitude integer, intent(in):: kmax ! 鉛直層数. ! Number of vertical level real(DP), intent(in):: x_Lon (0:imax-1) ! 経度. Longitude real(DP), intent(in):: y_Lat (0:jmax-1) ! 緯度. Latitude real(DP), intent(in):: z_Sigma (0:kmax-1) !$ \sigma $レベル (整数). ! Full$ \sigma $level real(DP), intent(in):: r_Sigma (0:kmax) !$ \sigma $レベル (半整数). ! Half$ \sigma $level real(DP), intent(in):: PI !$ \pi $. 円周率. Circular constant real(DP), intent(in):: RAir !$ R $. 大気気体定数. Gas constant of air real(DP), intent(in):: Grav !$ g $. 重力加速度. Gravitational acceleration real(DP), intent(in):: Cp !$ C_p $. 大気定圧比熱. Specific heat of air at constant pressure real(DP), intent(in):: EL !$ L $. 水の凝結の潜熱. Latent heat of condensation of water vapor real(DP), intent(in):: RVap !$ R_v $. 水蒸気気体定数. Gas constant of water vapor real(DP), intent(in):: EpsV !$ \epsilon_v $. 水蒸気分子量比. Molecular weight ratio of water vapor real(DP), intent(in):: ES0 !$ e^{*} $(273K) . 0 ℃での飽和蒸気圧. Saturated vapor pressure at 0 degrees C real(DP), intent(in):: StB !$ \sigma_{SB} $. ステファンボルツマン定数. Stefan-Boltzmann constant real(DP), intent(in):: FKarm !$ k $. カルマン定数. Karman constant real(DP), intent(in):: DelTime !$ \Delta t $. タイムステップ. Time step real(DP), intent(in), optional:: x_Lon_Weight(0:imax-1) ! 経度座標重み. ! Weight of longitude real(DP), intent(in), optional:: y_Lat_Weight(0:jmax-1) ! 緯度座標重み. ! Weight of latitude real(DP), intent(in), optional:: current_time_value ! 現在時刻の数値. Numerical value of current time character(*), intent(in), optional:: current_time_unit ! 現在時刻の単位. Unit of current time character(*), intent(in), optional:: history_varlist ! ヒストリデータの出力変数リスト. ! カンマで区切って並べる. ! (例: "Rain,RadLFlux,RadSFlux" ). ! ! List of variables output to history data. ! Delimiter is comma. ! (exp. "Rain,RadLFlux,RadSFlux" ). ! real(DP), intent(in), optional:: history_interval_value ! ヒストリデータの出力間隔の数値. ! Numerical value for interval of history data output character(*), intent(in), optional:: history_interval_unit ! ヒストリデータの出力間隔の単位. ! Unit for interval of history data output character(*), intent(in), optional:: history_precision ! ヒストリデータの精度. ! Precision of history data character(*), intent(in), optional:: history_fileprefix ! ヒストリデータのファイル名の接頭詞. ! Prefix of history data filenames character(*), intent(in), optional :: nmlfile ! NAMELIST ファイルの名称. ! この引数に空文字以外を与えた場合, ! 指定されたファイルから ! NAMELIST 変数群を読み込みます. ! ファイルを読み込めない場合にはエラーを ! 生じます. ! ! NAMELIST 変数群の詳細に関しては ! NAMELIST#phy_ape_nml ! を参照してください. ! ! NAMELIST file name. ! If nonnull character is specified to ! this argument, ! NAMELIST group name is loaded from the ! file. ! If the file can not be read, ! an error occurs. ! ! See "NAMELIST#phy_ape_nml" ! for details about a NAMELIST group. ! logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! 地表面データ ! Data on surface real(DP):: xy_SurfTemp (0:imax-1, 0:jmax-1) ! 地表面温度. ! Surface temperature real(DP):: xy_SurfAlbedo (0:imax-1, 0:jmax-1) ! 地表アルベド. ! Surface albedo real(DP):: xy_SurfHumidCoeff (0:imax-1, 0:jmax-1) ! 地表湿潤度. ! Surface humidity coefficient real(DP):: xy_SurfRoughLength (0:imax-1, 0:jmax-1) ! 地表粗度長. ! Surface rough length real(DP):: xy_SurfHeatCapacity (0:imax-1, 0:jmax-1) ! 地表熱容量. ! Surface heat capacity real(DP):: xy_GroundTempFlux (0:imax-1, 0:jmax-1) ! 地中熱フラックス. ! Ground temperature flux integer:: xy_SurfCondition (0:imax-1, 0:jmax-1) ! 地表状態. ! Surface condition !----------------------------------- ! ヒストリファイルへのデータ出力設定 ! Configure the settings for history data output character(TOKEN):: name ! 変数名. Variable name type(PHYAPE_HISTNML), pointer:: hptr =>null() ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" character(STRING):: history_filename ! ヒストリデータのファイル名. ! History data filenames character(STRING):: history_varlist_work type(GT_HISTORY), pointer:: history_work =>null() ! gt4_history モジュール用構造体. ! Derived type for "gt4_history" module character(TOKEN):: xdim ! 経度の名称. Name of longitude character(TOKEN):: ydim ! 緯度の名称. Name of latitude character(TOKEN):: zdim !$ \sigma $レベル (整数) の名称. ! Name of full$ \sigma $level character(TOKEN):: rdim !$ \sigma $レベル (半整数) の名称. ! Name of half$ \sigma $level character(TOKEN):: timedim ! 時刻の名称. Name of time !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c character(*), parameter:: subname = 'PhysApeCreate' continue call BeginSub( subname, version ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 初期設定のチェック ! Check initialization !----------------------------------------------------------------- if ( phy_ape % initialized ) then stat = DC_EALREADYINIT cause_c = 'PHYAPE' goto 999 end if !----------------------------------------------------------------- ! 引数の正当性のチェック ! Validation of arguments !----------------------------------------------------------------- if (imax < 1) then stat = DC_ENEGATIVE cause_c = 'imax' goto 999 end if if (jmax < 1) then stat = DC_ENEGATIVE cause_c = 'jmax' goto 999 end if if (kmax < 1) then stat = DC_ENEGATIVE cause_c = 'kmax' goto 999 end if if (DelTime < 0.0_DP) then stat = DC_ENEGATIVE cause_c = 'DelTime' goto 999 end if !----------------------------------------------------------------- ! 波数・格子点の設定 ! Configure wave number and grid point !----------------------------------------------------------------- phy_ape % imax = imax phy_ape % jmax = jmax phy_ape % kmax = kmax !----------------------------------------------------------------- ! 座標軸の設定 ! Configure axes !----------------------------------------------------------------- allocate( phy_ape % x_Lon (0:imax-1) ) phy_ape % x_Lon = x_Lon allocate( phy_ape % x_Lon_Weight (0:imax-1) ) if ( present(x_Lon_Weight) ) then phy_ape % x_Lon_Weight = x_Lon_Weight else phy_ape % x_Lon_Weight = 2.0_DP * PI / imax end if allocate( phy_ape % y_Lat (0:jmax-1) ) phy_ape % y_Lat = y_Lat allocate( phy_ape % y_Lat_Weight (0:jmax-1) ) if ( present(y_Lat_Weight) ) then phy_ape % y_Lat_Weight = y_Lat_Weight else phy_ape % y_Lat_Weight = 2.0_DP / jmax end if allocate( phy_ape % z_Sigma (0:kmax-1) ) phy_ape % z_Sigma = z_Sigma allocate( phy_ape % r_Sigma (0:kmax) ) phy_ape % r_Sigma = r_Sigma !----------------------------------------------------------------- ! 定数の設定 ! Configure constants !----------------------------------------------------------------- phy_ape % PI = PI !----------------------------------------------------------------- !$ \Delta t $の設定 ! Configure$ \Delta t $!----------------------------------------------------------------- phy_ape % DelTime = DelTime !----------------------------------------------------------------- ! 時刻管理 ! Time control !----------------------------------------------------------------- if ( present(current_time_value) .and. present(current_time_unit) ) then call Create( diff = phy_ape % current_time, value = current_time_value, unit = current_time_unit ) ! (in) else call Create( diff = phy_ape % current_time, value = 0.0_DP, unit = 'sec' ) ! (in) end if call Create( diff = phy_ape % delta_time, value = DelTime, unit = 'sec' ) ! (in) !----------------------------------------------------------------- ! 地表条件設定 ! Configure ground condition !----------------------------------------------------------------- call Create( phy_grd = phy_ape % phy_grd, imax = imax, jmax = jmax, SurfTemp = 273.0_DP, SurfAlbedo = 0.15_DP, SurfHumidCoeff = 1.0_DP, SurfRoughLength = 1.0e-4_DP, SurfHeatCapacity = 0.0_DP, GroundTempFlux = 0.0_DP, SurfCondition = 0, nmlfile = nmlfile, err = err ) ! (out) call Get( phy_grd = phy_ape % phy_grd, xy_SurfTemp = xy_SurfTemp, xy_SurfAlbedo = xy_SurfAlbedo, xy_SurfHumidCoeff = xy_SurfHumidCoeff, xy_SurfRoughLength = xy_SurfRoughLength, xy_SurfCondition = xy_SurfCondition, xy_SurfHeatCapacity = xy_SurfHeatCapacity, xy_GroundTempFlux = xy_GroundTempFlux ) ! (out) !----------------------------------------------------------------- ! 温度の半整数$ \sigma $レベルの補間, 気圧とジオポテンシャルの算出 ! Interpolate temperature on half$ \sigma $level, and ! calculate pressure and geo-potential !----------------------------------------------------------------- call Create( phy_intpol = phy_ape % phy_intpol, imax = imax, jmax = jmax, kmax = kmax, z_Sigma = z_Sigma, r_Sigma = r_Sigma, RAir = RAir, Grav = Grav, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 負の水蒸気除去 ! Remove negative moisture !----------------------------------------------------------------- call Create( phy_neg_mst = phy_ape % phy_neg_mst, imax = imax, jmax = jmax, kmax = kmax, PI = PI, DelTime = DelTime, x_Lon_Weight = x_Lon_Weight, y_Lat_Weight = y_Lat_Weight, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 湿潤過程 (積雲) ! Moist process (cumulus) !----------------------------------------------------------------- call Create( phy_cumad = phy_ape % phy_cumad, imax = imax, jmax = jmax, kmax = kmax, Grav = Grav, Cp = Cp, RAir = RAir, EL = EL, RVap = RVap, EpsV = EpsV, ES0 = ES0, DelTime = DelTime, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 湿潤過程 (大規模凝結) ! Moist process (large scale condensation) !----------------------------------------------------------------- call Create( phy_lsc = phy_ape % phy_lsc, imax = imax, jmax = jmax, kmax = kmax, Grav = Grav, Cp = Cp, EL = EL, RVap = RVap, EpsV = EpsV, ES0 = ES0, DelTime = DelTime, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 陰解配列初期設定 ! Initialize implicit matrices !----------------------------------------------------------------- call Create( phy_impl = phy_ape % phy_impl, imax = imax, jmax = jmax, kmax = kmax, Grav = Grav, Cp = Cp, EL = EL, DelTime = DelTime, xy_SurfHeatCapacity = xy_SurfHeatCapacity, xy_SurfCondition = xy_SurfCondition, xy_GroundTempFlux = xy_GroundTempFlux, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 放射フラックス ! Radiation flux !----------------------------------------------------------------- call PhyRadFluxCreate( phy_radflx = phy_ape % phy_radflx, imax = imax, jmax = jmax, kmax = kmax, y_Lat = y_Lat, Grav = Grav, Cp = Cp, StB = StB, xy_SurfTemp = xy_SurfTemp, xy_SurfAlbedo = xy_SurfAlbedo, current_time_value = current_time_value, current_time_unit = current_time_unit, delta_time_value = DelTime, delta_time_unit = 'sec', delta_time_value_RadLong = 3.0_DP, delta_time_unit_RadLong = 'hour', delta_time_value_RadShort = 1.0_DP, delta_time_unit_RadShort = 'hour', nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 鉛直拡散フラックス ! Vertical diffusion flux !----------------------------------------------------------------- call Create( phy_vdif = phy_ape % phy_vdif, imax = imax, jmax = jmax, kmax = kmax, RAir = RAir, Cp = Cp, Grav = Grav, EL = EL, FKarm = FKarm, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 地表面フラックス ! Surface flux !----------------------------------------------------------------- call Create( phy_surfflx = phy_ape % phy_surfflx, imax = imax, jmax = jmax, kmax = kmax, RAir = RAir, Cp = Cp, Grav = Grav, EL = EL, ES0 = ES0, RVap = RVap, EpsV = EpsV, FKarm = FKarm, xy_SurfTemp = xy_SurfTemp, xy_SurfHumidCoeff = xy_SurfHumidCoeff, xy_SurfRoughLength = xy_SurfRoughLength, xy_SurfCondition = xy_SurfCondition, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! 乾燥対流調節 ! Dry convective adjustment !----------------------------------------------------------------- call Create( phy_dryconv = phy_ape % phy_dryconv, imax = imax, jmax = jmax, kmax = kmax, RAir = RAir, Cp = Cp, DelTime = DelTime, nmlfile = nmlfile, err = err ) ! (out) !----------------------------------------------------------------- ! ヒストリファイルへのデータ出力設定 ! Configure the settings for history data output !----------------------------------------------------------------- if ( associated( phy_ape % hist_nml ) ) deallocate( phy_ape % hist_nml ) allocate( phy_ape % hist_nml(1) ) !------------------------- ! デフォルト値 ! Default values history_varlist_work = '' phy_ape % history_fileprefix = '' phy_ape % hist_nml(1) % name = '' phy_ape % hist_nml(1) % file = '' phy_ape % hist_nml(1) % history_interval_value = -1.0_DP phy_ape % hist_nml(1) % history_interval_unit = 'sec' phy_ape % hist_nml(1) % history_precision = 'float' phy_ape % hist_nml(1) % history_average = .false. !------------------------- ! オプショナル引数からの値 ! Values from optional arguments if ( present(history_varlist) ) history_varlist_work = history_varlist if ( present(history_fileprefix) ) phy_ape % history_fileprefix = history_fileprefix if ( present(history_interval_value) ) phy_ape % hist_nml(1) % history_interval_value = history_interval_value if ( present(history_interval_unit) ) phy_ape % hist_nml(1) % history_interval_unit = history_interval_unit if ( present(history_precision) ) phy_ape % hist_nml(1) % history_precision = history_precision !------------------------- ! NAMELIST からの値 ! Values from NAMELIST if ( present_and_not_empty(nmlfile) ) then call MessageNotify( 'M', subname, 'Loading NAMELIST file "%c" ...', c1=trim(nmlfile) ) call NmlRead ( nmlfile = nmlfile, history_varlist_ = history_varlist_work, history_fileprefix_ = phy_ape % history_fileprefix, hist_nml = phy_ape % hist_nml, err = err ) ! (out) if ( present_and_true(err) ) then call MessageNotify( 'W', subname, '"%c" can not be read.', c1=trim(nmlfile) ) stat = DC_ENOFILEREAD cause_c = nmlfile goto 999 end if end if !----------------------------------------------------------------- ! ヒストリーデータに関する時刻管理 ! Time control for history data !----------------------------------------------------------------- call Create( diff = phy_ape % hist_nml(1) % history_interval_time, value = phy_ape % hist_nml(1) % history_interval_value, unit = phy_ape % hist_nml(1) % history_interval_unit ) ! (in) !----------------------------------------------------------------- ! 内部ルーチン HstSetXYZR によるファイル作成 ! Files are created by internal subroutine "HstSetXYZR" !----------------------------------------------------------------- call Split( str = history_varlist_work, sep = ',', carray = phy_ape % history_varlist_array ) ! (out) !------------------------- ! xyr_UFlux の出力設定 ! Configure the settings for "xyr_UFlux" output name = 'SurfStressX' history_filename = trim(phy_ape % history_fileprefix) // 'SurfStressX.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_surfstressx => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_surfstressx, varname = 'SurfStressX', dims = StoA(xdim, ydim, rdim, timedim), longname = 'surface stress(x)', units = 'N m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyr_VFlux の出力設定 ! Configure the settings for "xyr_VFlux" output name = 'SurfStressY' history_filename = trim(phy_ape % history_fileprefix) // 'SurfStressY.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_surfstressy => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_surfstressy, varname = 'SurfStressY', dims = StoA(xdim, ydim, rdim, timedim), longname = 'surface stress(y)', units = 'N m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyr_TempFlux の出力設定 ! Configure the settings for "xyr_TempFlux" output name = 'SensHeatFlux' history_filename = trim(phy_ape % history_fileprefix) // 'SensHeatFlux.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_sensheatflux => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_sensheatflux, varname = 'SensHeatFlux', dims = StoA(xdim, ydim, rdim, timedim), longname = 'sensible heat flux', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyr_QVapFlux の出力設定 ! Configure the settings for "xyr_QVapFlux" output name = 'LatentHeatFlux' history_filename = trim(phy_ape % history_fileprefix) // 'LatentHeatFlux.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_latentheatflux => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_latentheatflux, varname = 'LatentHeatFlux', dims = StoA(xdim, ydim, rdim, timedim), longname = 'latent heat flux', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xy_LscRain + xy_CumulusRain の出力設定 ! Configure the settings for "xy_LscRain + xy_CumulusRain" output name = 'Rain' history_filename = trim(phy_ape % history_fileprefix) // 'Rain.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_rain => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_rain, varname = 'Rain', dims = StoA(xdim, ydim, timedim), longname = 'precipitation', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xy_CumulusRain の出力設定 ! Configure the settings for "xy_CumulusRain" output name = 'CumulusRain' history_filename = trim(phy_ape % history_fileprefix) // 'CumulusRain.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_cumrain => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_cumrain, varname = 'CumulusRain', dims = StoA(xdim, ydim, timedim), longname = 'precipitation by cumulus scheme', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xy_LscRain の出力設定 ! Configure the settings for "xy_LscRain" output name = 'LscRain' history_filename = trim(phy_ape % history_fileprefix) // 'LscRain.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_lscrain => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_lscrain, varname = 'LscRain', dims = StoA(xdim, ydim, timedim), longname = 'precipitation by large scale condensation', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyr_RadLFlux の出力設定 ! Configure the settings for "xyr_RadLFlux" output name = 'RadLFlux' history_filename = trim(phy_ape % history_fileprefix) // 'RadLFlux.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_radlflux => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_radlflux, varname = 'RadLFlux', dims = StoA(xdim, ydim, rdim, timedim), longname = 'longwave flux', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyr_RadSFlux の出力設定 ! Configure the settings for "xyr_RadSFlux" output name = 'RadSFlux' history_filename = trim(phy_ape % history_fileprefix) // 'RadSFlux.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_radsflux => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_radsflux, varname = 'RadSFlux', dims = StoA(xdim, ydim, rdim, timedim), longname = 'shortwave flux', units = 'W m-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DNegQVap1Dt, xyz_DNegQVap2Dt の出力設定 ! Configure the settings for "xyz_DNegQVap1Dt", "xyz_DNegQVap2Dt" output name = 'DNegQVapDt' history_filename = trim(phy_ape % history_fileprefix) // 'DNegQVapDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dnegqvapdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dnegqvapdt, varname = 'DNegQVapDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'remove negative moist', units = 's-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DCumlusTempDt + xyz_DLscTempDt の出力設定 ! Configure the settings for "xyz_DCumlusTempDt" + "xyz_DLscTempDt" output name = 'DCumLscTempDt' history_filename = trim(phy_ape % history_fileprefix) // 'DCumLscTempDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dcumlsctempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dcumlsctempdt, varname = 'DCumLscTempDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'cumulus and large-scale condensation heating', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DCumlusQVapDt + xyz_DLscQVapDt の出力設定 ! Configure the settings for "xyz_DCumlusQVapDt + xyz_DLscQVapDt" output name = 'DCumLscQVapDt' history_filename = trim(phy_ape % history_fileprefix) // 'DCumLscQVapDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dcumlscqvapdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dcumlscqvapdt, varname = 'DCumLscQVapDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'cumulus and large-scale condensation moistening', units = 's-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DLscTempDt の出力設定 ! Configure the settings for "xyz_DLscTempDt" output name = 'DLscTempDt' history_filename = trim(phy_ape % history_fileprefix) // 'DLscTempDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dlsctempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dlsctempdt, varname = 'DLscTempDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'large-scale condensation heating', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DLscQVapDt の出力設定 ! Configure the settings for "xyz_DLscQVapDt" output name = 'DLscQVapDt' history_filename = trim(phy_ape % history_fileprefix) // 'DLscQVapDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dlscqvapdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dlscqvapdt, varname = 'DLscQVapDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'large-scale condensation moistening', units = 's-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DCumulusTempDt の出力設定 ! Configure the settings for "xyz_DCumulusTempDt" output name = 'DCumulusTempDt' history_filename = trim(phy_ape % history_fileprefix) // 'DCumulusTempDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dcumtempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dcumtempdt, varname = 'DCumulusTempDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'cumulus condensation heating', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DCumulusQVapDt の出力設定 ! Configure the settings for "xyz_DCumulusQVapDt" output name = 'DCumulusQVapDt' history_filename = trim(phy_ape % history_fileprefix) // 'DCumulusQVapDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dcumqvapdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dcumqvapdt, varname = 'DCumulusQVapDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'cumulus condensation moistening', units = 's-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DDryTempDt の出力設定 ! Configure the settings for "xyz_DDryTempDt" output name = 'DDryTempDt' history_filename = trim(phy_ape % history_fileprefix) // 'DDryTempDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_ddrytempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_ddrytempdt, varname = 'DDryTempDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'temperature tendency by dry convective adjustment', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xy_DPsDt の出力設定 ! Configure the settings for "xy_DPsDt" output name = 'DPsDt' history_filename = trim(phy_ape % history_fileprefix) // 'DPsDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dpsdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dpsdt, varname = 'DPsDt', dims = StoA(xdim, ydim, timedim), longname = 'surface pressure tendency for removal of negative moisture', units = 'Pa s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DRadLTempDt の出力設定 ! Configure the settings for "xyz_DRadLTempDt" output name = 'DRadLTempDt' history_filename = trim(phy_ape % history_fileprefix) // 'DRadLTempDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dradltempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dradltempdt, varname = 'DRadLTempDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'longwave heating', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DRadSTempDt の出力設定 ! Configure the settings for "xyz_DRadSTempDt" output name = 'DRadSTempDt' history_filename = trim(phy_ape % history_fileprefix) // 'DRadSTempDt.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dradstempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dradstempdt, varname = 'DRadSTempDt', dims = StoA(xdim, ydim, zdim, timedim), longname = 'shortwave heating', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DUDt の出力設定 ! Configure the settings for "xyz_DUDt" output name = 'DUDtAPE' history_filename = trim(phy_ape % history_fileprefix) // 'DUDtAPE.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dverdiffudt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dverdiffudt, varname = 'DUDtAPE', dims = StoA(xdim, ydim, zdim, timedim), longname = 'diffusive force(x)', units = 'm s-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DVDt の出力設定 ! Configure the settings for "xyz_DVDt" output name = 'DVDtAPE' history_filename = trim(phy_ape % history_fileprefix) // 'DVDtAPE.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dverdiffvdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dverdiffvdt, varname = 'DVDtAPE', dims = StoA(xdim, ydim, zdim, timedim), longname = 'diffusive force(y)', units = 'm s-2', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DTempDt の出力設定 ! Configure the settings for "xyz_DTempDt" output name = 'DTempDtAPE' history_filename = trim(phy_ape % history_fileprefix) // 'DTempDtAPE.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dverdifftempdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dverdifftempdt, varname = 'DTempDtAPE', dims = StoA(xdim, ydim, zdim, timedim), longname = 'diffusive heating', units = 'K s-1', xtype = hptr % history_precision ) ! (in) end if !------------------------- ! xyz_DQVapDt の出力設定 ! Configure the settings for "xyz_DQVapDt" output name = 'DQVapDtAPE' history_filename = trim(phy_ape % history_fileprefix) // 'DQVapDtAPE.nc' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( trim(hptr % file) /= '' ) history_filename = trim(hptr % file) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. hptr % history_interval_value > 0.0_DP ) then if ( associated( history_work ) ) nullify( history_work ) call HstSetXYZR( phy_ape = phy_ape, file = history_filename, hptr = hptr, history = history_work, xdim = xdim, ydim = ydim, zdim = zdim, rdim = rdim, timedim = timedim, err = err ) ! (out) phy_ape % gthist_dverdiffqvapdt => history_work nullify( history_work ) call HistoryAddVariable( history = phy_ape % gthist_dverdiffqvapdt, varname = 'DQVapDtAPE', dims = StoA(xdim, ydim, zdim, timedim), longname = 'diffusive moistening', units = 's-1', xtype = hptr % history_precision ) ! (in) end if !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- phy_ape % initialized = .true. 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeCreate Subroutine : name :character(*), intent(in)  : 変数名. Variable name hist_nml(:) :type(PHYAPE_HISTNML), pointer  : (in) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. この配列の 1 番目にはデフォルトの設定が格納 され, 2 番目以降に個別の設定が格納される. Individual data output information from "NAMELIST#phy_ape_history_nml". Default settings are stored in the first element of this array, and individual settings are stored in the second or more. hptr :type(PHYAPE_HISTNML), pointer  : (out) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. Individual data output information from "NAMELIST#phy_ape_history_nml" err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. データ出力情報が格納されたポインタ配列 hist_nml 内の name に該当するデータの情報へ hptr を結合して返します. hist_nml が割り付けられていない場合, エラーを返します. Associate hptr to information of data correspond to name stored in pointer array hist_nml, and return it. If hist_nml is not allocated, error is occured. [Source] subroutine PhysApeHstNmlAssoc( name, hist_nml, hptr, err ) ! ! データ出力情報が格納されたポインタ配列 *hist_nml* 内の ! *name* に該当するデータの情報へ *hptr* を結合して返します. ! ! *hist_nml* が割り付けられていない場合, エラーを返します. ! ! Associate *hptr* to information of data correspond to *name* ! stored in pointer array *hist_nml*, and return it. ! ! If *hist_nml* is not allocated, error is occured. ! use dc_trace, only: BeginSub, EndSub use dc_string, only: PutLine, Printf, Split, StrInclude, StoA, JoinChar use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_error, only: StoreError, DC_NOERR, DC_ENOASSOC implicit none character(*), intent(in):: name ! 変数名. Variable name type(PHYAPE_HISTNML), pointer:: hist_nml(:) ! (in) ! ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! この配列の 1 番目にはデフォルトの設定が格納 ! され, 2 番目以降に個別の設定が格納される. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml". ! Default settings are stored in ! the first element of this array, ! and individual settings are stored in ! the second or more. type(PHYAPE_HISTNML), pointer:: hptr ! (out) ! ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c integer:: hmax ! hist_nml(:) のサイズ. ! Size of "hist_nml(:)" integer:: i ! DO ループ用作業変数 ! Work variables for DO loop character(*), parameter:: subname = 'PhysApeHstNmlAssoc' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 割付状態の確認 ! Check allocation !----------------------------------------------------------------- if ( .not. associated( hist_nml ) ) then stat = DC_ENOASSOC cause_c = 'hist_nml' goto 999 end if if ( size( hist_nml ) < 1 ) then stat = DC_ENOASSOC cause_c = 'hist_nml' goto 999 end if !----------------------------------------------------------------- ! *hist_nml* に格納される, *name* に該当するデータへ結合 ! Associate information of data correspond to *name* ! stored in pointer array *hist_nml* !----------------------------------------------------------------- hmax = size( hist_nml ) if ( associated(hptr) ) nullify( hptr ) do i = 1, hmax if ( trim(hist_nml(i) % name) == trim(name) ) hptr => hist_nml(i) end do if ( .not. associated(hptr) ) hptr => hist_nml(1) !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeHstNmlAssoc Subroutine : phy_ape :type(PHYAPE), intent(inout) file :character(*), intent(in)  : ヒストリデータのファイル名. History data filenames hptr :type(PHYAPE_HISTNML), pointer  : (in) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. Individual data output information from "NAMELIST#phy_ape_history_nml" history :type(GT_HISTORY), pointer  : (out) gt4_history モジュール用構造体. Derived type for "gt4_history" module xdim :character(*), intent(out)  : 経度の名称. Name of longitude ydim :character(*), intent(out)  : 緯度の名称. Name of latitude zdim :character(*), intent(out)  :$ sigma $レベル (整数) の名称. Name of full$ sigma $level rdim :character(*), intent(out)  :$ sigma $レベル (半整数) の名称. Name of half$ sigma $level timedim :character(*), intent(out)  : 時刻の名称. Name of time err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. このサブルーチンはモジュール内からの出力データの初期設定を行います. 内部的に使用されることを想定しているため, モジュール外部からは 呼び出さないでください. file に与えられた名前のファイルをオープンし, ファイル ID などが 格納された GT_HISTORY 変数 history を返します. history は空状態にして与えてください. なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます. This subroutine initializes settings of data output from this module. It is expected that this subroutine is used internally, so do not refer from the outside. A file with name file is opened, and "GT_HISTORY" variable history that stores file ID etc. is returned. Give disassociated history. If phy_ape is not initialized by "Create" yet, error is occurred. [Source] subroutine PhysApeHstSetXYZR( phy_ape, file, hptr, history, xdim, ydim, zdim, rdim, timedim, err ) ! ! このサブルーチンはモジュール内からの出力データの初期設定を行います. ! 内部的に使用されることを想定しているため, モジュール外部からは ! 呼び出さないでください. ! ! *file* に与えられた名前のファイルをオープンし, ファイル ID などが ! 格納された GT_HISTORY 変数 *history* を返します. ! *history* は空状態にして与えてください. ! ! なお, 与えられた *phy_ape* が Create によって初期設定 ! されていない場合, プログラムはエラーを発生させます. ! ! This subroutine initializes settings of data output from this module. ! It is expected that this subroutine is used internally, so ! do not refer from the outside. ! ! A file with name *file* is opened, and "GT_HISTORY" variable ! *history* that stores file ID etc. is returned. ! Give disassociated *history*. ! ! If *phy_ape* is not initialized by "Create" yet, ! error is occurred. ! use dc_trace, only: BeginSub, EndSub use dc_string, only: PutLine, Printf, Split, StrInclude, StoA, JoinChar use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT, DC_ENOASSOC use dc_date, only: Create, EvalSec, EvalByUnit use gt4_history, only: GT_HISTORY, HistoryCreate, HistoryAddVariable, HistoryPut, HistoryAddAttr implicit none type(PHYAPE), intent(inout):: phy_ape character(*), intent(in):: file ! ヒストリデータのファイル名. ! History data filenames type(PHYAPE_HISTNML), pointer:: hptr ! (in) ! ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" type(GT_HISTORY), pointer:: history ! (out) ! ! gt4_history モジュール用構造体. ! Derived type for "gt4_history" module character(*), intent(out):: xdim ! 経度の名称. Name of longitude character(*), intent(out):: ydim ! 緯度の名称. Name of latitude character(*), intent(out):: zdim !$ \sigma $レベル (整数) の名称. ! Name of full$ \sigma $level character(*), intent(out):: rdim !$ \sigma $レベル (半整数) の名称. ! Name of half$ \sigma $level character(*), intent(out):: timedim ! 時刻の名称. Name of time logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c character(*), parameter:: subname = 'PhysApeHstSetXYZR' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 割付状態の確認 ! Check allocation !----------------------------------------------------------------- if ( .not. associated( hptr ) ) then stat = DC_ENOASSOC cause_c = 'hptr' goto 999 end if !----------------------------------------------------------------- ! これまでにオープンされたファイルのチェック ! Check already opened files !----------------------------------------------------------------- !※ HistoryInquire でファイル名が一致していることをチェック !※ HistoryInquire と hptr との内部情報の比較から, ! origin, interval, 時刻の単位が一致することをチェック ! ! 上記チェックが通れば, その gthist に結合. ! ファイルのみが一致し, それ以外が一致しない場合はエラーを返す. ! ファイル名が一致しない場合, 下記のように allocate を行い, ! リスト構造になっている ***_HISTLIST の要素を増やしてそちらから ! 作成済みの変数に結合する. if ( associated( history ) ) nullify( history ) allocate( history ) !----------------------------------------------------------------- ! 軸の名称の設定 ! Configure names of axes !----------------------------------------------------------------- xdim = 'lon' ydim = 'lat' zdim = 'sig' rdim = 'sigm' timedim = 'time' !----------------------------------------------------------------- ! HistoryCreate によるファイル作成 ! Files are created by "HistoryCreate" !----------------------------------------------------------------- call HistoryCreate( history = history, file = file, title = 'Aqua planet experiment', source = 'dcpam4 : ' // trim(version), institution = 'GFD Dennou Club', dims = StoA(xdim, ydim, zdim, rdim, timedim), dimsizes = (/phy_ape % imax, phy_ape % jmax, phy_ape % kmax, phy_ape % kmax + 1, 0/), longnames = StoA('longitude', 'latitude', 'sigma at layer midpoints', 'sigma at layer end-points (half level)', 'time'), units = StoA('degree_east', 'degree_north', '1', '1', hptr % history_interval_unit), origin = real(EvalbyUnit(phy_ape % current_time, hptr % history_interval_unit)), interval = real(EvalbyUnit(hptr % history_interval_time, hptr % history_interval_unit)) ) ! (in) call HistoryAddAttr( history = history, varname = xdim, attrname = 'standard_name', value = 'longitude' ) ! (in) call HistoryAddAttr( history = history, varname = ydim, attrname = 'standard_name', value = 'latitude' ) ! (in) call HistoryAddAttr( history = history, varname = 'sig', attrname = 'standard_name', value = 'atmosphere_sigma_coordinate' ) ! (in) call HistoryAddAttr( history = history, varname = 'sigm', attrname = 'standard_name', value = 'atmosphere_sigma_coordinate' ) ! (in) call HistoryAddAttr( history = history, varname = 'time', attrname = 'standard_name', value = 'time' ) ! (in) call HistoryAddAttr( history = history, varname = 'sig', attrname = 'positive', value = 'down' ) ! (in) call HistoryAddAttr( history = history, varname = 'sigm', attrname = 'positive', value = 'down' ) ! (in) call HistoryPut( history = history, varname = xdim, array = phy_ape % x_Lon / phy_ape % PI * 180.0_DP ) ! (in) call HistoryPut( history = history, varname = ydim, array = phy_ape % y_Lat / phy_ape % PI * 180.0_DP ) ! (in) call HistoryPut( history = history, varname = 'sig', array = phy_ape % z_Sigma ) ! (in) call HistoryPut( history = history, varname = 'sigm', array = phy_ape % r_Sigma ) ! (in) call HistoryAddVariable( history = history, varname = 'lon_weight', dims = StoA('lon'), longname = 'weight for integration in longitude', units = 'radian', xtype = 'double' ) ! (in) call HistoryAddAttr( history = history, varname = 'lon', attrname = 'gt_calc_weight', value = 'lon_weight' ) ! (in) call HistoryPut( history = history, varname = 'lon_weight', array = phy_ape % x_Lon_Weight ) ! (in) call HistoryAddVariable( history = history, varname = 'lat_weight', dims = StoA('lat'), longname = 'weight for integration in latitude', units = 'radian', xtype = 'double' ) ! (in) call HistoryAddAttr( history = history, varname = 'lat', attrname = 'gt_calc_weight', value = 'lat_weight' ) ! (in) call HistoryPut( history = history, varname = 'lat_weight', array = phy_ape % y_Lat_Weight ) ! (in) !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeHstSetXYZR  Function : result : logical phy_ape : type(PHYAPE), intent(in) phy_ape が初期設定されている場合には .true. が, 初期設定されていない場合には .false. が返ります. If phy_ape is initialized, .true. is returned. If phy_ape is not initialized, .false. is returned. [Source] logical function PhysApeInitialized( phy_ape ) result(result) ! ! *phy_ape* が初期設定されている場合には .true. が, ! 初期設定されていない場合には .false. が返ります. ! ! If *phy_ape* is initialized, .true. is returned. ! If *phy_ape* is not initialized, .false. is returned. ! implicit none type(PHYAPE), intent(in):: phy_ape continue result = phy_ape % initialized end function PhysApeInitialized Subroutine : nmlfile :character(*), intent(in)  : NAMELIST ファイルの名称. NAMELIST file name history_varlist_ :character(*), intent(inout) history_fileprefix_ :character(*), intent(inout) hist_nml(:) :type(PHYAPE_HISTNML), pointer  : (inout) NAMELIST#phy_ape_history_nml から入手される個別のデータ出力情報. この配列の 1 番目にはデフォルトの設定が格納 され, 2 番目以降に個別の設定が格納される. Individual data output information from "NAMELIST#phy_ape_history_nml". Default settings are stored in the first element of this array, and individual settings are stored in the second or more. err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. NAMELIST ファイル nmlfile から値を入力するための 内部サブルーチンです. Create 内で呼び出されることを 想定しています. 値が NAMELIST ファイル内で指定されていない場合には, 入力された値がそのまま返ります. なお, nmlfile に空文字が与えられた場合, または 与えられた nmlfile を読み込むことができない場合, プログラムはエラーを発生させます. This is an internal subroutine to input values from NAMELIST file nmlfile. This subroutine is expected to be called by "Create". A value not specified in NAMELIST file is returned without change. If nmlfile is empty, or nmlfile can not be read, error is occurred. This procedure input/output NAMELIST#phy_ape_varlist_nml, NAMELIST#phy_ape_history_nml . [Source] subroutine PhysApeNmlRead( nmlfile, history_varlist_, history_fileprefix_, hist_nml, err ) ! ! NAMELIST ファイル *nmlfile* から値を入力するための ! 内部サブルーチンです. Create 内で呼び出されることを ! 想定しています. ! ! 値が NAMELIST ファイル内で指定されていない場合には, ! 入力された値がそのまま返ります. ! ! なお, *nmlfile* に空文字が与えられた場合, または ! 与えられた *nmlfile* を読み込むことができない場合, ! プログラムはエラーを発生させます. ! ! This is an internal subroutine to input values from ! NAMELIST file *nmlfile*. This subroutine is expected to be ! called by "Create". ! ! A value not specified in NAMELIST file is returned ! without change. ! ! If *nmlfile* is empty, or *nmlfile* can not be read, ! error is occurred. ! use dc_trace, only: BeginSub, EndSub use dc_string, only: PutLine, Printf, Split, StrInclude, StoA, JoinChar use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_iounit, only: FileOpen use dc_message, only: MessageNotify use dc_present, only: present_and_true use dc_date, only: Create use dc_error, only: StoreError, DC_NOERR, DC_ENOFILEREAD, DC_ENOASSOC implicit none character(*), intent(in):: nmlfile ! NAMELIST ファイルの名称. ! NAMELIST file name character(*), intent(inout):: history_varlist_ character(STRING):: history_varlist ! ヒストリデータの出力変数リスト. ! カンマで区切って並べる. ! (例: "Data1,Data2" ). ! ! List of variables output to history data. ! Delimiter is comma. ! (exp. "Data1,Data2" ). ! character(*), intent(inout):: history_fileprefix_ character(STRING):: history_fileprefix ! ヒストリデータのファイル名の接頭詞. ! Prefix of history data filenames type(PHYAPE_HISTNML), pointer:: hist_nml(:) ! (inout) ! ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! この配列の 1 番目にはデフォルトの設定が格納 ! され, 2 番目以降に個別の設定が格納される. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml". ! Default settings are stored in ! the first element of this array, ! and individual settings are stored in ! the second or more. logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !!$    namelist /phy_ape_nml/ &
!!$& param_c !!$                              ! phy_ape モジュール用
!!$! NAMELIST 変数群名. !!$                              !
!!$! phy_ape#Create を使用する際に, !!$                              ! オプショナル引数 *nmlfile* へ NAMELIST
!!$! ファイル名を指定することで, そのファイルから !!$                              ! この NAMELIST 変数群を読み込みます.
!!$! !!$                              ! NAMELIST group name for
!!$! "phy_ape" module. !!$                              !
!!$! If a NAMELIST filename is specified to !!$                              ! an optional argument *nmlfile*
!!$! when "phy_ape#Create" is used, !!$                              ! this NAMELIST group is loaded from
!!$! the file. namelist /phy_ape_varlist_nml/ history_varlist ! phy_ape モジュールの ! ヒストリデータ出力リスト用 ! NAMELIST 変数群名. ! ! phy_ape#Create を使用する際に, ! オプショナル引数 *nmlfile* へ NAMELIST ! ファイル名を指定することで, そのファイルから ! この NAMELIST 変数群を読み込みます. ! ! NAMELIST group name for ! output list of history data of ! "phy_ape" module. ! ! If a NAMELIST filename is specified to ! an optional argument *nmlfile* ! when "phy_ape#Create" is used, ! this NAMELIST group is loaded from ! the file. character(TOKEN):: name ! 変数名. ! 空白の場合には, この他の設定値は ! phy_ape モジュールにおいて ! 出力されるデータ全ての ! デフォルト値となります. ! ! Variable name. ! If blank is given, other values are ! used as default values of output data ! in "phy_ape". character(STRING):: file ! 出力ファイル名. ! これはデフォルト値としては使用されません. ! *name* に値が設定されている時のみ有効です. ! ! Output file name. ! This is not used as default value. ! This value is valid only when *name* is ! specified. real(DP):: history_interval_value ! ヒストリデータの出力間隔の数値. ! Numerical value for interval of history data output character(TOKEN):: history_interval_unit ! ヒストリデータの出力間隔の単位. ! Unit for interval of history data output character(TOKEN):: history_precision ! ヒストリデータの精度. ! Precision of history data logical:: history_average ! 出力データの平均化フラグ. ! Flag for average of output data namelist /phy_ape_history_nml/ name, file, history_interval_value, history_interval_unit, history_precision, history_fileprefix, history_average ! phy_ape モジュールのヒストリデータ用 ! NAMELIST 変数群名. ! ! phy_ape#Create を使用する際に, ! オプショナル引数 *nmlfile* へ NAMELIST ! ファイル名を指定することで, そのファイルから ! この NAMELIST 変数群を読み込みます. ! ! NAMELIST group name for ! history data of "phy_ape" module. ! ! If a NAMELIST filename is specified to ! an optional argument *nmlfile* ! when "phy_ape#Create" is used, ! this NAMELIST group is loaded from ! the file. !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c integer:: unit_nml ! NAMELIST ファイルオープン用装置番号. ! Unit number for NAMELIST file open integer:: iostat_nml ! NAMELIST 読み込み時の IOSTAT. ! IOSTAT of NAMELIST read character(TOKEN):: pos_nml ! NAMELIST 読み込み時のファイル位置. ! File position of NAMELIST read integer:: hmax ! hist_nml(:) のサイズ. ! Size of "hist_nml(:)" type(PHYAPE_HISTNML), allocatable:: hist_nml_work(:) character(*), parameter:: subname = 'PhysApeNmlRead' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 割付状態の確認 ! Check allocation !----------------------------------------------------------------- if ( .not. associated( hist_nml ) ) then stat = DC_ENOASSOC cause_c = 'hist_nml' goto 999 end if if ( size( hist_nml ) < 1 ) then stat = DC_ENOASSOC cause_c = 'hist_nml' goto 999 end if !----------------------------------------------------------------- ! 文字型引数を NAMELIST 変数群へ代入 ! Substitute character arguments to NAMELIST group !----------------------------------------------------------------- history_varlist = history_varlist_ history_fileprefix = history_fileprefix_ !---------------------------------------------------------------- ! NAMELIST ファイルのオープン ! Open NAMELIST file !---------------------------------------------------------------- call FileOpen( unit = unit_nml, file = nmlfile, mode = 'r', err = err ) ! (out) if ( present_and_true(err) ) then stat = DC_ENOFILEREAD cause_c = nmlfile goto 999 end if !----------------------------------------------------------------- ! NAMELIST 変数群の取得 ! Get NAMELIST group !----------------------------------------------------------------- !------------------------- ! 係数などの取得 ! Get coefficients etc. !!$    rewind( unit_nml )
!!$read( unit = unit_nml, & ! (in) !!$      & nml = phy_ape_nml, iostat = iostat_nml ) ! (out)
!!$if ( iostat_nml == 0 ) then !!$      call MessageNotify( 'M', subname, &
!!$& 'NAMELIST group "%c" is loaded from "%c".', & !!$        & c1='phy_ape_nml', c2=trim(nmlfile) )
!!$write(STDOUT, nml = phy_ape_nml) !!$    else
!!$call MessageNotify( 'W', subname, & !!$        & 'NAMELIST group "%c" is not found in "%c" (iostat=%d).', &
!!$& c1='phy_ape_nml', c2=trim(nmlfile), & !!$        & i = (/iostat_nml/) )
!!$end if !!$
!!$rewind( unit_nml ) !------------------------- ! 出力変数リスト取得 ! Get list of output variables rewind( unit_nml ) read( unit = unit_nml, nml = phy_ape_varlist_nml, iostat = iostat_nml ) ! (out) if ( iostat_nml == 0 ) then call MessageNotify( 'M', subname, 'NAMELIST group "%c" is loaded from "%c".', c1='phy_ape_varlist_nml', c2=trim(nmlfile) ) write(STDOUT, nml = phy_ape_varlist_nml) else call MessageNotify( 'W', subname, 'NAMELIST group "%c" is not found in "%c" (iostat=%d).', c1='phy_ape_varlist_nml', c2=trim(nmlfile), i = (/iostat_nml/) ) end if !------------------------- ! 出力データの個別情報の取得 ! Get individual information of output data rewind( unit_nml ) iostat_nml = 0 pos_nml = '' do while ( trim(pos_nml) /= 'APPEND' .and. iostat_nml == 0 ) name = '' file = '' history_interval_value = hist_nml(1) % history_interval_value history_interval_unit = hist_nml(1) % history_interval_unit history_precision = hist_nml(1) % history_precision history_average = hist_nml(1) % history_average read( unit = unit_nml, nml = phy_ape_history_nml, iostat = iostat_nml ) ! (out) inquire( unit_nml, position = pos_nml ) ! (out) if ( iostat_nml == 0 ) then call MessageNotify( 'M', subname, 'NAMELIST group "%c" is loaded from "%c".', c1='phy_ape_history_nml', c2=trim(nmlfile) ) write(STDOUT, nml = phy_ape_history_nml) if ( name == '' ) then hist_nml(1) % name = name hist_nml(1) % file = '' hist_nml(1) % history_interval_value = history_interval_value hist_nml(1) % history_interval_unit = history_interval_unit hist_nml(1) % history_precision = history_precision hist_nml(1) % history_average = history_average call Create( diff = hist_nml(1) % history_interval_time, value = history_interval_value, unit = history_interval_unit ) ! (in) elseif ( file /= '' ) then hmax = size( hist_nml ) allocate( hist_nml_work(hmax) ) hist_nml_work = hist_nml deallocate( hist_nml ) allocate( hist_nml(hmax+1) ) hist_nml(1:hmax) = hist_nml_work deallocate( hist_nml_work ) if ( trim(history_varlist) /= '' ) history_varlist = trim( history_varlist ) // ',' history_varlist = trim( history_varlist ) // trim(name) hist_nml(hmax+1) % name = name hist_nml(hmax+1) % file = file hist_nml(hmax+1) % history_interval_value = history_interval_value hist_nml(hmax+1) % history_interval_unit = history_interval_unit hist_nml(hmax+1) % history_precision = history_precision hist_nml(hmax+1) % history_average = history_average call Create( diff = hist_nml(hmax+1) % history_interval_time, value = history_interval_value, unit = history_interval_unit ) ! (in) end if else call MessageNotify( 'W', subname, 'NAMELIST group "%c" is not found in "%c" any more (iostat=%d).', c1='phy_ape_history_nml', c2=trim(nmlfile), i = (/iostat_nml/) ) end if end do close( unit_nml ) !----------------------------------------------------------------- ! NAMELIST 変数群を文字型引数へ代入 ! Substitute NAMELIST group to character arguments !----------------------------------------------------------------- history_varlist_ = history_varlist history_fileprefix_ = history_fileprefix !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeNmlRead Subroutine : phy_ape :type(PHYAPE), intent(inout) xyz_U(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)  :$ u $. 東西風速. Zonal wind xyz_V(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)  :$ v $. 南北風速. Meridional wind xyz_Temp(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)  :$ T $. 温度. Temperature xy_Ps(0:phy_ape%imax-1, 0:phy_ape%jmax-1) :real(DP), intent(in)  :$ p_s $. 地表面気圧. Surface pressure xyz_QVap(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(in)  :$ q $. 比湿. Specific humidity xyz_DUDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)  :$ DP{u}{t} $. 東西風速変化. Zonal wind tendency xyz_DVDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)  :$ DP{v}{t} $. 南北風速変化. Meridional wind tendency xyz_DTempDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)  :$ DP{T}{t} $. 温度変化. Temperature tendency xyz_DQVapDt(0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) :real(DP), intent(out)  :$ DP{q}{t} $. 比湿変化. Temperature tendency historyput_flag :logical, intent(in), optional  : データ出力のフラグ. SetTime によって時刻を明示的に 指定した場合には, この引数に .true. または .false. を指定する ことでデータ出力のオンオフを 明示的に指定する必要があります. デフォルトは .false. です. Data output flag. When time is specified by "SetTime", explicit specification of data output on/off by specifying ".true." or ".false." to this argument. Default value is ".false.". err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. 放射や鉛直拡散など, いくつかの物理過程 を計算し, 与えられた風速, 温度, 地表面気圧, 比湿から, それぞれの変化量を返します. 詳細は phy_ape を参照してください. なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます. Some physical processes (radiation, vertical diffusion, etc) are calculated, and tendencies of velocity, temperature, surface pressure, specific humidity are returned. See "phy_ape" for detail. If phy_ape is not initialized by "Create" yet, error is occurred. [Source] subroutine PhysApePhysicsAPE( phy_ape, xyz_U, xyz_V, xyz_Temp, xy_Ps, xyz_QVap, xyz_DUDt, xyz_DVDt, xyz_DTempDt, xyz_DQVapDt, historyput_flag, err ) ! ! 放射や鉛直拡散など, いくつかの物理過程 ! を計算し, 与えられた風速, 温度, 地表面気圧, 比湿から, ! それぞれの変化量を返します. 詳細は phy_ape を参照してください. ! ! なお, 与えられた *phy_ape* が Create によって初期設定 ! されていない場合, プログラムはエラーを発生させます. ! ! Some physical processes (radiation, vertical diffusion, etc) ! are calculated, and tendencies of velocity, temperature, ! surface pressure, specific humidity are returned. ! See "phy_ape" for detail. ! ! If *phy_ape* is not initialized by "Create" yet, ! error is occurred. ! use phy_interpolate, only: InterpolateTemp, InterpolateGeoPot use phy_implicit, only: GetMatrices, Integrate use phy_radiation_flux, only: RadiationFlux, RadiationDTempDt use phy_verdiff, only: VerticalDiffusion use phy_surface_flux, only: SurfaceFlux use dc_trace, only: BeginSub, EndSub use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_present, only: present_and_true use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT use dc_string, only: PutLine, Split, StrInclude use dc_date, only: EvalSec, EvalByUnit, mod, operator(*), operator(==), operator(<), operator(/), operator(+), operator(-) use gt4_history, only: HistoryPut implicit none type(PHYAPE), intent(inout):: phy_ape real(DP), intent(in):: xyz_U (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ u $. 東西風速. Zonal wind real(DP), intent(in):: xyz_V (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ v $. 南北風速. Meridional wind real(DP), intent(in):: xyz_Temp (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ T $. 温度. Temperature real(DP), intent(in):: xy_Ps (0:phy_ape%imax-1, 0:phy_ape%jmax-1) !$ p_s $. 地表面気圧. Surface pressure real(DP), intent(in):: xyz_QVap (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ q $. 比湿. Specific humidity real(DP), intent(out):: xyz_DUDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \DP{u}{t} $. ! 東西風速変化. ! Zonal wind tendency real(DP), intent(out):: xyz_DVDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \DP{v}{t} $. ! 南北風速変化. ! Meridional wind tendency real(DP), intent(out):: xyz_DTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \DP{T}{t} $. ! 温度変化. ! Temperature tendency real(DP), intent(out):: xyz_DQVapDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \DP{q}{t} $. ! 比湿変化. ! Temperature tendency logical, intent(in), optional:: historyput_flag ! データ出力のフラグ. ! SetTime によって時刻を明示的に ! 指定した場合には, この引数に ! .true. または .false. を指定する ! ことでデータ出力のオンオフを ! 明示的に指定する必要があります. ! デフォルトは .false. です. ! ! Data output flag. ! When time is specified by "SetTime", ! explicit specification of data output ! on/off by specifying ".true." or ".false." ! to this argument. ! Default value is ".false.". ! logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! *phy_ape* から取り出される設定値 ! Setting values fetched from *phy_ape* integer:: kmax ! 鉛直層数. ! Number of vertical level real(DP):: DelTime !$ \Delta t $. タイムステップ. Time step !----------------------------------- ! 温度 (整数レベル) と地表面気圧から内挿されるデータ ! Data interpolated from temperature (full level) and surface pressure real(DP):: xyr_Temp (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) !$ T $. 温度 (半整数レベル). ! Temperature (half level) real(DP):: xyz_Press (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ p $. 気圧 (整数レベル). ! Air pressure (full level) real(DP):: xyr_Press (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) !$ p $. 気圧 (半整数レベル). ! Air pressure (half level) real(DP):: xyz_GeoPot (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \phi $. ジオポテンシャル (整数レベル). ! Geo-potential (full level) real(DP):: xyr_GeoPot (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) !$ \phi $. ジオポテンシャル (半整数レベル). ! Geo-potential (half level) !----------------------------------- ! 陰解配列 ! Implicit matrices real(DP):: xyza_UVMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1, -1:1) ! 速度陰解行列. ! Implicit matrix about velocity real(DP):: xyza_TempMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1, -1:phy_ape%kmax-1, -1:1) ! 温度陰解行列. ! Implicit matrix about temperature real(DP):: xyza_QVapMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1, -1:1) ! 比湿陰解行列. ! Implicit matrix about specific humidity !----------------------------------- ! 放射フラックスで計算される量 ! Values calculated by radiation flux real(DP):: xyr_RadLFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) ! 長波フラックス. ! Longwave flux real(DP):: xya_SurfRadLMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1, -1:1) !$ T $陰解行列: 地表. !$ T $implicit matrix: surface real(DP):: xyra_DelRadLFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax, 0:1) ! 長波地表温度変化. ! Surface temperature tendency with longwave real(DP):: xyr_RadSFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) ! 短波 (日射) フラックス. ! Shortwave (insolation) flux !----------------------------------- ! 鉛直拡散フラックスで計算される量 ! Values calculated by vertical diffusion flux real(DP):: xyr_UFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) ! 東西風速フラックス. ! Zonal wind flux real(DP):: xyr_VFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) ! 南北風速フラックス. ! Meridional wind flux real(DP):: xyr_TempFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) ! 温度フラックス. ! Temperature flux real(DP):: xyr_QVapFlux (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax) ! 比湿フラックス. ! Specific humidity flux !----------------------------------- ! 地表面フラックスで計算される量 ! Values calculated by surface flux real(DP):: xy_SurfUVMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1) ! 速度陰解行列: 地表. ! Implicit matrix about velocity: surface real(DP):: xyaa_SurfTempMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:1, -1:1) ! 温度陰解行列: 地表. ! Implicit matrix about temperature: surface real(DP):: xyaa_SurfQVapMatrix (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:1, -1:1) ! 比湿陰解行列: 地表. ! Implicit matrix about specific humidity: surface !----------------------------------- ! 温度変換率 ! Temperature tendency real(DP):: xyz_DRadLTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 長波加熱率. ! Temperature tendency with longwave real(DP):: xyz_DRadSTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) ! 短波加熱率. ! Temperature tendency with shortwave real(DP):: xyz_DTempDtWork (0:phy_ape%imax-1, 0:phy_ape%jmax-1, 0:phy_ape%kmax-1) !$ \DP{T}{t} $. ! 温度変化. (データ出力用) ! Temperature tendency (for data output) !----------------------------------- ! 時間変化率の計算 (陰解法) ! Calculate tendency (implicit) real(DP):: xy_DSurfTempDt (0:phy_ape%imax-1, 0:phy_ape%jmax-1) ! 地表面温度変化率. ! Surface temperature tendency !----------------------------------- ! ヒストリファイルへのデータ出力設定 ! Configure the settings for history data output character(TOKEN):: name ! 変数名. Variable name type(PHYAPE_HISTNML), pointer:: hptr =>null() ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" !----------------------------------- ! 作業変数 ! Work variables integer:: k ! DO ループ用作業変数 ! Work variables for DO loop integer:: stat character(STRING):: cause_c character(*), parameter:: subname = 'PhysApePhysicsAPE' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 初期設定のチェック ! Check initialization !----------------------------------------------------------------- if ( .not. phy_ape % initialized ) then stat = DC_ENOTINIT cause_c = 'PHYAPE' goto 999 end if !----------------------------------------------------------------- ! *phy_ape* に格納されている設定値の取り出し ! Fetch setting values stored in *phy_ape* !----------------------------------------------------------------- kmax = phy_ape % kmax DelTime = phy_ape % DelTime !----------------------------------------------------------------- ! 温度の半整数$ \sigma $レベルの補間, 気圧とジオポテンシャルの算出 (1) ! Interpolate temperature on half$ \sigma $level, and ! calculate pressure and geo-potential (1) !----------------------------------------------------------------- !----------------------------------- ! 温度の半整数$ \sigma $レベルの補間 ! Interpolate temperature on half$ \sigma $level call InterpolateTemp( phy_intpol = phy_ape % phy_intpol, xyz_Temp = xyz_Temp, xyr_Temp = xyr_Temp, err = err ) ! (out) !----------------------------------- ! 気圧とジオポテンシャルの算出 ! Calculate pressure and geo-potential call InterpolateGeoPot( phy_intpol = phy_ape % phy_intpol, xy_Ps = xy_Ps, xyz_Temp = xyz_Temp, xyr_Temp = xyr_Temp, xyz_Press = xyz_Press, xyr_Press = xyr_Press, xyz_GeoPot = xyz_GeoPot, xyr_GeoPot = xyr_GeoPot, err = err ) ! (out) !----------------------------------------------------------------- ! 陰解配列作成 ! Create implicit matrices !----------------------------------------------------------------- call GetMatrices( phy_impl = phy_ape % phy_impl, xyr_Press = xyr_Press, xyr_UFlux = xyr_UFlux, xyr_VFlux = xyr_VFlux, xyr_TempFlux = xyr_TempFlux, xyr_QVapFlux = xyr_QVapFlux, xyza_UVMatrix = xyza_UVMatrix, xyza_TempMatrix = xyza_TempMatrix, xyza_QVapMatrix = xyza_QVapMatrix, err = err ) ! (out) !----------------------------------------------------------------- ! 放射フラックス ! Radiation flux !----------------------------------------------------------------- call RadiationFlux( phy_radflx = phy_ape % phy_radflx, xyz_Temp = xyz_Temp, xyz_QVap = xyz_QVap, xyr_Press = xyr_Press, xyr_RadLFlux = xyr_RadLFlux, xya_SurfRadLMatrix = xya_SurfRadLMatrix, xyra_DelRadLFlux = xyra_DelRadLFlux, xyr_RadSFlux = xyr_RadSFlux, err = err ) ! (out) !----------------------------------------------------------------- ! 鉛直拡散フラックス ! Vertical diffusion flux !----------------------------------------------------------------- call VerticalDiffusion( phy_vdif = phy_ape % phy_vdif, xyz_U = xyz_U, xyz_V = xyz_V, xyz_Temp = xyz_Temp, xyr_Temp = xyr_Temp, xyz_QVap = xyz_QVap, xyz_Press = xyz_Press, xyr_Press = xyr_Press, xyz_GeoPot = xyz_GeoPot, xyr_GeoPot = xyr_GeoPot, xyr_UFlux = xyr_UFlux, xyr_VFlux = xyr_VFlux, xyr_TempFlux = xyr_TempFlux, xyr_QVapFlux = xyr_QVapFlux, xyza_UVMatrix = xyza_UVMatrix, xyza_TempMatrix = xyza_TempMatrix, xyza_QVapMatrix = xyza_QVapMatrix, err = err ) ! (out) !----------------------------------------------------------------- ! 地表面フラックス ! Surface flux !----------------------------------------------------------------- call SurfaceFlux( phy_surfflx = phy_ape % phy_surfflx, xyz_U = xyz_U, xyz_V = xyz_V, xyz_Temp = xyz_Temp, xyr_Temp = xyr_Temp, xyz_QVap = xyz_QVap, xyz_Press = xyz_Press, xyr_Press = xyr_Press, xyz_GeoPot = xyz_GeoPot, xyr_UFlux = xyr_UFlux, xyr_VFlux = xyr_VFlux, xyr_TempFlux = xyr_TempFlux, xyr_QVapFlux = xyr_QVapFlux, xy_SurfUVMatrix = xy_SurfUVMatrix, xyaa_SurfTempMatrix = xyaa_SurfTempMatrix, xyaa_SurfQVapMatrix = xyaa_SurfQVapMatrix, err = err ) ! (out) !----------------------------------------------------------------- ! 時間変化率の計算 (陰解法) ! Calculate tendency (implicit) !----------------------------------------------------------------- call Integrate( phy_impl = phy_ape % phy_impl, xyr_UFlux = xyr_UFlux, xyr_VFlux = xyr_VFlux, xyr_TempFlux = xyr_TempFlux, xy_SurfRadSFlux = xyr_RadSFlux(:,:,0), xy_SurfRadLFlux = xyr_RadLFlux(:,:,0), xyr_QVapFlux = xyr_QVapFlux, xyza_UVMatrix = xyza_UVMatrix, xyza_TempMatrix = xyza_TempMatrix, xyza_QVapMatrix = xyza_QVapMatrix, xy_SurfUVMatrix = xy_SurfUVMatrix, xyaa_SurfTempMatrix = xyaa_SurfTempMatrix, xyaa_SurfQVapMatrix = xyaa_SurfQVapMatrix, xya_SurfRadLMatrix = xya_SurfRadLMatrix, xyz_DVerdiffUDt = xyz_DUDt, xyz_DVerdiffVDt = xyz_DVDt, xyz_DVerdiffTempDt = xyz_DTempDt, xy_DVerdiffSurfTempDt = xy_DSurfTempDt, xyz_DVerdiffQVapDt = xyz_DQVapDt, err = err ) ! (out) !----------------------------------------------------------------- ! 運動量, 温度, 比湿フラックス補正 ! Fluxes of momentum, temperature, specifid humidity correction !----------------------------------------------------------------- ! ※ dcpam3 最新版から導入予定 !!$    call FluxCorrection( phy_impl = phy_ape % phy_impl, &  ! (inout)
!!$& xyz_DVerdiffUDt = xyz_DUDt, & ! (in) !!$      & xyz_DVerdiffVDt = xyz_DVDt, &               ! (in)
!!$& xyz_DVerdiffTempDt = xyz_DTempDt, & ! (in) !!$      & xy_DVerdiffSurfTempDt = xy_DSurfTempDt, & ! (in)
!!$& xyz_DVerdiffQVapDt = xyz_DQVapDt, & ! (in) !!$      & xyza_UVMatrix = xyza_UVMatrix, &                   ! (in)
!!$& xyza_TempMatrix = xyza_TempMatrix, & ! (in) !!$      & xyza_QVapMatrix = xyza_QVapMatrix, &               ! (in)
!!$& xy_SurfUVMatrix = xy_SurfUVMatrix, & ! (in) !!$      & xyaa_SurfTempMatrix = xyaa_SurfTempMatrix, &       ! (in)
!!$& xyaa_SurfQVapMatrix = xyaa_SurfQVapMatrix, & ! (in) !!$      & xyr_UFlux = xyr_UFlux, xyr_VFlux = xyr_VFlux, &    ! (inout)
!!$& xyr_TempFlux = xyr_TempFlux, & ! (inout) !!$      & xyr_QVapFlux = xyr_QVapFlux )                      ! (inout)

!-----------------------------------------------------------------
!  放射フラックス補正
!  Radiation flux correction
!-----------------------------------------------------------------
do k = 0, kmax
xyr_RadLFlux(:,:,k) = xyr_RadLFlux(:,:,k) + (   xy_DSurfTempDt * xyra_DelRadLFlux(:,:,k,0) + xyz_DTempDt(:,:,1) * xyra_DelRadLFlux(:,:,k,1) ) * 2.0_DP * DelTime
end do

!-----------------------------------------------------------------
!  放射による温度変化率
!  Temperature tendency with radiation
!-----------------------------------------------------------------

!-----------------------------------------------------------------
!  重力波抵抗
!  Gravity wave drag
!-----------------------------------------------------------------
!  ※ AGCM5 最新版から導入予定.

!-----------------------------------------------------------------
!  温度変化率へ放射による加熱率を追加
!  Radiation heating is added to temperature tendency
!-----------------------------------------------------------------
xyz_DTempDtWork = xyz_DTempDt
xyz_DTempDt = xyz_DTempDt + xyz_DRadLTempDt + xyz_DRadSTempDt

!-----------------------------------------------------------------
!  温度変化分の足し込み
!  Add temperature tendency
!-----------------------------------------------------------------
!!$xyz_Temp = xyz_Temp & !!$      &        + ( xyz_DRadLTempDt + xyz_DRadSTempDt ) * 2.0_DP * DelTime
!!$!!$    xyz_Temp =   xyz_Temp &
!!$& + ( xyz_DTempDt ) * 2.0_DP * DelTime !!$
!!$xyz_QVap = xyz_QVap & !!$      &        + ( xyz_DQVapDt ) * 2.0_DP * DelTime
!!$!!$    xyz_U =   xyz_U &
!!$& + ( xyz_DUDt ) * 2.0_DP * DelTime !!$
!!$xyz_V = xyz_V & !!$      &     + ( xyz_DVDt ) * 2.0_DP * DelTime

!!$! ※ 未導入. (モジュール化されていない??) !!$    call physics_integrate_surftemp( &
!!$& xy_SurfTemp, xyr_RadLFlux, xyra_DelRadLFlux, & !(inout) !!$      &  xy_DSurfTempDt, DelTime & !(in)
!!$& ) !---------------------------------------------------------------- ! ヒストリファイルへのデータ出力 ! History data output !---------------------------------------------------------------- !------------------------- ! xyr_UFlux の出力 ! Output "xyr_UFlux" name = 'SurfStressX' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_surfstressx, varname = name, array = xyr_UFlux, quiet = .false. ) ! (in) end if !------------------------- ! xyr_VFlux の出力 ! Output "xyr_VFlux" name = 'SurfStressY' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_surfstressy, varname = name, array = xyr_VFlux, quiet = .false. ) ! (in) end if !------------------------- ! xyr_TempFlux の出力 ! Output "xyr_TempFlux" name = 'SensHeatFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_sensheatflux, varname = name, array = xyr_TempFlux, quiet = .false. ) ! (in) end if !------------------------- ! xyr_QVapFlux の出力 ! Output "xyr_QVapFlux" name = 'LatentHeatFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_latentheatflux, varname = name, array = xyr_QVapFlux, quiet = .false. ) ! (in) end if !------------------------- ! xyr_RadLFlux の出力 ! Output "xyr_RadLFlux" name = 'RadLFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_radlflux, varname = name, array = xyr_RadLFlux, quiet = .false. ) ! (in) end if !------------------------- ! xyr_RadSFlux の出力 ! Output "xyr_RadSFlux" name = 'RadSFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_radsflux, varname = name, array = xyr_RadSFlux, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DRadLTempDt の出力 ! Output "xyz_DRadLTempDt" name = 'DRadLTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dradltempdt, varname = name, array = xyz_DRadLTempDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DRadSTempDt の出力 ! Output "xyz_DRadSTempDt" name = 'DRadSTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dradstempdt, varname = name, array = xyz_DRadSTempDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DUDt の出力 ! Output "xyz_DUDt" name = 'DUDtAPE' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dverdiffudt, varname = name, array = xyz_DUDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DVDt の出力 ! Output "xyz_DVDt" name = 'DVDtAPE' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dverdiffvdt, varname = name, array = xyz_DVDt, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DTempDt の出力 ! Output "xyz_DTempDt" name = 'DTempDtAPE' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dverdifftempdt, varname = name, array = xyz_DTempDtWork, quiet = .false. ) ! (in) end if !------------------------- ! xyz_DQVapDt の出力 ! Output "xyz_DQVapDt" name = 'DQVapDtAPE' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) .and. ( present_and_true( historyput_flag ) .or. hptr % history_interval_value > 0.0_DP .and. mod( phy_ape % current_time, hptr % history_interval_time) == 0 ) ) then call HistoryPut( history = phy_ape % gthist_dverdiffqvapdt, varname = name, array = xyz_DQVapDt, quiet = .false. ) ! (in) end if !----------------------------------------------------------------- ! 時刻の更新は Adjust にておこなう ! "Adjust" updates time !----------------------------------------------------------------- !!$    phy_ape % current_time = &
!!$& phy_ape % current_time + phy_ape % delta_time !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApePhysicsAPE Subroutine : phy_ape :type(PHYAPE), intent(in) unit :integer, intent(in), optional  : 出力先の装置番号. デフォルトの出力先は標準出力. Unit number for output. Default value is standard output. indent :character(*), intent(in), optional  : 表示されるメッセージの字下げ. Indent of displayed messages. err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. 引数 phy_ape に設定されている情報を印字します. デフォルトではメッセージは標準出力に出力されます. unit に装置番号を指定することで, 出力先を変更することが可能です. Print information of phy_ape. By default messages are output to standard output. Unit number for output can be changed by unit argument. [Source] subroutine PhysApePutLine( phy_ape, unit, indent, err ) ! ! 引数 *phy_ape* に設定されている情報を印字します. ! デフォルトではメッセージは標準出力に出力されます. ! *unit* に装置番号を指定することで, 出力先を変更することが可能です. ! ! Print information of *phy_ape*. ! By default messages are output to standard output. ! Unit number for output can be changed by *unit* argument. ! use phy_ground, only: PutLine use phy_interpolate, only: PutLine use phy_neg_moist, only: PutLine use phy_cumulus_adjust, only: PutLine use phy_lscond, only: PutLine use phy_implicit, only: PutLine use phy_radiation_flux, only: PhyRadFluxPutLine use phy_verdiff, only: PutLine use phy_surface_flux, only: PutLine use phy_dryconv_adjust, only: PutLine use dc_trace, only: BeginSub, EndSub use dc_string, only: PutLine, Printf, Split, StrInclude, StoA, JoinChar use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT use dc_string, only: Printf, PutLine implicit none type(PHYAPE), intent(in):: phy_ape integer, intent(in), optional:: unit ! 出力先の装置番号. ! デフォルトの出力先は標準出力. ! ! Unit number for output. ! Default value is standard output. character(*), intent(in), optional:: indent ! 表示されるメッセージの字下げ. ! ! Indent of displayed messages. logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c integer:: out_unit integer:: indent_len character(STRING):: indent_str integer:: hmax ! hist_nml(:) のサイズ. ! Size of "hist_nml(:)" integer:: i ! DO ループ用作業変数 ! Work variables for DO loop character(*), parameter:: subname = 'PhysApePutLine' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 初期設定のチェック ! Check initialization !----------------------------------------------------------------- if ( present(unit) ) then out_unit = unit else out_unit = STDOUT end if indent_len = 0 indent_str = '' if ( present(indent) ) then if ( len(indent) /= 0 ) then indent_len = len(indent) indent_str(1:indent_len) = indent end if end if !----------------------------------------------------------------- ! "PHYAPE" の設定の印字 ! Print the settings for "PHYAPE" !----------------------------------------------------------------- if ( phy_ape % initialized ) then call Printf( out_unit, indent_str(1:indent_len) // '#<PHYAPE:: @initialized=%y', l = (/phy_ape % initialized/) ) call Printf( out_unit, indent_str(1:indent_len) // ' @imax=%d @jmax=%d @kmax=%d', i = (/phy_ape % imax, phy_ape % jmax, phy_ape % kmax/) ) call Printf( out_unit, indent_str(1:indent_len) // ' @PI=%f @DelTime=%f', d = (/phy_ape % PI, phy_ape % DelTime/) ) call PutLine( phy_ape % x_Lon, unit = out_unit, lbounds = lbound(phy_ape % x_Lon), ubounds = ubound(phy_ape % x_Lon), indent = indent_str(1:indent_len) // ' @x_Lon=' ) call PutLine( phy_ape % x_Lon_Weight, unit = out_unit, lbounds = lbound(phy_ape % x_Lon_Weight), ubounds = ubound(phy_ape % x_Lon_Weight), indent = indent_str(1:indent_len) // ' @x_Lon_Weight=' ) call PutLine( phy_ape % y_Lat, unit = out_unit, lbounds = lbound(phy_ape % y_Lat), ubounds = ubound(phy_ape % y_Lat), indent = indent_str(1:indent_len) // ' @y_Lat=' ) call PutLine( phy_ape % y_Lat_Weight, unit = out_unit, lbounds = lbound(phy_ape % y_Lat_Weight), ubounds = ubound(phy_ape % y_Lat_Weight), indent = indent_str(1:indent_len) // ' @y_Lat_Weight=' ) call PutLine( phy_ape % z_Sigma, unit = out_unit, lbounds = lbound(phy_ape % z_Sigma), ubounds = ubound(phy_ape % z_Sigma), indent = indent_str(1:indent_len) // ' @z_Sigma=' ) call PutLine( phy_ape % r_Sigma, unit = out_unit, lbounds = lbound(phy_ape % r_Sigma), ubounds = ubound(phy_ape % r_Sigma), indent = indent_str(1:indent_len) // ' @r_Sigma=' ) call Printf( out_unit, indent_str(1:indent_len) // ' @history_varlist=%c', c1 = trim( JoinChar(phy_ape % history_varlist_array, ',') ) ) call Printf( out_unit, indent_str(1:indent_len) // ' @history_fileprefix=%c', c1 = trim(phy_ape % history_fileprefix) ) hmax = size( phy_ape % hist_nml ) do i = 1, hmax call Printf( out_unit, indent_str(1:indent_len) // ' #<PHYAPE_HISTNML:: @name=%c @file=%c', c1 = trim(phy_ape % hist_nml(i) % name), c2 = trim(phy_ape % hist_nml(i) % file) ) call Printf( out_unit, indent_str(1:indent_len) // ' @history_interval_value=%f @history_interval_unit=%c', d = (/phy_ape % hist_nml(i) % history_interval_value/), c1 = trim(phy_ape % hist_nml(i) % history_interval_unit) ) call Printf( out_unit, indent_str(1:indent_len) // ' @history_precision=%c @history_average=%c', c1 = trim(phy_ape % hist_nml(i) % history_precision), l = (/ phy_ape % hist_nml(i) % history_average /) ) end do call PutLine( phy_ape % phy_grd, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_intpol, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_neg_mst, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_cumad, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_lsc, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_impl, out_unit, indent_str(1:indent_len) // ' ', err ) call PhyRadFluxPutLine( phy_ape % phy_radflx, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_vdif, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_surfflx, out_unit, indent_str(1:indent_len) // ' ', err ) call PutLine( phy_ape % phy_dryconv, out_unit, indent_str(1:indent_len) // ' ', err ) call Printf( out_unit, indent_str(1:indent_len) // '>' ) else call Printf( out_unit, indent_str(1:indent_len) // '#<PHYAPE:: @initialized=%y>', l = (/phy_ape % initialized/) ) end if !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApePutLine Subroutine : phy_ape :type(PHYAPE), intent(inout) current_time_value :real(DP), intent(in)  : 現在時刻の数値. Numerical value of current time current_time_unit :character(*), intent(in)  : 現在時刻の単位. Unit of current time err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. phy_ape に対して時刻の設定を行います. ヒストリデータの 出力時刻も設定します. 一度でもこのサブルーチンを呼んだ場合には, それ以後のヒストリデータ出力前にこのサブルーチンを呼び出し, 時刻の設定を行ってください. また, データを出力するサブルーチンに対しても オプショナル引数 historyput_flag に .true. を与えてください. なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます. Set time to phy_ape. The output time of history data are specified. Once this subroutine is called, the time of history data must be specified by this routine before history data output. In additional, give ".true." to an optional argument "historyput_flag" of a data output subroutine. If phy_ape is not initialized by "Create" yet, error is occurred. [Source] subroutine PhysApeSetTime( phy_ape, current_time_value, current_time_unit, err ) ! ! *phy_ape* に対して時刻の設定を行います. ! ! ヒストリデータの ! 出力時刻も設定します. 一度でもこのサブルーチンを呼んだ場合には, ! それ以後のヒストリデータ出力前にこのサブルーチンを呼び出し, ! 時刻の設定を行ってください. ! また, データを出力するサブルーチンに対しても ! オプショナル引数 historyput_flag に .true. を与えてください. ! ! なお, 与えられた *phy_ape* が Create によって初期設定 ! されていない場合, プログラムはエラーを発生させます. ! ! Set time to *phy_ape*. ! ! The output time of history data are specified. ! Once this subroutine is called, the time of history data must be ! specified by this routine before history data output. ! In additional, give ".true." to an optional argument ! "historyput_flag" of a data output subroutine. ! ! If *phy_ape* is not initialized by "Create" yet, ! error is occurred. ! use dc_trace, only: BeginSub, EndSub use dc_string, only: PutLine, Printf, Split, StrInclude, StoA, JoinChar use dc_types, only: DP, STRING, TOKEN, STDOUT use dc_date, only: Create, EvalbyUnit use dc_error, only: StoreError, DC_NOERR, DC_ENOTINIT use gt4_history, only: HistorySetTime implicit none type(PHYAPE), intent(inout):: phy_ape real(DP), intent(in):: current_time_value ! 現在時刻の数値. Numerical value of current time character(*), intent(in):: current_time_unit ! 現在時刻の単位. Unit of current time logical, intent(out), optional:: err ! 例外処理用フラグ. ! デフォルトでは, この手続き内でエラーが ! 生じた場合, プログラムは強制終了します. ! 引数 *err* が与えられる場合, ! プログラムは強制終了せず, 代わりに ! *err* に .true. が代入されます. ! ! Exception handling flag. ! By default, when error occur in ! this procedure, the program aborts. ! If this *err* argument is given, ! .true. is substituted to *err* and ! the program does not abort. !----------------------------------- ! ヒストリファイルへのデータ出力設定 ! Configure the settings for history data output character(TOKEN):: name ! 変数名. Variable name type(PHYAPE_HISTNML), pointer:: hptr =>null() ! NAMELIST#phy_ape_history_nml ! から入手される個別のデータ出力情報. ! ! Individual data output information from ! "NAMELIST#phy_ape_history_nml" !----------------------------------- ! 作業変数 ! Work variables integer:: stat character(STRING):: cause_c integer:: hmax ! hist_nml(:) のサイズ. ! Size of "hist_nml(:)" integer:: i ! DO ループ用作業変数 ! Work variables for DO loop character(*), parameter:: subname = 'PhysApeSetTime' continue call BeginSub( subname ) stat = DC_NOERR cause_c = '' !----------------------------------------------------------------- ! 初期設定のチェック ! Check initialization !----------------------------------------------------------------- if ( .not. phy_ape % initialized ) then stat = DC_ENOTINIT cause_c = 'PHYAPE' goto 999 end if !----------------------------------------------------------------- ! 時刻設定 ! Configure time !----------------------------------------------------------------- call Create( diff = phy_ape % current_time, value = current_time_value, unit = current_time_unit ) ! (in) !----------------------------------------------------------------- ! ヒストリファイルへのデータの時刻設定 ! Configure the time of history data !----------------------------------------------------------------- hmax = size( phy_ape % hist_nml ) do i = 1, hmax phy_ape % hist_nml(i) % history_interval_value = - 1.0_DP call Create( diff = phy_ape % hist_nml(i) % history_interval_time, value = phy_ape % hist_nml(i) % history_interval_value, unit = phy_ape % hist_nml(i) % history_interval_unit ) ! (in) end do !------------------------- ! xyr_UFlux の時刻設定 ! Configure the time of "xyr_UFlux" name = 'SurfStressX' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_surfstressx, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyr_VFlux の時刻設定 ! Configure the time of "xyr_VFlux" name = 'SurfStressY' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_surfstressy, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyr_TempFlux の時刻設定 ! Configure the time of "xyr_TempFlux" name = 'SensHeatFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_sensheatflux, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyr_QVapFlux の時刻設定 ! Configure the time of "xyr_QVapFlux" name = 'LatentHeatFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_latentheatflux, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xy_LscRain + xy_CumulusRain の時刻設定 ! Configure the time of "xy_LscRain + xy_CumulusRain" name = 'Rain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_rain, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xy_CumulusRain の時刻設定 ! Configure the time of "xy_CumulusRain" name = 'CumulusRain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_cumrain, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xy_LscRain の時刻設定 ! Configure the time of "xy_LscRain" name = 'LscRain' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_lscrain, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyr_RadLFlux の時刻設定 ! Configure the time of "xyr_RadLFlux" name = 'RadLFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_radlflux, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyr_RadSFlux の時刻設定 ! Configure the time of "xyr_RadSFlux" name = 'RadSFlux' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_radsflux, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DNegQVap1Dt, xyz_DNegQVap2Dt の時刻設定 ! Configure the time of "xyz_DNegQVap1Dt", "xyz_DNegQVap2Dt" name = 'DNegQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dnegqvapdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DLscTempDt の時刻設定 ! Configure the time of "xyz_DLscTempDt" name = 'DLscTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dlsctempdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DLscQVapDt の時刻設定 ! Configure the time of "xyz_DLscQVapDt" name = 'DLscQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dlscqvapdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DCumulusTempDt の時刻設定 ! Configure the time of "xyz_DCumulusTempDt" name = 'DCumulusTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dcumtempdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DCumulusQVapDt の時刻設定 ! Configure the time of "xyz_DCumulusQVapDt" name = 'DCumulusQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dcumqvapdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DDryTempDt の時刻設定 ! Configure the time of "xyz_DDryTempDt" name = 'DDryTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_ddrytempdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xy_DPsDt の時刻設定 ! Configure the time of "xy_DPsDt" name = 'DPsDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dpsdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DRadLTempDt の時刻設定 ! Configure the time of "xyz_DRadLTempDt" name = 'DRadLTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dradltempdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DRadSTempDt の時刻設定 ! Configure the time of "xyz_DRadSTempDt" name = 'DRadSTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dradstempdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DVerdiffUDt の時刻設定 ! Configure the time of "xyz_DVerdiffUDt" name = 'DVerdiffUDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dverdiffudt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DVerdiffVDt の時刻設定 ! Configure the time of "xyz_DVerdiffVDt" name = 'DVerdiffVDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dverdiffvdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DVerdiffTempDt の時刻設定 ! Configure the time of "xyz_DVerdiffTempDt" name = 'DVerdiffTempDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dverdifftempdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !------------------------- ! xyz_DVerdiffQVapDt の時刻設定 ! Configure the time of "xyz_DVerdiffQVapDt" name = 'DVerdiffQVapDt' call HstNmlAssoc( hist_nml = phy_ape % hist_nml, name = name, hptr = hptr ) ! (out) if ( StrInclude( phy_ape % history_varlist_array, name ) ) then call HistorySetTime( history = phy_ape % gthist_dverdiffqvapdt, time = real( EvalbyUnit( phy_ape % current_time, hptr % history_interval_unit) ) ) ! (in) end if !----------------------------------------------------------------- ! 終了処理, 例外処理 ! Termination and Exception handling !----------------------------------------------------------------- 999 continue call StoreError( stat, subname, err, cause_c ) call EndSub( subname ) end subroutine PhysApeSetTime SetTime( phy_ape, current_time_value, current_time_unit, [err] ) Subroutine : phy_ape :type(PHYAPE), intent(inout) current_time_value :real(DP), intent(in)  : 現在時刻の数値. Numerical value of current time current_time_unit :character(*), intent(in)  : 現在時刻の単位. Unit of current time err :logical, intent(out), optional  : 例外処理用フラグ. デフォルトでは, この手続き内でエラーが 生じた場合, プログラムは強制終了します. 引数 err が与えられる場合, プログラムは強制終了せず, 代わりに err に .true. が代入されます. Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. phy_ape に対して時刻の設定を行います. ヒストリデータの 出力時刻も設定します. 一度でもこのサブルーチンを呼んだ場合には, それ以後のヒストリデータ出力前にこのサブルーチンを呼び出し, 時刻の設定を行ってください. また, データを出力するサブルーチンに対しても オプショナル引数 historyput_flag に .true. を与えてください. なお, 与えられた phy_apeCreate によって初期設定 されていない場合, プログラムはエラーを発生させます. Set time to phy_ape. The output time of history data are specified. Once this subroutine is called, the time of history data must be specified by this routine before history data output. In additional, give ".true." to an optional argument "historyput_flag" of a data output subroutine. If phy_ape is not initialized by "Create" yet, error is occurred. Alias for PhysApeSetTime version  Constant : version = ’$Name: dcpam4-20080626 $’ // ’$Id: phy_ape.f90,v 1.33 2008-06-14 11:44:16 morikawa Exp \$’ : character(*), parameter